]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Disabled BOOKKEEPING flag for normal use 34/2034/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 27 Aug 2018 13:54:12 +0000 (16:54 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 27 Aug 2018 13:54:12 +0000 (16:54 +0300)
Also fixed all compilation warnings from the file.

gitlab #5

Change-Id: I5697ade4a1443df565dd19f78fa1ce044ae97169

bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/AsyncBarrierImpl.java

index 232e5cbd7e358b4cfb7171c5e4c1e62f71fa3ab9..af0604ae6c6abe6d3dee3a573509b4a304471b54 100644 (file)
@@ -26,14 +26,14 @@ final public class AsyncBarrierImpl extends AtomicInteger implements AsyncBarrie
 
        private static final long serialVersionUID = 4724463372850048672L;
 
-       static final HashMap<AsyncBarrierImpl, Collection<AsyncBarrierImpl>> reverseLookup = new HashMap<AsyncBarrierImpl, Collection<AsyncBarrierImpl>>();
-       public static final HashMap<AsyncBarrierImpl, Debugger> debuggerMap = new HashMap<AsyncBarrierImpl, Debugger>();
-       static final HashMap<AsyncBarrierImpl, CacheEntry> entryMap = new HashMap<AsyncBarrierImpl, CacheEntry>();
-       static final HashMap<AsyncBarrierImpl, Boolean> restartMap = new HashMap<AsyncBarrierImpl, Boolean>();
+       static final HashMap<AsyncBarrierImpl, Collection<AsyncBarrierImpl>> reverseLookup = new HashMap<>();
+       public static final HashMap<AsyncBarrierImpl, Debugger> debuggerMap = new HashMap<>();
+       static final HashMap<AsyncBarrierImpl, CacheEntry<?>> entryMap = new HashMap<>();
+       static final HashMap<AsyncBarrierImpl, Boolean> restartMap = new HashMap<>();
 
        static final int WAIT_TIME = 600;
 
-       public static final boolean BOOKKEEPING = true;
+       public static final boolean BOOKKEEPING = false;
        public static final boolean PRINT = false;
        static final boolean RESTART_GUARD = true;
 
@@ -41,7 +41,7 @@ final public class AsyncBarrierImpl extends AtomicInteger implements AsyncBarrie
 
        //private final Semaphore sema = new Semaphore(0);
 
-       public AsyncBarrierImpl(AsyncBarrierImpl caller, CacheEntry entry) {
+       public AsyncBarrierImpl(AsyncBarrierImpl caller, CacheEntry<?> entry) {
                super(0);
                if (BOOKKEEPING) {
                        synchronized (entryMap) {
@@ -208,7 +208,7 @@ final public class AsyncBarrierImpl extends AtomicInteger implements AsyncBarrie
        }
 
        public static String report(AsyncBarrierImpl barrier) {
-               CacheEntry e = entryMap.get(barrier);
+               CacheEntry<?> e = entryMap.get(barrier);
                if(e != null) return e.toString();
                else return "Barrier@" + System.identityHashCode(barrier);
        }