Bug 480152 - Unable to open Project Explorer
authorAndrey Loskutov <loskutov@gmx.de>
Tue, 20 Oct 2015 20:19:19 +0000 (22:19 +0200)
committerAndrey Loskutov <loskutov@gmx.de>
Wed, 28 Oct 2015 19:11:49 +0000 (15:11 -0400)
commit2547b8a4867fa046fbf5a50e6119568028f3738b
treef12bfa1b861b6faa58478de35f48eeb21300ffd0
parent2848f55dc940086bc9b7514ed88168a9ffbea92d
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: I6947e5db90f08534a7e6c5796bb97c14dfd1e91e
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/nested/NestedProjectManager.java