/* * Constructs a {@code LogRecord} object using the supplied the logging * level and message. The millis property is set to the current time. The * sequence property is set to a new unique value, allocated in increasing * order within the virtual machine. The thread ID is set to a unique value * for the current thread. All other properties are set to {@code null}. * * @param level * the logging level, may not be {@code null}. * @param msg * the raw message. * @throws NullPointerException * if {@code level} is {@code null}. */ public LogRecord(Level level, String msg) { if (null == level) { // logging.4=The 'level' parameter is null. throw new java.lang.NullPointerException("The 'level' parameter is null."); //$NON-NLS-1$ } this.level = level; this.message = msg; this.millis = java.lang.SystemJ.currentTimeMillis(); lock (typeof(LogRecord).getClass()) { this.sequenceNumber = currentSequenceNumber++; java.lang.Integer id = currentThreadId.get(); if (null == id) { this.threadID = initThreadId; currentThreadId.set(java.lang.Integer.valueOf(initThreadId++)); } else { this.threadID = id.intValue(); } } this.sourceClassName = null; this.sourceMethodName = null; this.loggerName = null; this.parameters = null; this.resourceBundle = null; this.resourceBundleName = null; this.thrown = null; }
/** * Decrements the active count for the given key. * Also decrements the total active count. * * @param key pool key */ private void decrementActiveCount(K key) { _totActive--; java.lang.Integer active = _activeCount.get(key); if (null == active) { // do nothing, either null or zero is OK } else if (active.intValue() <= 1) { _activeCount.remove(key); } else { _activeCount.put(key, new java.lang.Integer(active.intValue() - 1)); } }
/** * Returns the number of occurrence of the given element in this bag * by looking up its count in the underlying map. * * @param object the object to search for * @return the number of occurrences of the object, zero if not found */ public virtual int getCount(Object obj) { int result = 0; java.lang.Integer count = MapUtils.getInteger(_map, obj); if (count != null) { result = count.intValue(); } return(result); }
/** * Increment the active count for the given key. Also * increments the total active count. * * @param key pool key */ private void incrementActiveCount(K key) { _totActive++; java.lang.Integer old = _activeCount.get(key); if (null == old) { _activeCount.put(key, new java.lang.Integer(1)); } else { _activeCount.put(key, new java.lang.Integer(old.intValue() + 1)); } }
private void initProperties(String p, java.lang.Boolean a, java.lang.Integer l, java.lang.Integer c) { base.initProperties("ALL", null, "java.util.logging.XMLFormatter", null); String className = this.getClass().getName(); pattern = (null == p) ? getStringProperty(className + ".pattern", DEFAULT_PATTERN) : p; if (null == pattern || "".equals(pattern)) { // logging.19=Pattern cannot be empty throw new java.lang.NullPointerException("Pattern cannot be empty"); } append = (null == a) ? getBooleanProperty(className + ".append", DEFAULT_APPEND) : a.booleanValue(); count = (null == c) ? getIntProperty(className + ".count", DEFAULT_COUNT) : c.intValue(); limit = (null == l) ? getIntProperty(className + ".limit", DEFAULT_LIMIT) : l.intValue(); count = count < 1 ? DEFAULT_COUNT : count; limit = limit < 0 ? DEFAULT_LIMIT : limit; files = new java.io.File[count]; }