static
and/or final
.
Ensuring that every class logger is effectively constant and bound to that class
simplifies the task of providing a unified logging implementation for an application.
A quick-fix is provided to change the logger modifiers to static final
.
Example:
public class Significant {
private Logger LOG = Logger.getLogger(Critical.class);
}
After the quick-fix is applied:
public class Significant {
private static final Logger LOG = Logger.getLogger(Critical.class);
}
Configure the inspection:
static
and final
and are of the type equal to one of the specified class names.