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 63476 - NPE from java hints
Summary: NPE from java hints
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
: 64061 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-09-01 01:10 UTC by Peter Zavadsky
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
exception (955 bytes, text/plain)
2005-09-01 01:11 UTC, Peter Zavadsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Zavadsky 2005-09-01 01:10:49 UTC
Linux: build 200508281800:

There occured NPE (see attachment) repeatedly which was very annoying, basically
blocking from work.
Comment 1 Peter Zavadsky 2005-09-01 01:11:24 UTC
Created attachment 24435 [details]
exception
Comment 2 Martin Roskanin 2005-09-12 12:49:00 UTC
reassigning to java module
Comment 3 Martin Roskanin 2005-09-12 12:49:52 UTC
*** Issue 64061 has been marked as a duplicate of this issue. ***
Comment 4 Pavel Flaska 2005-09-12 13:38:45 UTC
Either there is cp root in classpath, which does not have associated ClassIndex,
or there is null value in any cp root.

I can check existence of index for given cp root. IMO a cause of problem is
somewhere else (there has to be index for given cp root and cp root cannot be
null.) 

Peter, are you able to provide additional information?
i) Is it reproducible,
ii) can you provide project (or describe your project, if it is netbeans module,
j2se project etc.)
iii) and source code and line number where problem appears?

Thanks.
Comment 5 Peter Zavadsky 2005-09-12 17:40:55 UTC
i) I don't know the steps how to reproduce, I hit the issue after working some
time (on our project).
ii) Our project is based on NB (4.0), plus our modules,I mount it as a project
all together (i.e. the project root dir is a parent dir of all modules dirs),
when I specify the classpath, src path accordingly (pointing to modules I am
working on).
iii) about this I am not sure, once I hit it, it pops up repeatedly, and I have
to restart in order to be able to work again. It doesn't seem to be specific
line of code, it is always in different source (AFAIK).

Please for now fix the NPE, even by the check (if it is necessary). NPE is a
runtime exception, which means the code has some flaw, which should be changed.
If there is some variable which can be null, the it has to be checked against
that possibility, if the variable (returned from some method) 'is guaranteed'
non-null, then the method should be checked and assured it returns non-null,
etc. (it can chain). Thanks.
I hope the stack trace is enough in this case.
Comment 6 Pavel Flaska 2005-09-13 08:40:05 UTC
Fixed. Added check and assertions.

Checking in src/org/netbeans/modules/java/hints/JavaHintsProvider.java;
/cvs/java/hints/src/org/netbeans/modules/java/hints/JavaHintsProvider.java,v 
<--  JavaHintsProvider.java
new revision: 1.43; previous revision: 1.42
done
Comment 7 Pavel Flaska 2005-09-13 14:42:46 UTC
Previous fix was incorrect.

Checking in src/org/netbeans/modules/java/hints/JavaHintsProvider.java;
/cvs/java/hints/src/org/netbeans/modules/java/hints/JavaHintsProvider.java,v 
<--  JavaHintsProvider.java
new revision: 1.44; previous revision: 1.43
done
Comment 8 Quality Engineering 2007-09-20 12:47:54 UTC
Reorganization of java component