X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.utils%2Fsrc%2Forg%2Fsimantics%2Futils%2FDevelopment.java;fp=bundles%2Forg.simantics.utils%2Fsrc%2Forg%2Fsimantics%2Futils%2FDevelopment.java;h=26359e799f0b96c460300d16896a96b57d46fc65;hb=86239efa9f50ae671563e6149a586093751a3e69;hp=96c3453c759020f7a8d2d072ace6af721a20b892;hpb=07710b8d5004ddfc203ff18a2c3f7a361f952c52;p=simantics%2Fplatform.git 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 96c3453c7..26359e799 100644 --- a/bundles/org.simantics.utils/src/org/simantics/utils/Development.java +++ b/bundles/org.simantics.utils/src/org/simantics/utils/Development.java @@ -17,9 +17,11 @@ public class Development { private static final Logger LOGGER = LoggerFactory.getLogger(Development.class); public static TreeMap histogram = new TreeMap<>(); + public static Map histogramExceptions = new HashMap<>(); public static final boolean DEVELOPMENT = false; - + private static final int histogramExceptionThreshold = 100; + public static final String PRINT = "Development.print"; public interface DevelopmentListener { @@ -98,6 +100,9 @@ public class Development { String key = o.toString(); Integer i = histogram.get(key); histogram.put(key, i == null ? 1 : i+1); + if (i != null && i >= histogramExceptionThreshold) { + histogramExceptions.computeIfAbsent(key, k -> new Exception()); + } } }