Bug 14055

Summary: NPE in JavaModelManager.getVariableAsXMLString
Product: [Eclipse Project] JDT Reporter: John Arthorne <john.arthorne>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0 M6   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

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