diff options
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java index 0a8bf62f95..2f1a9e1cda 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java @@ -47,8 +47,6 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; -import java.util.Iterator; -import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ScheduledThreadPoolExecutor; @@ -225,7 +223,7 @@ public class RepositoryCache { private volatile long expireAfter; private RepositoryCache() { - cacheMap = new ConcurrentHashMap<Key, Repository>(); + cacheMap = new ConcurrentHashMap<>(); openLocks = new Lock[4]; for (int i = 0; i < openLocks.length; i++) { openLocks[i] = new Lock(); @@ -314,9 +312,8 @@ public class RepositoryCache { } private void clearAll() { - for (Iterator<Map.Entry<Key, Repository>> i = cacheMap - .entrySet().iterator(); i.hasNext();) { - unregisterAndCloseRepository(i.next().getKey()); + for (Key k : cacheMap.keySet()) { + unregisterAndCloseRepository(k); } } |