Add missing '@Override' annotations.
This commit is contained in:
@@ -73,6 +73,7 @@ public class LogConfigurationException extends RuntimeException {
|
||||
/**
|
||||
* Return the underlying cause of this exception (if any).
|
||||
*/
|
||||
@Override
|
||||
public Throwable getCause() {
|
||||
return this.cause;
|
||||
}
|
||||
|
||||
@@ -296,6 +296,7 @@ public abstract class LogFactory {
|
||||
* and hashtables don't allow null as a key.
|
||||
* @deprecated since 1.1.2
|
||||
*/
|
||||
@Deprecated
|
||||
protected static volatile LogFactory nullClassLoaderFactory;
|
||||
|
||||
/**
|
||||
@@ -811,6 +812,7 @@ public abstract class LogFactory {
|
||||
private static ClassLoader getContextClassLoaderInternal() throws LogConfigurationException {
|
||||
return (ClassLoader)AccessController.doPrivileged(
|
||||
new PrivilegedAction() {
|
||||
@Override
|
||||
public Object run() {
|
||||
return directGetContextClassLoader();
|
||||
}
|
||||
@@ -960,6 +962,7 @@ public abstract class LogFactory {
|
||||
// ClassCastException can be thrown.
|
||||
final Object result = AccessController.doPrivileged(
|
||||
new PrivilegedAction() {
|
||||
@Override
|
||||
public Object run() {
|
||||
return createFactory(factoryClass, classLoader);
|
||||
}
|
||||
@@ -1236,6 +1239,7 @@ public abstract class LogFactory {
|
||||
private static InputStream getResourceAsStream(final ClassLoader loader, final String name) {
|
||||
return (InputStream)AccessController.doPrivileged(
|
||||
new PrivilegedAction() {
|
||||
@Override
|
||||
public Object run() {
|
||||
if (loader != null) {
|
||||
return loader.getResourceAsStream(name);
|
||||
@@ -1262,6 +1266,7 @@ public abstract class LogFactory {
|
||||
private static Enumeration getResources(final ClassLoader loader, final String name) {
|
||||
final PrivilegedAction action =
|
||||
new PrivilegedAction() {
|
||||
@Override
|
||||
public Object run() {
|
||||
try {
|
||||
if (loader != null) {
|
||||
@@ -1298,6 +1303,7 @@ public abstract class LogFactory {
|
||||
private static Properties getProperties(final URL url) {
|
||||
final PrivilegedAction action =
|
||||
new PrivilegedAction() {
|
||||
@Override
|
||||
public Object run() {
|
||||
InputStream stream = null;
|
||||
try {
|
||||
@@ -1445,6 +1451,7 @@ public abstract class LogFactory {
|
||||
throws SecurityException {
|
||||
return (String) AccessController.doPrivileged(
|
||||
new PrivilegedAction() {
|
||||
@Override
|
||||
public Object run() {
|
||||
return System.getProperty(key, def);
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ import org.apache.commons.logging.impl.NoOpLog;
|
||||
*
|
||||
* @version $Id$
|
||||
*/
|
||||
@Deprecated
|
||||
public class LogSource {
|
||||
|
||||
// ------------------------------------------------------- Class Attributes
|
||||
|
||||
@@ -106,6 +106,7 @@ public class AvalonLogger implements Log {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#debug(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void debug(final Object message, final Throwable t) {
|
||||
if (getLogger().isDebugEnabled()) {
|
||||
getLogger().debug(String.valueOf(message), t);
|
||||
@@ -118,6 +119,7 @@ public class AvalonLogger implements Log {
|
||||
* @param message to log.
|
||||
* @see org.apache.commons.logging.Log#debug(Object)
|
||||
*/
|
||||
@Override
|
||||
public void debug(final Object message) {
|
||||
if (getLogger().isDebugEnabled()) {
|
||||
getLogger().debug(String.valueOf(message));
|
||||
@@ -131,6 +133,7 @@ public class AvalonLogger implements Log {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#error(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void error(final Object message, final Throwable t) {
|
||||
if (getLogger().isErrorEnabled()) {
|
||||
getLogger().error(String.valueOf(message), t);
|
||||
@@ -143,6 +146,7 @@ public class AvalonLogger implements Log {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#error(Object)
|
||||
*/
|
||||
@Override
|
||||
public void error(final Object message) {
|
||||
if (getLogger().isErrorEnabled()) {
|
||||
getLogger().error(String.valueOf(message));
|
||||
@@ -156,6 +160,7 @@ public class AvalonLogger implements Log {
|
||||
* @param t log this cause.
|
||||
* @see org.apache.commons.logging.Log#fatal(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void fatal(final Object message, final Throwable t) {
|
||||
if (getLogger().isFatalErrorEnabled()) {
|
||||
getLogger().fatalError(String.valueOf(message), t);
|
||||
@@ -168,6 +173,7 @@ public class AvalonLogger implements Log {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#fatal(Object)
|
||||
*/
|
||||
@Override
|
||||
public void fatal(final Object message) {
|
||||
if (getLogger().isFatalErrorEnabled()) {
|
||||
getLogger().fatalError(String.valueOf(message));
|
||||
@@ -181,6 +187,7 @@ public class AvalonLogger implements Log {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#info(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void info(final Object message, final Throwable t) {
|
||||
if (getLogger().isInfoEnabled()) {
|
||||
getLogger().info(String.valueOf(message), t);
|
||||
@@ -193,6 +200,7 @@ public class AvalonLogger implements Log {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#info(Object)
|
||||
*/
|
||||
@Override
|
||||
public void info(final Object message) {
|
||||
if (getLogger().isInfoEnabled()) {
|
||||
getLogger().info(String.valueOf(message));
|
||||
@@ -203,6 +211,7 @@ public class AvalonLogger implements Log {
|
||||
* Is logging to <code>org.apache.avalon.framework.logger.Logger.debug</code> enabled?
|
||||
* @see org.apache.commons.logging.Log#isDebugEnabled()
|
||||
*/
|
||||
@Override
|
||||
public boolean isDebugEnabled() {
|
||||
return getLogger().isDebugEnabled();
|
||||
}
|
||||
@@ -211,6 +220,7 @@ public class AvalonLogger implements Log {
|
||||
* Is logging to <code>org.apache.avalon.framework.logger.Logger.error</code> enabled?
|
||||
* @see org.apache.commons.logging.Log#isErrorEnabled()
|
||||
*/
|
||||
@Override
|
||||
public boolean isErrorEnabled() {
|
||||
return getLogger().isErrorEnabled();
|
||||
}
|
||||
@@ -219,6 +229,7 @@ public class AvalonLogger implements Log {
|
||||
* Is logging to <code>org.apache.avalon.framework.logger.Logger.fatalError</code> enabled?
|
||||
* @see org.apache.commons.logging.Log#isFatalEnabled()
|
||||
*/
|
||||
@Override
|
||||
public boolean isFatalEnabled() {
|
||||
return getLogger().isFatalErrorEnabled();
|
||||
}
|
||||
@@ -227,6 +238,7 @@ public class AvalonLogger implements Log {
|
||||
* Is logging to <code>org.apache.avalon.framework.logger.Logger.info</code> enabled?
|
||||
* @see org.apache.commons.logging.Log#isInfoEnabled()
|
||||
*/
|
||||
@Override
|
||||
public boolean isInfoEnabled() {
|
||||
return getLogger().isInfoEnabled();
|
||||
}
|
||||
@@ -235,6 +247,7 @@ public class AvalonLogger implements Log {
|
||||
* Is logging to <code>org.apache.avalon.framework.logger.Logger.debug</code> enabled?
|
||||
* @see org.apache.commons.logging.Log#isTraceEnabled()
|
||||
*/
|
||||
@Override
|
||||
public boolean isTraceEnabled() {
|
||||
return getLogger().isDebugEnabled();
|
||||
}
|
||||
@@ -243,6 +256,7 @@ public class AvalonLogger implements Log {
|
||||
* Is logging to <code>org.apache.avalon.framework.logger.Logger.warn</code> enabled?
|
||||
* @see org.apache.commons.logging.Log#isWarnEnabled()
|
||||
*/
|
||||
@Override
|
||||
public boolean isWarnEnabled() {
|
||||
return getLogger().isWarnEnabled();
|
||||
}
|
||||
@@ -254,6 +268,7 @@ public class AvalonLogger implements Log {
|
||||
* @param t log this cause.
|
||||
* @see org.apache.commons.logging.Log#trace(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void trace(final Object message, final Throwable t) {
|
||||
if (getLogger().isDebugEnabled()) {
|
||||
getLogger().debug(String.valueOf(message), t);
|
||||
@@ -266,6 +281,7 @@ public class AvalonLogger implements Log {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#trace(Object)
|
||||
*/
|
||||
@Override
|
||||
public void trace(final Object message) {
|
||||
if (getLogger().isDebugEnabled()) {
|
||||
getLogger().debug(String.valueOf(message));
|
||||
@@ -279,6 +295,7 @@ public class AvalonLogger implements Log {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void warn(final Object message, final Throwable t) {
|
||||
if (getLogger().isWarnEnabled()) {
|
||||
getLogger().warn(String.valueOf(message), t);
|
||||
@@ -291,6 +308,7 @@ public class AvalonLogger implements Log {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#warn(Object)
|
||||
*/
|
||||
@Override
|
||||
public void warn(final Object message) {
|
||||
if (getLogger().isWarnEnabled()) {
|
||||
getLogger().warn(String.valueOf(message));
|
||||
|
||||
@@ -128,6 +128,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#debug(Object)
|
||||
*/
|
||||
@Override
|
||||
public void debug(final Object message) {
|
||||
log(Level.FINE, String.valueOf(message), null);
|
||||
}
|
||||
@@ -139,6 +140,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
* @param exception log this cause
|
||||
* @see org.apache.commons.logging.Log#debug(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void debug(final Object message, final Throwable exception) {
|
||||
log(Level.FINE, String.valueOf(message), exception);
|
||||
}
|
||||
@@ -149,6 +151,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#error(Object)
|
||||
*/
|
||||
@Override
|
||||
public void error(final Object message) {
|
||||
log(Level.SEVERE, String.valueOf(message), null);
|
||||
}
|
||||
@@ -160,6 +163,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
* @param exception log this cause
|
||||
* @see org.apache.commons.logging.Log#error(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void error(final Object message, final Throwable exception) {
|
||||
log(Level.SEVERE, String.valueOf(message), exception);
|
||||
}
|
||||
@@ -170,6 +174,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#fatal(Object)
|
||||
*/
|
||||
@Override
|
||||
public void fatal(final Object message) {
|
||||
log(Level.SEVERE, String.valueOf(message), null);
|
||||
}
|
||||
@@ -181,6 +186,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
* @param exception log this cause
|
||||
* @see org.apache.commons.logging.Log#fatal(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void fatal(final Object message, final Throwable exception) {
|
||||
log(Level.SEVERE, String.valueOf(message), exception);
|
||||
}
|
||||
@@ -201,6 +207,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#info(Object)
|
||||
*/
|
||||
@Override
|
||||
public void info(final Object message) {
|
||||
log(Level.INFO, String.valueOf(message), null);
|
||||
}
|
||||
@@ -212,6 +219,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
* @param exception log this cause
|
||||
* @see org.apache.commons.logging.Log#info(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void info(final Object message, final Throwable exception) {
|
||||
log(Level.INFO, String.valueOf(message), exception);
|
||||
}
|
||||
@@ -219,6 +227,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
/**
|
||||
* Is debug logging currently enabled?
|
||||
*/
|
||||
@Override
|
||||
public boolean isDebugEnabled() {
|
||||
return getLogger().isLoggable(Level.FINE);
|
||||
}
|
||||
@@ -226,6 +235,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
/**
|
||||
* Is error logging currently enabled?
|
||||
*/
|
||||
@Override
|
||||
public boolean isErrorEnabled() {
|
||||
return getLogger().isLoggable(Level.SEVERE);
|
||||
}
|
||||
@@ -233,6 +243,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
/**
|
||||
* Is fatal logging currently enabled?
|
||||
*/
|
||||
@Override
|
||||
public boolean isFatalEnabled() {
|
||||
return getLogger().isLoggable(Level.SEVERE);
|
||||
}
|
||||
@@ -240,6 +251,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
/**
|
||||
* Is info logging currently enabled?
|
||||
*/
|
||||
@Override
|
||||
public boolean isInfoEnabled() {
|
||||
return getLogger().isLoggable(Level.INFO);
|
||||
}
|
||||
@@ -247,6 +259,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
/**
|
||||
* Is trace logging currently enabled?
|
||||
*/
|
||||
@Override
|
||||
public boolean isTraceEnabled() {
|
||||
return getLogger().isLoggable(Level.FINEST);
|
||||
}
|
||||
@@ -254,6 +267,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
/**
|
||||
* Is warn logging currently enabled?
|
||||
*/
|
||||
@Override
|
||||
public boolean isWarnEnabled() {
|
||||
return getLogger().isLoggable(Level.WARNING);
|
||||
}
|
||||
@@ -264,6 +278,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#trace(Object)
|
||||
*/
|
||||
@Override
|
||||
public void trace(final Object message) {
|
||||
log(Level.FINEST, String.valueOf(message), null);
|
||||
}
|
||||
@@ -275,6 +290,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
* @param exception log this cause
|
||||
* @see org.apache.commons.logging.Log#trace(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void trace(final Object message, final Throwable exception) {
|
||||
log(Level.FINEST, String.valueOf(message), exception);
|
||||
}
|
||||
@@ -285,6 +301,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#warn(Object)
|
||||
*/
|
||||
@Override
|
||||
public void warn(final Object message) {
|
||||
log(Level.WARNING, String.valueOf(message), null);
|
||||
}
|
||||
@@ -296,6 +313,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
* @param exception log this cause
|
||||
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void warn(final Object message, final Throwable exception) {
|
||||
log(Level.WARNING, String.valueOf(message), exception);
|
||||
}
|
||||
|
||||
@@ -99,6 +99,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#debug(Object)
|
||||
*/
|
||||
@Override
|
||||
public void debug(final Object message) {
|
||||
log(Level.FINE, String.valueOf(message), null);
|
||||
}
|
||||
@@ -110,6 +111,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
* @param exception log this cause
|
||||
* @see org.apache.commons.logging.Log#debug(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void debug(final Object message, final Throwable exception) {
|
||||
log(Level.FINE, String.valueOf(message), exception);
|
||||
}
|
||||
@@ -120,6 +122,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#error(Object)
|
||||
*/
|
||||
@Override
|
||||
public void error(final Object message) {
|
||||
log(Level.SEVERE, String.valueOf(message), null);
|
||||
}
|
||||
@@ -131,6 +134,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
* @param exception log this cause
|
||||
* @see org.apache.commons.logging.Log#error(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void error(final Object message, final Throwable exception) {
|
||||
log(Level.SEVERE, String.valueOf(message), exception);
|
||||
}
|
||||
@@ -141,6 +145,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#fatal(Object)
|
||||
*/
|
||||
@Override
|
||||
public void fatal(final Object message) {
|
||||
log(Level.SEVERE, String.valueOf(message), null);
|
||||
}
|
||||
@@ -152,6 +157,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
* @param exception log this cause
|
||||
* @see org.apache.commons.logging.Log#fatal(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void fatal(final Object message, final Throwable exception) {
|
||||
log(Level.SEVERE, String.valueOf(message), exception);
|
||||
}
|
||||
@@ -172,6 +178,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#info(Object)
|
||||
*/
|
||||
@Override
|
||||
public void info(final Object message) {
|
||||
log(Level.INFO, String.valueOf(message), null);
|
||||
}
|
||||
@@ -183,6 +190,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
* @param exception log this cause
|
||||
* @see org.apache.commons.logging.Log#info(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void info(final Object message, final Throwable exception) {
|
||||
log(Level.INFO, String.valueOf(message), exception);
|
||||
}
|
||||
@@ -190,6 +198,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
/**
|
||||
* Is debug logging currently enabled?
|
||||
*/
|
||||
@Override
|
||||
public boolean isDebugEnabled() {
|
||||
return getLogger().isLoggable(Level.FINE);
|
||||
}
|
||||
@@ -197,6 +206,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
/**
|
||||
* Is error logging currently enabled?
|
||||
*/
|
||||
@Override
|
||||
public boolean isErrorEnabled() {
|
||||
return getLogger().isLoggable(Level.SEVERE);
|
||||
}
|
||||
@@ -204,6 +214,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
/**
|
||||
* Is fatal logging currently enabled?
|
||||
*/
|
||||
@Override
|
||||
public boolean isFatalEnabled() {
|
||||
return getLogger().isLoggable(Level.SEVERE);
|
||||
}
|
||||
@@ -211,6 +222,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
/**
|
||||
* Is info logging currently enabled?
|
||||
*/
|
||||
@Override
|
||||
public boolean isInfoEnabled() {
|
||||
return getLogger().isLoggable(Level.INFO);
|
||||
}
|
||||
@@ -218,6 +230,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
/**
|
||||
* Is trace logging currently enabled?
|
||||
*/
|
||||
@Override
|
||||
public boolean isTraceEnabled() {
|
||||
return getLogger().isLoggable(Level.FINEST);
|
||||
}
|
||||
@@ -225,6 +238,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
/**
|
||||
* Is warn logging currently enabled?
|
||||
*/
|
||||
@Override
|
||||
public boolean isWarnEnabled() {
|
||||
return getLogger().isLoggable(Level.WARNING);
|
||||
}
|
||||
@@ -235,6 +249,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#trace(Object)
|
||||
*/
|
||||
@Override
|
||||
public void trace(final Object message) {
|
||||
log(Level.FINEST, String.valueOf(message), null);
|
||||
}
|
||||
@@ -246,6 +261,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
* @param exception log this cause
|
||||
* @see org.apache.commons.logging.Log#trace(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void trace(final Object message, final Throwable exception) {
|
||||
log(Level.FINEST, String.valueOf(message), exception);
|
||||
}
|
||||
@@ -256,6 +272,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#warn(Object)
|
||||
*/
|
||||
@Override
|
||||
public void warn(final Object message) {
|
||||
log(Level.WARNING, String.valueOf(message), null);
|
||||
}
|
||||
@@ -267,6 +284,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
* @param exception log this cause
|
||||
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void warn(final Object message, final Throwable exception) {
|
||||
log(Level.WARNING, String.valueOf(message), exception);
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@ public class Log4JLogger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#trace(Object)
|
||||
*/
|
||||
@Override
|
||||
public void trace(final Object message) {
|
||||
getLogger().log(FQCN, traceLevel, message, null);
|
||||
}
|
||||
@@ -141,6 +142,7 @@ public class Log4JLogger implements Log, Serializable {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#trace(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void trace(final Object message, final Throwable t) {
|
||||
getLogger().log(FQCN, traceLevel, message, t);
|
||||
}
|
||||
@@ -151,6 +153,7 @@ public class Log4JLogger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#debug(Object)
|
||||
*/
|
||||
@Override
|
||||
public void debug(final Object message) {
|
||||
getLogger().log(FQCN, Level.DEBUG, message, null);
|
||||
}
|
||||
@@ -162,6 +165,7 @@ public class Log4JLogger implements Log, Serializable {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#debug(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void debug(final Object message, final Throwable t) {
|
||||
getLogger().log(FQCN, Level.DEBUG, message, t);
|
||||
}
|
||||
@@ -172,6 +176,7 @@ public class Log4JLogger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#info(Object)
|
||||
*/
|
||||
@Override
|
||||
public void info(final Object message) {
|
||||
getLogger().log(FQCN, Level.INFO, message, null);
|
||||
}
|
||||
@@ -183,6 +188,7 @@ public class Log4JLogger implements Log, Serializable {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#info(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void info(final Object message, final Throwable t) {
|
||||
getLogger().log(FQCN, Level.INFO, message, t);
|
||||
}
|
||||
@@ -193,6 +199,7 @@ public class Log4JLogger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#warn(Object)
|
||||
*/
|
||||
@Override
|
||||
public void warn(final Object message) {
|
||||
getLogger().log(FQCN, Level.WARN, message, null);
|
||||
}
|
||||
@@ -204,6 +211,7 @@ public class Log4JLogger implements Log, Serializable {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void warn(final Object message, final Throwable t) {
|
||||
getLogger().log(FQCN, Level.WARN, message, t);
|
||||
}
|
||||
@@ -214,6 +222,7 @@ public class Log4JLogger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#error(Object)
|
||||
*/
|
||||
@Override
|
||||
public void error(final Object message) {
|
||||
getLogger().log(FQCN, Level.ERROR, message, null);
|
||||
}
|
||||
@@ -225,6 +234,7 @@ public class Log4JLogger implements Log, Serializable {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#error(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void error(final Object message, final Throwable t) {
|
||||
getLogger().log(FQCN, Level.ERROR, message, t);
|
||||
}
|
||||
@@ -235,6 +245,7 @@ public class Log4JLogger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#fatal(Object)
|
||||
*/
|
||||
@Override
|
||||
public void fatal(final Object message) {
|
||||
getLogger().log(FQCN, Level.FATAL, message, null);
|
||||
}
|
||||
@@ -246,6 +257,7 @@ public class Log4JLogger implements Log, Serializable {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#fatal(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void fatal(final Object message, final Throwable t) {
|
||||
getLogger().log(FQCN, Level.FATAL, message, t);
|
||||
}
|
||||
@@ -269,6 +281,7 @@ public class Log4JLogger implements Log, Serializable {
|
||||
/**
|
||||
* Check whether the Log4j Logger used is enabled for <code>DEBUG</code> priority.
|
||||
*/
|
||||
@Override
|
||||
public boolean isDebugEnabled() {
|
||||
return getLogger().isDebugEnabled();
|
||||
}
|
||||
@@ -276,6 +289,7 @@ public class Log4JLogger implements Log, Serializable {
|
||||
/**
|
||||
* Check whether the Log4j Logger used is enabled for <code>ERROR</code> priority.
|
||||
*/
|
||||
@Override
|
||||
public boolean isErrorEnabled() {
|
||||
return getLogger().isEnabledFor(Level.ERROR);
|
||||
}
|
||||
@@ -283,6 +297,7 @@ public class Log4JLogger implements Log, Serializable {
|
||||
/**
|
||||
* Check whether the Log4j Logger used is enabled for <code>FATAL</code> priority.
|
||||
*/
|
||||
@Override
|
||||
public boolean isFatalEnabled() {
|
||||
return getLogger().isEnabledFor(Level.FATAL);
|
||||
}
|
||||
@@ -290,6 +305,7 @@ public class Log4JLogger implements Log, Serializable {
|
||||
/**
|
||||
* Check whether the Log4j Logger used is enabled for <code>INFO</code> priority.
|
||||
*/
|
||||
@Override
|
||||
public boolean isInfoEnabled() {
|
||||
return getLogger().isInfoEnabled();
|
||||
}
|
||||
@@ -299,6 +315,7 @@ public class Log4JLogger implements Log, Serializable {
|
||||
* When using a log4j version that does not support the TRACE level, this call
|
||||
* will report whether <code>DEBUG</code> is enabled or not.
|
||||
*/
|
||||
@Override
|
||||
public boolean isTraceEnabled() {
|
||||
return getLogger().isEnabledFor(traceLevel);
|
||||
}
|
||||
@@ -306,6 +323,7 @@ public class Log4JLogger implements Log, Serializable {
|
||||
/**
|
||||
* Check whether the Log4j Logger used is enabled for <code>WARN</code> priority.
|
||||
*/
|
||||
@Override
|
||||
public boolean isWarnEnabled() {
|
||||
return getLogger().isEnabledFor(Level.WARN);
|
||||
}
|
||||
|
||||
@@ -242,6 +242,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
*
|
||||
* @param name Name of the attribute to return
|
||||
*/
|
||||
@Override
|
||||
public Object getAttribute(final String name) {
|
||||
return attributes.get(name);
|
||||
}
|
||||
@@ -251,6 +252,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
* configuration attributes. If there are no such attributes, a zero
|
||||
* length array is returned.
|
||||
*/
|
||||
@Override
|
||||
public String[] getAttributeNames() {
|
||||
return (String[]) attributes.keySet().toArray(new String[attributes.size()]);
|
||||
}
|
||||
@@ -264,6 +266,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
* @throws LogConfigurationException if a suitable <code>Log</code>
|
||||
* instance cannot be returned
|
||||
*/
|
||||
@Override
|
||||
public Log getInstance(final Class clazz) throws LogConfigurationException {
|
||||
return getInstance(clazz.getName());
|
||||
}
|
||||
@@ -285,6 +288,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
* @throws LogConfigurationException if a suitable <code>Log</code>
|
||||
* instance cannot be returned
|
||||
*/
|
||||
@Override
|
||||
public Log getInstance(final String name) throws LogConfigurationException {
|
||||
Log instance = (Log) instances.get(name);
|
||||
if (instance == null) {
|
||||
@@ -302,6 +306,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
* throwing away a ClassLoader. Dangling references to objects in that
|
||||
* class loader would prevent garbage collection.
|
||||
*/
|
||||
@Override
|
||||
public void release() {
|
||||
|
||||
logDiagnostic("Releasing all known loggers");
|
||||
@@ -314,6 +319,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
*
|
||||
* @param name Name of the attribute to remove
|
||||
*/
|
||||
@Override
|
||||
public void removeAttribute(final String name) {
|
||||
attributes.remove(name);
|
||||
}
|
||||
@@ -342,6 +348,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
* @param value Value of the attribute to set, or <code>null</code>
|
||||
* to remove any setting for this attribute
|
||||
*/
|
||||
@Override
|
||||
public void setAttribute(final String name, final Object value) {
|
||||
if (logConstructor != null) {
|
||||
logDiagnostic("setAttribute: call too late; configuration already performed.");
|
||||
@@ -450,6 +457,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
* @deprecated Never invoked by this class; subclasses should not assume
|
||||
* it will be.
|
||||
*/
|
||||
@Deprecated
|
||||
protected String getLogClassName() {
|
||||
if (logClassName == null) {
|
||||
discoverLogImplementation(getClass().getName());
|
||||
@@ -474,6 +482,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
* @deprecated Never invoked by this class; subclasses should not assume
|
||||
* it will be.
|
||||
*/
|
||||
@Deprecated
|
||||
protected Constructor getLogConstructor()
|
||||
throws LogConfigurationException {
|
||||
|
||||
@@ -491,6 +500,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
* @deprecated Never invoked by this class; subclasses should not assume
|
||||
* it will be.
|
||||
*/
|
||||
@Deprecated
|
||||
protected boolean isJdk13LumberjackAvailable() {
|
||||
return isLogLibraryAvailable(
|
||||
"Jdk13Lumberjack",
|
||||
@@ -506,6 +516,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
* @deprecated Never invoked by this class; subclasses should not assume
|
||||
* it will be.
|
||||
*/
|
||||
@Deprecated
|
||||
protected boolean isJdk14Available() {
|
||||
return isLogLibraryAvailable(
|
||||
"Jdk14",
|
||||
@@ -518,6 +529,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
* @deprecated Never invoked by this class; subclasses should not assume
|
||||
* it will be.
|
||||
*/
|
||||
@Deprecated
|
||||
protected boolean isLog4JAvailable() {
|
||||
return isLogLibraryAvailable(
|
||||
"Log4J",
|
||||
@@ -595,6 +607,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
throws LogConfigurationException {
|
||||
return (ClassLoader)AccessController.doPrivileged(
|
||||
new PrivilegedAction() {
|
||||
@Override
|
||||
public Object run() {
|
||||
return LogFactory.directGetContextClassLoader();
|
||||
}
|
||||
@@ -614,6 +627,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
throws SecurityException {
|
||||
return (String) AccessController.doPrivileged(
|
||||
new PrivilegedAction() {
|
||||
@Override
|
||||
public Object run() {
|
||||
return System.getProperty(key, def);
|
||||
}
|
||||
@@ -631,6 +645,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
try {
|
||||
return (ClassLoader)AccessController.doPrivileged(
|
||||
new PrivilegedAction() {
|
||||
@Override
|
||||
public Object run() {
|
||||
return cl.getParent();
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@ public class LogKitLogger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#trace(Object)
|
||||
*/
|
||||
@Override
|
||||
public void trace(final Object message) {
|
||||
debug(message);
|
||||
}
|
||||
@@ -96,6 +97,7 @@ public class LogKitLogger implements Log, Serializable {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#trace(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void trace(final Object message, final Throwable t) {
|
||||
debug(message, t);
|
||||
}
|
||||
@@ -106,6 +108,7 @@ public class LogKitLogger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#debug(Object)
|
||||
*/
|
||||
@Override
|
||||
public void debug(final Object message) {
|
||||
if (message != null) {
|
||||
getLogger().debug(String.valueOf(message));
|
||||
@@ -119,6 +122,7 @@ public class LogKitLogger implements Log, Serializable {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#debug(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void debug(final Object message, final Throwable t) {
|
||||
if (message != null) {
|
||||
getLogger().debug(String.valueOf(message), t);
|
||||
@@ -131,6 +135,7 @@ public class LogKitLogger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#info(Object)
|
||||
*/
|
||||
@Override
|
||||
public void info(final Object message) {
|
||||
if (message != null) {
|
||||
getLogger().info(String.valueOf(message));
|
||||
@@ -144,6 +149,7 @@ public class LogKitLogger implements Log, Serializable {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#info(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void info(final Object message, final Throwable t) {
|
||||
if (message != null) {
|
||||
getLogger().info(String.valueOf(message), t);
|
||||
@@ -156,6 +162,7 @@ public class LogKitLogger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#warn(Object)
|
||||
*/
|
||||
@Override
|
||||
public void warn(final Object message) {
|
||||
if (message != null) {
|
||||
getLogger().warn(String.valueOf(message));
|
||||
@@ -169,6 +176,7 @@ public class LogKitLogger implements Log, Serializable {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void warn(final Object message, final Throwable t) {
|
||||
if (message != null) {
|
||||
getLogger().warn(String.valueOf(message), t);
|
||||
@@ -181,6 +189,7 @@ public class LogKitLogger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#error(Object)
|
||||
*/
|
||||
@Override
|
||||
public void error(final Object message) {
|
||||
if (message != null) {
|
||||
getLogger().error(String.valueOf(message));
|
||||
@@ -194,6 +203,7 @@ public class LogKitLogger implements Log, Serializable {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#error(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void error(final Object message, final Throwable t) {
|
||||
if (message != null) {
|
||||
getLogger().error(String.valueOf(message), t);
|
||||
@@ -206,6 +216,7 @@ public class LogKitLogger implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#fatal(Object)
|
||||
*/
|
||||
@Override
|
||||
public void fatal(final Object message) {
|
||||
if (message != null) {
|
||||
getLogger().fatalError(String.valueOf(message));
|
||||
@@ -219,6 +230,7 @@ public class LogKitLogger implements Log, Serializable {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#fatal(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void fatal(final Object message, final Throwable t) {
|
||||
if (message != null) {
|
||||
getLogger().fatalError(String.valueOf(message), t);
|
||||
@@ -228,6 +240,7 @@ public class LogKitLogger implements Log, Serializable {
|
||||
/**
|
||||
* Checks whether the <code>LogKit</code> logger will log messages of priority <code>DEBUG</code>.
|
||||
*/
|
||||
@Override
|
||||
public boolean isDebugEnabled() {
|
||||
return getLogger().isDebugEnabled();
|
||||
}
|
||||
@@ -235,6 +248,7 @@ public class LogKitLogger implements Log, Serializable {
|
||||
/**
|
||||
* Checks whether the <code>LogKit</code> logger will log messages of priority <code>ERROR</code>.
|
||||
*/
|
||||
@Override
|
||||
public boolean isErrorEnabled() {
|
||||
return getLogger().isErrorEnabled();
|
||||
}
|
||||
@@ -242,6 +256,7 @@ public class LogKitLogger implements Log, Serializable {
|
||||
/**
|
||||
* Checks whether the <code>LogKit</code> logger will log messages of priority <code>FATAL_ERROR</code>.
|
||||
*/
|
||||
@Override
|
||||
public boolean isFatalEnabled() {
|
||||
return getLogger().isFatalErrorEnabled();
|
||||
}
|
||||
@@ -249,6 +264,7 @@ public class LogKitLogger implements Log, Serializable {
|
||||
/**
|
||||
* Checks whether the <code>LogKit</code> logger will log messages of priority <code>INFO</code>.
|
||||
*/
|
||||
@Override
|
||||
public boolean isInfoEnabled() {
|
||||
return getLogger().isInfoEnabled();
|
||||
}
|
||||
@@ -256,6 +272,7 @@ public class LogKitLogger implements Log, Serializable {
|
||||
/**
|
||||
* Checks whether the <code>LogKit</code> logger will log messages of priority <code>DEBUG</code>.
|
||||
*/
|
||||
@Override
|
||||
public boolean isTraceEnabled() {
|
||||
return getLogger().isDebugEnabled();
|
||||
}
|
||||
@@ -263,6 +280,7 @@ public class LogKitLogger implements Log, Serializable {
|
||||
/**
|
||||
* Checks whether the <code>LogKit</code> logger will log messages of priority <code>WARN</code>.
|
||||
*/
|
||||
@Override
|
||||
public boolean isWarnEnabled() {
|
||||
return getLogger().isWarnEnabled();
|
||||
}
|
||||
|
||||
@@ -36,28 +36,40 @@ public class NoOpLog implements Log, Serializable {
|
||||
/** Base constructor */
|
||||
public NoOpLog(final String name) { }
|
||||
/** Do nothing */
|
||||
@Override
|
||||
public void trace(final Object message) { }
|
||||
/** Do nothing */
|
||||
@Override
|
||||
public void trace(final Object message, final Throwable t) { }
|
||||
/** Do nothing */
|
||||
@Override
|
||||
public void debug(final Object message) { }
|
||||
/** Do nothing */
|
||||
@Override
|
||||
public void debug(final Object message, final Throwable t) { }
|
||||
/** Do nothing */
|
||||
@Override
|
||||
public void info(final Object message) { }
|
||||
/** Do nothing */
|
||||
@Override
|
||||
public void info(final Object message, final Throwable t) { }
|
||||
/** Do nothing */
|
||||
@Override
|
||||
public void warn(final Object message) { }
|
||||
/** Do nothing */
|
||||
@Override
|
||||
public void warn(final Object message, final Throwable t) { }
|
||||
/** Do nothing */
|
||||
@Override
|
||||
public void error(final Object message) { }
|
||||
/** Do nothing */
|
||||
@Override
|
||||
public void error(final Object message, final Throwable t) { }
|
||||
/** Do nothing */
|
||||
@Override
|
||||
public void fatal(final Object message) { }
|
||||
/** Do nothing */
|
||||
@Override
|
||||
public void fatal(final Object message, final Throwable t) { }
|
||||
|
||||
/**
|
||||
@@ -65,6 +77,7 @@ public class NoOpLog implements Log, Serializable {
|
||||
*
|
||||
* @return false
|
||||
*/
|
||||
@Override
|
||||
public final boolean isDebugEnabled() { return false; }
|
||||
|
||||
/**
|
||||
@@ -72,6 +85,7 @@ public class NoOpLog implements Log, Serializable {
|
||||
*
|
||||
* @return false
|
||||
*/
|
||||
@Override
|
||||
public final boolean isErrorEnabled() { return false; }
|
||||
|
||||
/**
|
||||
@@ -79,6 +93,7 @@ public class NoOpLog implements Log, Serializable {
|
||||
*
|
||||
* @return false
|
||||
*/
|
||||
@Override
|
||||
public final boolean isFatalEnabled() { return false; }
|
||||
|
||||
/**
|
||||
@@ -86,6 +101,7 @@ public class NoOpLog implements Log, Serializable {
|
||||
*
|
||||
* @return false
|
||||
*/
|
||||
@Override
|
||||
public final boolean isInfoEnabled() { return false; }
|
||||
|
||||
/**
|
||||
@@ -93,6 +109,7 @@ public class NoOpLog implements Log, Serializable {
|
||||
*
|
||||
* @return false
|
||||
*/
|
||||
@Override
|
||||
public final boolean isTraceEnabled() { return false; }
|
||||
|
||||
/**
|
||||
@@ -100,5 +117,6 @@ public class NoOpLog implements Log, Serializable {
|
||||
*
|
||||
* @return false
|
||||
*/
|
||||
@Override
|
||||
public final boolean isWarnEnabled() { return false; }
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ public class ServletContextCleaner implements ServletContextListener {
|
||||
* class to release any logging information related to the current
|
||||
* contextClassloader.
|
||||
*/
|
||||
@Override
|
||||
public void contextDestroyed(final ServletContextEvent sce) {
|
||||
final ClassLoader tccl = Thread.currentThread().getContextClassLoader();
|
||||
|
||||
@@ -130,6 +131,7 @@ public class ServletContextCleaner implements ServletContextListener {
|
||||
/**
|
||||
* Invoked when a webapp is deployed. Nothing needs to be done here.
|
||||
*/
|
||||
@Override
|
||||
public void contextInitialized(final ServletContextEvent sce) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@@ -365,6 +365,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#debug(Object)
|
||||
*/
|
||||
@Override
|
||||
public final void debug(final Object message) {
|
||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_DEBUG)) {
|
||||
log(SimpleLog.LOG_LEVEL_DEBUG, message, null);
|
||||
@@ -379,6 +380,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#debug(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public final void debug(final Object message, final Throwable t) {
|
||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_DEBUG)) {
|
||||
log(SimpleLog.LOG_LEVEL_DEBUG, message, t);
|
||||
@@ -391,6 +393,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#trace(Object)
|
||||
*/
|
||||
@Override
|
||||
public final void trace(final Object message) {
|
||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_TRACE)) {
|
||||
log(SimpleLog.LOG_LEVEL_TRACE, message, null);
|
||||
@@ -404,6 +407,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#trace(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public final void trace(final Object message, final Throwable t) {
|
||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_TRACE)) {
|
||||
log(SimpleLog.LOG_LEVEL_TRACE, message, t);
|
||||
@@ -416,6 +420,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#info(Object)
|
||||
*/
|
||||
@Override
|
||||
public final void info(final Object message) {
|
||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_INFO)) {
|
||||
log(SimpleLog.LOG_LEVEL_INFO,message,null);
|
||||
@@ -429,6 +434,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#info(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public final void info(final Object message, final Throwable t) {
|
||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_INFO)) {
|
||||
log(SimpleLog.LOG_LEVEL_INFO, message, t);
|
||||
@@ -441,6 +447,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#warn(Object)
|
||||
*/
|
||||
@Override
|
||||
public final void warn(final Object message) {
|
||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_WARN)) {
|
||||
log(SimpleLog.LOG_LEVEL_WARN, message, null);
|
||||
@@ -454,6 +461,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public final void warn(final Object message, final Throwable t) {
|
||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_WARN)) {
|
||||
log(SimpleLog.LOG_LEVEL_WARN, message, t);
|
||||
@@ -466,6 +474,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#error(Object)
|
||||
*/
|
||||
@Override
|
||||
public final void error(final Object message) {
|
||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_ERROR)) {
|
||||
log(SimpleLog.LOG_LEVEL_ERROR, message, null);
|
||||
@@ -479,6 +488,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#error(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public final void error(final Object message, final Throwable t) {
|
||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_ERROR)) {
|
||||
log(SimpleLog.LOG_LEVEL_ERROR, message, t);
|
||||
@@ -491,6 +501,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
* @param message to log
|
||||
* @see org.apache.commons.logging.Log#fatal(Object)
|
||||
*/
|
||||
@Override
|
||||
public final void fatal(final Object message) {
|
||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_FATAL)) {
|
||||
log(SimpleLog.LOG_LEVEL_FATAL, message, null);
|
||||
@@ -504,6 +515,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
* @param t log this cause
|
||||
* @see org.apache.commons.logging.Log#fatal(Object, Throwable)
|
||||
*/
|
||||
@Override
|
||||
public final void fatal(final Object message, final Throwable t) {
|
||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_FATAL)) {
|
||||
log(SimpleLog.LOG_LEVEL_FATAL, message, t);
|
||||
@@ -517,6 +529,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
* concatenation to be avoided when the message will be ignored by the
|
||||
* logger.
|
||||
*/
|
||||
@Override
|
||||
public final boolean isDebugEnabled() {
|
||||
return isLevelEnabled(SimpleLog.LOG_LEVEL_DEBUG);
|
||||
}
|
||||
@@ -528,6 +541,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
* concatenation to be avoided when the message will be ignored by the
|
||||
* logger.
|
||||
*/
|
||||
@Override
|
||||
public final boolean isErrorEnabled() {
|
||||
return isLevelEnabled(SimpleLog.LOG_LEVEL_ERROR);
|
||||
}
|
||||
@@ -539,6 +553,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
* concatenation to be avoided when the message will be ignored by the
|
||||
* logger.
|
||||
*/
|
||||
@Override
|
||||
public final boolean isFatalEnabled() {
|
||||
return isLevelEnabled(SimpleLog.LOG_LEVEL_FATAL);
|
||||
}
|
||||
@@ -550,6 +565,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
* concatenation to be avoided when the message will be ignored by the
|
||||
* logger.
|
||||
*/
|
||||
@Override
|
||||
public final boolean isInfoEnabled() {
|
||||
return isLevelEnabled(SimpleLog.LOG_LEVEL_INFO);
|
||||
}
|
||||
@@ -561,6 +577,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
* concatenation to be avoided when the message will be ignored by the
|
||||
* logger.
|
||||
*/
|
||||
@Override
|
||||
public final boolean isTraceEnabled() {
|
||||
return isLevelEnabled(SimpleLog.LOG_LEVEL_TRACE);
|
||||
}
|
||||
@@ -572,6 +589,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
* concatenation to be avoided when the message will be ignored by the
|
||||
* logger.
|
||||
*/
|
||||
@Override
|
||||
public final boolean isWarnEnabled() {
|
||||
return isLevelEnabled(SimpleLog.LOG_LEVEL_WARN);
|
||||
}
|
||||
@@ -640,6 +658,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
private static InputStream getResourceAsStream(final String name) {
|
||||
return (InputStream)AccessController.doPrivileged(
|
||||
new PrivilegedAction() {
|
||||
@Override
|
||||
public Object run() {
|
||||
final ClassLoader threadCL = getContextClassLoader();
|
||||
|
||||
|
||||
@@ -138,6 +138,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
/**
|
||||
*@see Hashtable
|
||||
*/
|
||||
@Override
|
||||
public boolean containsKey(final Object key) {
|
||||
// purge should not be required
|
||||
final Referenced referenced = new Referenced(key);
|
||||
@@ -147,6 +148,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
/**
|
||||
*@see Hashtable
|
||||
*/
|
||||
@Override
|
||||
public Enumeration elements() {
|
||||
purge();
|
||||
return super.elements();
|
||||
@@ -155,6 +157,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
/**
|
||||
*@see Hashtable
|
||||
*/
|
||||
@Override
|
||||
public Set entrySet() {
|
||||
purge();
|
||||
final Set referencedEntries = super.entrySet();
|
||||
@@ -175,6 +178,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
/**
|
||||
*@see Hashtable
|
||||
*/
|
||||
@Override
|
||||
public Object get(final Object key) {
|
||||
// for performance reasons, no purge
|
||||
final Referenced referenceKey = new Referenced(key);
|
||||
@@ -184,13 +188,16 @@ public final class WeakHashtable extends Hashtable {
|
||||
/**
|
||||
*@see Hashtable
|
||||
*/
|
||||
@Override
|
||||
public Enumeration keys() {
|
||||
purge();
|
||||
final Enumeration enumer = super.keys();
|
||||
return new Enumeration() {
|
||||
@Override
|
||||
public boolean hasMoreElements() {
|
||||
return enumer.hasMoreElements();
|
||||
}
|
||||
@Override
|
||||
public Object nextElement() {
|
||||
final Referenced nextReference = (Referenced) enumer.nextElement();
|
||||
return nextReference.getValue();
|
||||
@@ -201,6 +208,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
/**
|
||||
*@see Hashtable
|
||||
*/
|
||||
@Override
|
||||
public Set keySet() {
|
||||
purge();
|
||||
final Set referencedKeys = super.keySet();
|
||||
@@ -218,6 +226,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
/**
|
||||
*@see Hashtable
|
||||
*/
|
||||
@Override
|
||||
public synchronized Object put(final Object key, final Object value) {
|
||||
// check for nulls, ensuring semantics match superclass
|
||||
if (key == null) {
|
||||
@@ -245,6 +254,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
/**
|
||||
*@see Hashtable
|
||||
*/
|
||||
@Override
|
||||
public void putAll(final Map t) {
|
||||
if (t != null) {
|
||||
final Set entrySet = t.entrySet();
|
||||
@@ -258,6 +268,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
/**
|
||||
*@see Hashtable
|
||||
*/
|
||||
@Override
|
||||
public Collection values() {
|
||||
purge();
|
||||
return super.values();
|
||||
@@ -266,6 +277,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
/**
|
||||
*@see Hashtable
|
||||
*/
|
||||
@Override
|
||||
public synchronized Object remove(final Object key) {
|
||||
// for performance reasons, only purge every
|
||||
// MAX_CHANGES_BEFORE_PURGE times
|
||||
@@ -283,6 +295,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
/**
|
||||
*@see Hashtable
|
||||
*/
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
purge();
|
||||
return super.isEmpty();
|
||||
@@ -291,6 +304,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
/**
|
||||
*@see Hashtable
|
||||
*/
|
||||
@Override
|
||||
public int size() {
|
||||
purge();
|
||||
return super.size();
|
||||
@@ -299,6 +313,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
/**
|
||||
*@see Hashtable
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
purge();
|
||||
return super.toString();
|
||||
@@ -307,6 +322,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
/**
|
||||
* @see Hashtable
|
||||
*/
|
||||
@Override
|
||||
protected void rehash() {
|
||||
// purge here to save the effort of rehashing dead entries
|
||||
purge();
|
||||
@@ -359,6 +375,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
boolean result = false;
|
||||
if (o instanceof Map.Entry) {
|
||||
@@ -373,19 +390,23 @@ public final class WeakHashtable extends Hashtable {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (getKey()==null ? 0 : getKey().hashCode()) ^
|
||||
(getValue()==null ? 0 : getValue().hashCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object setValue(final Object value) {
|
||||
throw new UnsupportedOperationException("Entry.setValue is not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getKey() {
|
||||
return key;
|
||||
}
|
||||
@@ -420,6 +441,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return hashCode;
|
||||
}
|
||||
@@ -428,6 +450,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
return reference.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
boolean result = false;
|
||||
if (o instanceof Referenced) {
|
||||
|
||||
@@ -29,6 +29,7 @@ public class AltHashtable extends Hashtable {
|
||||
public static Object lastKey;
|
||||
public static Object lastValue;
|
||||
|
||||
@Override
|
||||
public Object put(final Object key, final Object value) {
|
||||
lastKey = key;
|
||||
lastValue = value;
|
||||
|
||||
@@ -53,6 +53,7 @@ public class AltHashtableTestCase extends TestCase {
|
||||
* This is true of all JVMs I know of; and if it isn't then this test will
|
||||
* fail and someone will tell us.
|
||||
*/
|
||||
@Override
|
||||
public void setUp() {
|
||||
System.setProperty(
|
||||
"org.apache.commons.logging.LogFactory.HashtableImpl",
|
||||
|
||||
@@ -81,6 +81,7 @@ public class LoadTestCase extends TestCase{
|
||||
|
||||
// not very trivial to emulate we must implement "findClass",
|
||||
// but it will delegete to junit class loder first
|
||||
@Override
|
||||
public Class loadClass(final String name)throws ClassNotFoundException{
|
||||
|
||||
//isolates all logging classes, application in the same classloader too.
|
||||
@@ -211,11 +212,13 @@ public class LoadTestCase extends TestCase{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUp() {
|
||||
// save state before test starts so we can restore it when test ends
|
||||
origContextClassLoader = Thread.currentThread().getContextClassLoader();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tearDown() {
|
||||
// restore original state so a test can't stuff up later tests.
|
||||
Thread.currentThread().setContextClassLoader(origContextClassLoader);
|
||||
|
||||
@@ -20,6 +20,7 @@ package org.apache.commons.logging;
|
||||
public class LogTestCase extends AbstractLogTest
|
||||
{
|
||||
|
||||
@Override
|
||||
public Log getLogObject()
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -101,6 +101,7 @@ public class PathableClassLoader extends URLClassLoader {
|
||||
* use addLogicalLib instead, then define the location for that logical
|
||||
* library in the build.xml file.
|
||||
*/
|
||||
@Override
|
||||
public void addURL(final URL url) {
|
||||
super.addURL(url);
|
||||
}
|
||||
@@ -291,6 +292,7 @@ public class PathableClassLoader extends URLClassLoader {
|
||||
* prefix associated with that entry then attempt to load the class via
|
||||
* that entries' classloader.
|
||||
*/
|
||||
@Override
|
||||
protected Class loadClass(final String name, final boolean resolve)
|
||||
throws ClassNotFoundException {
|
||||
// just for performance, check java and javax
|
||||
@@ -340,6 +342,7 @@ public class PathableClassLoader extends URLClassLoader {
|
||||
* the resource is looked for in the local classpath before the parent
|
||||
* loader is consulted.
|
||||
*/
|
||||
@Override
|
||||
public URL getResource(final String name) {
|
||||
if (parentFirst) {
|
||||
return super.getResource(name);
|
||||
@@ -413,6 +416,7 @@ public class PathableClassLoader extends URLClassLoader {
|
||||
* the resource is looked for in the local classpath before the parent
|
||||
* loader is consulted.
|
||||
*/
|
||||
@Override
|
||||
public InputStream getResourceAsStream(final String name) {
|
||||
if (parentFirst) {
|
||||
return super.getResourceAsStream(name);
|
||||
|
||||
@@ -133,6 +133,7 @@ public class PathableTestSuite extends TestSuite {
|
||||
* The context classloader and system properties are saved before each
|
||||
* test, and restored after the test completes to better isolate tests.
|
||||
*/
|
||||
@Override
|
||||
public void runTest(final Test test, final TestResult result) {
|
||||
final ClassLoader origContext = Thread.currentThread().getContextClassLoader();
|
||||
final Properties oldSysProps = (Properties) System.getProperties().clone();
|
||||
|
||||
@@ -20,6 +20,7 @@ import org.apache.commons.logging.impl.SimpleLog;
|
||||
|
||||
public class SimpleLogTestCase extends AbstractLogTest
|
||||
{
|
||||
@Override
|
||||
public Log getLogObject()
|
||||
{
|
||||
return new SimpleLog(this.getClass().getName());
|
||||
|
||||
@@ -36,6 +36,7 @@ public class AvalonLoggerTestCase extends AbstractLogTest {
|
||||
return suite;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Log getLogObject() {
|
||||
// Output does not seem to be used, so don't display it.
|
||||
final Log log = new AvalonLogger(new NullLogger());
|
||||
|
||||
@@ -87,6 +87,7 @@ public class FirstPriorityConfigTestCase extends TestCase {
|
||||
/**
|
||||
* Set up instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
@@ -94,6 +95,7 @@ public class FirstPriorityConfigTestCase extends TestCase {
|
||||
/**
|
||||
* Tear down instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void tearDown() {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
|
||||
@@ -105,6 +105,7 @@ public class PriorityConfigTestCase extends TestCase {
|
||||
/**
|
||||
* Set up instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
@@ -112,6 +113,7 @@ public class PriorityConfigTestCase extends TestCase {
|
||||
/**
|
||||
* Tear down instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void tearDown() {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ public class WeakHashtableTestCase extends TestCase {
|
||||
super(testName);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
weakHashtable = new WeakHashtable();
|
||||
@@ -273,6 +274,7 @@ public class WeakHashtableTestCase extends TestCase {
|
||||
super(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
for (int i = 0; i < RUN_LOOPS; i++) {
|
||||
hashtable.put("key" + ":" + i%10, Boolean.TRUE);
|
||||
|
||||
@@ -165,6 +165,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
/**
|
||||
* Set up instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
setUpManager
|
||||
("org/apache/commons/logging/jdk14/CustomConfig.properties");
|
||||
@@ -200,6 +201,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
/**
|
||||
* Tear down instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void tearDown() {
|
||||
super.tearDown();
|
||||
handlers = null;
|
||||
@@ -259,6 +261,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
|
||||
|
||||
// Test Serializability of Log instance
|
||||
@Override
|
||||
public void testSerializable() throws Exception {
|
||||
|
||||
super.testSerializable();
|
||||
@@ -271,6 +274,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
|
||||
|
||||
// Check the log instance
|
||||
@Override
|
||||
protected void checkLog() {
|
||||
|
||||
assertNotNull("Log exists", log);
|
||||
|
||||
@@ -78,6 +78,7 @@ public class DefaultConfigTestCase extends TestCase {
|
||||
/**
|
||||
* Set up instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
setUpFactory();
|
||||
setUpLog("TestLogger");
|
||||
@@ -100,6 +101,7 @@ public class DefaultConfigTestCase extends TestCase {
|
||||
/**
|
||||
* Tear down instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void tearDown() {
|
||||
log = null;
|
||||
factory = null;
|
||||
|
||||
@@ -53,15 +53,18 @@ public class TestHandler extends Handler {
|
||||
// -------------------------------------------------------- Handler Methods
|
||||
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void flush() {
|
||||
records.clear();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void publish(final LogRecord record) {
|
||||
records.add(record);
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ public abstract class StandardTests extends TestCase {
|
||||
/**
|
||||
* Set up instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
@@ -65,6 +66,7 @@ public abstract class StandardTests extends TestCase {
|
||||
/**
|
||||
* Tear down instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void tearDown() {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.apache.log4j.Logger;
|
||||
|
||||
public class Log4j12StandardTests extends StandardTests {
|
||||
|
||||
@Override
|
||||
public void setUpTestAppender(final List logEvents) {
|
||||
final TestAppender appender = new TestAppender(logEvents);
|
||||
final Logger rootLogger = Logger.getRootLogger();
|
||||
|
||||
@@ -49,6 +49,7 @@ public class TestAppender extends AppenderSkeleton {
|
||||
|
||||
// ------------------------------------------------------- Appender Methods
|
||||
|
||||
@Override
|
||||
protected void append(final LoggingEvent event) {
|
||||
final StandardTests.LogEvent lev = new StandardTests.LogEvent();
|
||||
|
||||
@@ -70,10 +71,12 @@ public class TestAppender extends AppenderSkeleton {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean requiresLayout() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ public class StandardTestCase extends AbstractLogTest {
|
||||
/**
|
||||
* Set up instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
LogFactory.releaseAll();
|
||||
|
||||
@@ -90,6 +91,7 @@ public class StandardTestCase extends AbstractLogTest {
|
||||
/**
|
||||
* Tear down instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void tearDown() {
|
||||
log = null;
|
||||
factory = null;
|
||||
@@ -102,6 +104,7 @@ public class StandardTestCase extends AbstractLogTest {
|
||||
* Override the abstract method from the parent class so that the
|
||||
* inherited tests can access the right Log object type.
|
||||
*/
|
||||
@Override
|
||||
public Log getLogObject()
|
||||
{
|
||||
return new LogKitLogger(this.getClass().getName());
|
||||
|
||||
@@ -37,6 +37,7 @@ public class NoOpLogTestCase extends AbstractLogTest
|
||||
/**
|
||||
* Set up instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
LogFactory.releaseAll();
|
||||
|
||||
@@ -48,6 +49,7 @@ public class NoOpLogTestCase extends AbstractLogTest
|
||||
/**
|
||||
* Tear down instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void tearDown() {
|
||||
LogFactory.releaseAll();
|
||||
System.getProperties().remove("org.apache.commons.logging.Log");
|
||||
@@ -57,6 +59,7 @@ public class NoOpLogTestCase extends AbstractLogTest
|
||||
* Override the abstract method from the parent class so that the
|
||||
* inherited tests can access the right Log object type.
|
||||
*/
|
||||
@Override
|
||||
public Log getLogObject()
|
||||
{
|
||||
return new NoOpLog(this.getClass().getName());
|
||||
|
||||
@@ -58,6 +58,7 @@ public class MockSecurityManager extends SecurityManager {
|
||||
return untrustedCodeCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkPermission(final Permission p) throws SecurityException {
|
||||
if (setSecurityManagerPerm.implies(p)) {
|
||||
// ok, allow this; we don't want to block any calls to setSecurityManager
|
||||
|
||||
@@ -69,11 +69,13 @@ public class SecurityAllowedTestCase extends TestCase
|
||||
return new PathableTestSuite(testClass, parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUp() {
|
||||
// save security manager so it can be restored in tearDown
|
||||
oldSecMgr = System.getSecurityManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tearDown() {
|
||||
// Restore, so other tests don't get stuffed up if a test
|
||||
// sets a custom security manager.
|
||||
|
||||
@@ -73,6 +73,7 @@ public class SecurityForbiddenTestCase extends TestCase
|
||||
return new PathableTestSuite(testClass, parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUp() {
|
||||
// save security manager so it can be restored in tearDown
|
||||
oldSecMgr = System.getSecurityManager();
|
||||
@@ -84,6 +85,7 @@ public class SecurityForbiddenTestCase extends TestCase
|
||||
otherClassLoader = classLoader;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tearDown() {
|
||||
// Restore, so other tests don't get stuffed up if a test
|
||||
// sets a custom security manager.
|
||||
|
||||
@@ -73,6 +73,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
* when they are created. Subclasses can override this method to
|
||||
* define properties that suit them.
|
||||
*/
|
||||
@Override
|
||||
public void setProperties() {
|
||||
System.setProperty(
|
||||
"org.apache.commons.logging.Log",
|
||||
@@ -85,6 +86,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
/**
|
||||
* Set up instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
LogFactory.releaseAll();
|
||||
setProperties();
|
||||
@@ -121,6 +123,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
/**
|
||||
* Tear down instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void tearDown() {
|
||||
super.tearDown();
|
||||
expected = null;
|
||||
@@ -151,6 +154,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
|
||||
|
||||
// Test Serializability of standard instance
|
||||
@Override
|
||||
public void testSerializable() throws Exception {
|
||||
|
||||
((DecoratedSimpleLog) log).clearCache();
|
||||
@@ -166,6 +170,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
|
||||
|
||||
// Check the decorated log instance
|
||||
@Override
|
||||
protected void checkDecorated() {
|
||||
|
||||
assertNotNull("Log exists", log);
|
||||
@@ -224,6 +229,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
|
||||
|
||||
// Check the standard log instance
|
||||
@Override
|
||||
protected void checkStandard() {
|
||||
|
||||
checkDecorated();
|
||||
|
||||
@@ -64,6 +64,7 @@ public class DateTimeCustomConfigTestCase extends CustomConfigTestCase {
|
||||
* set up the props defined in the parent class setProperties method,
|
||||
* and add a few to configure the SimpleLog class date/time output.
|
||||
*/
|
||||
@Override
|
||||
public void setProperties() {
|
||||
super.setProperties();
|
||||
|
||||
@@ -78,6 +79,7 @@ public class DateTimeCustomConfigTestCase extends CustomConfigTestCase {
|
||||
/**
|
||||
* Set up instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
}
|
||||
@@ -86,6 +88,7 @@ public class DateTimeCustomConfigTestCase extends CustomConfigTestCase {
|
||||
// ----------------------------------------------------------- Methods
|
||||
|
||||
/** Checks that the date time format has been successfully set */
|
||||
@Override
|
||||
protected void checkDecoratedDateTime() {
|
||||
assertEquals("Expected date format to be set", "dd.mm.yyyy",
|
||||
((DecoratedSimpleLog) log).getDateTimeFormat());
|
||||
@@ -98,6 +101,7 @@ public class DateTimeCustomConfigTestCase extends CustomConfigTestCase {
|
||||
}
|
||||
|
||||
/** Hook for subclassses */
|
||||
@Override
|
||||
protected void checkShowDateTime() {
|
||||
assertTrue(((DecoratedSimpleLog) log).getShowDateTime());
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ public class DecoratedSimpleLog extends SimpleLog {
|
||||
|
||||
|
||||
// Cache logged messages
|
||||
@Override
|
||||
protected void log(final int type, final Object message, final Throwable t) {
|
||||
|
||||
super.log(type, message, t);
|
||||
|
||||
@@ -100,6 +100,7 @@ public class DefaultConfigTestCase extends TestCase {
|
||||
/**
|
||||
* Set up instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
LogFactory.releaseAll();
|
||||
setProperties();
|
||||
@@ -110,6 +111,7 @@ public class DefaultConfigTestCase extends TestCase {
|
||||
/**
|
||||
* Tear down instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void tearDown() {
|
||||
log = null;
|
||||
factory = null;
|
||||
|
||||
@@ -22,23 +22,41 @@ public class MyLog implements Log {
|
||||
|
||||
public MyLog(final String category) {}
|
||||
|
||||
@Override
|
||||
public boolean isDebugEnabled() { return false; }
|
||||
@Override
|
||||
public boolean isErrorEnabled() { return false; }
|
||||
@Override
|
||||
public boolean isFatalEnabled() { return false; }
|
||||
@Override
|
||||
public boolean isInfoEnabled() { return false; }
|
||||
@Override
|
||||
public boolean isTraceEnabled() { return false; }
|
||||
@Override
|
||||
public boolean isWarnEnabled() { return false; }
|
||||
|
||||
@Override
|
||||
public void trace(final Object message) {}
|
||||
@Override
|
||||
public void trace(final Object message, final Throwable t) {}
|
||||
@Override
|
||||
public void debug(final Object message) {}
|
||||
@Override
|
||||
public void debug(final Object message, final Throwable t) {}
|
||||
@Override
|
||||
public void info(final Object message) {}
|
||||
@Override
|
||||
public void info(final Object message, final Throwable t) {}
|
||||
@Override
|
||||
public void warn(final Object message) {}
|
||||
@Override
|
||||
public void warn(final Object message, final Throwable t) {}
|
||||
@Override
|
||||
public void error(final Object message) {}
|
||||
@Override
|
||||
public void error(final Object message, final Throwable t) {}
|
||||
@Override
|
||||
public void fatal(final Object message) {}
|
||||
@Override
|
||||
public void fatal(final Object message, final Throwable t) {}
|
||||
}
|
||||
|
||||
@@ -22,11 +22,18 @@ import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
public class MyLogFactoryImpl extends LogFactory {
|
||||
@Override
|
||||
public Object getAttribute(final String name) { return null; }
|
||||
@Override
|
||||
public String[] getAttributeNames() { return null; }
|
||||
@Override
|
||||
public Log getInstance(final Class clazz) { return null; }
|
||||
@Override
|
||||
public Log getInstance(final String name) { return null; }
|
||||
@Override
|
||||
public void release() {}
|
||||
@Override
|
||||
public void removeAttribute(final String name) {}
|
||||
@Override
|
||||
public void setAttribute(final String name, final Object value) {}
|
||||
}
|
||||
|
||||
@@ -91,6 +91,7 @@ public class TcclDisabledTestCase extends TestCase {
|
||||
/**
|
||||
* Set up instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
@@ -98,6 +99,7 @@ public class TcclDisabledTestCase extends TestCase {
|
||||
/**
|
||||
* Tear down instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void tearDown() {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
|
||||
@@ -91,6 +91,7 @@ public class TcclEnabledTestCase extends TestCase {
|
||||
/**
|
||||
* Set up instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
@@ -98,6 +99,7 @@ public class TcclEnabledTestCase extends TestCase {
|
||||
/**
|
||||
* Tear down instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void tearDown() {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ public class TcclDisabledTestCase extends TestCase {
|
||||
/**
|
||||
* Set up instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
@@ -100,6 +101,7 @@ public class TcclDisabledTestCase extends TestCase {
|
||||
/**
|
||||
* Tear down instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void tearDown() {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@ public class TcclEnabledTestCase extends TestCase {
|
||||
/**
|
||||
* Set up instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
@@ -94,6 +95,7 @@ public class TcclEnabledTestCase extends TestCase {
|
||||
/**
|
||||
* Tear down instance variables required by this test case.
|
||||
*/
|
||||
@Override
|
||||
public void tearDown() {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user