Bug 322545

Summary: NPE in ExternalFoldersManager
Product: [Eclipse Project] JDT Reporter: Uwe Stieber <uwe.st>
Component: CoreAssignee: Ayushman Jain <amj87.iitr>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: amj87.iitr, jarthana, srikanth_sankaran, stephan.herrmann
Version: 3.7   
Target Milestone: 3.7 M2   
Hardware: PC   
OS: All   
Whiteboard:

Description Uwe Stieber CLA 2010-08-12 10:49:13 EDT
With the latest version of ExternalFoldersManager (1.19, included in 3.7M1), there happens a NPE in the refresh job if a .classpath file of an Java project contains a non-existing external reference, which should be simply ignored.

eclipse.buildId=I20100805-1700
java.version=1.6.0_05
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86


Error
Thu Aug 12 16:45:45 CEST 2010
An internal error occurred during: "Refreshing external folders".

java.lang.NullPointerException
at org.eclipse.jdt.internal.core.ExternalFoldersManager$RefreshJob.run(ExternalFoldersManager.java:387)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

It should be tested if the "folder" isn't null before accessing it. Note that this line had been guarded by such a check in the previous version of ExternalFoldersManager (1.18). So re-adding this guard would be great.
Comment 1 Stephan Herrmann CLA 2010-08-12 12:26:07 EDT
Looks like a duplicate of bug 321358.
Also related: bug 320618 which has a pending patch.
Comment 2 Ayushman Jain CLA 2010-08-12 13:30:22 EDT
Indeed a dup. Thanks Stephen.

*** This bug has been marked as a duplicate of bug 321358 ***
Comment 3 Jay Arthanareeswaran CLA 2010-08-23 06:47:55 EDT
(In reply to comment #0)
> With the latest version of ExternalFoldersManager (1.19, included in 3.7M1),
> there happens a NPE in the refresh job if a .classpath file of an Java project
> contains a non-existing external reference, which should be simply ignored.

It doesn't appear to be a simple missing external folder that has caused this bug. As I mentioned in bug 321358, comment 6, it might be the corrupt external folder project or the cache that is causing this.

If you are still able to replicate this behavior, please attach a test case or the workspace, preferably with isolated problem.
Comment 4 Srikanth Sankaran CLA 2010-09-14 00:31:41 EDT
Verified for 3.7 M2 using build I20100909-1700