Log not {@link ThreadLocal#remove()}ed leak as a warning.
979363
protected void processLeak(ClassLoaderLeakPreventor preventor, Thread thread, Reference<?> entry, 
                             ThreadLocal<?> threadLocal, Object value, String message) {
    preventor.warn(message);
  }
1309469
public void stop_logging () {
   		Vector dl = Util.instance().get_device_list("*");
        for (Object aDl : dl) {
            ((DeviceImpl) aDl).stop_logging();
        }
    }
689163
private void logFailure(String message, Object... args) {
        totalFailures.inc();

        long total = totalFailures.get();

        // it can happen that 2 threads at the same conclude that the level should be warn because of the
        // non atomic int/get. This is an acceptable trade of since it is unlikely to happen and you only get
        // additional warning under log as a side effect.
        Level level = total % WARNING_LOG_FREQUENCY == 0
                ? Level.WARNING : Level.FINEST;

        if (logger.isLoggable(level)) {
            logger.log(level, String.format(message, args));
        }
    }
820792
public static void ignore(Log log,Throwable th)
    {
        if (log.isTraceEnabled()) log.trace(IGNORED,th);
    }
954370
void flushLogQueue() {
        Set<String> problems = new LinkedHashSet<String>();
        synchronized (messageQueue) {
            Iterator<LogEntry> i = messageQueue.iterator();
            while (i.hasNext()) {
                problems.add("\t\t" + i.next().getMessage() + "\n");
                i.remove();
            }
        }
        if (!problems.isEmpty()) {
            logger.transformationWarnings(target.getHostName(), problems);
        }
    }
1335894
public final void traceThreadStack(Object logTool, Thread thread) {
        StackTraceElement[] stack = thread.getStackTrace();

        if (stack != null) {
            StringBuilder stackTrace = new StringBuilder("TRACEBACK for Thread " + thread.getName() + ": ");

            for (int i = 0; i < stack.length; ++i) {
                stackTrace.append(EOLN);
                stackTrace.append(stack[i].toString());
            }

            debugTrace(logTool, EOLN + stackTrace.toString());
        }
    }
76833
public OutputStream removeThreadStream() {
        final OutputStream orig = inheritOutputStream.get();
        inheritOutputStream.set(null);
        return orig;
    }
767512
protected void closeLogExc(@Nullable final Closeable closeable) {
		if (closeable == null) {
			return;
		}

		try {
			closeable.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
1237547
private final void _destroy(final Method logFactoryRelease) {
		for (final Iterator it = this.childrenMap.entrySet().iterator(); it
				.hasNext();) {
			final Map.Entry entry = (Map.Entry) it.next();
			final CClassLoader loader = (CClassLoader) entry.getValue();
			loader._destroy(logFactoryRelease);
			it.remove();
		}

		try {
			// remove ref from commons logging
			logFactoryRelease.invoke(null, new Object[] { this });
		} catch (final Exception e) {
		}

		try {
			// reset parent to system class loader
			final Field parent = ClassLoader.class.getDeclaredField("parent");
			parent.setAccessible(true);
			parent.set(this, ClassLoader.getSystemClassLoader());
			parent.setAccessible(false);
		} catch (final Throwable ignore) {
		}

		this.classesMap.clear();
		for (final Iterator it = this.dllMap.entrySet().iterator(); it
				.hasNext();) {
			final Object element = it.next();
			final Map.Entry entry = (Map.Entry) element;
			if (entry.getValue() instanceof File) {
				((File) entry.getValue()).delete();
			}
		}
		this.cacheMap.clear();
		this.dllMap.clear();
		this.resourcesMap.clear();
		this.config = null;
		this.name = null;
		this.finalizepath = this.path;
		this.path = null;
		//classes
		System.runFinalization();
		System.gc();
	}
1061812
public static void handleOrLog(Throwable t)
    {
        if (Thread.getDefaultUncaughtExceptionHandler() == null)
            logger.error("Error in ThreadPoolExecutor", t);
        else
            Thread.getDefaultUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), t);
    }
193478
public void warning(String msg) {
        if (Level.WARNING.intValue() < levelValue) {
            return;
        }
        log(Level.WARNING, msg);
    }
1120689
@SuppressWarnings("unchecked")
    private void processJavaLoggerDiscovery(ClassTraceInfo info) {
        List<FieldNode> loggerFields = getFieldsByDesc(LOGGER_TYPE.getDescriptor(), info.classNode.fields);
        if (!loggerFields.isEmpty()) {
            // Remove references to non-static Loggers
            for (int i = loggerFields.size() - 1; i >= 0; i--) {
                FieldNode fn = loggerFields.get(i);
                if ((fn.access & Opcodes.ACC_STATIC) != Opcodes.ACC_STATIC) {
                    loggerFields.remove(i);
                    StringBuilder sb = new StringBuilder();
                    sb.append("WARNING: Non-static java.util.logging.Logger field declared on class ");
                    sb.append(info.classNode.name.replaceAll("/", "\\.")).append(": ");
                    sb.append(fn.name);
                    info.warnings.add(sb.toString());
                }
            }
            if (loggerFields.size() > 1) {
                StringBuilder sb = new StringBuilder();
                sb.append("WARNING: Multiple java.util.logging.Logger fields declared on class ");
                sb.append(info.classNode.name.replaceAll("/", "\\.")).append(": ");
                for (int i = 0; i < loggerFields.size(); i++) {
                    sb.append(loggerFields.get(i).name);
                    if (i + 1 != loggerFields.size()) {
                        sb.append(", ");
                    }
                }
                info.warnings.add(sb.toString());
            }

            // Keep track of the first static Logger
            if (loggerFields.size() > 0) {
                info.loggerFieldNode = loggerFields.get(0);
            }
        }
    }
439736
public static void closeQuietly(@Nullable final Closeable closeable, @Nonnull final Logger log) {
        try {
            if (null != closeable) {
                closeable.close();
            }
        } catch (Exception e) {
            log.error("Exception during cleanup of a Closeable, ignoring", e);
        }
    }
928892
@UiThread
  public void onDestroy() {
    mapboxMap.removeOnMapClickListener(mapClickResolver);
    mapboxMap.removeOnMapLongClickListener(mapClickResolver);
    dragListeners.clear();
    clickListeners.clear();
    longClickListeners.clear();
  }
1154461
private void remove(Thread t) {
        synchronized (this) {
            if (destroyed) {
                return;
            }
            for (int i = 0 ; i < nthreads ; i++) {
                if (threads[i] == t) {
                    System.arraycopy(threads, i + 1, threads, i, --nthreads - i);
                    // Zap dangling reference to the dead thread so that
                    // the garbage collector will collect it.
                    threads[nthreads] = null;
                    break;
                }
            }
        }
    }
833182
void removeLog(PlainChangesLog log)
   {
      if (LOG.isDebugEnabled())
      {
         LOG.debug("tx removeLog() " + this + (transactionLog != null ? "\n" + transactionLog.dump() : "[NULL]"));
      }

      if (txStarted())
      {
         transactionLog.removeLog(log);
         if (transactionLog.getSize() == 0)
         {
            // Clear tx changes log if there is no log left
            transactionLog = null;
         }
      }
   }
679844
public static void clearBegunTxOnThread() {
        final Stack<BegunTx<?>> stack = threadLocal.get();
        if (stack != null) {
            stack.pop(); // remove latest
            if (stack.isEmpty()) {
                perfectlyClear();
            }
        }
    }