Community
Participate
Working Groups
HEAD After the fix for bug 317719, ECJ in compliance 1.6 compiles both of these interface J { <T extends Number> T foo(final Number p); Float foo(final Number p); } -------------------------------------------------- class X { <N extends B> N a(A<Number> s) { return null; } <N> Object a(A<Number> n) { return null; } } class A<T> {} class B {} -------------------------------------------------- However, the first one does NOT compile with javac6. bug 317719 comment 48 documents my findings that we may have sidestepped JLS 8.4.2 after the fix for bug 289247. This may be one reason why ECJ in 1.6 compliance is more liberal than javac6
Srikanth, the patch in bug 317719 comment 50 is a step towards rectifying this. You can see how valid that is.
Created attachment 201561 [details] proposed fix v0.5 + updated tests The LS 8.4.2 says that The signature of a method m1 is a subsignature of the signature of a method m2 if either: • m2 has the same signature as m1, or • the signature of m1 is the same as the erasure of the signature of m2. It seems that the logic for point 2 is the only thing which currently distinguishes ECJ compliance 1.6 behaviour with javac6. This patch adds that logic, special cased for 1.6 compliance. This is on the lines of the logic we also had before fix for bug 289247 deleted it.
Created attachment 201564 [details] proposed fix v1.0 + updated tests This patch adds some more logic that was removed after the fix for bug 289247. So, now we're more closely compatible with javac6 and many cases where we were being more liberal than javac6 due to the fix for bug 317719 now agree with javac6. Cases such as these also complain now: int foo() {return 1;} float foo() {return 1.0;}
Created attachment 201587 [details] Revised patch under test Same patch with minor clean ups.
Created attachment 201611 [details] Proposed patch - Passes all tests.
I think this patch correctly restores the fragment of the code deleted by bug 289247 and in combination with the fix for bug 317719, effectively restores the behavior at compliance level 1.6 to how it stood before the combination of fixes for the bug 289247 and bug 273862. Thanks Ayush. +1 for the patch. Please release for HEAD and 3.7.1.
Thanks Srikanth. Released in HEAD for 3.8M2 and in R3_7_maintenance for 3.7.1
Verified for 3.7.1 RC2 using build M20110824-0800
Verified for 3.8M2 with build I20110912-2126.