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;
}
- 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 {
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);
}
}