commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skitch...@apache.org
Subject svn commit: r179529 - /jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java /jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/Jdk14Logger.java
Date Thu, 02 Jun 2005 06:31:53 GMT
Author: skitching
Date: Wed Jun  1 23:31:52 2005
New Revision: 179529

URL: http://svn.apache.org/viewcvs?rev=179529&view=rev
Log:
Ensure an ExceptionInInitializerError occurs when trying to create an instance
of these classes in pre-1.4 JVMs. Without this, an InvocationTargetException
could be thrown when calling the constructor but that could also be caused
by a number of other reasons which we don't want to ignore.

Modified:
    jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java
    jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/Jdk14Logger.java

Modified: jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java?rev=179529&r1=179528&r2=179529&view=diff
==============================================================================
--- jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java
(original)
+++ jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java
Wed Jun  1 23:31:52 2005
@@ -57,6 +57,14 @@
     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
 
 

Modified: jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/Jdk14Logger.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/Jdk14Logger.java?rev=179529&r1=179528&r2=179529&view=diff
==============================================================================
--- jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/Jdk14Logger.java
(original)
+++ jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/Jdk14Logger.java
Wed Jun  1 23:31:52 2005
@@ -38,6 +38,13 @@
 
 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
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message