DESCRIPTION

Bug 480152 - Unable to open Project Explorer

Cleaned up NestedProjectManager code.

Added NPE guards on all places where IResource.getLocation() is used,
since it can always return null for not existing projects and their
children (and in few other cases too of course).

Removed getInstance() block which would immediately fail with NPE if
synchronizing on a null field.

Made locationsToProjects synchronous map to avoid ConcurrentModification
exceptions and inconsistent states while accessing and updating the map
from different threads (the code is exposed to UI and resource callbacks
which usually operate on different threads).

Change-Id: I725c9f56c31ba99e5d0701fcf57a59ea87d41e21
Signed-off-by: Jayvion Booth xxx@xxx.xxx


COMMENTS

author: Jayvion Booth
date: 2015-10-20 20:19:39.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2015-10-20 20:19:45.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/7147/

-------------------------------------
author: Brenden Conley
date: 2015-10-20 20:35:31.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/7147/ : SUCCESS

-------------------------------------
author: Sawyer Richmond
date: 2015-10-23 17:25:37.000000000

Patch Set 1:

(1 comment)

Andrey, 

IHMO, it's good patch in sense that we're really need to check getLocation() result for null in most cases.

I'd just prefer not to do it twice (see my comment for the line 147).

Line:147, bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/nested/NestedProjectManager.java -> IMHO, here is not needed extra check for mostDirectParentProject.getLocation() == null, because the same check was done actually in lines 136-139.

-------------------------------------
author: Jayvion Booth
date: 2015-10-23 18:54:24.000000000

Patch Set 1:

(1 comment)

Line:147, bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/nested/NestedProjectManager.java -> Since the value is computed every time, the code could return null here even if it returned non null value few milliseconds before.

-------------------------------------
author: Jayvion Booth
date: 2015-10-23 18:54:34.000000000

Patch Set 2: Patch Set 1 was rebased

-------------------------------------
author: Gerrit Code Review
date: 2015-10-23 19:15:50.000000000

Change has been successfully merged into the git repository by Jayvion Booth

-------------------------------------
