Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315791 - NullPointerException on TaskRepository.flushCredentials due to String.intern()
Summary: NullPointerException on TaskRepository.flushCredentials due to String.intern()
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P1 blocker (vote)
Target Milestone: 3.4   Edit
Assignee: Shawn Minto CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 315893 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-06-04 11:38 EDT by Shawn Minto CLA
Modified: 2010-06-05 22:18 EDT (History)
2 users (show)

See Also:


Attachments
proposed patch (997 bytes, patch)
2010-06-04 12:50 EDT, Shawn Minto CLA
no flags Details | Diff
mylyn/context/zip (1.90 KB, application/octet-stream)
2010-06-04 12:50 EDT, Shawn Minto CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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. ***