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. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@179529 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user