/** * Release a reference to the log corresponding to provided path. The log is closed if this is the * last reference. */ private static synchronized void releaseLog(final File logPath) { Log<?, ?> log = logsCache.get(logPath); if (log == null) { // this should never happen logger.error(ERR_CHANGELOG_UNREFERENCED_LOG_WHILE_RELEASING.get(logPath.getPath())); return; } if (log.referenceCount > 1) { log.referenceCount--; } else { log.doClose(); logsCache.remove(logPath); } }