Bug 87749 - different IMethodBindings of generic method have equal getKey()
Summary: different IMethodBindings of generic method have equal getKey()
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-11 06:01 EST by Markus Keller CLA
Modified: 2005-05-27 04:57 EDT (History)
0 users

See Also:


Attachments
Proposed patch (4.21 KB, patch)
2005-05-12 16:55 EDT, Jerome Lanneluc CLA
no flags Details | Diff
Regression test (1.70 KB, patch)
2005-05-12 16:56 EDT, Jerome Lanneluc CLA
no flags Details | Diff

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