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.

Bug 69810 - NPE from SimpleProxyLookup
Summary: NPE from SimpleProxyLookup
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Lookup (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: RANDOM
: 69859 69862 69868 69879 69892 69893 69927 69938 69954 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-12-03 11:10 UTC by Martin Krauskopf
Modified: 2008-12-23 14:32 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
npe (1.65 KB, text/plain)
2005-12-03 11:11 UTC, Martin Krauskopf
Details
NPE_java (1.54 KB, text/plain)
2005-12-03 11:17 UTC, Martin Krauskopf
Details
Testcase. (1.40 KB, text/plain)
2005-12-03 16:16 UTC, Jan Lahoda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Krauskopf 2005-12-03 11:10:50 UTC
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).
Comment 1 Martin Krauskopf 2005-12-03 11:11:25 UTC
Created attachment 27519 [details]
npe
Comment 2 Martin Krauskopf 2005-12-03 11:13:49 UTC
Freshest build, Linux, jdk 1.6.0-beta-b59a. Probably unrelated.
Comment 3 Martin Krauskopf 2005-12-03 11:17:07 UTC
Also for java file. Attaching...
Comment 4 Martin Krauskopf 2005-12-03 11:17:59 UTC
Created attachment 27520 [details]
NPE_java
Comment 5 Jan Lahoda 2005-12-03 12:46:30 UTC
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.
Comment 6 Jan Lahoda 2005-12-03 12:52:23 UTC
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.
Comment 7 Jan Lahoda 2005-12-03 16:14:55 UTC
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.
Comment 8 Jan Lahoda 2005-12-03 16:16:15 UTC
Created attachment 27526 [details]
Testcase.
Comment 9 Martin Krauskopf 2005-12-03 16:25:17 UTC
Happens quite often. At least P1.5 ;) Up to Yarda.
Comment 10 Martin Krauskopf 2005-12-03 16:48:28 UTC
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.
Comment 11 Jan Lahoda 2005-12-03 17:32:56 UTC
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?
Comment 12 Martin Krauskopf 2005-12-03 17:41:24 UTC
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 ;)
Comment 13 Jaroslav Tulach 2005-12-04 19:31:48 UTC
 
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. 
Comment 14 Jan Lahoda 2005-12-04 19:45:38 UTC
Well, maybe the comment on WeakSet (bug 42271) was simply obsolette: the WeakSet
is AFAIK not used in SimpleProxyLookup.
Comment 15 ehartmann 2005-12-05 08:25:34 UTC
This happens to one of our developer who is testing Netbeans 5.0 ant letting
Netbeans running over the weekend.
Comment 16 Jaroslav Tulach 2005-12-05 09:13:21 UTC
openide/util/src/org/openide/util/lookup/SimpleProxyLookup.java,v  <--  
SimpleProxyLookup.java 
new revision: 1.3; previous revision: 1.2 
Comment 17 Martin Krauskopf 2005-12-05 10:57:10 UTC
*** Issue 69862 has been marked as a duplicate of this issue. ***
Comment 18 Jan Lahoda 2005-12-05 12:44:58 UTC
*** Issue 69868 has been marked as a duplicate of this issue. ***
Comment 19 vanob 2005-12-05 13:08:57 UTC
Could anyone put a binary patch for this problem?
Will it be fixed in 20051205 build? I'm using 20051204
Comment 20 Jaroslav Tulach 2005-12-05 13:25:11 UTC
*** Issue 69879 has been marked as a duplicate of this issue. ***
Comment 21 Jan Lahoda 2005-12-05 15:03:55 UTC
*** Issue 69892 has been marked as a duplicate of this issue. ***
Comment 22 Marek Fukala 2005-12-05 15:13:24 UTC
*** Issue 69859 has been marked as a duplicate of this issue. ***
Comment 23 Jan Lahoda 2005-12-05 16:59:35 UTC
*** Issue 69893 has been marked as a duplicate of this issue. ***
Comment 24 Jan Lahoda 2005-12-05 16:59:42 UTC
*** Issue 69893 has been marked as a duplicate of this issue. ***
Comment 25 Jan Lahoda 2005-12-06 09:34:15 UTC
*** Issue 69927 has been marked as a duplicate of this issue. ***
Comment 26 Jaroslav Tulach 2005-12-07 09:18:40 UTC
*** Issue 69938 has been marked as a duplicate of this issue. ***
Comment 27 Marek Fukala 2005-12-07 09:33:25 UTC
*** Issue 69954 has been marked as a duplicate of this issue. ***
Comment 28 Jan Lahoda 2005-12-09 12:46:59 UTC
Jarda, is there any specific reason why you did not commit the test?
Comment 29 Jaroslav Tulach 2005-12-09 19:04:00 UTC
I have not noticed there is a test. I'll add it. 
Comment 30 Quality Engineering 2008-12-23 14:32:28 UTC
This issue had *1 votes* before move to platform component