diff --git a/src/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java b/src/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java index 80792b1..b099ac6 100644 --- a/src/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java +++ b/src/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java @@ -57,6 +57,14 @@ public class Jdk13LumberjackLogger implements Log, Serializable { private boolean classAndMethodFound = false; + /** + * This member variable simply ensures that any attempt to initialise + * this class in a pre-1.4 JVM will result in an ExceptionInInitializerError. + * It must not be private, as an optimising compiler could detect that it + * is not used and optimise it away. + */ + protected static final Level dummyLevel = Level.FINE; + // ----------------------------------------------------------- Constructors diff --git a/src/java/org/apache/commons/logging/impl/Jdk14Logger.java b/src/java/org/apache/commons/logging/impl/Jdk14Logger.java index ba2cb8e..56c1e1c 100644 --- a/src/java/org/apache/commons/logging/impl/Jdk14Logger.java +++ b/src/java/org/apache/commons/logging/impl/Jdk14Logger.java @@ -38,6 +38,13 @@ import org.apache.commons.logging.Log; public class Jdk14Logger implements Log, Serializable { + /** + * This member variable simply ensures that any attempt to initialise + * this class in a pre-1.4 JVM will result in an ExceptionInInitializerError. + * It must not be private, as an optimising compiler could detect that it + * is not used and optimise it away. + */ + protected static final Level dummyLevel = Level.FINE; // ----------------------------------------------------------- Constructors