Move loggers to the top of their class

There is a possibility of hitting NPE on a logger if it is not the first
statically initialized member. For example, if another static
initializer creates an instance of its class and the logger is used
from the constructor.

Change-Id: I51fa855a8883c107f2e4ef5ac039dc12a571a7ae
This commit is contained in:
Saša Živkov 2017-10-27 12:29:52 +02:00 committed by Sasa Zivkov
parent 7fcb7854b2
commit 176466ed28
2 changed files with 4 additions and 4 deletions

View File

@ -64,11 +64,11 @@
/** Cache of active {@link Repository} instances. */
public class RepositoryCache {
private static final RepositoryCache cache = new RepositoryCache();
private final static Logger LOG = LoggerFactory
.getLogger(RepositoryCache.class);
private static final RepositoryCache cache = new RepositoryCache();
/**
* Open an existing repository, reusing a cached instance if possible.
* <p>

View File

@ -77,6 +77,8 @@
/** Abstraction to support various file system operations not in Java. */
public abstract class FS {
private static final Logger LOG = LoggerFactory.getLogger(FS.class);
/**
* This class creates FS instances. It will be overridden by a Java7 variant
* if such can be detected in {@link #detect(Boolean)}.
@ -158,8 +160,6 @@ public int getRc() {
}
}
private final static Logger LOG = LoggerFactory.getLogger(FS.class);
/** The auto-detected implementation selected for this operating system and JRE. */
public static final FS DETECTED = detect();