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.
Annotation: Exception occurred in Request Processor java.lang.NullPointerException at org.netbeans.modules.editor.java.JavaFixAllImports.changeImports(JavaFixAllImports.java:393) at org.netbeans.modules.editor.java.JavaFixAllImports.addAllNeededImports(JavaFixAllImports.java:264) at org.netbeans.modules.editor.java.JavaFixAllImports$1.run(JavaFixAllImports.java:67) at org.openide.util.Task.run(Task.java:136) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:686) [org.netbeans.javacore] INFORMATIONAL *********** Exception occurred ************ at 9:54 PM on Jan 28, 2005 [catch]java.lang.Exception: rollback!!! at org.netbeans.modules.javacore.ExclusiveMutex.leave(ExclusiveMutex.java:345) at org.netbeans.mdr.NBMDRepositoryImpl.endTrans(NBMDRepositoryImpl.java:248) at org.netbeans.modules.editor.java.JMIUtils.endTrans(JMIUtils.java:167) at org.netbeans.modules.editor.java.JavaFixAllImports.addAllNeededImports(JavaFixAllImports.java:271) at org.netbeans.modules.editor.java.JavaFixAllImports$1.run(JavaFixAllImports.java:67) at org.openide.util.Task.run(Task.java:136) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:686) *********** Exception occurred ************ at 9:54 PM on Jan 28, 2005 Annotation: Exception occurred in Request Processor java.lang.NullPointerException at org.netbeans.modules.editor.java.JavaFixAllImports.changeImports(JavaFixAllImports.java:393) at org.netbeans.modules.editor.java.JavaFixAllImports.addAllNeededImports(JavaFixAllImports.java:264) at org.netbeans.modules.editor.java.JavaFixAllImports$1.run(JavaFixAllImports.java:67) at org.openide.util.Task.run(Task.java:136) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:686)
java issue
Could you please provide steps to reproduce this problem? FixAllImports works OK for me in the current build. What build are you using? Could you please attach the messages.log.
1) I am using NetBeans IDE 4.0 (Build 200412081800), which should be the latest build. 2) The Fix Imports work most of the time, but definitely don't work for missing annotation classes. I am going to upload the entire zipped NetBeans project as an attachment shortly. Just open up the NetBeans project folder "yajcache". 3) The one that caused NPE when invoking the Fix Imports is the class org.apache.jcs.yajcache.soft.SoftRefFileCache.java, when the line for importing the AtomicInteger is commented out.
Created attachment 20054 [details] zipped NetBeans project folder with lib/*.jar removed to reduce filesize
The removed lib/*.jar files are: commons-beanutils-1.6.1.jar commons-collections-3.1.jar commons-lang-2.0.jar commons-logging-1.0.3.jar junit-3.8.1.jar log4j-1.2.8.jar All can be easily found and downloaded somewhere else. All let me know if you want me to upload them as separate attachments.
Created attachment 20055 [details] messages.log of NetBeans when the NPE occurred
Also, for any class that has the following line, import org.apache.jcs.yajcache.lang.annotation.*; if you comment it out and do a Fix Imports, you will get a failure. However, this seems to be a different (and general) failure than the specific AtomicInteger fix import problem of class SoftRefFileCache.java
Fixed in main trunk. Checking in JavaFixAllImports.java; /cvs/java/editor/src/org/netbeans/modules/editor/java/JavaFixAllImports.java new revision: 1.4; previous revision: 1.3