Bug 166077 - [compiler] extraneous tests in Scope#findExactMethod
Summary: [compiler] extraneous tests in Scope#findExactMethod
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.3 M4   Edit
Assignee: Maxime Daniel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-28 11:40 EST by Maxime Daniel CLA
Modified: 2006-12-11 15:33 EST (History)
0 users

See Also:


Attachments
Fix (1.51 KB, patch)
2006-11-30 06:20 EST, Maxime Daniel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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