This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
1. Open contrib/autoproject.kit and run Debug. Rest of steps in tested IDE. 2. svn checkout http://google-guice.googlecode.com/svn/trunk/ google-guice-read-only 3. Open Guice project. 4. Alt-F6 and accept 'test' target. 5. There will be two failures that I see. Click on hyperlink for ScopesTest. Press Shift-F6 to (re-)run it. 6. I get Testcase: testSingletons(com.google.inject.ScopesTest): Caused an ERROR Repetitive method name/signature in class file com/google/inject/Stage java.lang.ClassFormatError: Repetitive method name/signature in class file com/google/inject/Stage at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at com.google.inject.Guice.createInjector(Guice.java:70) at com.google.inject.Guice.createInjector(Guice.java:60) at com.google.inject.ScopesTest.testSingletons(ScopesTest.java:57) etc. 7. Open Stage.java, modify (e.g. insert then delete a space at EOF), and save. Rerun ScopesTest. Now I get Testcase: testSingletons(com.google.inject.ScopesTest): Caused an ERROR Absent Code attribute in method that is not native or abstract in class file com/google/inject/InjectorImpl java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file com/google/inject/InjectorImpl at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:90) at com.google.inject.Guice.createInjector(Guice.java:132) at com.google.inject.Guice.createInjector(Guice.java:93) at com.google.inject.Guice.createInjector(Guice.java:70) at com.google.inject.Guice.createInjector(Guice.java:60) at com.google.inject.ScopesTest.testSingletons(ScopesTest.java:57) 8. Open InjectorImpl.java, modify, save. Rerun test. Now java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file com/google/inject/internal/ReferenceCache etc. etc.
Should be OK: http://hg.netbeans.org/main?cmd=changeset;node=d9f8d2ce40c0 http://hg.netbeans.org/main/nb-javac?cmd=changeset;node=ed452dfda4c8
Integrated into 'main-golden', available in build *200808060201* on http://bits.netbeans.org/dev/nightly/ Changeset: http://hg.netbeans.org/main/rev/d9f8d2ce40c0 User: Jan Lahoda <jlahoda@netbeans.org> Log: #142848: another attempt for correct generation of package-info.class
The bug was caused by: http://hg.netbeans.org/main?cmd=changeset;node=2beb1fbd8baa After this change, each time a package-info.java was encountered, all classes parsed so far were dumped into .class files (and the current instance of the parser was discarded). If the following conditions were met: -a dumped .class file contained a static initializer -the dumped .class file was loaded and then parsed from the source then the final .class file contained duplicated static initializer, one of them without code attribute (the one that originated in the first .class file) The solution is twofold: -rollback of 2beb1fbd8baa (which fixes this problem, but will break generation of .class file for package-info.java) -(more) correct fix for generation of .class files for package-info.java: make JavacTaskImpl.enter return a TypeElement for content package-info.java, so it can be passed to JTI.generate, which will then generate only the single .class file corresponding to package-info.java Risks: -negative impact to files other than package-info.java is very unlikely -two possible problems for package-info.java: -generation of .class files for package-info might break (please note that .class files are never generated for "empty" package-infos) -processing of package-infos might break I consider both of these problems to be not very likely.
Wrong class generation is very serious problem -> P1 this should be fixed in beta, in order to test the fix properly
Created attachment 66665 [details] Diff against release65_beta
The patch against release65_beta is attached. The changes in the parser are here: http://hg.netbeans.org/main/nb-javac?cmd=changeset;node=ed452dfda4c8 Dusan, could you please review the fix? Thanks.
The fix seems to be OK.
i cannot reproduce it with current trunk -> verified by QA
*** Issue 142808 has been marked as a duplicate of this issue. ***
Confirmed, fix works on my test case. Thanks! (BTW rerunning a single failed test method works in this project now too.)
Merged into release65_beta branch: http://hg.netbeans.org/release65_beta/rev/50b2377449b2