181920212223242526
} } public synchronized void start() { if (inReplace.getAndSet(true) != Boolean.FALSE || replaceMap != null) { throw new ConcurrencyError("Already replacing"); } replaceMap = new ConcurrentHashMap<K, V>(); }
25262728293031323334
replaceMap = new ConcurrentHashMap<K, V>(); } public synchronized void done() { if (inReplace.getAndSet(false) != Boolean.TRUE || replaceMap == null) { throw new ConcurrencyError("Not yet replacing"); } hashMap = replaceMap; replaceMap = null; }
126127128129130131132133134135136
} @Override public void run() { //noinspection ThrowableInstanceNeverThrown new ConcurrencyError("Just loading some exception classes."); try { InsecurityManager.init(); } catch (Throwable t) { System.err.println("Failed to set up Security Manager. This is probably not a huge problem - but it could indicate classloading issues."); }