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.
From time to time I'm getting the attached NPE. Not sure how to 100% reproduce. But once I get it it is thrown everytime I select an XML file (wherever or when i 'return' to editor where XML is opened). Restart helps for some while. I have all window slided (except of editor of course).
Created attachment 27519 [details] npe
Freshest build, Linux, jdk 1.6.0-beta-b59a. Probably unrelated.
Also for java file. Attaching...
Created attachment 27520 [details] NPE_java
Martin, could you please write what revision of SimpleProxyLookup do you have and double-check it is not modified locally? I see only comments on lines 141 and 71 in last two revisions (1.1 is 6 months old). Thanks.
Please disregard my last comment, I did not have updated the file (so I checked revision 1.1 and revision 1.1, although I supposed I am checking 1.1 and 1.2). Sorry.
I think it is caused by recent Jarda's changes in the lookup. The behavior is probably random because it depends on clearing references by the garbage collector. I am attaching test case that proves that the problem is in SimpleProxyLookup.
Created attachment 27526 [details] Testcase.
Happens quite often. At least P1.5 ;) Up to Yarda.
It forces me to restart every ten minutes, because IDE becomes more or less unusable after NPE begins to poped up when moving in explorer, Ctrl-Tabing, ... --> P1.
The fix should be trivial. Simply change line 71 of SimpleProxyLookup from: if (p.updateLookup(l)) { to if (p != null && p.updateLookup(l)) { at least tests pass with this change :-). Martin, could you give it a try?
Workaround is even more trivial - close Navigator window (cannot be even slided). But that's quite ugly. I'm just running the patched loaders version and it of course works. Hopefully without side efects? I really don't want to try to learn this part of core NB magic now ;)
Well changing "if (p.updateLookup(l))" to "if (p != null && p.updateLookup(l)" is probably the fix, I've deleted the p != null because there was a comment from pnejedly, that the p != null is a workaround for bug 42271. I am going to revert the fix tomorrow, but still it would be interesting to see why the bug 42271 is fixed and still it is causing the problem here.
Well, maybe the comment on WeakSet (bug 42271) was simply obsolette: the WeakSet is AFAIK not used in SimpleProxyLookup.
This happens to one of our developer who is testing Netbeans 5.0 ant letting Netbeans running over the weekend.
openide/util/src/org/openide/util/lookup/SimpleProxyLookup.java,v <-- SimpleProxyLookup.java new revision: 1.3; previous revision: 1.2
*** Issue 69862 has been marked as a duplicate of this issue. ***
*** Issue 69868 has been marked as a duplicate of this issue. ***
Could anyone put a binary patch for this problem? Will it be fixed in 20051205 build? I'm using 20051204
*** Issue 69879 has been marked as a duplicate of this issue. ***
*** Issue 69892 has been marked as a duplicate of this issue. ***
*** Issue 69859 has been marked as a duplicate of this issue. ***
*** Issue 69893 has been marked as a duplicate of this issue. ***
*** Issue 69927 has been marked as a duplicate of this issue. ***
*** Issue 69938 has been marked as a duplicate of this issue. ***
*** Issue 69954 has been marked as a duplicate of this issue. ***
Jarda, is there any specific reason why you did not commit the test?
I have not noticed there is a test. I'll add it.
This issue had *1 votes* before move to platform component