Bug 6059 - NPE in JavaModelStatus
Summary: NPE in JavaModelStatus
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: 2.0 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-19 08:41 EST by Martin Aeschlimann CLA
Modified: 2002-02-19 07:51 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2001-11-19 08:41:04 EST
I got a NPE on this code
IStatus validation= JavaConventions.validateClasspath(fJavaProject, 
newClasspath, fOutputLocation);
if (!validation.matches(IStatus.ERROR)) {

On debugging I saw that JavaModelStatus.fChildren is null.
Can't see how that happens, but it was.
Comment 1 Philipe Mulet CLA 2001-12-03 09:46:57 EST
Any test case on how to reproduce this ?
Comment 2 Martin Aeschlimann CLA 2001-12-04 03:56:31 EST
in BuildPathsBlock, search the validateClasspath line and add
if (!validation.matches(IStatus.ERROR)) {
 System.out.println("Wont be reached");
}
Comment 3 Olivier Thomann CLA 2002-02-13 09:59:16 EST
Could you please specify the build number?
Comment 4 Martin Aeschlimann CLA 2002-02-13 11:27:46 EST
still exists in 20020212
Comment 5 Olivier Thomann CLA 2002-02-15 10:34:55 EST
When I added the two lines:
if (!validation.matches(IStatus.ERROR)) {
 
System.out.println("Wont be reached");
}

What am I supposed to do to reproduce the 
problem?
Comment 6 Martin Aeschlimann CLA 2002-02-15 10:52:44 EST
add the two lines to BuildPathsBlock.java, after the line containing 
validateClasspath

Run Eclipse, open the new class wizard -> NPE at the added line
I just tried that in 20020212, and it still crashes. seems to be independent of 
the validated classpath.
Comment 7 Olivier Thomann CLA 2002-02-15 12:17:24 EST
The bug was due to the order of evaluation. At the time the VERIFIED_OK object is created, the 
fgChildren is still null because it is initilized in the clinit after the Java Model Status object 
is created.
Fixed and released in HEAD.