Community
Participate
Working Groups
The following code (with appropriate imports) is rejected by ECJ, but Javac accepts this program: Object in = new Object() { public Object foo() { return (Serializable) this; } }; I believe (as per JLS 5.1.6.1, where there's lot of change for Java 9), this is valid.
To figure out the changes in JLS 9 - 5.1.6.1, please see that JLS 8 has similar rules in the body of 5.1.6. I think the relevant bullets are JLS 8: From any class type C to any non-parameterized interface type K, provided that C is not final and does not implement K. JLS 9: S is a class type, T is an interface type, and S does not name a final class (§8.1.1). Except for the parameterization issue, both versions basically state the same. I think what *has* changed is the finalness of anonymous classes. JLS 8 - 15.9.5 An anonymous class is always implicitly final (§8.1.1.2). JLS 9 - 15.9.5 An anonymous class is never final (§8.1.1.2). :)
New Gerrit change created: https://git.eclipse.org/r/104035
Gerrit change https://git.eclipse.org/r/104035 was merged to [BETA_JAVA9]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=fce70ab5b1cb13a2f70c1b9062312a09892f1a96
(In reply to Eclipse Genie from comment #3) > Gerrit change https://git.eclipse.org/r/104035 was merged to [BETA_JAVA9]. > Commit: > http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=fce70ab5b1cb13a2f70c1b9062312a09892f1a96 > Released for BETA_JAVA9
*** Bug 497609 has been marked as a duplicate of this bug. ***