]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Removed apparent debugging code from org.simantics.utils.Development 02/1602/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 20 Mar 2018 08:04:38 +0000 (10:04 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 20 Mar 2018 08:04:38 +0000 (10:04 +0200)
refs #7719

Change-Id: If5e3366a390f7c2cae581d7d0994f85a404a326d

bundles/org.simantics.utils/src/org/simantics/utils/Development.java

index 84c13b4d82973f81706ae881fe2736821f5dff1e..96c3453c759020f7a8d2d072ace6af721a20b892 100644 (file)
@@ -16,7 +16,7 @@ import org.slf4j.LoggerFactory;
 public class Development {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(Development.class);
-       public static TreeMap<String,Integer> histogram = new TreeMap<String,Integer>();
+       public static TreeMap<String,Integer> histogram = new TreeMap<>();
 
        public static final boolean DEVELOPMENT = false;
        
@@ -28,9 +28,9 @@ public class Development {
                
        }
        
-       final static private HashMap<String, Variant> properties = new HashMap<String, Variant>(); 
+       final static private HashMap<String, Variant> properties = new HashMap<>(); 
        
-       final static private CopyOnWriteArrayList<DevelopmentListener> listeners = new CopyOnWriteArrayList<DevelopmentListener>();
+       final static private CopyOnWriteArrayList<DevelopmentListener> listeners = new CopyOnWriteArrayList<>();
 
        static {
                
@@ -96,13 +96,8 @@ public class Development {
        
        public static void recordHistogram(Object o) {
                String key = o.toString();
-               Integer i = Development.histogram.get(key);
-               if(i == null) i = 0;
-               int newValue = i+1;
-               if (newValue == 1000) {
-                   newValue = newValue;
-               }
-               Development.histogram.put(key, newValue);
+               Integer i = histogram.get(key);
+               histogram.put(key, i == null ? 1 : i+1);
        }
        
 }