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;
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();
}
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);
}
}