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.
As Martin suggested, I'm using UsageFinder over only the currently open class to locate callers of whatever method the caret is in and highlight them. Once in a while, when this code runs in a background thread, I will see the following NPE. AFAIK the values being passed are valid - not sure what the trigger is. java.lang.NullPointerException at org.netbeans.modules.javacore.jmiimpl.javamodel.UsageFinder.i sMatch(UsageFinder.java:200) at org.netbeans.modules.javacore.jmiimpl.javamodel.UsageFinder. getUsers(UsageFinder.java:157) at org.netbeans.modules.javacore.jmiimpl.javamodel.UsageFinder. getUsers(UsageFinder.java:160) at org.netbeans.modules.javacore.jmiimpl.javamodel.UsageFinder. getUsers(UsageFinder.java:160) at org.netbeans.modules.javacore.jmiimpl.javamodel.UsageFinder. getUsers(UsageFinder.java:160) at org.netbeans.modules.javacore.jmiimpl.javamodel.UsageFinder. getUsers(UsageFinder.java:160) at org.netbeans.modules.javacore.jmiimpl.javamodel.UsageFinder. getUsers(UsageFinder.java:160) at org.netbeans.modules.javacore.jmiimpl.javamodel.UsageFinder. getUsers(UsageFinder.java:160) at org.netbeans.modules.javacore.jmiimpl.javamodel.UsageFinder. getUsers(UsageFinder.java:142) at org.netbeans.modules.javacore.jmiimpl.javamodel.UsageFinder.a ccess$200(UsageFinder.java:34) at org.netbeans.modules.javacore.jmiimpl.javamodel.UsageFinder$ LazyIterator.findNext(UsageFinder.java:285) at org.netbeans.modules.javacore.jmiimpl.javamodel.UsageFinder$ LazyIterator.hasNext(UsageFinder.java:309) at org.netbeans.modules.javacore.jmiimpl.javamodel.UsageFinder$ LazyCollection.size(UsageFinder.java:223) at java.util.AbstractCollection.isEmpty(AbstractCollection.java:77) at org.netbeans.modules.javagator.Hacks.extractClassMembers(Ha cks.java:206) [catch] at org.netbeans.modules.javagator.Hacks.findUsagesOfElement(Ha cks.java:182) at org.netbeans.modules.javagator.ClassMemberRelatedItemProvid er.collectRelatedItems(ClassMemberRelatedItemProvider.java:62) at org.netbeans.spi.navigator.RelatedItemProviderSupport$Updater .run(RelatedItemProviderSupport.java:253) at org.openide.util.Task.run(Task.java:136) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.ja va:330) at org.openide.util.RequestProcessor$Processor.run(RequestProces sor.java:686)
I'm not sure what is null, but it looks like method.getDeclaringClass() returned null. Can you reproduce it?
It was happening very regularly, though it's tough to determine exactly what triggers it. Try building a copy of Navigator: cd contrib/navigator ant rebuild-modules and just run with it enabled for a while. Eventually, when you are editing something, you will start to see thousands of exceptions scroll up the console - that is it.
I'm not able to reproduce it. I'm getting lots of Illegal State Exceptions and NPEs from ui.nodes.BridgeUtils, which is called by javagator.actions.OpenAction. But no NPE from UsageFinder
Tim, is this bug still reproducible?
As you probably know, I'm in the middle of packing to move to California, so I won't be able to look at much of anything for a few weeks. I think it was still reproducible on the 1017 build, but I'm not sure. I recommend you run Navigator/Javagator yourself (it's useful and fun!!! You'll love it! You won't be able to live without it!!) - if you hit this bug, believe me, you'll know it. Sorry I can't be more help right now. I should be more settled in mid-late November.
I'm sorry I cannot reproduce it. I tried to use Navigator, but it looks like it does not work at all now. No Exceptions, No Warnings - just empty Navigator. NPE was probably caused by incorrect usage of UsageFinder. Tim, please attach fresh stack trace. Thanks.
You have to have javagator installed as well. Navigator is just the view; javagator provides a model over java sources.
Oops I didn't have javagator. Anyway I'm having it now and I'm getting various ClassCast and IllegalState Exceptions, but no NPE from UsageFinder.
Haven't seen this problem in a while either.