1
0

No need to initialize instance variables to their default values.

This commit is contained in:
Gary Gregory
2020-05-25 12:08:30 -04:00
parent 7c70d1a180
commit 9444f0730b
10 changed files with 20 additions and 19 deletions

View File

@@ -69,7 +69,7 @@ public class LogConfigurationException extends RuntimeException {
/** /**
* The underlying cause of this exception. * The underlying cause of this exception.
*/ */
protected Throwable cause = null; protected Throwable cause;
/** /**
* Return the underlying cause of this exception (if any). * Return the underlying cause of this exception (if any).

View File

@@ -133,7 +133,7 @@ public abstract class LogFactory {
* generated by LogFactory or LogFactoryImpl. When non-null, * generated by LogFactory or LogFactoryImpl. When non-null,
* interesting events will be written to the specified object. * interesting events will be written to the specified object.
*/ */
private static PrintStream diagnosticsStream = null; private static PrintStream diagnosticsStream;
/** /**
* A string that gets prefixed to every message output by the * A string that gets prefixed to every message output by the
@@ -279,7 +279,7 @@ public abstract class LogFactory {
* The previously constructed <code>LogFactory</code> instances, keyed by * The previously constructed <code>LogFactory</code> instances, keyed by
* the <code>ClassLoader</code> with which it was created. * the <code>ClassLoader</code> with which it was created.
*/ */
protected static Hashtable factories = null; protected static Hashtable factories;
/** /**
* Previously constructed <code>LogFactory</code> instance as in the * Previously constructed <code>LogFactory</code> instance as in the
@@ -296,7 +296,7 @@ public abstract class LogFactory {
* and hashtables don't allow null as a key. * and hashtables don't allow null as a key.
* @deprecated since 1.1.2 * @deprecated since 1.1.2
*/ */
protected static volatile LogFactory nullClassLoaderFactory = null; protected static volatile LogFactory nullClassLoaderFactory;
/** /**
* Create the hashtable which will be used to store a map of * Create the hashtable which will be used to store a map of

View File

@@ -59,13 +59,13 @@ public class LogSource {
static protected Hashtable logs = new Hashtable(); static protected Hashtable logs = new Hashtable();
/** Is log4j available (in the current classpath) */ /** Is log4j available (in the current classpath) */
static protected boolean log4jIsAvailable = false; static protected boolean log4jIsAvailable;
/** Is JDK 1.4 logging available */ /** Is JDK 1.4 logging available */
static protected boolean jdk14IsAvailable = false; static protected boolean jdk14IsAvailable;
/** Constructor for current log class */ /** Constructor for current log class */
static protected Constructor logImplctor = null; static protected Constructor logImplctor;
// ----------------------------------------------------- Class Initializers // ----------------------------------------------------- Class Initializers

View File

@@ -52,7 +52,8 @@ import org.apache.commons.logging.Log;
public class AvalonLogger implements Log { public class AvalonLogger implements Log {
/** Ancestral Avalon logger. */ /** Ancestral Avalon logger. */
private static volatile Logger defaultLogger = null; private static volatile Logger defaultLogger;
/** Avalon logger used to perform log. */ /** Avalon logger used to perform log. */
private final transient Logger logger; private final transient Logger logger;

View File

@@ -45,11 +45,11 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
/** /**
* The underlying Logger implementation we are using. * The underlying Logger implementation we are using.
*/ */
protected transient Logger logger = null; protected transient Logger logger;
protected String name = null; protected String name;
private String sourceClassName = "unknown"; private String sourceClassName = "unknown";
private String sourceMethodName = "unknown"; private String sourceMethodName = "unknown";
private boolean classAndMethodFound = false; private boolean classAndMethodFound;
/** /**
* This member variable simply ensures that any attempt to initialise * This member variable simply ensures that any attempt to initialise

View File

@@ -60,12 +60,12 @@ public class Jdk14Logger implements Log, Serializable {
/** /**
* The underlying Logger implementation we are using. * The underlying Logger implementation we are using.
*/ */
protected transient Logger logger = null; protected transient Logger logger;
/** /**
* The name of the logger we are wrapping. * The name of the logger we are wrapping.
*/ */
protected String name = null; protected String name;
// --------------------------------------------------------- Protected Methods // --------------------------------------------------------- Protected Methods

View File

@@ -53,7 +53,7 @@ public class Log4JLogger implements Log, Serializable {
private static final String FQCN = Log4JLogger.class.getName(); private static final String FQCN = Log4JLogger.class.getName();
/** Log to this logger */ /** Log to this logger */
private transient volatile Logger logger = null; private transient volatile Logger logger;
/** Logger name */ /** Logger name */
private final String name; private final String name;

View File

@@ -202,7 +202,7 @@ public class LogFactoryImpl extends LogFactory {
* This value is initialized by <code>getLogConstructor()</code>, * This value is initialized by <code>getLogConstructor()</code>,
* and then returned repeatedly. * and then returned repeatedly.
*/ */
protected Constructor logConstructor = null; protected Constructor logConstructor;
/** /**
* The signature of the Constructor to be used. * The signature of the Constructor to be used.
@@ -213,7 +213,7 @@ public class LogFactoryImpl extends LogFactory {
* The one-argument <code>setLogFactory</code> method of the selected * The one-argument <code>setLogFactory</code> method of the selected
* {@link org.apache.commons.logging.Log} method, if it exists. * {@link org.apache.commons.logging.Log} method, if it exists.
*/ */
protected Method logMethod = null; protected Method logMethod;
/** /**
* The signature of the <code>setLogFactory</code> method to be used. * The signature of the <code>setLogFactory</code> method to be used.

View File

@@ -41,10 +41,10 @@ public class LogKitLogger implements Log, Serializable {
// ------------------------------------------------------------- Attributes // ------------------------------------------------------------- Attributes
/** Logging goes to this <code>LogKit</code> logger */ /** Logging goes to this <code>LogKit</code> logger */
protected transient volatile Logger logger = null; protected transient volatile Logger logger;
/** Name of this logger */ /** Name of this logger */
protected String name = null; protected String name;
// ------------------------------------------------------------ Constructor // ------------------------------------------------------------ Constructor

View File

@@ -108,7 +108,7 @@ public class SimpleLog implements Log, Serializable {
* in 1.1.1 to fix an existing thread safety bug (SimpleDateFormat.format * in 1.1.1 to fix an existing thread safety bug (SimpleDateFormat.format
* is not thread-safe). * is not thread-safe).
*/ */
static protected DateFormat dateFormatter = null; static protected DateFormat dateFormatter;
// ---------------------------------------------------- Log Level Constants // ---------------------------------------------------- Log Level Constants