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

Bug 424407

Summary: NPE in DisabledResourceManager.save()
Product: [WebTools] WTP Common Tools Reporter: Kaloyan Raev <kaloyan>
Component: wst.validationAssignee: wst.validation <wst.validation-inbox>
Status: CLOSED DUPLICATE QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3    
Version: 3.4.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Kaloyan Raev CLA 2013-12-19 03:19:34 EST
In the context of 424340 we faced a NPE in DisabledResourceManager.save()

java.lang.NullPointerException
	at org.eclipse.wst.validation.internal.DisabledResourceManager.save(DisabledResourceManager.java:67)
	at org.eclipse.wst.validation.internal.DisabledResourceManager.disableValidation(DisabledResourceManager.java:49)
	at org.eclipse.wst.validation.ValidationFramework.disableValidation(ValidationFramework.java:130)
	...

This happens if a disabled resource is deleted. The resource still remains listed in the "disabled" preference. After Eclipse is restarted, the "disabled" preference is deserialized in DisabledResourceManager.load() and the deleted resource cannot be resolved to an existing resource in the project. This results in adding a "null" object in the "_disabled" set, which causes NullPointerException on consecutive save operations.
Comment 1 Kaloyan Raev CLA 2013-12-19 04:07:21 EST
I just noticed that this is duplicate to bug 399121, which was fixed in 3.5. I had 3.4.2 in my target platform.

*** This bug has been marked as a duplicate of bug 399121 ***