X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.utils%2Fsrc%2Forg%2Fsimantics%2Futils%2FDevelopment.java;h=96c3453c759020f7a8d2d072ace6af721a20b892;hp=84c13b4d82973f81706ae881fe2736821f5dff1e;hb=14782a8b99b1c6e7523b85e71b165439ffc47257;hpb=1ead2fab0a23f75b540dc3f20e84e536f3aaa3ca diff --git a/bundles/org.simantics.utils/src/org/simantics/utils/Development.java b/bundles/org.simantics.utils/src/org/simantics/utils/Development.java index 84c13b4d8..96c3453c7 100644 --- a/bundles/org.simantics.utils/src/org/simantics/utils/Development.java +++ b/bundles/org.simantics.utils/src/org/simantics/utils/Development.java @@ -16,7 +16,7 @@ import org.slf4j.LoggerFactory; public class Development { private static final Logger LOGGER = LoggerFactory.getLogger(Development.class); - public static TreeMap histogram = new TreeMap(); + public static TreeMap histogram = new TreeMap<>(); public static final boolean DEVELOPMENT = false; @@ -28,9 +28,9 @@ public class Development { } - final static private HashMap properties = new HashMap(); + final static private HashMap properties = new HashMap<>(); - final static private CopyOnWriteArrayList listeners = new CopyOnWriteArrayList(); + final static private CopyOnWriteArrayList 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); } }