Bug 166077

Summary: [compiler] extraneous tests in Scope#findExactMethod
Product: [Eclipse Project] JDT Reporter: Maxime Daniel <maxime_daniel>
Component: CoreAssignee: Maxime Daniel <maxime_daniel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.3   
Target Milestone: 3.3 M4   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Fix none

Description Maxime Daniel CLA 2006-11-28 11:40:08 EST
Source version v_725.

The following extract shows that the second test against Binding.NO_TYPE_VARIABLES is extraneous, assuming that we are exempt from multi-threading side effects.

public MethodBinding findExactMethod(
...
  MethodBinding exactMethod = ...
  if (exactMethod != null && exactMethod.typeVariables == Binding.NO_TYPE_VARIABLES && !exactMethod.isBridge()) {
...
    if (exactMethod.typeVariables != Binding.NO_TYPE_VARIABLES || invocationSite.genericTypeArguments() != null) {
      ...
    }
  return null;
}

A variant happens within the block.

I believe that this is a consequence of a constants rationalization effort that replaced a code in which tests yielding the same results looked different. Now they are clearly redundant.

This is a follow-up on bug 164094 that pointed that code area out for another reason.
Comment 1 Maxime Daniel CLA 2006-11-30 03:56:40 EST
It is in Scope#findExactMethod indeed.
Comment 2 Maxime Daniel CLA 2006-11-30 06:20:00 EST
Created attachment 54769 [details]
Fix
Comment 3 Maxime Daniel CLA 2006-11-30 06:23:08 EST
Released for 3.3 M4.
Comment 4 Olivier Thomann CLA 2006-12-11 15:33:51 EST
Verified for 3.3M4 with I20061211-1119