Community
Participate
Working Groups
The attached small test case source file in Eclipse 3.2 compiles improperly; here are the project compiler properties: Compiler compliance level: 1.4 Do not use default settings: Class compatibility: 1.4 Source compatibility: 1.4 The rest is default. If you run the test, notice that the references to the inner static class end up becoming references to the outer class. Stepping through with the debugger shows this as well; be it by stepping through the frames or by assignment in the same frame. The test case shows it has to do with asserts being present in the inner class. If the asserts can (although I cannot say they are) be optimized out, nothing goes wrong, but any assert that must be evaluated at runtime will cause the failure. Try the various cases by uncommenting the snippets inside of Bar.myMethod to see others. We've seen this on Windows XP, and Linux. Since Eclipse 3.2 for sure, and I believe this wasn't showing on Eclipse 3.1.
Created attachment 53334 [details] Test case
Could you please provide your output? I could not see anything wrong so far.
Here's what I just did: New Java Project, default options everywhere (my ws had Java JDK 1.5.0_6 as its default). Imported Chicken.java, moved to package. Run as Java Application: Expecting class Foo Got the class class org.innocuous.Chicken$Foo Expecting class Bar Got the class class org.innocuous.Chicken Look at the code. It should not have gotten Chicken in the second test case.
I get: Expecting class Foo Got the class class org.innocuous.Chicken$Foo Expecting class Bar Got the class class org.innocuous.Chicken$Bar using HEAD. I'll check with 3.2.0. Could you please zip your project and attach it to this bug report? Thanks.
Created attachment 53385 [details] Project with test case, from Eclipse 3.2.1, windows.
Reproduced. I am investigating.
This is a regression introduced with fix for bug 157389. This should be backported to 3.2.2. I am working on a fix. Thanks for the bug report and the time you spent to provide steps to reproduce.
Created attachment 53405 [details] Proposed fix This patch adds all class literal synthetic fields to the outermost enclosing type and it makes a consistent usage of the source type on which the synthetic field is added. We were wrongly sharing the same synthetic field for org.innocuous.Chicken.class and org.innocuous.Chicken$Bar.class.
+1 for 3.2.2
Released for 3.3M4.
Created attachment 53523 [details] Proposed fix Proposed fix for 3.2 maintenance stream.
Created attachment 53524 [details] Regression tests for 3.2 maintenance branch
Released for 3.2.2.
Verified for 3.2.2 using build M20070112-1200.
(Was only is status whiteboard: frederic_fusier@fr.ibm.com 2006-12-13 03:25:18 Status Whiteboard Verified for 3.3 M4 using build I20061212-0010.)