Bug 106090

Summary: [generics] Method invocation resolution depends on declaration order
Product: [Eclipse Project] JDT Reporter: Alex Hudspith <alexh.public+ecl>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: bmiller, mlists, philippe_mulet
Version: 3.1   
Target Milestone: 3.2 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Source for MethodsAB and MethodsBA none

Description Alex Hudspith CLA 2005-08-04 15:42:10 EDT
The two attached classes MethodsAB and MethodsBA are identical except for the
ordering of the two overloadings of 'method'. Compiling and running these in
Eclipse gives different results for each. MethodsAB outputs "Method A" whereas
MethodsBA outputs "Method B". Sun's javac 1.5.0_04 generates code that outputs
"Method B" for both.

I couldn't say for certain which method should be called (which is "most
specific" in the sense of JLS3 15.12.2.5?), but the result should at least be
the same in each case.
Comment 1 Alex Hudspith CLA 2005-08-04 15:44:29 EDT
Created attachment 25708 [details]
Source for MethodsAB and MethodsBA

Source attached.
Comment 2 Kent Johnson CLA 2005-09-19 15:42:43 EDT
Will be fixed when we take care of tieBreak methods as described in bug 100869
Comment 3 Philipe Mulet CLA 2005-09-23 06:18:44 EDT
Fix will not be ready for 3.1.1, removing target milestone "3.1.1"
Comment 4 Philipe Mulet CLA 2006-03-03 12:09:47 EST
Kent - using HEAD we complain about ambiguities in both cases.
Comment 5 Kent Johnson CLA 2006-03-28 10:45:30 EST
Finally fixed.

Added AmbiguousMethodTest test011
Comment 6 Frederic Fusier CLA 2006-03-29 05:32:43 EST
Verified for 3.2 M6 using build I20060329-0010.