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

Bug 315791

Summary: NullPointerException on TaskRepository.flushCredentials due to String.intern()
Product: z_Archived Reporter: Shawn Minto <shawn.minto>
Component: MylynAssignee: Shawn Minto <shawn.minto>
Status: RESOLVED FIXED QA Contact:
Severity: blocker    
Priority: P1 CC: robert.elves, steffen.pingel
Version: unspecified   
Target Milestone: 3.4   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
proposed patch
none
mylyn/context/zip none

Description Shawn Minto CLA 2010-06-04 11:38:30 EDT
It seems that some of the changes to reduce memory by using intern() can cause a NullPointerException.

java.lang.NullPointerException
	at org.eclipse.mylyn.tasks.core.TaskRepository.setProperty(TaskRepository.java:814)
	at org.eclipse.mylyn.tasks.core.TaskRepository.flushAuthenticationCredentials(TaskRepository.java:343)
	at org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager.removeRepository(TaskRepositoryManager.java:169)
	at org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager.clearRepositories(TaskRepositoryManager.java:439)
	at org.eclipse.mylyn.tests.util.TestFixture.singleRepository(TestFixture.java:211)
	....
Comment 1 Shawn Minto CLA 2010-06-04 12:50:41 EDT
Created attachment 171128 [details]
proposed patch

Here is the proposed fix for this.  Steffen, should we look at the other places where intern() is used to make sure that there aren't other cases like this?
Comment 2 Shawn Minto CLA 2010-06-04 12:50:42 EDT
Created attachment 171129 [details]
mylyn/context/zip
Comment 3 Steffen Pingel CLA 2010-06-04 17:46:11 EDT
Thanks for catching that. I have committed the fix. For unreleased changes please always feel free to reopen the original bug that way we can track all changes in one place.
Comment 4 Steffen Pingel CLA 2010-06-05 22:18:17 EDT
*** Bug 315893 has been marked as a duplicate of this bug. ***