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.
Latest NB 6.1 builds ~ March 12. <Find Usages> for a method in an NBM project when the caller of the method is in an unopened project. Gave NPE (attached).
Created attachment 58276 [details] NPE stack trace
Marked regression because this was supposedly fixed in 6.0. See issue 120041.
It must be very recent regression, or it is not that easy to reproduce. Can you provide steps by step instructions? Find Usages should work only with open projects.
The symbol was only referenced from j2eeserver module, which was not open. Instead of informing me there were no references, I got the NPE. I can try it with a new userdir in case there is cache corruption (different problem?) FWIW, when I manually opened j2eeserver later in the session, and did the same FindUsages attempt, it worked and I got the results I wanted.
Now it shows this exception on the console (nothing visible in IDE): SEVERE [org.openide.util.RequestProcessor] java.lang.IllegalArgumentException: Cannot pass null as an argument of the SourceUtils.getFile at org.netbeans.api.java.source.SourceUtils.getFile(SourceUtils.java:354) at org.netbeans.modules.refactoring.java.RetoucheUtils$CompilerTask.run(RetoucheUtils.java:808) at org.netbeans.modules.refactoring.java.RetoucheUtils$CompilerTask.run(RetoucheUtils.java:774) at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:665) at org.netbeans.modules.refactoring.java.RetoucheUtils.getFileObject(RetoucheUtils.java:543) at org.netbeans.modules.refactoring.java.RetoucheUtils.getClasspathInfoFor(RetoucheUtils.java:635) at org.netbeans.modules.refactoring.java.ui.WhereUsedQueryUI.setParameters(WhereUsedQueryUI.java:130) at org.netbeans.modules.refactoring.spi.impl.ParametersPanel$Prepare.run(ParametersPanel.java:749) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986) This is with latest sources, clean build, clean userdir. Steps: 1. Open contrib/j2ee.hk2 (maybe also contrib/glassfish.[common, jruby, javaee], I had them open, but they are not related.) 2. Open the java file [SP] / org.netbeans.modules.j2ee.hk2.ide / FastDeploy.java 3. Scroll to line ~109 - "public ProgressObject incrementalDeploy(TargetModuleID targetModuleID, AppChangeDescriptor appChangeDescriptor)" 4. Right click the method <incrementalDeploy> and perform <Find Usages>, default options (search open projects, search from base, etc.) 5. In a 3/13 build, it will show the aforementioned IAEx on the console and correctly show no hits in the output. 6. If you open the "j2eeserver" project, there are no problems, because that's where the caller of this method is.
Hm. It works for me. I have build from 8/3. One usage found in TargetServer.java. Is it correct? Jirko, can you reproduce it?
Product Version: NetBeans IDE Dev (Build 20080313092248) Java: 1.6.0_10-beta; Java HotSpot(TM) Client VM 11.0-b11 System: Linux version 2.6.22-14-generic running on i386; UTF-8; en_US (nb) I've got the original exception (MPE) if the j2eeserver module was not opened. If it was opened one usage in class TargetServer was found
OK. Trying to pull/checkout/build/test again. BTW issue 129906 is probably duplicate of this one.
I did update and now I'm able to reproduce it. Probably very recent regression.
*** Issue 129906 has been marked as a duplicate of this issue. ***
It's caused by unknown source root on the source path, the IDE ignored whole source path when it contained unknown source to prevent parsing and OOM. I suggest to ignore just the unknown root instead of the whole source path. Here comes the suggested diff
Created attachment 58406 [details] Proposed fix
Fixed thanks to tzezula. ba2901ab6fb6