void (boolean disposeExternal) { REPO_LOCK.writeLock().lock(); try { for (Repository repo : myRepositories.values()) { Disposer.dispose(repo); } myRepositories.clear(); if (disposeExternal) { for (Repository repo : myExternalRepositories.values()) { Disposer.dispose(repo); } myExternalRepositories.clear(); } updatePathToRootMap(); } finally { REPO_LOCK.writeLock().unlock(); } }