Community
Participate
Working Groups
public class Foo { public Foo() { } public static void main(String[] args) { Foo l = new Foo(); StringBuffer sb = new StringBuffer(); sb.append(l); } } with "Compiler compliance level: 5.0" and "Source Compatibility: 1.4" is fine with 3.1.2, but 3.2 gives me the error: The method append(Object) is ambiguous for the type StringBuffer JVM 1.5.0_06-b05
Cannot reproduce in latest 3.2. Added LookupTest#test068
Is that the same as eclipse-SDK-I20060428-0010? I just installed it in a virgin directory and with a virgin workspace I still see the same problem.
Reproduced with latest. Kent, any idea?
Philippe - have a fix for this. When compliance is >= 5.0 but source is less, we should not 'see' bridge methods.
+1 for 3.2RC3. Jeff - pls cast your vote. This is a scenario where 1.5 JRE is used with 1.4 source level... Kent - pls attach your patch. You need to wait until second vote got casted to get clearance.
BTW - I did miss the -source 1.4 in my testcase (LookupTest#test068). I tuned the test, and indeed reproduced the issue. Kent - pls reenable the test once the fix is made available.
This is related to the fix for bug 124943
Other related bugs are bug 81535 and bug 128560
no patch attached. Can't tell how widespread the change is.
Kent - pls attach the patch asap (hoping bugzilla doesn't go down again)
Created attachment 40062 [details] Patch The simple fix didn't work for all the cases from the related bugs. Instead we needed to remove the change to BinaryTypeBinding for bug 124943, which became unnecessary with the changes to mostSpecificMethod from last month. Then we needed to allow compatible (but not equal) return types in inherited methods from binary types, when the source level < 1.5 but the compliance >= 1.5. Without this change, we think a method does not override the other because of compatible, but not equal return types (allowed in 1.5, but not 1.4). Patch is attached. It looks bigger than it is because we moved a method up from MethodVerifier15.
+1 looks like fun
Enabled LookupTest#test068
Verified using N20060503-0010 for 3.2RC3
Double-checked using N20040504-0010 + JDT/Core v_663