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>