Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 354349

Summary: parseSdkContent failed at startup: NullpointerException in ProjectDescription.hasPublicChanges()
Product: [Eclipse Project] Platform Reporter: public
Component: ResourcesAssignee: Szymon Brandys <Szymon.Brandys>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: amj87.iitr
Version: 3.8   
Target Milestone: 3.8 M4   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description public CLA 2011-08-10 05:24:21 EDT
Build Identifier: 20110615-0604

When starting Eclipse with the Android ADT plugin r12 installed I sometimes get the error "parseSdkContent failed". 
Apparently the attribute ProjectDescription for the function hasPublicChanges() in org.eclipse.core.internal.resources.ProjectDescription.java is null.
According to the logged stacktrace:

java.lang.NullPointerException
	at org.eclipse.core.internal.resources.ProjectDescription.hasPublicChanges(ProjectDescription.java:509)
	at org.eclipse.core.internal.resources.Project.setDescription(Project.java:1328)
	at org.eclipse.jdt.internal.core.ProjectReferenceChange$1.run(ProjectReferenceChange.java:107)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
	at org.eclipse.jdt.internal.core.ProjectReferenceChange.updateProjectReferencesIfNecessary(ProjectReferenceChange.java:110)
	at org.eclipse.jdt.internal.core.ChangeClasspathOperation.classpathChanged(ChangeClasspathOperation.java:59)
	at org.eclipse.jdt.internal.core.SetContainerOperation.executeOperation(SetContainerOperation.java:110)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:793)
	at org.eclipse.jdt.core.JavaCore.setClasspathContainer(JavaCore.java:4925)
	at com.android.ide.eclipse.adt.internal.project.AndroidClasspathContainerInitializer.updateProjects(AndroidClasspathContainerInitializer.java:166)
	at com.android.ide.eclipse.adt.AdtPlugin$10.run(AdtPlugin.java:1291)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Reproducible: Always

Steps to Reproduce:
1.Install Eclipse
2.Install Android ADT plugin r12
3.Create a project
4.After restarting Eclipse a couple of times this error could popup and never leave after once it popped up for the first time.
The only way to resolve this is to reinstall Eclipse and hope for the best.
Comment 1 public CLA 2011-08-10 06:23:56 EDT
OK, I found out after a long search that the <name> tag got lost in the .project file of one of the projects.
This probably happened when we moved and renamed the folder of our project on the subversion server.
This name tag is required when creating a new project, but won't be checked for if the project got moved outside Eclipse?
Isn't there a way that Eclipse will automatically validate these kind of files? Just like finding warnings/errors in code.
Comment 2 Ayushman Jain CLA 2011-08-11 05:26:39 EDT
Moving to Platform/Resource
Comment 3 Szymon Brandys CLA 2011-08-11 07:18:20 EDT
Adding a validator with errors/warnings is way too much. We just need to log it in the error log and maybe fall back to the empty string if the name is null.
Comment 4 Szymon Brandys CLA 2011-11-15 11:58:54 EST
I just log the problem and do not fall back to the empty string. Fixed with http://git.eclipse.org/c/platform/eclipse.platform.resources.git/commit/?id=8a988a6bc8c326a87b95eb8899561221b910deef