Bug 14055 - NPE in JavaModelManager.getVariableAsXMLString
Summary: NPE in JavaModelManager.getVariableAsXMLString
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M6   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-17 17:52 EDT by John Arthorne CLA
Modified: 2002-04-18 07:59 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2002-04-17 17:52:49 EDT
Build 20020416

Don't ask for the test case ;)  It happens while debugging a self-hosting 
workspace, and doing a checkout from a CVS repository to a workspace on a 
network drive.

In the following for loop, varPath was null, causing a NPE on line 802.  The 
variable was ECLIPSE_HOME.

for (int i= 0; i < variables.length; ++i) {
	String var = variables[i];
	IPath varPath = JavaCore.getClasspathVariable(var);
	Element varElement= document.createElement("variable"); 
	varElement.setAttribute("name", var); //$NON-NLS-1$
	varElement.setAttribute("path", varPath.toString());			 
	rootElement.appendChild(varElement);
}
Comment 1 Philipe Mulet CLA 2002-04-18 07:59:39 EDT
Thanks for the info. Added null check protection.
Fixed