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 19001 - NPEs when starting ide.
Summary: NPEs when starting ide.
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
: 19015 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-01-03 11:06 UTC by Jan Zajicek
Modified: 2007-09-26 09:14 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
stacktraces (5.24 KB, text/plain)
2002-01-03 11:07 UTC, Jan Zajicek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Zajicek 2002-01-03 11:06:13 UTC
Attached NPEs were thrown when started ide. See issue #18760 for details. Why
does Lokup.getDefault().lookup(JavaSettings.class) return null? CCing Honza.
Comment 1 Jan Zajicek 2002-01-03 11:07:25 UTC
Created attachment 3964 [details]
stacktraces
Comment 2 _ ttran 2002-01-03 12:51:37 UTC
this is not a bug in java module, rather a bug in Lookup I think
Comment 3 _ ttran 2002-01-03 12:52:50 UTC
Zohar, are you able to reproduce this bug?
Comment 4 Jaroslav Tulach 2002-01-03 17:02:30 UTC
The issue #18760 indicated that there were problems recognizing the
content of setttings files. In such case it is ok that JavaSettings
were not found.

But I cannot reproduce it. I have:

1. Installed version XXX of NetBeans
2. Unziped Zohar's userdir into directory zohar
3. started netbeans with XXX/bin/runide.sh -userdir zohar
4. no NullPointerException

I repeated those steps for latest builds of Nb3.3.0, Nb3.3.1 and Main
trunk. Nothing. 

Please reopen with some steps how to simulate the behaviour.


Comment 5 Jaroslav Tulach 2002-01-04 09:21:08 UTC
Reproduced. Create issue 19025 to improve the general behaviour, but
reassigned to java module because lookup is allowed to return null.
Fix the NPE please.
Comment 6 Jaroslav Tulach 2002-01-04 09:22:38 UTC
*** Issue 19015 has been marked as a duplicate of this issue. ***
Comment 7 Svata Dedic 2002-01-04 10:45:04 UTC
So, what's your recommendation ? Should all queries for the setting
object use SharedClassObject.findObject(whatever.class, true) to be
safe ? Will it work when Lookup.getDefault().lookup() and
SharedClassObject.find() are mixed ?
We can't really create a default setting object (since it is a
subclass of SharedClassObject) and use it when Lookup finds nothing.
The alternative is to guard all lookup()s with a condition.
Comment 8 Jaroslav Tulach 2002-01-04 13:16:07 UTC
Depends on what you need. SharedClassObject.findObject (...)
guarantees that an instance will be returned (in this case
uninitialized) - Lookup can return null and then you can ignore the
action but that depends on your decision.
Comment 9 Svata Dedic 2002-01-08 12:42:16 UTC
I've created a work around - but still I think that behaviour of the
Lookup holding system options should be better.
Fixed in trunk,
/cvs/java/src/org/netbeans/modules/java/JavaExecSupport.java,v  <-- 
JavaExecSupport.java
new revision: 1.8; previous revision: 1.7
Comment 10 Jan Becicka 2002-06-27 11:01:37 UTC
VERIFIED
Comment 11 Quality Engineering 2003-07-01 13:20:22 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.