Bug 87749

Summary: different IMethodBindings of generic method have equal getKey()
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch
none
Regression test none

Description Markus Keller CLA 2005-03-11 06:01:46 EST
I20050308-1510

The three occurrences of method sort(..) below all have different
IMethodBindings, but share the same key:
Lxy/Try;.sort<T::Ljava/lang/Comparable<-TT;>;>(Ljava/util/List<TT;>;)V

public class Try {
    public static <T extends Comparable<? super T>> void sort(List<T> list) {
        
    }
    /**
     * @see #sort(List)
     */
    void binarySearch() {
        sort(new ArrayList());
    }
}

The declaration (generic method) and the code reference (raw method) should
definitely have different keys.

For the code reference and the javadoc reference, I think the keys should be
equal, but the IMethodBindings should be identical.
Comment 1 Jerome Lanneluc CLA 2005-05-12 16:55:44 EDT
Created attachment 21068 [details]
Proposed patch

Changed ParameterizedGenericMethodBinding#computeUniqueKey(...) to add empty
arguments (%<>) at the end of the key if it is a raw method.
Adapted BindingKeyParser and BindingKeyResolver to this new format.
Comment 2 Jerome Lanneluc CLA 2005-05-12 16:56:56 EDT
Created attachment 21069 [details]
Regression test

Added regression test BatchASTCreationTests#test063()
Comment 3 Jerome Lanneluc CLA 2005-05-15 06:26:24 EDT
Released fix and regression test
Comment 4 David Audel CLA 2005-05-27 04:57:28 EDT
Verified in i20050527-0010