Bug 325399 - NPE in org.eclipse.jdt.internal.core.ExternalFoldersManager$RefreshJob.run()
Summary: NPE in org.eclipse.jdt.internal.core.ExternalFoldersManager$RefreshJob.run()
Status: VERIFIED DUPLICATE of bug 321358
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 trivial (vote)
Target Milestone: 3.7 M2   Edit
Assignee: Jay Arthanareeswaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-15 17:40 EDT by Troy Bishop CLA
Modified: 2011-01-25 11:20 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Troy Bishop CLA 2010-09-15 17:40:25 EDT
Build Identifier: Eclipse 3.6.0

I am receiving the following NPE when a build is occurring on a workspace:

!ENTRY org.eclipse.core.jobs 4 2 2010-09-15 17:33:03.692
!MESSAGE An internal error occurred during: "Refreshing external folders".
!STACK 0
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)

I debugged into the problem as I really have no idea how this happened as it is looking for a path that does not exist and I don't recall how (or where) it got added.  Nonetheless, it is exposing an NPE that I think can be easily fixed, i.e. looking at the code this is where it fails (in org.eclipse.jdt.internal.core.ExternalFoldersManager$RefreshJob#run()):

IFolder folder = getFolder(externalPath);
folder.refreshLocal(IResource.DEPTH_INFINITE, pm);  // <-- NPE here because folder is null

A simply null check added here to prevent the refreshLocal call when the folder is null would prevent this NPE from happening.

I am marking as trivial since it does not seem to have any negative side-effect and is only an NPE in the .log file.

Reproducible: Always
Comment 1 Jay Arthanareeswaran CLA 2010-09-15 23:57:54 EDT
This has already been fixed for 3.7M2.

*** This bug has been marked as a duplicate of bug 321358 ***
Comment 2 Olivier Thomann CLA 2011-01-25 11:20:21 EST
Verified.