import org.simantics.databoard.binding.Binding;
import org.simantics.databoard.binding.error.BindingException;
import org.simantics.databoard.binding.mutable.Variant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class Development {
- public static TreeMap<String,Integer> histogram = new TreeMap<String,Integer>();
+ private static final Logger LOGGER = LoggerFactory.getLogger(Development.class);
+ 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 {
@Override
public void handle(Object event) {
if((Boolean) getProperty(PRINT, Bindings.BOOLEAN))
- System.err.println(event.toString());
+ LOGGER.info(event.toString());
}
});
public static void recordHistogram(Object o) {
String key = o.toString();
- Integer i = Development.histogram.get(key);
- if(i == null) i = 0;
- Development.histogram.put(key, i+1);
+ Integer i = histogram.get(key);
+ histogram.put(key, i == null ? 1 : i+1);
}
}