Bug 219568 - NPE attempting to create a linked folder in a hidden project after restart
Summary: NPE attempting to create a linked folder in a hidden project after restart
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M6   Edit
Assignee: Szymon Brandys CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 182537
  Show dependency tree
 
Reported: 2008-02-20 05:02 EST by Jerome Lanneluc CLA
Modified: 2008-03-30 08:47 EDT (History)
1 user (show)

See Also:


Attachments
Test (3.96 KB, patch)
2008-02-22 15:06 EST, Szymon Brandys CLA
no flags Details | Diff
Test (3.97 KB, patch)
2008-02-22 15:09 EST, Szymon Brandys CLA
no flags Details | Diff
Fix (21.77 KB, patch)
2008-02-22 17:49 EST, John Arthorne CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jerome Lanneluc CLA 2008-02-20 05:02:28 EST
I20080212-0800

1. Create a hidden project
2. Exit/restart
3. Attempt to create a link folder in this project
Observe: You get the following NPE:

!ENTRY org.eclipse.core.resources 4 2 2008-02-20 10:58:34.062
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.core.internal.resources.LocationValidator.validateLinkLocationURI(LocationValidator.java:101)
	at org.eclipse.core.internal.resources.Workspace.validateLinkLocationURI(Workspace.java:2046)
	at org.eclipse.core.internal.resources.Resource.assertLinkRequirements(Resource.java:154)
	at org.eclipse.core.internal.resources.Resource.createLink(Resource.java:586)
	at org.eclipse.core.internal.resources.Resource.createLink(Resource.java:568)
Comment 1 Szymon Brandys CLA 2008-02-22 15:06:27 EST
Created attachment 90511 [details]
Test

The test that illustrates the issue.
Comment 2 Szymon Brandys CLA 2008-02-22 15:09:03 EST
Created attachment 90512 [details]
Test
Comment 3 John Arthorne CLA 2008-02-22 17:49:55 EST
Created attachment 90533 [details]
Fix

This reveals a pervasive problem in resource internals wherever we use IWorkspaceRoot#getProjects, which omits hidden projects. In most cases we should be including hidden projects to ensure we handle them like other resources.
Comment 4 John Arthorne CLA 2008-02-22 17:50:57 EST
Fix and test released.
Comment 5 Szymon Brandys CLA 2008-03-30 08:47:04 EDT
Verified in I20080327-0100.