808182838485868788899091
/** * Relies on an external lock on {@link #lock} for thread safety. */ private Counter getOrCreateCounter(String type){ Counter cnt = counts.get(type); if (cnt == null){ cnt = new Counter(); counts.put(type, cnt); } return cnt; }