Modified: logging/log4j/log4j2/trunk/jcl-bridge/src/test/java/org/apache/logging/log4j/jcl/LoggerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/jcl-bridge/src/test/java/org/apache/logging/log4j/jcl/LoggerTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/jcl-bridge/src/test/java/org/apache/logging/log4j/jcl/LoggerTest.java (original)
+++ logging/log4j/log4j2/trunk/jcl-bridge/src/test/java/org/apache/logging/log4j/jcl/LoggerTest.java Mon Dec 10 19:36:06 2012
@@ -48,14 +48,14 @@ public class LoggerTest {
@BeforeClass
public static void setupClass() {
System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
- LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
- Configuration config = ctx.getConfiguration();
+ final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
+ final Configuration config = ctx.getConfiguration();
}
@AfterClass
public static void cleanupClass() {
System.clearProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
- LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
+ final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
ctx.reconfigure();
StatusLogger.getLogger().reset();
}
@@ -74,15 +74,15 @@ public class LoggerTest {
verify("List", "o.a.l.l.j.LoggerTest Info Message {} MDC{}" + LINE_SEP);
}
- private void verify(String name, String expected) {
- LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
- Map<String, Appender> list = ctx.getConfiguration().getAppenders();
- Appender listApp = list.get(name);
+ private void verify(final String name, final String expected) {
+ final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
+ final Map<String, Appender> list = ctx.getConfiguration().getAppenders();
+ final Appender listApp = list.get(name);
assertNotNull("Missing Appender", listApp);
assertTrue("Not a ListAppender", listApp instanceof ListAppender);
- List<String> events = ((ListAppender) listApp).getMessages();
+ final List<String> events = ((ListAppender) listApp).getMessages();
assertTrue("Incorrect number of messages. Expected 1 Actual " + events.size(), events.size()== 1);
- String actual = events.get(0);
+ final String actual = events.get(0);
assertEquals("Incorrect message. Expected " + expected + ". Actual " + actual, expected, actual);
((ListAppender) listApp).clear();
}
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/BasicConfigurator.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/BasicConfigurator.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/BasicConfigurator.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/BasicConfigurator.java Mon Dec 10 19:36:06 2012
@@ -34,7 +34,7 @@ public class BasicConfigurator {
/**
* No-op implementation.
*/
- public static void configure(Appender appender) {
+ public static void configure(final Appender appender) {
}
/**
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Category.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Category.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Category.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Category.java Mon Dec 10 19:36:06 2012
@@ -57,7 +57,7 @@ public class Category {
* @param context The LoggerContext.
* @param name The name of the Logger.
*/
- protected Category(LoggerContext context, String name) {
+ protected Category(final LoggerContext context, final String name) {
this.logger = context.getLogger(name);
}
@@ -65,38 +65,38 @@ public class Category {
* Constructor exposed by Log4j 1.2.
* @param name The name of the Logger.
*/
- protected Category(String name) {
+ protected Category(final String name) {
this((LoggerContext) PrivateManager.getContext(), name);
}
- private Category(org.apache.logging.log4j.core.Logger logger) {
+ private Category(final org.apache.logging.log4j.core.Logger logger) {
this.logger = logger;
}
- public static Category getInstance(String name) {
+ public static Category getInstance(final String name) {
return getInstance((LoggerContext) PrivateManager.getContext(), name, loggerFactory);
}
- static Category getInstance(LoggerContext context, String name) {
+ static Category getInstance(final LoggerContext context, final String name) {
return getInstance(context, name, loggerFactory);
}
- static Category getInstance(LoggerContext context, String name, LoggerFactory factory) {
- ConcurrentMap<String, Logger> loggers = getLoggersMap(context);
+ static Category getInstance(final LoggerContext context, final String name, final LoggerFactory factory) {
+ final ConcurrentMap<String, Logger> loggers = getLoggersMap(context);
Logger logger = loggers.get(name);
if (logger != null) {
return logger;
}
logger = factory.makeNewLoggerInstance(context, name);
- Logger prev = loggers.putIfAbsent(name, logger);
+ final Logger prev = loggers.putIfAbsent(name, logger);
return prev == null ? logger : prev;
}
- public static Category getInstance(Class clazz) {
+ public static Category getInstance(final Class clazz) {
return getInstance(clazz.getName());
}
- static Category getInstance(LoggerContext context, Class clazz) {
+ static Category getInstance(final LoggerContext context, final Class clazz) {
return getInstance(context, clazz.getName());
}
@@ -109,12 +109,12 @@ public class Category {
}
public final Category getParent() {
- org.apache.logging.log4j.core.Logger parent = logger.getParent();
+ final org.apache.logging.log4j.core.Logger parent = logger.getParent();
if (parent == null) {
return null;
}
- ConcurrentMap<String, Logger> loggers = getLoggersMap(logger.getContext());
- Logger l = loggers.get(parent.getName());
+ final ConcurrentMap<String, Logger> loggers = getLoggersMap(logger.getContext());
+ final Logger l = loggers.get(parent.getName());
return l == null ? new Category(parent) : l;
}
@@ -123,11 +123,11 @@ public class Category {
}
- static Category getRoot(LoggerContext context) {
+ static Category getRoot(final LoggerContext context) {
return getInstance(context, "");
}
- private static ConcurrentMap<String, Logger> getLoggersMap(LoggerContext context) {
+ private static ConcurrentMap<String, Logger> getLoggersMap(final LoggerContext context) {
synchronized (CONTEXT_MAP) {
ConcurrentMap<String, Logger> map = CONTEXT_MAP.get(context);
if (map == null) {
@@ -152,7 +152,7 @@ public class Category {
}
public final Level getEffectiveLevel() {
- org.apache.logging.log4j.Level level = logger.getLevel();
+ final org.apache.logging.log4j.Level level = logger.getLevel();
switch (level) {
case TRACE:
@@ -176,7 +176,7 @@ public class Category {
return getEffectiveLevel();
}
- public void setLevel(Level level) {
+ public void setLevel(final Level level) {
logger.setLevel(org.apache.logging.log4j.Level.toLevel(level.levelStr));
}
@@ -184,15 +184,15 @@ public class Category {
return getEffectiveLevel();
}
- public void setPriority(Priority priority) {
+ public void setPriority(final Priority priority) {
logger.setLevel(org.apache.logging.log4j.Level.toLevel(priority.levelStr));
}
- public void debug(Object message) {
+ public void debug(final Object message) {
maybeLog(FQCN, org.apache.logging.log4j.Level.DEBUG, message, null);
}
- public void debug(Object message, Throwable t) {
+ public void debug(final Object message, final Throwable t) {
maybeLog(FQCN, org.apache.logging.log4j.Level.DEBUG, message, t);
}
@@ -200,11 +200,11 @@ public class Category {
return logger.isDebugEnabled();
}
- public void error(Object message) {
+ public void error(final Object message) {
maybeLog(FQCN, org.apache.logging.log4j.Level.ERROR, message, null);
}
- public void error(Object message, Throwable t) {
+ public void error(final Object message, final Throwable t) {
maybeLog(FQCN, org.apache.logging.log4j.Level.ERROR, message, t);
}
@@ -212,11 +212,11 @@ public class Category {
return logger.isErrorEnabled();
}
- public void warn(Object message) {
+ public void warn(final Object message) {
maybeLog(FQCN, org.apache.logging.log4j.Level.WARN, message, null);
}
- public void warn(Object message, Throwable t) {
+ public void warn(final Object message, final Throwable t) {
maybeLog(FQCN, org.apache.logging.log4j.Level.WARN, message, t);
}
@@ -224,11 +224,11 @@ public class Category {
return logger.isWarnEnabled();
}
- public void fatal(Object message) {
+ public void fatal(final Object message) {
maybeLog(FQCN, org.apache.logging.log4j.Level.FATAL, message, null);
}
- public void fatal(Object message, Throwable t) {
+ public void fatal(final Object message, final Throwable t) {
maybeLog(FQCN, org.apache.logging.log4j.Level.FATAL, message, t);
}
@@ -236,11 +236,11 @@ public class Category {
return logger.isFatalEnabled();
}
- public void info(Object message) {
+ public void info(final Object message) {
maybeLog(FQCN, org.apache.logging.log4j.Level.INFO, message, null);
}
- public void info(Object message, Throwable t) {
+ public void info(final Object message, final Throwable t) {
maybeLog(FQCN, org.apache.logging.log4j.Level.INFO, message, t);
}
@@ -248,11 +248,11 @@ public class Category {
return logger.isInfoEnabled();
}
- public void trace(Object message) {
+ public void trace(final Object message) {
maybeLog(FQCN, org.apache.logging.log4j.Level.TRACE, message, null);
}
- public void trace(Object message, Throwable t) {
+ public void trace(final Object message, final Throwable t) {
maybeLog(FQCN, org.apache.logging.log4j.Level.TRACE, message, t);
}
@@ -260,8 +260,8 @@ public class Category {
return logger.isTraceEnabled();
}
- public boolean isEnabledFor(Priority level) {
- org.apache.logging.log4j.Level lvl = org.apache.logging.log4j.Level.toLevel(level.toString());
+ public boolean isEnabledFor(final Priority level) {
+ final org.apache.logging.log4j.Level lvl = org.apache.logging.log4j.Level.toLevel(level.toString());
return isEnabledFor(lvl);
}
@@ -269,14 +269,14 @@ public class Category {
* No-op implementation.
* @param appender The Appender to add.
*/
- public void addAppender(Appender appender) {
+ public void addAppender(final Appender appender) {
}
/**
* No-op implementation.
* @param event The logging event.
*/
- public void callAppenders(LoggingEvent event) {
+ public void callAppenders(final LoggingEvent event) {
}
public Enumeration getAllAppenders() {
@@ -288,7 +288,7 @@ public class Category {
* @param name The name of the Appender.
* @return null.
*/
- public Appender getAppender(String name) {
+ public Appender getAppender(final String name) {
return null;
}
@@ -296,7 +296,7 @@ public class Category {
Is the appender passed as parameter attached to this category?
@param appender The Appender to add.
*/
- public boolean isAttached(Appender appender) {
+ public boolean isAttached(final Appender appender) {
return false;
}
@@ -310,14 +310,14 @@ public class Category {
* No-op implementation.
* @param appender The Appender to remove.
*/
- public void removeAppender(Appender appender) {
+ public void removeAppender(final Appender appender) {
}
/**
* No-op implementation.
* @param name The Appender to remove.
*/
- public void removeAppender(String name) {
+ public void removeAppender(final String name) {
}
/**
@@ -327,13 +327,13 @@ public class Category {
}
- public void forcedLog(String fqcn, Priority level, Object message, Throwable t) {
- org.apache.logging.log4j.Level lvl = org.apache.logging.log4j.Level.toLevel(level.toString());
- Message msg = message instanceof Message ? (Message) message : new ObjectMessage(message);
+ public void forcedLog(final String fqcn, final Priority level, final Object message, final Throwable t) {
+ final org.apache.logging.log4j.Level lvl = org.apache.logging.log4j.Level.toLevel(level.toString());
+ final Message msg = message instanceof Message ? (Message) message : new ObjectMessage(message);
logger.log(null, fqcn, lvl, msg, t);
}
- public boolean exists(String name) {
+ public boolean exists(final String name) {
return PrivateManager.getContext().hasLogger(name);
}
@@ -341,11 +341,11 @@ public class Category {
return logger.isAdditive();
}
- public void setAdditivity(boolean additivity) {
+ public void setAdditivity(final boolean additivity) {
logger.setAdditive(additivity);
}
- public void setResourceBundle(ResourceBundle bundle) {
+ public void setResourceBundle(final ResourceBundle bundle) {
this.bundle = bundle;
}
@@ -353,12 +353,12 @@ public class Category {
if (bundle != null) {
return bundle;
}
- int i = 0;
+ final int i = 0;
String name = logger.getName();
- ConcurrentMap<String, Logger> loggers = getLoggersMap(logger.getContext());
+ final ConcurrentMap<String, Logger> loggers = getLoggersMap(logger.getContext());
while ((name = NameUtil.getSubName(name)) != null) {
if (loggers.containsKey(name)) {
- ResourceBundle rb = loggers.get(name).bundle;
+ final ResourceBundle rb = loggers.get(name).bundle;
if (rb != null) {
return rb;
}
@@ -381,49 +381,49 @@ public class Category {
@since 1.2
*/
- public void assertLog(boolean assertion, String msg) {
+ public void assertLog(final boolean assertion, final String msg) {
if (!assertion) {
this.error(msg);
}
}
- public void l7dlog(Priority priority, String key, Throwable t) {
+ public void l7dlog(final Priority priority, final String key, final Throwable t) {
if (isEnabledFor(priority)) {
- Message msg = new LocalizedMessage(bundle, key, null);
+ final Message msg = new LocalizedMessage(bundle, key, null);
forcedLog(FQCN, priority, msg, t);
}
}
- public void l7dlog(Priority priority, String key, Object[] params, Throwable t) {
+ public void l7dlog(final Priority priority, final String key, final Object[] params, final Throwable t) {
if (isEnabledFor(priority)) {
- Message msg = new LocalizedMessage(bundle, key, params);
+ final Message msg = new LocalizedMessage(bundle, key, params);
forcedLog(FQCN, priority, msg, t);
}
}
- public void log(Priority priority, Object message, Throwable t) {
+ public void log(final Priority priority, final Object message, final Throwable t) {
if (isEnabledFor(priority)) {
- Message msg = new ObjectMessage(message);
+ final Message msg = new ObjectMessage(message);
forcedLog(FQCN, priority, msg, t);
}
}
- public void log(Priority priority, Object message) {
+ public void log(final Priority priority, final Object message) {
if (isEnabledFor(priority)) {
- Message msg = new ObjectMessage(message);
+ final Message msg = new ObjectMessage(message);
forcedLog(FQCN, priority, msg, null);
}
}
- public void log(String fqcn, Priority priority, Object message, Throwable t) {
+ public void log(final String fqcn, final Priority priority, final Object message, final Throwable t) {
if (isEnabledFor(priority)) {
- Message msg = new ObjectMessage(message);
+ final Message msg = new ObjectMessage(message);
forcedLog(fqcn, priority, msg, t);
}
}
- private void maybeLog(String fqcn, org.apache.logging.log4j.Level level,
- Object message, Throwable throwable) {
+ private void maybeLog(final String fqcn, final org.apache.logging.log4j.Level level,
+ final Object message, final Throwable throwable) {
if (logger.isEnabled(level, null, message, throwable)) {
logger.log(null, FQCN, level, new ObjectMessage(message), throwable);
}
@@ -434,7 +434,7 @@ public class Category {
*/
private static class PrivateFactory implements LoggerFactory {
- public Logger makeNewLoggerInstance(LoggerContext context, String name) {
+ public Logger makeNewLoggerInstance(final LoggerContext context, final String name) {
return new Logger(context, name);
}
}
@@ -449,12 +449,12 @@ public class Category {
return getContext(FQCN, false);
}
- public static org.apache.logging.log4j.Logger getLogger(String name) {
+ public static org.apache.logging.log4j.Logger getLogger(final String name) {
return getLogger(FQCN, name);
}
}
- private boolean isEnabledFor(org.apache.logging.log4j.Level level) {
+ private boolean isEnabledFor(final org.apache.logging.log4j.Level level) {
return logger.isEnabled(level, null, null);
}
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Level.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Level.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Level.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Level.java Mon Dec 10 19:36:06 2012
@@ -102,7 +102,7 @@ public class Level extends Priority impl
* @param levelStr The level name.
* @param syslogEquivalent The matching syslog level.
*/
- protected Level(int level, String levelStr, int syslogEquivalent) {
+ protected Level(final int level, final String levelStr, final int syslogEquivalent) {
super(level, levelStr, syslogEquivalent);
}
@@ -114,7 +114,7 @@ public class Level extends Priority impl
* @param sArg The level name.
* @return The Level.
*/
- public static Level toLevel(String sArg) {
+ public static Level toLevel(final String sArg) {
return toLevel(sArg, Level.DEBUG);
}
@@ -125,7 +125,7 @@ public class Level extends Priority impl
* @param val The integer value of the Level.
* @return The Level.
*/
- public static Level toLevel(int val) {
+ public static Level toLevel(final int val) {
return toLevel(val, Level.DEBUG);
}
@@ -137,7 +137,7 @@ public class Level extends Priority impl
* @param defaultLevel the default level if the integer doesn't match.
* @return The matching Level.
*/
- public static Level toLevel(int val, Level defaultLevel) {
+ public static Level toLevel(final int val, final Level defaultLevel) {
switch (val) {
case ALL_INT:
return ALL;
@@ -168,12 +168,12 @@ public class Level extends Priority impl
* @param defaultLevel The default Level to use.
* @return the matching Level.
*/
- public static Level toLevel(String sArg, Level defaultLevel) {
+ public static Level toLevel(final String sArg, final Level defaultLevel) {
if (sArg == null) {
return defaultLevel;
}
- String s = sArg.toUpperCase();
+ final String s = sArg.toUpperCase();
if (s.equals("ALL")) {
return Level.ALL;
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/LogManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/LogManager.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/LogManager.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/LogManager.java Mon Dec 10 19:36:06 2012
@@ -77,8 +77,8 @@ public final class LogManager {
return (Logger) Category.getInstance((LoggerContext) PrivateManager.getContext(), name);
}
- public static Logger exists(String name) {
- LoggerContext ctx = (LoggerContext) PrivateManager.getContext();
+ public static Logger exists(final String name) {
+ final LoggerContext ctx = (LoggerContext) PrivateManager.getContext();
if (!ctx.hasLogger(name)) {
return null;
}
@@ -90,7 +90,7 @@ public final class LogManager {
}
static void reconfigure() {
- LoggerContext ctx = (LoggerContext) PrivateManager.getContext();
+ final LoggerContext ctx = (LoggerContext) PrivateManager.getContext();
ctx.reconfigure();
}
@@ -112,7 +112,7 @@ public final class LogManager {
* @param guard prevents calls at the incorrect time.
* @throws IllegalArgumentException
*/
- public static void setRepositorySelector(RepositorySelector selector, Object guard)
+ public static void setRepositorySelector(final RepositorySelector selector, final Object guard)
throws IllegalArgumentException {
}
@@ -121,23 +121,23 @@ public final class LogManager {
}
private static class Repository implements LoggerRepository {
- public void addHierarchyEventListener(HierarchyEventListener listener) {
+ public void addHierarchyEventListener(final HierarchyEventListener listener) {
}
- public boolean isDisabled(int level) {
+ public boolean isDisabled(final int level) {
return false;
}
- public void setThreshold(Level level) {
+ public void setThreshold(final Level level) {
}
- public void setThreshold(String val) {
+ public void setThreshold(final String val) {
}
- public void emitNoAppenderWarning(Category cat) {
+ public void emitNoAppenderWarning(final Category cat) {
}
@@ -145,11 +145,11 @@ public final class LogManager {
return Level.OFF;
}
- public Logger getLogger(String name) {
+ public Logger getLogger(final String name) {
return (Logger) Category.getInstance((LoggerContext) PrivateManager.getContext(), name);
}
- public Logger getLogger(String name, LoggerFactory factory) {
+ public Logger getLogger(final String name, final LoggerFactory factory) {
return (Logger) Category.getInstance((LoggerContext) PrivateManager.getContext(), name);
}
@@ -157,7 +157,7 @@ public final class LogManager {
return (Logger) Category.getRoot((LoggerContext) PrivateManager.getContext());
}
- public Logger exists(String name) {
+ public Logger exists(final String name) {
return LogManager.exists(name);
}
@@ -172,7 +172,7 @@ public final class LogManager {
return NullEnumeration.getInstance();
}
- public void fireAddAppenderEvent(Category logger, Appender appender) {
+ public void fireAddAppenderEvent(final Category logger, final Appender appender) {
}
public void resetConfiguration() {
@@ -190,7 +190,7 @@ public final class LogManager {
return getContext(FQCN, false);
}
- public static org.apache.logging.log4j.Logger getLogger(String name) {
+ public static org.apache.logging.log4j.Logger getLogger(final String name) {
return getLogger(FQCN, name);
}
}
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Logger.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Logger.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Logger.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Logger.java Mon Dec 10 19:36:06 2012
@@ -27,19 +27,19 @@ public class Logger extends Category {
private static final String FQCN = Logger.class.getName();
- protected Logger(String name) {
+ protected Logger(final String name) {
super((LoggerContext) PrivateManager.getContext(), name);
}
- Logger(LoggerContext context, String name) {
+ Logger(final LoggerContext context, final String name) {
super(context, name);
}
- public static Logger getLogger(String name) {
+ public static Logger getLogger(final String name) {
return (Logger) Category.getInstance((LoggerContext) PrivateManager.getContext(), name);
}
- public static Logger getLogger(Class<?> clazz) {
+ public static Logger getLogger(final Class<?> clazz) {
return (Logger) Category.getInstance((LoggerContext) PrivateManager.getContext(), clazz);
}
@@ -47,7 +47,7 @@ public class Logger extends Category {
return (Logger) Category.getRoot((LoggerContext) PrivateManager.getContext());
}
- public static Logger getLogger(String name, LoggerFactory factory) {
+ public static Logger getLogger(final String name, final LoggerFactory factory) {
return (Logger) Category.getInstance((LoggerContext) PrivateManager.getContext(), name, factory);
}
@@ -61,7 +61,7 @@ public class Logger extends Category {
return getContext(FQCN, false);
}
- public static org.apache.logging.log4j.Logger getLogger(String name) {
+ public static org.apache.logging.log4j.Logger getLogger(final String name) {
return getLogger(FQCN, name);
}
}
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/MDC.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/MDC.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/MDC.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/MDC.java Mon Dec 10 19:36:06 2012
@@ -37,7 +37,7 @@ public final class MDC {
}
@Override
- protected Map<String, Object> childValue(Map<String, Object> parentValue) {
+ protected Map<String, Object> childValue(final Map<String, Object> parentValue) {
return parentValue == null ? new HashMap<String, Object>() : new HashMap<String, Object>(parentValue);
}
};
@@ -46,22 +46,22 @@ public final class MDC {
}
- public static void put(String key, String value) {
+ public static void put(final String key, final String value) {
localMap.get().put(key, value);
ThreadContext.put(key, value);
}
- public static void put(String key, Object value) {
+ public static void put(final String key, final Object value) {
localMap.get().put(key, value);
ThreadContext.put(key, value.toString());
}
- public static Object get(String key) {
+ public static Object get(final String key) {
return localMap.get().get(key);
}
- public static void remove(String key) {
+ public static void remove(final String key) {
localMap.get().remove(key);
ThreadContext.remove(key);
}
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/NDC.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/NDC.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/NDC.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/NDC.java Mon Dec 10 19:36:06 2012
@@ -53,8 +53,8 @@ public final class NDC {
* @return Stack A clone of the current thread's diagnostic context.
*/
public static Stack cloneStack() {
- Stack<String> stack = new Stack<String>();
- for (String element : org.apache.logging.log4j.ThreadContext.cloneStack().asList()) {
+ final Stack<String> stack = new Stack<String>();
+ for (final String element : org.apache.logging.log4j.ThreadContext.cloneStack().asList()) {
stack.push(element);
}
return stack;
@@ -80,7 +80,7 @@ public final class NDC {
*
* @param stack The diagnostic context of the parent thread.
*/
- public static void inherit(Stack stack) {
+ public static void inherit(final Stack stack) {
org.apache.logging.log4j.ThreadContext.setStack(stack);
}
@@ -136,7 +136,7 @@ public final class NDC {
*
* @param message The new diagnostic context information.
*/
- public static void push(String message) {
+ public static void push(final String message) {
org.apache.logging.log4j.ThreadContext.push(message);
}
@@ -190,7 +190,7 @@ public final class NDC {
* @see #getDepth
* @param maxDepth The maximum depth of the stack.
*/
- public static void setMaxDepth(int maxDepth) {
+ public static void setMaxDepth(final int maxDepth) {
org.apache.logging.log4j.ThreadContext.trim(maxDepth);
}
}
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/PatternLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/PatternLayout.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/PatternLayout.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/PatternLayout.java Mon Dec 10 19:36:06 2012
@@ -24,7 +24,7 @@ import org.apache.log4j.spi.LoggingEvent
public class PatternLayout extends Layout {
@Override
- public String format(LoggingEvent event) {
+ public String format(final LoggingEvent event) {
return "";
}
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Priority.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Priority.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Priority.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/Priority.java Mon Dec 10 19:36:06 2012
@@ -112,7 +112,7 @@ public class Priority {
* @param levelStr The level name.
* @param syslogEquivalent The equivalent syslog value.
*/
- protected Priority(int level, String levelStr, int syslogEquivalent) {
+ protected Priority(final int level, final String levelStr, final int syslogEquivalent) {
this.level = level;
this.levelStr = levelStr;
this.syslogEquivalent = syslogEquivalent;
@@ -126,9 +126,9 @@ public class Priority {
* @since 1.2
*/
@Override
- public boolean equals(Object o) {
+ public boolean equals(final Object o) {
if (o instanceof Priority) {
- Priority r = (Priority) o;
+ final Priority r = (Priority) o;
return this.level == r.level;
} else {
return false;
@@ -155,7 +155,7 @@ public class Priority {
* @param r The Priority to check.
* @return true if the current level is greater or equal to the specified Priority.
*/
- public boolean isGreaterOrEqual(Priority r) {
+ public boolean isGreaterOrEqual(final Priority r) {
return level >= r.level;
}
@@ -196,7 +196,7 @@ public class Priority {
* @deprecated Please use the {@link Level#toLevel(String)} method instead.
*/
@Deprecated
- public static Priority toPriority(String sArg) {
+ public static Priority toPriority(final String sArg) {
return Level.toLevel(sArg);
}
@@ -206,7 +206,7 @@ public class Priority {
* @deprecated Please use the {@link Level#toLevel(int)} method instead.
*/
@Deprecated
- public static Priority toPriority(int val) {
+ public static Priority toPriority(final int val) {
return toPriority(val, Priority.DEBUG);
}
@@ -217,7 +217,7 @@ public class Priority {
* @deprecated Please use the {@link Level#toLevel(int, Level)} method instead.
*/
@Deprecated
- public static Priority toPriority(int val, Priority defaultPriority) {
+ public static Priority toPriority(final int val, final Priority defaultPriority) {
return Level.toLevel(val, (Level) defaultPriority);
}
@@ -228,7 +228,7 @@ public class Priority {
* @deprecated Please use the {@link Level#toLevel(String, Level)} method instead.
*/
@Deprecated
- public static Priority toPriority(String sArg, Priority defaultPriority) {
+ public static Priority toPriority(final String sArg, final Priority defaultPriority) {
return Level.toLevel(sArg, (Level) defaultPriority);
}
}
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/PropertyConfigurator.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/PropertyConfigurator.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/PropertyConfigurator.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/PropertyConfigurator.java Mon Dec 10 19:36:06 2012
@@ -28,11 +28,11 @@ import java.util.Properties;
*/
public class PropertyConfigurator {
- public void doConfigure(String configFileName, LoggerRepository hierarchy) {
+ public void doConfigure(final String configFileName, final LoggerRepository hierarchy) {
}
- public static void configure(String configFileName) {
+ public static void configure(final String configFileName) {
}
/**
@@ -40,7 +40,7 @@ public class PropertyConfigurator {
@since 0.8.2
*/
- public static void configure(URL configURL) {
+ public static void configure(final URL configURL) {
}
/**
@@ -48,7 +48,7 @@ public class PropertyConfigurator {
@since 1.2.17
*/
- public static void configure(InputStream inputStream) {
+ public static void configure(final InputStream inputStream) {
}
@@ -57,7 +57,7 @@ public class PropertyConfigurator {
See {@link #doConfigure(String, LoggerRepository)} for the expected format.
*/
- public static void configure(Properties properties) {
+ public static void configure(final Properties properties) {
}
/**
@@ -68,7 +68,7 @@ public class PropertyConfigurator {
@param configFilename A file in key=value format.
*/
- public static void configureAndWatch(String configFilename) {
+ public static void configureAndWatch(final String configFilename) {
}
@@ -83,7 +83,7 @@ public class PropertyConfigurator {
@param configFilename A file in key=value format.
@param delay The delay in milliseconds to wait between each check.
*/
- public static void configureAndWatch(String configFilename, long delay) {
+ public static void configureAndWatch(final String configFilename, final long delay) {
}
@@ -92,7 +92,7 @@ public class PropertyConfigurator {
See {@link #doConfigure(String, LoggerRepository)} for the expected format.
*/
- public void doConfigure(Properties properties, LoggerRepository hierarchy) {
+ public void doConfigure(final Properties properties, final LoggerRepository hierarchy) {
}
/**
@@ -100,12 +100,12 @@ public class PropertyConfigurator {
*
* @since 1.2.17
*/
- public void doConfigure(InputStream inputStream, LoggerRepository hierarchy) {
+ public void doConfigure(final InputStream inputStream, final LoggerRepository hierarchy) {
}
/**
Read configuration options from url <code>configURL</code>.
*/
- public void doConfigure(java.net.URL configURL, LoggerRepository hierarchy) {
+ public void doConfigure(final java.net.URL configURL, final LoggerRepository hierarchy) {
}
}
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/config/PropertySetter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/config/PropertySetter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/config/PropertySetter.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/config/PropertySetter.java Mon Dec 10 19:36:06 2012
@@ -31,7 +31,7 @@ public class PropertySetter {
*
* @param obj the object for which to set properties
*/
- public PropertySetter(Object obj) {
+ public PropertySetter(final Object obj) {
}
/**
@@ -43,14 +43,14 @@ public class PropertySetter {
@param properties A java.util.Properties containing keys and values.
@param prefix Only keys having the specified prefix will be set.
*/
- public static void setProperties(Object obj, Properties properties, String prefix) {
+ public static void setProperties(final Object obj, final Properties properties, final String prefix) {
}
/**
* Set the properites for the object that match the <code>prefix</code> passed as parameter.
*/
- public void setProperties(Properties properties, String prefix) {
+ public void setProperties(final Properties properties, final String prefix) {
}
/**
@@ -68,7 +68,7 @@ public class PropertySetter {
@param name name of the property
@param value String value of the property
*/
- public void setProperty(String name, String value) {
+ public void setProperty(final String name, final String value) {
}
/**
@@ -79,7 +79,7 @@ public class PropertySetter {
@param name The named of the property to set.
@param value The value of the property.
*/
- public void setProperty(PropertyDescriptor prop, String name, String value)
+ public void setProperty(final PropertyDescriptor prop, final String name, final String value)
throws PropertySetterException {
}
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/config/PropertySetterException.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/config/PropertySetterException.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/config/PropertySetterException.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/config/PropertySetterException.java Mon Dec 10 19:36:06 2012
@@ -26,11 +26,11 @@ public class PropertySetterException ext
private static final long serialVersionUID = -1352613734254235861L;
protected Throwable rootCause;
- public PropertySetterException(String msg) {
+ public PropertySetterException(final String msg) {
super(msg);
}
- public PropertySetterException(Throwable rootCause) {
+ public PropertySetterException(final Throwable rootCause) {
super();
this.rootCause = rootCause;
}
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/spi/Filter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/spi/Filter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/spi/Filter.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/spi/Filter.java Mon Dec 10 19:36:06 2012
@@ -70,7 +70,7 @@ public abstract class Filter {
/**
* Set the next filter pointer.
*/
- public void setNext(Filter next) {
+ public void setNext(final Filter next) {
this.next = next;
}
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/xml/DOMConfigurator.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/xml/DOMConfigurator.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/xml/DOMConfigurator.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/xml/DOMConfigurator.java Mon Dec 10 19:36:06 2012
@@ -31,36 +31,36 @@ import java.util.Properties;
*/
public class DOMConfigurator {
- public static void configure(Element element) {
+ public static void configure(final Element element) {
}
- public static void configureAndWatch(String configFilename) {
+ public static void configureAndWatch(final String configFilename) {
}
- public static void configureAndWatch(String configFilename, long delay) {
+ public static void configureAndWatch(final String configFilename, final long delay) {
}
- public void doConfigure(final String filename, LoggerRepository repository) {
+ public void doConfigure(final String filename, final LoggerRepository repository) {
}
- public void doConfigure(final URL url, LoggerRepository repository) {
+ public void doConfigure(final URL url, final LoggerRepository repository) {
}
- public void doConfigure(final InputStream inputStream, LoggerRepository repository)
+ public void doConfigure(final InputStream inputStream, final LoggerRepository repository)
throws FactoryConfigurationError {
}
- public void doConfigure(final Reader reader, LoggerRepository repository)
+ public void doConfigure(final Reader reader, final LoggerRepository repository)
throws FactoryConfigurationError {
}
- public void doConfigure(Element element, LoggerRepository repository) {
+ public void doConfigure(final Element element, final LoggerRepository repository) {
}
- public static void configure(String filename) throws FactoryConfigurationError {
+ public static void configure(final String filename) throws FactoryConfigurationError {
}
- public static void configure(URL url) throws FactoryConfigurationError {
+ public static void configure(final URL url) throws FactoryConfigurationError {
}
public static String subst(final String value, final Properties props) {
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/BasicConfigurationFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/BasicConfigurationFactory.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/BasicConfigurationFactory.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/BasicConfigurationFactory.java Mon Dec 10 19:36:06 2012
@@ -34,12 +34,12 @@ public class BasicConfigurationFactory e
}
@Override
- public Configuration getConfiguration(ConfigurationSource source) {
+ public Configuration getConfiguration(final ConfigurationSource source) {
return new BasicConfiguration();
}
@Override
- public Configuration getConfiguration(String name, URI configLocation) {
+ public Configuration getConfiguration(final String name, final URI configLocation) {
return new BasicConfiguration();
}
@@ -48,10 +48,10 @@ public class BasicConfigurationFactory e
private static final String DEFAULT_LEVEL = "org.apache.logging.log4j.level";
public BasicConfiguration() {
- LoggerConfig root = getRootLogger();
+ final LoggerConfig root = getRootLogger();
setName("BasicConfiguration");
- String levelName = System.getProperty(DEFAULT_LEVEL);
- Level level = (levelName != null && Level.valueOf(levelName) != null) ? Level.valueOf(levelName) : Level.DEBUG;
+ final String levelName = System.getProperty(DEFAULT_LEVEL);
+ final Level level = (levelName != null && Level.valueOf(levelName) != null) ? Level.valueOf(levelName) : Level.DEBUG;
root.setLevel(level);
}
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/CategoryTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/CategoryTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/CategoryTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/CategoryTest.java Mon Dec 10 19:36:06 2012
@@ -53,7 +53,7 @@ public class CategoryTest {
public static void setupClass() {
appender.start();
ConfigurationFactory.setConfigurationFactory(cf);
- LoggerContext ctx = (LoggerContext) org.apache.logging.log4j.LogManager.getContext();
+ final LoggerContext ctx = (LoggerContext) org.apache.logging.log4j.LogManager.getContext();
ctx.reconfigure();
}
@@ -68,11 +68,11 @@ public class CategoryTest {
*/
@Test
public void testForcedLog() {
- MockCategory category = new MockCategory("org.example.foo");
+ final MockCategory category = new MockCategory("org.example.foo");
category.setAdditivity(false);
category.getLogger().addAppender(appender);
category.info("Hello, World");
- List<LogEvent> list = appender.getEvents();
+ final List<LogEvent> list = appender.getEvents();
int events = list.size();
assertTrue("Number of events should be 1, was " + events, events == 1);
LogEvent event = list.get(0);
@@ -101,7 +101,7 @@ public class CategoryTest {
*/
@Test
public void testGetChainedPriorityReturnType() throws Exception {
- Method method = Category.class.getMethod("getChainedPriority", (Class[]) null);
+ final Method method = Category.class.getMethod("getChainedPriority", (Class[]) null);
assertTrue(method.getReturnType() == Priority.class);
}
@@ -110,9 +110,9 @@ public class CategoryTest {
*/
@Test
public void testL7dlog() {
- Logger logger = Logger.getLogger("org.example.foo");
+ final Logger logger = Logger.getLogger("org.example.foo");
logger.setLevel(Level.ERROR);
- Priority debug = Level.DEBUG;
+ final Priority debug = Level.DEBUG;
logger.l7dlog(debug, "Hello, World", null);
assertTrue(appender.getEvents().size() == 0);
}
@@ -122,9 +122,9 @@ public class CategoryTest {
*/
@Test
public void testL7dlog4Param() {
- Logger logger = Logger.getLogger("org.example.foo");
+ final Logger logger = Logger.getLogger("org.example.foo");
logger.setLevel(Level.ERROR);
- Priority debug = Level.DEBUG;
+ final Priority debug = Level.DEBUG;
logger.l7dlog(debug, "Hello, World", new Object[0], null);
assertTrue(appender.getEvents().size() == 0);
}
@@ -137,11 +137,11 @@ public class CategoryTest {
// create the logger using LogManager
org.apache.logging.log4j.LogManager.getLogger("existingLogger");
// Logger will be the one created above
- Logger logger = Logger.getLogger("existingLogger");
- Logger l2 = LogManager.getLogger("existingLogger");
+ final Logger logger = Logger.getLogger("existingLogger");
+ final Logger l2 = LogManager.getLogger("existingLogger");
assertEquals(logger, l2);
logger.setLevel(Level.ERROR);
- Priority debug = Level.DEBUG;
+ final Priority debug = Level.DEBUG;
// the next line will throw an exception if the LogManager loggers
// aren't supported by 1.2 Logger/Category
logger.l7dlog(debug, "Hello, World", new Object[0], null);
@@ -156,26 +156,26 @@ public class CategoryTest {
@Deprecated
@Test
public void testSetPriority() {
- Logger logger = Logger.getLogger("org.example.foo");
- Priority debug = Level.DEBUG;
+ final Logger logger = Logger.getLogger("org.example.foo");
+ final Priority debug = Level.DEBUG;
logger.setPriority(debug);
}
@Test
public void testClassName() {
- Category category = Category.getInstance("TestCategory");
- Layout layout = PatternLayout.createLayout("%d %p %C{1.} [%t] %m%n", null, null, null);
- ListAppender appender = new ListAppender("List2", null, layout, false, false);
+ final Category category = Category.getInstance("TestCategory");
+ final Layout layout = PatternLayout.createLayout("%d %p %C{1.} [%t] %m%n", null, null, null);
+ final ListAppender appender = new ListAppender("List2", null, layout, false, false);
appender.start();
category.setAdditivity(false);
category.getLogger().addAppender(appender);
category.error("Test Message");
- List<String> msgs = appender.getMessages();
+ final List<String> msgs = appender.getMessages();
assertTrue("Incorrect number of messages. Expected 1 got " + msgs.size(), msgs.size() == 1);
- String msg = msgs.get(0);
+ final String msg = msgs.get(0);
appender.clear();
- String threadName = Thread.currentThread().getName();
- String expected = "ERROR o.a.l.CategoryTest [" + threadName + "] Test Message" + LINE_SEP;
+ final String threadName = Thread.currentThread().getName();
+ final String expected = "ERROR o.a.l.CategoryTest [" + threadName + "] Test Message" + LINE_SEP;
assertTrue("Incorrect message \"" + msg + "\"" + " expected \"" + expected +"\"", msg.endsWith(expected));
}
@@ -198,7 +198,7 @@ public class CategoryTest {
* @param msg message
*/
public void info(final String msg) {
- Priority info = Level.INFO;
+ final Priority info = Level.INFO;
forcedLog(MockCategory.class.toString(), info, msg, null);
}
}
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/LevelTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/LevelTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/LevelTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/LevelTest.java Mon Dec 10 19:36:06 2012
@@ -42,7 +42,7 @@ public class LevelTest {
*/
@Test
public void testSerializeINFO() throws Exception {
- int[] skip = new int[]{};
+ final int[] skip = new int[]{};
SerializationTestHelper.assertSerializationEquals(
"target/test-classes/witness/serialization/info.bin",
Level.INFO, skip, Integer.MAX_VALUE);
@@ -55,11 +55,11 @@ public class LevelTest {
*/
@Test
public void testDeserializeINFO() throws Exception {
- Object obj =
+ final Object obj =
SerializationTestHelper.deserializeStream(
"target/test-classes/witness/serialization/info.bin");
assertTrue(obj instanceof Level);
- Level info = (Level) obj;
+ final Level info = (Level) obj;
assertEquals("INFO", info.toString());
//
// JDK 1.1 doesn't support readResolve necessary for the assertion
@@ -76,11 +76,11 @@ public class LevelTest {
*/
@Test
public void testCustomLevelSerialization() throws Exception {
- CustomLevel custom = new CustomLevel();
- Object obj = SerializationTestHelper.serializeClone(custom);
+ final CustomLevel custom = new CustomLevel();
+ final Object obj = SerializationTestHelper.serializeClone(custom);
assertTrue(obj instanceof CustomLevel);
- CustomLevel clone = (CustomLevel) obj;
+ final CustomLevel clone = (CustomLevel) obj;
assertEquals(Level.INFO.level, clone.level);
assertEquals(Level.INFO.levelStr, clone.levelStr);
assertEquals(Level.INFO.syslogEquivalent, clone.syslogEquivalent);
@@ -123,7 +123,7 @@ public class LevelTest {
*/
@Test
public void testIntToTrace() {
- Level trace = Level.toLevel(5000);
+ final Level trace = Level.toLevel(5000);
assertEquals("TRACE", trace.toString());
}
@@ -132,7 +132,7 @@ public class LevelTest {
*/
@Test
public void testStringToTrace() {
- Level trace = Level.toLevel("TRACE");
+ final Level trace = Level.toLevel("TRACE");
assertEquals("TRACE", trace.toString());
}
@@ -213,7 +213,7 @@ public class LevelTest {
*/
@Test
public void testIntToAll() {
- Level level = Level.toLevel(Level.ALL_INT);
+ final Level level = Level.toLevel(Level.ALL_INT);
assertEquals("ALL", level.toString());
}
@@ -222,7 +222,7 @@ public class LevelTest {
*/
@Test
public void testIntToFatal() {
- Level level = Level.toLevel(Level.FATAL_INT);
+ final Level level = Level.toLevel(Level.FATAL_INT);
assertEquals("FATAL", level.toString());
}
@@ -232,7 +232,7 @@ public class LevelTest {
*/
@Test
public void testIntToOff() {
- Level level = Level.toLevel(Level.OFF_INT);
+ final Level level = Level.toLevel(Level.OFF_INT);
assertEquals("OFF", level.toString());
}
@@ -241,7 +241,7 @@ public class LevelTest {
*/
@Test
public void testToLevelUnrecognizedInt() {
- Level level = Level.toLevel(17, Level.FATAL);
+ final Level level = Level.toLevel(17, Level.FATAL);
assertEquals("FATAL", level.toString());
}
@@ -250,7 +250,7 @@ public class LevelTest {
*/
@Test
public void testToLevelNull() {
- Level level = Level.toLevel(null, Level.FATAL);
+ final Level level = Level.toLevel(null, Level.FATAL);
assertEquals("FATAL", level.toString());
}
@@ -259,7 +259,7 @@ public class LevelTest {
*/
@Test
public void testDotlessLowerI() {
- Level level = Level.toLevel("\u0131nfo");
+ final Level level = Level.toLevel("\u0131nfo");
assertEquals("INFO", level.toString());
}
@@ -269,10 +269,10 @@ public class LevelTest {
*/
@Test
public void testDottedLowerI() {
- Locale defaultLocale = Locale.getDefault();
- Locale turkey = new Locale("tr", "TR");
+ final Locale defaultLocale = Locale.getDefault();
+ final Locale turkey = new Locale("tr", "TR");
Locale.setDefault(turkey);
- Level level = Level.toLevel("info");
+ final Level level = Level.toLevel("info");
Locale.setDefault(defaultLocale);
assertEquals("INFO", level.toString());
}
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/LoggerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/LoggerTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/LoggerTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/LoggerTest.java Mon Dec 10 19:36:06 2012
@@ -80,7 +80,7 @@ public class LoggerTest {
@After
public void tearDown() {
- LoggerContext ctx = (LoggerContext) org.apache.logging.log4j.LogManager.getContext();
+ final LoggerContext ctx = (LoggerContext) org.apache.logging.log4j.LogManager.getContext();
ctx.reconfigure();
a1 = null;
a2 = null;
@@ -124,9 +124,9 @@ public class LoggerTest {
*/
@Test
public void testAdditivity1() {
- Logger a = Logger.getLogger("a");
- Logger ab = Logger.getLogger("a.b");
- CountingAppender ca = new CountingAppender();
+ final Logger a = Logger.getLogger("a");
+ final Logger ab = Logger.getLogger("a.b");
+ final CountingAppender ca = new CountingAppender();
ca.start();
a.getLogger().addAppender(ca);
@@ -149,14 +149,14 @@ public class LoggerTest {
@Test
public void testAdditivity2() {
- Logger a = Logger.getLogger("a");
- Logger ab = Logger.getLogger("a.b");
- Logger abc = Logger.getLogger("a.b.c");
- Logger x = Logger.getLogger("x");
+ final Logger a = Logger.getLogger("a");
+ final Logger ab = Logger.getLogger("a.b");
+ final Logger abc = Logger.getLogger("a.b.c");
+ final Logger x = Logger.getLogger("x");
- CountingAppender ca1 = new CountingAppender();
+ final CountingAppender ca1 = new CountingAppender();
ca1.start();
- CountingAppender ca2 = new CountingAppender();
+ final CountingAppender ca2 = new CountingAppender();
ca2.start();
a.getLogger().addAppender(ca1);
@@ -188,17 +188,17 @@ public class LoggerTest {
@Test
public void testAdditivity3() {
- Logger root = Logger.getRootLogger();
- Logger a = Logger.getLogger("a");
- Logger ab = Logger.getLogger("a.b");
- Logger abc = Logger.getLogger("a.b.c");
- Logger x = Logger.getLogger("x");
+ final Logger root = Logger.getRootLogger();
+ final Logger a = Logger.getLogger("a");
+ final Logger ab = Logger.getLogger("a.b");
+ final Logger abc = Logger.getLogger("a.b.c");
+ final Logger x = Logger.getLogger("x");
- CountingAppender caRoot = new CountingAppender();
+ final CountingAppender caRoot = new CountingAppender();
caRoot.start();
- CountingAppender caA = new CountingAppender();
+ final CountingAppender caA = new CountingAppender();
caA.start();
- CountingAppender caABC = new CountingAppender();
+ final CountingAppender caABC = new CountingAppender();
caABC.start();
root.getLogger().addAppender(caRoot);
@@ -300,14 +300,14 @@ public class LoggerTest {
@Test
public void testRB1() {
- Logger root = Logger.getRootLogger();
+ final Logger root = Logger.getRootLogger();
root.setResourceBundle(rbUS);
ResourceBundle t = root.getResourceBundle();
assertSame(t, rbUS);
- Logger x = Logger.getLogger("x");
- Logger x_y = Logger.getLogger("x.y");
- Logger x_y_z = Logger.getLogger("x.y.z");
+ final Logger x = Logger.getLogger("x");
+ final Logger x_y = Logger.getLogger("x.y");
+ final Logger x_y_z = Logger.getLogger("x.y.z");
t = x.getResourceBundle();
assertSame(t, rbUS);
@@ -319,14 +319,14 @@ public class LoggerTest {
@Test
public void testRB2() {
- Logger root = Logger.getRootLogger();
+ final Logger root = Logger.getRootLogger();
root.setResourceBundle(rbUS);
ResourceBundle t = root.getResourceBundle();
assertTrue(t == rbUS);
- Logger x = Logger.getLogger("x");
- Logger x_y = Logger.getLogger("x.y");
- Logger x_y_z = Logger.getLogger("x.y.z");
+ final Logger x = Logger.getLogger("x");
+ final Logger x_y = Logger.getLogger("x.y");
+ final Logger x_y_z = Logger.getLogger("x.y.z");
x_y.setResourceBundle(rbFR);
t = x.getResourceBundle();
@@ -339,14 +339,14 @@ public class LoggerTest {
@Test
public void testRB3() {
- Logger root = Logger.getRootLogger();
+ final Logger root = Logger.getRootLogger();
root.setResourceBundle(rbUS);
ResourceBundle t = root.getResourceBundle();
assertTrue(t == rbUS);
- Logger x = Logger.getLogger("x");
- Logger x_y = Logger.getLogger("x.y");
- Logger x_y_z = Logger.getLogger("x.y.z");
+ final Logger x = Logger.getLogger("x");
+ final Logger x_y = Logger.getLogger("x.y");
+ final Logger x_y_z = Logger.getLogger("x.y.z");
x_y.setResourceBundle(rbFR);
x_y_z.setResourceBundle(rbCH);
@@ -360,9 +360,9 @@ public class LoggerTest {
@Test
public void testExists() {
- Logger a = Logger.getLogger("a");
- Logger a_b = Logger.getLogger("a.b");
- Logger a_b_c = Logger.getLogger("a.b.c");
+ final Logger a = Logger.getLogger("a");
+ final Logger a_b = Logger.getLogger("a.b");
+ final Logger a_b_c = Logger.getLogger("a.b.c");
Logger t;
t = LogManager.exists("xx");
@@ -391,22 +391,22 @@ public class LoggerTest {
*/
@Test
public void testTrace() {
- ListAppender appender = new ListAppender("List");
+ final ListAppender appender = new ListAppender("List");
appender.start();
- Logger root = Logger.getRootLogger();
+ final Logger root = Logger.getRootLogger();
root.getLogger().addAppender(appender);
root.setLevel(Level.INFO);
- Logger tracer = Logger.getLogger("com.example.Tracer");
+ final Logger tracer = Logger.getLogger("com.example.Tracer");
tracer.setLevel(Level.TRACE);
tracer.trace("Message 1");
root.trace("Discarded Message");
root.trace("Discarded Message");
- List<LogEvent> msgs = appender.getEvents();
+ final List<LogEvent> msgs = appender.getEvents();
assertEquals(1, msgs.size());
- LogEvent event = (LogEvent) msgs.get(0);
+ final LogEvent event = (LogEvent) msgs.get(0);
assertEquals(org.apache.logging.log4j.Level.TRACE, event.getLevel());
assertEquals("Message 1", event.getMessage().getFormat());
appender.stop();
@@ -418,23 +418,23 @@ public class LoggerTest {
*/
@Test
public void testTraceWithException() {
- ListAppender appender = new ListAppender("List");
+ final ListAppender appender = new ListAppender("List");
appender.start();
- Logger root = Logger.getRootLogger();
+ final Logger root = Logger.getRootLogger();
root.getLogger().addAppender(appender);
root.setLevel(Level.INFO);
- Logger tracer = Logger.getLogger("com.example.Tracer");
+ final Logger tracer = Logger.getLogger("com.example.Tracer");
tracer.setLevel(Level.TRACE);
- NullPointerException ex = new NullPointerException();
+ final NullPointerException ex = new NullPointerException();
tracer.trace("Message 1", ex);
root.trace("Discarded Message", ex);
root.trace("Discarded Message", ex);
- List<LogEvent> msgs = appender.getEvents();
+ final List<LogEvent> msgs = appender.getEvents();
assertEquals(1, msgs.size());
- LogEvent event = msgs.get(0);
+ final LogEvent event = msgs.get(0);
assertEquals(org.apache.logging.log4j.Level.TRACE, event.getLevel());
assertEquals("Message 1", event.getMessage().getFormattedMessage());
appender.stop();
@@ -446,13 +446,13 @@ public class LoggerTest {
*/
@Test
public void testIsTraceEnabled() {
- ListAppender appender = new ListAppender("List");
+ final ListAppender appender = new ListAppender("List");
appender.start();
- Logger root = Logger.getRootLogger();
+ final Logger root = Logger.getRootLogger();
root.getLogger().addAppender(appender);
root.setLevel(Level.INFO);
- Logger tracer = Logger.getLogger("com.example.Tracer");
+ final Logger tracer = Logger.getLogger("com.example.Tracer");
tracer.setLevel(Level.TRACE);
assertTrue(tracer.isTraceEnabled());
@@ -463,19 +463,19 @@ public class LoggerTest {
@Test
public void testLog() {
- PatternLayout layout = PatternLayout.createLayout("%d %C %L %m", null, null, null);
- ListAppender appender = new ListAppender("List", null, layout, false, false);
+ final PatternLayout layout = PatternLayout.createLayout("%d %C %L %m", null, null, null);
+ final ListAppender appender = new ListAppender("List", null, layout, false, false);
appender.start();
- Logger root = Logger.getRootLogger();
+ final Logger root = Logger.getRootLogger();
root.getLogger().addAppender(appender);
root.setLevel(Level.INFO);
- MyLogger log = new MyLogger(root);
+ final MyLogger log = new MyLogger(root);
log.logInfo("This is a test", null);
root.log(Priority.INFO, "Test msg2", null);
root.log(Priority.INFO, "Test msg3");
- List<String> msgs = appender.getMessages();
+ final List<String> msgs = appender.getMessages();
assertTrue("Incorrect number of messages", msgs.size() == 3);
- String msg = msgs.get(0);
+ final String msg = msgs.get(0);
assertTrue("Message contains incorrect class name: " + msg, msg.contains(LoggerTest.class.getName()));
appender.stop();
root.getLogger().removeAppender(appender);
@@ -483,13 +483,13 @@ public class LoggerTest {
private static class MyLogger {
- private Logger logger;
+ private final Logger logger;
- public MyLogger(Logger logger) {
+ public MyLogger(final Logger logger) {
this.logger = logger;
}
- public void logInfo(String msg, Throwable t) {
+ public void logInfo(final String msg, final Throwable t) {
logger.log(MyLogger.class.getName(), Priority.INFO, msg, t);
}
}
@@ -507,7 +507,7 @@ public class LoggerTest {
public void close() {
}
- public void append(LogEvent event) {
+ public void append(final LogEvent event) {
counter++;
}
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/PriorityTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/PriorityTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/PriorityTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/PriorityTest.java Mon Dec 10 19:36:06 2012
@@ -175,7 +175,7 @@ public class PriorityTest {
@Deprecated
@Test
public void testGetAllPossiblePriorities() {
- Priority[] priorities = Priority.getAllPossiblePriorities();
+ final Priority[] priorities = Priority.getAllPossiblePriorities();
assertEquals(5, priorities.length);
}
@@ -231,7 +231,7 @@ public class PriorityTest {
@Deprecated
@Test
public void testDotlessLowerI() {
- Priority level = Priority.toPriority("\u0131nfo");
+ final Priority level = Priority.toPriority("\u0131nfo");
assertEquals("INFO", level.toString());
}
@@ -244,10 +244,10 @@ public class PriorityTest {
@Deprecated
@Test
public void testDottedLowerI() {
- Locale defaultLocale = Locale.getDefault();
- Locale turkey = new Locale("tr", "TR");
+ final Locale defaultLocale = Locale.getDefault();
+ final Locale turkey = new Locale("tr", "TR");
Locale.setDefault(turkey);
- Priority level = Priority.toPriority("info");
+ final Priority level = Priority.toPriority("info");
Locale.setDefault(defaultLocale);
assertEquals("INFO", level.toString());
}
Modified: logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/util/SerializationTestHelper.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/util/SerializationTestHelper.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/util/SerializationTestHelper.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/util/SerializationTestHelper.java Mon Dec 10 19:36:06 2012
@@ -51,13 +51,13 @@ public class SerializationTestHelper {
*/
public static Object serializeClone(final Object obj)
throws IOException, ClassNotFoundException {
- ByteArrayOutputStream memOut = new ByteArrayOutputStream();
- ObjectOutputStream objOut = new ObjectOutputStream(memOut);
+ final ByteArrayOutputStream memOut = new ByteArrayOutputStream();
+ final ObjectOutputStream objOut = new ObjectOutputStream(memOut);
objOut.writeObject(obj);
objOut.close();
- ByteArrayInputStream src = new ByteArrayInputStream(memOut.toByteArray());
- ObjectInputStream objIs = new ObjectInputStream(src);
+ final ByteArrayInputStream src = new ByteArrayInputStream(memOut.toByteArray());
+ final ObjectInputStream objIs = new ObjectInputStream(src);
return objIs.readObject();
}
@@ -71,8 +71,8 @@ public class SerializationTestHelper {
*/
public static Object deserializeStream(final String witness)
throws Exception {
- FileInputStream fileIs = new FileInputStream(witness);
- ObjectInputStream objIs = new ObjectInputStream(fileIs);
+ final FileInputStream fileIs = new FileInputStream(witness);
+ final ObjectInputStream objIs = new ObjectInputStream(fileIs);
return objIs.readObject();
}
@@ -90,8 +90,8 @@ public class SerializationTestHelper {
public static void assertSerializationEquals(
final String witness, final Object obj, final int[] skip,
final int endCompare) throws Exception {
- ByteArrayOutputStream memOut = new ByteArrayOutputStream();
- ObjectOutputStream objOut = new ObjectOutputStream(memOut);
+ final ByteArrayOutputStream memOut = new ByteArrayOutputStream();
+ final ObjectOutputStream objOut = new ObjectOutputStream(memOut);
objOut.writeObject(obj);
objOut.close();
@@ -110,13 +110,13 @@ public class SerializationTestHelper {
public static void assertStreamEquals(
final String witness, final byte[] actual, final int[] skip,
final int endCompare) throws IOException {
- File witnessFile = new File(witness);
+ final File witnessFile = new File(witness);
if (witnessFile.exists()) {
int skipIndex = 0;
- byte[] expected = new byte[actual.length];
- FileInputStream is = new FileInputStream(witnessFile);
- int bytesRead = is.read(expected);
+ final byte[] expected = new byte[actual.length];
+ final FileInputStream is = new FileInputStream(witnessFile);
+ final int bytesRead = is.read(expected);
is.close();
if (bytesRead < endCompare) {
@@ -143,7 +143,7 @@ public class SerializationTestHelper {
//
// if the file doesn't exist then
// assume that we are setting up and need to write it
- FileOutputStream os = new FileOutputStream(witnessFile);
+ final FileOutputStream os = new FileOutputStream(witnessFile);
os.write(actual);
os.close();
fail("Writing witness file " + witness);
Modified: logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/apache/logging/slf4j/SLF4JLoggingException.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/apache/logging/slf4j/SLF4JLoggingException.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/apache/logging/slf4j/SLF4JLoggingException.java (original)
+++ logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/apache/logging/slf4j/SLF4JLoggingException.java Mon Dec 10 19:36:06 2012
@@ -22,15 +22,15 @@ package org.apache.logging.slf4j;
*/
public class SLF4JLoggingException extends RuntimeException {
- public SLF4JLoggingException(String msg) {
+ public SLF4JLoggingException(final String msg) {
super(msg);
}
- public SLF4JLoggingException(String msg, Exception ex) {
+ public SLF4JLoggingException(final String msg, final Exception ex) {
super(msg, ex);
}
- public SLF4JLoggingException(Exception ex) {
+ public SLF4JLoggingException(final Exception ex) {
super(ex);
}
}
Modified: logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4JLoggerFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4JLoggerFactory.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4JLoggerFactory.java (original)
+++ logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4JLoggerFactory.java Mon Dec 10 19:36:06 2012
@@ -41,15 +41,15 @@ public class Log4JLoggerFactory implemen
private final Map<LoggerContext, ConcurrentMap<String, Logger>> contextMap =
new WeakHashMap<LoggerContext, ConcurrentMap<String, Logger>>();
- public Logger getLogger(String name) {
- LoggerContext context = getContext();
- ConcurrentMap<String, Logger> loggers = getLoggersMap(context);
+ public Logger getLogger(final String name) {
+ final LoggerContext context = getContext();
+ final ConcurrentMap<String, Logger> loggers = getLoggersMap(context);
if (loggers.containsKey(name)) {
return loggers.get(name);
}
- String key = Logger.ROOT_LOGGER_NAME.equals(name) ? LogManager.ROOT_LOGGER_NAME : name;
- org.apache.logging.log4j.Logger logger = context.getLogger(key);
+ final String key = Logger.ROOT_LOGGER_NAME.equals(name) ? LogManager.ROOT_LOGGER_NAME : name;
+ final org.apache.logging.log4j.Logger logger = context.getLogger(key);
if (logger instanceof AbstractLogger) {
loggers.putIfAbsent(name, new SLF4JLogger((AbstractLogger) logger, name));
return loggers.get(name);
@@ -57,7 +57,7 @@ public class Log4JLoggerFactory implemen
throw new SLF4JLoggingException("SLF4J Adapter requires base logging system to extend Log4J AbstractLogger");
}
- private ConcurrentMap<String, Logger> getLoggersMap(LoggerContext context) {
+ private ConcurrentMap<String, Logger> getLoggersMap(final LoggerContext context) {
synchronized (contextMap) {
ConcurrentMap<String, Logger> map = contextMap.get(context);
if (map == null) {
@@ -68,11 +68,11 @@ public class Log4JLoggerFactory implemen
}
}
private LoggerContext getContext() {
- Throwable t = new Throwable();
+ final Throwable t = new Throwable();
boolean next = false;
boolean pkg = false;
String fqcn = LoggerFactory.class.getName();
- for (StackTraceElement element : t.getStackTrace()) {
+ for (final StackTraceElement element : t.getStackTrace()) {
if (FQCN.equals(element.getClassName())) {
next = true;
continue;
@@ -99,11 +99,11 @@ public class Log4JLoggerFactory implemen
return getContext(FQCN, false);
}
- public static LoggerContext getContext(String fqcn) {
+ public static LoggerContext getContext(final String fqcn) {
return getContext(fqcn, false);
}
- public static org.apache.logging.log4j.Logger getLogger(String name) {
+ public static org.apache.logging.log4j.Logger getLogger(final String name) {
return getLogger(FQCN, name);
}
}
Modified: logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4JMDCAdapter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4JMDCAdapter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4JMDCAdapter.java (original)
+++ logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4JMDCAdapter.java Mon Dec 10 19:36:06 2012
@@ -26,15 +26,15 @@ import java.util.Map;
*/
public class Log4JMDCAdapter implements MDCAdapter {
- public void put(String key, String val) {
+ public void put(final String key, final String val) {
ThreadContext.put(key, val);
}
- public String get(String key) {
+ public String get(final String key) {
return ThreadContext.get(key);
}
- public void remove(String key) {
+ public void remove(final String key) {
ThreadContext.remove(key);
}
@@ -46,9 +46,9 @@ public class Log4JMDCAdapter implements
return ThreadContext.getContext();
}
- public void setContextMap(Map map) {
+ public void setContextMap(final Map map) {
ThreadContext.clear();
- for (Map.Entry<String, String> entry : ((Map<String, String>) map).entrySet()) {
+ for (final Map.Entry<String, String> entry : ((Map<String, String>) map).entrySet()) {
ThreadContext.put(entry.getKey(), entry.getValue());
}
}
Modified: logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4JMarkerFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4JMarkerFactory.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4JMarkerFactory.java (original)
+++ logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4JMarkerFactory.java Mon Dec 10 19:36:06 2012
@@ -27,9 +27,9 @@ import java.util.concurrent.ConcurrentMa
*/
public class Log4JMarkerFactory implements IMarkerFactory {
- private ConcurrentMap<String, Marker> markerMap = new ConcurrentHashMap<String, Marker>();
+ private final ConcurrentMap<String, Marker> markerMap = new ConcurrentHashMap<String, Marker>();
- public Marker getMarker(String name) {
+ public Marker getMarker(final String name) {
if (name == null) {
throw new IllegalArgumentException("Marker name must not be null");
}
@@ -40,15 +40,15 @@ public class Log4JMarkerFactory implemen
return marker;
}
- public boolean exists(String name) {
+ public boolean exists(final String name) {
return markerMap.containsKey(name);
}
- public boolean detachMarker(String name) {
+ public boolean detachMarker(final String name) {
return false;
}
- public Marker getDetachedMarker(String name) {
+ public Marker getDetachedMarker(final String name) {
return new MarkerWrapper(name);
}
}
Modified: logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/MarkerWrapper.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/MarkerWrapper.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/MarkerWrapper.java (original)
+++ logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/MarkerWrapper.java Mon Dec 10 19:36:06 2012
@@ -26,17 +26,17 @@ public class MarkerWrapper extends Basic
private MarkerWrapper parent;
- MarkerWrapper(String name) {
+ MarkerWrapper(final String name) {
super(name);
}
@Override
- public void add(org.slf4j.Marker reference) {
+ public void add(final org.slf4j.Marker reference) {
super.add(reference);
((MarkerWrapper) reference).setParent(this);
}
- private void setParent(MarkerWrapper marker) {
+ private void setParent(final MarkerWrapper marker) {
parent = marker;
}
@@ -44,7 +44,7 @@ public class MarkerWrapper extends Basic
return this.parent;
}
- public boolean isInstanceOf(org.apache.logging.log4j.Marker marker) {
+ public boolean isInstanceOf(final org.apache.logging.log4j.Marker marker) {
if (marker == null) {
throw new IllegalArgumentException("A marker parameter is required");
}
@@ -56,7 +56,7 @@ public class MarkerWrapper extends Basic
}
}
- public boolean isInstanceOf(String name) {
+ public boolean isInstanceOf(final String name) {
if (name == null) {
throw new IllegalArgumentException("A marker name is required");
}
|