Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 121006 - NullPointerException at$LookupSensitive$
NullPointerException at$LookupS...
Product: utilities
Classification: Unclassified
Component: Search
All All
: P3 (vote)
: 6.x
Assigned To: Marian Petras
Depends on:
Blocks: 106082
  Show dependency treegraph
Reported: 2007-11-02 17:44 UTC by Jesse Glick
Modified: 2007-12-07 16:41 UTC (History)
0 users

See Also:
Issue Type: DEFECT

stacktrace (705 bytes, text/plain)
2007-11-02 17:44 UTC, Jesse Glick

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2007-11-02 17:44:02 UTC
Build: NetBeans IDE Dev (Build 071102)
VM: Java HotSpot(TM) Client VM, 1.5.0_12-b04
OS: Linux, 2.6.22-14-generic, i386

User Comments: 
Just closed a couple of projects.
Comment 1 Jesse Glick 2007-11-02 17:44:11 UTC
Created attachment 52399 [details]
Comment 2 Jesse Glick 2007-11-02 17:56:08 UTC
Looks like a race condition introduced by fix of issue #106082.

I would recommend simplifying code:

private final PropertyChangeSupport support;
LS(...) {
  // ...
  support = new PropertyChangeSupport(this);
  searchScopeRegistry.addChangeListener(WeakListeners.change(this, searchScopeRegistry));
  enabled = searchScopeRegistry.hasApplicableSearchScope();
void addPCL(l) {
void removePCL(l) {

Besides the race condition, the current code looks like it could be a memory leak anyway, if FIFA.LS.rPCL is never
called for whatever reason.
Comment 3 Marian Petras 2007-11-05 07:24:46 UTC
I will try to fix this for NB 6.0.
Comment 4 Marian Petras 2007-11-14 17:10:19 UTC
Fixed in the trunk.

I did not do the suggested changes because:
a) field 'support' is also used as an indication whether there is some listener registered
b) I am sure FIFA.LS.rPCL is called - the NullPointerException would never be thrown if it was not called

The change I made just changes the code such that when stateChanged() is called, the list of currently registered
listeners is stored and this list is later used for actual notification. This guarantees that the NullPointerException
is never called and that the correct list of listeners is called.

Modified file:
    utilities/src/org/netbeans/modules/search/   (1.9)


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo