You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/05/25 16:08:34 UTC
[commons-logging] branch master updated: No need to initialize
instance variables to their default values.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-logging.git
The following commit(s) were added to refs/heads/master by this push:
new 9444f07 No need to initialize instance variables to their default values.
9444f07 is described below
commit 9444f0730bb04b6f3678d0501599234d77527210
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon May 25 12:08:30 2020 -0400
No need to initialize instance variables to their default values.
---
.../java/org/apache/commons/logging/LogConfigurationException.java | 2 +-
src/main/java/org/apache/commons/logging/LogFactory.java | 6 +++---
src/main/java/org/apache/commons/logging/LogSource.java | 6 +++---
src/main/java/org/apache/commons/logging/impl/AvalonLogger.java | 3 ++-
.../java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java | 6 +++---
src/main/java/org/apache/commons/logging/impl/Jdk14Logger.java | 4 ++--
src/main/java/org/apache/commons/logging/impl/Log4JLogger.java | 2 +-
src/main/java/org/apache/commons/logging/impl/LogFactoryImpl.java | 4 ++--
src/main/java/org/apache/commons/logging/impl/LogKitLogger.java | 4 ++--
src/main/java/org/apache/commons/logging/impl/SimpleLog.java | 2 +-
10 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/src/main/java/org/apache/commons/logging/LogConfigurationException.java b/src/main/java/org/apache/commons/logging/LogConfigurationException.java
index 9bf174c..b2dd465 100644
--- a/src/main/java/org/apache/commons/logging/LogConfigurationException.java
+++ b/src/main/java/org/apache/commons/logging/LogConfigurationException.java
@@ -69,7 +69,7 @@ public class LogConfigurationException extends RuntimeException {
/**
* The underlying cause of this exception.
*/
- protected Throwable cause = null;
+ protected Throwable cause;
/**
* Return the underlying cause of this exception (if any).
diff --git a/src/main/java/org/apache/commons/logging/LogFactory.java b/src/main/java/org/apache/commons/logging/LogFactory.java
index f3e0d24..1aa28bc 100644
--- a/src/main/java/org/apache/commons/logging/LogFactory.java
+++ b/src/main/java/org/apache/commons/logging/LogFactory.java
@@ -133,7 +133,7 @@ public abstract class LogFactory {
* generated by LogFactory or LogFactoryImpl. When non-null,
* 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
@@ -279,7 +279,7 @@ public abstract class LogFactory {
* The previously constructed <code>LogFactory</code> instances, keyed by
* 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
@@ -296,7 +296,7 @@ public abstract class LogFactory {
* and hashtables don't allow null as a key.
* @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
diff --git a/src/main/java/org/apache/commons/logging/LogSource.java b/src/main/java/org/apache/commons/logging/LogSource.java
index a091891..eb4fff4 100644
--- a/src/main/java/org/apache/commons/logging/LogSource.java
+++ b/src/main/java/org/apache/commons/logging/LogSource.java
@@ -59,13 +59,13 @@ public class LogSource {
static protected Hashtable logs = new Hashtable();
/** Is log4j available (in the current classpath) */
- static protected boolean log4jIsAvailable = false;
+ static protected boolean log4jIsAvailable;
/** Is JDK 1.4 logging available */
- static protected boolean jdk14IsAvailable = false;
+ static protected boolean jdk14IsAvailable;
/** Constructor for current log class */
- static protected Constructor logImplctor = null;
+ static protected Constructor logImplctor;
// ----------------------------------------------------- Class Initializers
diff --git a/src/main/java/org/apache/commons/logging/impl/AvalonLogger.java b/src/main/java/org/apache/commons/logging/impl/AvalonLogger.java
index 90e666c..77bf13d 100644
--- a/src/main/java/org/apache/commons/logging/impl/AvalonLogger.java
+++ b/src/main/java/org/apache/commons/logging/impl/AvalonLogger.java
@@ -52,7 +52,8 @@ import org.apache.commons.logging.Log;
public class AvalonLogger implements Log {
/** Ancestral Avalon logger. */
- private static volatile Logger defaultLogger = null;
+ private static volatile Logger defaultLogger;
+
/** Avalon logger used to perform log. */
private final transient Logger logger;
diff --git a/src/main/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java b/src/main/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java
index bce5364..c7b73de 100644
--- a/src/main/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java
+++ b/src/main/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java
@@ -45,11 +45,11 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
/**
* The underlying Logger implementation we are using.
*/
- protected transient Logger logger = null;
- protected String name = null;
+ protected transient Logger logger;
+ protected String name;
private String sourceClassName = "unknown";
private String sourceMethodName = "unknown";
- private boolean classAndMethodFound = false;
+ private boolean classAndMethodFound;
/**
* This member variable simply ensures that any attempt to initialise
diff --git a/src/main/java/org/apache/commons/logging/impl/Jdk14Logger.java b/src/main/java/org/apache/commons/logging/impl/Jdk14Logger.java
index 18e6b40..8b0791a 100644
--- a/src/main/java/org/apache/commons/logging/impl/Jdk14Logger.java
+++ b/src/main/java/org/apache/commons/logging/impl/Jdk14Logger.java
@@ -60,12 +60,12 @@ public class Jdk14Logger implements Log, Serializable {
/**
* The underlying Logger implementation we are using.
*/
- protected transient Logger logger = null;
+ protected transient Logger logger;
/**
* The name of the logger we are wrapping.
*/
- protected String name = null;
+ protected String name;
// --------------------------------------------------------- Protected Methods
diff --git a/src/main/java/org/apache/commons/logging/impl/Log4JLogger.java b/src/main/java/org/apache/commons/logging/impl/Log4JLogger.java
index d193df8..ae46536 100644
--- a/src/main/java/org/apache/commons/logging/impl/Log4JLogger.java
+++ b/src/main/java/org/apache/commons/logging/impl/Log4JLogger.java
@@ -53,7 +53,7 @@ public class Log4JLogger implements Log, Serializable {
private static final String FQCN = Log4JLogger.class.getName();
/** Log to this logger */
- private transient volatile Logger logger = null;
+ private transient volatile Logger logger;
/** Logger name */
private final String name;
diff --git a/src/main/java/org/apache/commons/logging/impl/LogFactoryImpl.java b/src/main/java/org/apache/commons/logging/impl/LogFactoryImpl.java
index 0d0adb6..c4ccbe7 100644
--- a/src/main/java/org/apache/commons/logging/impl/LogFactoryImpl.java
+++ b/src/main/java/org/apache/commons/logging/impl/LogFactoryImpl.java
@@ -202,7 +202,7 @@ public class LogFactoryImpl extends LogFactory {
* This value is initialized by <code>getLogConstructor()</code>,
* and then returned repeatedly.
*/
- protected Constructor logConstructor = null;
+ protected Constructor logConstructor;
/**
* 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
* {@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.
diff --git a/src/main/java/org/apache/commons/logging/impl/LogKitLogger.java b/src/main/java/org/apache/commons/logging/impl/LogKitLogger.java
index 01c49ca..b0c13b4 100644
--- a/src/main/java/org/apache/commons/logging/impl/LogKitLogger.java
+++ b/src/main/java/org/apache/commons/logging/impl/LogKitLogger.java
@@ -41,10 +41,10 @@ public class LogKitLogger implements Log, Serializable {
// ------------------------------------------------------------- Attributes
/** Logging goes to this <code>LogKit</code> logger */
- protected transient volatile Logger logger = null;
+ protected transient volatile Logger logger;
/** Name of this logger */
- protected String name = null;
+ protected String name;
// ------------------------------------------------------------ Constructor
diff --git a/src/main/java/org/apache/commons/logging/impl/SimpleLog.java b/src/main/java/org/apache/commons/logging/impl/SimpleLog.java
index 43146ef..53f0643 100644
--- a/src/main/java/org/apache/commons/logging/impl/SimpleLog.java
+++ b/src/main/java/org/apache/commons/logging/impl/SimpleLog.java
@@ -108,7 +108,7 @@ public class SimpleLog implements Log, Serializable {
* in 1.1.1 to fix an existing thread safety bug (SimpleDateFormat.format
* is not thread-safe).
*/
- static protected DateFormat dateFormatter = null;
+ static protected DateFormat dateFormatter;
// ---------------------------------------------------- Log Level Constants