You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2018/10/30 03:50:26 UTC
[01/13] logging-log4j2 git commit: Revert "Use final. Remove trailing
spaces."
Repository: logging-log4j2
Updated Branches:
refs/heads/release-2.x a8a7e7c93 -> 1f4c79624
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-jdbc-dbcp2/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/PoolingDriverConnectionSource.java
----------------------------------------------------------------------
diff --git a/log4j-jdbc-dbcp2/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/PoolingDriverConnectionSource.java b/log4j-jdbc-dbcp2/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/PoolingDriverConnectionSource.java
index 3fbb0da..f1ede24 100644
--- a/log4j-jdbc-dbcp2/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/PoolingDriverConnectionSource.java
+++ b/log4j-jdbc-dbcp2/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/PoolingDriverConnectionSource.java
@@ -168,7 +168,7 @@ public final class PoolingDriverConnectionSource extends AbstractDriverManagerCo
}
@Override
- public boolean stop(final long timeout, final TimeUnit timeUnit) {
+ public boolean stop(long timeout, TimeUnit timeUnit) {
try {
final PoolingDriver driver = getPoolingDriver();
if (driver != null) {
@@ -176,7 +176,7 @@ public final class PoolingDriverConnectionSource extends AbstractDriverManagerCo
driver.closePool(poolName);
}
return true;
- } catch (final Exception e) {
+ } catch (Exception e) {
getLogger().error("Exception stopping connection source for '{}' → '{}'", getConnectionString(),
getActualConnectionString(), e);
return false;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/ClientGuiJConsolePlugin.java
----------------------------------------------------------------------
diff --git a/log4j-jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/ClientGuiJConsolePlugin.java b/log4j-jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/ClientGuiJConsolePlugin.java
index f7405c2..538dc8d 100644
--- a/log4j-jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/ClientGuiJConsolePlugin.java
+++ b/log4j-jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/ClientGuiJConsolePlugin.java
@@ -22,6 +22,8 @@ import java.util.Map;
import javax.swing.JPanel;
import javax.swing.SwingWorker;
+import com.sun.tools.jconsole.JConsolePlugin;
+
/**
* Adapts the {@code ClientGui} to the {@code JConsolePlugin} API.
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-jpa/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JpaDatabaseManager.java
----------------------------------------------------------------------
diff --git a/log4j-jpa/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JpaDatabaseManager.java b/log4j-jpa/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JpaDatabaseManager.java
index 081f760..b2d36a8 100644
--- a/log4j-jpa/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JpaDatabaseManager.java
+++ b/log4j-jpa/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JpaDatabaseManager.java
@@ -89,7 +89,7 @@ public final class JpaDatabaseManager extends AbstractDatabaseManager {
protected void writeInternal(final LogEvent event) {
writeInternal(event, null);
}
-
+
@Override
protected void writeInternal(final LogEvent event, final Serializable serializable) {
if (!this.isRunning() || this.entityManagerFactory == null || this.entityManager == null
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-jpa/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/InstantAttributeConverter.java
----------------------------------------------------------------------
diff --git a/log4j-jpa/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/InstantAttributeConverter.java b/log4j-jpa/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/InstantAttributeConverter.java
index fde75af..9e0120e 100644
--- a/log4j-jpa/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/InstantAttributeConverter.java
+++ b/log4j-jpa/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/InstantAttributeConverter.java
@@ -46,11 +46,11 @@ public class InstantAttributeConverter implements AttributeConverter<Instant, St
return null;
}
- final int pos = s.indexOf(",");
- final long epochSecond = Long.parseLong(s.substring(0, pos));
- final int nanos = Integer.parseInt(s.substring(pos + 1, s.length()));
+ int pos = s.indexOf(",");
+ long epochSecond = Long.parseLong(s.substring(0, pos));
+ int nanos = Integer.parseInt(s.substring(pos + 1, s.length()));
- final MutableInstant result = new MutableInstant();
+ MutableInstant result = new MutableInstant();
result.initFromEpochSecond(epochSecond, nanos);
return result;
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-jpa/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/AbstractJpaAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-jpa/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/AbstractJpaAppenderTest.java b/log4j-jpa/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/AbstractJpaAppenderTest.java
index 6d90b3c..6ff3c14 100644
--- a/log4j-jpa/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/AbstractJpaAppenderTest.java
+++ b/log4j-jpa/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/AbstractJpaAppenderTest.java
@@ -64,7 +64,7 @@ public abstract class AbstractJpaAppenderTest {
public void tearDown() throws SQLException {
final LoggerContext context = LoggerContext.getContext(false);
try {
- final String appenderName = "databaseAppender";
+ String appenderName = "databaseAppender";
final Appender appender = context.getConfiguration().getAppender(appenderName);
assertNotNull("The appender '" + appenderName + "' should not be null.", appender);
assertTrue("The appender should be a JpaAppender.", appender instanceof JpaAppender);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-jpa/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextStackJsonAttributeConverterTest.java
----------------------------------------------------------------------
diff --git a/log4j-jpa/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextStackJsonAttributeConverterTest.java b/log4j-jpa/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextStackJsonAttributeConverterTest.java
index 165f87f..0fae006 100644
--- a/log4j-jpa/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextStackJsonAttributeConverterTest.java
+++ b/log4j-jpa/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextStackJsonAttributeConverterTest.java
@@ -36,7 +36,7 @@ public class ContextStackJsonAttributeConverterTest {
private ContextStackJsonAttributeConverter converter;
@Rule
- public final ThreadContextStackRule threadContextRule = new ThreadContextStackRule();
+ public final ThreadContextStackRule threadContextRule = new ThreadContextStackRule();
@Before
public void setUp() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-jul/src/main/java/org/apache/logging/log4j/jul/Constants.java
----------------------------------------------------------------------
diff --git a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/Constants.java b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/Constants.java
index 90e0730..bc86410 100644
--- a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/Constants.java
+++ b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/Constants.java
@@ -29,7 +29,7 @@ public final class Constants {
* {@code log4j-core}.
*/
public static final String LOGGER_ADAPTOR_PROPERTY = "log4j.jul.LoggerAdapter";
-
+
/**
* The Log4j property to set to a custom implementation of {@link org.apache.logging.log4j.jul.LevelConverter}. The specified class must have
* a default constructor.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-jul/src/main/java/org/apache/logging/log4j/jul/DefaultLevelConverter.java
----------------------------------------------------------------------
diff --git a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/DefaultLevelConverter.java b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/DefaultLevelConverter.java
index ea04fee..adaf4eb 100644
--- a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/DefaultLevelConverter.java
+++ b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/DefaultLevelConverter.java
@@ -34,7 +34,7 @@ import org.apache.logging.log4j.Level;
* <p>
* Since 2.4, supports custom JUL levels by mapping them to their closest mapped neighbour.
* </p>
- *
+ *
* @since 2.1
*/
public class DefaultLevelConverter implements LevelConverter {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-jul/src/test/java/org/apache/logging/log4j/jul/DefaultLevelConverterCustomJulLevelsTest.java
----------------------------------------------------------------------
diff --git a/log4j-jul/src/test/java/org/apache/logging/log4j/jul/DefaultLevelConverterCustomJulLevelsTest.java b/log4j-jul/src/test/java/org/apache/logging/log4j/jul/DefaultLevelConverterCustomJulLevelsTest.java
index 03f3cff..18f3bf0 100644
--- a/log4j-jul/src/test/java/org/apache/logging/log4j/jul/DefaultLevelConverterCustomJulLevelsTest.java
+++ b/log4j-jul/src/test/java/org/apache/logging/log4j/jul/DefaultLevelConverterCustomJulLevelsTest.java
@@ -22,7 +22,7 @@ import org.junit.Test;
/**
* Tests {@link DefaultLevelConverter} for custom JUL levels.
- *
+ *
* @since 2.4
*/
public class DefaultLevelConverterCustomJulLevelsTest {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-mongodb2/src/test/java/org/apache/logging/log4j/mongodb2/MongoDbTestRule.java
----------------------------------------------------------------------
diff --git a/log4j-mongodb2/src/test/java/org/apache/logging/log4j/mongodb2/MongoDbTestRule.java b/log4j-mongodb2/src/test/java/org/apache/logging/log4j/mongodb2/MongoDbTestRule.java
index 68416c2..465fa3f 100644
--- a/log4j-mongodb2/src/test/java/org/apache/logging/log4j/mongodb2/MongoDbTestRule.java
+++ b/log4j-mongodb2/src/test/java/org/apache/logging/log4j/mongodb2/MongoDbTestRule.java
@@ -43,7 +43,7 @@ import de.flapdoodle.embed.process.runtime.Network;
/**
* A JUnit test rule to manage a MongoDB embedded instance.
- *
+ *
* TODO Move this class to Apache Commons Testing.
*/
public class MongoDbTestRule implements TestRule {
@@ -164,7 +164,7 @@ public class MongoDbTestRule implements TestRule {
@Override
public String toString() {
- final StringBuilder builder = new StringBuilder();
+ StringBuilder builder = new StringBuilder();
builder.append("MongoDbTestRule [starter=");
builder.append(starter);
builder.append(", portSystemPropertyName=");
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-mongodb3/src/test/java/org/apache/logging/log4j/mongodb3/MongoDbTestRule.java
----------------------------------------------------------------------
diff --git a/log4j-mongodb3/src/test/java/org/apache/logging/log4j/mongodb3/MongoDbTestRule.java b/log4j-mongodb3/src/test/java/org/apache/logging/log4j/mongodb3/MongoDbTestRule.java
index b6a7097..96a903b 100644
--- a/log4j-mongodb3/src/test/java/org/apache/logging/log4j/mongodb3/MongoDbTestRule.java
+++ b/log4j-mongodb3/src/test/java/org/apache/logging/log4j/mongodb3/MongoDbTestRule.java
@@ -43,7 +43,7 @@ import de.flapdoodle.embed.process.runtime.Network;
/**
* A JUnit test rule to manage a MongoDB embedded instance.
- *
+ *
* TODO Move this class to Apache Commons Testing.
*/
public class MongoDbTestRule implements TestRule {
@@ -172,7 +172,7 @@ public class MongoDbTestRule implements TestRule {
@Override
public String toString() {
- final StringBuilder builder = new StringBuilder();
+ StringBuilder builder = new StringBuilder();
builder.append("MongoDbTestRule [starter=");
builder.append(starter);
builder.append(", portSystemPropertyName=");
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractLoadBundleTest.java
----------------------------------------------------------------------
diff --git a/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractLoadBundleTest.java b/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractLoadBundleTest.java
index 39fecb7..f22c4a1 100644
--- a/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractLoadBundleTest.java
+++ b/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractLoadBundleTest.java
@@ -44,7 +44,7 @@ public abstract class AbstractLoadBundleTest {
private final BundleTestInfo bundleTestInfo;
private Path here;
-
+
@Rule
public OsgiRule osgi = new OsgiRule(getFactory());
/**
@@ -61,7 +61,7 @@ public abstract class AbstractLoadBundleTest {
@Before
public void before() throws BundleException {
bundleContext = osgi.getFramework().getBundleContext();
-
+
here = Paths.get(".").toAbsolutePath().normalize();
}
@@ -75,7 +75,7 @@ public abstract class AbstractLoadBundleTest {
final Path corePath = here.resolveSibling("log4j-core").resolve("target").resolve("log4j-core-" + bundleTestInfo.getVersion() + ".jar");
return bundleContext.installBundle(corePath.toUri().toString());
}
-
+
private Bundle getDummyBundle() throws BundleException {
final Path dumyPath = here.resolveSibling("log4j-samples").resolve("log4j-samples-configuration").resolve("target").resolve("log4j-samples-configuration-" + bundleTestInfo.getVersion() + ".jar");
return bundleContext.installBundle(dumyPath.toUri().toString());
@@ -86,9 +86,9 @@ public abstract class AbstractLoadBundleTest {
return bundleContext.installBundle(apiPath.toUri().toString());
}
-
+
protected abstract FrameworkFactory getFactory();
-
+
private void log(final Bundle dummy) throws ReflectiveOperationException {
// use reflection to log in the context of the dummy bundle
@@ -131,7 +131,7 @@ public abstract class AbstractLoadBundleTest {
private void start(final Bundle api, final Bundle core, final Bundle dummy) throws BundleException {
api.start();
core.start();
- dummy.start();
+ dummy.start();
}
private void stop(final Bundle api, final Bundle core, final Bundle dummy) throws BundleException {
@@ -139,7 +139,7 @@ public abstract class AbstractLoadBundleTest {
core.stop();
api.stop();
}
-
+
private void uninstall(final Bundle api, final Bundle core, final Bundle dummy) throws BundleException {
dummy.uninstall();
core.uninstall();
@@ -154,37 +154,37 @@ public abstract class AbstractLoadBundleTest {
final Bundle api = getApiBundle();
final Bundle core = getCoreBundle();
-
+
Assert.assertEquals("api is not in INSTALLED state", Bundle.INSTALLED, api.getState());
Assert.assertEquals("core is not in INSTALLED state", Bundle.INSTALLED, core.getState());
api.start();
core.start();
-
- Assert.assertEquals("api is not in ACTIVE state", Bundle.ACTIVE, api.getState());
- Assert.assertEquals("core is not in ACTIVE state", Bundle.ACTIVE, core.getState());
-
+
+ Assert.assertEquals("api is not in ACTIVE state", Bundle.ACTIVE, api.getState());
+ Assert.assertEquals("core is not in ACTIVE state", Bundle.ACTIVE, core.getState());
+
core.stop();
api.stop();
-
+
Assert.assertEquals("api is not in RESOLVED state", Bundle.RESOLVED, api.getState());
Assert.assertEquals("core is not in RESOLVED state", Bundle.RESOLVED, core.getState());
-
+
api.start();
core.start();
-
- Assert.assertEquals("api is not in ACTIVE state", Bundle.ACTIVE, api.getState());
- Assert.assertEquals("core is not in ACTIVE state", Bundle.ACTIVE, core.getState());
-
+
+ Assert.assertEquals("api is not in ACTIVE state", Bundle.ACTIVE, api.getState());
+ Assert.assertEquals("core is not in ACTIVE state", Bundle.ACTIVE, core.getState());
+
core.stop();
api.stop();
-
+
Assert.assertEquals("api is not in RESOLVED state", Bundle.RESOLVED, api.getState());
Assert.assertEquals("core is not in RESOLVED state", Bundle.RESOLVED, core.getState());
-
+
core.uninstall();
api.uninstall();
-
+
Assert.assertEquals("api is not in UNINSTALLED state", Bundle.UNINSTALLED, api.getState());
Assert.assertEquals("core is not in UNINSTALLED state", Bundle.UNINSTALLED, core.getState());
}
@@ -223,7 +223,7 @@ public abstract class AbstractLoadBundleTest {
core.stop();
api.stop();
-
+
core.uninstall();
api.uninstall();
}
@@ -291,7 +291,7 @@ public abstract class AbstractLoadBundleTest {
/**
- * Tests the loading of the 1.2 Compatibility API bundle, its classes should be loadable from the Core bundle,
+ * Tests the loading of the 1.2 Compatibility API bundle, its classes should be loadable from the Core bundle,
* and the class loader should be the same between a class from core and a class from compat
*/
@Test
@@ -303,7 +303,7 @@ public abstract class AbstractLoadBundleTest {
api.start();
core.start();
-
+
final Class<?> coreClassFromCore = core.loadClass("org.apache.logging.log4j.core.Core");
final Class<?> levelClassFrom12API = core.loadClass("org.apache.log4j.Level");
final Class<?> levelClassFromAPI = core.loadClass("org.apache.logging.log4j.Level");
@@ -313,7 +313,7 @@ public abstract class AbstractLoadBundleTest {
core.stop();
api.stop();
-
+
uninstall(api, core, compat);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/OsgiRule.java
----------------------------------------------------------------------
diff --git a/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/OsgiRule.java b/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/OsgiRule.java
index eef72e1..6832157 100644
--- a/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/OsgiRule.java
+++ b/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/OsgiRule.java
@@ -58,7 +58,7 @@ public class OsgiRule extends ExternalResource {
configMap.put("felix.log.level", "4");
configMap.put("eclipse.log.level", "ALL");
// Hack to get the build working on Windows. Could try newer versions of Felix.
- configMap.put("felix.cache.locking", "false");
+ configMap.put("felix.cache.locking", "false");
// Delegates loading of endorsed libraries to JVM classloader
// config.put("org.osgi.framework.bootdelegation", "javax.*,org.w3c.*,org.xml.*");
framework = factory.newFramework(configMap);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/FileAppenderThrowableBenchmark.java
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/FileAppenderThrowableBenchmark.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/FileAppenderThrowableBenchmark.java
index b9b8a7f..7bf5ba9 100644
--- a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/FileAppenderThrowableBenchmark.java
+++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/FileAppenderThrowableBenchmark.java
@@ -116,21 +116,21 @@ public class FileAppenderThrowableBenchmark {
new Class<?>[]{Class.forName(FileAppenderThrowableBenchmark.class.getName() + "$TestIface" + (i % 31))},
new InvocationHandler() {
@Override
- public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
try {
return method.invoke(delegate, args);
- } catch (final InvocationTargetException e) {
+ } catch (InvocationTargetException e) {
throw e.getCause();
}
}
});
}
- } catch (final ClassNotFoundException e) {
+ } catch (ClassNotFoundException e) {
throw new IllegalStateException("Failed to create stack", e);
}
try {
helper.action();
- } catch (final IllegalStateException e) {
+ } catch (IllegalStateException e) {
return e;
}
throw new IllegalStateException("Failed to create throwable");
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/LoggerConfigBenchmark.java
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/LoggerConfigBenchmark.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/LoggerConfigBenchmark.java
index df5d494..0d36c21 100644
--- a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/LoggerConfigBenchmark.java
+++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/LoggerConfigBenchmark.java
@@ -164,7 +164,7 @@ public class LoggerConfigBenchmark {
processLogEvent(event);
}
}
-
+
volatile LoggerConfigBenchmark loggerConfig = this;
/**
@@ -186,7 +186,7 @@ public class LoggerConfigBenchmark {
/**
* Determine if the LogEvent should be processed or ignored.
- *
+ *
* @param event The LogEvent.
* @return true if the LogEvent should be processed.
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/StringBuilderEscapeBenchmark.java
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/StringBuilderEscapeBenchmark.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/StringBuilderEscapeBenchmark.java
index 774a5a5..865f925 100644
--- a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/StringBuilderEscapeBenchmark.java
+++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/StringBuilderEscapeBenchmark.java
@@ -68,8 +68,8 @@ public class StringBuilderEscapeBenchmark {
return state.buffer.length();
}
- private static String repeat(final String str, final int times) {
- final StringBuilder sb = new StringBuilder(str.length() * times);
+ private static String repeat(String str, int times) {
+ StringBuilder sb = new StringBuilder(str.length() * times);
for (int i = 0; i < times; i++) {
sb.append(str);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ThreadLocalVsPoolBenchmark.java
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ThreadLocalVsPoolBenchmark.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ThreadLocalVsPoolBenchmark.java
index 9e5a3e4..beb1456 100644
--- a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ThreadLocalVsPoolBenchmark.java
+++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ThreadLocalVsPoolBenchmark.java
@@ -177,7 +177,7 @@ public class ThreadLocalVsPoolBenchmark {
}
/**
- *
+ *
*/
abstract class ObjectPool<T> {
private final Deque<T> pool = new ConcurrentLinkedDeque<>();
@@ -195,7 +195,7 @@ abstract class ObjectPool<T> {
}
/**
- *
+ *
*/
class StringBuilderPool extends ObjectPool<StringBuilder> {
private final int initialSize;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ThreadsafeDateFormatBenchmark.java
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ThreadsafeDateFormatBenchmark.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ThreadsafeDateFormatBenchmark.java
index c28d398..885c357 100644
--- a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ThreadsafeDateFormatBenchmark.java
+++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ThreadsafeDateFormatBenchmark.java
@@ -67,7 +67,7 @@ public class ThreadsafeDateFormatBenchmark {
private final FastDateFormat fastDateFormat = FastDateFormat.getInstance("HH:mm:ss.SSS");
private final FixedDateFormat fixedDateFormat = FixedDateFormat.createIfSupported("HH:mm:ss.SSS");
private final FormatterFixedReuseBuffer formatFixedReuseBuffer = new FormatterFixedReuseBuffer();
-
+
private class CachedTimeFastFormat {
private final long timestamp;
private final String formatted;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/TimeFormatBenchmark.java
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/TimeFormatBenchmark.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/TimeFormatBenchmark.java
index a6b3db9..74e76f7 100644
--- a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/TimeFormatBenchmark.java
+++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/TimeFormatBenchmark.java
@@ -172,7 +172,7 @@ public class TimeFormatBenchmark {
// Do subtract to get remainder instead of doing % 10
buffer[pos++] = ((char) (hour - 10 * temp + '0'));
- buffer[pos++] = (':');
+ buffer[pos++] = ((char) ':');
// Minute
// 13/128 is nearly the same as /10 for values up to 65
@@ -181,14 +181,14 @@ public class TimeFormatBenchmark {
// Do subtract to get remainder instead of doing % 10
buffer[pos++] = ((char) (minute - 10 * temp + '0'));
- buffer[pos++] = (':');
+ buffer[pos++] = ((char) ':');
// Second
// 13/128 is nearly the same as /10 for values up to 65
temp = (second * 13) >> 7;
buffer[pos++] = ((char) (temp + '0'));
buffer[pos++] = ((char) (second - 10 * temp + '0'));
- buffer[pos++] = ('.');
+ buffer[pos++] = ((char) '.');
// Millisecond
// 41/4096 is nearly the same as /100
@@ -227,7 +227,7 @@ public class TimeFormatBenchmark {
// Do subtract to get remainder instead of doing % 10
buffer.append((char) (hours - 10 * temp + '0'));
- buffer.append(':');
+ buffer.append((char) ':');
// Minute
temp = minutes / 10;
@@ -235,13 +235,13 @@ public class TimeFormatBenchmark {
// Do subtract to get remainder instead of doing % 10
buffer.append((char) (minutes - 10 * temp + '0'));
- buffer.append(':');
+ buffer.append((char) ':');
// Second
temp = seconds / 10;
buffer.append((char) (temp + '0'));
buffer.append((char) (seconds - 10 * temp + '0'));
- buffer.append('.');
+ buffer.append((char) '.');
// Millisecond
temp = ms / 100;
@@ -279,7 +279,7 @@ public class TimeFormatBenchmark {
// Do subtract to get remainder instead of doing % 10
buffer[pos++] = ((char) (hours - 10 * temp + '0'));
- buffer[pos++] = (':');
+ buffer[pos++] = ((char) ':');
// Minute
temp = minutes / 10;
@@ -287,13 +287,13 @@ public class TimeFormatBenchmark {
// Do subtract to get remainder instead of doing % 10
buffer[pos++] = ((char) (minutes - 10 * temp + '0'));
- buffer[pos++] = (':');
+ buffer[pos++] = ((char) ':');
// Second
temp = seconds / 10;
buffer[pos++] = ((char) (temp + '0'));
buffer[pos++] = ((char) (seconds - 10 * temp + '0'));
- buffer[pos++] = ('.');
+ buffer[pos++] = ((char) '.');
// Millisecond
temp = ms / 100;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-slf4j18-impl/src/main/java/org/apache/logging/slf4j/Log4jLoggerFactory.java
----------------------------------------------------------------------
diff --git a/log4j-slf4j18-impl/src/main/java/org/apache/logging/slf4j/Log4jLoggerFactory.java b/log4j-slf4j18-impl/src/main/java/org/apache/logging/slf4j/Log4jLoggerFactory.java
index e7865a8..fcf1d66 100644
--- a/log4j-slf4j18-impl/src/main/java/org/apache/logging/slf4j/Log4jLoggerFactory.java
+++ b/log4j-slf4j18-impl/src/main/java/org/apache/logging/slf4j/Log4jLoggerFactory.java
@@ -32,7 +32,7 @@ public class Log4jLoggerFactory extends AbstractLoggerAdapter<Logger> implements
private static final String PACKAGE = "org.slf4j";
private final Log4jMarkerFactory markerFactory;
- public Log4jLoggerFactory(final Log4jMarkerFactory markerFactory) {
+ public Log4jLoggerFactory(Log4jMarkerFactory markerFactory) {
this.markerFactory = markerFactory;
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-web/src/main/java/org/apache/logging/log4j/web/Log4jWebLifeCycle.java
----------------------------------------------------------------------
diff --git a/log4j-web/src/main/java/org/apache/logging/log4j/web/Log4jWebLifeCycle.java b/log4j-web/src/main/java/org/apache/logging/log4j/web/Log4jWebLifeCycle.java
index e8cba90..05ccbfa 100644
--- a/log4j-web/src/main/java/org/apache/logging/log4j/web/Log4jWebLifeCycle.java
+++ b/log4j-web/src/main/java/org/apache/logging/log4j/web/Log4jWebLifeCycle.java
@@ -25,7 +25,7 @@ import org.apache.logging.log4j.core.LifeCycle;
* access to them.
*/
interface Log4jWebLifeCycle extends Log4jWebSupport, LifeCycle {
-
+
/**
* Starts up Log4j in the web application. Calls {@link #setLoggerContext()} after initialization is complete.
*
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-web/src/main/java/org/apache/logging/log4j/web/appender/ServletAppender.java
----------------------------------------------------------------------
diff --git a/log4j-web/src/main/java/org/apache/logging/log4j/web/appender/ServletAppender.java b/log4j-web/src/main/java/org/apache/logging/log4j/web/appender/ServletAppender.java
index b3c47e2..ddbc799 100644
--- a/log4j-web/src/main/java/org/apache/logging/log4j/web/appender/ServletAppender.java
+++ b/log4j-web/src/main/java/org/apache/logging/log4j/web/appender/ServletAppender.java
@@ -67,7 +67,7 @@ public class ServletAppender extends AbstractAppender {
/**
* Logs with {@link ServletContext#log(String, Throwable)} if true and with {@link ServletContext#log(String)} if false.
- *
+ *
* @return whether to log a Throwable with the servlet context.
*/
public boolean isLogThrowables() {
@@ -82,7 +82,7 @@ public class ServletAppender extends AbstractAppender {
}
}
-
+
@PluginBuilderFactory
public static <B extends Builder<B>> B newBuilder() {
return new Builder<B>().asBuilder();
@@ -90,7 +90,7 @@ public class ServletAppender extends AbstractAppender {
private final ServletContext servletContext;
private final boolean logThrowables;
-
+
private ServletAppender(final String name, final Layout<? extends Serializable> layout, final Filter filter,
final ServletContext servletContext, final boolean ignoreExceptions, final boolean logThrowables) {
super(name, filter, layout, ignoreExceptions, Property.EMPTY_ARRAY);
[10/13] logging-log4j2 git commit: Revert "Use final. Remove trailing
spaces."
Posted by gg...@apache.org.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
index 335018e..3c733d4 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
@@ -90,10 +90,10 @@ public class DefaultRolloverStrategy extends AbstractRolloverStrategy {
public static class Builder implements org.apache.logging.log4j.core.util.Builder<DefaultRolloverStrategy> {
@PluginBuilderAttribute("max")
private String max;
-
+
@PluginBuilderAttribute("min")
private String min;
-
+
@PluginBuilderAttribute("fileIndex")
private String fileIndex;
@@ -143,7 +143,7 @@ public class DefaultRolloverStrategy extends AbstractRolloverStrategy {
}
final int compressionLevel = Integers.parseInt(compressionLevelStr, Deflater.DEFAULT_COMPRESSION);
// The config object can be null when this object is built programmatically.
- final StrSubstitutor nonNullStrSubstitutor = config != null ? config.getStrSubstitutor() : new StrSubstitutor();
+ StrSubstitutor nonNullStrSubstitutor = config != null ? config.getStrSubstitutor() : new StrSubstitutor();
return new DefaultRolloverStrategy(minIndex, maxIndex, useMax, compressionLevel, nonNullStrSubstitutor,
customActions, stopCustomActionsOnError, tempCompressedFilePattern);
}
@@ -260,7 +260,7 @@ public class DefaultRolloverStrategy extends AbstractRolloverStrategy {
/**
* Defines configuration.
- *
+ *
* @param config The Configuration.
* @return This builder for chaining convenience
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DirectWriteRolloverStrategy.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DirectWriteRolloverStrategy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DirectWriteRolloverStrategy.java
index 8c6d259..b1ee506 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DirectWriteRolloverStrategy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DirectWriteRolloverStrategy.java
@@ -60,7 +60,7 @@ import org.apache.logging.log4j.core.util.Integers;
public class DirectWriteRolloverStrategy extends AbstractRolloverStrategy implements DirectFileRolloverStrategy {
private static final int DEFAULT_MAX_FILES = 7;
-
+
/**
* Builds DirectWriteRolloverStrategy instances.
*/
@@ -181,7 +181,7 @@ public class DirectWriteRolloverStrategy extends AbstractRolloverStrategy implem
/**
* Defines configuration.
- *
+ *
* @param config The Configuration.
* @return This builder for chaining convenience
*/
@@ -349,7 +349,7 @@ public class DirectWriteRolloverStrategy extends AbstractRolloverStrategy implem
nextIndex = fileIndex + 1;
final FileExtension fileExtension = manager.getFileExtension();
if (fileExtension != null) {
- compressedName += fileExtension.getExtension();
+ compressedName += fileExtension.getExtension();
if (tempCompressedFilePattern != null) {
final StringBuilder buf = new StringBuilder();
tempCompressedFilePattern.formatFileName(strSubstitutor, buf, fileIndex);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/FileExtension.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/FileExtension.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/FileExtension.java
index b859d79..9d0016f 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/FileExtension.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/FileExtension.java
@@ -121,5 +121,5 @@ public enum FileExtension {
File target(final String fileName) {
return new File(fileName);
- }
+ }
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/NoOpTriggeringPolicy.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/NoOpTriggeringPolicy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/NoOpTriggeringPolicy.java
index ff554e7..b9af0a0 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/NoOpTriggeringPolicy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/NoOpTriggeringPolicy.java
@@ -24,7 +24,7 @@ import org.apache.logging.log4j.core.config.plugins.PluginFactory;
/*
* Never triggers and is handy for edge-cases in tests for example.
- *
+ *
* @since 2.11.1
*/
@Plugin(name = "NoOpTriggeringPolicy", category = Core.CATEGORY_NAME, printObject = true)
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java
index a3fb930..affb809 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java
@@ -130,8 +130,8 @@ public class RollingRandomAccessFileManager extends RollingFileManager {
protected synchronized void writeToDestination(final byte[] bytes, final int offset, final int length) {
try {
if (randomAccessFile == null) {
- final String fileName = getFileName();
- final File file = new File(fileName);
+ String fileName = getFileName();
+ File file = new File(fileName);
FileUtils.makeParentDirs(file);
createFileAfterRollover(fileName);
}
@@ -148,7 +148,7 @@ public class RollingRandomAccessFileManager extends RollingFileManager {
createFileAfterRollover(getFileName());
}
- private void createFileAfterRollover(final String fileName) throws IOException {
+ private void createFileAfterRollover(String fileName) throws IOException {
this.randomAccessFile = new RandomAccessFile(fileName, "rw");
if (isAppend()) {
randomAccessFile.seek(randomAccessFile.length());
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TimeBasedTriggeringPolicy.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TimeBasedTriggeringPolicy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TimeBasedTriggeringPolicy.java
index 3cadd42..7f6ac79 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TimeBasedTriggeringPolicy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TimeBasedTriggeringPolicy.java
@@ -33,18 +33,18 @@ import org.apache.logging.log4j.core.util.Integers;
@Plugin(name = "TimeBasedTriggeringPolicy", category = Core.CATEGORY_NAME, printObject = true)
public final class TimeBasedTriggeringPolicy extends AbstractTriggeringPolicy {
-
+
public static class Builder implements org.apache.logging.log4j.core.util.Builder<TimeBasedTriggeringPolicy> {
@PluginBuilderAttribute
private int interval = 1;
-
+
@PluginBuilderAttribute
private boolean modulate = false;
-
+
@PluginBuilderAttribute
private int maxRandomDelay = 0;
-
+
@Override
public TimeBasedTriggeringPolicy build() {
final long maxRandomDelayMillis = TimeUnit.SECONDS.toMillis(maxRandomDelay);
@@ -62,17 +62,17 @@ public final class TimeBasedTriggeringPolicy extends AbstractTriggeringPolicy {
public int getMaxRandomDelay() {
return maxRandomDelay;
}
-
+
public Builder withInterval(final int interval){
this.interval = interval;
return this;
}
-
+
public Builder withModulate(final boolean modulate){
this.modulate = modulate;
return this;
}
-
+
public Builder withMaxRandomDelay(final int maxRandomDelay){
this.maxRandomDelay = maxRandomDelay;
return this;
@@ -108,10 +108,10 @@ public final class TimeBasedTriggeringPolicy extends AbstractTriggeringPolicy {
@Override
public void initialize(final RollingFileManager aManager) {
this.manager = aManager;
-
+
// LOG4J2-531: call getNextTime twice to force initialization of both prevFileTime and nextFileTime
aManager.getPatternProcessor().getNextTime(aManager.getFileTime(), interval, modulate);
-
+
nextRolloverMillis = ThreadLocalRandom.current().nextLong(0, 1 + maxRandomDelayMillis)
+ aManager.getPatternProcessor().getNextTime(aManager.getFileTime(), interval, modulate);
}
@@ -151,7 +151,7 @@ public final class TimeBasedTriggeringPolicy extends AbstractTriggeringPolicy {
.withModulate(Boolean.parseBoolean(modulate))
.build();
}
-
+
@PluginBuilderFactory
public static TimeBasedTriggeringPolicy.Builder newBuilder() {
return new Builder();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TriggeringPolicy.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TriggeringPolicy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TriggeringPolicy.java
index bb68d90..ed6a3f1 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TriggeringPolicy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TriggeringPolicy.java
@@ -22,7 +22,7 @@ import org.apache.logging.log4j.core.LogEvent;
* A <code>TriggeringPolicy</code> controls the conditions under which rollover
* occurs. Such conditions include time of day, file size, an
* external event, the log request or a combination thereof.
- *
+ *
* @see AbstractTriggeringPolicy
*/
public interface TriggeringPolicy /* TODO 3.0: extends LifeCycle */ {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/AbstractAction.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/AbstractAction.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/AbstractAction.java
index f6a92ff..633d4bc 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/AbstractAction.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/AbstractAction.java
@@ -26,7 +26,7 @@ import org.apache.logging.log4j.status.StatusLogger;
* Abstract base class for implementations of Action.
*/
public abstract class AbstractAction implements Action {
-
+
/**
* Allows subclasses access to the status logger without creating another instance.
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/AbstractPathAction.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/AbstractPathAction.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/AbstractPathAction.java
index 7d8ac06..f8ddf48 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/AbstractPathAction.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/AbstractPathAction.java
@@ -45,7 +45,7 @@ public abstract class AbstractPathAction extends AbstractAction {
/**
* Creates a new AbstractPathAction that starts scanning for files to process from the specified base path.
- *
+ *
* @param basePath base path from where to start scanning for files to process.
* @param followSymbolicLinks whether to follow symbolic links. Default is false.
* @param maxDepth The maxDepth parameter is the maximum number of levels of directories to visit. A value of 0
@@ -57,7 +57,7 @@ public abstract class AbstractPathAction extends AbstractAction {
protected AbstractPathAction(final String basePath, final boolean followSymbolicLinks, final int maxDepth,
final PathCondition[] pathFilters, final StrSubstitutor subst) {
this.basePathString = basePath;
- this.options = followSymbolicLinks ? EnumSet.of(FileVisitOption.FOLLOW_LINKS)
+ this.options = followSymbolicLinks ? EnumSet.of(FileVisitOption.FOLLOW_LINKS)
: Collections.<FileVisitOption> emptySet();
this.maxDepth = maxDepth;
this.pathConditions = Arrays.asList(Arrays.copyOf(pathFilters, pathFilters.length));
@@ -87,7 +87,7 @@ public abstract class AbstractPathAction extends AbstractAction {
* method when the {@link #execute()} method is invoked.
* <p>
* The visitor is responsible for processing the files it encounters that are accepted by all filters.
- *
+ *
* @param visitorBaseDir base dir from where to start scanning for files to process
* @param conditions filters that determine if a file should be processed
* @return a new {@code FileVisitor<Path>}
@@ -99,7 +99,7 @@ public abstract class AbstractPathAction extends AbstractAction {
* Returns the base path from where to start scanning for files to delete. Lookups are resolved, so if the
* configuration was <code><Delete basePath="${sys:user.home}/abc" /></code> then this method returns a path
* to the "abc" file or directory in the user's home directory.
- *
+ *
* @return the base path (all lookups resolved)
*/
public Path getBasePath() {
@@ -108,7 +108,7 @@ public abstract class AbstractPathAction extends AbstractAction {
/**
* Returns the base path as it was specified in the configuration. Lookups are not resolved.
- *
+ *
* @return the base path as it was specified in the configuration
*/
public String getBasePathString() {
@@ -121,16 +121,16 @@ public abstract class AbstractPathAction extends AbstractAction {
/**
* Returns whether to follow symbolic links or not.
- *
+ *
* @return the options
*/
public Set<FileVisitOption> getOptions() {
return Collections.unmodifiableSet(options);
}
-
+
/**
* Returns whether to follow symbolic links or not.
- *
+ *
* @return whether to follow symbolic links or not
*/
public boolean isFollowSymbolicLinks() {
@@ -139,7 +139,7 @@ public abstract class AbstractPathAction extends AbstractAction {
/**
* Returns the the maximum number of directory levels to visit.
- *
+ *
* @return the maxDepth
*/
public int getMaxDepth() {
@@ -148,7 +148,7 @@ public abstract class AbstractPathAction extends AbstractAction {
/**
* Returns the list of PathCondition objects.
- *
+ *
* @return the pathFilters
*/
public List<PathCondition> getPathConditions() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/CommonsCompressAction.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/CommonsCompressAction.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/CommonsCompressAction.java
index e461a8c..6d0c6e2 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/CommonsCompressAction.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/CommonsCompressAction.java
@@ -140,7 +140,7 @@ public final class CommonsCompressAction extends AbstractAction {
@Override
public String toString() {
- return CommonsCompressAction.class.getSimpleName() + '[' + source + " to " + destination
+ return CommonsCompressAction.class.getSimpleName() + '[' + source + " to " + destination
+ ", deleteSource=" + deleteSource + ']';
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/CompositeAction.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/CompositeAction.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/CompositeAction.java
index 8d5a48b..5637144 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/CompositeAction.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/CompositeAction.java
@@ -25,7 +25,7 @@ import java.util.List;
* A group of Actions to be executed in sequence.
*/
public class CompositeAction extends AbstractAction {
-
+
/**
* Actions to perform.
*/
@@ -99,7 +99,7 @@ public class CompositeAction extends AbstractAction {
return status;
}
-
+
@Override
public String toString() {
return CompositeAction.class.getSimpleName() + Arrays.toString(actions);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeleteAction.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeleteAction.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeleteAction.java
index a0fbac6..76e9b00 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeleteAction.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeleteAction.java
@@ -45,7 +45,7 @@ public class DeleteAction extends AbstractPathAction {
/**
* Creates a new DeleteAction that starts scanning for files to delete from the specified base path.
- *
+ *
* @param basePath base path from where to start scanning for files to delete.
* @param followSymbolicLinks whether to follow symbolic links. Default is false.
* @param maxDepth The maxDepth parameter is the maximum number of levels of directories to visit. A value of 0
@@ -74,7 +74,7 @@ public class DeleteAction extends AbstractPathAction {
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.appender.rolling.action.AbstractPathAction#execute()
*/
@Override
@@ -113,7 +113,7 @@ public class DeleteAction extends AbstractPathAction {
/**
* Deletes the specified file.
- *
+ *
* @param path the file to delete
* @throws IOException if a problem occurred deleting the file
*/
@@ -124,7 +124,7 @@ public class DeleteAction extends AbstractPathAction {
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.appender.rolling.action.AbstractPathAction#execute(FileVisitor)
*/
@Override
@@ -153,7 +153,7 @@ public class DeleteAction extends AbstractPathAction {
/**
* Returns a sorted list of all files up to maxDepth under the basePath.
- *
+ *
* @return a sorted list of files
* @throws IOException
*/
@@ -166,7 +166,7 @@ public class DeleteAction extends AbstractPathAction {
/**
* Returns {@code true} if files are not deleted even when all conditions accept a path, {@code false} otherwise.
- *
+ *
* @return {@code true} if files are not deleted even when all conditions accept a path, {@code false} otherwise
*/
public boolean isTestMode() {
@@ -180,7 +180,7 @@ public class DeleteAction extends AbstractPathAction {
/**
* Create a DeleteAction.
- *
+ *
* @param basePath base path from where to start scanning for files to delete.
* @param followLinks whether to follow symbolic links. Default is false.
* @param maxDepth The maxDepth parameter is the maximum number of levels of directories to visit. A value of 0
@@ -199,7 +199,7 @@ public class DeleteAction extends AbstractPathAction {
@PluginFactory
public static DeleteAction createDeleteAction(
// @formatter:off
- @PluginAttribute("basePath") final String basePath,
+ @PluginAttribute("basePath") final String basePath,
@PluginAttribute(value = "followLinks") final boolean followLinks,
@PluginAttribute(value = "maxDepth", defaultInt = 1) final int maxDepth,
@PluginAttribute(value = "testMode") final boolean testMode,
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeletingVisitor.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeletingVisitor.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeletingVisitor.java
index 45ddd33..825e774 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeletingVisitor.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeletingVisitor.java
@@ -1,97 +1,97 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-package org.apache.logging.log4j.core.appender.rolling.action;
-
-import java.io.IOException;
-import java.nio.file.FileVisitResult;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.SimpleFileVisitor;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.util.List;
-import java.util.Objects;
-
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.status.StatusLogger;
-
-/**
- * FileVisitor that deletes files that are accepted by all PathFilters. Directories are ignored.
- */
-public class DeletingVisitor extends SimpleFileVisitor<Path> {
- private static final Logger LOGGER = StatusLogger.getLogger();
-
- private final Path basePath;
- private final boolean testMode;
- private final List<? extends PathCondition> pathConditions;
-
- /**
- * Constructs a new DeletingVisitor.
- *
- * @param basePath used to relativize paths
- * @param pathConditions objects that need to confirm whether a file can be deleted
- * @param testMode if true, files are not deleted but instead a message is printed to the <a
- * href="http://logging.apache.org/log4j/2.x/manual/configuration.html#StatusMessages">status logger</a>
- * at INFO level. Users can use this to do a dry run to test if their configuration works as expected.
- */
- public DeletingVisitor(final Path basePath, final List<? extends PathCondition> pathConditions,
- final boolean testMode) {
- this.testMode = testMode;
- this.basePath = Objects.requireNonNull(basePath, "basePath");
- this.pathConditions = Objects.requireNonNull(pathConditions, "pathConditions");
- for (final PathCondition condition : pathConditions) {
- condition.beforeFileTreeWalk();
- }
- }
-
- @Override
- public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException {
- for (final PathCondition pathFilter : pathConditions) {
- final Path relative = basePath.relativize(file);
- if (!pathFilter.accept(basePath, relative, attrs)) {
- LOGGER.trace("Not deleting base={}, relative={}", basePath, relative);
- return FileVisitResult.CONTINUE;
- }
- }
- if (isTestMode()) {
- LOGGER.info("Deleting {} (TEST MODE: file not actually deleted)", file);
- } else {
- delete(file);
- }
- return FileVisitResult.CONTINUE;
- }
-
- /**
- * Deletes the specified file.
- *
- * @param file the file to delete
- * @throws IOException if a problem occurred deleting the file
- */
- protected void delete(final Path file) throws IOException {
- LOGGER.trace("Deleting {}", file);
- Files.deleteIfExists(file);
- }
-
- /**
- * Returns {@code true} if files are not deleted even when all conditions accept a path, {@code false} otherwise.
- *
- * @return {@code true} if files are not deleted even when all conditions accept a path, {@code false} otherwise
- */
- public boolean isTestMode() {
- return testMode;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.core.appender.rolling.action;
+
+import java.io.IOException;
+import java.nio.file.FileVisitResult;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.SimpleFileVisitor;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.List;
+import java.util.Objects;
+
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.status.StatusLogger;
+
+/**
+ * FileVisitor that deletes files that are accepted by all PathFilters. Directories are ignored.
+ */
+public class DeletingVisitor extends SimpleFileVisitor<Path> {
+ private static final Logger LOGGER = StatusLogger.getLogger();
+
+ private final Path basePath;
+ private final boolean testMode;
+ private final List<? extends PathCondition> pathConditions;
+
+ /**
+ * Constructs a new DeletingVisitor.
+ *
+ * @param basePath used to relativize paths
+ * @param pathConditions objects that need to confirm whether a file can be deleted
+ * @param testMode if true, files are not deleted but instead a message is printed to the <a
+ * href="http://logging.apache.org/log4j/2.x/manual/configuration.html#StatusMessages">status logger</a>
+ * at INFO level. Users can use this to do a dry run to test if their configuration works as expected.
+ */
+ public DeletingVisitor(final Path basePath, final List<? extends PathCondition> pathConditions,
+ final boolean testMode) {
+ this.testMode = testMode;
+ this.basePath = Objects.requireNonNull(basePath, "basePath");
+ this.pathConditions = Objects.requireNonNull(pathConditions, "pathConditions");
+ for (final PathCondition condition : pathConditions) {
+ condition.beforeFileTreeWalk();
+ }
+ }
+
+ @Override
+ public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException {
+ for (final PathCondition pathFilter : pathConditions) {
+ final Path relative = basePath.relativize(file);
+ if (!pathFilter.accept(basePath, relative, attrs)) {
+ LOGGER.trace("Not deleting base={}, relative={}", basePath, relative);
+ return FileVisitResult.CONTINUE;
+ }
+ }
+ if (isTestMode()) {
+ LOGGER.info("Deleting {} (TEST MODE: file not actually deleted)", file);
+ } else {
+ delete(file);
+ }
+ return FileVisitResult.CONTINUE;
+ }
+
+ /**
+ * Deletes the specified file.
+ *
+ * @param file the file to delete
+ * @throws IOException if a problem occurred deleting the file
+ */
+ protected void delete(final Path file) throws IOException {
+ LOGGER.trace("Deleting {}", file);
+ Files.deleteIfExists(file);
+ }
+
+ /**
+ * Returns {@code true} if files are not deleted even when all conditions accept a path, {@code false} otherwise.
+ *
+ * @return {@code true} if files are not deleted even when all conditions accept a path, {@code false} otherwise
+ */
+ public boolean isTestMode() {
+ return testMode;
+ }
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/Duration.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/Duration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/Duration.java
index 8684a29..5305c91 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/Duration.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/Duration.java
@@ -29,7 +29,7 @@ import java.util.regex.Pattern;
* <p>
* Similarly to the {@code java.time.Duration} class, this class does not support year or month sections in the format.
* This implementation does not support fractions or negative values.
- *
+ *
* @see #parse(CharSequence)
*/
public class Duration implements Serializable, Comparable<Duration> {
@@ -101,7 +101,7 @@ public class Duration implements Serializable, Comparable<Duration> {
* positive symbol. The number of days, hours, minutes and seconds must parse to a {@code long}.
* <p>
* Examples:
- *
+ *
* <pre>
* "PT20S" -- parses as "20 seconds"
* "PT15M" -- parses as "15 minutes" (where a minute is 60 seconds)
@@ -205,14 +205,14 @@ public class Duration implements Serializable, Comparable<Duration> {
* all positive.
* <p>
* Examples:
- *
+ *
* <pre>
* "20 seconds" -- "PT20S
* "15 minutes" (15 * 60 seconds) -- "PT15M"
* "10 hours" (10 * 3600 seconds) -- "PT10H"
* "2 days" (2 * 86400 seconds) -- "P2D"
* </pre>
- *
+ *
* @return an ISO-8601 representation of this duration, not null
*/
@Override
@@ -247,7 +247,7 @@ public class Duration implements Serializable, Comparable<Duration> {
/*
* (non-Javadoc)
- *
+ *
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
@Override
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/GzCompressAction.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/GzCompressAction.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/GzCompressAction.java
index eb8e6e3..1c9b082 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/GzCompressAction.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/GzCompressAction.java
@@ -121,7 +121,7 @@ public final class GzCompressAction extends AbstractAction {
@Override
public String toString() {
- return GzCompressAction.class.getSimpleName() + '[' + source + " to " + destination
+ return GzCompressAction.class.getSimpleName() + '[' + source + " to " + destination
+ ", deleteSource=" + deleteSource + ']';
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAccumulatedFileCount.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAccumulatedFileCount.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAccumulatedFileCount.java
index f5761bb..b47954f 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAccumulatedFileCount.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAccumulatedFileCount.java
@@ -59,7 +59,7 @@ public final class IfAccumulatedFileCount implements PathCondition {
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.appender.rolling.action.PathCondition#accept(java.nio.file.Path,
* java.nio.file.Path, java.nio.file.attribute.BasicFileAttributes)
*/
@@ -78,7 +78,7 @@ public final class IfAccumulatedFileCount implements PathCondition {
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.appender.rolling.action.PathCondition#beforeFileTreeWalk()
*/
@Override
@@ -89,12 +89,12 @@ public final class IfAccumulatedFileCount implements PathCondition {
/**
* Create an IfAccumulatedFileCount condition.
- *
+ *
* @param threshold The threshold count from which files will be deleted.
* @return An IfAccumulatedFileCount condition.
*/
@PluginFactory
- public static IfAccumulatedFileCount createFileCountCondition(
+ public static IfAccumulatedFileCount createFileCountCondition(
// @formatter:off
@PluginAttribute(value = "exceeds", defaultInt = Integer.MAX_VALUE) final int threshold,
@PluginElement("PathConditions") final PathCondition... nestedConditions) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAccumulatedFileSize.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAccumulatedFileSize.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAccumulatedFileSize.java
index 6cc6ab6..7c1d908 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAccumulatedFileSize.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAccumulatedFileSize.java
@@ -60,7 +60,7 @@ public final class IfAccumulatedFileSize implements PathCondition {
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.appender.rolling.action.PathCondition#accept(java.nio.file.Path,
* java.nio.file.Path, java.nio.file.attribute.BasicFileAttributes)
*/
@@ -80,7 +80,7 @@ public final class IfAccumulatedFileSize implements PathCondition {
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.appender.rolling.action.PathCondition#beforeFileTreeWalk()
*/
@Override
@@ -91,12 +91,12 @@ public final class IfAccumulatedFileSize implements PathCondition {
/**
* Create an IfAccumulatedFileSize condition.
- *
+ *
* @param threshold The threshold accumulated file size from which files will be deleted.
* @return An IfAccumulatedFileSize condition.
*/
@PluginFactory
- public static IfAccumulatedFileSize createFileSizeCondition(
+ public static IfAccumulatedFileSize createFileSizeCondition(
// @formatter:off
@PluginAttribute("exceeds") final String size,
@PluginElement("PathConditions") final PathCondition... nestedConditions) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAll.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAll.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAll.java
index 27596cb..2eaea8b 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAll.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAll.java
@@ -45,7 +45,7 @@ public final class IfAll implements PathCondition {
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.appender.rolling.action.PathCondition#accept(java.nio.file.Path,
* java.nio.file.Path, java.nio.file.attribute.BasicFileAttributes)
*/
@@ -59,7 +59,7 @@ public final class IfAll implements PathCondition {
/**
* Returns {@code true} if all the specified conditions accept the specified path, {@code false} otherwise.
- *
+ *
* @param list the array of conditions to evaluate
* @param baseDir the directory from where to start scanning for deletion candidate files
* @param relativePath the candidate for deletion. This path is relative to the baseDir.
@@ -79,7 +79,7 @@ public final class IfAll implements PathCondition {
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.appender.rolling.action.PathCondition#beforeFileTreeWalk()
*/
@Override
@@ -89,7 +89,7 @@ public final class IfAll implements PathCondition {
/**
* Calls {@link #beforeFileTreeWalk()} on all of the specified nested conditions.
- *
+ *
* @param nestedConditions the conditions to call {@link #beforeFileTreeWalk()} on
*/
public static void beforeFileTreeWalk(final PathCondition[] nestedConditions) {
@@ -100,12 +100,12 @@ public final class IfAll implements PathCondition {
/**
* Create a Composite PathCondition whose components all need to accept before this condition accepts.
- *
+ *
* @param components The component filters.
* @return A Composite PathCondition.
*/
@PluginFactory
- public static IfAll createAndCondition(
+ public static IfAll createAndCondition(
@PluginElement("PathConditions") final PathCondition... components) {
return new IfAll(components);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAny.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAny.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAny.java
index a982b58..6d5841f 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAny.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfAny.java
@@ -70,12 +70,12 @@ public final class IfAny implements PathCondition {
/**
* Create a Composite PathCondition: accepts if any of the nested conditions accepts.
- *
+ *
* @param components The component conditions.
* @return A Composite PathCondition.
*/
@PluginFactory
- public static IfAny createOrCondition(
+ public static IfAny createOrCondition(
@PluginElement("PathConditions") final PathCondition... components) {
return new IfAny(components);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfFileName.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfFileName.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfFileName.java
index 34ee066..1084a77 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfFileName.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfFileName.java
@@ -52,7 +52,7 @@ public final class IfFileName implements PathCondition {
/**
* Constructs a FileNameFilter filter. If both a regular expression and a glob pattern are specified the glob
* pattern is used and the regular expression is ignored.
- *
+ *
* @param glob the baseDir-relative path pattern of the files to delete (may contain '*' and '?' wildcarts)
* @param regex the regular expression that matches the baseDir-relative path of the file(s) to delete
* @param nestedConditions nested conditions to evaluate if this condition accepts a path
@@ -80,7 +80,7 @@ public final class IfFileName implements PathCondition {
* {@code syntax:pattern} where syntax is one of "glob" or "regex" and the pattern is either a {@linkplain Pattern
* regular expression} or a simplified pattern expression described under "glob" in
* {@link FileSystem#getPathMatcher(String)}.
- *
+ *
* @return relative path of the file(s) to delete (may contain regular expression or wildcarts)
*/
public String getSyntaxAndPattern() {
@@ -93,7 +93,7 @@ public final class IfFileName implements PathCondition {
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.appender.rolling.action.PathCondition#accept(java.nio.file.Path,
* java.nio.file.Path, java.nio.file.attribute.BasicFileAttributes)
*/
@@ -112,7 +112,7 @@ public final class IfFileName implements PathCondition {
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.appender.rolling.action.PathCondition#beforeFileTreeWalk()
*/
@Override
@@ -125,7 +125,7 @@ public final class IfFileName implements PathCondition {
* {@linkplain FileSystem#getPathMatcher(String) glob pattern} or the regular expression matches the relative path.
* If both a regular expression and a glob pattern are specified the glob pattern is used and the regular expression
* is ignored.
- *
+ *
* @param glob the baseDir-relative path pattern of the files to delete (may contain '*' and '?' wildcarts)
* @param regex the regular expression that matches the baseDir-relative path of the file(s) to delete
* @param nestedConditions nested conditions to evaluate if this condition accepts a path
@@ -133,10 +133,10 @@ public final class IfFileName implements PathCondition {
* @see FileSystem#getPathMatcher(String)
*/
@PluginFactory
- public static IfFileName createNameCondition(
+ public static IfFileName createNameCondition(
// @formatter:off
- @PluginAttribute("glob") final String glob,
- @PluginAttribute("regex") final String regex,
+ @PluginAttribute("glob") final String glob,
+ @PluginAttribute("regex") final String regex,
@PluginElement("PathConditions") final PathCondition... nestedConditions) {
// @formatter:on
return new IfFileName(glob, regex, nestedConditions);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfLastModified.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfLastModified.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfLastModified.java
index eff6536..4a4c717 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfLastModified.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfLastModified.java
@@ -61,7 +61,7 @@ public final class IfLastModified implements PathCondition {
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.appender.rolling.action.PathCondition#accept(java.nio.file.Path,
* java.nio.file.Path, java.nio.file.attribute.BasicFileAttributes)
*/
@@ -82,7 +82,7 @@ public final class IfLastModified implements PathCondition {
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.appender.rolling.action.PathCondition#beforeFileTreeWalk()
*/
@Override
@@ -92,15 +92,15 @@ public final class IfLastModified implements PathCondition {
/**
* Create an IfLastModified condition.
- *
+ *
* @param age The path age that is accepted by this condition. Must be a valid Duration.
* @param nestedConditions nested conditions to evaluate if this condition accepts a path
* @return An IfLastModified condition.
*/
@PluginFactory
- public static IfLastModified createAgeCondition(
+ public static IfLastModified createAgeCondition(
// @formatter:off
- @PluginAttribute("age") final Duration age,
+ @PluginAttribute("age") final Duration age,
@PluginElement("PathConditions") final PathCondition... nestedConditions) {
// @formatter:on
return new IfLastModified(age, nestedConditions);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfNot.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfNot.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfNot.java
index 998a713..1baf187 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfNot.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfNot.java
@@ -61,12 +61,12 @@ public final class IfNot implements PathCondition {
/**
* Create an IfNot PathCondition.
- *
+ *
* @param condition The condition to negate.
* @return An IfNot PathCondition.
*/
@PluginFactory
- public static IfNot createNotCondition(
+ public static IfNot createNotCondition(
@PluginElement("PathConditions") final PathCondition condition) {
return new IfNot(condition);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathCondition.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathCondition.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathCondition.java
index 8b8944c..0fa7873 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathCondition.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathCondition.java
@@ -1,44 +1,44 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-package org.apache.logging.log4j.core.appender.rolling.action;
-
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.attribute.BasicFileAttributes;
-
-/**
- * Filter that accepts or rejects a candidate {@code Path} for deletion.
- */
-public interface PathCondition {
-
- /**
- * Invoked before a new {@linkplain Files#walkFileTree(Path, java.util.Set, int, java.nio.file.FileVisitor) file
- * tree walk} is started. Stateful PathConditions can reset their state when this method is called.
- */
- void beforeFileTreeWalk();
-
- /**
- * Returns {@code true} if the specified candidate path should be deleted, {@code false} otherwise.
- *
- * @param baseDir the directory from where to start scanning for deletion candidate files
- * @param relativePath the candidate for deletion. This path is relative to the baseDir.
- * @param attrs attributes of the candidate path
- * @return whether the candidate path should be deleted
- */
- boolean accept(final Path baseDir, final Path relativePath, final BasicFileAttributes attrs);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.core.appender.rolling.action;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.attribute.BasicFileAttributes;
+
+/**
+ * Filter that accepts or rejects a candidate {@code Path} for deletion.
+ */
+public interface PathCondition {
+
+ /**
+ * Invoked before a new {@linkplain Files#walkFileTree(Path, java.util.Set, int, java.nio.file.FileVisitor) file
+ * tree walk} is started. Stateful PathConditions can reset their state when this method is called.
+ */
+ void beforeFileTreeWalk();
+
+ /**
+ * Returns {@code true} if the specified candidate path should be deleted, {@code false} otherwise.
+ *
+ * @param baseDir the directory from where to start scanning for deletion candidate files
+ * @param relativePath the candidate for deletion. This path is relative to the baseDir.
+ * @param attrs attributes of the candidate path
+ * @return whether the candidate path should be deleted
+ */
+ boolean accept(final Path baseDir, final Path relativePath, final BasicFileAttributes attrs);
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathSortByModificationTime.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathSortByModificationTime.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathSortByModificationTime.java
index 468dee7..e0a04b5 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathSortByModificationTime.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathSortByModificationTime.java
@@ -37,7 +37,7 @@ public class PathSortByModificationTime implements PathSorter, Serializable {
/**
* Constructs a new SortByModificationTime sorter.
- *
+ *
* @param recentFirst if true, most recently modified paths should come first
*/
public PathSortByModificationTime(final boolean recentFirst) {
@@ -47,19 +47,19 @@ public class PathSortByModificationTime implements PathSorter, Serializable {
/**
* Create a PathSorter that sorts by lastModified time.
- *
+ *
* @param recentFirst if true, most recently modified paths should come first.
* @return A PathSorter.
*/
@PluginFactory
- public static PathSorter createSorter(
+ public static PathSorter createSorter(
@PluginAttribute(value = "recentFirst", defaultBoolean = true) final boolean recentFirst) {
return new PathSortByModificationTime(recentFirst);
}
/**
* Returns whether this sorter sorts recent files first.
- *
+ *
* @return whether this sorter sorts recent files first
*/
public boolean isRecentFirst() {
@@ -68,7 +68,7 @@ public class PathSortByModificationTime implements PathSorter, Serializable {
/*
* (non-Javadoc)
- *
+ *
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
@Override
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathWithAttributes.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathWithAttributes.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathWithAttributes.java
index 7dbc92c..42640c3 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathWithAttributes.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathWithAttributes.java
@@ -1,59 +1,59 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-package org.apache.logging.log4j.core.appender.rolling.action;
-
-import java.nio.file.Path;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.util.Objects;
-
-/**
- * Tuple of a {@code Path} and {@code BasicFileAttributes}, used for sorting.
- */
-public class PathWithAttributes {
-
- private final Path path;
- private final BasicFileAttributes attributes;
-
- public PathWithAttributes(final Path path, final BasicFileAttributes attributes) {
- this.path = Objects.requireNonNull(path, "path");
- this.attributes = Objects.requireNonNull(attributes, "attributes");
- }
-
- @Override
- public String toString() {
- return path + " (modified: " + attributes.lastModifiedTime() + ")";
- }
-
- /**
- * Returns the path.
- *
- * @return the path
- */
- public Path getPath() {
- return path;
- }
-
- /**
- * Returns the attributes.
- *
- * @return the attributes
- */
- public BasicFileAttributes getAttributes() {
- return attributes;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.core.appender.rolling.action;
+
+import java.nio.file.Path;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.Objects;
+
+/**
+ * Tuple of a {@code Path} and {@code BasicFileAttributes}, used for sorting.
+ */
+public class PathWithAttributes {
+
+ private final Path path;
+ private final BasicFileAttributes attributes;
+
+ public PathWithAttributes(final Path path, final BasicFileAttributes attributes) {
+ this.path = Objects.requireNonNull(path, "path");
+ this.attributes = Objects.requireNonNull(attributes, "attributes");
+ }
+
+ @Override
+ public String toString() {
+ return path + " (modified: " + attributes.lastModifiedTime() + ")";
+ }
+
+ /**
+ * Returns the path.
+ *
+ * @return the path
+ */
+ public Path getPath() {
+ return path;
+ }
+
+ /**
+ * Returns the attributes.
+ *
+ * @return the attributes
+ */
+ public BasicFileAttributes getAttributes() {
+ return attributes;
+ }
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PosixViewAttributeAction.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PosixViewAttributeAction.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PosixViewAttributeAction.java
index 0cf6ba5..bb5bc74 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PosixViewAttributeAction.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PosixViewAttributeAction.java
@@ -43,12 +43,12 @@ import org.apache.logging.log4j.util.Strings;
/**
* File posix attribute view action.
- *
+ *
* Allow to define file permissions, user and group for log files on posix supported OS.
*/
@Plugin(name = "PosixViewAttribute", category = Core.CATEGORY_NAME, printObject = true)
public class PosixViewAttributeAction extends AbstractPathAction {
-
+
/**
* File permissions.
*/
@@ -86,7 +86,7 @@ public class PosixViewAttributeAction extends AbstractPathAction {
@PluginConfiguration
private Configuration configuration;
-
+
private StrSubstitutor subst;
@PluginBuilderAttribute
@@ -183,7 +183,7 @@ public class PosixViewAttributeAction extends AbstractPathAction {
/**
* Define max folder depth to search for eligible files to apply posix attribute view.
- * @param maxDepth Max search depth
+ * @param maxDepth Max search depth
* @return This builder
*/
public Builder withMaxDepth(final int maxDepth) {
@@ -275,10 +275,10 @@ public class PosixViewAttributeAction extends AbstractPathAction {
public Set<PosixFilePermission> getFilePermissions() {
return filePermissions;
}
-
+
/**
* Returns file owner if defined and the OS supports owner file attribute view,
- * null otherwise.
+ * null otherwise.
* @return File owner
* @see FileOwnerAttributeView
*/
@@ -288,7 +288,7 @@ public class PosixViewAttributeAction extends AbstractPathAction {
/**
* Returns file group if defined and the OS supports posix/group file attribute view,
- * null otherwise.
+ * null otherwise.
* @return File group
* @see PosixFileAttributeView
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/ScriptCondition.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/ScriptCondition.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/ScriptCondition.java
index 6ef46ed..9d728c0 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/ScriptCondition.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/ScriptCondition.java
@@ -38,7 +38,7 @@ import org.apache.logging.log4j.status.StatusLogger;
/**
* A condition of the {@link DeleteAction} where a user-provided script selects the files to delete from a provided
* list. The specified script may be a {@link Script}, a {@link ScriptFile} or a {@link ScriptRef}.
- *
+ *
* @see #createCondition(AbstractScript, Configuration)
*/
@Plugin(name = "ScriptCondition", category = Core.CATEGORY_NAME, printObject = true)
@@ -50,7 +50,7 @@ public class ScriptCondition {
/**
* Constructs a new ScriptCondition.
- *
+ *
* @param script the script that can select files to delete
* @param configuration configuration containing the StrSubstitutor passed to the script
*/
@@ -64,7 +64,7 @@ public class ScriptCondition {
/**
* Executes the script
- *
+ *
* @param baseDir
* @param candidates
* @return
@@ -84,7 +84,7 @@ public class ScriptCondition {
/**
* Creates the ScriptCondition.
- *
+ *
* @param script The script to run. This may be a {@link Script}, a {@link ScriptFile} or a {@link ScriptRef}. The
* script must return a {@code List<PathWithAttributes>}. When the script is executed, it is provided the
* following bindings:
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/SortingVisitor.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/SortingVisitor.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/SortingVisitor.java
index 7b6d956..7bf76b6 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/SortingVisitor.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/SortingVisitor.java
@@ -1,58 +1,58 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-package org.apache.logging.log4j.core.appender.rolling.action;
-
-import java.io.IOException;
-import java.nio.file.FileVisitResult;
-import java.nio.file.Path;
-import java.nio.file.SimpleFileVisitor;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * FileVisitor that sorts files.
- */
-public class SortingVisitor extends SimpleFileVisitor<Path> {
-
- private final PathSorter sorter;
- private final List<PathWithAttributes> collected = new ArrayList<>();
-
- /**
- * Constructs a new DeletingVisitor.
- *
- * @param basePath used to relativize paths
- * @param pathFilters objects that need to confirm whether a file can be deleted
- */
- public SortingVisitor(final PathSorter sorter) {
- this.sorter = Objects.requireNonNull(sorter, "sorter");
- }
-
- @Override
- public FileVisitResult visitFile(final Path path, final BasicFileAttributes attrs) throws IOException {
- collected.add(new PathWithAttributes(path, attrs));
- return FileVisitResult.CONTINUE;
- }
-
- public List<PathWithAttributes> getSortedPaths() {
- Collections.sort(collected, sorter);
- return collected;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.core.appender.rolling.action;
+
+import java.io.IOException;
+import java.nio.file.FileVisitResult;
+import java.nio.file.Path;
+import java.nio.file.SimpleFileVisitor;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * FileVisitor that sorts files.
+ */
+public class SortingVisitor extends SimpleFileVisitor<Path> {
+
+ private final PathSorter sorter;
+ private final List<PathWithAttributes> collected = new ArrayList<>();
+
+ /**
+ * Constructs a new DeletingVisitor.
+ *
+ * @param basePath used to relativize paths
+ * @param pathFilters objects that need to confirm whether a file can be deleted
+ */
+ public SortingVisitor(final PathSorter sorter) {
+ this.sorter = Objects.requireNonNull(sorter, "sorter");
+ }
+
+ @Override
+ public FileVisitResult visitFile(final Path path, final BasicFileAttributes attrs) throws IOException {
+ collected.add(new PathWithAttributes(path, attrs));
+ return FileVisitResult.CONTINUE;
+ }
+
+ public List<PathWithAttributes> getSortedPaths() {
+ Collections.sort(collected, sorter);
+ return collected;
+ }
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/ZipCompressAction.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/ZipCompressAction.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/ZipCompressAction.java
index 3a0019f..a7705da 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/ZipCompressAction.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/ZipCompressAction.java
@@ -132,7 +132,7 @@ public final class ZipCompressAction extends AbstractAction {
@Override
public String toString() {
- return ZipCompressAction.class.getSimpleName() + '[' + source + " to " + destination
+ return ZipCompressAction.class.getSimpleName() + '[' + source + " to " + destination
+ ", level=" + level + ", deleteSource=" + deleteSource + ']';
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/IdlePurgePolicy.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/IdlePurgePolicy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/IdlePurgePolicy.java
index 1babc38..e892f66 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/IdlePurgePolicy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/IdlePurgePolicy.java
@@ -41,7 +41,7 @@ import org.apache.logging.log4j.core.config.plugins.PluginFactory;
public class IdlePurgePolicy extends AbstractLifeCycle implements PurgePolicy, Runnable {
private final long timeToLive;
- private final long checkInterval;
+ private final long checkInterval;
private final ConcurrentMap<String, Long> appendersUsage = new ConcurrentHashMap<>();
private RoutingAppender routingAppender;
private final ConfigurationScheduler scheduler;
@@ -123,7 +123,7 @@ public class IdlePurgePolicy extends AbstractLifeCycle implements PurgePolicy, R
* Create the PurgePolicy
*
* @param timeToLive the number of increments of timeUnit before the Appender should be purged.
- * @param checkInterval when all appenders purged, the number of increments of timeUnit to check if any appenders appeared
+ * @param checkInterval when all appenders purged, the number of increments of timeUnit to check if any appenders appeared
* @param timeUnit the unit of time the timeToLive and the checkInterval is expressed in.
* @return The Routes container.
*/
@@ -155,7 +155,7 @@ public class IdlePurgePolicy extends AbstractLifeCycle implements PurgePolicy, R
LOGGER.error("timeToLive must be positive. timeToLive set to 0");
ttl = 0;
}
-
+
long ci;
if (checkInterval == null) {
ci = ttl;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/PurgePolicy.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/PurgePolicy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/PurgePolicy.java
index f780b15..b0c8c61 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/PurgePolicy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/PurgePolicy.java
@@ -27,9 +27,9 @@ public interface PurgePolicy {
* Activates purging appenders
*/
void purge();
-
+
/**
- *
+ *
* @param routed appender key
* @param event
*/
@@ -37,7 +37,7 @@ public interface PurgePolicy {
/**
* Initializes with routing appender
- *
+ *
* @param routingAppender
*/
void initialize(RoutingAppender routingAppender);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/Routes.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/Routes.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/Routes.java
index f02b7cf..e179ad7 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/Routes.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/Routes.java
@@ -47,12 +47,12 @@ public final class Routes {
public static class Builder implements org.apache.logging.log4j.core.util.Builder<Routes> {
- @PluginConfiguration
+ @PluginConfiguration
private Configuration configuration;
- @PluginAttribute("pattern")
+ @PluginAttribute("pattern")
private String pattern;
-
+
@PluginElement("Script")
private AbstractScript patternScript;
@@ -114,7 +114,7 @@ public final class Routes {
this.routes = routes;
return this;
}
-
+
}
private static final Logger LOGGER = StatusLogger.getLogger();
@@ -141,16 +141,16 @@ public final class Routes {
public static Builder newBuilder() {
return new Builder();
}
-
+
private final Configuration configuration;
-
+
private final String pattern;
private final AbstractScript patternScript;
-
+
// TODO Why not make this a Map or add a Map.
private final Route[] routes;
-
+
private Routes(final Configuration configuration, final AbstractScript patternScript, final String pattern, final Route... routes) {
this.configuration = configuration;
this.patternScript = patternScript;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java
index 61ca41f..06d219a 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java
@@ -86,7 +86,6 @@ public class AsyncLoggerConfig extends LoggerConfig {
delegate.setLogEventFactory(getLogEventFactory());
}
- @Override
protected void log(final LogEvent event, final LoggerConfigPredicate predicate) {
// See LOG4J2-2301
if (predicate == LoggerConfigPredicate.ALL &&
@@ -121,7 +120,7 @@ public class AsyncLoggerConfig extends LoggerConfig {
super.callAppenders(event);
}
- private void logToAsyncDelegate(final LogEvent event) {
+ private void logToAsyncDelegate(LogEvent event) {
if (!isFiltered(event)) {
// Passes on the event to a separate thread that will call
// asyncCallAppenders(LogEvent).
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerContext.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerContext.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerContext.java
index fa93851..68326f7 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerContext.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerContext.java
@@ -58,7 +58,7 @@ public class AsyncLoggerContext extends LoggerContext {
protected Logger newInstance(final LoggerContext ctx, final String name, final MessageFactory messageFactory) {
return new AsyncLogger(ctx, name, messageFactory, loggerDisruptor);
}
-
+
@Override
public void setName(final String name) {
super.setName("AsyncContext[" + name + "]");
@@ -67,7 +67,7 @@ public class AsyncLoggerContext extends LoggerContext {
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.LoggerContext#start()
*/
@Override
@@ -78,7 +78,7 @@ public class AsyncLoggerContext extends LoggerContext {
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.LoggerContext#start(org.apache.logging.log4j.core.config.Configuration)
*/
@Override
@@ -102,7 +102,7 @@ public class AsyncLoggerContext extends LoggerContext {
public boolean stop(final long timeout, final TimeUnit timeUnit) {
setStopping();
// first stop Disruptor
- loggerDisruptor.stop(timeout, timeUnit);
+ loggerDisruptor.stop(timeout, timeUnit);
super.stop(timeout, timeUnit);
return true;
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerContextSelector.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerContextSelector.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerContextSelector.java
index b8fe437..358b265 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerContextSelector.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerContextSelector.java
@@ -33,7 +33,7 @@ public class AsyncLoggerContextSelector extends ClassLoaderContextSelector {
/**
* Returns {@code true} if the user specified this selector as the Log4jContextSelector, to make all loggers
* asynchronous.
- *
+ *
* @return {@code true} if all loggers are asynchronous, {@code false} otherwise.
*/
public static boolean isSelected() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEvent.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEvent.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEvent.java
index c259fc2..8af33e7 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEvent.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEvent.java
@@ -69,7 +69,7 @@ public class RingBufferLogEvent implements LogEvent, ReusableMessage, CharSequen
private int threadPriority;
private long threadId;
- private final MutableInstant instant = new MutableInstant();
+ private MutableInstant instant = new MutableInstant();
private long nanoTime;
private short parameterCount;
private boolean includeLocation;
@@ -281,7 +281,7 @@ public class RingBufferLogEvent implements LogEvent, ReusableMessage, CharSequen
}
@Override
- public <S> void forEachParameter(final ParameterConsumer<S> action, final S state) {
+ public <S> void forEachParameter(ParameterConsumer<S> action, S state) {
if (parameters != null) {
for (short i = 0; i < parameterCount; i++) {
action.accept(parameters[i], i, state);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java
index 8194ffc..1e4a820 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java
@@ -40,7 +40,7 @@ public class AppenderControl extends AbstractFilterable {
/**
* Constructor.
- *
+ *
* @param appender The target Appender.
* @param level the Level to filter on.
* @param filter the Filter(s) to apply.
@@ -56,7 +56,7 @@ public class AppenderControl extends AbstractFilterable {
/**
* Returns the name the appender had when this AppenderControl was constructed.
- *
+ *
* @return the appender name
*/
public String getAppenderName() {
@@ -65,7 +65,7 @@ public class AppenderControl extends AbstractFilterable {
/**
* Returns the Appender.
- *
+ *
* @return the Appender.
*/
public Appender getAppender() {
@@ -74,7 +74,7 @@ public class AppenderControl extends AbstractFilterable {
/**
* Call the appender.
- *
+ *
* @param event The event to process.
*/
public void callAppender(final LogEvent event) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AwaitUnconditionallyReliabilityStrategy.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AwaitUnconditionallyReliabilityStrategy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AwaitUnconditionallyReliabilityStrategy.java
index bd582b5..357f18b 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AwaitUnconditionallyReliabilityStrategy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AwaitUnconditionallyReliabilityStrategy.java
@@ -47,7 +47,7 @@ public class AwaitUnconditionallyReliabilityStrategy implements ReliabilityStrat
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.config.ReliabilityStrategy#log(org.apache.logging.log4j.util.Supplier,
* java.lang.String, java.lang.String, org.apache.logging.log4j.Marker, org.apache.logging.log4j.Level,
* org.apache.logging.log4j.message.Message, java.lang.Throwable)
@@ -60,7 +60,7 @@ public class AwaitUnconditionallyReliabilityStrategy implements ReliabilityStrat
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.config.ReliabilityStrategy#log(org.apache.logging.log4j.util.Supplier,
* org.apache.logging.log4j.core.LogEvent)
*/
@@ -71,7 +71,7 @@ public class AwaitUnconditionallyReliabilityStrategy implements ReliabilityStrat
/*
* (non-Javadoc)
- *
+ *
* @see
* org.apache.logging.log4j.core.config.ReliabilityStrategy#beforeLogEvent(org.apache.logging.log4j.core.config.
* LoggerConfig, org.apache.logging.log4j.util.Supplier)
@@ -83,7 +83,7 @@ public class AwaitUnconditionallyReliabilityStrategy implements ReliabilityStrat
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.config.ReliabilityStrategy#afterLogEvent()
*/
@Override
@@ -93,7 +93,7 @@ public class AwaitUnconditionallyReliabilityStrategy implements ReliabilityStrat
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.config.ReliabilityStrategy#beforeStopAppenders()
*/
@Override
@@ -103,7 +103,7 @@ public class AwaitUnconditionallyReliabilityStrategy implements ReliabilityStrat
/*
* (non-Javadoc)
- *
+ *
* @see
* org.apache.logging.log4j.core.config.ReliabilityStrategy#beforeStopConfiguration(org.apache.logging.log4j.core
* .config.Configuration)
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationScheduler.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationScheduler.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationScheduler.java
index dd7525c..5341337 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationScheduler.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationScheduler.java
@@ -38,7 +38,7 @@ public class ConfigurationScheduler extends AbstractLifeCycle {
private static final Logger LOGGER = StatusLogger.getLogger();
private static final String SIMPLE_NAME = "Log4j2 " + ConfigurationScheduler.class.getSimpleName();
private static final int MAX_SCHEDULED_ITEMS = 5;
-
+
private ScheduledExecutorService executorService;
private int scheduledItems = 0;
private final String name;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java
index 21558fc..3c87695 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java
@@ -275,7 +275,7 @@ public class ConfigurationSource {
if (is == null) {
return null;
}
-
+
if (FileUtils.isFile(url)) {
try {
return new ConfigurationSource(is, FileUtils.fileFromUri(url.toURI()));
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
index 0747399..28dd85f 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
@@ -335,7 +335,7 @@ public final class Configurator {
* rollover thread is done. When this method returns, these tasks' status are undefined, the tasks may be done or
* not.
* </p>
- *
+ *
* @param ctx
* the logger context to shut down, may be null.
*/
[12/13] logging-log4j2 git commit: Revert "Use final. Remove trailing
spaces."
Posted by gg...@apache.org.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java b/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
index 0c77b86..5b6ac1a 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
@@ -2141,7 +2141,7 @@ public abstract class AbstractLogger implements ExtendedLogger, Serializable {
getRecursionDepthHolder()[0]++;
}
private static void decrementRecursionDepth() {
- final int[] depth = getRecursionDepthHolder();
+ int[] depth = getRecursionDepthHolder();
depth[0]--;
if (depth[0] < 0) {
throw new IllegalStateException("Recursion depth became negative: " + depth[0]);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerAdapter.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerAdapter.java b/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerAdapter.java
index eb6b44f..e86f990 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerAdapter.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerAdapter.java
@@ -28,7 +28,7 @@ import org.apache.logging.log4j.util.LoaderUtil;
/**
* Provides an abstract base class to use for implementing LoggerAdapter.
- *
+ *
* @param <L> the Logger class to adapt
* @since 2.1
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/spi/CopyOnWriteSortedArrayThreadContextMap.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/spi/CopyOnWriteSortedArrayThreadContextMap.java b/log4j-api/src/main/java/org/apache/logging/log4j/spi/CopyOnWriteSortedArrayThreadContextMap.java
index 727a016..862246e 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/spi/CopyOnWriteSortedArrayThreadContextMap.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/spi/CopyOnWriteSortedArrayThreadContextMap.java
@@ -53,7 +53,7 @@ class CopyOnWriteSortedArrayThreadContextMap implements ReadOnlyThreadContextMap
protected static final String PROPERTY_NAME_INITIAL_CAPACITY = "log4j2.ThreadContext.initial.capacity";
private static final StringMap EMPTY_CONTEXT_DATA = new SortedArrayStringMap(1);
-
+
private static volatile int initialCapacity;
private static volatile boolean inheritableMap;
@@ -66,7 +66,7 @@ class CopyOnWriteSortedArrayThreadContextMap implements ReadOnlyThreadContextMap
initialCapacity = properties.getIntegerProperty(PROPERTY_NAME_INITIAL_CAPACITY, DEFAULT_INITIAL_CAPACITY);
inheritableMap = properties.getBooleanProperty(INHERITABLE_MAP);
}
-
+
static {
EMPTY_CONTEXT_DATA.freeze();
init();
@@ -88,7 +88,7 @@ class CopyOnWriteSortedArrayThreadContextMap implements ReadOnlyThreadContextMap
if (parentValue == null) {
return null;
}
- final StringMap stringMap = createStringMap(parentValue);
+ StringMap stringMap = createStringMap(parentValue);
stringMap.freeze();
return stringMap;
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/spi/DefaultThreadContextMap.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/spi/DefaultThreadContextMap.java b/log4j-api/src/main/java/org/apache/logging/log4j/spi/DefaultThreadContextMap.java
index a00043b..1e69a83 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/spi/DefaultThreadContextMap.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/spi/DefaultThreadContextMap.java
@@ -44,7 +44,7 @@ public class DefaultThreadContextMap implements ThreadContextMap, ReadOnlyString
private final ThreadLocal<Map<String, String>> localMap;
private static boolean inheritableMap;
-
+
static {
init();
}
@@ -69,7 +69,7 @@ public class DefaultThreadContextMap implements ThreadContextMap, ReadOnlyString
static void init() {
inheritableMap = PropertiesUtil.getProperties().getBooleanProperty(INHERITABLE_MAP);
}
-
+
public DefaultThreadContextMap() {
this(true);
}
@@ -154,7 +154,6 @@ public class DefaultThreadContextMap implements ThreadContextMap, ReadOnlyString
for (final Map.Entry<String, String> entry : map.entrySet()) {
//BiConsumer should be able to handle values of any type V. In our case the values are of type String.
@SuppressWarnings("unchecked")
- final
V value = (V) entry.getValue();
action.accept(entry.getKey(), value);
}
@@ -169,7 +168,6 @@ public class DefaultThreadContextMap implements ThreadContextMap, ReadOnlyString
for (final Map.Entry<String, String> entry : map.entrySet()) {
//TriConsumer should be able to handle values of any type V. In our case the values are of type String.
@SuppressWarnings("unchecked")
- final
V value = (V) entry.getValue();
action.accept(entry.getKey(), value, state);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/spi/GarbageFreeSortedArrayThreadContextMap.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/spi/GarbageFreeSortedArrayThreadContextMap.java b/log4j-api/src/main/java/org/apache/logging/log4j/spi/GarbageFreeSortedArrayThreadContextMap.java
index e65b1d0..186e2a8 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/spi/GarbageFreeSortedArrayThreadContextMap.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/spi/GarbageFreeSortedArrayThreadContextMap.java
@@ -53,7 +53,7 @@ class GarbageFreeSortedArrayThreadContextMap implements ReadOnlyThreadContextMap
protected static final String PROPERTY_NAME_INITIAL_CAPACITY = "log4j2.ThreadContext.initial.capacity";
protected final ThreadLocal<StringMap> localMap;
-
+
private static volatile int initialCapacity;
private static volatile boolean inheritableMap;
@@ -66,7 +66,7 @@ class GarbageFreeSortedArrayThreadContextMap implements ReadOnlyThreadContextMap
initialCapacity = properties.getIntegerProperty(PROPERTY_NAME_INITIAL_CAPACITY, DEFAULT_INITIAL_CAPACITY);
inheritableMap = properties.getBooleanProperty(INHERITABLE_MAP);
}
-
+
static {
init();
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/spi/Provider.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/spi/Provider.java b/log4j-api/src/main/java/org/apache/logging/log4j/spi/Provider.java
index 833b2d1..5808cf8 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/spi/Provider.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/spi/Provider.java
@@ -189,7 +189,7 @@ public class Provider {
public URL getUrl() {
return url;
}
-
+
@Override
public String toString() {
final StringBuilder result = new StringBuilder("Provider[");
@@ -220,7 +220,7 @@ public class Provider {
}
@Override
- public boolean equals(final Object o) {
+ public boolean equals(Object o) {
if (this == o) {
return true;
}
@@ -228,7 +228,7 @@ public class Provider {
return false;
}
- final Provider provider = (Provider) o;
+ Provider provider = (Provider) o;
if (priority != null ? !priority.equals(provider.priority) : provider.priority != null) {
return false;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/spi/StandardLevel.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/spi/StandardLevel.java b/log4j-api/src/main/java/org/apache/logging/log4j/spi/StandardLevel.java
index cb40ba3..8a10e2d 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/spi/StandardLevel.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/spi/StandardLevel.java
@@ -73,7 +73,7 @@ public enum StandardLevel {
/**
* Returns the integer value of the Level.
- *
+ *
* @return the integer value of the Level.
*/
public int intLevel() {
@@ -82,7 +82,7 @@ public enum StandardLevel {
/**
* Method to convert custom Levels into a StandardLevel for conversion to other systems.
- *
+ *
* @param intLevel The integer value of the Level.
* @return The StandardLevel.
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/spi/ThreadContextMapFactory.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/spi/ThreadContextMapFactory.java b/log4j-api/src/main/java/org/apache/logging/log4j/spi/ThreadContextMapFactory.java
index bf52b30..c67fbcd 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/spi/ThreadContextMapFactory.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/spi/ThreadContextMapFactory.java
@@ -49,14 +49,14 @@ public final class ThreadContextMapFactory {
private static final Logger LOGGER = StatusLogger.getLogger();
private static final String THREAD_CONTEXT_KEY = "log4j2.threadContextMap";
private static final String GC_FREE_THREAD_CONTEXT_KEY = "log4j2.garbagefree.threadContextMap";
-
+
private static boolean GcFreeThreadContextKey;
private static String ThreadContextMapName;
static {
initPrivate();
}
-
+
/**
* Initializes static variables based on system properties. Normally called when this class is initialized by the VM
* and when Log4j is reconfigured.
@@ -77,7 +77,7 @@ public final class ThreadContextMapFactory {
ThreadContextMapName = properties.getStringProperty(THREAD_CONTEXT_KEY);
GcFreeThreadContextKey = properties.getBooleanProperty(GC_FREE_THREAD_CONTEXT_KEY);
}
-
+
private ThreadContextMapFactory() {
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusData.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusData.java b/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusData.java
index 13f4859..463d9d0 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusData.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusData.java
@@ -43,7 +43,7 @@ public class StatusData implements Serializable {
/**
* Creates the StatusData object.
- *
+ *
* @param caller The method that created the event.
* @param level The logging level.
* @param msg The message String.
@@ -62,7 +62,7 @@ public class StatusData implements Serializable {
/**
* Returns the event's timestamp.
- *
+ *
* @return The event's timestamp.
*/
public long getTimestamp() {
@@ -71,7 +71,7 @@ public class StatusData implements Serializable {
/**
* Returns the StackTraceElement for the method that created the event.
- *
+ *
* @return The StackTraceElement.
*/
public StackTraceElement getStackTraceElement() {
@@ -80,7 +80,7 @@ public class StatusData implements Serializable {
/**
* Returns the logging level for the event.
- *
+ *
* @return The logging level.
*/
public Level getLevel() {
@@ -89,7 +89,7 @@ public class StatusData implements Serializable {
/**
* Returns the message associated with the event.
- *
+ *
* @return The message associated with the event.
*/
public Message getMessage() {
@@ -105,7 +105,7 @@ public class StatusData implements Serializable {
/**
* Returns the Throwable associated with the event.
- *
+ *
* @return The Throwable associated with the event.
*/
public Throwable getThrowable() {
@@ -114,7 +114,7 @@ public class StatusData implements Serializable {
/**
* Formats the StatusData for viewing.
- *
+ *
* @return The formatted status data as a String.
*/
public String getFormattedStatus() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/util/EnglishEnums.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/EnglishEnums.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/EnglishEnums.java
index a5b4df7..be6b346 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/EnglishEnums.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/EnglishEnums.java
@@ -20,7 +20,7 @@ import java.util.Locale;
/**
* <em>Consider this class private.</em>
- *
+ *
* <p>
* Helps convert English Strings to English Enum values.
* </p>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/util/FilteredObjectInputStream.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/FilteredObjectInputStream.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/FilteredObjectInputStream.java
index 48080a7..df97fd2 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/FilteredObjectInputStream.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/FilteredObjectInputStream.java
@@ -56,7 +56,7 @@ public class FilteredObjectInputStream extends ObjectInputStream {
this.allowedClasses = new HashSet<>();
}
- public FilteredObjectInputStream(final InputStream in) throws IOException {
+ public FilteredObjectInputStream(InputStream in) throws IOException {
super(in);
this.allowedClasses = new HashSet<>();
}
@@ -77,7 +77,7 @@ public class FilteredObjectInputStream extends ObjectInputStream {
@Override
protected Class<?> resolveClass(final ObjectStreamClass desc) throws IOException, ClassNotFoundException {
- final String name = desc.getName();
+ String name = desc.getName();
if (!(isAllowedByDefault(name) || allowedClasses.contains(name))) {
throw new InvalidObjectException("Class is not allowed for deserialization: " + name);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java
index ab61dbc..bbf3cc7 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java
@@ -106,14 +106,14 @@ public final class LoaderUtil {
}
public static ClassLoader[] getClassLoaders() {
- final List<ClassLoader> classLoaders = new ArrayList<>();
- final ClassLoader tcl = getThreadContextClassLoader();
+ List<ClassLoader> classLoaders = new ArrayList<>();
+ ClassLoader tcl = getThreadContextClassLoader();
classLoaders.add(tcl);
// Some implementations may use null to represent the bootstrap class loader.
- final ClassLoader current = LoaderUtil.class.getClassLoader();
+ ClassLoader current = LoaderUtil.class.getClassLoader();
if (current != null && current != tcl) {
classLoaders.add(current);
- final ClassLoader parent = current.getParent();
+ ClassLoader parent = current.getParent();
while (parent != null && !classLoaders.contains(parent)) {
classLoaders.add(parent);
}
@@ -123,7 +123,7 @@ public final class LoaderUtil {
classLoaders.add(parent);
parent = parent.getParent();
}
- final ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
+ ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
if (!classLoaders.contains(systemClassLoader)) {
classLoaders.add(systemClassLoader);
}
@@ -281,7 +281,7 @@ public final class LoaderUtil {
static Collection<UrlResource> findUrlResources(final String resource) {
// @formatter:off
final ClassLoader[] candidates = {
- getThreadContextClassLoader(),
+ getThreadContextClassLoader(),
LoaderUtil.class.getClassLoader(),
GET_CLASS_LOADER_DISABLED ? null : ClassLoader.getSystemClassLoader()};
// @formatter:on
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/util/LowLevelLogUtil.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/LowLevelLogUtil.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/LowLevelLogUtil.java
index d963013..5cf40ca 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/LowLevelLogUtil.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/LowLevelLogUtil.java
@@ -35,7 +35,7 @@ final class LowLevelLogUtil {
/**
* Logs the given message.
- *
+ *
* @param message the message to log
* @since 2.9.2
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/util/ProcessIdUtil.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/ProcessIdUtil.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/ProcessIdUtil.java
index 18d1834..685aabe 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/ProcessIdUtil.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/ProcessIdUtil.java
@@ -30,13 +30,13 @@ public class ProcessIdUtil {
public static String getProcessId() {
try {
// LOG4J2-2126 use reflection to improve compatibility with Android Platform which does not support JMX extensions
- final Class<?> managementFactoryClass = Class.forName("java.lang.management.ManagementFactory");
- final Method getRuntimeMXBean = managementFactoryClass.getDeclaredMethod("getRuntimeMXBean");
- final Class<?> runtimeMXBeanClass = Class.forName("java.lang.management.RuntimeMXBean");
- final Method getName = runtimeMXBeanClass.getDeclaredMethod("getName");
+ Class<?> managementFactoryClass = Class.forName("java.lang.management.ManagementFactory");
+ Method getRuntimeMXBean = managementFactoryClass.getDeclaredMethod("getRuntimeMXBean");
+ Class<?> runtimeMXBeanClass = Class.forName("java.lang.management.RuntimeMXBean");
+ Method getName = runtimeMXBeanClass.getDeclaredMethod("getName");
- final Object runtimeMXBean = getRuntimeMXBean.invoke(null);
- final String name = (String) getName.invoke(runtimeMXBean);
+ Object runtimeMXBean = getRuntimeMXBean.invoke(null);
+ String name = (String) getName.invoke(runtimeMXBean);
//String name = ManagementFactory.getRuntimeMXBean().getName(); //JMX not allowed on Android
return name.split("@")[0]; // likely works on most platforms
} catch (final Exception ex) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
index 334fd7b..2a9ff7f 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
@@ -178,9 +178,9 @@ public final class PropertiesUtil {
if (Charset.isSupported(charsetName)) {
return Charset.forName(charsetName);
}
- final ResourceBundle bundle = getCharsetsResourceBundle();
+ ResourceBundle bundle = getCharsetsResourceBundle();
if (bundle.containsKey(name)) {
- final String mapped = bundle.getString(name);
+ String mapped = bundle.getString(name);
if (Charset.isSupported(mapped)) {
return Charset.forName(mapped);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertyFilePropertySource.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertyFilePropertySource.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertyFilePropertySource.java
index c4cf359..3adbb24 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertyFilePropertySource.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertyFilePropertySource.java
@@ -37,7 +37,7 @@ public class PropertyFilePropertySource extends PropertiesPropertySource {
for (final URL url : LoaderUtil.findResources(fileName)) {
try (final InputStream in = url.openStream()) {
props.load(in);
- } catch (final IOException e) {
+ } catch (IOException e) {
LowLevelLogUtil.logException("Unable to read " + url, e);
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertySource.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertySource.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertySource.java
index aba2ccf..75399d9 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertySource.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertySource.java
@@ -93,7 +93,7 @@ public interface PropertySource {
if (CACHE.containsKey(value)) {
return CACHE.get(value);
}
- final List<CharSequence> tokens = new ArrayList<>();
+ List<CharSequence> tokens = new ArrayList<>();
final Matcher matcher = PROPERTY_TOKENIZER.matcher(value);
while (matcher.find()) {
tokens.add(matcher.group(1).toLowerCase());
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java
index c4f6ca1..d19cdd9 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java
@@ -63,10 +63,10 @@ public final class ProviderUtil {
private static volatile ProviderUtil instance;
private ProviderUtil() {
- for (final ClassLoader classLoader : LoaderUtil.getClassLoaders()) {
+ for (ClassLoader classLoader : LoaderUtil.getClassLoaders()) {
try {
loadProviders(classLoader);
- } catch (final Throwable ex) {
+ } catch (Throwable ex) {
LOGGER.debug("Unable to retrieve provider from ClassLoader {}", classLoader, ex);
}
}
@@ -101,7 +101,7 @@ public final class ProviderUtil {
}
/**
- *
+ *
* @param classLoader null can be used to mark the bootstrap class loader.
*/
protected static void loadProviders(final ClassLoader classLoader) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/util/ReadOnlyStringMap.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/ReadOnlyStringMap.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/ReadOnlyStringMap.java
index 8a330f9..df9a1c8 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/ReadOnlyStringMap.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/ReadOnlyStringMap.java
@@ -25,7 +25,7 @@ import java.util.Map;
* @since 2.7
*/
public interface ReadOnlyStringMap extends Serializable {
-
+
/**
* Returns a non-{@code null} mutable {@code Map<String, String>} containing a snapshot of this data structure.
*
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/util/SortedArrayStringMap.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/SortedArrayStringMap.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/SortedArrayStringMap.java
index ffd9745..6d3eadb 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/SortedArrayStringMap.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/SortedArrayStringMap.java
@@ -96,7 +96,7 @@ public class SortedArrayStringMap implements IndexedStringMap {
Method[] methods = ObjectInputStream.class.getMethods();
Method setMethod = null;
Method getMethod = null;
- for (final Method method : methods) {
+ for (Method method : methods) {
if (method.getName().equals("setObjectInputFilter")) {
setMethod = method;
} else if (method.getName().equals("getObjectInputFilter")) {
@@ -106,16 +106,16 @@ public class SortedArrayStringMap implements IndexedStringMap {
Method newMethod = null;
try {
if (setMethod != null) {
- final Class<?> clazz = Class.forName("org.apache.logging.log4j.util.internal.DefaultObjectInputFilter");
+ Class<?> clazz = Class.forName("org.apache.logging.log4j.util.internal.DefaultObjectInputFilter");
methods = clazz.getMethods();
- for (final Method method : methods) {
+ for (Method method : methods) {
if (method.getName().equals("newInstance") && Modifier.isStatic(method.getModifiers())) {
newMethod = method;
break;
}
}
}
- } catch (final ClassNotFoundException ex) {
+ } catch (ClassNotFoundException ex) {
// Ignore the exception
}
newObjectInputFilter = newMethod;
@@ -549,7 +549,7 @@ public class SortedArrayStringMap implements IndexedStringMap {
}
}
- private static Object unmarshall(final byte[] data, final ObjectInputStream inputStream)
+ private static Object unmarshall(final byte[] data, ObjectInputStream inputStream)
throws IOException, ClassNotFoundException {
final ByteArrayInputStream bin = new ByteArrayInputStream(data);
Collection<String> allowedClasses = null;
@@ -559,8 +559,8 @@ public class SortedArrayStringMap implements IndexedStringMap {
ois = new FilteredObjectInputStream(bin, allowedClasses);
} else {
try {
- final Object obj = getObjectInputFilter.invoke(inputStream);
- final Object filter = newObjectInputFilter.invoke(null, obj);
+ Object obj = getObjectInputFilter.invoke(inputStream);
+ Object filter = newObjectInputFilter.invoke(null, obj);
ois = new ObjectInputStream(bin);
setObjectInputFilter.invoke(ois, filter);
} catch (IllegalAccessException | InvocationTargetException ex) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java
index a45fa5a..48fa98f 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java
@@ -189,7 +189,7 @@ public final class StringBuilders {
}
}
- final int lastChar = toAppendTo.length() - 1;
+ int lastChar = toAppendTo.length() - 1;
toAppendTo.setLength(toAppendTo.length() + escapeCount);
int lastPos = toAppendTo.length() - 1;
@@ -238,7 +238,7 @@ public final class StringBuilders {
}
}
- private static int escapeAndDecrement(final StringBuilder toAppendTo, int lastPos, final char c) {
+ private static int escapeAndDecrement(StringBuilder toAppendTo, int lastPos, char c) {
toAppendTo.setCharAt(lastPos--, c);
toAppendTo.setCharAt(lastPos--, '\\');
return lastPos;
@@ -262,7 +262,7 @@ public final class StringBuilders {
}
}
- final int lastChar = toAppendTo.length() - 1;
+ int lastChar = toAppendTo.length() - 1;
toAppendTo.setLength(toAppendTo.length() + escapeCount);
int lastPos = toAppendTo.length() - 1;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/util/Strings.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/Strings.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/Strings.java
index d0eea99..c369a4e 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/Strings.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/Strings.java
@@ -22,7 +22,7 @@ import java.util.Objects;
/**
* <em>Consider this class private.</em>
- *
+ *
* @see <a href="http://commons.apache.org/proper/commons-lang/">Apache Commons Lang</a>
*/
public final class Strings {
@@ -31,7 +31,7 @@ public final class Strings {
* The empty string.
*/
public static final String EMPTY = "";
-
+
/**
* OS-dependent line separator, defaults to {@code "\n"} if the system property {@code ""line.separator"} cannot be
* read.
@@ -45,7 +45,7 @@ public final class Strings {
/**
* Returns a double quoted string.
- *
+ *
* @param str a String
* @return {@code "str"}
*/
@@ -129,7 +129,7 @@ public final class Strings {
/**
* Returns a quoted string.
- *
+ *
* @param str a String
* @return {@code 'str'}
*/
@@ -146,7 +146,7 @@ public final class Strings {
public String toRootUpperCase(final String str) {
return str.toUpperCase(Locale.ROOT);
}
-
+
/**
* <p>
* Removes control characters (char <= 32) from both ends of this String returning {@code null} if the String is
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java
index 5be886b..a152aad 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java
@@ -922,8 +922,8 @@ public class AbstractLoggerTest {
throw new IllegalStateException("Oops!");
}
}, "Message Format"));
- final List<StatusData> statusDatalist = StatusLogger.getLogger().getStatusData();
- final StatusData mostRecent = statusDatalist.get(statusDatalist.size() - 1);
+ List<StatusData> statusDatalist = StatusLogger.getLogger().getStatusData();
+ StatusData mostRecent = statusDatalist.get(statusDatalist.size() - 1);
assertEquals(Level.WARN, mostRecent.getLevel());
assertThat(mostRecent.getFormattedStatus(), containsString(
"org.apache.logging.log4j.spi.AbstractLogger caught " +
@@ -939,8 +939,8 @@ public class AbstractLoggerTest {
throw new IllegalStateException("Oops!");
}
}, null /* format */));
- final List<StatusData> statusDatalist = StatusLogger.getLogger().getStatusData();
- final StatusData mostRecent = statusDatalist.get(statusDatalist.size() - 1);
+ List<StatusData> statusDatalist = StatusLogger.getLogger().getStatusData();
+ StatusData mostRecent = statusDatalist.get(statusDatalist.size() - 1);
assertEquals(Level.WARN, mostRecent.getLevel());
assertThat(mostRecent.getFormattedStatus(), containsString(
"org.apache.logging.log4j.spi.AbstractLogger caught " +
@@ -950,7 +950,7 @@ public class AbstractLoggerTest {
private static final class TestMessage implements Message {
private final FormattedMessageSupplier formattedMessageSupplier;
private final String format;
- TestMessage(final FormattedMessageSupplier formattedMessageSupplier, final String format) {
+ TestMessage(FormattedMessageSupplier formattedMessageSupplier, String format) {
this.formattedMessageSupplier = formattedMessageSupplier;
this.format = format;
}
@@ -1320,7 +1320,7 @@ public class AbstractLoggerTest {
private static class ThrowableMessage implements Message {
/**
- *
+ *
*/
private static final long serialVersionUID = 1L;
private final Throwable throwable;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/LogManagerTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/LogManagerTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/LogManagerTest.java
index 68d6e4d..a3164d1 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/LogManagerTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/LogManagerTest.java
@@ -35,19 +35,19 @@ public class LogManagerTest {
class Inner {
final Logger LOGGER = LogManager.getLogger();
}
-
+
class InnerByClass {
final Logger LOGGER = LogManager.getLogger(InnerByClass.class);
}
-
+
static class StaticInner {
final static Logger LOGGER = LogManager.getLogger();
}
-
+
static class StaticInnerByClass {
final static Logger LOGGER = LogManager.getLogger(StaticInnerByClass.class);
}
-
+
@Test
public void testGetLogger() {
Logger logger = LogManager.getLogger();
@@ -79,9 +79,9 @@ public class LogManagerTest {
@Test
public void testGetLoggerForAnonymousInnerClass1() throws IOException {
final Closeable closeable = new Closeable() {
-
+
Logger LOGGER = LogManager.getLogger();
-
+
@Override
public void close() throws IOException {
Assert.assertEquals("org.apache.logging.log4j.LogManagerTest$1", LOGGER.getName());
@@ -93,9 +93,9 @@ public class LogManagerTest {
@Test
public void testGetLoggerForAnonymousInnerClass2() throws IOException {
final Closeable closeable = new Closeable() {
-
+
Logger LOGGER = LogManager.getLogger(getClass());
-
+
@Override
public void close() throws IOException {
Assert.assertEquals("org.apache.logging.log4j.LogManagerTest$2", LOGGER.getName());
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/LoggerSupplierTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/LoggerSupplierTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/LoggerSupplierTest.java
index bf28a1e..7b78fe1 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/LoggerSupplierTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/LoggerSupplierTest.java
@@ -1,235 +1,235 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j;
-
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.startsWith;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
-
-import java.util.List;
-import java.util.Locale;
-
-import org.apache.logging.log4j.message.FormattedMessage;
-import org.apache.logging.log4j.message.JsonMessage;
-import org.apache.logging.log4j.message.LocalizedMessage;
-import org.apache.logging.log4j.message.MessageFormatMessage;
-import org.apache.logging.log4j.message.ObjectArrayMessage;
-import org.apache.logging.log4j.message.ObjectMessage;
-import org.apache.logging.log4j.message.ParameterizedMessage;
-import org.apache.logging.log4j.message.SimpleMessage;
-import org.apache.logging.log4j.message.StringFormattedMessage;
-import org.apache.logging.log4j.message.ThreadDumpMessage;
-import org.apache.logging.log4j.util.Supplier;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Tests Logger APIs with {@link Supplier}.
- */
-public class LoggerSupplierTest {
-
- private final TestLogger logger = (TestLogger) LogManager.getLogger("LoggerTest");
-
- private final List<String> results = logger.getEntries();
-
- Locale defaultLocale;
-
- @Test
- public void flowTracing_SupplierOfFormattedMessage() {
- logger.traceEntry(new Supplier<FormattedMessage>() {
- @Override
- public FormattedMessage get() {
- return new FormattedMessage("int foo={}", 1234567890);
- }
- });
- assertEquals(1, results.size());
- assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
- assertThat("Missing entry data", results.get(0), containsString("(int foo=1234567890)"));
- assertThat("Bad toString()", results.get(0), not(containsString("FormattedMessage")));
- }
-
- @Test
- public void flowTracing_SupplierOfJsonMessage() {
- logger.traceEntry(new Supplier<JsonMessage>() {
- @Override
- public JsonMessage get() {
- return new JsonMessage(System.getProperties());
- }
- });
- assertEquals(1, results.size());
- assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
- assertThat("Missing entry data", results.get(0), containsString("\"java.runtime.name\":"));
- assertThat("Bad toString()", results.get(0), not(containsString("JsonMessage")));
- }
-
- @Test
- public void flowTracing_SupplierOfLocalizedMessage() {
- logger.traceEntry(new Supplier<LocalizedMessage>() {
- @Override
- public LocalizedMessage get() {
- return new LocalizedMessage("int foo={}", 1234567890);
- }
- });
- assertEquals(1, results.size());
- assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
- assertThat("Missing entry data", results.get(0), containsString("(int foo=1234567890)"));
- assertThat("Bad toString()", results.get(0), not(containsString("LocalizedMessage")));
- }
-
- @Test
- public void flowTracing_SupplierOfLong() {
- logger.traceEntry(new Supplier<Long>() {
- @Override
- public Long get() {
- return Long.valueOf(1234567890);
- }
- });
- assertEquals(1, results.size());
- assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
- assertThat("Missing entry data", results.get(0), containsString("(1234567890)"));
- assertThat("Bad toString()", results.get(0), not(containsString("SimpleMessage")));
- }
-
- @Test
- public void flowTracing_SupplierOfMessageFormatMessage() {
- logger.traceEntry(new Supplier<MessageFormatMessage>() {
- @Override
- public MessageFormatMessage get() {
- return new MessageFormatMessage("int foo={0}", 1234567890);
- }
- });
- assertEquals(1, results.size());
- assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
- assertThat("Missing entry data", results.get(0), containsString("(int foo=1,234,567,890)"));
- assertThat("Bad toString()", results.get(0), not(containsString("MessageFormatMessage")));
- }
-
- @Test
- public void flowTracing_SupplierOfObjectArrayMessage() {
- logger.traceEntry(new Supplier<ObjectArrayMessage>() {
- @Override
- public ObjectArrayMessage get() {
- return new ObjectArrayMessage(1234567890);
- }
- });
- assertEquals(1, results.size());
- assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
- assertThat("Missing Enter data", results.get(0), containsString("([1234567890])"));
- assertThat("Bad toString()", results.get(0), not(containsString("ObjectArrayMessage")));
- }
-
- @Test
- public void flowTracing_SupplierOfObjectMessage() {
- logger.traceEntry(new Supplier<ObjectMessage>() {
- @Override
- public ObjectMessage get() {
- return new ObjectMessage(1234567890);
- }
- });
- assertEquals(1, results.size());
- assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
- assertThat("Missing entry data", results.get(0), containsString("(1234567890)"));
- assertThat("Bad toString()", results.get(0), not(containsString("ObjectMessage")));
- }
-
- @Test
- public void flowTracing_SupplierOfParameterizedMessage() {
- logger.traceEntry(new Supplier<ParameterizedMessage>() {
- @Override
- public ParameterizedMessage get() {
- return new ParameterizedMessage("int foo={}", 1234567890);
- }
- });
- assertEquals(1, results.size());
- assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
- assertThat("Missing entry data", results.get(0), containsString("(int foo=1234567890)"));
- assertThat("Bad toString()", results.get(0), not(containsString("ParameterizedMessage")));
- }
-
- @Test
- public void flowTracing_SupplierOfSimpleMessage() {
- logger.traceEntry(new Supplier<SimpleMessage>() {
- @Override
- public SimpleMessage get() {
- return new SimpleMessage("1234567890");
- }
- });
- assertEquals(1, results.size());
- assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
- assertThat("Missing entry data", results.get(0), containsString("(1234567890)"));
- assertThat("Bad toString()", results.get(0), not(containsString("SimpleMessage")));
- }
-
- @Test
- public void flowTracing_SupplierOfString() {
- logger.traceEntry(new Supplier<String>() {
- @Override
- public String get() {
- return "1234567890";
- }
- });
- assertEquals(1, results.size());
- assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
- assertThat("Missing entry data", results.get(0), containsString("(1234567890)"));
- assertThat("Bad toString()", results.get(0), not(containsString("SimpleMessage")));
- }
-
- @Test
- public void flowTracing_SupplierOfStringFormattedMessage() {
- logger.traceEntry(new Supplier<StringFormattedMessage>() {
- @Override
- public StringFormattedMessage get() {
- return new StringFormattedMessage("int foo=%,d", 1234567890);
- }
- });
- assertEquals(1, results.size());
- assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
- assertThat("Missing entry data", results.get(0), containsString("(int foo=1,234,567,890)"));
- assertThat("Bad toString()", results.get(0), not(containsString("StringFormattedMessage")));
- }
-
- @Test
- public void flowTracing_SupplierOfThreadDumpMessage() {
- logger.traceEntry(new Supplier<ThreadDumpMessage>() {
- @Override
- public ThreadDumpMessage get() {
- return new ThreadDumpMessage("Title of ...");
- }
- });
- assertEquals(1, results.size());
- assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
- assertThat("Missing entry data", results.get(0), containsString("RUNNABLE"));
- assertThat("Missing entry data", results.get(0), containsString("Title of ..."));
- assertThat("Missing entry data", results.get(0), containsString(getClass().getName()));
- }
-
- @Before
- public void setup() {
- results.clear();
- defaultLocale = Locale.getDefault(Locale.Category.FORMAT);
- Locale.setDefault(Locale.Category.FORMAT, java.util.Locale.US);
- }
-
- @After
- public void tearDown() {
- Locale.setDefault(Locale.Category.FORMAT, defaultLocale);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.startsWith;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.logging.log4j.message.FormattedMessage;
+import org.apache.logging.log4j.message.JsonMessage;
+import org.apache.logging.log4j.message.LocalizedMessage;
+import org.apache.logging.log4j.message.MessageFormatMessage;
+import org.apache.logging.log4j.message.ObjectArrayMessage;
+import org.apache.logging.log4j.message.ObjectMessage;
+import org.apache.logging.log4j.message.ParameterizedMessage;
+import org.apache.logging.log4j.message.SimpleMessage;
+import org.apache.logging.log4j.message.StringFormattedMessage;
+import org.apache.logging.log4j.message.ThreadDumpMessage;
+import org.apache.logging.log4j.util.Supplier;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Tests Logger APIs with {@link Supplier}.
+ */
+public class LoggerSupplierTest {
+
+ private final TestLogger logger = (TestLogger) LogManager.getLogger("LoggerTest");
+
+ private final List<String> results = logger.getEntries();
+
+ Locale defaultLocale;
+
+ @Test
+ public void flowTracing_SupplierOfFormattedMessage() {
+ logger.traceEntry(new Supplier<FormattedMessage>() {
+ @Override
+ public FormattedMessage get() {
+ return new FormattedMessage("int foo={}", 1234567890);
+ }
+ });
+ assertEquals(1, results.size());
+ assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
+ assertThat("Missing entry data", results.get(0), containsString("(int foo=1234567890)"));
+ assertThat("Bad toString()", results.get(0), not(containsString("FormattedMessage")));
+ }
+
+ @Test
+ public void flowTracing_SupplierOfJsonMessage() {
+ logger.traceEntry(new Supplier<JsonMessage>() {
+ @Override
+ public JsonMessage get() {
+ return new JsonMessage(System.getProperties());
+ }
+ });
+ assertEquals(1, results.size());
+ assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
+ assertThat("Missing entry data", results.get(0), containsString("\"java.runtime.name\":"));
+ assertThat("Bad toString()", results.get(0), not(containsString("JsonMessage")));
+ }
+
+ @Test
+ public void flowTracing_SupplierOfLocalizedMessage() {
+ logger.traceEntry(new Supplier<LocalizedMessage>() {
+ @Override
+ public LocalizedMessage get() {
+ return new LocalizedMessage("int foo={}", 1234567890);
+ }
+ });
+ assertEquals(1, results.size());
+ assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
+ assertThat("Missing entry data", results.get(0), containsString("(int foo=1234567890)"));
+ assertThat("Bad toString()", results.get(0), not(containsString("LocalizedMessage")));
+ }
+
+ @Test
+ public void flowTracing_SupplierOfLong() {
+ logger.traceEntry(new Supplier<Long>() {
+ @Override
+ public Long get() {
+ return Long.valueOf(1234567890);
+ }
+ });
+ assertEquals(1, results.size());
+ assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
+ assertThat("Missing entry data", results.get(0), containsString("(1234567890)"));
+ assertThat("Bad toString()", results.get(0), not(containsString("SimpleMessage")));
+ }
+
+ @Test
+ public void flowTracing_SupplierOfMessageFormatMessage() {
+ logger.traceEntry(new Supplier<MessageFormatMessage>() {
+ @Override
+ public MessageFormatMessage get() {
+ return new MessageFormatMessage("int foo={0}", 1234567890);
+ }
+ });
+ assertEquals(1, results.size());
+ assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
+ assertThat("Missing entry data", results.get(0), containsString("(int foo=1,234,567,890)"));
+ assertThat("Bad toString()", results.get(0), not(containsString("MessageFormatMessage")));
+ }
+
+ @Test
+ public void flowTracing_SupplierOfObjectArrayMessage() {
+ logger.traceEntry(new Supplier<ObjectArrayMessage>() {
+ @Override
+ public ObjectArrayMessage get() {
+ return new ObjectArrayMessage(1234567890);
+ }
+ });
+ assertEquals(1, results.size());
+ assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
+ assertThat("Missing Enter data", results.get(0), containsString("([1234567890])"));
+ assertThat("Bad toString()", results.get(0), not(containsString("ObjectArrayMessage")));
+ }
+
+ @Test
+ public void flowTracing_SupplierOfObjectMessage() {
+ logger.traceEntry(new Supplier<ObjectMessage>() {
+ @Override
+ public ObjectMessage get() {
+ return new ObjectMessage(1234567890);
+ }
+ });
+ assertEquals(1, results.size());
+ assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
+ assertThat("Missing entry data", results.get(0), containsString("(1234567890)"));
+ assertThat("Bad toString()", results.get(0), not(containsString("ObjectMessage")));
+ }
+
+ @Test
+ public void flowTracing_SupplierOfParameterizedMessage() {
+ logger.traceEntry(new Supplier<ParameterizedMessage>() {
+ @Override
+ public ParameterizedMessage get() {
+ return new ParameterizedMessage("int foo={}", 1234567890);
+ }
+ });
+ assertEquals(1, results.size());
+ assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
+ assertThat("Missing entry data", results.get(0), containsString("(int foo=1234567890)"));
+ assertThat("Bad toString()", results.get(0), not(containsString("ParameterizedMessage")));
+ }
+
+ @Test
+ public void flowTracing_SupplierOfSimpleMessage() {
+ logger.traceEntry(new Supplier<SimpleMessage>() {
+ @Override
+ public SimpleMessage get() {
+ return new SimpleMessage("1234567890");
+ }
+ });
+ assertEquals(1, results.size());
+ assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
+ assertThat("Missing entry data", results.get(0), containsString("(1234567890)"));
+ assertThat("Bad toString()", results.get(0), not(containsString("SimpleMessage")));
+ }
+
+ @Test
+ public void flowTracing_SupplierOfString() {
+ logger.traceEntry(new Supplier<String>() {
+ @Override
+ public String get() {
+ return "1234567890";
+ }
+ });
+ assertEquals(1, results.size());
+ assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
+ assertThat("Missing entry data", results.get(0), containsString("(1234567890)"));
+ assertThat("Bad toString()", results.get(0), not(containsString("SimpleMessage")));
+ }
+
+ @Test
+ public void flowTracing_SupplierOfStringFormattedMessage() {
+ logger.traceEntry(new Supplier<StringFormattedMessage>() {
+ @Override
+ public StringFormattedMessage get() {
+ return new StringFormattedMessage("int foo=%,d", 1234567890);
+ }
+ });
+ assertEquals(1, results.size());
+ assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
+ assertThat("Missing entry data", results.get(0), containsString("(int foo=1,234,567,890)"));
+ assertThat("Bad toString()", results.get(0), not(containsString("StringFormattedMessage")));
+ }
+
+ @Test
+ public void flowTracing_SupplierOfThreadDumpMessage() {
+ logger.traceEntry(new Supplier<ThreadDumpMessage>() {
+ @Override
+ public ThreadDumpMessage get() {
+ return new ThreadDumpMessage("Title of ...");
+ }
+ });
+ assertEquals(1, results.size());
+ assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
+ assertThat("Missing entry data", results.get(0), containsString("RUNNABLE"));
+ assertThat("Missing entry data", results.get(0), containsString("Title of ..."));
+ assertThat("Missing entry data", results.get(0), containsString(getClass().getName()));
+ }
+
+ @Before
+ public void setup() {
+ results.clear();
+ defaultLocale = Locale.getDefault(Locale.Category.FORMAT);
+ Locale.setDefault(Locale.Category.FORMAT, java.util.Locale.US);
+ }
+
+ @After
+ public void tearDown() {
+ Locale.setDefault(Locale.Category.FORMAT, defaultLocale);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/LoggerTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/LoggerTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/LoggerTest.java
index c9a284f..2321c64 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/LoggerTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/LoggerTest.java
@@ -538,7 +538,7 @@ public class LoggerTest {
ThreadContext.put("TestYear", Integer.valueOf(2010).toString());
logger.debug("Debug message");
- final String testYear = ThreadContext.get("TestYear");
+ String testYear = ThreadContext.get("TestYear");
assertNotNull("Test Year is null", testYear);
assertEquals("Incorrect test year: " + testYear, "2010", testYear);
ThreadContext.clearMap();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/MarkerTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/MarkerTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/MarkerTest.java
index db232bc..2874016 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/MarkerTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/MarkerTest.java
@@ -56,7 +56,7 @@ public class MarkerTest {
existing.setParents(parent);
assertTrue(existing.hasParents());
}
-
+
@Test
public void testMarker() {
final Marker parent = MarkerManager.getMarker("PARENT");
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/ThreadContextHolder.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/ThreadContextHolder.java b/log4j-api/src/test/java/org/apache/logging/log4j/ThreadContextHolder.java
index 30bb27d..4c85bde 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/ThreadContextHolder.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/ThreadContextHolder.java
@@ -23,15 +23,15 @@ import org.apache.logging.log4j.ThreadContext.ContextStack;
/**
* Holds an immutable copy of the ThreadContext stack and map.
- *
+ *
* TODO Use LOG4J2-1517 Add ThreadContext.setContext(Map<String, String>)
- *
+ *
* or
- *
+ *
* TODO Might be replaced by something from LOG4J2-1447.
- *
+ *
* or do nothing.
- *
+ *
* @since 2.7
*/
public class ThreadContextHolder {
@@ -43,7 +43,7 @@ public class ThreadContextHolder {
/**
* Constructs a new holder initialized with an immutable copy of the ThreadContext stack and map.
- *
+ *
* @param restoreContext
* @param restoreStack
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/junit/SecurityManagerTestRule.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/junit/SecurityManagerTestRule.java b/log4j-api/src/test/java/org/apache/logging/log4j/junit/SecurityManagerTestRule.java
index c334ed8..57ac55d 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/junit/SecurityManagerTestRule.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/junit/SecurityManagerTestRule.java
@@ -28,7 +28,7 @@ import org.junit.runners.model.Statement;
* Using a security manager can mess up other tests so this is best used from integration tests (classes that end in
* "IT" instead of "Test" and "TestCase".)
* </p>
- *
+ *
* <p>
* When this test rule is evaluated, it will:
* </p>
@@ -38,7 +38,7 @@ import org.junit.runners.model.Statement;
* <li>Evaluate the test statement.</li>
* <li>Reset the current SecurityManager to the one from step (1).</li>
* </ol>
- *
+ *
* @since 2.11.0
*/
public class SecurityManagerTestRule implements TestRule {
@@ -54,7 +54,7 @@ public class SecurityManagerTestRule implements TestRule {
* <li>Evaluate the test statement.</li>
* <li>Reset the current SecurityManager to the one from step (1).</li>
* </ol>
- *
+ *
* @param securityManager
* the {@link SecurityManager} to use while running a test.
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/junit/SerialUtil.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/junit/SerialUtil.java b/log4j-api/src/test/java/org/apache/logging/log4j/junit/SerialUtil.java
index 4c8a420..211eca6 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/junit/SerialUtil.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/junit/SerialUtil.java
@@ -46,7 +46,7 @@ public class SerialUtil {
throw new IllegalStateException("Could not serialize", ex);
}
}
-
+
/**
* Deserialize an object from the specified byte array and returns the result.
* @param data byte array representing the serialized object
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/junit/ThreadContextMapRule.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/junit/ThreadContextMapRule.java b/log4j-api/src/test/java/org/apache/logging/log4j/junit/ThreadContextMapRule.java
index be3047b..4066303 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/junit/ThreadContextMapRule.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/junit/ThreadContextMapRule.java
@@ -18,9 +18,9 @@ package org.apache.logging.log4j.junit;
/**
* Restores the ThreadContext to it's initial map values after a JUnit test.
- *
+ *
* Usage:
- *
+ *
* <pre>
* @Rule
* public final ThreadContextMapRule threadContextRule = new ThreadContextMapRule();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/junit/ThreadContextRule.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/junit/ThreadContextRule.java b/log4j-api/src/test/java/org/apache/logging/log4j/junit/ThreadContextRule.java
index e01ada3..dad7b5b 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/junit/ThreadContextRule.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/junit/ThreadContextRule.java
@@ -22,9 +22,9 @@ import org.junit.rules.ExternalResource;
/**
* Restores the ThreadContext to it's initial map and stack values after a JUnit test.
- *
+ *
* Usage:
- *
+ *
* <pre>
* @Rule
* public final ThreadContextRule threadContextRule = new ThreadContextRule();
@@ -45,7 +45,7 @@ public class ThreadContextRule extends ExternalResource {
/**
* Constructs an instance initialized to restore the given structures.
- *
+ *
* @param restoreMap
* Whether to restore the thread context map.
* @param restoreStack
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/junit/ThreadContextStackRule.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/junit/ThreadContextStackRule.java b/log4j-api/src/test/java/org/apache/logging/log4j/junit/ThreadContextStackRule.java
index 9c74662..1581dc8 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/junit/ThreadContextStackRule.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/junit/ThreadContextStackRule.java
@@ -18,9 +18,9 @@ package org.apache.logging.log4j.junit;
/**
* Restores the ThreadContext to it's initial stack values after a JUnit test.
- *
+ *
* Usage:
- *
+ *
* <pre>
* @Rule
* public final ThreadContextStackRule threadContextRule = new ThreadContextStackRule();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java
index d6c5cf7..44a15aa 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java
@@ -231,7 +231,7 @@ public class MapMessageTest {
}
@Override
- public void formatTo(final StringBuilder buffer) {
+ public void formatTo(StringBuilder buffer) {
buffer.append("formatTo");
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/message/ObjectArrayMessageTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/ObjectArrayMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/ObjectArrayMessageTest.java
index 55bf1b9..5f11cf8 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/ObjectArrayMessageTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/ObjectArrayMessageTest.java
@@ -1,40 +1,40 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * @since 2.4
- */
-public class ObjectArrayMessageTest {
-
- private static final Object[] ARRAY = { "A", "B", "C" };
- private static final ObjectArrayMessage OBJECT_ARRAY_MESSAGE = new ObjectArrayMessage(ARRAY);
-
- @Test
- public void testGetParameters() {
- Assert.assertArrayEquals(ARRAY, OBJECT_ARRAY_MESSAGE.getParameters());
- }
-
- @Test
- public void testGetThrowable() {
- Assert.assertEquals(null, OBJECT_ARRAY_MESSAGE.getThrowable());
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.message;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * @since 2.4
+ */
+public class ObjectArrayMessageTest {
+
+ private static final Object[] ARRAY = { "A", "B", "C" };
+ private static final ObjectArrayMessage OBJECT_ARRAY_MESSAGE = new ObjectArrayMessage(ARRAY);
+
+ @Test
+ public void testGetParameters() {
+ Assert.assertArrayEquals(ARRAY, OBJECT_ARRAY_MESSAGE.getParameters());
+ }
+
+ @Test
+ public void testGetThrowable() {
+ Assert.assertEquals(null, OBJECT_ARRAY_MESSAGE.getThrowable());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableParameterizedMessageTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableParameterizedMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableParameterizedMessageTest.java
index 93fe061..d16beb3 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableParameterizedMessageTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableParameterizedMessageTest.java
@@ -154,13 +154,13 @@ public class ReusableParameterizedMessageTest {
final ReusableParameterizedMessage msg = new ReusableParameterizedMessage();
final Throwable EXCEPTION1 = new IllegalAccessError("#1");
msg.set(testMsg, "msg", EXCEPTION1);
- final List<Object> expected = new LinkedList<>();
+ List<Object> expected = new LinkedList<>();
expected.add("msg");
expected.add(EXCEPTION1);
final List<Object> actual = new LinkedList<>();
msg.forEachParameter(new ParameterConsumer<Void>() {
@Override
- public void accept(final Object parameter, final int parameterIndex, final Void state) {
+ public void accept(Object parameter, int parameterIndex, Void state) {
actual.add(parameter);
}
}, null);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/spi/DefaultThreadContextMapTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/spi/DefaultThreadContextMapTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/spi/DefaultThreadContextMapTest.java
index b3a7aa9..e3ad5d6 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/spi/DefaultThreadContextMapTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/spi/DefaultThreadContextMapTest.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertTrue;
import java.util.HashMap;
import java.util.Map;
+import org.apache.logging.log4j.ThreadContext;
import org.junit.Test;
/**
@@ -128,7 +129,7 @@ public class DefaultThreadContextMapTest {
assertEquals("value2", map.get("key2"));
return map;
}
-
+
@Test
public void testGetCopyReturnsMutableMap() {
final DefaultThreadContextMap map = new DefaultThreadContextMap(true);
@@ -219,7 +220,7 @@ public class DefaultThreadContextMapTest {
final ThreadLocal<Map<String, String>> threadLocal = DefaultThreadContextMap.createThreadLocalMap(true);
assertFalse(threadLocal instanceof InheritableThreadLocal<?>);
}
-
+
@Test
public void testThreadLocalInheritableIfConfigured() {
System.setProperty(DefaultThreadContextMap.INHERITABLE_MAP, "true");
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/util/CharsetForNameMain.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/CharsetForNameMain.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/CharsetForNameMain.java
index 64caaf3..b82e135 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/CharsetForNameMain.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/CharsetForNameMain.java
@@ -24,11 +24,11 @@ public class CharsetForNameMain {
/**
* Checks that the given Charset names can be loaded.
*/
- public static void main(final String[] args) {
- for (final String value : args) {
+ public static void main(String[] args) {
+ for (String value : args) {
final String charsetName = value.trim();
if (Charset.isSupported(charsetName)) {
- final Charset cs = Charset.forName(charsetName);
+ Charset cs = Charset.forName(charsetName);
System.out.println(String.format("%s -> %s aliases: %s", charsetName, cs.name(), cs.aliases()));
} else {
System.err.println("Not supported:" + charsetName);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/util/EnvironmentPropertySourceSecurityManagerIT.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/EnvironmentPropertySourceSecurityManagerIT.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/EnvironmentPropertySourceSecurityManagerIT.java
index fef8d1b..0020c05 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/EnvironmentPropertySourceSecurityManagerIT.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/EnvironmentPropertySourceSecurityManagerIT.java
@@ -30,7 +30,7 @@ import org.junit.Test;
* integration tests (classes that end in "IT" instead of "Test" and
* "TestCase".)
* </p>
- *
+ *
* @see EnvironmentPropertySource
* @see SecurityManager
* @see System#setSecurityManager(SecurityManager)
@@ -56,7 +56,7 @@ public class EnvironmentPropertySourceSecurityManagerIT {
/**
* Makes sure we do not blow up with exception below due to a security manager
* rejecting environment variable access in {@link EnvironmentPropertySource}.
- *
+ *
* <pre>
* java.lang.NoClassDefFoundError: Could not initialize class org.apache.logging.log4j.util.PropertiesUtil
* at org.apache.logging.log4j.status.StatusLogger.<clinit>(StatusLogger.java:78)
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/util/Log4jCharsetsPropertiesTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/Log4jCharsetsPropertiesTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/Log4jCharsetsPropertiesTest.java
index 916521b..ff8fd5f 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/Log4jCharsetsPropertiesTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/Log4jCharsetsPropertiesTest.java
@@ -31,13 +31,13 @@ public class Log4jCharsetsPropertiesTest {
*/
@Test
public void testLoadAll() {
- final ResourceBundle resourceBundle = PropertiesUtil.getCharsetsResourceBundle();
- final Enumeration<String> keys = resourceBundle.getKeys();
+ ResourceBundle resourceBundle = PropertiesUtil.getCharsetsResourceBundle();
+ Enumeration<String> keys = resourceBundle.getKeys();
while (keys.hasMoreElements()) {
- final String key = keys.nextElement();
+ String key = keys.nextElement();
Assert.assertFalse(String.format("The Charset %s is available and should not be mapped", key),
Charset.isSupported(key));
- final String value = resourceBundle.getString(key);
+ String value = resourceBundle.getString(key);
Assert.assertTrue(String.format("The Charset %s is is not available and is mapped from %s", value, key),
Charset.isSupported(value));
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/util/ProcessIdUtilTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/ProcessIdUtilTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/ProcessIdUtilTest.java
index 423532d..13aaf9c 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/ProcessIdUtilTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/ProcessIdUtilTest.java
@@ -24,7 +24,7 @@ public class ProcessIdUtilTest {
@Test
public void processIdTest() throws Exception {
- final String processId = ProcessIdUtil.getProcessId();
+ String processId = ProcessIdUtil.getProcessId();
assertFalse("ProcessId is default", processId.equals(ProcessIdUtil.DEFAULT_PROCESSID));
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertiesUtilTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertiesUtilTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertiesUtilTest.java
index 4f9b40e..49b62de 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertiesUtilTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertiesUtilTest.java
@@ -79,25 +79,25 @@ public class PropertiesUtilTest {
assertEquals(StandardCharsets.US_ASCII, pu.getCharsetProperty("e.1"));
assertEquals(Charset.defaultCharset(), pu.getCharsetProperty("e.2"));
}
-
+
@Test
public void testGetMappedProperty_sun_stdout_encoding() {
final PropertiesUtil pu = new PropertiesUtil(System.getProperties());
- final Charset expected = System.console() == null ? Charset.defaultCharset() : StandardCharsets.UTF_8;
+ Charset expected = System.console() == null ? Charset.defaultCharset() : StandardCharsets.UTF_8;
assertEquals(expected, pu.getCharsetProperty("sun.stdout.encoding"));
}
@Test
public void testGetMappedProperty_sun_stderr_encoding() {
final PropertiesUtil pu = new PropertiesUtil(System.getProperties());
- final Charset expected = System.console() == null ? Charset.defaultCharset() : StandardCharsets.UTF_8;
+ Charset expected = System.console() == null ? Charset.defaultCharset() : StandardCharsets.UTF_8;
assertEquals(expected, pu.getCharsetProperty("sun.err.encoding"));
}
@Test
public void testNonStringSystemProperties() {
- final Object key1 = "1";
- final Object key2 = new Object();
+ Object key1 = "1";
+ Object key2 = new Object();
System.getProperties().put(key1, new Object());
System.getProperties().put(key2, "value-2");
try {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertyFilePropertySourceSecurityManagerIT.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertyFilePropertySourceSecurityManagerIT.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertyFilePropertySourceSecurityManagerIT.java
index 3985c29..e59e77e 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertyFilePropertySourceSecurityManagerIT.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertyFilePropertySourceSecurityManagerIT.java
@@ -36,7 +36,7 @@ import org.junit.Test;
* integration tests (classes that end in "IT" instead of "Test" and
* "TestCase".)
* </p>
- *
+ *
* @see PropertyFilePropertySource
* @see SecurityManager
* @see System#setSecurityManager(SecurityManager)
@@ -48,7 +48,7 @@ public class PropertyFilePropertySourceSecurityManagerIT {
public static void beforeClass() {
Assert.assertTrue(TEST_FIXTURE_PATH, Files.exists(Paths.get(TEST_FIXTURE_PATH)));
}
-
+
@Rule
public final SecurityManagerTestRule rule = new SecurityManagerTestRule(new TestSecurityManager());
@@ -72,7 +72,7 @@ public class PropertyFilePropertySourceSecurityManagerIT {
* Makes sure we do not blow up with exception below due to a security manager
* rejecting environment variable access in
* {@link SystemPropertiesPropertySource}.
- *
+ *
* <pre>
* </pre>
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertySourceTokenizerTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertySourceTokenizerTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertySourceTokenizerTest.java
index 38afa0f..dd1d49c 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertySourceTokenizerTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertySourceTokenizerTest.java
@@ -60,7 +60,7 @@ public class PropertySourceTokenizerTest {
@Test
public void testTokenize() throws Exception {
- final List<CharSequence> tokens = PropertySource.Util.tokenize(value);
+ List<CharSequence> tokens = PropertySource.Util.tokenize(value);
assertEquals(expectedTokens, tokens);
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/util/ProviderUtilTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/ProviderUtilTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/ProviderUtilTest.java
index 6c03f81..ce4236a 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/ProviderUtilTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/ProviderUtilTest.java
@@ -31,9 +31,9 @@ public class ProviderUtilTest {
@Test
public void complexTest() throws Exception {
- final File file = new File("target/classes");
- final ClassLoader classLoader = new URLClassLoader(new URL[] {file.toURI().toURL()});
- final Worker worker = new Worker();
+ File file = new File("target/classes");
+ ClassLoader classLoader = new URLClassLoader(new URL[] {file.toURI().toURL()});
+ Worker worker = new Worker();
worker.setContextClassLoader(classLoader);
worker.start();
worker.join();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/util/SortedArrayStringMapTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/SortedArrayStringMapTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/SortedArrayStringMapTest.java
index 54e5ccb..3d9ce3e 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/SortedArrayStringMapTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/SortedArrayStringMapTest.java
@@ -48,7 +48,7 @@ public class SortedArrayStringMapTest {
}
public void testConstructorAllowsZeroCapacity() throws Exception {
- final SortedArrayStringMap sortedArrayStringMap = new SortedArrayStringMap(0);
+ SortedArrayStringMap sortedArrayStringMap = new SortedArrayStringMap(0);
assertEquals(0, sortedArrayStringMap.size());
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/util/StringBuildersTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/StringBuildersTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/StringBuildersTest.java
index 6fa7a6f..6feecbb 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/StringBuildersTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/StringBuildersTest.java
@@ -49,8 +49,8 @@ public class StringBuildersTest {
@Test
public void escapeJsonCharactersCorrectly() {
- final String jsonValueNotEscaped = "{\"field\n1\":\"value_1\"}";
- final String jsonValueEscaped = "{\\\"field\\n1\\\":\\\"value_1\\\"}";
+ String jsonValueNotEscaped = "{\"field\n1\":\"value_1\"}";
+ String jsonValueEscaped = "{\\\"field\\n1\\\":\\\"value_1\\\"}";
StringBuilder sb = new StringBuilder();
sb.append(jsonValueNotEscaped);
@@ -59,7 +59,7 @@ public class StringBuildersTest {
assertEquals(jsonValueEscaped, sb.toString());
sb = new StringBuilder();
- final String jsonValuePartiallyEscaped = "{\"field\n1\":\\\"value_1\\\"}";
+ String jsonValuePartiallyEscaped = "{\"field\n1\":\\\"value_1\\\"}";
sb.append(jsonValueNotEscaped);
assertEquals(jsonValueNotEscaped, sb.toString());
StringBuilders.escapeJson(sb, 10);
@@ -68,10 +68,10 @@ public class StringBuildersTest {
@Test
public void escapeJsonCharactersISOControl() {
- final String jsonValueNotEscaped = "{\"field\n1\":\"value" + (char) 0x8F + "_1\"}";
- final String jsonValueEscaped = "{\\\"field\\n1\\\":\\\"value\\u008F_1\\\"}";
+ String jsonValueNotEscaped = "{\"field\n1\":\"value" + (char) 0x8F + "_1\"}";
+ String jsonValueEscaped = "{\\\"field\\n1\\\":\\\"value\\u008F_1\\\"}";
- final StringBuilder sb = new StringBuilder();
+ StringBuilder sb = new StringBuilder();
sb.append(jsonValueNotEscaped);
assertEquals(jsonValueNotEscaped, sb.toString());
StringBuilders.escapeJson(sb, 0);
@@ -80,10 +80,10 @@ public class StringBuildersTest {
@Test
public void escapeXMLCharactersCorrectly() {
- final String xmlValueNotEscaped = "<\"Salt&Peppa'\">";
- final String xmlValueEscaped = "<"Salt&Peppa'">";
+ String xmlValueNotEscaped = "<\"Salt&Peppa'\">";
+ String xmlValueEscaped = "<"Salt&Peppa'">";
- final StringBuilder sb = new StringBuilder();
+ StringBuilder sb = new StringBuilder();
sb.append(xmlValueNotEscaped);
assertEquals(xmlValueNotEscaped, sb.toString());
StringBuilders.escapeXml(sb, 0);
[08/13] logging-log4j2 git commit: Revert "Use final. Remove trailing
spaces."
Posted by gg...@apache.org.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/ScriptPatternSelector.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/ScriptPatternSelector.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/ScriptPatternSelector.java
index 4172fcc..35c6f4b 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/ScriptPatternSelector.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/ScriptPatternSelector.java
@@ -48,21 +48,21 @@ public class ScriptPatternSelector implements PatternSelector {
*/
public static class Builder implements org.apache.logging.log4j.core.util.Builder<ScriptPatternSelector> {
- @PluginElement("Script")
+ @PluginElement("Script")
private AbstractScript script;
-
- @PluginElement("PatternMatch")
+
+ @PluginElement("PatternMatch")
private PatternMatch[] properties;
-
- @PluginBuilderAttribute("defaultPattern")
+
+ @PluginBuilderAttribute("defaultPattern")
private String defaultPattern;
-
- @PluginBuilderAttribute("alwaysWriteExceptions")
+
+ @PluginBuilderAttribute("alwaysWriteExceptions")
private boolean alwaysWriteExceptions = true;
-
+
@PluginBuilderAttribute("disableAnsi")
private boolean disableAnsi;
-
+
@PluginBuilderAttribute("noConsoleNoAnsi")
private boolean noConsoleNoAnsi;
@@ -131,7 +131,7 @@ public class ScriptPatternSelector implements PatternSelector {
return this;
}
}
-
+
private final Map<String, PatternFormatter[]> formatterMap = new HashMap<>();
private final Map<String, String> patternMap = new HashMap<>();
@@ -204,7 +204,7 @@ public class ScriptPatternSelector implements PatternSelector {
/**
* Deprecated, use {@link #newBuilder()} instead.
- *
+ *
* @param script
* @param properties
* @param defaultPattern
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/SyslogLayout.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/SyslogLayout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/SyslogLayout.java
index b6d58de..97fcc3b 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/SyslogLayout.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/SyslogLayout.java
@@ -46,17 +46,17 @@ public final class SyslogLayout extends AbstractStringLayout {
/**
* Builds a SyslogLayout.
* <p>The main arguments are</p>
- * <ul>
+ * <ul>
* <li>facility: The Facility is used to try to classify the message.</li>
* <li>includeNewLine: If true a newline will be appended to the result.</li>
* <li>escapeNL: Pattern to use for replacing newlines.</li>
* <li>charset: The character set.</li>
- * </ul>
+ * </ul>
* @param <B> the builder type
*/
public static class Builder<B extends Builder<B>> extends AbstractStringLayout.Builder<B>
implements org.apache.logging.log4j.core.util.Builder<SyslogLayout> {
-
+
public Builder() {
super();
setCharset(StandardCharsets.UTF_8);
@@ -104,7 +104,7 @@ public final class SyslogLayout extends AbstractStringLayout {
}
}
-
+
@PluginBuilderFactory
public static <B extends Builder<B>> B newBuilder() {
return new Builder<B>().asBuilder();
@@ -123,7 +123,7 @@ public final class SyslogLayout extends AbstractStringLayout {
* Date format used if header = true.
*/
private final SimpleDateFormat dateFormat = new SimpleDateFormat("MMM dd HH:mm:ss", Locale.ENGLISH);
-
+
/**
* Host name used to identify messages from this appender.
*/
@@ -184,7 +184,7 @@ public final class SyslogLayout extends AbstractStringLayout {
* <li>Key: "formatType" Value: "logfilepatternreceiver" (format uses the keywords supported by
* LogFilePatternReceiver)</li>
* </ul>
- *
+ *
* @return Map of content format keys supporting SyslogLayout
*/
@Override
@@ -199,7 +199,7 @@ public final class SyslogLayout extends AbstractStringLayout {
/**
* Creates a SyslogLayout.
- *
+ *
* @param facility The Facility is used to try to classify the message.
* @param includeNewLine If true a newline will be appended to the result.
* @param escapeNL Pattern to use for replacing newlines.
@@ -215,7 +215,7 @@ public final class SyslogLayout extends AbstractStringLayout {
/**
* Gets the facility.
- *
+ *
* @return the facility
*/
public Facility getFacility() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/XmlLayout.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/XmlLayout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/XmlLayout.java
index c9cd886..b09add7 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/XmlLayout.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/XmlLayout.java
@@ -146,7 +146,7 @@ public final class XmlLayout extends AbstractJacksonLayout {
* <li>Key: "dtd" Value: "log4j-events.dtd"</li>
* <li>Key: "version" Value: "2.0"</li>
* </ul>
- *
+ *
* @return Map of content format keys supporting XmlLayout
*/
@Override
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/YamlLayout.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/YamlLayout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/YamlLayout.java
index 0245cd8..1d8576f 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/YamlLayout.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/YamlLayout.java
@@ -157,7 +157,7 @@ public final class YamlLayout extends AbstractJacksonLayout {
/**
* Creates a YAML Layout.
- *
+ *
* @param config
* The plugin configuration.
* @param locationInfo
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/AbstractLookup.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/AbstractLookup.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/AbstractLookup.java
index c76561c..1dba499 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/AbstractLookup.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/AbstractLookup.java
@@ -18,14 +18,14 @@ package org.apache.logging.log4j.core.lookup;
/**
* A default lookup for others to extend.
- *
+ *
* @since 2.1
*/
public abstract class AbstractLookup implements StrLookup {
/**
* Calls {@code lookup(null, key)} in the super class.
- *
+ *
* @see StrLookup#lookup(LogEvent, String)
*/
@Override
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/MainMapLookup.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/MainMapLookup.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/MainMapLookup.java
index 34b2fd3..a50de0d 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/MainMapLookup.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/MainMapLookup.java
@@ -23,9 +23,9 @@ import org.apache.logging.log4j.core.config.plugins.Plugin;
/**
* A map-based lookup for main arguments.
- *
+ *
* See {@link #setMainArguments(String[])}.
- *
+ *
* @since 2.4
*/
@Plugin(name = "main", category = StrLookup.CATEGORY)
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/MarkerLookup.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/MarkerLookup.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/MarkerLookup.java
index fbbef22..320db49 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/MarkerLookup.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/MarkerLookup.java
@@ -24,7 +24,7 @@ import org.apache.logging.log4j.core.config.plugins.Plugin;
/**
* Looks-up markers.
- *
+ *
* @since 2.4
*/
@Plugin(name = "marker", category = StrLookup.CATEGORY)
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/StrMatcher.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/StrMatcher.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/StrMatcher.java
index bea4262..f6d787a 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/StrMatcher.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/StrMatcher.java
@@ -369,7 +369,7 @@ public abstract class StrMatcher {
}
return len;
}
-
+
@Override
public String toString() {
return super.toString() + Chars.SPACE + Arrays.toString(chars);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/net/AbstractSocketManager.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/AbstractSocketManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/AbstractSocketManager.java
index 76d3e46..5157365 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/AbstractSocketManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/AbstractSocketManager.java
@@ -34,12 +34,12 @@ public abstract class AbstractSocketManager extends OutputStreamManager {
* The Internet address of the host.
*/
protected final InetAddress inetAddress;
-
+
/**
* The name of the host.
*/
protected final String host;
-
+
/**
* The port on the host.
*/
@@ -55,7 +55,7 @@ public abstract class AbstractSocketManager extends OutputStreamManager {
* @param bufferSize The buffer size.
*/
public AbstractSocketManager(final String name, final OutputStream os, final InetAddress inetAddress,
- final String host, final int port, final Layout<? extends Serializable> layout, final boolean writeHeader,
+ final String host, final int port, final Layout<? extends Serializable> layout, final boolean writeHeader,
final int bufferSize) {
super(os, name, layout, writeHeader, bufferSize);
this.inetAddress = inetAddress;
@@ -69,7 +69,7 @@ public abstract class AbstractSocketManager extends OutputStreamManager {
* <li>Key: "port" Value: provided "port" param</li>
* <li>Key: "address" Value: provided "address" param</li>
* </ul>
- *
+ *
* @return Map of content format keys supporting AbstractSocketManager
*/
@Override
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/net/DatagramSocketManager.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/DatagramSocketManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/DatagramSocketManager.java
index 8f22c85..844c614 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/DatagramSocketManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/DatagramSocketManager.java
@@ -75,7 +75,7 @@ public class DatagramSocketManager extends AbstractSocketManager {
* <li>Key: "protocol" Value: "udp"</li>
* <li>Key: "direction" Value: "out"</li>
* </ul>
- *
+ *
* @return Map of content format keys supporting DatagramSocketManager
*/
@Override
@@ -94,7 +94,7 @@ public class DatagramSocketManager extends AbstractSocketManager {
private final int port;
private final Layout<? extends Serializable> layout;
private final int bufferSize;
-
+
public FactoryData(final String host, final int port, final Layout<? extends Serializable> layout, final int bufferSize) {
this.host = host;
this.port = port;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Facility.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Facility.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Facility.java
index a03dc33..a5eadf3 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Facility.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Facility.java
@@ -125,76 +125,76 @@ import org.apache.logging.log4j.util.EnglishEnums;
* </table>
*/
public enum Facility {
-
+
/** Kernel messages. */
KERN(0),
-
+
/** User level messages. */
USER(1),
-
+
/** Mail system. */
MAIL(2),
-
+
/** System daemons. */
DAEMON(3),
-
+
/** Security/Authorization messages. */
AUTH(4),
-
+
/** Messages generated by syslogd. */
SYSLOG(5),
-
+
/** Line printer subsystem. */
LPR(6),
-
+
/** Network news subsystem. */
NEWS(7),
-
+
/** UUCP subsystem. */
UUCP(8),
-
+
/** Clock daemon. */
CRON(9),
-
+
/** Security/Authorization messages. */
AUTHPRIV(10),
-
+
/** FTP daemon. */
FTP(11),
-
+
/** NTP subsystem. */
NTP(12),
-
+
/** Log audit. */
LOG_AUDIT(13),
-
+
/** Log alert. */
LOG_ALERT(14),
-
+
/** Clock daemon. */
CLOCK(15),
-
+
/** Local use 0. */
LOCAL0(16),
-
+
/** Local use 1. */
LOCAL1(17),
-
+
/** Local use 2. */
LOCAL2(18),
-
+
/** Local use 3. */
LOCAL3(19),
-
+
/** Local use 4. */
LOCAL4(20),
-
+
/** Local use 5. */
LOCAL5(21),
-
+
/** Local use 6. */
LOCAL6(22),
-
+
/** Local use 7. */
LOCAL7(23);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/net/JndiManager.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/JndiManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/JndiManager.java
index 2670857..22ab3aa 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/JndiManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/JndiManager.java
@@ -55,7 +55,7 @@ public class JndiManager extends AbstractManager {
/**
* Gets a named JndiManager using the default {@link javax.naming.InitialContext}.
- *
+ *
* @param name the name of the JndiManager instance to create or use if available
* @return a default JndiManager
*/
@@ -89,7 +89,7 @@ public class JndiManager extends AbstractManager {
/**
* Gets a JndiManager with the provided configuration information.
- *
+ *
* @param properties JNDI properties, usually created by calling {@link #createProperties(String, String, String, String, String, Properties)}.
* @return the JndiManager for the provided parameters.
* @see #createProperties(String, String, String, String, String, Properties)
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/net/MulticastDnsAdvertiser.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/MulticastDnsAdvertiser.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/MulticastDnsAdvertiser.java
index 5f86c53..3d610bf 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/MulticastDnsAdvertiser.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/MulticastDnsAdvertiser.java
@@ -116,7 +116,7 @@ public class MulticastDnsAdvertiser implements Advertiser {
/**
* Unadvertise the previously advertised entity.
- *
+ *
* @param serviceInfo
*/
@Override
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Priority.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Priority.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Priority.java
index decd996..c7c6acc 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Priority.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Priority.java
@@ -49,7 +49,7 @@ public class Priority {
private static int toPriority(final Facility aFacility, final Severity aSeverity) {
return (aFacility.getCode() << 3) + aSeverity.getCode();
}
-
+
/**
* Returns the Facility.
* @return the Facility.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Rfc1349TrafficClass.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Rfc1349TrafficClass.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Rfc1349TrafficClass.java
index fe5d6f1..8144e45 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Rfc1349TrafficClass.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Rfc1349TrafficClass.java
@@ -19,7 +19,7 @@ package org.apache.logging.log4j.core.net;
/**
* Enumerates the <a href="https://tools.ietf.org/html/rfc1349">RFC 1349</a> TOS field.
- *
+ *
* <ul>
* <li><code>IPTOS_LOWCOST (0x02)</code></li>
* <li><code>IPTOS_RELIABILITY (0x04)</code></li>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/net/SslSocketManager.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/SslSocketManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/SslSocketManager.java
index 074b34a..2a4593d 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/SslSocketManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/SslSocketManager.java
@@ -158,13 +158,13 @@ public class SslSocketManager extends TcpSocketManager {
private static class SslSocketManagerFactory extends TcpSocketManagerFactory<SslSocketManager, SslFactoryData> {
@Override
- SslSocketManager createManager(final String name, final OutputStream os, final Socket socket, final InetAddress inetAddress,
+ SslSocketManager createManager(final String name, OutputStream os, Socket socket, InetAddress inetAddress,
final SslFactoryData data) {
return new SslSocketManager(name, os, socket, data.sslConfiguration, inetAddress, data.host, data.port,
data.connectTimeoutMillis, data.reconnectDelayMillis, data.immediateFail, data.layout, data.bufferSize,
data.socketOptions);
}
-
+
@Override
Socket createSocket(final SslFactoryData data) throws IOException {
return SslSocketManager.createSocket(data.host, data.port, data.connectTimeoutMillis, data.sslConfiguration,
@@ -172,8 +172,8 @@ public class SslSocketManager extends TcpSocketManager {
}
}
- static Socket createSocket(final String host, final int port, final int connectTimeoutMillis,
- final SslConfiguration sslConfiguration, final SocketOptions socketOptions) throws IOException {
+ static Socket createSocket(final String host, int port, int connectTimeoutMillis,
+ final SslConfiguration sslConfiguration, SocketOptions socketOptions) throws IOException {
final SSLSocketFactory socketFactory = createSslSocketFactory(sslConfiguration);
final SSLSocket socket = (SSLSocket) socketFactory.createSocket();
if (socketOptions != null) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/net/TcpSocketManager.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/TcpSocketManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/TcpSocketManager.java
index c5967c0..f5b971d 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/TcpSocketManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/TcpSocketManager.java
@@ -68,7 +68,7 @@ public class TcpSocketManager extends AbstractSocketManager {
/**
* Constructs.
- *
+ *
* @param name
* The unique name of this connection.
* @param os
@@ -105,7 +105,7 @@ public class TcpSocketManager extends AbstractSocketManager {
/**
* Constructs.
- *
+ *
* @param name
* The unique name of this connection.
* @param os
@@ -148,7 +148,7 @@ public class TcpSocketManager extends AbstractSocketManager {
/**
* Obtains a TcpSocketManager.
- *
+ *
* @param host
* The host to connect to.
* @param port
@@ -172,7 +172,7 @@ public class TcpSocketManager extends AbstractSocketManager {
/**
* Obtains a TcpSocketManager.
- *
+ *
* @param host
* The host to connect to.
* @param port
@@ -221,7 +221,7 @@ public class TcpSocketManager extends AbstractSocketManager {
reconnector = createReconnector();
try {
reconnector.reconnect();
- } catch (final IOException reconnEx) {
+ } catch (IOException reconnEx) {
LOGGER.debug("Cannot reestablish socket connection to {}: {}; starting reconnector thread {}",
config, reconnEx.getLocalizedMessage(), reconnector.getName(), reconnEx);
reconnector.start();
@@ -230,7 +230,7 @@ public class TcpSocketManager extends AbstractSocketManager {
}
try {
writeAndFlush(bytes, offset, length, immediateFlush);
- } catch (final IOException e) {
+ } catch (IOException e) {
throw new AppenderLoggingException(
String.format("Error writing to %s after reestablishing connection for %s", getName(),
config),
@@ -282,7 +282,7 @@ public class TcpSocketManager extends AbstractSocketManager {
* <li>Key: "protocol" Value: "tcp"</li>
* <li>Key: "direction" Value: "out"</li>
* </ul>
- *
+ *
* @return Map of content format keys supporting TcpSocketManager
*/
@Override
@@ -422,7 +422,7 @@ public class TcpSocketManager extends AbstractSocketManager {
/**
* Factory to create a TcpSocketManager.
- *
+ *
* @param <M>
* The manager type.
* @param <T>
@@ -460,7 +460,7 @@ public class TcpSocketManager extends AbstractSocketManager {
}
@SuppressWarnings("unchecked")
- M createManager(final String name, final OutputStream os, final Socket socket, final InetAddress inetAddress, final T data) {
+ M createManager(final String name, OutputStream os, Socket socket, InetAddress inetAddress, final T data) {
return (M) new TcpSocketManager(name, os, socket, inetAddress, data.host, data.port,
data.connectTimeoutMillis, data.reconnectDelayMillis, data.immediateFail, data.layout,
data.bufferSize, data.socketOptions);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/AbstractKeyStoreConfiguration.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/AbstractKeyStoreConfiguration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/AbstractKeyStoreConfiguration.java
index 27ab29d..5855026 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/AbstractKeyStoreConfiguration.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/AbstractKeyStoreConfiguration.java
@@ -70,7 +70,7 @@ public class AbstractKeyStoreConfiguration extends StoreConfiguration<KeyStore>
}
try (final InputStream fin = openInputStream(loadLocation)) {
final KeyStore ks = KeyStore.getInstance(this.keyStoreType);
- final char[] password = this.getPasswordAsCharArray();
+ char[] password = this.getPasswordAsCharArray();
try {
ks.load(fin, password);
} finally {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/EnvironmentPasswordProvider.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/EnvironmentPasswordProvider.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/EnvironmentPasswordProvider.java
index da16622..d60f82c 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/EnvironmentPasswordProvider.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/EnvironmentPasswordProvider.java
@@ -49,7 +49,7 @@ class EnvironmentPasswordProvider implements PasswordProvider {
@Override
public char[] getPassword() {
- final String password = System.getenv(passwordEnvironmentVariable);
+ String password = System.getenv(passwordEnvironmentVariable);
return password == null ? null : password.toCharArray();
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/FilePasswordProvider.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/FilePasswordProvider.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/FilePasswordProvider.java
index 355a781..ff59b00 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/FilePasswordProvider.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/FilePasswordProvider.java
@@ -65,14 +65,14 @@ class FilePasswordProvider implements PasswordProvider {
byte[] bytes = null;
try {
bytes = Files.readAllBytes(passwordPath);
- final ByteBuffer bb = ByteBuffer.wrap(bytes);
- final CharBuffer decoded = Charset.defaultCharset().decode(bb);
- final char[] result = new char[decoded.limit()];
+ ByteBuffer bb = ByteBuffer.wrap(bytes);
+ CharBuffer decoded = Charset.defaultCharset().decode(bb);
+ char[] result = new char[decoded.limit()];
decoded.get(result, 0, result.length);
decoded.rewind();
decoded.put(new char[result.length]); // erase decoded CharBuffer
return result;
- } catch (final IOException e) {
+ } catch (IOException e) {
throw new IllegalStateException("Could not read password from " + passwordPath + ": " + e, e);
} finally {
if (bytes != null) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/KeyStoreConfiguration.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/KeyStoreConfiguration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/KeyStoreConfiguration.java
index ff479be..0c9e3ce 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/KeyStoreConfiguration.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/KeyStoreConfiguration.java
@@ -107,7 +107,7 @@ public class KeyStoreConfiguration extends AbstractKeyStoreConfiguration {
}
try {
// @formatter:off
- final PasswordProvider provider = passwordFile != null
+ PasswordProvider provider = passwordFile != null
? new FilePasswordProvider(passwordFile)
: passwordEnvironmentVariable != null
? new EnvironmentPasswordProvider(passwordEnvironmentVariable)
@@ -118,7 +118,7 @@ public class KeyStoreConfiguration extends AbstractKeyStoreConfiguration {
Arrays.fill(password, '\0');
}
return new KeyStoreConfiguration(location, provider, keyStoreType, keyManagerFactoryAlgorithm);
- } catch (final Exception ex) {
+ } catch (Exception ex) {
throw new StoreConfigurationException("Could not configure KeyStore", ex);
}
}
@@ -166,7 +166,7 @@ public class KeyStoreConfiguration extends AbstractKeyStoreConfiguration {
public KeyManagerFactory initKeyManagerFactory() throws NoSuchAlgorithmException, UnrecoverableKeyException,
KeyStoreException {
final KeyManagerFactory kmFactory = KeyManagerFactory.getInstance(this.keyManagerFactoryAlgorithm);
- final char[] password = this.getPasswordAsCharArray();
+ char[] password = this.getPasswordAsCharArray();
try {
kmFactory.init(this.getKeyStore(), password);
} finally {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SslConfiguration.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SslConfiguration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SslConfiguration.java
index 5603e89..b129184 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SslConfiguration.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SslConfiguration.java
@@ -66,7 +66,7 @@ public class SslConfiguration {
this.trustStoreConfig.clearSecrets();
}
}
-
+
public SSLSocketFactory getSslSocketFactory() {
return sslContext.getSocketFactory();
}
@@ -219,7 +219,7 @@ public class SslConfiguration {
/**
* Creates an SslConfiguration from a KeyStoreConfiguration and a TrustStoreConfiguration.
- *
+ *
* @param protocol The protocol, see http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#SSLContext
* @param keyStoreConfig The KeyStoreConfiguration.
* @param trustStoreConfig The TrustStoreConfiguration.
@@ -229,7 +229,7 @@ public class SslConfiguration {
public static SslConfiguration createSSLConfiguration(
// @formatter:off
@PluginAttribute("protocol") final String protocol,
- @PluginElement("KeyStore") final KeyStoreConfiguration keyStoreConfig,
+ @PluginElement("KeyStore") final KeyStoreConfiguration keyStoreConfig,
@PluginElement("TrustStore") final TrustStoreConfiguration trustStoreConfig) {
// @formatter:on
return new SslConfiguration(protocol, keyStoreConfig, trustStoreConfig);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfigurationException.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfigurationException.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfigurationException.java
index f635145..793e6df 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfigurationException.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfigurationException.java
@@ -30,7 +30,7 @@ public class StoreConfigurationException extends Exception {
super(message);
}
- public StoreConfigurationException(final String message, final Exception e) {
+ public StoreConfigurationException(String message, Exception e) {
super(message, e);
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/TrustStoreConfiguration.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/TrustStoreConfiguration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/TrustStoreConfiguration.java
index 08ddc69..b5c282b 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/TrustStoreConfiguration.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/TrustStoreConfiguration.java
@@ -96,7 +96,7 @@ public class TrustStoreConfiguration extends AbstractKeyStoreConfiguration {
}
try {
// @formatter:off
- final PasswordProvider provider = passwordFile != null
+ PasswordProvider provider = passwordFile != null
? new FilePasswordProvider(passwordFile)
: passwordEnvironmentVariable != null
? new EnvironmentPasswordProvider(passwordEnvironmentVariable)
@@ -107,7 +107,7 @@ public class TrustStoreConfiguration extends AbstractKeyStoreConfiguration {
Arrays.fill(password, '\0');
}
return new TrustStoreConfiguration(location, provider, keyStoreType, trustManagerFactoryAlgorithm);
- } catch (final Exception ex) {
+ } catch (Exception ex) {
throw new StoreConfigurationException("Could not configure TrustStore", ex);
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/parser/TextLogEventParser.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/parser/TextLogEventParser.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/parser/TextLogEventParser.java
index 2ef2bc3..ca20335 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/parser/TextLogEventParser.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/parser/TextLogEventParser.java
@@ -22,7 +22,7 @@ import org.apache.logging.log4j.core.LogEvent;
* Parses the output from a text based layout into instances of {@link LogEvent}.
*/
public interface TextLogEventParser extends LogEventParser {
-
+
/**
* Parses a String, which is expected to contain exactly one log event.
*
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
index 703786b..9bc85ca 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
@@ -184,7 +184,7 @@ public final class DatePatternConverter extends LogEventPatternConverter impleme
cachedTime = new AtomicReference<>(fromEpochMillis(System.currentTimeMillis()));
}
- private CachedTime fromEpochMillis(final long epochMillis) {
+ private CachedTime fromEpochMillis(long epochMillis) {
final MutableInstant temp = new MutableInstant();
temp.initFromEpochMilli(epochMillis, 0);
return new CachedTime(temp);
@@ -266,7 +266,7 @@ public final class DatePatternConverter extends LogEventPatternConverter impleme
}
public void format(final long epochMilli, final StringBuilder output) {
- final MutableInstant instant = getMutableInstant();
+ MutableInstant instant = getMutableInstant();
instant.initFromEpochMilli(epochMilli, 0);
format(instant, output);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverter.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverter.java
index 9485746..8ec9b7d 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverter.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverter.java
@@ -35,7 +35,7 @@ public final class ExtendedThrowablePatternConverter extends ThrowablePatternCon
/**
* Private constructor.
- *
+ *
* @param config
* @param options options, may be null.
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java
index 330da9f..c4b9703 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java
@@ -252,7 +252,7 @@ public final class HighlightConverter extends LogEventPatternConverter implement
}
}
- String getLevelStyle(final Level level) {
+ String getLevelStyle(Level level) {
return levelStyles.get(level);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/JAnsiTextRenderer.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/JAnsiTextRenderer.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/JAnsiTextRenderer.java
index ea47a68..8377036 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/JAnsiTextRenderer.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/JAnsiTextRenderer.java
@@ -34,9 +34,9 @@ import org.fusesource.jansi.AnsiRenderer.Code;
/**
* Renders an input as ANSI escaped output.
- *
+ *
* Uses the JAnsi rendering syntax as the default to render a message into an ANSI escaped string.
- *
+ *
* The default syntax for embedded ANSI codes is:
*
* <pre>
@@ -54,28 +54,28 @@ import org.fusesource.jansi.AnsiRenderer.Code;
* <pre>
* @|bold,red Warning!|@
* </pre>
- *
+ *
* You can also define custom style names in the configuration with the syntax:
- *
+ *
* <pre>
* %message{ansi}{StyleName=value(,value)*( StyleName=value(,value)*)*}%n
* </pre>
- *
+ *
* For example:
- *
+ *
* <pre>
* %message{ansi}{WarningStyle=red,bold KeyStyle=white ValueStyle=blue}%n
* </pre>
- *
+ *
* The call site can look like this:
- *
+ *
* <pre>
* logger.info("@|KeyStyle {}|@ = @|ValueStyle {}|@", entry.getKey(), entry.getValue());
* </pre>
- *
+ *
* Note: This class originally copied and then heavily modified code from JAnsi's AnsiRenderer (which is licensed as
* Apache 2.0.)
- *
+ *
* @see AnsiRenderer
*/
public final class JAnsiTextRenderer implements TextRenderer {
@@ -254,7 +254,7 @@ public final class JAnsiTextRenderer implements TextRenderer {
/**
* Renders the given text with the given names which can be ANSI code names or Log4j style names.
- *
+ *
* @param text
* The text to render
* @param names
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java
index f603b05..91c11ec 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java
@@ -276,7 +276,7 @@ public final class PatternParser {
final int begin = i; // position of first real char
int depth = 1; // already inside one level
while (depth > 0 && i < pattern.length()) {
- final char c = pattern.charAt(i);
+ char c = pattern.charAt(i);
if (c == '{') {
depth++;
} else if (c == '}') {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/PlainTextRenderer.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/PlainTextRenderer.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/PlainTextRenderer.java
index a29634d..5233432 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/PlainTextRenderer.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/PlainTextRenderer.java
@@ -20,7 +20,7 @@ package org.apache.logging.log4j.core.pattern;
Renders input unchanged.
*/
public final class PlainTextRenderer implements TextRenderer {
-
+
private static final PlainTextRenderer INSTANCE = new PlainTextRenderer();
public static PlainTextRenderer getInstance() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/ProcessIdPatternConverter.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/ProcessIdPatternConverter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/ProcessIdPatternConverter.java
index 847c931..d182dc0 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/ProcessIdPatternConverter.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/ProcessIdPatternConverter.java
@@ -32,7 +32,7 @@ public final class ProcessIdPatternConverter extends LogEventPatternConverter {
private ProcessIdPatternConverter(final String... options) {
super("Process ID", "pid");
final String defaultValue = options.length > 0 ? options[0] : DEFAULT_DEFAULT_VALUE;
- final String discoveredPid = ProcessIdUtil.getProcessId();
+ String discoveredPid = ProcessIdUtil.getProcessId();
pid = discoveredPid.equals(ProcessIdUtil.DEFAULT_PROCESSID) ? defaultValue : discoveredPid;
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/TextRenderer.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/TextRenderer.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/TextRenderer.java
index 3a9e210..2355c88 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/TextRenderer.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/TextRenderer.java
@@ -23,7 +23,7 @@ public interface TextRenderer {
/**
* Renders input text to an output.
- *
+ *
* @param input
* The input
* @param output
@@ -35,7 +35,7 @@ public interface TextRenderer {
/**
* Renders input text to an output.
- *
+ *
* @param input
* The input
* @param output
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/script/AbstractScript.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/script/AbstractScript.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/script/AbstractScript.java
index b78bff2..90f04fa 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/script/AbstractScript.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/script/AbstractScript.java
@@ -26,7 +26,7 @@ public abstract class AbstractScript {
protected static final Logger LOGGER = StatusLogger.getLogger();
protected static final String DEFAULT_LANGUAGE = "JavaScript";
-
+
private final String language;
private final String scriptText;
private final String name;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/JndiContextSelector.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/JndiContextSelector.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/JndiContextSelector.java
index b054e9a..b790eaf 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/JndiContextSelector.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/JndiContextSelector.java
@@ -44,7 +44,7 @@ import org.apache.logging.log4j.status.StatusLogger;
* Here is an example of an <code>env-entry</code>:
* </p>
* <blockquote>
- *
+ *
* <pre>
* <env-entry>
* <description>JNDI logging context name for this app</description>
@@ -53,7 +53,7 @@ import org.apache.logging.log4j.status.StatusLogger;
* <env-entry-type>java.lang.String</env-entry-type>
* </env-entry>
* </pre>
- *
+ *
* </blockquote>
*
* <p>
@@ -66,7 +66,7 @@ import org.apache.logging.log4j.status.StatusLogger;
* (ContextJNDISelector) will use this resource to automatically configure the log4j repository.
* </p>
** <blockquote>
- *
+ *
* <pre>
* <env-entry>
* <description>URL for configuring log4j context</description>
@@ -75,7 +75,7 @@ import org.apache.logging.log4j.status.StatusLogger;
* <env-entry-type>java.lang.String</env-entry-type>
* </env-entry>
* </pre>
- *
+ *
* </blockquote>
*
* <p>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/time/MutableInstant.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/time/MutableInstant.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/time/MutableInstant.java
index 0c7f451..2e49a96 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/time/MutableInstant.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/time/MutableInstant.java
@@ -54,14 +54,14 @@ public class MutableInstant implements Instant, Serializable {
@Override
public long getEpochMillisecond() {
final int millis = nanoOfSecond / NANOS_PER_MILLI;
- final long epochMillisecond = epochSecond * MILLIS_PER_SECOND + millis;
+ long epochMillisecond = epochSecond * MILLIS_PER_SECOND + millis;
return epochMillisecond;
}
@Override
public int getNanoOfMillisecond() {
final int millis = nanoOfSecond / NANOS_PER_MILLI;
- final int nanoOfMillisecond = nanoOfSecond - (millis * NANOS_PER_MILLI); // cheaper than nanoOfSecond % NANOS_PER_MILLI
+ int nanoOfMillisecond = nanoOfSecond - (millis * NANOS_PER_MILLI); // cheaper than nanoOfSecond % NANOS_PER_MILLI
return nanoOfMillisecond;
}
@@ -121,7 +121,7 @@ public class MutableInstant implements Instant, Serializable {
* the second element is the number of nanoseconds, later along the time-line, from the start of the millisecond
*/
public static void instantToMillisAndNanos(final long epochSecond, final int nano, final long[] result) {
- final int millis = nano / NANOS_PER_MILLI;
+ int millis = nano / NANOS_PER_MILLI;
result[0] = epochSecond * MILLIS_PER_SECOND + millis;
result[1] = nano - (millis * NANOS_PER_MILLI); // cheaper than nanoOfSecond % NANOS_PER_MILLI
}
@@ -134,7 +134,7 @@ public class MutableInstant implements Instant, Serializable {
if (!(object instanceof MutableInstant)) {
return false;
}
- final MutableInstant other = (MutableInstant) object;
+ MutableInstant other = (MutableInstant) object;
return epochSecond == other.epochSecond && nanoOfSecond == other.nanoOfSecond;
}
[03/13] logging-log4j2 git commit: Revert "Use final. Remove trailing
spaces."
Posted by gg...@apache.org.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerThreadContextTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerThreadContextTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerThreadContextTest.java
index 76bf257..0b5ff64 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerThreadContextTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerThreadContextTest.java
@@ -56,10 +56,10 @@ public class AsyncLoggerThreadContextTest {
final File file = new File("target", "AsyncLoggerTest.log");
// System.out.println(f.getAbsolutePath());
file.delete();
-
+
ThreadContext.push("stackvalue");
ThreadContext.put("KEY", "mapvalue");
-
+
final Logger log = LogManager.getLogger("com.foo.Bar");
final String msg = "Async logger msg";
log.info(msg, new InternalError("this is not a real error"));
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerUseAfterShutdownTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerUseAfterShutdownTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerUseAfterShutdownTest.java
index f553137..2e4ab33 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerUseAfterShutdownTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerUseAfterShutdownTest.java
@@ -57,7 +57,7 @@ public class AsyncLoggerUseAfterShutdownTest {
log.info(msg, new InternalError("this is not a real error"));
CoreLoggerContexts.stopLoggerContext(); // stop async thread
- // call the #logMessage() method to bypass the isEnabled check:
+ // call the #logMessage() method to bypass the isEnabled check:
// before the LOG4J2-639 fix this would throw a NPE
((AbstractLogger) log).logMessage("com.foo.Bar", Level.INFO, null, new SimpleMessage("msg"), null);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/async/BlockingAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/BlockingAppender.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/BlockingAppender.java
index c8e5ecd..6c8423f 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/BlockingAppender.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/BlockingAppender.java
@@ -64,7 +64,7 @@ public class BlockingAppender extends AbstractAppender {
// block until the test class tells us to continue
try {
countDownLatch.await();
- } catch (final InterruptedException e) {
+ } catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/async/QueueFullAbstractTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/QueueFullAbstractTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/QueueFullAbstractTest.java
index 187a08f..d0542dc 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/QueueFullAbstractTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/QueueFullAbstractTest.java
@@ -40,7 +40,7 @@ public abstract class QueueFullAbstractTest {
protected BlockingAppender blockingAppender;
protected Unlocker unlocker;
- protected static void TRACE(final Object msg) {
+ protected static void TRACE(Object msg) {
if (TRACE) {
System.out.println(msg);
}
@@ -48,7 +48,7 @@ public abstract class QueueFullAbstractTest {
class Unlocker extends Thread {
final CountDownLatch countDownLatch;
- Unlocker(final CountDownLatch countDownLatch) {
+ Unlocker(CountDownLatch countDownLatch) {
this.countDownLatch = countDownLatch;
}
@Override
@@ -57,7 +57,7 @@ public abstract class QueueFullAbstractTest {
countDownLatch.await();
TRACE("Unlocker activated. Sleeping 500 millis before taking action...");
Thread.sleep(500);
- } catch (final InterruptedException e) {
+ } catch (InterruptedException e) {
throw new RuntimeException(e);
}
TRACE("Unlocker signalling BlockingAppender to proceed...");
@@ -66,9 +66,9 @@ public abstract class QueueFullAbstractTest {
}
class DomainObject {
- private final Logger innerLogger = LogManager.getLogger(DomainObject.class);
+ private Logger innerLogger = LogManager.getLogger(DomainObject.class);
final int count;
- DomainObject(final int loggingCount) {
+ DomainObject(int loggingCount) {
this.count = loggingCount;
}
@@ -86,34 +86,34 @@ public abstract class QueueFullAbstractTest {
static Stack transform(final List<LogEvent> logEvents) {
final List<String> filtered = new ArrayList<>(logEvents.size());
- for (final LogEvent event : logEvents) {
+ for (LogEvent event : logEvents) {
filtered.add(event.getMessage().getFormattedMessage());
}
Collections.reverse(filtered);
- final Stack<String> result = new Stack<>();
+ Stack<String> result = new Stack<>();
result.addAll(filtered);
return result;
}
- static long asyncRemainingCapacity(final Logger logger) {
+ static long asyncRemainingCapacity(Logger logger) {
if (logger instanceof AsyncLogger) {
try {
- final Field f = field(AsyncLogger.class, "loggerDisruptor");
+ Field f = field(AsyncLogger.class, "loggerDisruptor");
return ((AsyncLoggerDisruptor) f.get(logger)).getDisruptor().getRingBuffer().remainingCapacity();
- } catch (final Exception ex) {
+ } catch (Exception ex) {
throw new RuntimeException(ex);
}
} else {
- final LoggerConfig loggerConfig = ((org.apache.logging.log4j.core.Logger) logger).get();
+ LoggerConfig loggerConfig = ((org.apache.logging.log4j.core.Logger) logger).get();
if (loggerConfig instanceof AsyncLoggerConfig) {
try {
- final Object delegate = field(AsyncLoggerConfig.class, "delegate").get(loggerConfig);
+ Object delegate = field(AsyncLoggerConfig.class, "delegate").get(loggerConfig);
return ((Disruptor) field(AsyncLoggerConfigDisruptor.class, "disruptor").get(delegate)).getRingBuffer().remainingCapacity();
- } catch (final Exception ex) {
+ } catch (Exception ex) {
throw new RuntimeException(ex);
}
} else {
- final Appender async = loggerConfig.getAppenders().get("async");
+ Appender async = loggerConfig.getAppenders().get("async");
if (async instanceof AsyncAppender) {
return ((AsyncAppender) async).getQueueCapacity();
}
@@ -121,8 +121,8 @@ public abstract class QueueFullAbstractTest {
}
throw new IllegalStateException("Neither Async Loggers nor AsyncAppender are configured");
}
- private static Field field(final Class<?> c, final String name) throws NoSuchFieldException {
- final Field f = c.getDeclaredField(name);
+ private static Field field(Class<?> c, String name) throws NoSuchFieldException {
+ Field f = c.getDeclaredField(name);
f.setAccessible(true);
return f;
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/async/QueueFullAsyncLoggerConfigLoggingFromToStringTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/QueueFullAsyncLoggerConfigLoggingFromToStringTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/QueueFullAsyncLoggerConfigLoggingFromToStringTest.java
index d11c2ff..307a93d 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/QueueFullAsyncLoggerConfigLoggingFromToStringTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/QueueFullAsyncLoggerConfigLoggingFromToStringTest.java
@@ -94,10 +94,10 @@ public class QueueFullAsyncLoggerConfigLoggingFromToStringTest extends QueueFull
final Stack<String> actual = transform(blockingAppender.logEvents);
assertEquals("Logging in toString() #0", actual.pop());
- final List<StatusData> statusDataList = StatusLogger.getLogger().getStatusData();
+ List<StatusData> statusDataList = StatusLogger.getLogger().getStatusData();
assertEquals("Jumped the queue: queue full",
"Logging in toString() #128", actual.pop());
- final StatusData mostRecentStatusData = statusDataList.get(statusDataList.size() - 1);
+ StatusData mostRecentStatusData = statusDataList.get(statusDataList.size() - 1);
assertEquals("Expected warn level status message", Level.WARN, mostRecentStatusData.getLevel());
assertThat(mostRecentStatusData.getFormattedStatus(), containsString(
"Log4j2 logged an event out of order to prevent deadlock caused by domain " +
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/async/RingBufferLogEventTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/RingBufferLogEventTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/RingBufferLogEventTest.java
index 02a1f8a..099d660 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/RingBufferLogEventTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/RingBufferLogEventTest.java
@@ -58,7 +58,7 @@ public class RingBufferLogEventTest {
final LogEvent logEvent = new RingBufferLogEvent();
Assert.assertNotSame(logEvent, logEvent.toImmutable());
}
-
+
@Test
public void testGetLevelReturnsOffIfNullLevelSet() {
final RingBufferLogEvent evt = new RingBufferLogEvent();
@@ -192,8 +192,8 @@ public class RingBufferLogEventTest {
final Marker marker = MarkerManager.getMarker("marked man");
final String fqcn = "f.q.c.n";
final Level level = Level.TRACE;
- final ReusableMessageFactory factory = new ReusableMessageFactory();
- final Message message = factory.newMessage("Hello {}!", "World");
+ ReusableMessageFactory factory = new ReusableMessageFactory();
+ Message message = factory.newMessage("Hello {}!", "World");
try {
final Throwable t = new InternalError("not a real error");
final ContextStack contextStack = new MutableThreadContextStack(Arrays.asList("a", "b"));
@@ -221,8 +221,8 @@ public class RingBufferLogEventTest {
final Marker marker = MarkerManager.getMarker("marked man");
final String fqcn = "f.q.c.n";
final Level level = Level.TRACE;
- final ReusableMessageFactory factory = new ReusableMessageFactory();
- final Message message = factory.newMessage("Hello {}!", "World");
+ ReusableMessageFactory factory = new ReusableMessageFactory();
+ Message message = factory.newMessage("Hello {}!", "World");
try {
final Throwable t = new InternalError("not a real error");
final ContextStack contextStack = new MutableThreadContextStack(Arrays.asList("a", "b"));
@@ -255,7 +255,7 @@ public class RingBufferLogEventTest {
final RingBufferLogEvent evt = new RingBufferLogEvent();
evt.forEachParameter(new ParameterConsumer<Void>() {
@Override
- public void accept(final Object parameter, final int parameterIndex, final Void state) {
+ public void accept(Object parameter, int parameterIndex, Void state) {
fail("Should not have been called");
}
}, null);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/Histogram.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/Histogram.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/Histogram.java
index 39cde5f..bf0823b 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/Histogram.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/Histogram.java
@@ -130,7 +130,7 @@ public final class Histogram
// do a classic binary search to find the high value
while (low < high)
{
- final int mid = low + ((high - low) >> 1);
+ int mid = low + ((high - low) >> 1);
if (upperBounds[mid] < value)
{
low = mid + 1;
@@ -287,10 +287,10 @@ public final class Histogram
{
if (0L != counts[i])
{
- final long upperBound = Math.min(upperBounds[i], maxValue);
- final long midPoint = lowerBound + ((upperBound - lowerBound) / 2L);
+ long upperBound = Math.min(upperBounds[i], maxValue);
+ long midPoint = lowerBound + ((upperBound - lowerBound) / 2L);
- final BigDecimal intervalTotal = new BigDecimal(midPoint).multiply(new BigDecimal(counts[i]));
+ BigDecimal intervalTotal = new BigDecimal(midPoint).multiply(new BigDecimal(counts[i]));
total = total.add(intervalTotal);
}
@@ -360,7 +360,7 @@ public final class Histogram
@Override
public String toString()
{
- final StringBuilder sb = new StringBuilder();
+ StringBuilder sb = new StringBuilder();
sb.append("Histogram{");
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestDriver.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestDriver.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestDriver.java
index e9934fc..2be6499 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestDriver.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestDriver.java
@@ -206,10 +206,10 @@ public class PerfTestDriver {
public static void main(final String[] args) throws Exception {
final long start = System.nanoTime();
-
+
final List<Setup> tests = selectTests();
runPerfTests(args, tests);
-
+
System.out.printf("Done. Total duration: %.1f minutes%n", (System.nanoTime() - start)
/ (60.0 * 1000.0 * 1000.0 * 1000.0));
@@ -218,7 +218,7 @@ public class PerfTestDriver {
private static List<Setup> selectTests() throws IOException {
final List<Setup> tests = new ArrayList<>();
-
+
// final String CACHEDCLOCK = "-Dlog4j.Clock=CachedClock";
final String SYSCLOCK = "-Dlog4j.Clock=SystemClock";
final String ALL_ASYNC = "-DLog4jContextSelector=" + AsyncLoggerContextSelector.class.getName();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/config/CompositeConfigurationTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/CompositeConfigurationTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/CompositeConfigurationTest.java
index 2eb61b2..cb7b497 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/CompositeConfigurationTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/CompositeConfigurationTest.java
@@ -96,7 +96,7 @@ public class CompositeConfigurationTest {
appendersMap.size());
assertTrue(appendersMap.get("STDOUT") instanceof ConsoleAppender);
- final Filter loggerFilter = config.getLogger("cat1").getFilter();
+ Filter loggerFilter = config.getLogger("cat1").getFilter();
assertTrue(loggerFilter instanceof RegexFilter);
assertEquals(loggerFilter.getOnMatch(), Filter.Result.DENY);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java
index a7cfe17..a9b48e7 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java
@@ -111,13 +111,13 @@ public class ConfigurationTest {
final Configuration config = this.ctx.getConfiguration();
assertEquals(config.getRootLogger(), config.getLoggerConfig(Strings.EMPTY));
}
-
+
@Test(expected = NullPointerException.class)
public void testGetLoggerConfigNull() throws Exception {
final Configuration config = this.ctx.getConfiguration();
assertEquals(config.getRootLogger(), config.getLoggerConfig(null));
}
-
+
@Test
public void testLogger() throws Exception {
final Logger logger = this.ctx.getLogger(LOGGER_NAME);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/config/JiraLog4j2_2134Test.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/JiraLog4j2_2134Test.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/JiraLog4j2_2134Test.java
index 67217f6..b94a5a9 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/JiraLog4j2_2134Test.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/JiraLog4j2_2134Test.java
@@ -38,23 +38,23 @@ public class JiraLog4j2_2134Test {
@Test
public void testRefresh() {
- final Logger log = LogManager.getLogger(this.getClass());
+ Logger log = LogManager.getLogger(this.getClass());
final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
final Configuration config = ctx.getConfiguration();
- final PatternLayout layout = PatternLayout.newBuilder()
+ PatternLayout layout = PatternLayout.newBuilder()
// @formatter:off
.withPattern(PatternLayout.SIMPLE_CONVERSION_PATTERN)
.withConfiguration(config)
.build();
final Layout<? extends Serializable> layout1 = layout;
// @formatter:on
- final Appender appender = FileAppender.newBuilder().withFileName("target/test.log").setLayout(layout1)
+ Appender appender = FileAppender.newBuilder().withFileName("target/test.log").setLayout(layout1)
.setConfiguration(config).withBufferSize(4000).setName("File").build();
// appender.start();
config.addAppender(appender);
- final AppenderRef ref = AppenderRef.createAppenderRef("File", null, null);
- final AppenderRef[] refs = new AppenderRef[] { ref };
- final LoggerConfig loggerConfig = LoggerConfig.createLogger(false, Level.INFO, "testlog4j2refresh", "true", refs,
+ AppenderRef ref = AppenderRef.createAppenderRef("File", null, null);
+ AppenderRef[] refs = new AppenderRef[] { ref };
+ LoggerConfig loggerConfig = LoggerConfig.createLogger(false, Level.INFO, "testlog4j2refresh", "true", refs,
null, config, null);
loggerConfig.addAppender(appender, null, null);
config.addLogger("testlog4j2refresh", loggerConfig);
@@ -66,7 +66,7 @@ public class JiraLog4j2_2134Test {
@Test
public void testRefreshMinimalCodeStart() {
- final Logger log = LogManager.getLogger(this.getClass());
+ Logger log = LogManager.getLogger(this.getClass());
final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
final Configuration config = ctx.getConfiguration();
ctx.start(config);
@@ -76,7 +76,7 @@ public class JiraLog4j2_2134Test {
@Test
public void testRefreshMinimalCodeStopStart() {
- final Logger log = LogManager.getLogger(this.getClass());
+ Logger log = LogManager.getLogger(this.getClass());
final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
ctx.stop();
ctx.start();
@@ -86,7 +86,7 @@ public class JiraLog4j2_2134Test {
@Test
public void testRefreshMinimalCodeStopStartConfig() {
- final Logger log = LogManager.getLogger(this.getClass());
+ Logger log = LogManager.getLogger(this.getClass());
final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
final Configuration config = ctx.getConfiguration();
ctx.stop();
@@ -98,18 +98,18 @@ public class JiraLog4j2_2134Test {
@SuppressWarnings("deprecation")
@Test
public void testRefreshDeprecatedApis() {
- final Logger log = LogManager.getLogger(this.getClass());
+ Logger log = LogManager.getLogger(this.getClass());
final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
final Configuration config = ctx.getConfiguration();
- final PatternLayout layout = PatternLayout.createLayout(PatternLayout.SIMPLE_CONVERSION_PATTERN, null, config, null,
+ PatternLayout layout = PatternLayout.createLayout(PatternLayout.SIMPLE_CONVERSION_PATTERN, null, config, null,
null, false, false, null, null);
- final Appender appender = FileAppender.createAppender("target/test.log", "false", "false", "File", "true", "false",
+ Appender appender = FileAppender.createAppender("target/test.log", "false", "false", "File", "true", "false",
"false", "4000", layout, null, "false", null, config);
appender.start();
config.addAppender(appender);
- final AppenderRef ref = AppenderRef.createAppenderRef("File", null, null);
- final AppenderRef[] refs = new AppenderRef[] { ref };
- final LoggerConfig loggerConfig = LoggerConfig.createLogger("false", Level.INFO, "testlog4j2refresh", "true", refs,
+ AppenderRef ref = AppenderRef.createAppenderRef("File", null, null);
+ AppenderRef[] refs = new AppenderRef[] { ref };
+ LoggerConfig loggerConfig = LoggerConfig.createLogger("false", Level.INFO, "testlog4j2refresh", "true", refs,
null, config, null);
loggerConfig.addAppender(appender, null, null);
config.addLogger("testlog4j2refresh", loggerConfig);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/config/LoggerConfigTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/LoggerConfigTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/LoggerConfigTest.java
index ab4acdb..a7cceff 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/LoggerConfigTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/LoggerConfigTest.java
@@ -79,7 +79,7 @@ public class LoggerConfigTest {
};
final LoggerConfig loggerConfig = createForProperties(all);
final List<Property> list = loggerConfig.getPropertyList();
- assertEquals("map and list contents equal", new HashSet<>(list),
+ assertEquals("map and list contents equal", new HashSet<>(list),
new HashSet<>(loggerConfig.getPropertyList()));
final Object[] actualListHolder = new Object[1];
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/config/NestedLoggerConfigTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/NestedLoggerConfigTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/NestedLoggerConfigTest.java
index 3f39648..bbc9837 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/NestedLoggerConfigTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/NestedLoggerConfigTest.java
@@ -18,17 +18,28 @@ package org.apache.logging.log4j.core.config;
import com.google.common.collect.ImmutableList;
import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.Marker;
+import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.xml.XmlConfiguration;
+import org.apache.logging.log4j.core.impl.Log4jLogEvent.Builder;
+import org.apache.logging.log4j.core.impl.LogEventFactory;
+import org.apache.logging.log4j.message.Message;
+import org.apache.logging.log4j.message.SimpleMessage;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.file.Path;
+import java.util.HashSet;
import java.util.List;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
/**
* Tests for LoggerConfig hierarchies.
@@ -43,13 +54,13 @@ public class NestedLoggerConfigTest {
private final String prefix;
- public NestedLoggerConfigTest(final String prefix) {
+ public NestedLoggerConfigTest(String prefix) {
this.prefix = prefix;
}
@Test
public void testInheritParentDefaultLevel() throws IOException {
- final Configuration configuration = loadConfiguration(prefix + "default-level.xml");
+ Configuration configuration = loadConfiguration(prefix + "default-level.xml");
try {
assertEquals(Level.ERROR, configuration.getLoggerConfig("com.foo").getLevel());
} finally {
@@ -59,7 +70,7 @@ public class NestedLoggerConfigTest {
@Test
public void testInheritParentLevel() throws IOException {
- final Configuration configuration = loadConfiguration(prefix + "inherit-level.xml");
+ Configuration configuration = loadConfiguration(prefix + "inherit-level.xml");
try {
assertEquals(Level.TRACE, configuration.getLoggerConfig("com.foo").getLevel());
} finally {
@@ -67,10 +78,10 @@ public class NestedLoggerConfigTest {
}
}
- private Configuration loadConfiguration(final String resourcePath) throws IOException {
- final InputStream in = getClass().getClassLoader().getResourceAsStream(resourcePath);
+ private Configuration loadConfiguration(String resourcePath) throws IOException {
+ InputStream in = getClass().getClassLoader().getResourceAsStream(resourcePath);
try {
- final Configuration configuration = new XmlConfiguration(new LoggerContext("test"), new ConfigurationSource(in));
+ Configuration configuration = new XmlConfiguration(new LoggerContext("test"), new ConfigurationSource(in));
configuration.initialize();
configuration.start();
return configuration;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtilCustomProtocolTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtilCustomProtocolTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtilCustomProtocolTest.java
index ed2db6e..33e0ee1 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtilCustomProtocolTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtilCustomProtocolTest.java
@@ -47,7 +47,7 @@ public class ResolverUtilCustomProtocolTest {
@Rule
public RuleChain chain = RuleChain.outerRule(new CleanFolders(ResolverUtilTest.WORK_DIR));
-
+
static class NoopURLStreamHandlerFactory implements URLStreamHandlerFactory {
@Override
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtilTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtilTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtilTest.java
index a9de08a..1c6371b 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtilTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtilTest.java
@@ -51,7 +51,7 @@ public class ResolverUtilTest {
@Rule
public RuleChain chain = RuleChain.outerRule(new CleanFolders(WORK_DIR));
-
+
@Test
public void testExtractPathFromJarUrl() throws Exception {
final URL url = new URL("jar:file:/C:/Users/me/.m2/repository/junit/junit/4.11/junit-4.11.jar!/org/junit/Test.class");
@@ -193,29 +193,29 @@ public class ResolverUtilTest {
if (!parent.exists()) {
assertTrue("Create customplugin" + suffix + " folder KO", f.getParentFile().mkdirs());
}
-
+
final String content = new String(Files.readAllBytes(orig.toPath()))
.replaceAll("FixedString", "FixedString" + suffix)
.replaceAll("customplugin", "customplugin" + suffix);
Files.write(f.toPath(), content.getBytes());
-
+
PluginManagerPackagesTest.compile(f);
return workDir;
}
static void createJar(final URI jarURI, final File workDir, final File f) throws Exception {
- final Map<String, String> env = new HashMap<>();
+ final Map<String, String> env = new HashMap<>();
env.put("create", "true");
final URI uri = URI.create("jar:file://" + jarURI.getRawPath());
- try (FileSystem zipfs = FileSystems.newFileSystem(uri, env)) {
+ try (FileSystem zipfs = FileSystems.newFileSystem(uri, env)) {
final Path path = zipfs.getPath(workDir.toPath().relativize(f.toPath()).toString());
if (path.getParent() != null) {
Files.createDirectories(path.getParent());
}
Files.copy(f.toPath(),
- path,
- StandardCopyOption.REPLACE_EXISTING );
- }
+ path,
+ StandardCopyOption.REPLACE_EXISTING );
+ }
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/validation/validators/ValidatingPluginWithTypedBuilderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/validation/validators/ValidatingPluginWithTypedBuilderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/validation/validators/ValidatingPluginWithTypedBuilderTest.java
index 2b0ebd1..ae236b4 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/validation/validators/ValidatingPluginWithTypedBuilderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/validation/validators/ValidatingPluginWithTypedBuilderTest.java
@@ -48,7 +48,7 @@ public class ValidatingPluginWithTypedBuilderTest {
@Test
public void testNullDefaultValue() throws Exception {
// @formatter:off
- final ValidatingPluginWithTypedBuilder validatingPlugin = (ValidatingPluginWithTypedBuilder)
+ final ValidatingPluginWithTypedBuilder validatingPlugin = (ValidatingPluginWithTypedBuilder)
new PluginBuilder(plugin).
withConfiguration(new NullConfiguration()).
withConfigurationNode(node).build();
@@ -60,7 +60,7 @@ public class ValidatingPluginWithTypedBuilderTest {
public void testNonNullValue() throws Exception {
node.getAttributes().put("name", "foo");
// @formatter:off
- final ValidatingPluginWithTypedBuilder validatingPlugin = (ValidatingPluginWithTypedBuilder)
+ final ValidatingPluginWithTypedBuilder validatingPlugin = (ValidatingPluginWithTypedBuilder)
new PluginBuilder(plugin).
withConfiguration(new NullConfiguration()).
withConfigurationNode(node).build();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilterTest.java
index fce48e5..0488d0f 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilterTest.java
@@ -45,8 +45,8 @@ import org.junit.Test;
public class DynamicThresholdFilterTest {
@Rule
- public final ThreadContextMapRule threadContextRule = new ThreadContextMapRule();
-
+ public final ThreadContextMapRule threadContextRule = new ThreadContextMapRule();
+
@After
public void cleanup() {
final LoggerContext ctx = LoggerContext.getContext(false);
@@ -88,11 +88,11 @@ public class DynamicThresholdFilterTest {
filter.start();
assertTrue(filter.isStarted());
final Object [] replacements = {"one", "two", "three"};
- assertSame(Filter.Result.ACCEPT, filter.filter(null, Level.DEBUG, null, "some test message", replacements));
- assertSame(Filter.Result.ACCEPT, filter.filter(null, Level.DEBUG, null, "some test message", "one", "two", "three"));
+ assertSame(Filter.Result.ACCEPT, filter.filter(null, Level.DEBUG, null, "some test message", replacements));
+ assertSame(Filter.Result.ACCEPT, filter.filter(null, Level.DEBUG, null, "some test message", "one", "two", "three"));
ThreadContext.clearMap();
}
-
+
@Test
public void testConfig() {
try (final LoggerContext ctx = Configurator.initialize("Test1",
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/LevelRangeFilterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/LevelRangeFilterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/LevelRangeFilterTest.java
index 336d3ce..b99c6a9 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/LevelRangeFilterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/LevelRangeFilterTest.java
@@ -56,5 +56,5 @@ public class LevelRangeFilterTest {
assertTrue(filter.isStarted());
assertSame(Filter.Result.NEUTRAL, filter.filter(null, Level.ERROR, null, (Object) null, (Throwable) null));
}
-
+
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/FactoryTestStringMap.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/FactoryTestStringMap.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/FactoryTestStringMap.java
index aacdf2d..47872fa 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/FactoryTestStringMap.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/FactoryTestStringMap.java
@@ -63,7 +63,7 @@ public class FactoryTestStringMap implements IndexedStringMap {
}
@Override
- public String getKeyAt(final int index) {
+ public String getKeyAt(int index) {
return null;
}
@@ -73,12 +73,12 @@ public class FactoryTestStringMap implements IndexedStringMap {
}
@Override
- public <V> V getValueAt(final int index) {
+ public <V> V getValueAt(int index) {
return null;
}
@Override
- public int indexOfKey(final String key) {
+ public int indexOfKey(String key) {
return 0;
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/Log4jLogEventNanoTimeTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/Log4jLogEventNanoTimeTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/Log4jLogEventNanoTimeTest.java
index caae76b..93d60c4 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/Log4jLogEventNanoTimeTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/Log4jLogEventNanoTimeTest.java
@@ -62,7 +62,7 @@ public class Log4jLogEventNanoTimeTest {
Log4jLogEvent.setNanoClock(new DummyNanoClock(DUMMYNANOTIME));
log.info("Use dummy nano clock");
assertTrue("using SystemNanoClock", Log4jLogEvent.getNanoClock() instanceof DummyNanoClock);
-
+
CoreLoggerContexts.stopLoggerContext(file); // stop async thread
String line1;
@@ -82,7 +82,7 @@ public class Log4jLogEventNanoTimeTest {
assertEquals(line1Parts[0], line1Parts[1]);
final long loggedNanoTime = Long.parseLong(line1Parts[0]);
assertTrue("used system nano time", loggedNanoTime - before < TimeUnit.SECONDS.toNanos(1));
-
+
final String[] line2Parts = line2.split(" AND ");
assertEquals("Use dummy nano clock", line2Parts[2]);
assertEquals(String.valueOf(DUMMYNANOTIME), line2Parts[0]);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/MutableLogEventTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/MutableLogEventTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/MutableLogEventTest.java
index 033cc9d..273502a 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/MutableLogEventTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/MutableLogEventTest.java
@@ -63,7 +63,7 @@ public class MutableLogEventTest {
try {
Class.forName("java.io.ObjectInputFilter");
useObjectInputStream = true;
- } catch (final ClassNotFoundException ex) {
+ } catch (ClassNotFoundException ex) {
// Ignore the exception
}
}
@@ -116,7 +116,7 @@ public class MutableLogEventTest {
@Test
public void testInitFromReusableCopiesFormatString() {
- final Message message = ReusableMessageFactory.INSTANCE.newMessage("msg in a {}", "bottle");
+ Message message = ReusableMessageFactory.INSTANCE.newMessage("msg in a {}", "bottle");
final Log4jLogEvent source = Log4jLogEvent.newBuilder() //
.setContextData(CONTEXT_DATA) //
.setContextStack(STACK) //
@@ -138,17 +138,17 @@ public class MutableLogEventTest {
assertEquals("format", "msg in a {}", mutable.getFormat());
assertEquals("formatted", "msg in a bottle", mutable.getFormattedMessage());
assertEquals("parameters", new String[] {"bottle"}, mutable.getParameters());
- final Message memento = mutable.memento();
+ Message memento = mutable.memento();
assertEquals("format", "msg in a {}", memento.getFormat());
assertEquals("formatted", "msg in a bottle", memento.getFormattedMessage());
assertEquals("parameters", new String[] {"bottle"}, memento.getParameters());
- final Message eventMementoMessage = mutable.createMemento().getMessage();
+ Message eventMementoMessage = mutable.createMemento().getMessage();
assertEquals("format", "msg in a {}", eventMementoMessage.getFormat());
assertEquals("formatted", "msg in a bottle", eventMementoMessage.getFormattedMessage());
assertEquals("parameters", new String[] {"bottle"}, eventMementoMessage.getParameters());
- final Message log4JLogEventMessage = new Log4jLogEvent.Builder(mutable).build().getMessage();
+ Message log4JLogEventMessage = new Log4jLogEvent.Builder(mutable).build().getMessage();
assertEquals("format", "msg in a {}", log4JLogEventMessage.getFormat());
assertEquals("formatted", "msg in a bottle", log4JLogEventMessage.getFormattedMessage());
assertEquals("parameters", new String[] {"bottle"}, log4JLogEventMessage.getParameters());
@@ -156,8 +156,8 @@ public class MutableLogEventTest {
@Test
public void testInitFromReusableObjectCopiesParameter() {
- final Object param = new Object();
- final Message message = ReusableMessageFactory.INSTANCE.newMessage(param);
+ Object param = new Object();
+ Message message = ReusableMessageFactory.INSTANCE.newMessage(param);
final Log4jLogEvent source = Log4jLogEvent.newBuilder()
.setContextData(CONTEXT_DATA)
.setContextStack(STACK)
@@ -180,7 +180,7 @@ public class MutableLogEventTest {
assertNull("format", mutable.getFormat());
assertEquals("formatted", param.toString(), mutable.getFormattedMessage());
assertEquals("parameters", new Object[] {param}, mutable.getParameters());
- final Message memento = mutable.memento();
+ Message memento = mutable.memento();
assertNull("format", memento.getFormat());
assertEquals("formatted", param.toString(), memento.getFormattedMessage());
assertEquals("parameters", new Object[] {param}, memento.getParameters());
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/NestedLoggingFromThrowableMessageTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/NestedLoggingFromThrowableMessageTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/NestedLoggingFromThrowableMessageTest.java
index 2f1bc04..912f1a8 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/NestedLoggingFromThrowableMessageTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/NestedLoggingFromThrowableMessageTest.java
@@ -76,8 +76,8 @@ public class NestedLoggingFromThrowableMessageTest {
CoreLoggerContexts.stopLoggerContext(false, file1);
CoreLoggerContexts.stopLoggerContext(false, file2);
- final Set<String> lines1 = readUniqueLines(file1);
- final Set<String> lines2 = readUniqueLines(file2);
+ Set<String> lines1 = readUniqueLines(file1);
+ Set<String> lines2 = readUniqueLines(file2);
assertEquals("Expected the same data from both appenders", lines1, lines2);
assertEquals(2, lines1.size());
@@ -85,9 +85,9 @@ public class NestedLoggingFromThrowableMessageTest {
assertTrue(lines1.contains("ERROR NestedLoggingFromThrowableMessageTest Test message"));
}
- private static Set<String> readUniqueLines(final File input) throws IOException {
- final Set<String> lines = new HashSet<>();
- final BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(input)));
+ private static Set<String> readUniqueLines(File input) throws IOException {
+ Set<String> lines = new HashSet<>();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(input)));
try {
String line;
while ((line = reader.readLine()) != null) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/NestedLoggingFromToStringTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/NestedLoggingFromToStringTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/NestedLoggingFromToStringTest.java
index e95e308..d0c35cb 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/NestedLoggingFromToStringTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/NestedLoggingFromToStringTest.java
@@ -50,7 +50,7 @@ public class NestedLoggingFromToStringTest {
public static void beforeClass() {
System.setProperty("log4j2.is.webapp", "false");
}
-
+
@Rule
public LoggerContextRule context = new LoggerContextRule("log4j-sync-to-list.xml");
private ListAppender listAppender;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThreadContextDataInjectorTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThreadContextDataInjectorTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThreadContextDataInjectorTest.java
index 2f913f7..f553d3a 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThreadContextDataInjectorTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThreadContextDataInjectorTest.java
@@ -78,13 +78,13 @@ public class ThreadContextDataInjectorTest {
}
private void testContextDataInjector() {
- final ReadOnlyThreadContextMap readOnlythreadContextMap = getThreadContextMap();
+ ReadOnlyThreadContextMap readOnlythreadContextMap = getThreadContextMap();
assertThat("thread context map class name",
(readOnlythreadContextMap == null) ? null : readOnlythreadContextMap.getClass().getName(),
is(equalTo(readOnlythreadContextMapClassName)));
- final ContextDataInjector contextDataInjector = createInjector();
- final StringMap stringMap = contextDataInjector.injectContextData(null, new SortedArrayStringMap());
+ ContextDataInjector contextDataInjector = createInjector();
+ StringMap stringMap = contextDataInjector.injectContextData(null, new SortedArrayStringMap());
assertThat("thread context map", ThreadContext.getContext(), allOf(hasEntry("foo", "bar"), not(hasKey("baz"))));
assertThat("context map", stringMap.toMap(), allOf(hasEntry("foo", "bar"), not(hasKey("baz"))));
@@ -106,7 +106,7 @@ public class ThreadContextDataInjectorTest {
}
}
- private void prepareThreadContext(final boolean isThreadContextMapInheritable) {
+ private void prepareThreadContext(boolean isThreadContextMapInheritable) {
System.setProperty("log4j2.isThreadContextMapInheritable", Boolean.toString(isThreadContextMapInheritable));
PropertiesUtil.getProperties().reload();
ThreadContextTest.reinitThreadContext();
@@ -130,7 +130,7 @@ public class ThreadContextDataInjectorTest {
testContextDataInjector();
}
}).get();
- } catch (final ExecutionException ee) {
+ } catch (ExecutionException ee) {
throw ee.getCause();
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptionsTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptionsTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptionsTest.java
index be2fd7f..d099da1 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptionsTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptionsTest.java
@@ -37,7 +37,7 @@ public final class ThrowableFormatOptionsTest {
/**
* Runs a given test comparing against the expected values.
- *
+ *
* @param options
* The list of options to parse.
* @param expectedLines
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/jmx/ServerTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/jmx/ServerTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/jmx/ServerTest.java
index 57c8910..2533869 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/jmx/ServerTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/jmx/ServerTest.java
@@ -33,7 +33,7 @@ public class ServerTest {
final String ctx = "WebAppClassLoader=1320771902@4eb9613e"; // LOG4J2-492
final String ctxName = Server.escape(ctx);
assertEquals("\"WebAppClassLoader=1320771902@4eb9613e\"", ctxName);
- new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
+ new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
// no MalformedObjectNameException = success
}
@@ -42,7 +42,7 @@ public class ServerTest {
final String ctx = "a,b,c";
final String ctxName = Server.escape(ctx);
assertEquals("\"a,b,c\"", ctxName);
- new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
+ new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
// no MalformedObjectNameException = success
}
@@ -51,7 +51,7 @@ public class ServerTest {
final String ctx = "a:b:c";
final String ctxName = Server.escape(ctx);
assertEquals("\"a:b:c\"", ctxName);
- new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
+ new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
// no MalformedObjectNameException = success
}
@@ -60,7 +60,7 @@ public class ServerTest {
final String ctx = "a?c";
final String ctxName = Server.escape(ctx);
assertEquals("\"a\\?c\"", ctxName);
- new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
+ new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
// no MalformedObjectNameException = success
}
@@ -69,7 +69,7 @@ public class ServerTest {
final String ctx = "a*c";
final String ctxName = Server.escape(ctx);
assertEquals("\"a\\*c\"", ctxName);
- new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
+ new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
// no MalformedObjectNameException = success
}
@@ -78,7 +78,7 @@ public class ServerTest {
final String ctx = "a\\c";
final String ctxName = Server.escape(ctx);
assertEquals("\"a\\\\c\"", ctxName);
- new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
+ new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
// no MalformedObjectNameException = success
}
@@ -87,7 +87,7 @@ public class ServerTest {
final String ctx = "a\"c";
final String ctxName = Server.escape(ctx);
assertEquals("\"a\\\"c\"", ctxName);
- new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
+ new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
// no MalformedObjectNameException = success
}
@@ -96,7 +96,7 @@ public class ServerTest {
final String ctx = "a c";
final String ctxName = Server.escape(ctx);
assertEquals("a c", ctxName);
- new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
+ new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
// no MalformedObjectNameException = success
}
@@ -105,7 +105,7 @@ public class ServerTest {
final String ctx = "a\rc";
final String ctxName = Server.escape(ctx);
assertEquals("ac", ctxName);
- new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
+ new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
// no MalformedObjectNameException = success
}
@@ -114,7 +114,7 @@ public class ServerTest {
final String ctx = "a\nc";
final String ctxName = Server.escape(ctx);
assertEquals("\"a\\nc\"", ctxName);
- new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
+ new ObjectName(String.format(LoggerContextAdminMBean.PATTERN, ctxName));
// no MalformedObjectNameException = success
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/CsvLogEventLayoutTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/CsvLogEventLayoutTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/CsvLogEventLayoutTest.java
index 078ed02..0ee8861 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/CsvLogEventLayoutTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/CsvLogEventLayoutTest.java
@@ -49,7 +49,7 @@ public class CsvLogEventLayoutTest {
static ConfigurationFactory cf = new BasicConfigurationFactory();
@Rule
- public final ThreadContextRule threadContextRule = new ThreadContextRule();
+ public final ThreadContextRule threadContextRule = new ThreadContextRule();
@AfterClass
public static void cleanupClass() {
@@ -127,7 +127,7 @@ public class CsvLogEventLayoutTest {
final String quote = del == ',' ? "\"" : "";
Assert.assertTrue(event0, event0.contains(del + quote + "one=1, two=2, three=3" + quote + del));
Assert.assertTrue(event1, event1.contains(del + "INFO" + del));
-
+
if (hasHeaderSerializer && header == null) {
Assert.fail();
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/GelfLayoutTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/GelfLayoutTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/GelfLayoutTest.java
index e18bceb..095bec6 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/GelfLayoutTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/GelfLayoutTest.java
@@ -45,9 +45,9 @@ import static net.javacrumbs.jsonunit.JsonAssert.assertJsonEquals;
import static org.junit.Assert.assertEquals;
public class GelfLayoutTest {
-
+
static ConfigurationFactory configFactory = new BasicConfigurationFactory();
-
+
private static final String HOSTNAME = "TheHost";
private static final String KEY1 = "Key1";
private static final String KEY2 = "Key2";
@@ -61,7 +61,7 @@ public class GelfLayoutTest {
private static final String VALUE1 = "Value1";
@Rule
- public final ThreadContextRule threadContextRule = new ThreadContextRule();
+ public final ThreadContextRule threadContextRule = new ThreadContextRule();
@AfterClass
public static void cleanupClass() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/HtmlLayoutTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/HtmlLayoutTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/HtmlLayoutTest.java
index 20a8dde..80acb1f 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/HtmlLayoutTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/HtmlLayoutTest.java
@@ -46,7 +46,7 @@ public class HtmlLayoutTest {
static ConfigurationFactory cf = new BasicConfigurationFactory();
@Rule
- public final ThreadContextRule threadContextRule = new ThreadContextRule();
+ public final ThreadContextRule threadContextRule = new ThreadContextRule();
@BeforeClass
public static void setupClass() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/JsonLayoutTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/JsonLayoutTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/JsonLayoutTest.java
index 9dfade0..6eb5c4f 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/JsonLayoutTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/JsonLayoutTest.java
@@ -391,7 +391,7 @@ public class JsonLayoutTest {
.setCharset(StandardCharsets.UTF_8)
.setIncludeStacktrace(true)
.build();
- final Message message = ReusableMessageFactory.INSTANCE.newMessage("Testing {}", new TestObj());
+ Message message = ReusableMessageFactory.INSTANCE.newMessage("Testing {}", new TestObj());
try {
final Log4jLogEvent expected = Log4jLogEvent.newBuilder()
.setLoggerName("a.B")
@@ -400,7 +400,7 @@ public class JsonLayoutTest {
.setMessage(message)
.setThreadName("threadName")
.setTimeMillis(1).build();
- final MutableLogEvent mutableLogEvent = new MutableLogEvent();
+ MutableLogEvent mutableLogEvent = new MutableLogEvent();
mutableLogEvent.initFrom(expected);
final String str = layout.toSerializable(mutableLogEvent);
final String expectedMessage = "Testing " + TestObj.TO_STRING_VALUE;
@@ -426,9 +426,9 @@ public class JsonLayoutTest {
.setCharset(StandardCharsets.UTF_8)
.setIncludeStacktrace(true)
.build();
- final Message message = ReusableMessageFactory.INSTANCE.newMessage("Testing {}", new TestObj());
+ Message message = ReusableMessageFactory.INSTANCE.newMessage("Testing {}", new TestObj());
try {
- final RingBufferLogEvent ringBufferEvent = new RingBufferLogEvent();
+ RingBufferLogEvent ringBufferEvent = new RingBufferLogEvent();
ringBufferEvent.setValues(
null, "a.B", null, "f.q.c.n", Level.DEBUG, message,
null, new SortedArrayStringMap(), ThreadContext.EMPTY_STACK, 1L,
@@ -499,19 +499,19 @@ public class JsonLayoutTest {
// @formatter:off
return layout.toSerializable(expected);
}
-
+
@Test
public void testObjectMessageAsJsonString() {
final String str = prepareJSONForObjectMessageAsJsonObjectTests(1234, false);
assertTrue(str, str.contains("\"message\":\"" + this.getClass().getCanonicalName() + "$TestClass@"));
}
-
+
@Test
public void testObjectMessageAsJsonObject() {
final String str = prepareJSONForObjectMessageAsJsonObjectTests(1234, true);
assertTrue(str, str.contains("\"message\":{\"value\":1234}"));
}
-
+
private String prepareJSONForObjectMessageAsJsonObjectTests(final int value, final boolean objectMessageAsJsonObject) {
final TestClass testClass = new TestClass();
testClass.setValue(value);
@@ -551,11 +551,11 @@ public class JsonLayoutTest {
final String str = layout.toSerializable(LogEventFixtures.createLogEvent());
assertFalse(str.endsWith("\0"));
}
-
+
private String toPropertySeparator(final boolean compact) {
return compact ? ":" : " : ";
}
-
+
private static class TestClass {
private int value;
@@ -563,7 +563,7 @@ public class JsonLayoutTest {
return value;
}
- public void setValue(final int value) {
+ public void setValue(int value) {
this.value = value;
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/Log4j2_1482_Test.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/Log4j2_1482_Test.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/Log4j2_1482_Test.java
index 3c94d58..abd1852 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/Log4j2_1482_Test.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/Log4j2_1482_Test.java
@@ -42,7 +42,7 @@ import org.junit.experimental.categories.Category;
public abstract class Log4j2_1482_Test {
static final String CONFIG_LOCATION = "log4j2-1482.xml";
-
+
static final String FOLDER = "target/log4j2-1482";
private static final int LOOP_COUNT = 10;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/Log4j2_2195_Test.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/Log4j2_2195_Test.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/Log4j2_2195_Test.java
index 5112e5d..958e38a 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/Log4j2_2195_Test.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/Log4j2_2195_Test.java
@@ -41,20 +41,20 @@ public class Log4j2_2195_Test {
@Test
public void test() {
logger.info("This is a test.", new Exception("Test exception!"));
- final ListAppender listAppender = loggerContextRule.getListAppender("ListAppender");
+ ListAppender listAppender = loggerContextRule.getListAppender("ListAppender");
Assert.assertNotNull(listAppender);
- final List<String> events = listAppender.getMessages();
+ List<String> events = listAppender.getMessages();
Assert.assertNotNull(events);
Assert.assertEquals(1, events.size());
- final String logEvent = events.get(0);
+ String logEvent = events.get(0);
Assert.assertNotNull(logEvent);
Assert.assertFalse("\"org.junit\" should not be here", logEvent.contains("org.junit"));
Assert.assertFalse("\"org.eclipse\" should not be here", logEvent.contains("org.eclipse"));
//
- final Layout<? extends Serializable> layout = listAppender.getLayout();
- final PatternLayout pLayout = (PatternLayout) layout;
+ Layout<? extends Serializable> layout = listAppender.getLayout();
+ PatternLayout pLayout = (PatternLayout) layout;
Assert.assertNotNull(pLayout);
- final Serializer eventSerializer = pLayout.getEventSerializer();
+ Serializer eventSerializer = pLayout.getEventSerializer();
Assert.assertNotNull(eventSerializer);
//
Assert.assertTrue("Missing \"|\"", logEvent.contains("|"));
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/Rfc5424LayoutTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/Rfc5424LayoutTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/Rfc5424LayoutTest.java
index 0b9b50d..db70075 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/Rfc5424LayoutTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/Rfc5424LayoutTest.java
@@ -73,7 +73,7 @@ public class Rfc5424LayoutTest {
static ConfigurationFactory cf = new BasicConfigurationFactory();
@Rule
- public final ThreadContextRule threadContextRule = new ThreadContextRule();
+ public final ThreadContextRule threadContextRule = new ThreadContextRule();
@BeforeClass
public static void setupClass() {
@@ -195,15 +195,15 @@ public class Rfc5424LayoutTest {
final StructuredDataMessage msg2 = new StructuredDataMessage("Extra@18060", null, "Audit");
msg2.put("Item1", "Hello");
msg2.put("Item2", "World");
- final List<StructuredDataMessage> messages = new ArrayList<>();
+ List<StructuredDataMessage> messages = new ArrayList<>();
messages.add(msg);
messages.add(msg2);
final StructuredDataCollectionMessage collectionMessage = new StructuredDataCollectionMessage(messages);
root.info(MarkerManager.getMarker("EVENT"), collectionMessage);
- final List<String> list = appender.getMessages();
- final String result = list.get(0);
+ List<String> list = appender.getMessages();
+ String result = list.get(0);
assertTrue("Expected line to contain " + collectionLine1 + ", Actual " + result,
result.contains(collectionLine1));
assertTrue("Expected line to contain " + collectionLine2 + ", Actual " + result,
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/SerializedLayoutTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/SerializedLayoutTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/SerializedLayoutTest.java
index da20507..c01c82e 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/SerializedLayoutTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/SerializedLayoutTest.java
@@ -59,14 +59,14 @@ public class SerializedLayoutTest {
static boolean useObjectInputStream = false;
@Rule
- public final ThreadContextRule threadContextRule = new ThreadContextRule();
+ public final ThreadContextRule threadContextRule = new ThreadContextRule();
@BeforeClass
public static void setupClass() {
try {
Class.forName("java.io.ObjectInputFilter");
useObjectInputStream = true;
- } catch (final ClassNotFoundException ex) {
+ } catch (ClassNotFoundException ex) {
// Ignore the exception
}
ConfigurationFactory.setConfigurationFactory(cf);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/SyslogLayoutTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/SyslogLayoutTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/SyslogLayoutTest.java
index d9bd5b0..b5bea03 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/SyslogLayoutTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/SyslogLayoutTest.java
@@ -55,7 +55,7 @@ public class SyslogLayoutTest {
static ConfigurationFactory cf = new BasicConfigurationFactory();
@Rule
- public final ThreadContextRule threadContextRule = new ThreadContextRule();
+ public final ThreadContextRule threadContextRule = new ThreadContextRule();
@BeforeClass
public static void setupClass() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/XmlLayoutTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/XmlLayoutTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/XmlLayoutTest.java
index 9d97f6a..4ee8f1e 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/XmlLayoutTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/XmlLayoutTest.java
@@ -61,7 +61,7 @@ public class XmlLayoutTest {
private static final String markerTag = "<Marker name=\"EVENT\"/>";
@Rule
- public final ThreadContextRule threadContextRule = new ThreadContextRule();
+ public final ThreadContextRule threadContextRule = new ThreadContextRule();
@AfterClass
public static void cleanupClass() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MainInputArgumentsJmxLookupTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MainInputArgumentsJmxLookupTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MainInputArgumentsJmxLookupTest.java
index 22583d3..be1f587 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MainInputArgumentsJmxLookupTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MainInputArgumentsJmxLookupTest.java
@@ -22,9 +22,9 @@ import org.junit.Test;
/**
* Tests {@link JmxRuntimeInputArgumentsLookup} from the command line, not a JUnit test.
- *
+ *
* From an IDE or CLI: --file foo.txt
- *
+ *
* @since 2.1
*/
public class MainInputArgumentsJmxLookupTest {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MainInputArgumentsLookupTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MainInputArgumentsLookupTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MainInputArgumentsLookupTest.java
index 966c6fd..6150afd 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MainInputArgumentsLookupTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MainInputArgumentsLookupTest.java
@@ -23,9 +23,9 @@ import org.apache.logging.log4j.core.config.Configurator;
/**
* Tests {@link org.apache.logging.log4j.core.lookup.MainMapLookup#MAIN_SINGLETON} from the command line, not a real
* JUnit test.
- *
+ *
* From an IDE or CLI: --file foo.txt
- *
+ *
* @since 2.4
*/
public class MainInputArgumentsLookupTest {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MainInputArgumentsMapLookup.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MainInputArgumentsMapLookup.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MainInputArgumentsMapLookup.java
index 1ec64a8..f6bad22 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MainInputArgumentsMapLookup.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MainInputArgumentsMapLookup.java
@@ -20,7 +20,7 @@ import java.util.Map;
/**
* Work in progress, saved for future experimentation.
- *
+ *
* TODO The goal is to use the Sun debugger API to find the main arg values on the stack.
*/
public class MainInputArgumentsMapLookup extends MapLookup {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MarkerLookupConfigTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MarkerLookupConfigTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MarkerLookupConfigTest.java
index e3ce8d4..62f8897 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MarkerLookupConfigTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MarkerLookupConfigTest.java
@@ -31,7 +31,7 @@ import org.junit.Test;
/**
* Tests {@link MarkerLookup} with a configuration file.
- *
+ *
* @since 2.4
*/
public class MarkerLookupConfigTest {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MarkerLookupTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MarkerLookupTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MarkerLookupTest.java
index fac33d4..d26f895 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MarkerLookupTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MarkerLookupTest.java
@@ -29,7 +29,7 @@ import org.junit.Test;
/**
* Tests {@link MarkerLookup}.
- *
+ *
* @since 2.4
*/
public class MarkerLookupTest {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockTcpSyslogServer.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockTcpSyslogServer.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockTcpSyslogServer.java
index 919eebc..ea41e61 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockTcpSyslogServer.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockTcpSyslogServer.java
@@ -46,7 +46,7 @@ public class MockTcpSyslogServer extends MockSyslogServer {
thread.interrupt();
try {
thread.join(100);
- } catch (final InterruptedException ie) {
+ } catch (InterruptedException ie) {
System.out.println("Shutdown of TCP server thread failed.");
}
}
@@ -76,7 +76,7 @@ public class MockTcpSyslogServer extends MockSyslogServer {
System.out.println("Message too long");
}
}
- } catch (final BindException be) {
+ } catch (BindException be) {
be.printStackTrace();
} finally {
if (socket != null) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockTlsSyslogServer.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockTlsSyslogServer.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockTlsSyslogServer.java
index b116e40..a445464 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockTlsSyslogServer.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockTlsSyslogServer.java
@@ -67,7 +67,7 @@ public class MockTlsSyslogServer extends MockSyslogServer {
if (thread != null) {
try {
thread.join(100);
- } catch (final InterruptedException ie) {
+ } catch (InterruptedException ie) {
System.out.println("Shutdown of TLS server thread failed.");
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockUdpSyslogServer.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockUdpSyslogServer.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockUdpSyslogServer.java
index a41b26b..a74940b 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockUdpSyslogServer.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockUdpSyslogServer.java
@@ -42,7 +42,7 @@ public class MockUdpSyslogServer extends MockSyslogServer {
thread.interrupt();
try {
thread.join(100);
- } catch (final InterruptedException ie) {
+ } catch (InterruptedException ie) {
System.out.println("Shutdown of Log4j UDP server thread failed.");
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/FilePasswordProviderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/FilePasswordProviderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/FilePasswordProviderTest.java
index 13ca8a4..26cda80 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/FilePasswordProviderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/FilePasswordProviderTest.java
@@ -31,7 +31,7 @@ public class FilePasswordProviderTest {
final Path path = Files.createTempFile("testPass", ".txt");
Files.write(path, PASSWORD.getBytes(Charset.defaultCharset()));
- final char[] actual = new FilePasswordProvider(path.toString()).getPassword();
+ char[] actual = new FilePasswordProvider(path.toString()).getPassword();
Files.delete(path);
assertArrayEquals(PASSWORD.toCharArray(), actual);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/MemoryPasswordProviderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/MemoryPasswordProviderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/MemoryPasswordProviderTest.java
index 99b3097..df4b5f2 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/MemoryPasswordProviderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/MemoryPasswordProviderTest.java
@@ -29,16 +29,16 @@ public class MemoryPasswordProviderTest {
@Test
public void testConstructorDoesNotModifyOriginalParameterArray() {
- final char[] initial = "123".toCharArray();
+ char[] initial = "123".toCharArray();
new MemoryPasswordProvider(initial);
assertArrayEquals("123".toCharArray(), initial);
}
@Test
public void testGetPasswordReturnsCopyOfConstructorArray() {
- final char[] initial = "123".toCharArray();
- final MemoryPasswordProvider provider = new MemoryPasswordProvider(initial);
- final char[] actual = provider.getPassword();
+ char[] initial = "123".toCharArray();
+ MemoryPasswordProvider provider = new MemoryPasswordProvider(initial);
+ char[] actual = provider.getPassword();
assertArrayEquals("123".toCharArray(), actual);
assertNotSame(initial, actual);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DatePatternConverterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DatePatternConverterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DatePatternConverterTest.java
index affb5b2..728254a 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DatePatternConverterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DatePatternConverterTest.java
@@ -150,8 +150,8 @@ public class DatePatternConverterTest {
}
}
- private String precisePattern(final String pattern, final int precision) {
- final String seconds = pattern.substring(0, pattern.indexOf("SSS"));
+ private String precisePattern(final String pattern, int precision) {
+ String seconds = pattern.substring(0, pattern.indexOf("SSS"));
return seconds + "nnnnnnnnn".substring(0, precision);
}
@@ -162,7 +162,7 @@ public class DatePatternConverterTest {
final StringBuilder milli = new StringBuilder();
final LogEvent event = new MyLogEvent();
- for (final String timeZone : new String[]{"PDT", null}) { // Pacific Daylight Time=UTC-8:00
+ for (String timeZone : new String[]{"PDT", null}) { // Pacific Daylight Time=UTC-8:00
for (final FixedDateFormat.FixedFormat format : FixedDateFormat.FixedFormat.values()) {
for (int i = 1; i <= 9; i++) {
if (format.getPattern().endsWith("n")) {
@@ -178,7 +178,7 @@ public class DatePatternConverterTest {
final String[] milliOptions = {format.getPattern(), timeZone};
DatePatternConverter.newInstance(milliOptions).format(event, milli);
milli.setLength(milli.length() - 3); // truncate millis
- final String expected = milli.append("987123456".substring(0, i)).toString();
+ String expected = milli.append("987123456".substring(0, i)).toString();
assertEquals(expected, precise.toString());
//System.out.println(preciseOptions[0] + ": " + precise);
@@ -208,7 +208,7 @@ public class DatePatternConverterTest {
final String[] milliOptions = {format.getPattern()};
DatePatternConverter.newInstance(milliOptions).format(event, milli);
milli.setLength(milli.length() - 3); // truncate millis
- final String expected = milli.append("987123456").toString();
+ String expected = milli.append("987123456").toString();
assertEquals(expected, precise.toString());
//System.out.println(preciseOptions[0] + ": " + precise);
@@ -228,7 +228,7 @@ public class DatePatternConverterTest {
@Override
public Instant getInstant() {
- final MutableInstant result = new MutableInstant();
+ MutableInstant result = new MutableInstant();
result.initFromEpochMilli(getTimeMillis(), 123456);
return result;
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DisableAnsiTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DisableAnsiTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DisableAnsiTest.java
index b841ea4..7fea6fe 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DisableAnsiTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DisableAnsiTest.java
@@ -55,5 +55,5 @@ public class DisableAnsiTest {
assertEquals("Incorrect number of messages. Should be 1 is " + msgs.size(), 1, msgs.size());
assertTrue("Replacement failed - expected ending " + EXPECTED + ", actual " + msgs.get(0), msgs.get(0).endsWith(EXPECTED));
}
-
+
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverterTest.java
index bcb9b1c..445b893 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverterTest.java
@@ -159,7 +159,7 @@ public class ExtendedThrowablePatternConverterTest {
final String expected = sw.toString(); //.replaceAll("\r", Strings.EMPTY);
assertEquals(expected, result);
}
-
+
@Test
public void testFiltersAndSeparator() {
final ExtendedThrowablePatternConverter exConverter = ExtendedThrowablePatternConverter.newInstance(null,
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/HighlightConverterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/HighlightConverterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/HighlightConverterTest.java
index 442c5ab..c3b1ba6 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/HighlightConverterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/HighlightConverterTest.java
@@ -53,10 +53,10 @@ public class HighlightConverterTest {
converter.format(event, buffer);
assertEquals("\u001B[32mINFO : message in a bottle\u001B[m", buffer.toString());
}
-
+
@Test
public void testLevelNamesBad() {
- final String colorName = "red";
+ String colorName = "red";
final String[] options = { "%-5level: %msg", PatternParser.NO_CONSOLE_NO_ANSI + "=false, "
+ PatternParser.DISABLE_ANSI + "=false, " + "BAD_LEVEL_A=" + colorName + ", BAD_LEVEL_B=" + colorName };
final HighlightConverter converter = HighlightConverter.newInstance(null, options);
@@ -67,7 +67,7 @@ public class HighlightConverterTest {
@Test
public void testLevelNamesGood() {
- final String colorName = "red";
+ String colorName = "red";
final String[] options = { "%-5level: %msg", PatternParser.NO_CONSOLE_NO_ANSI + "=false, "
+ PatternParser.DISABLE_ANSI + "=false, " + "DEBUG=" + colorName + ", TRACE=" + colorName };
final HighlightConverter converter = HighlightConverter.newInstance(null, options);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MdcPatternConverterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MdcPatternConverterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MdcPatternConverterTest.java
index 4cb6c7d..00e97f7 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MdcPatternConverterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MdcPatternConverterTest.java
@@ -36,7 +36,7 @@ import org.junit.Test;
public class MdcPatternConverterTest {
@Rule
- public final ThreadContextMapRule threadContextRule = new ThreadContextMapRule();
+ public final ThreadContextMapRule threadContextRule = new ThreadContextMapRule();
@Before
public void setup() {
[09/13] logging-log4j2 git commit: Revert "Use final. Remove trailing
spaces."
Posted by gg...@apache.org.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/CustomLevelConfig.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/CustomLevelConfig.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/CustomLevelConfig.java
index d28753d..ca6bd9b 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/CustomLevelConfig.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/CustomLevelConfig.java
@@ -42,7 +42,7 @@ public final class CustomLevelConfig {
/**
* Creates a CustomLevelConfig object. This also defines the Level object with a call to
* {@link Level#forName(String, int)}.
- *
+ *
* @param levelName name of the custom level.
* @param intLevel the intLevel that determines where this level resides relative to the built-in levels
* @return A CustomLevelConfig object.
@@ -60,7 +60,7 @@ public final class CustomLevelConfig {
/**
* Returns the custom level name.
- *
+ *
* @return the custom level name
*/
public String getLevelName() {
@@ -70,7 +70,7 @@ public final class CustomLevelConfig {
/**
* Returns the custom level intLevel that determines the strength of the custom level relative to the built-in
* levels.
- *
+ *
* @return the custom level intLevel
*/
public int getIntLevel() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/CustomLevels.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/CustomLevels.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/CustomLevels.java
index db6eab3..0b43858 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/CustomLevels.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/CustomLevels.java
@@ -40,7 +40,7 @@ public final class CustomLevels {
/**
* Create a CustomLevels object to contain all the CustomLevelConfigs.
- *
+ *
* @param customLevels An array of CustomLevelConfigs.
* @return A CustomLevels object.
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/DefaultConfiguration.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/DefaultConfiguration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/DefaultConfiguration.java
index 973eb27..cbedf7c 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/DefaultConfiguration.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/DefaultConfiguration.java
@@ -28,12 +28,12 @@ public class DefaultConfiguration extends AbstractConfiguration {
* The name of the default configuration.
*/
public static final String DEFAULT_NAME = "Default";
-
+
/**
* The System Property used to specify the logging level.
*/
public static final String DEFAULT_LEVEL = "org.apache.logging.log4j.level";
-
+
/**
* The default Pattern used for the default Layout.
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/DefaultReliabilityStrategy.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/DefaultReliabilityStrategy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/DefaultReliabilityStrategy.java
index f6e32f5..18fcae4 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/DefaultReliabilityStrategy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/DefaultReliabilityStrategy.java
@@ -38,7 +38,7 @@ public class DefaultReliabilityStrategy implements ReliabilityStrategy {
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.config.ReliabilityStrategy#log(org.apache.logging.log4j.util.Supplier,
* java.lang.String, java.lang.String, org.apache.logging.log4j.Marker, org.apache.logging.log4j.Level,
* org.apache.logging.log4j.message.Message, java.lang.Throwable)
@@ -51,7 +51,7 @@ public class DefaultReliabilityStrategy implements ReliabilityStrategy {
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.config.ReliabilityStrategy#log(org.apache.logging.log4j.util.Supplier,
* org.apache.logging.log4j.core.LogEvent)
*/
@@ -62,7 +62,7 @@ public class DefaultReliabilityStrategy implements ReliabilityStrategy {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.apache.logging.log4j.core.config.ReliabilityStrategy#beforeLogEvent(org.apache.logging.log4j.core.config.
* LoggerConfig, org.apache.logging.log4j.util.Supplier)
@@ -74,7 +74,7 @@ public class DefaultReliabilityStrategy implements ReliabilityStrategy {
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.config.ReliabilityStrategy#afterLogEvent()
*/
@Override
@@ -84,7 +84,7 @@ public class DefaultReliabilityStrategy implements ReliabilityStrategy {
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.logging.log4j.core.config.ReliabilityStrategy#beforeStopAppenders()
*/
@Override
@@ -94,7 +94,7 @@ public class DefaultReliabilityStrategy implements ReliabilityStrategy {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.apache.logging.log4j.core.config.ReliabilityStrategy#beforeStopConfiguration(org.apache.logging.log4j.core
* .config.Configuration)
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
index 97cebe0..1022f2d 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
@@ -442,7 +442,7 @@ public class LoggerConfig extends AbstractFilterable {
return reliabilityStrategy;
}
- private void processLogEvent(final LogEvent event, final LoggerConfigPredicate predicate) {
+ private void processLogEvent(final LogEvent event, LoggerConfigPredicate predicate) {
event.setIncludeLocation(isIncludeLocation());
if (predicate.allow(this)) {
callAppenders(event);
@@ -598,19 +598,19 @@ public class LoggerConfig extends AbstractFilterable {
protected enum LoggerConfigPredicate {
ALL() {
@Override
- boolean allow(final LoggerConfig config) {
+ boolean allow(LoggerConfig config) {
return true;
}
},
ASYNCHRONOUS_ONLY() {
@Override
- boolean allow(final LoggerConfig config) {
+ boolean allow(LoggerConfig config) {
return config instanceof AsyncLoggerConfig;
}
},
SYNCHRONOUS_ONLY() {
@Override
- boolean allow(final LoggerConfig config) {
+ boolean allow(LoggerConfig config) {
return !ASYNCHRONOUS_ONLY.allow(config);
}
};
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Property.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Property.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Property.java
index 137fba8..cb4731e 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Property.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Property.java
@@ -36,7 +36,7 @@ public final class Property {
* @since 2.11.2
*/
public static final Property[] EMPTY_ARRAY = new Property[0];
-
+
private static final Logger LOGGER = StatusLogger.getLogger();
private final String name;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ReliabilityStrategy.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ReliabilityStrategy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ReliabilityStrategy.java
index 223e0ed..f21a92d 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ReliabilityStrategy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ReliabilityStrategy.java
@@ -1,79 +1,79 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-package org.apache.logging.log4j.core.config;
-
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Marker;
-import org.apache.logging.log4j.core.LogEvent;
-import org.apache.logging.log4j.message.Message;
-import org.apache.logging.log4j.util.Supplier;
-
-/**
- * Interface for objects that know how to ensure delivery of log events to the appropriate appenders, even during and
- * after the configuration has been modified while the system is actively used.
- */
-public interface ReliabilityStrategy {
-
- /**
- * Logs an event.
- *
- * @param reconfigured supplies the next LoggerConfig if the strategy's LoggerConfig is no longer active
- * @param loggerName The name of the Logger.
- * @param fqcn The fully qualified class name of the caller.
- * @param marker A Marker or null if none is present.
- * @param level The event Level.
- * @param data The Message.
- * @param t A Throwable or null.
- */
- void log(Supplier<LoggerConfig> reconfigured, String loggerName, String fqcn, Marker marker, Level level,
- Message data, Throwable t);
-
- /**
- * Logs an event.
- *
- * @param reconfigured supplies the next LoggerConfig if the strategy's LoggerConfig is no longer active
- * @param event The log event.
- */
- void log(Supplier<LoggerConfig> reconfigured, LogEvent event);
-
- /**
- * For internal use by the ReliabilityStrategy; returns the LoggerConfig to use.
- *
- * @param next supplies the next LoggerConfig if the strategy's LoggerConfig is no longer active
- * @return the currently active LoggerConfig
- */
- LoggerConfig getActiveLoggerConfig(Supplier<LoggerConfig> next);
-
- /**
- * Called after a log event was logged.
- */
- void afterLogEvent();
-
- /**
- * Called before all appenders are stopped.
- */
- void beforeStopAppenders();
-
- /**
- * Called before the configuration is stopped.
- *
- * @param configuration the configuration that will be stopped
- */
- void beforeStopConfiguration(Configuration configuration);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.core.config;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.Marker;
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.message.Message;
+import org.apache.logging.log4j.util.Supplier;
+
+/**
+ * Interface for objects that know how to ensure delivery of log events to the appropriate appenders, even during and
+ * after the configuration has been modified while the system is actively used.
+ */
+public interface ReliabilityStrategy {
+
+ /**
+ * Logs an event.
+ *
+ * @param reconfigured supplies the next LoggerConfig if the strategy's LoggerConfig is no longer active
+ * @param loggerName The name of the Logger.
+ * @param fqcn The fully qualified class name of the caller.
+ * @param marker A Marker or null if none is present.
+ * @param level The event Level.
+ * @param data The Message.
+ * @param t A Throwable or null.
+ */
+ void log(Supplier<LoggerConfig> reconfigured, String loggerName, String fqcn, Marker marker, Level level,
+ Message data, Throwable t);
+
+ /**
+ * Logs an event.
+ *
+ * @param reconfigured supplies the next LoggerConfig if the strategy's LoggerConfig is no longer active
+ * @param event The log event.
+ */
+ void log(Supplier<LoggerConfig> reconfigured, LogEvent event);
+
+ /**
+ * For internal use by the ReliabilityStrategy; returns the LoggerConfig to use.
+ *
+ * @param next supplies the next LoggerConfig if the strategy's LoggerConfig is no longer active
+ * @return the currently active LoggerConfig
+ */
+ LoggerConfig getActiveLoggerConfig(Supplier<LoggerConfig> next);
+
+ /**
+ * Called after a log event was logged.
+ */
+ void afterLogEvent();
+
+ /**
+ * Called before all appenders are stopped.
+ */
+ void beforeStopAppenders();
+
+ /**
+ * Called before the configuration is stopped.
+ *
+ * @param configuration the configuration that will be stopped
+ */
+ void beforeStopConfiguration(Configuration configuration);
+
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ReliabilityStrategyFactory.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ReliabilityStrategyFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ReliabilityStrategyFactory.java
index 542cd75..953d96f 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ReliabilityStrategyFactory.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ReliabilityStrategyFactory.java
@@ -39,7 +39,7 @@ public final class ReliabilityStrategyFactory {
* <p>
* Users may also use this system property to specify the fully qualified class name of a class that implements the
* {@code ReliabilityStrategy} and has a constructor that accepts a single {@code LoggerConfig} argument.
- *
+ *
* @param loggerConfig the LoggerConfig the resulting {@code ReliabilityStrategy} is associated with
* @return a ReliabilityStrategy that helps the specified LoggerConfig to log events reliably during or after a
* configuration change
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/DefaultConfigurationBuilder.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/DefaultConfigurationBuilder.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/DefaultConfigurationBuilder.java
index c0595d7..27d8710 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/DefaultConfigurationBuilder.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/DefaultConfigurationBuilder.java
@@ -58,7 +58,7 @@ public class DefaultConfigurationBuilder<T extends BuiltConfiguration> implement
private static final String INDENT = " ";
private static final String EOL = System.lineSeparator();
-
+
private final Component root = new Component();
private Component loggers;
private Component appenders;
@@ -356,12 +356,12 @@ public class DefaultConfigurationBuilder<T extends BuiltConfiguration> implement
}
@Override
- public LoggerComponentBuilder newAsyncLogger(final String name) {
+ public LoggerComponentBuilder newAsyncLogger(String name) {
return new DefaultLoggerComponentBuilder(this, name, null, "AsyncLogger");
}
@Override
- public LoggerComponentBuilder newAsyncLogger(final String name, final boolean includeLocation) {
+ public LoggerComponentBuilder newAsyncLogger(String name, boolean includeLocation) {
return new DefaultLoggerComponentBuilder(this, name, null, "AsyncLogger", includeLocation);
}
@@ -391,7 +391,7 @@ public class DefaultConfigurationBuilder<T extends BuiltConfiguration> implement
}
@Override
- public RootLoggerComponentBuilder newAsyncRootLogger(final boolean includeLocation) {
+ public RootLoggerComponentBuilder newAsyncRootLogger(boolean includeLocation) {
return new DefaultRootLoggerComponentBuilder(this, null, "AsyncRoot", includeLocation);
}
@@ -464,12 +464,12 @@ public class DefaultConfigurationBuilder<T extends BuiltConfiguration> implement
}
@Override
- public LoggerComponentBuilder newLogger(final String name) {
+ public LoggerComponentBuilder newLogger(String name) {
return new DefaultLoggerComponentBuilder(this, name, null);
}
@Override
- public LoggerComponentBuilder newLogger(final String name, final boolean includeLocation) {
+ public LoggerComponentBuilder newLogger(String name, boolean includeLocation) {
return new DefaultLoggerComponentBuilder(this, name, null, includeLocation);
}
@@ -499,7 +499,7 @@ public class DefaultConfigurationBuilder<T extends BuiltConfiguration> implement
}
@Override
- public RootLoggerComponentBuilder newRootLogger(final boolean includeLocation) {
+ public RootLoggerComponentBuilder newRootLogger(boolean includeLocation) {
return new DefaultRootLoggerComponentBuilder(this, null, includeLocation);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/composite/CompositeConfiguration.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/composite/CompositeConfiguration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/composite/CompositeConfiguration.java
index 9b6b11a..063059a 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/composite/CompositeConfiguration.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/composite/CompositeConfiguration.java
@@ -38,6 +38,7 @@ import org.apache.logging.log4j.core.util.FileWatcher;
import org.apache.logging.log4j.core.util.Loader;
import org.apache.logging.log4j.core.util.Patterns;
import org.apache.logging.log4j.core.util.WatchManager;
+import org.apache.logging.log4j.util.LoaderUtil;
import org.apache.logging.log4j.util.PropertiesUtil;
/**
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/convert/TypeConverters.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/convert/TypeConverters.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/convert/TypeConverters.java
index e688874..dc833f0 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/convert/TypeConverters.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/convert/TypeConverters.java
@@ -91,7 +91,7 @@ public final class TypeConverters {
/**
* Converts a {@link String} into a {@code byte[]}.
- *
+ *
* The supported formats are:
* <ul>
* <li>0x0123456789ABCDEF</li>
@@ -394,7 +394,7 @@ public final class TypeConverters {
* Converts a String to a given class if a TypeConverter is available for that class. Falls back to the provided
* default value if the conversion is unsuccessful. However, if the default value is <em>also</em> invalid, then
* {@code null} is returned (along with a nasty status log message).
- *
+ *
* @param s
* the string to convert
* @param clazz
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginBuilder.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginBuilder.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginBuilder.java
index f726a3a..443c612 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginBuilder.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginBuilder.java
@@ -23,6 +23,7 @@ import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginManager.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginManager.java
index abe2aa9..704ffd1 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginManager.java
@@ -43,7 +43,7 @@ public class PluginManager {
/**
* Constructs a PluginManager for the plugin category name given.
- *
+ *
* @param category The plugin category name.
*/
public PluginManager(final String category) {
@@ -52,7 +52,7 @@ public class PluginManager {
/**
* Process annotated plugins.
- *
+ *
* @deprecated Use {@link org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor} instead. To do so,
* simply include {@code log4j-core} in your dependencies and make sure annotation processing is not
* disabled. By default, supported Java compilers will automatically use that plugin processor provided
@@ -69,7 +69,7 @@ public class PluginManager {
/**
* Adds a package name to be scanned for plugins. Must be invoked prior to plugins being collected.
- *
+ *
* @param p The package name. Ignored if {@code null} or empty.
*/
public static void addPackage(final String p) {
@@ -94,7 +94,7 @@ public class PluginManager {
/**
* Returns the type of a specified plugin.
- *
+ *
* @param name The name of the plugin.
* @return The plugin's type.
*/
@@ -104,7 +104,7 @@ public class PluginManager {
/**
* Returns all the matching plugins.
- *
+ *
* @return A Map containing the name of the plugin and its type.
*/
public Map<String, PluginType<?>> getPlugins() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
index 1aa9a36..73b5fc0 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
@@ -112,7 +112,7 @@ public class ResolverUtil {
/**
* Returns the matching resources.
- *
+ *
* @return A Set of URIs that match the criteria.
*/
public Set<URI> getResources() {
@@ -432,7 +432,7 @@ public class ResolverUtil {
/**
* Will be called repeatedly with candidate classes. Must return True if a class is to be included in the
* results, false otherwise.
- *
+ *
* @param type
* The Class to match against.
* @return true if the Class matches.
@@ -441,7 +441,7 @@ public class ResolverUtil {
/**
* Test for a resource.
- *
+ *
* @param resource
* The URI to the resource.
* @return true if the resource matches.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/validation/ConstraintValidator.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/validation/ConstraintValidator.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/validation/ConstraintValidator.java
index b9c697a..1d8c0c5 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/validation/ConstraintValidator.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/validation/ConstraintValidator.java
@@ -37,7 +37,7 @@ public interface ConstraintValidator<A extends Annotation> {
* Indicates if the given value is valid.
*
* @param name the name to use for error reporting
- * @param value the value to validate.
+ * @param value the value to validate.
* @return {@code true} if the given value is valid.
*/
boolean isValid(String name, Object value);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/AbstractPluginVisitor.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/AbstractPluginVisitor.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/AbstractPluginVisitor.java
index 089d1f2..560cbe3 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/AbstractPluginVisitor.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/AbstractPluginVisitor.java
@@ -40,27 +40,27 @@ public abstract class AbstractPluginVisitor<A extends Annotation> implements Plu
protected static final Logger LOGGER = StatusLogger.getLogger();
/**
- *
+ *
*/
protected final Class<A> clazz;
/**
- *
+ *
*/
protected A annotation;
/**
- *
+ *
*/
protected String[] aliases;
/**
- *
+ *
*/
protected Class<?> conversionType;
/**
- *
+ *
*/
protected StrSubstitutor substitutor;
/**
- *
+ *
*/
protected Member member;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationBuilder.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationBuilder.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationBuilder.java
index f77707e..3143259 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationBuilder.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationBuilder.java
@@ -184,9 +184,9 @@ public class PropertiesConfigurationBuilder extends ConfigurationBuilderFactory
if (props.size() > 0) {
builder.add(createRootLogger(props));
}
-
+
builder.setLoggerContext(loggerContext);
-
+
return builder.build(false);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XmlConfiguration.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XmlConfiguration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XmlConfiguration.java
index 6b0e79a..07d5740 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XmlConfiguration.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XmlConfiguration.java
@@ -182,7 +182,7 @@ public class XmlConfiguration extends AbstractConfiguration implements Reconfigu
/**
* Creates a new DocumentBuilder suitable for parsing a configuration file.
- *
+ *
* @param xIncludeAware enabled XInclude
* @return a new DocumentBuilder
* @throws ParserConfigurationException
@@ -206,7 +206,7 @@ public class XmlConfiguration extends AbstractConfiguration implements Reconfigu
setFeature(factory, "http://xml.org/sax/features/external-parameter-entities", false);
setFeature(factory, "http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
}
-
+
private static void setFeature(final DocumentBuilderFactory factory, final String featureName, final boolean value) {
try {
factory.setFeature(featureName, value);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilter.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilter.java
index 75071ea..5e3c133 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilter.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilter.java
@@ -69,21 +69,21 @@ public abstract class AbstractFilter extends AbstractLifeCycle implements Filter
/**
* Sets the Result to return when the filter does not match. The default is Result.DENY.
- * @param onMismatch the Result to return when the filter does not match.
+ * @param onMismatch the Result to return when the filter does not match.
* @return this
*/
public B setOnMismatch(final Result onMismatch) {
this.onMismatch = onMismatch;
return asBuilder();
}
-
+
@SuppressWarnings("unchecked")
public B asBuilder() {
return (B) this;
}
}
-
+
/**
* The onMatch Result.
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilterable.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilterable.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilterable.java
index d2368b3..4c61d33 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilterable.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilterable.java
@@ -64,14 +64,14 @@ public abstract class AbstractFilterable extends AbstractLifeCycle implements Fi
return asBuilder();
}
- public B setPropertyArray(final Property[] properties) {
+ public B setPropertyArray(Property[] properties) {
this.propertyArray = properties;
return asBuilder();
}
/**
* Sets the filter.
- *
+ *
* @param filter The filter
* @return this
* @deprecated Use {@link #setFilter(Filter)}.
@@ -87,7 +87,7 @@ public abstract class AbstractFilterable extends AbstractLifeCycle implements Fi
* May be null.
*/
private volatile Filter filter;
-
+
@PluginElement("Properties")
private final Property[] propertyArray;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/BurstFilter.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/BurstFilter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/BurstFilter.java
index 95df851..c2326ad 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/BurstFilter.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/BurstFilter.java
@@ -303,7 +303,7 @@ public final class BurstFilter extends AbstractFilter {
/**
* Sets the logging level to use.
- * @param level the logging level to use.
+ * @param level the logging level to use.
* @return this
*/
public Builder setLevel(final Level level) {
@@ -313,7 +313,7 @@ public final class BurstFilter extends AbstractFilter {
/**
* Sets the average number of events per second to allow.
- * @param rate the average number of events per second to allow. This must be a positive number.
+ * @param rate the average number of events per second to allow. This must be a positive number.
* @return this
*/
public Builder setRate(final float rate) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/Filterable.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/Filterable.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/Filterable.java
index 993d04b..e6dd630 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/Filterable.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/Filterable.java
@@ -22,7 +22,7 @@ import org.apache.logging.log4j.core.LogEvent;
/**
* Interface implemented by Classes that allow filtering to occur.
- *
+ *
* <p>
* Extends {@link LifeCycle} since filters have a life cycle.
* </p>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/ScriptFilter.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/ScriptFilter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/ScriptFilter.java
index d06465f..1e47d4e 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/ScriptFilter.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/ScriptFilter.java
@@ -123,11 +123,11 @@ public final class ScriptFilter extends AbstractFilter {
/**
* Creates the ScriptFilter.
- * @param script The script to run. The script must return a boolean value. Either script or scriptFile must be
+ * @param script The script to run. The script must return a boolean value. Either script or scriptFile must be
* provided.
* @param match The action to take if a match occurs.
* @param mismatch The action to take if no match occurs.
- * @param configuration the configuration
+ * @param configuration the configuration
* @return A ScriptFilter.
*/
// TODO Consider refactoring to use AbstractFilter.AbstractFilterBuilder
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ContextDataFactory.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ContextDataFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ContextDataFactory.java
index a7a7aaa..70b548d 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ContextDataFactory.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ContextDataFactory.java
@@ -117,7 +117,7 @@ public class ContextDataFactory {
public static StringMap createContextData(final Map<String, String> context) {
final StringMap contextData = createContextData(context.size());
- for (final Entry<String, String> entry : context.entrySet()) {
+ for (Entry<String, String> entry : context.entrySet()) {
contextData.putValue(entry.getKey(), entry.getValue());
}
return contextData;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ExtendedClassInfo.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ExtendedClassInfo.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ExtendedClassInfo.java
index 2be5f5c..44d42f9 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ExtendedClassInfo.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ExtendedClassInfo.java
@@ -36,7 +36,7 @@ public final class ExtendedClassInfo implements Serializable {
/**
* Constructs a new instance.
- *
+ *
* @param exact
* @param location
* @param version
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jContextFactory.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jContextFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jContextFactory.java
index 9aa1da5..42bd52a 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jContextFactory.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jContextFactory.java
@@ -37,6 +37,7 @@ import org.apache.logging.log4j.core.util.Loader;
import org.apache.logging.log4j.core.util.ShutdownCallbackRegistry;
import org.apache.logging.log4j.spi.LoggerContextFactory;
import org.apache.logging.log4j.status.StatusLogger;
+import org.apache.logging.log4j.util.LoaderUtil;
import org.apache.logging.log4j.util.PropertiesUtil;
/**
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java
index ff5a6da..6ee9e1c 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java
@@ -85,7 +85,7 @@ public class Log4jLogEvent implements LogEvent {
private String loggerName;
private Message message;
private Throwable thrown;
- private final MutableInstant instant = new MutableInstant();
+ private MutableInstant instant = new MutableInstant();
private ThrowableProxy thrownProxy;
private StringMap contextData = createContextData((List<Property>) null);
private ThreadContext.ContextStack contextStack = ThreadContext.getImmutableStack();
@@ -417,7 +417,7 @@ public class Log4jLogEvent implements LogEvent {
final String threadName, final int threadPriority, final StackTraceElement source,
final long timestampMillis, final int nanoOfMillisecond, final long nanoTime) {
this(loggerName, marker, loggerFQCN, level, message, thrown, thrownProxy, contextData, contextStack, threadId, threadName, threadPriority, source, nanoTime);
- final long millis = message instanceof TimestampMessage
+ long millis = message instanceof TimestampMessage
? ((TimestampMessage) message).getTimestamp()
: timestampMillis;
instant.initFromEpochMilli(millis, nanoOfMillisecond);
@@ -762,7 +762,7 @@ public class Log4jLogEvent implements LogEvent {
public static LogEvent createMemento(final LogEvent logEvent) {
return new Log4jLogEvent.Builder(logEvent).build();
}
-
+
/**
* Creates and returns a new immutable copy of this {@code Log4jLogEvent}.
*
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MementoMessage.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MementoMessage.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MementoMessage.java
index 3cfcb3d..c867ce4 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MementoMessage.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MementoMessage.java
@@ -36,7 +36,7 @@ public final class MementoMessage implements Message, StringBuilderFormattable {
private final String format;
private final Object[] parameters;
- public MementoMessage(final String formattedMessage, final String format, final Object[] parameters) {
+ public MementoMessage(String formattedMessage, String format, Object[] parameters) {
this.formattedMessage = formattedMessage;
this.format = format;
this.parameters = parameters;
@@ -68,7 +68,7 @@ public final class MementoMessage implements Message, StringBuilderFormattable {
}
@Override
- public void formatTo(final StringBuilder buffer) {
+ public void formatTo(StringBuilder buffer) {
buffer.append(formattedMessage);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java
index 7b8f671..3e0d388 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java
@@ -45,7 +45,7 @@ public class MutableLogEvent implements LogEvent, ReusableMessage, ParameterVisi
private int threadPriority;
private long threadId;
- private final MutableInstant instant = new MutableInstant();
+ private MutableInstant instant = new MutableInstant();
private long nanoTime;
private short parameterCount;
private boolean includeLocation;
@@ -256,7 +256,7 @@ public class MutableLogEvent implements LogEvent, ReusableMessage, ParameterVisi
}
@Override
- public <S> void forEachParameter(final ParameterConsumer<S> action, final S state) {
+ public <S> void forEachParameter(ParameterConsumer<S> action, S state) {
if (parameters != null) {
for (short i = 0; i < parameterCount; i++) {
action.accept(parameters[i], i, state);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ReusableLogEventFactory.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ReusableLogEventFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ReusableLogEventFactory.java
index 9f4cc17..dd5cf62 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ReusableLogEventFactory.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ReusableLogEventFactory.java
@@ -98,7 +98,7 @@ public class ReusableLogEventFactory implements LogEventFactory {
*/
public static void release(final LogEvent logEvent) { // LOG4J2-1583
if (logEvent instanceof MutableLogEvent) {
- final MutableLogEvent mutableLogEvent = (MutableLogEvent) logEvent;
+ MutableLogEvent mutableLogEvent = (MutableLogEvent) logEvent;
mutableLogEvent.clear();
mutableLogEvent.reserved = false;
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java
index 1c043af..c948a0c 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java
@@ -298,7 +298,7 @@ public class ThrowableProxy implements Serializable {
*
* @param value New value of commonElementCount.
*/
- void setCommonElementCount(final int value) {
+ void setCommonElementCount(int value) {
this.commonElementCount = value;
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxyRenderer.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxyRenderer.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxyRenderer.java
index f13943a..d86d2bb 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxyRenderer.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxyRenderer.java
@@ -53,13 +53,13 @@ class ThrowableProxyRenderer {
}
private static void formatCause(final StringBuilder sb, final String prefix, final ThrowableProxy cause,
- final List<String> ignorePackages, final TextRenderer textRenderer, final String suffix, final String lineSeparator) {
+ final List<String> ignorePackages, final TextRenderer textRenderer, final String suffix, String lineSeparator) {
formatThrowableProxy(sb, prefix, CAUSED_BY_LABEL, cause, ignorePackages, textRenderer, suffix, lineSeparator);
}
private static void formatThrowableProxy(final StringBuilder sb, final String prefix, final String causeLabel,
final ThrowableProxy throwableProxy, final List<String> ignorePackages,
- final TextRenderer textRenderer, final String suffix, final String lineSeparator) {
+ final TextRenderer textRenderer, final String suffix, String lineSeparator) {
if (throwableProxy == null) {
return;
}
@@ -75,7 +75,7 @@ class ThrowableProxyRenderer {
}
private static void formatSuppressed(final StringBuilder sb, final String prefix, final ThrowableProxy[] suppressedProxies,
- final List<String> ignorePackages, final TextRenderer textRenderer, final String suffix, final String lineSeparator) {
+ final List<String> ignorePackages, final TextRenderer textRenderer, final String suffix, String lineSeparator) {
if (suppressedProxies == null) {
return;
}
@@ -86,7 +86,7 @@ class ThrowableProxyRenderer {
private static void formatElements(final StringBuilder sb, final String prefix, final int commonCount,
final StackTraceElement[] causedTrace, final ExtendedStackTraceElement[] extStackTrace,
- final List<String> ignorePackages, final TextRenderer textRenderer, final String suffix, final String lineSeparator) {
+ final List<String> ignorePackages, final TextRenderer textRenderer, final String suffix, String lineSeparator) {
if (ignorePackages == null || ignorePackages.isEmpty()) {
for (final ExtendedStackTraceElement element : extStackTrace) {
formatEntry(element, sb, prefix, textRenderer, suffix, lineSeparator);
@@ -126,7 +126,7 @@ class ThrowableProxyRenderer {
}
private static void appendSuppressedCount(final StringBuilder sb, final String prefix, final int count,
- final TextRenderer textRenderer, final String suffix, final String lineSeparator) {
+ final TextRenderer textRenderer, final String suffix, String lineSeparator) {
textRenderer.render(prefix, sb, "Prefix");
if (count == 1) {
textRenderer.render("\t... ", sb, "Suppressed");
@@ -140,7 +140,7 @@ class ThrowableProxyRenderer {
}
private static void formatEntry(final ExtendedStackTraceElement extStackTraceElement, final StringBuilder sb,
- final String prefix, final TextRenderer textRenderer, final String suffix, final String lineSeparator) {
+ final String prefix, final TextRenderer textRenderer, final String suffix, String lineSeparator) {
textRenderer.render(prefix, sb, "Prefix");
textRenderer.render("\tat ", sb, "At");
extStackTraceElement.renderOn(sb, textRenderer);
@@ -170,7 +170,7 @@ class ThrowableProxyRenderer {
* @param suffix Append this to the end of each stack frame.
* @param lineSeparator The end-of-line separator.
*/
- static void formatExtendedStackTraceTo(final ThrowableProxy src, final StringBuilder sb, final List<String> ignorePackages, final TextRenderer textRenderer, final String suffix, final String lineSeparator) {
+ static void formatExtendedStackTraceTo(ThrowableProxy src, final StringBuilder sb, final List<String> ignorePackages, final TextRenderer textRenderer, final String suffix, final String lineSeparator) {
textRenderer.render(src.getName(), sb, "Name");
textRenderer.render(": ", sb, "NameMessageSeparator");
textRenderer.render(src.getMessage(), sb, "Message");
@@ -193,7 +193,7 @@ class ThrowableProxyRenderer {
* @param lineSeparator The end-of-line separator.
*/
static void formatCauseStackTrace(final ThrowableProxy src, final StringBuilder sb, final List<String> ignorePackages, final TextRenderer textRenderer, final String suffix, final String lineSeparator) {
- final ThrowableProxy causeProxy = src.getCauseProxy();
+ ThrowableProxy causeProxy = src.getCauseProxy();
if (causeProxy != null) {
formatWrapper(sb, causeProxy, ignorePackages, textRenderer, suffix, lineSeparator);
sb.append(WRAPPED_BY_LABEL);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/ExtendedStackTraceElementMixIn.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/ExtendedStackTraceElementMixIn.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/ExtendedStackTraceElementMixIn.java
index 1aa3e4c..84df3d6 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/ExtendedStackTraceElementMixIn.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/ExtendedStackTraceElementMixIn.java
@@ -76,7 +76,7 @@ abstract class ExtendedStackTraceElementMixIn implements Serializable {
@JsonProperty("method")
@JacksonXmlProperty(localName = "method", isAttribute = true)
public abstract String getMethodName();
-
+
@JsonIgnore
abstract StackTraceElement getStackTraceElement();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/MarkerMixIn.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/MarkerMixIn.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/MarkerMixIn.java
index 85f2db9..950c2c8 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/MarkerMixIn.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/MarkerMixIn.java
@@ -48,7 +48,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
</Parents>
</Marker>
* </pre>
- *
+ *
* @see Marker
*/
// Alternate for multiple Marker implementation.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/StackTraceElementMixIn.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/StackTraceElementMixIn.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/StackTraceElementMixIn.java
index 16e655e..9a3b022 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/StackTraceElementMixIn.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/StackTraceElementMixIn.java
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
* <p>
* <em>Consider this class private.</em>
* </p>
- *
+ *
* @see StackTraceElement
*/
@JsonIgnoreProperties("nativeMethod")
@@ -34,9 +34,9 @@ abstract class StackTraceElementMixIn {
@JsonCreator
StackTraceElementMixIn(
// @formatter:off
- @JsonProperty("class") final String declaringClass,
+ @JsonProperty("class") final String declaringClass,
@JsonProperty("method") final String methodName,
- @JsonProperty("file") final String fileName,
+ @JsonProperty("file") final String fileName,
@JsonProperty("line") final int lineNumber)
// @formatter:on
{
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AsyncAppenderAdmin.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AsyncAppenderAdmin.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AsyncAppenderAdmin.java
index caaa433..5a173ea 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AsyncAppenderAdmin.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AsyncAppenderAdmin.java
@@ -91,7 +91,7 @@ public class AsyncAppenderAdmin implements AsyncAppenderAdminMBean {
public String[] getAppenderRefs() {
return asyncAppender.getAppenderRefStrings();
}
-
+
/**
* Returns {@code true} if this AsyncAppender will take a snapshot of the stack with
* every log event to determine the class and method where the logging call
@@ -102,7 +102,7 @@ public class AsyncAppenderAdmin implements AsyncAppenderAdminMBean {
public boolean isIncludeLocation() {
return asyncAppender.isIncludeLocation();
}
-
+
/**
* Returns {@code true} if this AsyncAppender will block when the queue is full,
* or {@code false} if events are dropped when the queue is full.
@@ -112,7 +112,7 @@ public class AsyncAppenderAdmin implements AsyncAppenderAdminMBean {
public boolean isBlocking() {
return asyncAppender.isBlocking();
}
-
+
/**
* Returns the name of the appender that any errors are logged to or {@code null}.
* @return the name of the appender that any errors are logged to or {@code null}
@@ -121,12 +121,12 @@ public class AsyncAppenderAdmin implements AsyncAppenderAdminMBean {
public String getErrorRef() {
return asyncAppender.getErrorRef();
}
-
+
@Override
public int getQueueCapacity() {
return asyncAppender.getQueueCapacity();
}
-
+
@Override
public int getQueueRemainingCapacity() {
return asyncAppender.getQueueRemainingCapacity();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AsyncAppenderAdminMBean.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AsyncAppenderAdminMBean.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AsyncAppenderAdminMBean.java
index 7348145..37dad2e 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AsyncAppenderAdminMBean.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AsyncAppenderAdminMBean.java
@@ -27,7 +27,7 @@ public interface AsyncAppenderAdminMBean {
* <p>
* You can find all registered AsyncAppenderAdmin MBeans like this:
* </p>
- *
+ *
* <pre>
* MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
* String pattern = String.format(AsyncAppenderAdminMBean.PATTERN, "*", "*");
@@ -38,21 +38,21 @@ public interface AsyncAppenderAdminMBean {
* and appender name may be quoted. When AsyncAppenderAdmin MBeans are
* registered, their ObjectNames are created using this pattern as follows:
* </p>
- *
+ *
* <pre>
* String ctxName = Server.escape(loggerContext.getName());
* String appenderName = Server.escape(appender.getName());
* String name = String.format(PATTERN, ctxName, appenderName);
* ObjectName objectName = new ObjectName(name);
* </pre>
- *
+ *
* @see Server#escape(String)
*/
String PATTERN = Server.DOMAIN + ":type=%s,component=AsyncAppenders,name=%s";
/**
* Returns the name of the instrumented {@code AsyncAppender}.
- *
+ *
* @return the name of the AsyncAppender
*/
String getName();
@@ -60,7 +60,7 @@ public interface AsyncAppenderAdminMBean {
/**
* Returns the result of calling {@code toString} on the {@code Layout}
* object of the instrumented {@code AsyncAppender}.
- *
+ *
* @return the {@code Layout} of the instrumented {@code AsyncAppender} as a
* string
*/
@@ -69,7 +69,7 @@ public interface AsyncAppenderAdminMBean {
/**
* Returns how exceptions thrown on the instrumented {@code AsyncAppender}
* are handled.
- *
+ *
* @return {@code true} if any exceptions thrown by the AsyncAppender will
* be logged or {@code false} if such exceptions are re-thrown.
*/
@@ -78,7 +78,7 @@ public interface AsyncAppenderAdminMBean {
/**
* Returns the result of calling {@code toString} on the error handler of
* this appender, or {@code "null"} if no error handler was set.
- *
+ *
* @return result of calling {@code toString} on the error handler of this
* appender, or {@code "null"}
*/
@@ -87,7 +87,7 @@ public interface AsyncAppenderAdminMBean {
/**
* Returns a string description of all filters configured for the
* instrumented {@code AsyncAppender}.
- *
+ *
* @return a string description of all configured filters for this appender
*/
String getFilter();
@@ -95,7 +95,7 @@ public interface AsyncAppenderAdminMBean {
/**
* Returns a String array with the appender refs configured for the
* instrumented {@code AsyncAppender}.
- *
+ *
* @return the appender refs for the instrumented {@code AsyncAppender}.
*/
String[] getAppenderRefs();
@@ -104,7 +104,7 @@ public interface AsyncAppenderAdminMBean {
* Returns {@code true} if this AsyncAppender will take a snapshot of the
* stack with every log event to determine the class and method where the
* logging call was made.
- *
+ *
* @return {@code true} if location is included with every event,
* {@code false} otherwise
*/
@@ -113,19 +113,19 @@ public interface AsyncAppenderAdminMBean {
/**
* Returns {@code true} if this AsyncAppender will block when the queue is
* full, or {@code false} if events are dropped when the queue is full.
- *
+ *
* @return whether this AsyncAppender will block or drop events when the
* queue is full.
*/
boolean isBlocking();
-
+
/**
* Returns the name of the appender that any errors are logged to or {@code null}.
* @return the name of the appender that any errors are logged to or {@code null}
*/
String getErrorRef();
-
+
int getQueueCapacity();
-
+
int getQueueRemainingCapacity();
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdmin.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdmin.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdmin.java
index 53b6079..fb41b04 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdmin.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdmin.java
@@ -32,7 +32,7 @@ public class ContextSelectorAdmin implements ContextSelectorAdminMBean {
/**
* Constructs a new {@code ContextSelectorAdmin}.
- *
+ *
* @param contextName name of the LoggerContext under which to register this
* ContextSelectorAdmin. Note that the ContextSelector may be
* registered multiple times, once for each LoggerContext. In web
@@ -55,7 +55,7 @@ public class ContextSelectorAdmin implements ContextSelectorAdminMBean {
/**
* Returns the {@code ObjectName} of this mbean.
- *
+ *
* @return the {@code ObjectName}
* @see ContextSelectorAdminMBean#PATTERN
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdminMBean.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdminMBean.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdminMBean.java
index 6cb65d6..7526982 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdminMBean.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdminMBean.java
@@ -32,7 +32,7 @@ public interface LoggerContextAdminMBean {
* <p>
* You can find all registered LoggerContextAdmin MBeans like this:
* </p>
- *
+ *
* <pre>
* MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
* String pattern = String.format(LoggerContextAdminMBean.PATTERN, "*");
@@ -43,13 +43,13 @@ public interface LoggerContextAdminMBean {
* may be quoted. When LoggerContextAdmin MBeans are registered, their
* ObjectNames are created using this pattern as follows:
* </p>
- *
+ *
* <pre>
* String ctxName = Server.escape(loggerContext.getName());
* String name = String.format(PATTERN, ctxName);
* ObjectName objectName = new ObjectName(name);
* </pre>
- *
+ *
* @see Server#escape(String)
*/
String PATTERN = Server.DOMAIN + ":type=%s";
@@ -69,21 +69,21 @@ public interface LoggerContextAdminMBean {
/**
* Returns the status of the instrumented {@code LoggerContext}.
- *
+ *
* @return the LoggerContext status.
*/
String getStatus();
/**
* Returns the name of the instrumented {@code LoggerContext}.
- *
+ *
* @return the name of the instrumented {@code LoggerContext}.
*/
String getName();
/**
* Returns the configuration location URI as a String.
- *
+ *
* @return the configuration location
*/
String getConfigLocationUri();
@@ -91,7 +91,7 @@ public interface LoggerContextAdminMBean {
/**
* Sets the configuration location to the specified URI. This will cause the
* instrumented {@code LoggerContext} to reconfigure.
- *
+ *
* @param configLocation location of the configuration file in
* {@link java.net.URI} format.
* @throws URISyntaxException if the format of the specified
@@ -105,7 +105,7 @@ public interface LoggerContextAdminMBean {
* configuration file or the text that was last set with a call to
* {@code setConfigText}. If reading a file, this method assumes the file's
* character encoding is UTF-8.
- *
+ *
* @return the configuration text
* @throws IOException if a problem occurred reading the contents of the
* config file.
@@ -116,7 +116,7 @@ public interface LoggerContextAdminMBean {
* Returns the configuration text, which may be the contents of the
* configuration file or the text that was last set with a call to
* {@code setConfigText}.
- *
+ *
* @param charsetName the encoding to use to convert the file's bytes into
* the resulting string.
* @return the configuration text
@@ -129,7 +129,7 @@ public interface LoggerContextAdminMBean {
* Sets the configuration text. This does not replace the contents of the
* configuration file, but <em>does</em> cause the instrumented
* {@code LoggerContext} to be reconfigured with the specified text.
- *
+ *
* @param configText the configuration text in XML or JSON format
* @param charsetName name of the {@code Charset} used to convert the
* specified configText to bytes
@@ -140,7 +140,7 @@ public interface LoggerContextAdminMBean {
/**
* Returns the name of the Configuration of the instrumented LoggerContext.
- *
+ *
* @return the Configuration name
*/
String getConfigName();
@@ -148,7 +148,7 @@ public interface LoggerContextAdminMBean {
/**
* Returns the class name of the {@code Configuration} of the instrumented
* LoggerContext.
- *
+ *
* @return the class name of the {@code Configuration}.
*/
String getConfigClassName();
@@ -156,14 +156,14 @@ public interface LoggerContextAdminMBean {
/**
* Returns a string description of all Filters configured in the
* {@code Configuration} of the instrumented LoggerContext.
- *
+ *
* @return a string description of all Filters configured
*/
String getConfigFilter();
/**
* Returns a map with configured properties.
- *
+ *
* @return a map with configured properties.
*/
Map<String, String> getConfigProperties();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/RingBufferAdmin.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/RingBufferAdmin.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/RingBufferAdmin.java
index b40d2f4..15a9e56 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/RingBufferAdmin.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/RingBufferAdmin.java
@@ -34,28 +34,28 @@ public class RingBufferAdmin implements RingBufferAdminMBean {
return new RingBufferAdmin(ringBuffer, name);
}
- public static RingBufferAdmin forAsyncLoggerConfig(final RingBuffer<?> ringBuffer,
+ public static RingBufferAdmin forAsyncLoggerConfig(final RingBuffer<?> ringBuffer,
final String contextName, final String configName) {
final String ctxName = Server.escape(contextName);
final String cfgName = Server.escape(configName);
final String name = String.format(PATTERN_ASYNC_LOGGER_CONFIG, ctxName, cfgName);
return new RingBufferAdmin(ringBuffer, name);
}
-
+
protected RingBufferAdmin(final RingBuffer<?> ringBuffer, final String mbeanName) {
- this.ringBuffer = ringBuffer;
+ this.ringBuffer = ringBuffer;
try {
objectName = new ObjectName(mbeanName);
} catch (final Exception e) {
throw new IllegalStateException(e);
}
}
-
+
@Override
public long getBufferSize() {
return ringBuffer == null ? 0 : ringBuffer.getBufferSize();
}
-
+
@Override
public long getRemainingCapacity() {
return ringBuffer == null ? 0 : ringBuffer.remainingCapacity();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/RingBufferAdminMBean.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/RingBufferAdminMBean.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/RingBufferAdminMBean.java
index 83a8278..052dcc8 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/RingBufferAdminMBean.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/RingBufferAdminMBean.java
@@ -35,7 +35,7 @@ public interface RingBufferAdminMBean {
* </pre>
*/
String PATTERN_ASYNC_LOGGER = Server.DOMAIN + ":type=%s,component=AsyncLoggerRingBuffer";
-
+
/**
* ObjectName pattern ({@value}) for RingBufferAdmin MBeans that instrument
* {@code AsyncLoggerConfig} ring buffers.
@@ -56,7 +56,7 @@ public interface RingBufferAdminMBean {
* Returns the number of slots that the ring buffer was configured with.
* Disruptor ring buffers are bounded-size data structures, this number does
* not change during the life of the ring buffer.
- *
+ *
* @return the number of slots that the ring buffer was configured with
*/
long getBufferSize();
@@ -64,7 +64,7 @@ public interface RingBufferAdminMBean {
/**
* Returns the number of available slots in the ring buffer. May vary wildly
* between invocations.
- *
+ *
* @return the number of available slots in the ring buffer
*/
long getRemainingCapacity();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdmin.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdmin.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdmin.java
index dbd7a6b..a602f4e 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdmin.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdmin.java
@@ -44,7 +44,7 @@ public class StatusLoggerAdmin extends NotificationBroadcasterSupport implements
/**
* Constructs a new {@code StatusLoggerAdmin} with the {@code Executor} to
* be used for sending {@code Notification}s asynchronously to listeners.
- *
+ *
* @param contextName name of the LoggerContext under which to register this
* StatusLoggerAdmin. Note that the StatusLogger may be
* registered multiple times, once for each LoggerContext. In web
@@ -132,7 +132,7 @@ public class StatusLoggerAdmin extends NotificationBroadcasterSupport implements
/*
* (non-Javadoc)
- *
+ *
* @see
* org.apache.logging.log4j.status.StatusListener#log(org.apache.logging
* .log4j.status.StatusData)
@@ -150,7 +150,7 @@ public class StatusLoggerAdmin extends NotificationBroadcasterSupport implements
/**
* Returns the {@code ObjectName} of this mbean.
- *
+ *
* @return the {@code ObjectName}
* @see StatusLoggerAdminMBean#PATTERN
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdminMBean.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdminMBean.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdminMBean.java
index e6510e6..91a6063 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdminMBean.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdminMBean.java
@@ -68,7 +68,7 @@ public interface StatusLoggerAdminMBean {
* @return the ObjectName of this StatusLogger MBean
*/
ObjectName getObjectName();
-
+
/**
* Returns a list with the most recent {@code StatusData} objects in the
* status history. The list has up to 200 entries by default but the length
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractCsvLayout.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractCsvLayout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractCsvLayout.java
index dee3cc9..e47b5e6 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractCsvLayout.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractCsvLayout.java
@@ -24,9 +24,9 @@ import org.apache.logging.log4j.core.config.Configuration;
/**
* A superclass for Comma-Separated Value (CSV) layouts.
- *
+ *
* Depends on Apache Commons CSV 1.2.
- *
+ *
* @since 2.4
*/
public abstract class AbstractCsvLayout extends AbstractStringLayout {
@@ -67,7 +67,7 @@ public abstract class AbstractCsvLayout extends AbstractStringLayout {
protected AbstractCsvLayout(final Configuration config, final Charset charset, final CSVFormat csvFormat,
final String header, final String footer) {
- super(config, charset,
+ super(config, charset,
PatternLayout.newSerializerBuilder().setConfiguration(config).setPattern(header).build(),
PatternLayout.newSerializerBuilder().setConfiguration(config).setPattern(footer).build());
this.format = csvFormat;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractJacksonLayout.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractJacksonLayout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractJacksonLayout.java
index 2e6f652..d764d55 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractJacksonLayout.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractJacksonLayout.java
@@ -177,7 +177,7 @@ abstract class AbstractJacksonLayout extends AbstractStringLayout {
*
* @return this builder
*/
- public B setAdditionalFields(final KeyValuePair[] additionalFields) {
+ public B setAdditionalFields(KeyValuePair[] additionalFields) {
this.additionalFields = additionalFields;
return asBuilder();
}
@@ -231,7 +231,7 @@ abstract class AbstractJacksonLayout extends AbstractStringLayout {
final ResolvableKeyValuePair[] resolvableFields = new ResolvableKeyValuePair[additionalFields.length];
for (int i = 0; i < additionalFields.length; i++) {
- final ResolvableKeyValuePair resolvable = resolvableFields[i] = new ResolvableKeyValuePair(additionalFields[i]);
+ ResolvableKeyValuePair resolvable = resolvableFields[i] = new ResolvableKeyValuePair(additionalFields[i]);
// Validate
if (config == null && resolvable.valueNeedsLookup) {
@@ -271,7 +271,7 @@ abstract class AbstractJacksonLayout extends AbstractStringLayout {
protected Object wrapLogEvent(final LogEvent event) {
if (additionalFields.length > 0) {
// Construct map for serialization - note that we are intentionally using original LogEvent
- final Map<String, String> additionalFieldsMap = resolveAdditionalFields(event);
+ Map<String, String> additionalFieldsMap = resolveAdditionalFields(event);
// This class combines LogEvent with AdditionalFields during serialization
return new LogEventWithAdditionalFields(event, additionalFieldsMap);
} else {
@@ -280,13 +280,13 @@ abstract class AbstractJacksonLayout extends AbstractStringLayout {
}
}
- private Map<String, String> resolveAdditionalFields(final LogEvent logEvent) {
+ private Map<String, String> resolveAdditionalFields(LogEvent logEvent) {
// Note: LinkedHashMap retains order
final Map<String, String> additionalFieldsMap = new LinkedHashMap<>(additionalFields.length);
final StrSubstitutor strSubstitutor = configuration.getStrSubstitutor();
// Go over each field
- for (final ResolvableKeyValuePair pair : additionalFields) {
+ for (ResolvableKeyValuePair pair : additionalFields) {
if (pair.valueNeedsLookup) {
// Resolve value
additionalFieldsMap.put(pair.key, strSubstitutor.replace(logEvent, pair.value));
@@ -316,7 +316,7 @@ abstract class AbstractJacksonLayout extends AbstractStringLayout {
private final Object logEvent;
private final Map<String, String> additionalFields;
- public LogEventWithAdditionalFields(final Object logEvent, final Map<String, String> additionalFields) {
+ public LogEventWithAdditionalFields(Object logEvent, Map<String, String> additionalFields) {
this.logEvent = logEvent;
this.additionalFields = additionalFields;
}
@@ -339,7 +339,7 @@ abstract class AbstractJacksonLayout extends AbstractStringLayout {
final String value;
final boolean valueNeedsLookup;
- ResolvableKeyValuePair(final KeyValuePair pair) {
+ ResolvableKeyValuePair(KeyValuePair pair) {
this.key = pair.getKey();
this.value = pair.getValue();
this.valueNeedsLookup = AbstractJacksonLayout.valueNeedsLookup(this.value);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/CsvParameterLayout.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/CsvParameterLayout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/CsvParameterLayout.java
index 549bedd..fe079fb 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/CsvParameterLayout.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/CsvParameterLayout.java
@@ -34,17 +34,17 @@ import org.apache.logging.log4j.status.StatusLogger;
/**
* A Comma-Separated Value (CSV) layout to log event parameters.
- * The event message is currently ignored.
- *
+ * The event message is currently ignored.
+ *
* <p>
* Best used with:
* </p>
* <p>
* {@code logger.debug(new ObjectArrayMessage(1, 2, "Bob"));}
* </p>
- *
+ *
* Depends on Apache Commons CSV 1.4.
- *
+ *
* @since 2.4
*/
@Plugin(name = "CsvParameterLayout", category = Node.CATEGORY, elementType = Layout.ELEMENT_TYPE, printObject = true)
@@ -70,7 +70,7 @@ public class CsvParameterLayout extends AbstractCsvLayout {
@PluginAttribute("nullString") final String nullString,
@PluginAttribute("recordSeparator") final String recordSeparator,
@PluginAttribute(value = "charset", defaultString = DEFAULT_CHARSET) final Charset charset,
- @PluginAttribute("header") final String header,
+ @PluginAttribute("header") final String header,
@PluginAttribute("footer") final String footer)
// @formatter:on
{
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/JsonLayout.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/JsonLayout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/JsonLayout.java
index fbbd597..607ec43 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/JsonLayout.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/JsonLayout.java
@@ -126,7 +126,7 @@ public final class JsonLayout extends AbstractJacksonLayout {
}
@Override
- public B setAdditionalFields(final KeyValuePair[] additionalFields) {
+ public B setAdditionalFields(KeyValuePair[] additionalFields) {
this.additionalFields = additionalFields;
return asBuilder();
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/MarkerPatternSelector.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/MarkerPatternSelector.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/MarkerPatternSelector.java
index d91e53a..719af9d 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/MarkerPatternSelector.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/MarkerPatternSelector.java
@@ -47,16 +47,16 @@ public class MarkerPatternSelector implements PatternSelector {
@PluginElement("PatternMatch")
private PatternMatch[] properties;
-
+
@PluginBuilderAttribute("defaultPattern")
private String defaultPattern;
-
- @PluginBuilderAttribute(value = "alwaysWriteExceptions")
+
+ @PluginBuilderAttribute(value = "alwaysWriteExceptions")
private boolean alwaysWriteExceptions = true;
-
+
@PluginBuilderAttribute(value = "disableAnsi")
private boolean disableAnsi;
-
+
@PluginBuilderAttribute(value = "noConsoleNoAnsi")
private boolean noConsoleNoAnsi;
@@ -107,7 +107,7 @@ public class MarkerPatternSelector implements PatternSelector {
}
}
-
+
private final Map<String, PatternFormatter[]> formatterMap = new HashMap<>();
private final Map<String, String> patternMap = new HashMap<>();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java
index 15e176e..57cbb9c 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java
@@ -551,9 +551,9 @@ public final class PatternLayout extends AbstractStringLayout {
}
private boolean useAnsiEscapeCodes() {
- final PropertiesUtil propertiesUtil = PropertiesUtil.getProperties();
- final boolean isPlatformSupportsAnsi = !propertiesUtil.isOsWindows();
- final boolean isJansiRequested = !propertiesUtil.getBooleanProperty("log4j.skipJansi", true);
+ PropertiesUtil propertiesUtil = PropertiesUtil.getProperties();
+ boolean isPlatformSupportsAnsi = !propertiesUtil.isOsWindows();
+ boolean isJansiRequested = !propertiesUtil.getBooleanProperty("log4j.skipJansi", true);
return isPlatformSupportsAnsi || isJansiRequested;
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java
index f019e84..bd5fb95 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java
@@ -391,7 +391,7 @@ public final class Rfc5424Layout extends AbstractStringLayout {
if (isStructured) {
if (message instanceof MessageCollectionMessage) {
- for (final StructuredDataMessage data : ((StructuredDataCollectionMessage)message)) {
+ for (StructuredDataMessage data : ((StructuredDataCollectionMessage)message)) {
addStructuredData(sdElements, data);
}
} else {
[11/13] logging-log4j2 git commit: Revert "Use final. Remove trailing
spaces."
Posted by gg...@apache.org.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/util/SystemPropertiesMain.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/SystemPropertiesMain.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/SystemPropertiesMain.java
index 605afb4..19b4981 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/SystemPropertiesMain.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/SystemPropertiesMain.java
@@ -28,20 +28,19 @@ public class SystemPropertiesMain {
/**
* Prints system properties to the console.
- *
+ *
* @param args
* unused
*/
- public static void main(final String[] args) {
+ public static void main(String[] args) {
@SuppressWarnings("unchecked")
- final
Enumeration<String> keyEnum = (Enumeration<String>) System.getProperties().propertyNames();
- final List<String> list = new ArrayList<>();
+ List<String> list = new ArrayList<>();
while (keyEnum.hasMoreElements()) {
list.add(keyEnum.nextElement());
}
Collections.sort(list);
- for (final String key : list) {
+ for (String key : list) {
System.out.println(key + " = " + System.getProperty(key));
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/util/SystemPropertiesPropertySourceSecurityManagerIT.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/SystemPropertiesPropertySourceSecurityManagerIT.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/SystemPropertiesPropertySourceSecurityManagerIT.java
index aeb31f6..ebab710 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/SystemPropertiesPropertySourceSecurityManagerIT.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/SystemPropertiesPropertySourceSecurityManagerIT.java
@@ -32,7 +32,7 @@ import org.junit.Test;
* integration tests (classes that end in "IT" instead of "Test" and
* "TestCase".)
* </p>
- *
+ *
* @see SystemPropertiesPropertySource
* @see SecurityManager
* @see System#setSecurityManager(SecurityManager)
@@ -60,7 +60,7 @@ public class SystemPropertiesPropertySourceSecurityManagerIT {
* Makes sure we do not blow up with exception below due to a security manager
* rejecting environment variable access in
* {@link SystemPropertiesPropertySource}.
- *
+ *
* <pre>
* java.lang.ExceptionInInitializerError
* at org.apache.logging.log4j.util.SystemPropertiesPropertySourceSecurityManagerTest.test(SystemPropertiesPropertySourceSecurityManagerTest.java:64)
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/test/java/org/apache/logging/log4j/util/SystemPropertiesPropertySourceTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/SystemPropertiesPropertySourceTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/SystemPropertiesPropertySourceTest.java
index 5075111..e492e4a 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/SystemPropertiesPropertySourceTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/SystemPropertiesPropertySourceTest.java
@@ -34,7 +34,7 @@ public class SystemPropertiesPropertySourceTest {
/**
* Tests avoiding a ConcurrentModificationException. For example:
- *
+ *
* <pre>
* java.util.ConcurrentModificationException
* at java.util.Hashtable$Enumerator.next(Hashtable.java:1167)
@@ -44,9 +44,9 @@ public class SystemPropertiesPropertySourceTest {
*/
@Test
public void testMultiThreadedAccess() throws InterruptedException, ExecutionException {
- final ExecutorService threadPool = Executors.newSingleThreadExecutor();
+ ExecutorService threadPool = Executors.newSingleThreadExecutor();
try {
- final Future<?> future = threadPool.submit(new Runnable() {
+ Future<?> future = threadPool.submit(new Runnable() {
@Override
public void run() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-appserver/src/main/java/org/apache/logging/log4j/appserver/jetty/Log4j2Logger.java
----------------------------------------------------------------------
diff --git a/log4j-appserver/src/main/java/org/apache/logging/log4j/appserver/jetty/Log4j2Logger.java b/log4j-appserver/src/main/java/org/apache/logging/log4j/appserver/jetty/Log4j2Logger.java
index 5b4bac2..561cfaf 100644
--- a/log4j-appserver/src/main/java/org/apache/logging/log4j/appserver/jetty/Log4j2Logger.java
+++ b/log4j-appserver/src/main/java/org/apache/logging/log4j/appserver/jetty/Log4j2Logger.java
@@ -26,7 +26,7 @@ import org.eclipse.jetty.util.log.Logger;
/**
* Provides a native Apache Log4j 2 logger for Eclipse Jetty logging.
- *
+ *
* <p>
* To direct Jetty to use this class, set the system property {{org.eclipse.jetty.util.log.class}} to this class name.
* </p>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-cassandra/src/main/java/org/apache/logging/log4j/cassandra/CassandraManager.java
----------------------------------------------------------------------
diff --git a/log4j-cassandra/src/main/java/org/apache/logging/log4j/cassandra/CassandraManager.java b/log4j-cassandra/src/main/java/org/apache/logging/log4j/cassandra/CassandraManager.java
index 391857b..65ee60e 100644
--- a/log4j-cassandra/src/main/java/org/apache/logging/log4j/cassandra/CassandraManager.java
+++ b/log4j-cassandra/src/main/java/org/apache/logging/log4j/cassandra/CassandraManager.java
@@ -92,7 +92,7 @@ public class CassandraManager extends AbstractDatabaseManager {
protected void writeInternal(final LogEvent event) {
writeInternal(event, null);
}
-
+
@Override
protected void writeInternal(final LogEvent event, final Serializable serializable) {
for (int i = 0; i < columnMappings.size(); i++) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core-its/src/test/java/org/apache/logging/log4j/core/SimplePerfTest.java
----------------------------------------------------------------------
diff --git a/log4j-core-its/src/test/java/org/apache/logging/log4j/core/SimplePerfTest.java b/log4j-core-its/src/test/java/org/apache/logging/log4j/core/SimplePerfTest.java
index e24f5f8..97ed395 100644
--- a/log4j-core-its/src/test/java/org/apache/logging/log4j/core/SimplePerfTest.java
+++ b/log4j-core-its/src/test/java/org/apache/logging/log4j/core/SimplePerfTest.java
@@ -49,7 +49,7 @@ public class SimplePerfTest {
public static void setupClass() {
final Configuration config = LoggerContext.getContext().getConfiguration();
-
+
if (!DefaultConfiguration.DEFAULT_NAME.equals(config.getName())) {
System.out.println("Configuration was " + config.getName());
LoggerContext.getContext().start(new DefaultConfiguration());
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/AbstractLifeCycle.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/AbstractLifeCycle.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/AbstractLifeCycle.java
index 46b10a5..cf2961d 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/AbstractLifeCycle.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/AbstractLifeCycle.java
@@ -39,7 +39,7 @@ public class AbstractLifeCycle implements LifeCycle2 {
/**
* Gets the status logger.
- *
+ *
* @return the status logger.
*/
protected static org.apache.logging.log4j.Logger getStatusLogger() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/DefaultLoggerContextAccessor.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/DefaultLoggerContextAccessor.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/DefaultLoggerContextAccessor.java
index ef9837e..4401247 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/DefaultLoggerContextAccessor.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/DefaultLoggerContextAccessor.java
@@ -29,7 +29,7 @@ public class DefaultLoggerContextAccessor implements LoggerContextAccessor {
/*
* Returns the current LoggerContext.
- *
+ *
* @see org.apache.logging.log4j.core.LoggerContextAccessor#getLoggerContext()
*/
@Override
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/LogEvent.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/LogEvent.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/LogEvent.java
index 0aa77a0..0879f40 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/LogEvent.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/LogEvent.java
@@ -51,7 +51,7 @@ public interface LogEvent extends Serializable {
/**
* Returns an immutable version of this log event, which MAY BE a copy of this event.
- *
+ *
* @return an immutable version of this log event
*/
LogEvent toImmutable();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/StringLayout.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/StringLayout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/StringLayout.java
index 895393f..3eb99e8 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/StringLayout.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/StringLayout.java
@@ -1,33 +1,33 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core;
-
-import java.nio.charset.Charset;
-
-/**
- * Instantiates the @{link Layout} type for String-based layouts.
- */
-public interface StringLayout extends Layout<String> {
-
- /**
- * Gets the Charset this layout uses to encode Strings into bytes.
- *
- * @return the Charset this layout uses to encode Strings into bytes.
- */
- Charset getCharset();
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.core;
+
+import java.nio.charset.Charset;
+
+/**
+ * Instantiates the @{link Layout} type for String-based layouts.
+ */
+public interface StringLayout extends Layout<String> {
+
+ /**
+ * Gets the Charset this layout uses to encode Strings into bytes.
+ *
+ * @return the Charset this layout uses to encode Strings into bytes.
+ */
+ Charset getCharset();
+
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/Version.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/Version.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/Version.java
index 13e2bf8..afab5c9 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/Version.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/Version.java
@@ -22,7 +22,7 @@ public class Version {
public static void main(final String[] args) {
System.out.println(getProductString());
}
-
+
public static String getProductString() {
final Package pkg = Version.class.getPackage();
if (pkg == null) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java
index aa844ff..77e547e 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java
@@ -42,15 +42,15 @@ import org.apache.logging.log4j.core.util.Integers;
public abstract class AbstractAppender extends AbstractFilterable implements Appender {
/**
- * Subclasses can extend this abstract Builder.
- *
+ * Subclasses can extend this abstract Builder.
+ *
* @param <B> The type to build.
*/
public abstract static class Builder<B extends Builder<B>> extends AbstractFilterable.Builder<B> {
@PluginBuilderAttribute
private boolean ignoreExceptions = true;
-
+
@PluginElement("Layout")
private Layout<? extends Serializable> layout;
@@ -110,7 +110,7 @@ public abstract class AbstractAppender extends AbstractFilterable implements App
this.name = name;
return asBuilder();
}
-
+
/**
* @deprecated Use {@link #setConfiguration(Configuration)}
*/
@@ -143,9 +143,9 @@ public abstract class AbstractAppender extends AbstractFilterable implements App
public B withName(final String name) {
return setName(name);
}
-
+
}
-
+
public static int parseInt(final String s, final int defaultValue) {
try {
return Integers.parseInt(s, defaultValue);
@@ -162,7 +162,7 @@ public abstract class AbstractAppender extends AbstractFilterable implements App
/**
* Constructor that defaults to suppressing exceptions.
- *
+ *
* @param name The Appender name.
* @param filter The Filter to associate with the Appender.
* @param layout The layout to use to format the event.
@@ -175,7 +175,7 @@ public abstract class AbstractAppender extends AbstractFilterable implements App
/**
* Constructor.
- *
+ *
* @param name The Appender name.
* @param filter The Filter to associate with the Appender.
* @param layout The layout to use to format the event.
@@ -191,7 +191,7 @@ public abstract class AbstractAppender extends AbstractFilterable implements App
/**
* Constructor.
- *
+ *
* @param name The Appender name.
* @param filter The Filter to associate with the Appender.
* @param layout The layout to use to format the event.
@@ -209,7 +209,7 @@ public abstract class AbstractAppender extends AbstractFilterable implements App
/**
* Handle an error with a message using the {@link ErrorHandler} configured for this Appender.
- *
+ *
* @param msg The message.
*/
public void error(final String msg) {
@@ -219,7 +219,7 @@ public abstract class AbstractAppender extends AbstractFilterable implements App
/**
* Handle an error with a message, exception, and a logging event, using the {@link ErrorHandler} configured for
* this Appender.
- *
+ *
* @param msg The message.
* @param event The LogEvent.
* @param t The Throwable.
@@ -230,7 +230,7 @@ public abstract class AbstractAppender extends AbstractFilterable implements App
/**
* Handle an error with a message and an exception using the {@link ErrorHandler} configured for this Appender.
- *
+ *
* @param msg The message.
* @param t The Throwable.
*/
@@ -240,7 +240,7 @@ public abstract class AbstractAppender extends AbstractFilterable implements App
/**
* Returns the ErrorHandler, if any.
- *
+ *
* @return The ErrorHandler.
*/
@Override
@@ -250,7 +250,7 @@ public abstract class AbstractAppender extends AbstractFilterable implements App
/**
* Returns the Layout for the appender.
- *
+ *
* @return The Layout used to format the event.
*/
@Override
@@ -260,7 +260,7 @@ public abstract class AbstractAppender extends AbstractFilterable implements App
/**
* Returns the name of the Appender.
- *
+ *
* @return The name of the Appender.
*/
@Override
@@ -281,7 +281,7 @@ public abstract class AbstractAppender extends AbstractFilterable implements App
/**
* The handler must be set before the appender is started.
- *
+ *
* @param handler The ErrorHandler to use.
*/
@Override
@@ -299,7 +299,7 @@ public abstract class AbstractAppender extends AbstractFilterable implements App
/**
* Serializes the given event using the appender's layout if present.
- *
+ *
* @param event
* the event to serialize.
* @return the serialized event or null if no layout is present.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractFileAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractFileAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractFileAppender.java
index f9283f0..7537d99 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractFileAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractFileAppender.java
@@ -35,7 +35,7 @@ public abstract class AbstractFileAppender<M extends OutputStreamManager> extend
/**
* Builds FileAppender instances.
- *
+ *
* @param <B>
* The type to build
*/
@@ -151,7 +151,7 @@ public abstract class AbstractFileAppender<M extends OutputStreamManager> extend
}
}
-
+
private final String fileName;
private final Advertiser advertiser;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractOutputStreamAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractOutputStreamAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractOutputStreamAppender.java
index 25803a3..d6acc08 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractOutputStreamAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractOutputStreamAppender.java
@@ -34,12 +34,12 @@ import org.apache.logging.log4j.core.util.Constants;
public abstract class AbstractOutputStreamAppender<M extends OutputStreamManager> extends AbstractAppender {
/**
- * Subclasses can extend this abstract Builder.
- *
+ * Subclasses can extend this abstract Builder.
+ *
* @param <B> The type to build.
*/
public abstract static class Builder<B extends Builder<B>> extends AbstractAppender.Builder<B> {
-
+
@PluginBuilderAttribute
private boolean bufferedIo = true;
@@ -60,12 +60,12 @@ public abstract class AbstractOutputStreamAppender<M extends OutputStreamManager
public boolean isImmediateFlush() {
return immediateFlush;
}
-
+
public B withImmediateFlush(final boolean immediateFlush) {
this.immediateFlush = immediateFlush;
return asBuilder();
}
-
+
public B withBufferedIo(final boolean bufferedIo) {
this.bufferedIo = bufferedIo;
return asBuilder();
@@ -77,7 +77,7 @@ public abstract class AbstractOutputStreamAppender<M extends OutputStreamManager
}
}
-
+
/**
* Immediate flush means that the underlying writer or output stream will be flushed at the end of each append
* operation. Immediate flush is slower but ensures that each append request is actually written. If
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractWriterAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractWriterAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractWriterAppender.java
index 078f6cb..f94ef59 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractWriterAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractWriterAppender.java
@@ -28,7 +28,7 @@ import org.apache.logging.log4j.core.config.Property;
/**
* Appends log events as strings to a writer.
- *
+ *
* @param <M>
* The kind of {@link WriterManager} under management
*/
@@ -49,18 +49,18 @@ public abstract class AbstractWriterAppender<M extends WriterManager> extends Ab
/**
* Instantiates.
- *
+ *
* @param name
* The name of the Appender.
* @param layout
* The layout to format the message.
- * @param properties
+ * @param properties
* Optional properties.
* @param manager
* The OutputStreamManager.
*/
protected AbstractWriterAppender(final String name, final StringLayout layout, final Filter filter,
- final boolean ignoreExceptions, final boolean immediateFlush, final Property[] properties, final M manager) {
+ final boolean ignoreExceptions, final boolean immediateFlush, Property[] properties, final M manager) {
super(name, filter, layout, ignoreExceptions, properties);
this.manager = manager;
this.immediateFlush = immediateFlush;
@@ -68,7 +68,7 @@ public abstract class AbstractWriterAppender<M extends WriterManager> extends Ab
/**
* Instantiates.
- *
+ *
* @param name
* The name of the Appender.
* @param layout
@@ -90,7 +90,7 @@ public abstract class AbstractWriterAppender<M extends WriterManager> extends Ab
* <p>
* Most subclasses will need to override this method.
* </p>
- *
+ *
* @param event
* The LogEvent.
*/
@@ -115,7 +115,7 @@ public abstract class AbstractWriterAppender<M extends WriterManager> extends Ab
/**
* Gets the manager.
- *
+ *
* @return the manager.
*/
public M getManager() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderSet.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderSet.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderSet.java
index 533a604..5400d13 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderSet.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderSet.java
@@ -50,7 +50,7 @@ public class AppenderSet {
public AppenderSet build() {
if (configuration == null) {
LOGGER.error("Configuration is missing from AppenderSet {}", this);
- return null;
+ return null;
}
if (node == null) {
LOGGER.error("No node in AppenderSet {}", this);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
index f7c9694..bf8a163 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
@@ -529,8 +529,8 @@ public final class AsyncAppender extends AbstractAppender {
/**
* Returns the number of elements in the queue.
- *
- * @return the number of elements in the queue.
+ *
+ * @return the number of elements in the queue.
* @since 2.11.1
*/
public int getQueueSize() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConfigurationFactoryData.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConfigurationFactoryData.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConfigurationFactoryData.java
index 7a93ad1..cadfea0 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConfigurationFactoryData.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConfigurationFactoryData.java
@@ -40,7 +40,7 @@ public class ConfigurationFactoryData {
/**
* Gets the LoggerContext from the Configuration or null.
- *
+ *
* @return the LoggerContext from the Configuration or null.
*/
public LoggerContext getLoggerContext() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
index 540c39d..7a9864f 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
@@ -84,7 +84,7 @@ public final class ConsoleAppender extends AbstractOutputStreamAppender<OutputSt
public abstract Charset getDefaultCharset();
- protected Charset getCharset(final String property, final Charset defaultCharset) {
+ protected Charset getCharset(final String property, Charset defaultCharset) {
return new PropertiesUtil(PropertiesUtil.getSystemProperties()).getCharsetProperty(property, defaultCharset);
}
@@ -92,7 +92,7 @@ public final class ConsoleAppender extends AbstractOutputStreamAppender<OutputSt
private ConsoleAppender(final String name, final Layout<? extends Serializable> layout, final Filter filter,
final OutputStreamManager manager, final boolean ignoreExceptions, final Target target,
- final Property[] properties) {
+ Property[] properties) {
super(name, layout, filter, ignoreExceptions, true, properties, manager);
this.target = target;
}
@@ -275,7 +275,7 @@ public final class ConsoleAppender extends AbstractOutputStreamAppender<OutputSt
return outputStream;
}
- private static String clean(final String string) {
+ private static String clean(String string) {
return string.replace(Chars.NUL, Chars.SPACE);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
index 14ee729..3032e30 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
@@ -64,7 +64,7 @@ public final class FailoverAppender extends AbstractAppender {
private FailoverAppender(final String name, final Filter filter, final String primary, final String[] failovers,
final int intervalMillis, final Configuration config, final boolean ignoreExceptions,
- final Property[] properties) {
+ Property[] properties) {
super(name, filter, null, ignoreExceptions, properties);
this.primaryRef = primary;
this.failovers = failovers;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java
index 7c55fac..7dd239b 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java
@@ -45,7 +45,7 @@ public final class FileAppender extends AbstractOutputStreamAppender<FileManager
/**
* Builds FileAppender instances.
- *
+ *
* @param <B>
* The type to build
*/
@@ -186,9 +186,9 @@ public final class FileAppender extends AbstractOutputStreamAppender<FileManager
}
}
-
+
private static final int DEFAULT_BUFFER_SIZE = 8192;
-
+
/**
* Create a File Appender.
* @param fileName The name and path of the file.
@@ -240,12 +240,12 @@ public final class FileAppender extends AbstractOutputStreamAppender<FileManager
.build();
// @formatter:on
}
-
+
@PluginBuilderFactory
public static <B extends Builder<B>> B newBuilder() {
return new Builder<B>().asBuilder();
}
-
+
private final String fileName;
private final Advertiser advertiser;
@@ -254,7 +254,7 @@ public final class FileAppender extends AbstractOutputStreamAppender<FileManager
private FileAppender(final String name, final Layout<? extends Serializable> layout, final Filter filter,
final FileManager manager, final String filename, final boolean ignoreExceptions,
- final boolean immediateFlush, final Advertiser advertiser, final Property[] properties) {
+ final boolean immediateFlush, final Advertiser advertiser, Property[] properties) {
super(name, layout, filter, ignoreExceptions, immediateFlush, properties, manager);
if (advertiser != null) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppender.java
index 54b8402..15a3a63 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppender.java
@@ -45,7 +45,7 @@ public final class MemoryMappedFileAppender extends AbstractOutputStreamAppender
/**
* Builds RandomAccessFileAppender instances.
- *
+ *
* @param <B>
* The type to build
*/
@@ -118,7 +118,7 @@ public final class MemoryMappedFileAppender extends AbstractOutputStreamAppender
}
}
-
+
private static final int BIT_POSITION_1GB = 30; // 2^30 ~= 1GB
private static final int MAX_REGION_LENGTH = 1 << BIT_POSITION_1GB;
private static final int MIN_REGION_LENGTH = 256;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamAppender.java
index 7dfd187..3c84938 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamAppender.java
@@ -23,6 +23,7 @@ import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Core;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.Layout;
+import org.apache.logging.log4j.core.appender.MemoryMappedFileAppender.Builder;
import org.apache.logging.log4j.core.config.Property;
import org.apache.logging.log4j.core.config.plugins.Plugin;
import org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory;
@@ -49,7 +50,7 @@ public final class OutputStreamAppender extends AbstractOutputStreamAppender<Out
private boolean follow = false;
- private final boolean ignoreExceptions = true;
+ private boolean ignoreExceptions = true;
private OutputStream target;
@@ -72,7 +73,7 @@ public final class OutputStreamAppender extends AbstractOutputStreamAppender<Out
return asBuilder();
}
}
-
+
/**
* Holds data to pass to factory method.
*/
@@ -83,7 +84,7 @@ public final class OutputStreamAppender extends AbstractOutputStreamAppender<Out
/**
* Builds instances.
- *
+ *
* @param os
* The OutputStream.
* @param type
@@ -105,7 +106,7 @@ public final class OutputStreamAppender extends AbstractOutputStreamAppender<Out
/**
* Creates an OutputStreamManager.
- *
+ *
* @param name
* The name of the entity to manage.
* @param data
@@ -122,7 +123,7 @@ public final class OutputStreamAppender extends AbstractOutputStreamAppender<Out
/**
* Creates an OutputStream Appender.
- *
+ *
* @param layout
* The layout to use or null to get the default layout.
* @param filter
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileAppender.java
index 6970126..98df988 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileAppender.java
@@ -43,7 +43,7 @@ public final class RandomAccessFileAppender extends AbstractOutputStreamAppender
/**
* Builds RandomAccessFileAppender instances.
- *
+ *
* @param <B>
* The type to build
*/
@@ -107,14 +107,14 @@ public final class RandomAccessFileAppender extends AbstractOutputStreamAppender
}
}
-
+
private final String fileName;
private Object advertisement;
private final Advertiser advertiser;
private RandomAccessFileAppender(final String name, final Layout<? extends Serializable> layout,
final Filter filter, final RandomAccessFileManager manager, final String filename,
- final boolean ignoreExceptions, final boolean immediateFlush, final Advertiser advertiser,
+ final boolean ignoreExceptions, final boolean immediateFlush, final Advertiser advertiser,
final Property[] properties) {
super(name, layout, filter, ignoreExceptions, immediateFlush, properties, manager);
@@ -233,7 +233,7 @@ public final class RandomAccessFileAppender extends AbstractOutputStreamAppender
.withImmediateFlush(isFlush).setLayout(layout).setName(name)
.build();
}
-
+
/**
* Creates a builder for a RandomAccessFileAppender.
* @return a builder for a RandomAccessFileAppender.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java
index 8373441..ed42236 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java
@@ -54,7 +54,7 @@ public final class RollingFileAppender extends AbstractOutputStreamAppender<Roll
/**
* Builds FileAppender instances.
- *
+ *
* @param <B>
* The type to build
* @since 2.7
@@ -75,11 +75,11 @@ public final class RollingFileAppender extends AbstractOutputStreamAppender<Roll
@PluginBuilderAttribute
private boolean locking;
- @PluginElement("Policy")
+ @PluginElement("Policy")
@Required
private TriggeringPolicy policy;
-
- @PluginElement("Strategy")
+
+ @PluginElement("Strategy")
private RolloverStrategy strategy;
@PluginBuilderAttribute
@@ -266,7 +266,7 @@ public final class RollingFileAppender extends AbstractOutputStreamAppender<Roll
}
}
-
+
private static final int DEFAULT_BUFFER_SIZE = 8192;
private final String fileName;
@@ -400,7 +400,7 @@ public final class RollingFileAppender extends AbstractOutputStreamAppender<Roll
/**
* Creates a new Builder.
- *
+ *
* @return a new Builder.
* @since 2.7
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingRandomAccessFileAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingRandomAccessFileAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingRandomAccessFileAppender.java
index b84275b..87bd023 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingRandomAccessFileAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingRandomAccessFileAppender.java
@@ -195,7 +195,7 @@ public final class RollingRandomAccessFileAppender extends AbstractOutputStreamA
}
}
-
+
private final String fileName;
private final String filePattern;
private final Object advertisement;
@@ -342,7 +342,7 @@ public final class RollingRandomAccessFileAppender extends AbstractOutputStreamA
.withStrategy(strategy)
.build();
}
-
+
@PluginBuilderFactory
public static <B extends Builder<B>> B newBuilder() {
return new Builder<B>().asBuilder();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
index 316663c..39be95e 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
@@ -65,7 +65,7 @@ public class SocketAppender extends AbstractOutputStreamAppender<AbstractSocketM
* <li>Removed deprecated "delayMillis", use "reconnectionDelayMillis".</li>
* <li>Removed deprecated "reconnectionDelay", use "reconnectionDelayMillis".</li>
* </ul>
- *
+ *
* @param <B>
* The type to build.
*/
@@ -94,10 +94,10 @@ public class SocketAppender extends AbstractOutputStreamAppender<AbstractSocketM
@PluginBuilderAttribute
@PluginAliases({ "reconnectDelay", "reconnectionDelay", "delayMillis", "reconnectionDelayMillis" })
private int reconnectDelayMillis;
-
+
@PluginElement("SocketOptions")
private SocketOptions socketOptions;
-
+
@PluginElement("SslConfiguration")
@PluginAliases({ "SslConfig" })
private SslConfiguration sslConfiguration;
@@ -184,13 +184,13 @@ public class SocketAppender extends AbstractOutputStreamAppender<AbstractSocketM
}
}
-
+
/**
* Builds a SocketAppender.
- * <ul>
+ * <ul>
* <li>Removed deprecated "delayMillis", use "reconnectionDelayMillis".</li>
* <li>Removed deprecated "reconnectionDelay", use "reconnectionDelayMillis".</li>
- * </ul>
+ * </ul>
*/
public static class Builder extends AbstractBuilder<Builder>
implements org.apache.logging.log4j.core.util.Builder<SocketAppender> {
@@ -226,7 +226,7 @@ public class SocketAppender extends AbstractOutputStreamAppender<AbstractSocketM
getPropertyArray());
}
}
-
+
@PluginBuilderFactory
public static Builder newBuilder() {
return new Builder();
@@ -341,7 +341,7 @@ public class SocketAppender extends AbstractOutputStreamAppender<AbstractSocketM
.build();
// @formatter:on
}
-
+
/**
* Creates a socket appender.
*
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
index 7ccb80d..87ec9f8 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
@@ -55,52 +55,52 @@ public class SyslogAppender extends SocketAppender {
@PluginBuilderAttribute("id")
private String id;
-
+
@PluginBuilderAttribute(value = "enterpriseNumber")
private int enterpriseNumber = Rfc5424Layout.DEFAULT_ENTERPRISE_NUMBER;
-
+
@PluginBuilderAttribute(value = "includeMdc")
private boolean includeMdc = true;
-
+
@PluginBuilderAttribute("mdcId")
private String mdcId;
-
+
@PluginBuilderAttribute("mdcPrefix")
private String mdcPrefix;
-
+
@PluginBuilderAttribute("eventPrefix")
private String eventPrefix;
-
+
@PluginBuilderAttribute(value = "newLine")
private boolean newLine;
-
+
@PluginBuilderAttribute("newLineEscape")
private String escapeNL;
-
+
@PluginBuilderAttribute("appName")
private String appName;
-
+
@PluginBuilderAttribute("messageId")
private String msgId;
-
+
@PluginBuilderAttribute("mdcExcludes")
private String excludes;
-
+
@PluginBuilderAttribute("mdcIncludes")
private String includes;
-
+
@PluginBuilderAttribute("mdcRequired")
private String required;
-
+
@PluginBuilderAttribute("format")
private String format;
-
+
@PluginBuilderAttribute("charset")
private Charset charsetName = StandardCharsets.UTF_8;
-
+
@PluginBuilderAttribute("exceptionPattern")
private String exceptionPattern;
-
+
@PluginElement("LoggerFields")
private LoggerFields[] loggerFields;
@@ -301,12 +301,12 @@ public class SyslogAppender extends SocketAppender {
return asBuilder();
}
}
-
+
protected static final String RFC5424 = "RFC5424";
protected SyslogAppender(final String name, final Layout<? extends Serializable> layout, final Filter filter,
final boolean ignoreExceptions, final boolean immediateFlush,
- final AbstractSocketManager manager, final Advertiser advertiser, final Property[] properties) {
+ final AbstractSocketManager manager, final Advertiser advertiser, Property[] properties) {
super(name, layout, filter, manager, ignoreExceptions, immediateFlush, advertiser, properties);
}
@@ -392,7 +392,7 @@ public class SyslogAppender extends SocketAppender {
final Configuration configuration,
final Charset charset,
final String exceptionPattern,
- final LoggerFields[] loggerFields,
+ final LoggerFields[] loggerFields,
final boolean advertise) {
// @formatter:on
@@ -428,7 +428,7 @@ public class SyslogAppender extends SocketAppender {
.build();
// @formatter:on
}
-
+
// Calling this method newBuilder() does not compile
@PluginBuilderFactory
public static <B extends Builder<B>> B newSyslogAppenderBuilder() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/TlsSyslogFrame.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/TlsSyslogFrame.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/TlsSyslogFrame.java
index 27e90cd..1b1a61a 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/TlsSyslogFrame.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/TlsSyslogFrame.java
@@ -22,7 +22,7 @@ import org.apache.logging.log4j.util.Chars;
/**
* Wraps messages that are formatted according to RFC 5425.
- *
+ *
* @see <a href="https://tools.ietf.org/html/rfc5425">RFC 5425</a>
*/
public class TlsSyslogFrame {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/WriterAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/WriterAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/WriterAppender.java
index 249fb9f..a5683eb 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/WriterAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/WriterAppender.java
@@ -16,12 +16,15 @@
*/
package org.apache.logging.log4j.core.appender;
+import java.io.Serializable;
import java.io.Writer;
import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Core;
import org.apache.logging.log4j.core.Filter;
+import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.StringLayout;
+import org.apache.logging.log4j.core.appender.HttpAppender.Builder;
import org.apache.logging.log4j.core.config.Property;
import org.apache.logging.log4j.core.config.plugins.Plugin;
import org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory;
@@ -47,8 +50,8 @@ public final class WriterAppender extends AbstractWriterAppender<WriterManager>
@Override
public WriterAppender build() {
- final StringLayout layout = (StringLayout) getLayout();
- final StringLayout actualLayout = layout != null ? layout : PatternLayout.createDefaultLayout();
+ StringLayout layout = (StringLayout) getLayout();
+ StringLayout actualLayout = layout != null ? layout : PatternLayout.createDefaultLayout();
return new WriterAppender(getName(), actualLayout, getFilter(), getManager(target, follow, actualLayout),
isIgnoreExceptions(), getPropertyArray());
}
@@ -73,7 +76,7 @@ public final class WriterAppender extends AbstractWriterAppender<WriterManager>
/**
* Builds instances.
- *
+ *
* @param writer
* The OutputStream.
* @param type
@@ -92,7 +95,7 @@ public final class WriterAppender extends AbstractWriterAppender<WriterManager>
/**
* Creates a WriterManager.
- *
+ *
* @param name
* The name of the entity to manage.
* @param data
@@ -109,7 +112,7 @@ public final class WriterAppender extends AbstractWriterAppender<WriterManager>
/**
* Creates a WriterAppender.
- *
+ *
* @param layout
* The layout to use or null to get the default layout.
* @param filter
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppender.java
index e977c1b..f720461 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppender.java
@@ -92,7 +92,7 @@ public abstract class AbstractDatabaseAppender<T extends AbstractDatabaseManager
* @param manager The matching {@link AbstractDatabaseManager} implementation.
*/
protected AbstractDatabaseAppender(final String name, final Filter filter,
- final Layout<? extends Serializable> layout, final boolean ignoreExceptions,
+ final Layout<? extends Serializable> layout, final boolean ignoreExceptions,
final Property[] properties, final T manager) {
super(name, filter, layout, ignoreExceptions, properties);
this.manager = manager;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManager.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManager.java
index f9a0082..0350543 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManager.java
@@ -272,7 +272,7 @@ public abstract class AbstractDatabaseManager extends AbstractManager implements
/**
* Gets the layout.
- *
+ *
* @return the layout.
*/
public Layout<? extends Serializable> getLayout() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/ColumnMapping.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/ColumnMapping.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/ColumnMapping.java
index 1178156..8d2759b 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/ColumnMapping.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/ColumnMapping.java
@@ -106,8 +106,8 @@ public class ColumnMapping {
/**
* Layout of value to write to database (before type conversion). Not applicable if {@link #setType(Class)} is
* a {@link ReadOnlyStringMap}, {@link ThreadContextMap}, or {@link ThreadContextStack}.
- *
- * @return this.
+ *
+ * @return this.
*/
public Builder setLayout(final StringLayout layout) {
this.layout = layout;
@@ -117,8 +117,8 @@ public class ColumnMapping {
/**
* Literal value to use for populating a column. This is generally useful for functions, stored procedures,
* etc. No escaping will be done on this value.
- *
- * @return this.
+ *
+ * @return this.
*/
public Builder setLiteral(final String literal) {
this.literal = literal;
@@ -127,8 +127,8 @@ public class ColumnMapping {
/**
* Column name.
- *
- * @return this.
+ *
+ * @return this.
*/
public Builder setName(final String name) {
this.name = name;
@@ -138,8 +138,8 @@ public class ColumnMapping {
/**
* Parameter value to use for populating a column, MUST contain a single parameter marker '?'. This is generally useful for functions, stored procedures,
* etc. No escaping will be done on this value.
- *
- * @return this.
+ *
+ * @return this.
*/
public Builder setParameter(final String parameter) {
this.parameter= parameter;
@@ -149,8 +149,8 @@ public class ColumnMapping {
/**
* Pattern to use as a {@link PatternLayout}. Convenient shorthand for {@link #setLayout(StringLayout)} with a
* PatternLayout.
- *
- * @return this.
+ *
+ * @return this.
*/
public Builder setPattern(final String pattern) {
this.pattern = pattern;
@@ -160,7 +160,7 @@ public class ColumnMapping {
/**
* Source name. Useful when combined with a {@link org.apache.logging.log4j.message.MapMessage} depending on the
* appender.
- *
+ *
* @return this.
*/
public Builder setSource(final String source) {
@@ -172,8 +172,8 @@ public class ColumnMapping {
* Class to convert value to before storing in database. If the type is compatible with {@link ThreadContextMap} or
* {@link ReadOnlyStringMap}, then the MDC will be used. If the type is compatible with {@link ThreadContextStack},
* then the NDC will be used. If the type is compatible with {@link Date}, then the event timestamp will be used.
- *
- * @return this.
+ *
+ * @return this.
*/
public Builder setType(final Class<?> type) {
this.type = type;
@@ -192,7 +192,7 @@ public class ColumnMapping {
public static Builder newBuilder() {
return new Builder();
}
-
+
private final StringLayout layout;
private final String literalValue;
private final String name;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractConnectionSource.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractConnectionSource.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractConnectionSource.java
index 72698b9..bd04eac 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractConnectionSource.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractConnectionSource.java
@@ -20,7 +20,7 @@ package org.apache.logging.log4j.core.appender.db.jdbc;
import org.apache.logging.log4j.core.AbstractLifeCycle;
public abstract class AbstractConnectionSource extends AbstractLifeCycle implements ConnectionSource {
-
+
// nothing yet
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractDriverManagerConnectionSource.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractDriverManagerConnectionSource.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractDriverManagerConnectionSource.java
index 0a67d69..06e5cce 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractDriverManagerConnectionSource.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractDriverManagerConnectionSource.java
@@ -127,7 +127,7 @@ public class AbstractDriverManagerConnectionSource extends AbstractConnectionSou
private final char[] userName;
public AbstractDriverManagerConnectionSource(final String driverClassName, final String connectionString,
- final String actualConnectionString, final char[] userName, final char[] password, final Property[] properties) {
+ String actualConnectionString, final char[] userName, final char[] password, final Property[] properties) {
super();
this.driverClassName = driverClassName;
this.connectionString = connectionString;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/ColumnConfig.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/ColumnConfig.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/ColumnConfig.java
index ba0ad25..1377b2a 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/ColumnConfig.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/ColumnConfig.java
@@ -147,8 +147,8 @@ public final class ColumnConfig {
/**
* The configuration object.
- *
- * @return this.
+ *
+ * @return this.
*/
public Builder setConfiguration(final Configuration configuration) {
this.configuration = configuration;
@@ -157,8 +157,8 @@ public final class ColumnConfig {
/**
* The name of the database column as it exists within the database table.
- *
- * @return this.
+ *
+ * @return this.
*/
public Builder setName(final String name) {
this.name = name;
@@ -168,8 +168,8 @@ public final class ColumnConfig {
/**
* The {@link PatternLayout} pattern to insert in this column. Mutually exclusive with
* {@code literal!=null} and {@code eventTimestamp=true}
- *
- * @return this.
+ *
+ * @return this.
*/
public Builder setPattern(final String pattern) {
this.pattern = pattern;
@@ -179,8 +179,8 @@ public final class ColumnConfig {
/**
* The literal value to insert into the column as-is without any quoting or escaping. Mutually exclusive with
* {@code pattern!=null} and {@code eventTimestamp=true}.
- *
- * @return this.
+ *
+ * @return this.
*/
public Builder setLiteral(final String literal) {
this.literal = literal;
@@ -190,8 +190,8 @@ public final class ColumnConfig {
/**
* If {@code "true"}, indicates that this column is a date-time column in which the event timestamp should be
* inserted. Mutually exclusive with {@code pattern!=null} and {@code literal!=null}.
- *
- * @return this.
+ *
+ * @return this.
*/
public Builder setEventTimestamp(final boolean eventTimestamp) {
isEventTimestamp = eventTimestamp;
@@ -200,8 +200,8 @@ public final class ColumnConfig {
/**
* If {@code "true"}, indicates that the column is a Unicode String.
- *
- * @return this.
+ *
+ * @return this.
*/
public Builder setUnicode(final boolean unicode) {
isUnicode = unicode;
@@ -210,8 +210,8 @@ public final class ColumnConfig {
/**
* If {@code "true"}, indicates that the column is a character LOB (CLOB).
- *
- * @return this.
+ *
+ * @return this.
*/
public Builder setClob(final boolean clob) {
isClob = clob;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/ConnectionSource.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/ConnectionSource.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/ConnectionSource.java
index 5ae51c6..42b6e1d 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/ConnectionSource.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/ConnectionSource.java
@@ -26,7 +26,7 @@ import org.apache.logging.log4j.core.LifeCycle;
* connection sources meet your needs, you can simply create your own connection source.
*/
public interface ConnectionSource extends LifeCycle {
-
+
/**
* This should return a new connection every time it is called.
*
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/DriverManagerConnectionSource.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/DriverManagerConnectionSource.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/DriverManagerConnectionSource.java
index 2f1b390..e390c5e 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/DriverManagerConnectionSource.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/DriverManagerConnectionSource.java
@@ -57,7 +57,7 @@ public class DriverManagerConnectionSource extends AbstractDriverManagerConnecti
}
public DriverManagerConnectionSource(final String driverClassName, final String connectionString,
- final String actualConnectionString, final char[] userName, final char[] password, final Property[] properties) {
+ String actualConnectionString, final char[] userName, final char[] password, final Property[] properties) {
super(driverClassName, connectionString, actualConnectionString, userName, password, properties);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppender.java
index 6f98eba..b241f29 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppender.java
@@ -121,7 +121,7 @@ public final class JdbcAppender extends AbstractDatabaseAppender<JdbcDatabaseMan
/**
* The connections source from which database connections should be retrieved.
- *
+ *
* @return this
*/
public B setConnectionSource(final ConnectionSource connectionSource) {
@@ -132,7 +132,7 @@ public final class JdbcAppender extends AbstractDatabaseAppender<JdbcDatabaseMan
/**
* If an integer greater than 0, this causes the appender to buffer log events and flush whenever the buffer
* reaches this size.
- *
+ *
* @return this
*/
public B setBufferSize(final int bufferSize) {
@@ -142,7 +142,7 @@ public final class JdbcAppender extends AbstractDatabaseAppender<JdbcDatabaseMan
/**
* The name of the database table to insert log events into.
- *
+ *
* @return this
*/
public B setTableName(final String tableName) {
@@ -152,7 +152,7 @@ public final class JdbcAppender extends AbstractDatabaseAppender<JdbcDatabaseMan
/**
* Information about the columns that log event data should be inserted into and how to insert that data.
- *
+ *
* @return this
*/
public B setColumnConfigs(final ColumnConfig... columnConfigs) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcDatabaseManager.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcDatabaseManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcDatabaseManager.java
index 72a3a3f..a026a3b 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcDatabaseManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcDatabaseManager.java
@@ -78,7 +78,7 @@ public final class JdbcDatabaseManager extends AbstractDatabaseManager {
* Creates managers.
*/
private static final class JdbcDatabaseManagerFactory implements ManagerFactory<JdbcDatabaseManager, FactoryData> {
-
+
private static final char PARAMETER_MARKER = '?';
@Override
@@ -215,11 +215,11 @@ public final class JdbcDatabaseManager extends AbstractDatabaseManager {
private final String sqlStatement;
private Connection connection;
-
+
private PreparedStatement statement;
-
+
private boolean isBatchSupported;
-
+
private JdbcDatabaseManager(final String name, final int bufferSize, final ConnectionSource connectionSource,
final String sqlStatement, final List<ColumnConfig> columnConfigs,
final List<ColumnMapping> columnMappings) {
@@ -237,7 +237,7 @@ public final class JdbcDatabaseManager extends AbstractDatabaseManager {
if (this.connection != null && !this.connection.isClosed()) {
if (this.isBatchSupported) {
logger().debug("Executing batch PreparedStatement {}", this.statement);
- final int[] result = this.statement.executeBatch();
+ int[] result = this.statement.executeBatch();
logger().debug("Batch result: {}", Arrays.toString(result));
}
logger().debug("Committing Connection {}", this.connection);
@@ -361,7 +361,7 @@ public final class JdbcDatabaseManager extends AbstractDatabaseManager {
this.statement.setObject(i++, DateTypeConverter.fromMillis(event.getTimeMillis(),
mapping.getType().asSubclass(Date.class)));
} else {
- final StringLayout layout = mapping.getLayout();
+ StringLayout layout = mapping.getLayout();
if (layout != null) {
if (Clob.class.isAssignableFrom(mapping.getType())) {
this.statement.setClob(i++, new StringReader(layout.toSerializable(event)));
@@ -409,7 +409,7 @@ public final class JdbcDatabaseManager extends AbstractDatabaseManager {
// Release ASAP
try {
statement.clearParameters();
- } catch (final SQLException e) {
+ } catch (SQLException e) {
// Ignore
}
Closer.closeSilently(reader);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/JmsAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/JmsAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/JmsAppender.java
index 59fd75b..7a7bd43 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/JmsAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/JmsAppender.java
@@ -29,6 +29,8 @@ import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.appender.AbstractAppender;
import org.apache.logging.log4j.core.appender.AbstractManager;
+import org.apache.logging.log4j.core.appender.HttpAppender;
+import org.apache.logging.log4j.core.appender.HttpAppender.Builder;
import org.apache.logging.log4j.core.appender.mom.JmsManager.JmsManagerConfiguration;
import org.apache.logging.log4j.core.config.Node;
import org.apache.logging.log4j.core.config.Property;
@@ -36,6 +38,7 @@ import org.apache.logging.log4j.core.config.plugins.Plugin;
import org.apache.logging.log4j.core.config.plugins.PluginAliases;
import org.apache.logging.log4j.core.config.plugins.PluginBuilderAttribute;
import org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory;
+import org.apache.logging.log4j.core.config.plugins.PluginElement;
import org.apache.logging.log4j.core.config.plugins.validation.constraints.Required;
import org.apache.logging.log4j.core.net.JndiManager;
@@ -109,7 +112,7 @@ public class JmsAppender extends AbstractAppender {
// JmsManagerFactory has already logged an ERROR.
return null;
}
- final Layout<? extends Serializable> layout = getLayout();
+ Layout<? extends Serializable> layout = getLayout();
if (layout == null) {
LOGGER.error("No layout provided for JmsAppender");
return null;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/DefaultKafkaProducerFactory.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/DefaultKafkaProducerFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/DefaultKafkaProducerFactory.java
index 1f7a278..e0b3921 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/DefaultKafkaProducerFactory.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/DefaultKafkaProducerFactory.java
@@ -29,7 +29,7 @@ public class DefaultKafkaProducerFactory implements KafkaProducerFactory {
/**
* Creates a new Kafka Producer from the given configuration properties.
- *
+ *
* @param config
* <a href="https://kafka.apache.org/documentation.html#producerconfigs">Kafka Producer configuration
* properties.</a>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppender.java
index ef4d656..642d6bb 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppender.java
@@ -50,12 +50,12 @@ public final class KafkaAppender extends AbstractAppender {
public static class Builder<B extends Builder<B>> extends AbstractAppender.Builder<B>
implements org.apache.logging.log4j.core.util.Builder<KafkaAppender> {
- @PluginAttribute("topic")
+ @PluginAttribute("topic")
private String topic;
@PluginAttribute("key")
private String key;
-
+
@PluginAttribute(value = "syncSend", defaultBoolean = true)
private boolean syncSend;
@@ -92,7 +92,7 @@ public final class KafkaAppender extends AbstractAppender {
}
}
-
+
@Deprecated
public static KafkaAppender createAppender(
final Layout<? extends Serializable> layout,
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaProducerFactory.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaProducerFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaProducerFactory.java
index a58fb38..7532bb8 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaProducerFactory.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaProducerFactory.java
@@ -28,7 +28,7 @@ public interface KafkaProducerFactory {
/**
* Creates a new Kafka Producer from the given configuration properties.
- *
+ *
* @param config
* <a href="https://kafka.apache.org/documentation.html#producerconfigs">Kafka Producer configuration
* properties.</a>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/nosql/NoSqlAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/nosql/NoSqlAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/nosql/NoSqlAppender.java
index 8ed9efa..fd3ca5d 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/nosql/NoSqlAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/nosql/NoSqlAppender.java
@@ -38,7 +38,7 @@ import org.apache.logging.log4j.core.util.Booleans;
* For examples on how to write your own NoSQL provider, see the simple source code for the MongoDB and CouchDB
* providers.
* </p>
- *
+ *
* @see NoSqlObject
* @see NoSqlConnection
* @see NoSqlProvider
@@ -48,7 +48,7 @@ public final class NoSqlAppender extends AbstractDatabaseAppender<NoSqlDatabaseM
/**
* Builds ConsoleAppender instances.
- *
+ *
* @param <B>
* The type to build
*/
@@ -84,25 +84,25 @@ public final class NoSqlAppender extends AbstractDatabaseAppender<NoSqlDatabaseM
/**
* Sets the buffer size.
- *
+ *
* @param bufferSize
* If an integer greater than 0, this causes the appender to buffer log events and flush whenever the
* buffer reaches this size.
* @return this
*/
- public B setBufferSize(final int bufferSize) {
+ public B setBufferSize(int bufferSize) {
this.bufferSize = bufferSize;
return asBuilder();
}
/**
* Sets the provider.
- *
+ *
* @param provider
* The NoSQL provider that provides connections to the chosen NoSQL database.
* @return this
*/
- public B setProvider(final NoSqlProvider<?> provider) {
+ public B setProvider(NoSqlProvider<?> provider) {
this.provider = provider;
return asBuilder();
}
@@ -131,7 +131,7 @@ public final class NoSqlAppender extends AbstractDatabaseAppender<NoSqlDatabaseM
public static NoSqlAppender createAppender(
// @formatter:off
final String name,
- final String ignore,
+ final String ignore,
final Filter filter,
final String bufferSize,
final NoSqlProvider<?> provider) {
@@ -163,7 +163,7 @@ public final class NoSqlAppender extends AbstractDatabaseAppender<NoSqlDatabaseM
private final String description;
- private NoSqlAppender(final String name, final Filter filter, final Layout<? extends Serializable> layout,
+ private NoSqlAppender(final String name, final Filter filter, Layout<? extends Serializable> layout,
final boolean ignoreExceptions, final Property[] properties, final NoSqlDatabaseManager<?> manager) {
super(name, filter, layout, ignoreExceptions, properties, manager);
this.description = this.getName() + "{ manager=" + this.getManager() + " }";
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/nosql/NoSqlDatabaseManager.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/nosql/NoSqlDatabaseManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/nosql/NoSqlDatabaseManager.java
index 3f623ba..80acae7 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/nosql/NoSqlDatabaseManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/nosql/NoSqlDatabaseManager.java
@@ -18,6 +18,8 @@ package org.apache.logging.log4j.core.appender.nosql;
import java.io.Serializable;
+import javax.jms.JMSException;
+
import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.ThreadContext;
import org.apache.logging.log4j.core.LogEvent;
@@ -72,7 +74,7 @@ public final class NoSqlDatabaseManager<W> extends AbstractDatabaseManager {
protected void writeInternal(final LogEvent event) {
writeInternal(event, null);
}
-
+
@Override
protected void writeInternal(final LogEvent event, final Serializable serializable) {
if (!this.isRunning() || this.connection == null || this.connection.isClosed()) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/nosql/NoSqlProvider.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/nosql/NoSqlProvider.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/nosql/NoSqlProvider.java
index 2726795..39c4d60 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/nosql/NoSqlProvider.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/nosql/NoSqlProvider.java
@@ -23,7 +23,7 @@ package org.apache.logging.log4j.core.appender.nosql;
* @param <C> Specifies which implementation of {@link NoSqlConnection} this provider provides.
*/
public interface NoSqlProvider<C extends NoSqlConnection<?, ? extends NoSqlObject<?>>> {
-
+
/**
* Obtains a connection from this provider. The concept of a connection in this case is not strictly an active
* duplex UDP or TCP connection to the underlying database. It can be thought of more as a gateway, a path for
@@ -32,7 +32,7 @@ public interface NoSqlProvider<C extends NoSqlConnection<?, ? extends NoSqlObjec
* Where applicable, this method should return a connection from the connection pool as opposed to opening a
* brand new connection every time.
* </p>
- *
+ *
* @return a connection that can be used to create and persist objects to this database.
* @see NoSqlConnection
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/LoggerNameLevelRewritePolicy.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/LoggerNameLevelRewritePolicy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/LoggerNameLevelRewritePolicy.java
index c6f9d44..a1ef2ef 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/LoggerNameLevelRewritePolicy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/LoggerNameLevelRewritePolicy.java
@@ -32,7 +32,7 @@ import org.apache.logging.log4j.core.util.KeyValuePair;
/**
* Rewrites log event levels for a given logger name.
- *
+ *
* @since 2.4
*/
@Plugin(name = "LoggerNameLevelRewritePolicy", category = Core.CATEGORY_NAME, elementType = "rewritePolicy", printObject = true)
@@ -40,7 +40,7 @@ public class LoggerNameLevelRewritePolicy implements RewritePolicy {
/**
* Creates a policy to rewrite levels for a given logger name.
- *
+ *
* @param loggerNamePrefix
* The logger name prefix for events to rewrite; all event logger names that start with this string will be
* rewritten.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/MapRewritePolicy.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/MapRewritePolicy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/MapRewritePolicy.java
index 61b41b1..5302a07 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/MapRewritePolicy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/MapRewritePolicy.java
@@ -37,7 +37,7 @@ import org.apache.logging.log4j.status.StatusLogger;
*/
@Plugin(name = "MapRewritePolicy", category = Core.CATEGORY_NAME, elementType = "rewritePolicy", printObject = true)
public final class MapRewritePolicy implements RewritePolicy {
-
+
/**
* Allow subclasses access to the status logger without creating another instance.
*/
@@ -90,12 +90,12 @@ public final class MapRewritePolicy implements RewritePolicy {
* keys should be updated.
*/
public enum Mode {
-
+
/**
* Keys should be added.
*/
Add,
-
+
/**
* Keys should be updated.
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/PropertiesRewritePolicy.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/PropertiesRewritePolicy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/PropertiesRewritePolicy.java
index 687f916..88a574d 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/PropertiesRewritePolicy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/PropertiesRewritePolicy.java
@@ -40,7 +40,7 @@ import org.apache.logging.log4j.util.StringMap;
*/
@Plugin(name = "PropertiesRewritePolicy", category = Core.CATEGORY_NAME, elementType = "rewritePolicy", printObject = true)
public final class PropertiesRewritePolicy implements RewritePolicy {
-
+
/**
* Allows subclasses access to the status logger without creating another instance.
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/CronTriggeringPolicy.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/CronTriggeringPolicy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/CronTriggeringPolicy.java
index 060e7fa..6eb3e50 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/CronTriggeringPolicy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/CronTriggeringPolicy.java
@@ -57,7 +57,7 @@ public final class CronTriggeringPolicy extends AbstractTriggeringPolicy {
/**
* Initializes the policy.
- *
+ *
* @param aManager
* The RollingFileManager.
*/
@@ -91,7 +91,7 @@ public final class CronTriggeringPolicy extends AbstractTriggeringPolicy {
/**
* Determines whether a rollover should occur.
- *
+ *
* @param event
* A reference to the currently event.
* @return true if a rollover should occur.
@@ -107,7 +107,7 @@ public final class CronTriggeringPolicy extends AbstractTriggeringPolicy {
/**
* Creates a ScheduledTriggeringPolicy.
- *
+ *
* @param configuration
* the Configuration.
* @param evaluateOnStartup
[13/13] logging-log4j2 git commit: Revert "Use final. Remove trailing
spaces."
Posted by gg...@apache.org.
Revert "Use final. Remove trailing spaces."
This reverts commit a8a7e7c93a5a85eee3c9bf87f8c015d8840d44cc.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/1f4c7962
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/1f4c7962
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/1f4c7962
Branch: refs/heads/release-2.x
Commit: 1f4c7962464547f700d48de6a58fc4c8eb625e29
Parents: a8a7e7c
Author: Gary Gregory <gg...@apache.org>
Authored: Mon Oct 29 21:48:24 2018 -0600
Committer: Gary Gregory <gg...@apache.org>
Committed: Mon Oct 29 21:48:24 2018 -0600
----------------------------------------------------------------------
.../java/org/apache/log4j/AppenderSkeleton.java | 26 +-
.../java/org/apache/log4j/ConsoleAppender.java | 2 +-
.../java/org/apache/log4j/SimpleLayout.java | 2 +-
.../log4j/config/Log4j1ConfigurationParser.java | 2 +-
.../java/org/apache/log4j/CategoryTest.java | 2 +-
.../test/java/org/apache/log4j/MDCTestCase.java | 4 +-
.../java/org/apache/log4j/VelocityTest.java | 6 +-
.../config/Log4j1ConfigurationFactoryTest.java | 2 +-
.../org/apache/logging/log4j/LogManager.java | 4 +-
.../java/org/apache/logging/log4j/Marker.java | 18 +-
.../logging/log4j/message/EntryMessage.java | 52 +-
.../logging/log4j/message/ExitMessage.java | 52 +-
.../logging/log4j/message/FlowMessage.java | 78 +-
.../log4j/message/FlowMessageFactory.java | 2 +-
.../logging/log4j/message/FormattedMessage.java | 2 +-
.../log4j/message/FormattedMessageFactory.java | 2 +-
.../logging/log4j/message/LocalizedMessage.java | 8 +-
.../log4j/message/LocalizedMessageFactory.java | 4 +-
.../logging/log4j/message/MapMessage.java | 48 +-
.../logging/log4j/message/MessageFactory2.java | 2 +-
.../log4j/message/MessageFormatMessage.java | 4 +-
.../message/MessageFormatMessageFactory.java | 2 +-
.../log4j/message/ObjectArrayMessage.java | 268 +--
.../message/ParameterizedMessageFactory.java | 2 +-
.../log4j/message/ReusableObjectMessage.java | 4 +-
.../message/ReusableParameterizedMessage.java | 4 +-
.../log4j/message/ReusableSimpleMessage.java | 2 +-
.../log4j/message/SimpleMessageFactory.java | 4 +-
.../log4j/message/StringFormattedMessage.java | 8 +-
.../logging/log4j/message/StringMapMessage.java | 6 +-
.../StructuredDataCollectionMessage.java | 30 +-
.../log4j/message/StructuredDataMessage.java | 12 +-
.../log4j/message/ThreadInformation.java | 2 +-
.../logging/log4j/spi/AbstractLogger.java | 2 +-
.../log4j/spi/AbstractLoggerAdapter.java | 2 +-
.../CopyOnWriteSortedArrayThreadContextMap.java | 6 +-
.../log4j/spi/DefaultThreadContextMap.java | 6 +-
.../GarbageFreeSortedArrayThreadContextMap.java | 4 +-
.../org/apache/logging/log4j/spi/Provider.java | 6 +-
.../apache/logging/log4j/spi/StandardLevel.java | 4 +-
.../log4j/spi/ThreadContextMapFactory.java | 6 +-
.../apache/logging/log4j/status/StatusData.java | 14 +-
.../apache/logging/log4j/util/EnglishEnums.java | 2 +-
.../log4j/util/FilteredObjectInputStream.java | 4 +-
.../apache/logging/log4j/util/LoaderUtil.java | 12 +-
.../logging/log4j/util/LowLevelLogUtil.java | 2 +-
.../logging/log4j/util/ProcessIdUtil.java | 12 +-
.../logging/log4j/util/PropertiesUtil.java | 4 +-
.../log4j/util/PropertyFilePropertySource.java | 2 +-
.../logging/log4j/util/PropertySource.java | 2 +-
.../apache/logging/log4j/util/ProviderUtil.java | 6 +-
.../logging/log4j/util/ReadOnlyStringMap.java | 2 +-
.../log4j/util/SortedArrayStringMap.java | 14 +-
.../logging/log4j/util/StringBuilders.java | 6 +-
.../org/apache/logging/log4j/util/Strings.java | 10 +-
.../logging/log4j/AbstractLoggerTest.java | 12 +-
.../apache/logging/log4j/LogManagerTest.java | 16 +-
.../logging/log4j/LoggerSupplierTest.java | 470 ++---
.../org/apache/logging/log4j/LoggerTest.java | 2 +-
.../org/apache/logging/log4j/MarkerTest.java | 2 +-
.../logging/log4j/ThreadContextHolder.java | 12 +-
.../log4j/junit/SecurityManagerTestRule.java | 6 +-
.../apache/logging/log4j/junit/SerialUtil.java | 2 +-
.../log4j/junit/ThreadContextMapRule.java | 4 +-
.../logging/log4j/junit/ThreadContextRule.java | 6 +-
.../log4j/junit/ThreadContextStackRule.java | 4 +-
.../logging/log4j/message/MapMessageTest.java | 2 +-
.../log4j/message/ObjectArrayMessageTest.java | 80 +-
.../ReusableParameterizedMessageTest.java | 4 +-
.../log4j/spi/DefaultThreadContextMapTest.java | 5 +-
.../logging/log4j/util/CharsetForNameMain.java | 6 +-
...ironmentPropertySourceSecurityManagerIT.java | 4 +-
.../log4j/util/Log4jCharsetsPropertiesTest.java | 8 +-
.../logging/log4j/util/ProcessIdUtilTest.java | 2 +-
.../logging/log4j/util/PropertiesUtilTest.java | 10 +-
...ertyFilePropertySourceSecurityManagerIT.java | 6 +-
.../log4j/util/PropertySourceTokenizerTest.java | 2 +-
.../logging/log4j/util/ProviderUtilTest.java | 6 +-
.../log4j/util/SortedArrayStringMapTest.java | 2 +-
.../logging/log4j/util/StringBuildersTest.java | 18 +-
.../log4j/util/SystemPropertiesMain.java | 9 +-
...opertiesPropertySourceSecurityManagerIT.java | 4 +-
.../SystemPropertiesPropertySourceTest.java | 6 +-
.../log4j/appserver/jetty/Log4j2Logger.java | 2 +-
.../log4j/cassandra/CassandraManager.java | 2 +-
.../logging/log4j/core/SimplePerfTest.java | 2 +-
.../logging/log4j/core/AbstractLifeCycle.java | 2 +-
.../core/DefaultLoggerContextAccessor.java | 2 +-
.../org/apache/logging/log4j/core/LogEvent.java | 2 +-
.../apache/logging/log4j/core/StringLayout.java | 66 +-
.../org/apache/logging/log4j/core/Version.java | 2 +-
.../log4j/core/appender/AbstractAppender.java | 34 +-
.../core/appender/AbstractFileAppender.java | 4 +-
.../appender/AbstractOutputStreamAppender.java | 12 +-
.../core/appender/AbstractWriterAppender.java | 14 +-
.../log4j/core/appender/AppenderSet.java | 2 +-
.../log4j/core/appender/AsyncAppender.java | 4 +-
.../core/appender/ConfigurationFactoryData.java | 2 +-
.../log4j/core/appender/ConsoleAppender.java | 6 +-
.../log4j/core/appender/FailoverAppender.java | 2 +-
.../log4j/core/appender/FileAppender.java | 12 +-
.../core/appender/MemoryMappedFileAppender.java | 4 +-
.../core/appender/OutputStreamAppender.java | 11 +-
.../core/appender/RandomAccessFileAppender.java | 8 +-
.../core/appender/RollingFileAppender.java | 12 +-
.../RollingRandomAccessFileAppender.java | 4 +-
.../log4j/core/appender/SocketAppender.java | 16 +-
.../log4j/core/appender/SyslogAppender.java | 40 +-
.../log4j/core/appender/TlsSyslogFrame.java | 2 +-
.../log4j/core/appender/WriterAppender.java | 13 +-
.../appender/db/AbstractDatabaseAppender.java | 2 +-
.../appender/db/AbstractDatabaseManager.java | 2 +-
.../log4j/core/appender/db/ColumnMapping.java | 28 +-
.../db/jdbc/AbstractConnectionSource.java | 2 +-
.../AbstractDriverManagerConnectionSource.java | 2 +-
.../core/appender/db/jdbc/ColumnConfig.java | 28 +-
.../core/appender/db/jdbc/ConnectionSource.java | 2 +-
.../db/jdbc/DriverManagerConnectionSource.java | 2 +-
.../core/appender/db/jdbc/JdbcAppender.java | 8 +-
.../appender/db/jdbc/JdbcDatabaseManager.java | 14 +-
.../log4j/core/appender/mom/JmsAppender.java | 5 +-
.../mom/kafka/DefaultKafkaProducerFactory.java | 2 +-
.../core/appender/mom/kafka/KafkaAppender.java | 6 +-
.../mom/kafka/KafkaProducerFactory.java | 2 +-
.../core/appender/nosql/NoSqlAppender.java | 16 +-
.../appender/nosql/NoSqlDatabaseManager.java | 4 +-
.../core/appender/nosql/NoSqlProvider.java | 4 +-
.../rewrite/LoggerNameLevelRewritePolicy.java | 4 +-
.../core/appender/rewrite/MapRewritePolicy.java | 6 +-
.../rewrite/PropertiesRewritePolicy.java | 2 +-
.../appender/rolling/CronTriggeringPolicy.java | 6 +-
.../rolling/DefaultRolloverStrategy.java | 8 +-
.../rolling/DirectWriteRolloverStrategy.java | 6 +-
.../core/appender/rolling/FileExtension.java | 2 +-
.../appender/rolling/NoOpTriggeringPolicy.java | 2 +-
.../rolling/RollingRandomAccessFileManager.java | 6 +-
.../rolling/TimeBasedTriggeringPolicy.java | 20 +-
.../core/appender/rolling/TriggeringPolicy.java | 2 +-
.../appender/rolling/action/AbstractAction.java | 2 +-
.../rolling/action/AbstractPathAction.java | 20 +-
.../rolling/action/CommonsCompressAction.java | 2 +-
.../rolling/action/CompositeAction.java | 4 +-
.../appender/rolling/action/DeleteAction.java | 16 +-
.../rolling/action/DeletingVisitor.java | 194 +-
.../core/appender/rolling/action/Duration.java | 10 +-
.../rolling/action/GzCompressAction.java | 2 +-
.../rolling/action/IfAccumulatedFileCount.java | 8 +-
.../rolling/action/IfAccumulatedFileSize.java | 8 +-
.../core/appender/rolling/action/IfAll.java | 12 +-
.../core/appender/rolling/action/IfAny.java | 4 +-
.../appender/rolling/action/IfFileName.java | 16 +-
.../appender/rolling/action/IfLastModified.java | 10 +-
.../core/appender/rolling/action/IfNot.java | 4 +-
.../appender/rolling/action/PathCondition.java | 88 +-
.../action/PathSortByModificationTime.java | 10 +-
.../rolling/action/PathWithAttributes.java | 118 +-
.../action/PosixViewAttributeAction.java | 14 +-
.../rolling/action/ScriptCondition.java | 8 +-
.../appender/rolling/action/SortingVisitor.java | 116 +-
.../rolling/action/ZipCompressAction.java | 2 +-
.../core/appender/routing/IdlePurgePolicy.java | 6 +-
.../core/appender/routing/PurgePolicy.java | 6 +-
.../log4j/core/appender/routing/Routes.java | 16 +-
.../log4j/core/async/AsyncLoggerConfig.java | 3 +-
.../log4j/core/async/AsyncLoggerContext.java | 8 +-
.../core/async/AsyncLoggerContextSelector.java | 2 +-
.../log4j/core/async/RingBufferLogEvent.java | 4 +-
.../log4j/core/config/AppenderControl.java | 8 +-
...AwaitUnconditionallyReliabilityStrategy.java | 12 +-
.../core/config/ConfigurationScheduler.java | 2 +-
.../log4j/core/config/ConfigurationSource.java | 2 +-
.../logging/log4j/core/config/Configurator.java | 2 +-
.../log4j/core/config/CustomLevelConfig.java | 6 +-
.../logging/log4j/core/config/CustomLevels.java | 2 +-
.../log4j/core/config/DefaultConfiguration.java | 4 +-
.../core/config/DefaultReliabilityStrategy.java | 12 +-
.../logging/log4j/core/config/LoggerConfig.java | 8 +-
.../logging/log4j/core/config/Property.java | 2 +-
.../log4j/core/config/ReliabilityStrategy.java | 158 +-
.../core/config/ReliabilityStrategyFactory.java | 2 +-
.../impl/DefaultConfigurationBuilder.java | 14 +-
.../composite/CompositeConfiguration.java | 1 +
.../config/plugins/convert/TypeConverters.java | 4 +-
.../core/config/plugins/util/PluginBuilder.java | 1 +
.../core/config/plugins/util/PluginManager.java | 10 +-
.../core/config/plugins/util/ResolverUtil.java | 6 +-
.../plugins/validation/ConstraintValidator.java | 2 +-
.../plugins/visitors/AbstractPluginVisitor.java | 12 +-
.../PropertiesConfigurationBuilder.java | 4 +-
.../log4j/core/config/xml/XmlConfiguration.java | 4 +-
.../log4j/core/filter/AbstractFilter.java | 6 +-
.../log4j/core/filter/AbstractFilterable.java | 6 +-
.../logging/log4j/core/filter/BurstFilter.java | 4 +-
.../logging/log4j/core/filter/Filterable.java | 2 +-
.../logging/log4j/core/filter/ScriptFilter.java | 4 +-
.../log4j/core/impl/ContextDataFactory.java | 2 +-
.../log4j/core/impl/ExtendedClassInfo.java | 2 +-
.../log4j/core/impl/Log4jContextFactory.java | 1 +
.../logging/log4j/core/impl/Log4jLogEvent.java | 6 +-
.../logging/log4j/core/impl/MementoMessage.java | 4 +-
.../log4j/core/impl/MutableLogEvent.java | 4 +-
.../core/impl/ReusableLogEventFactory.java | 2 +-
.../logging/log4j/core/impl/ThrowableProxy.java | 2 +-
.../log4j/core/impl/ThrowableProxyRenderer.java | 16 +-
.../jackson/ExtendedStackTraceElementMixIn.java | 2 +-
.../logging/log4j/core/jackson/MarkerMixIn.java | 2 +-
.../core/jackson/StackTraceElementMixIn.java | 6 +-
.../log4j/core/jmx/AsyncAppenderAdmin.java | 10 +-
.../log4j/core/jmx/AsyncAppenderAdminMBean.java | 28 +-
.../log4j/core/jmx/ContextSelectorAdmin.java | 4 +-
.../log4j/core/jmx/LoggerContextAdminMBean.java | 28 +-
.../logging/log4j/core/jmx/RingBufferAdmin.java | 10 +-
.../log4j/core/jmx/RingBufferAdminMBean.java | 6 +-
.../log4j/core/jmx/StatusLoggerAdmin.java | 6 +-
.../log4j/core/jmx/StatusLoggerAdminMBean.java | 2 +-
.../log4j/core/layout/AbstractCsvLayout.java | 6 +-
.../core/layout/AbstractJacksonLayout.java | 14 +-
.../log4j/core/layout/CsvParameterLayout.java | 10 +-
.../logging/log4j/core/layout/JsonLayout.java | 2 +-
.../core/layout/MarkerPatternSelector.java | 12 +-
.../log4j/core/layout/PatternLayout.java | 6 +-
.../log4j/core/layout/Rfc5424Layout.java | 2 +-
.../core/layout/ScriptPatternSelector.java | 22 +-
.../logging/log4j/core/layout/SyslogLayout.java | 16 +-
.../logging/log4j/core/layout/XmlLayout.java | 2 +-
.../logging/log4j/core/layout/YamlLayout.java | 2 +-
.../log4j/core/lookup/AbstractLookup.java | 4 +-
.../log4j/core/lookup/MainMapLookup.java | 4 +-
.../logging/log4j/core/lookup/MarkerLookup.java | 2 +-
.../logging/log4j/core/lookup/StrMatcher.java | 2 +-
.../log4j/core/net/AbstractSocketManager.java | 8 +-
.../log4j/core/net/DatagramSocketManager.java | 4 +-
.../apache/logging/log4j/core/net/Facility.java | 48 +-
.../logging/log4j/core/net/JndiManager.java | 4 +-
.../log4j/core/net/MulticastDnsAdvertiser.java | 2 +-
.../apache/logging/log4j/core/net/Priority.java | 2 +-
.../log4j/core/net/Rfc1349TrafficClass.java | 2 +-
.../log4j/core/net/SslSocketManager.java | 8 +-
.../log4j/core/net/TcpSocketManager.java | 18 +-
.../net/ssl/AbstractKeyStoreConfiguration.java | 2 +-
.../net/ssl/EnvironmentPasswordProvider.java | 2 +-
.../core/net/ssl/FilePasswordProvider.java | 8 +-
.../core/net/ssl/KeyStoreConfiguration.java | 6 +-
.../log4j/core/net/ssl/SslConfiguration.java | 6 +-
.../net/ssl/StoreConfigurationException.java | 2 +-
.../core/net/ssl/TrustStoreConfiguration.java | 4 +-
.../log4j/core/parser/TextLogEventParser.java | 2 +-
.../core/pattern/DatePatternConverter.java | 4 +-
.../ExtendedThrowablePatternConverter.java | 2 +-
.../log4j/core/pattern/HighlightConverter.java | 2 +-
.../log4j/core/pattern/JAnsiTextRenderer.java | 22 +-
.../log4j/core/pattern/PatternParser.java | 2 +-
.../log4j/core/pattern/PlainTextRenderer.java | 2 +-
.../core/pattern/ProcessIdPatternConverter.java | 2 +-
.../log4j/core/pattern/TextRenderer.java | 4 +-
.../log4j/core/script/AbstractScript.java | 2 +-
.../core/selector/JndiContextSelector.java | 8 +-
.../logging/log4j/core/time/MutableInstant.java | 8 +-
.../logging/log4j/core/tools/Generate.java | 1698 +++++++++---------
.../log4j/core/tools/picocli/CommandLine.java | 1167 ++++++------
.../logging/log4j/core/util/ClockFactory.java | 8 +-
.../logging/log4j/core/util/DummyNanoClock.java | 2 +-
.../log4j/core/util/ExecutorServices.java | 2 +-
.../logging/log4j/core/util/FileUtils.java | 6 +-
.../logging/log4j/core/util/FileWatcher.java | 4 +-
.../logging/log4j/core/util/JndiCloser.java | 120 +-
.../apache/logging/log4j/core/util/Loader.java | 10 +-
.../log4j/core/util/Log4jThreadFactory.java | 6 +-
.../logging/log4j/core/util/NetUtils.java | 2 +-
.../log4j/core/util/NullOutputStream.java | 16 +-
.../logging/log4j/core/util/Patterns.java | 4 +-
.../log4j/core/util/StringBuilderWriter.java | 336 ++--
.../logging/log4j/core/util/TypeUtil.java | 4 +-
.../logging/log4j/core/util/WatchManager.java | 14 +-
.../log4j/core/util/datetime/DateParser.java | 44 +-
.../log4j/core/util/datetime/DatePrinter.java | 6 +-
.../core/util/datetime/FastDateFormat.java | 16 +-
.../core/util/datetime/FastDateParser.java | 36 +-
.../core/util/datetime/FastDatePrinter.java | 40 +-
.../core/util/datetime/FixedDateFormat.java | 4 +-
.../log4j/core/util/datetime/FormatCache.java | 44 +-
.../logging/log4j/core/CustomLevelsTest.java | 4 +-
.../apache/logging/log4j/core/DeadlockTest.java | 2 +-
.../core/EventParameterMemoryLeakTest.java | 8 +-
.../log4j/core/GarbageCollectionHelper.java | 4 +-
.../logging/log4j/core/LateConfigTest.java | 2 +-
.../apache/logging/log4j/core/LogEventTest.java | 4 +-
...sableParameterizedMessageMemoryLeakTest.java | 8 +-
.../log4j/core/TestPatternConverters.java | 2 +-
.../appender/ConsoleAppenderBuilderTest.java | 4 +-
...nsoleAppenderDefaultSuppressedThrowable.java | 2 +-
.../appender/FileAppenderPermissionsTest.java | 2 +-
.../FileAppenderPermissionsXmlConfigTest.java | 2 +-
.../log4j/core/appender/HangingAppender.java | 2 +-
.../log4j/core/appender/HttpAppenderTest.java | 14 +-
.../log4j/core/appender/Jira739Test.java | 2 +-
.../appender/JsonCompleteFileAppenderTest.java | 9 +-
.../MemoryMappedFileAppenderRemapTest.java | 4 +-
.../MemoryMappedFileAppenderSimpleTest.java | 8 +-
.../appender/ScriptAppenderSelectorTest.java | 2 +-
.../core/appender/SmtpAppenderAsyncTest.java | 4 +-
.../log4j/core/appender/SocketAppenderTest.java | 14 +-
.../SyslogAppenderCustomLayoutTest.java | 2 +-
.../appender/XmlCompleteFileAppenderTest.java | 9 +-
.../core/appender/XmlFileAppenderTest.java | 6 +-
.../db/AbstractDatabaseManagerTest.java | 2 +-
.../jdbc/DriverManagerConnectionSourceTest.java | 6 +-
.../JdbcAppenderMapMessageDataSourceTest.java | 2 +-
.../JdbcAppenderStringSubstitutionTest.java | 8 +-
.../appender/mom/jeromq/JeroMqAppenderTest.java | 2 +-
.../appender/mom/jeromq/JeroMqTestClient.java | 108 +-
.../kafka/KafkaAppenderCloseTimeoutTest.java | 6 +-
.../appender/mom/kafka/KafkaAppenderTest.java | 10 +-
.../LoggerNameLevelRewritePolicyTest.java | 2 +-
.../appender/rewrite/MapRewritePolicyTest.java | 2 +-
.../rolling/CronTriggeringPolicyTest.java | 4 +-
.../core/appender/rolling/FileSizeTest.java | 2 +-
.../RollingAppenderDeleteNestedTest.java | 2 +-
...gAppenderDirectWriteWithReconfigureTest.java | 2 +-
.../RollingAppenderUncompressedTest.java | 2 +-
.../RollingFileAppenderReconfigureTest.java | 4 +-
...rReconfigureUndefinedSystemPropertyTest.java | 4 +-
.../rolling/action/DummyFileAttributes.java | 172 +-
.../core/appender/rolling/action/IfAllTest.java | 108 +-
.../core/appender/rolling/action/IfAnyTest.java | 104 +-
.../appender/rolling/action/IfFileNameTest.java | 262 +--
.../rolling/action/IfLastModifiedTest.java | 2 +-
.../action/PathSortByModificationTimeTest.java | 12 +-
.../rolling/action/SortingVisitorTest.java | 6 +-
.../routing/DefaultRouteScriptAppenderTest.java | 2 +-
.../routing/RoutesScriptAppenderTest.java | 4 +-
.../async/AsyncLoggerConfigAutoFlushTest.java | 2 +-
.../core/async/AsyncLoggerConfigTest2.java | 4 +-
.../core/async/AsyncLoggerConfigTest3.java | 2 +-
.../AsyncLoggerConfigUseAfterShutdownTest.java | 2 +-
.../AsyncLoggerConfigWithAsyncEnabledTest.java | 4 +-
.../async/AsyncLoggerContextSelectorTest.java | 2 +-
.../AsyncLoggerCustomSelectorLocationTest.java | 6 +-
.../core/async/AsyncLoggerLocationTest.java | 2 +-
.../log4j/core/async/AsyncLoggerTest.java | 4 +-
.../async/AsyncLoggerThreadContextTest.java | 4 +-
.../async/AsyncLoggerUseAfterShutdownTest.java | 2 +-
.../log4j/core/async/BlockingAppender.java | 2 +-
.../log4j/core/async/QueueFullAbstractTest.java | 32 +-
...syncLoggerConfigLoggingFromToStringTest.java | 4 +-
.../core/async/RingBufferLogEventTest.java | 12 +-
.../log4j/core/async/perftest/Histogram.java | 10 +-
.../core/async/perftest/PerfTestDriver.java | 6 +-
.../core/config/CompositeConfigurationTest.java | 2 +-
.../log4j/core/config/ConfigurationTest.java | 4 +-
.../log4j/core/config/JiraLog4j2_2134Test.java | 30 +-
.../log4j/core/config/LoggerConfigTest.java | 2 +-
.../core/config/NestedLoggerConfigTest.java | 23 +-
.../util/ResolverUtilCustomProtocolTest.java | 2 +-
.../config/plugins/util/ResolverUtilTest.java | 16 +-
.../ValidatingPluginWithTypedBuilderTest.java | 4 +-
.../core/filter/DynamicThresholdFilterTest.java | 10 +-
.../log4j/core/filter/LevelRangeFilterTest.java | 2 +-
.../log4j/core/impl/FactoryTestStringMap.java | 6 +-
.../core/impl/Log4jLogEventNanoTimeTest.java | 4 +-
.../log4j/core/impl/MutableLogEventTest.java | 16 +-
.../NestedLoggingFromThrowableMessageTest.java | 10 +-
.../impl/NestedLoggingFromToStringTest.java | 2 +-
.../impl/ThreadContextDataInjectorTest.java | 10 +-
.../core/impl/ThrowableFormatOptionsTest.java | 2 +-
.../logging/log4j/core/jmx/ServerTest.java | 20 +-
.../core/layout/CsvLogEventLayoutTest.java | 4 +-
.../log4j/core/layout/GelfLayoutTest.java | 6 +-
.../log4j/core/layout/HtmlLayoutTest.java | 2 +-
.../log4j/core/layout/JsonLayoutTest.java | 20 +-
.../log4j/core/layout/Log4j2_1482_Test.java | 2 +-
.../log4j/core/layout/Log4j2_2195_Test.java | 12 +-
.../log4j/core/layout/Rfc5424LayoutTest.java | 8 +-
.../log4j/core/layout/SerializedLayoutTest.java | 4 +-
.../log4j/core/layout/SyslogLayoutTest.java | 2 +-
.../log4j/core/layout/XmlLayoutTest.java | 2 +-
.../lookup/MainInputArgumentsJmxLookupTest.java | 4 +-
.../lookup/MainInputArgumentsLookupTest.java | 4 +-
.../lookup/MainInputArgumentsMapLookup.java | 2 +-
.../core/lookup/MarkerLookupConfigTest.java | 2 +-
.../log4j/core/lookup/MarkerLookupTest.java | 2 +-
.../core/net/mock/MockTcpSyslogServer.java | 4 +-
.../core/net/mock/MockTlsSyslogServer.java | 2 +-
.../core/net/mock/MockUdpSyslogServer.java | 2 +-
.../core/net/ssl/FilePasswordProviderTest.java | 2 +-
.../net/ssl/MemoryPasswordProviderTest.java | 8 +-
.../core/pattern/DatePatternConverterTest.java | 12 +-
.../log4j/core/pattern/DisableAnsiTest.java | 2 +-
.../ExtendedThrowablePatternConverterTest.java | 2 +-
.../core/pattern/HighlightConverterTest.java | 6 +-
.../core/pattern/MdcPatternConverterTest.java | 2 +-
.../pattern/MessagePatternConverterTest.java | 24 +-
.../core/pattern/NdcPatternConverterTest.java | 2 +-
.../log4j/core/pattern/NoConsoleNoAnsiTest.java | 2 +-
.../log4j/core/pattern/PatternParserTest2.java | 2 +-
.../core/pattern/RegexReplacementTest.java | 2 +-
.../log4j/core/time/MutableInstantTest.java | 52 +-
.../core/tools/GenerateCustomLoggerTest.java | 2 +-
.../core/tools/GenerateExtendedLoggerTest.java | 6 +-
.../util/datetime/FastDateParserSDFTest.java | 14 +-
.../core/util/datetime/FastDateParserTest.java | 24 +-
.../datetime/FastDateParser_MoreOrLessTest.java | 24 +-
.../apache/logging/log4j/junit/CleanFiles.java | 2 +-
.../logging/log4j/junit/LoggerContextRule.java | 4 +-
...MutableLogEventWithReusableParamMsgTest.java | 4 +-
.../logging/log4j/test/RuleChainFactory.java | 2 +-
.../log4j/flume/appender/FlumeAppender.java | 2 +-
.../log4j/flume/appender/FlumeEventFactory.java | 2 +-
.../appender/FlumePersistentAppenderTest.java | 7 +-
.../logging/log4j/io/ByteStreamLogger.java | 4 +-
.../logging/log4j/io/CharStreamLogger.java | 2 +-
.../log4j/io/LoggerBufferedInputStream.java | 8 +-
.../logging/log4j/io/LoggerBufferedReader.java | 14 +-
.../log4j/io/LoggerFilterOutputStream.java | 2 +-
.../logging/log4j/io/LoggerFilterWriter.java | 2 +-
.../logging/log4j/io/LoggerInputStream.java | 2 +-
.../logging/log4j/io/LoggerOutputStream.java | 2 +-
.../logging/log4j/io/LoggerPrintStream.java | 2 +-
.../apache/logging/log4j/io/LoggerReader.java | 2 +-
.../apache/logging/log4j/io/LoggerWriter.java | 2 +-
.../io/AbstractLoggerOutputStreamTest.java | 2 +-
.../logging/log4j/io/AbstractStreamTest.java | 118 +-
.../log4j/io/IoBuilderCallerInfoTesting.java | 110 +-
...LoggerBufferedInputStreamCallerInfoTest.java | 2 +-
.../io/LoggerBufferedReaderCallerInfoTest.java | 2 +-
.../io/LoggerInputStreamCallerInfoTest.java | 2 +-
.../logging/log4j/io/LoggerInputStreamTest.java | 2 +-
.../io/LoggerOutputStreamCallerInfoTest.java | 6 +-
.../io/LoggerPrintStreamCallerInfoTest.java | 30 +-
.../io/LoggerPrintWriterCallerInfoTest.java | 32 +-
.../log4j/io/LoggerPrintWriterJdbcH2Test.java | 192 +-
.../logging/log4j/io/LoggerPrintWriterTest.java | 2 +-
.../log4j/io/LoggerReaderCallerInfoTest.java | 2 +-
.../logging/log4j/io/LoggerReaderTest.java | 2 +-
.../org/apache/logging/log4j/jcl/Log4jLog.java | 2 +-
.../db/jdbc/PoolingDriverConnectionSource.java | 4 +-
.../log4j/jmx/gui/ClientGuiJConsolePlugin.java | 2 +
.../appender/db/jpa/JpaDatabaseManager.java | 2 +-
.../converter/InstantAttributeConverter.java | 8 +-
.../db/jpa/AbstractJpaAppenderTest.java | 2 +-
.../ContextStackJsonAttributeConverterTest.java | 2 +-
.../org/apache/logging/log4j/jul/Constants.java | 2 +-
.../log4j/jul/DefaultLevelConverter.java | 2 +-
...efaultLevelConverterCustomJulLevelsTest.java | 2 +-
.../logging/log4j/mongodb2/MongoDbTestRule.java | 4 +-
.../logging/log4j/mongodb3/MongoDbTestRule.java | 4 +-
.../osgi/tests/AbstractLoadBundleTest.java | 50 +-
.../log4j/osgi/tests/junit/OsgiRule.java | 2 +-
.../jmh/FileAppenderThrowableBenchmark.java | 8 +-
.../log4j/perf/jmh/LoggerConfigBenchmark.java | 4 +-
.../perf/jmh/StringBuilderEscapeBenchmark.java | 4 +-
.../perf/jmh/ThreadLocalVsPoolBenchmark.java | 4 +-
.../perf/jmh/ThreadsafeDateFormatBenchmark.java | 2 +-
.../log4j/perf/jmh/TimeFormatBenchmark.java | 18 +-
.../logging/slf4j/Log4jLoggerFactory.java | 2 +-
.../logging/log4j/web/Log4jWebLifeCycle.java | 2 +-
.../log4j/web/appender/ServletAppender.java | 6 +-
457 files changed, 4623 insertions(+), 4597 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-1.2-api/src/main/java/org/apache/log4j/AppenderSkeleton.java
----------------------------------------------------------------------
diff --git a/log4j-1.2-api/src/main/java/org/apache/log4j/AppenderSkeleton.java b/log4j-1.2-api/src/main/java/org/apache/log4j/AppenderSkeleton.java
index 78417cf..a4c5231 100644
--- a/log4j-1.2-api/src/main/java/org/apache/log4j/AppenderSkeleton.java
+++ b/log4j-1.2-api/src/main/java/org/apache/log4j/AppenderSkeleton.java
@@ -56,7 +56,7 @@ public abstract class AppenderSkeleton implements Appender, OptionHandler {
}
@Override
- public void addFilter(final Filter newFilter) {
+ public void addFilter(Filter newFilter) {
if(headFilter == null) {
headFilter = tailFilter = newFilter;
} else {
@@ -104,7 +104,7 @@ public abstract class AppenderSkeleton implements Appender, OptionHandler {
return threshold;
}
- public boolean isAsSevereAsThreshold(final Priority priority) {
+ public boolean isAsSevereAsThreshold(Priority priority) {
return ((threshold == null) || priority.isGreaterOrEqual(threshold));
}
@@ -113,7 +113,7 @@ public abstract class AppenderSkeleton implements Appender, OptionHandler {
* @param event The LoggingEvent.
*/
@Override
- public void doAppend(final LoggingEvent event) {
+ public void doAppend(LoggingEvent event) {
}
/**
@@ -122,54 +122,54 @@ public abstract class AppenderSkeleton implements Appender, OptionHandler {
* @since 0.9.0
*/
@Override
- public synchronized void setErrorHandler(final ErrorHandler eh) {
+ public synchronized void setErrorHandler(ErrorHandler eh) {
if (eh != null) {
this.errorHandler = eh;
}
}
@Override
- public void setLayout(final Layout layout) {
+ public void setLayout(Layout layout) {
this.layout = layout;
}
@Override
- public void setName(final String name) {
+ public void setName(String name) {
this.name = name;
}
- public void setThreshold(final Priority threshold) {
+ public void setThreshold(Priority threshold) {
this.threshold = threshold;
}
public static class NoOpErrorHandler implements ErrorHandler {
@Override
- public void setLogger(final Logger logger) {
+ public void setLogger(Logger logger) {
}
@Override
- public void error(final String message, final Exception e, final int errorCode) {
+ public void error(String message, Exception e, int errorCode) {
}
@Override
- public void error(final String message) {
+ public void error(String message) {
}
@Override
- public void error(final String message, final Exception e, final int errorCode, final LoggingEvent event) {
+ public void error(String message, Exception e, int errorCode, LoggingEvent event) {
}
@Override
- public void setAppender(final Appender appender) {
+ public void setAppender(Appender appender) {
}
@Override
- public void setBackupAppender(final Appender appender) {
+ public void setBackupAppender(Appender appender) {
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-1.2-api/src/main/java/org/apache/log4j/ConsoleAppender.java
----------------------------------------------------------------------
diff --git a/log4j-1.2-api/src/main/java/org/apache/log4j/ConsoleAppender.java b/log4j-1.2-api/src/main/java/org/apache/log4j/ConsoleAppender.java
index 605fac7..0e841c5 100644
--- a/log4j-1.2-api/src/main/java/org/apache/log4j/ConsoleAppender.java
+++ b/log4j-1.2-api/src/main/java/org/apache/log4j/ConsoleAppender.java
@@ -45,7 +45,7 @@ public class ConsoleAppender extends AppenderSkeleton
* {@inheritDoc}
*/
@Override
- protected void append(final LoggingEvent theEvent)
+ protected void append(LoggingEvent theEvent)
{
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-1.2-api/src/main/java/org/apache/log4j/SimpleLayout.java
----------------------------------------------------------------------
diff --git a/log4j-1.2-api/src/main/java/org/apache/log4j/SimpleLayout.java b/log4j-1.2-api/src/main/java/org/apache/log4j/SimpleLayout.java
index c77b9be..3b2374c 100644
--- a/log4j-1.2-api/src/main/java/org/apache/log4j/SimpleLayout.java
+++ b/log4j-1.2-api/src/main/java/org/apache/log4j/SimpleLayout.java
@@ -29,7 +29,7 @@ public class SimpleLayout extends Layout
* {@inheritDoc}
*/
@Override
- public String format(final LoggingEvent theEvent)
+ public String format(LoggingEvent theEvent)
{
return Strings.EMPTY;
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-1.2-api/src/main/java/org/apache/log4j/config/Log4j1ConfigurationParser.java
----------------------------------------------------------------------
diff --git a/log4j-1.2-api/src/main/java/org/apache/log4j/config/Log4j1ConfigurationParser.java b/log4j-1.2-api/src/main/java/org/apache/log4j/config/Log4j1ConfigurationParser.java
index ea2834f..112ab42 100644
--- a/log4j-1.2-api/src/main/java/org/apache/log4j/config/Log4j1ConfigurationParser.java
+++ b/log4j-1.2-api/src/main/java/org/apache/log4j/config/Log4j1ConfigurationParser.java
@@ -47,7 +47,7 @@ import org.apache.logging.log4j.util.Strings;
* Experimental parser for Log4j 1.2 properties configuration files.
*
* This class is not thread-safe.
- *
+ *
* <p>
* From the Log4j 1.2 Javadocs:
* </p>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-1.2-api/src/test/java/org/apache/log4j/CategoryTest.java
----------------------------------------------------------------------
diff --git a/log4j-1.2-api/src/test/java/org/apache/log4j/CategoryTest.java b/log4j-1.2-api/src/test/java/org/apache/log4j/CategoryTest.java
index 3792325..f671193 100644
--- a/log4j-1.2-api/src/test/java/org/apache/log4j/CategoryTest.java
+++ b/log4j-1.2-api/src/test/java/org/apache/log4j/CategoryTest.java
@@ -65,7 +65,7 @@ public class CategoryTest {
public void before() {
appender.clear();
}
-
+
/**
* Tests Category.forcedLog.
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-1.2-api/src/test/java/org/apache/log4j/MDCTestCase.java
----------------------------------------------------------------------
diff --git a/log4j-1.2-api/src/test/java/org/apache/log4j/MDCTestCase.java b/log4j-1.2-api/src/test/java/org/apache/log4j/MDCTestCase.java
index 97bf1ff..c0e5ba5 100644
--- a/log4j-1.2-api/src/test/java/org/apache/log4j/MDCTestCase.java
+++ b/log4j-1.2-api/src/test/java/org/apache/log4j/MDCTestCase.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-1.2-api/src/test/java/org/apache/log4j/VelocityTest.java
----------------------------------------------------------------------
diff --git a/log4j-1.2-api/src/test/java/org/apache/log4j/VelocityTest.java b/log4j-1.2-api/src/test/java/org/apache/log4j/VelocityTest.java
index c1165d7..99bd5a2 100644
--- a/log4j-1.2-api/src/test/java/org/apache/log4j/VelocityTest.java
+++ b/log4j-1.2-api/src/test/java/org/apache/log4j/VelocityTest.java
@@ -34,7 +34,7 @@ import org.junit.Test;
public class VelocityTest {
private static LoggerContext context;
-
+
@BeforeClass
public static void setupClass() {
context = LoggerContext.getContext(false);
@@ -44,8 +44,8 @@ private static LoggerContext context;
public static void tearDownClass() {
Configurator.shutdown(context);
StatusLogger.getLogger().reset();
- }
-
+ }
+
@Test
public void testVelocity() {
Velocity.init();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-1.2-api/src/test/java/org/apache/log4j/config/Log4j1ConfigurationFactoryTest.java
----------------------------------------------------------------------
diff --git a/log4j-1.2-api/src/test/java/org/apache/log4j/config/Log4j1ConfigurationFactoryTest.java b/log4j-1.2-api/src/test/java/org/apache/log4j/config/Log4j1ConfigurationFactoryTest.java
index ebe3e54..8d3e4e2 100644
--- a/log4j-1.2-api/src/test/java/org/apache/log4j/config/Log4j1ConfigurationFactoryTest.java
+++ b/log4j-1.2-api/src/test/java/org/apache/log4j/config/Log4j1ConfigurationFactoryTest.java
@@ -174,7 +174,7 @@ public class Log4j1ConfigurationFactoryTest {
} finally {
try {
Files.deleteIfExists(tempFilePath);
- } catch (final FileSystemException e) {
+ } catch (FileSystemException e) {
e.printStackTrace();
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java b/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java
index f2fdc72..ecff443 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java
@@ -349,7 +349,7 @@ public class LogManager {
* @return a LoggerContext.
*/
protected static LoggerContext getContext(final String fqcn, final ClassLoader loader,
- final boolean currentContext, final URI configLocation, final String name) {
+ final boolean currentContext, URI configLocation, String name) {
try {
return factory.getContext(fqcn, loader, null, currentContext, configLocation, name);
} catch (final IllegalStateException ex) {
@@ -406,7 +406,7 @@ public class LogManager {
}
private static String toLoggerName(final Class<?> cls) {
- final String canonicalName = cls.getCanonicalName();
+ String canonicalName = cls.getCanonicalName();
return canonicalName != null ? canonicalName : cls.getName();
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/Marker.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/Marker.java b/log4j-api/src/main/java/org/apache/logging/log4j/Marker.java
index 9cc03dd..784486e 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/Marker.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/Marker.java
@@ -29,7 +29,7 @@ public interface Marker extends Serializable {
/**
* Adds a Marker as a parent to this Marker.
- *
+ *
* @param markers The parent markers to add.
* @return The current Marker object, thus allowing multiple adds to be concatenated.
* @throws IllegalArgumentException if the argument is {@code null}
@@ -48,21 +48,21 @@ public interface Marker extends Serializable {
/**
* Returns the name of this Marker.
- *
+ *
* @return The name of the Marker.
*/
String getName();
/**
* Returns a list of parents of this Marker.
- *
+ *
* @return The parent Markers or {@code null} if this Marker has no parents.
*/
Marker[] getParents();
/**
* Returns a hash code value based on the name of this marker. Markers are equal if they have the same name.
- *
+ *
* @return the computed hash code
* @since 2.4
*/
@@ -71,14 +71,14 @@ public interface Marker extends Serializable {
/**
* Indicates whether this Marker has references to any other Markers.
- *
+ *
* @return {@code true} if the Marker has parent Markers
*/
boolean hasParents();
/**
* Checks whether this Marker is an instance of the specified Marker.
- *
+ *
* @param m The Marker to check.
* @return {@code true} if this Marker or one of its ancestors is the specified Marker, {@code false} otherwise.
* @throws IllegalArgumentException if the argument is {@code null}
@@ -87,7 +87,7 @@ public interface Marker extends Serializable {
/**
* Checks whether this Marker is an instance of the specified Marker.
- *
+ *
* @param name The name of the Marker.
* @return {@code true} if this Marker or one of its ancestors matches the specified name, {@code false} otherwise.
* @throws IllegalArgumentException if the argument is {@code null}
@@ -96,7 +96,7 @@ public interface Marker extends Serializable {
/**
* Removes the specified Marker as a parent of this Marker.
- *
+ *
* @param marker The marker to remove.
* @return {@code true} if the marker was removed.
* @throws IllegalArgumentException if the argument is {@code null}
@@ -105,7 +105,7 @@ public interface Marker extends Serializable {
/**
* Replaces the set of parent Markers with the provided Markers.
- *
+ *
* @param markers The new set of parent Markers or {@code null} to clear the parents.
* @return The current Marker object.
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/EntryMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/EntryMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/EntryMessage.java
index fe8bcc1..c00bd4c 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/EntryMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/EntryMessage.java
@@ -1,26 +1,26 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-/**
- * Entry flow messages
- *
- * @since 2.6
- */
-public interface EntryMessage extends FlowMessage {
- // empty
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.message;
+
+/**
+ * Entry flow messages
+ *
+ * @since 2.6
+ */
+public interface EntryMessage extends FlowMessage {
+ // empty
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/ExitMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/ExitMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/ExitMessage.java
index 9e1f23c..48722f6 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/ExitMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/ExitMessage.java
@@ -1,26 +1,26 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-/**
- * Exit flow messages
- *
- * @since 2.6
- */
-public interface ExitMessage extends FlowMessage {
- // empty
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.message;
+
+/**
+ * Exit flow messages
+ *
+ * @since 2.6
+ */
+public interface ExitMessage extends FlowMessage {
+ // empty
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/FlowMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/FlowMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/FlowMessage.java
index d708c30..c6d180d 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/FlowMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/FlowMessage.java
@@ -1,39 +1,39 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-/**
- * Flow messages
- *
- * @since 2.6
- */
-public interface FlowMessage extends Message {
-
- /**
- * The message text like "Enter" or "Exit" used to prefix the actual Message.
- *
- * @return message text used to prefix the actual Message.
- */
- String getText();
-
- /**
- * The wrapped message
- *
- * @return the wrapped message
- */
- Message getMessage();
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.message;
+
+/**
+ * Flow messages
+ *
+ * @since 2.6
+ */
+public interface FlowMessage extends Message {
+
+ /**
+ * The message text like "Enter" or "Exit" used to prefix the actual Message.
+ *
+ * @return message text used to prefix the actual Message.
+ */
+ String getText();
+
+ /**
+ * The wrapped message
+ *
+ * @return the wrapped message
+ */
+ Message getMessage();
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/FlowMessageFactory.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/FlowMessageFactory.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/FlowMessageFactory.java
index d1ca862..56ce7e7 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/FlowMessageFactory.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/FlowMessageFactory.java
@@ -21,7 +21,7 @@ package org.apache.logging.log4j.message;
* @since 2.6
*/
public interface FlowMessageFactory {
-
+
/**
* Creates a new entry message based on an existing message.
*
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/FormattedMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/FormattedMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/FormattedMessage.java
index 86f8322..a13fd99 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/FormattedMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/FormattedMessage.java
@@ -43,7 +43,7 @@ public class FormattedMessage implements Message {
private final Throwable throwable;
private Message message;
private final Locale locale;
-
+
/**
* Constructs with a locale, a pattern and a single parameter.
* @param locale The locale
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/FormattedMessageFactory.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/FormattedMessageFactory.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/FormattedMessageFactory.java
index c562c7d..805e24b 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/FormattedMessageFactory.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/FormattedMessageFactory.java
@@ -19,7 +19,7 @@ package org.apache.logging.log4j.message;
/**
* Creates {@link FormattedMessage} instances for {@link MessageFactory2} methods (and {@link MessageFactory} by
* extension.)
- *
+ *
* <h4>Note to implementors</h4>
* <p>
* This class implements all {@link MessageFactory2} methods.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
index a1b2e86..caf04f7 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
@@ -153,7 +153,7 @@ public class LocalizedMessage implements Message, LoggerNameAwareMessage {
/**
* Set the name of the Logger.
- *
+ *
* @param name The name of the Logger.
*/
@Override
@@ -163,7 +163,7 @@ public class LocalizedMessage implements Message, LoggerNameAwareMessage {
/**
* Returns the name of the Logger.
- *
+ *
* @return the name of the Logger.
*/
@Override
@@ -173,7 +173,7 @@ public class LocalizedMessage implements Message, LoggerNameAwareMessage {
/**
* Returns the formatted message after looking up the format in the resource bundle.
- *
+ *
* @return The formatted message String.
*/
@Override
@@ -218,7 +218,7 @@ public class LocalizedMessage implements Message, LoggerNameAwareMessage {
/**
* Override this to use a ResourceBundle.Control in Java 6
- *
+ *
* @param rbBaseName The base name of the resource bundle, a fully qualified class name.
* @param resourceBundleLocale The locale to use when formatting the message.
* @param loop If true the key will be treated as a package or class name and a resource bundle will be located
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessageFactory.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessageFactory.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessageFactory.java
index 18ab710..b7e9803 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessageFactory.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessageFactory.java
@@ -21,7 +21,7 @@ import java.util.ResourceBundle;
/**
* Creates {@link FormattedMessage} instances for {@link MessageFactory2} methods (and {@link MessageFactory} by
* extension.)
- *
+ *
* <h4>Note to implementors</h4>
* <p>
* This class does <em>not</em> implement any {@link MessageFactory2} methods and lets the superclass funnel those calls
@@ -73,7 +73,7 @@ public class LocalizedMessageFactory extends AbstractMessageFactory {
}
return new LocalizedMessage(resourceBundle, key);
}
-
+
/**
* Creates {@link LocalizedMessage} instances.
*
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
index 91f5b3e..38319d2 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
@@ -57,19 +57,19 @@ public class MapMessage<M extends MapMessage<M, V>, V> implements MultiFormatStr
* When set as the format specifier causes the Map to be formatted as XML.
*/
public enum MapFormat {
-
+
/** The map should be formatted as XML. */
XML,
-
+
/** The map should be formatted as JSON. */
JSON,
-
+
/** The map should be formatted the same as documented by java.util.AbstractMap.toString(). */
JAVA;
/**
* Maps a format name to an {@link MapFormat} while ignoring case.
- *
+ *
* @param format a MapFormat name
* @return a MapFormat
*/
@@ -82,7 +82,7 @@ public class MapMessage<M extends MapMessage<M, V>, V> implements MultiFormatStr
/**
* All {@code MapFormat} names.
- *
+ *
* @return All {@code MapFormat} names.
*/
public static String[] names() {
@@ -101,7 +101,7 @@ public class MapMessage<M extends MapMessage<M, V>, V> implements MultiFormatStr
/**
* Constructs a new instance.
- *
+ *
* @param initialCapacity the initial capacity.
*/
public MapMessage(final int initialCapacity) {
@@ -212,7 +212,7 @@ public class MapMessage<M extends MapMessage<M, V>, V> implements MultiFormatStr
* @return The value of the element or null if the key is not present.
*/
public String get(final String key) {
- final Object result = data.getValue(key);
+ Object result = data.getValue(key);
return ParameterFormatter.deepToString(result);
}
@@ -249,7 +249,7 @@ public class MapMessage<M extends MapMessage<M, V>, V> implements MultiFormatStr
return asString();
}
}
-
+
/**
* Performs the given action for each key-value pair in this data structure
* until all entries have been processed or the action throws an exception.
@@ -300,7 +300,7 @@ public class MapMessage<M extends MapMessage<M, V>, V> implements MultiFormatStr
public <CV, S> void forEach(final TriConsumer<String, ? super CV, S> action, final S state) {
data.forEach(action, state);
}
-
+
/**
* Formats the Structured data as described in <a href="https://tools.ietf.org/html/rfc5424">RFC 5424</a>.
*
@@ -343,7 +343,7 @@ public class MapMessage<M extends MapMessage<M, V>, V> implements MultiFormatStr
sb.append(" <Entry key=\"")
.append(data.getKeyAt(i))
.append("\">");
- final int size = sb.length();
+ int size = sb.length();
ParameterFormatter.recursiveDeepToString(data.getValueAt(i), sb, null);
StringBuilders.escapeXml(sb, size);
sb.append("</Entry>\n");
@@ -453,7 +453,7 @@ public class MapMessage<M extends MapMessage<M, V>, V> implements MultiFormatStr
}
@Override
- public void formatTo(final String[] formats, final StringBuilder buffer) {
+ public void formatTo(String[] formats, StringBuilder buffer) {
format(getFormat(formats), buffer);
}
@@ -485,10 +485,10 @@ public class MapMessage<M extends MapMessage<M, V>, V> implements MultiFormatStr
public Throwable getThrowable() {
return null;
}
-
+
/**
* Default implementation does nothing.
- *
+ *
* @since 2.9
*/
protected void validate(final String key, final boolean value) {
@@ -497,7 +497,7 @@ public class MapMessage<M extends MapMessage<M, V>, V> implements MultiFormatStr
/**
* Default implementation does nothing.
- *
+ *
* @since 2.9
*/
protected void validate(final String key, final byte value) {
@@ -506,7 +506,7 @@ public class MapMessage<M extends MapMessage<M, V>, V> implements MultiFormatStr
/**
* Default implementation does nothing.
- *
+ *
* @since 2.9
*/
protected void validate(final String key, final char value) {
@@ -515,7 +515,7 @@ public class MapMessage<M extends MapMessage<M, V>, V> implements MultiFormatStr
/**
* Default implementation does nothing.
- *
+ *
* @since 2.9
*/
protected void validate(final String key, final double value) {
@@ -524,16 +524,16 @@ public class MapMessage<M extends MapMessage<M, V>, V> implements MultiFormatStr
/**
* Default implementation does nothing.
- *
+ *
* @since 2.9
*/
protected void validate(final String key, final float value) {
// do nothing
}
-
+
/**
* Default implementation does nothing.
- *
+ *
* @since 2.9
*/
protected void validate(final String key, final int value) {
@@ -542,16 +542,16 @@ public class MapMessage<M extends MapMessage<M, V>, V> implements MultiFormatStr
/**
* Default implementation does nothing.
- *
+ *
* @since 2.9
*/
protected void validate(final String key, final long value) {
// do nothing
}
-
+
/**
* Default implementation does nothing.
- *
+ *
* @since 2.9
*/
protected void validate(final String key, final Object value) {
@@ -560,7 +560,7 @@ public class MapMessage<M extends MapMessage<M, V>, V> implements MultiFormatStr
/**
* Default implementation does nothing.
- *
+ *
* @since 2.9
*/
protected void validate(final String key, final short value) {
@@ -569,7 +569,7 @@ public class MapMessage<M extends MapMessage<M, V>, V> implements MultiFormatStr
/**
* Default implementation does nothing.
- *
+ *
* @since 2.9
*/
protected void validate(final String key, final String value) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/MessageFactory2.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/MessageFactory2.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/MessageFactory2.java
index b2940c2..33004dd 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/MessageFactory2.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/MessageFactory2.java
@@ -23,7 +23,7 @@ package org.apache.logging.log4j.message;
* @since 2.6
*/
public interface MessageFactory2 extends MessageFactory {
-
+
/**
* Creates a new message for the specified CharSequence.
* @param charSequence the (potentially mutable) CharSequence
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessage.java
index 0a4fac2..b34a72d 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessage.java
@@ -51,7 +51,7 @@ public class MessageFormatMessage implements Message {
/**
* Constructs a message.
- *
+ *
* @param locale the locale for this message format
* @param messagePattern the pattern for this message format
* @param parameters The objects to format
@@ -69,7 +69,7 @@ public class MessageFormatMessage implements Message {
/**
* Constructs a message.
- *
+ *
* @param messagePattern the pattern for this message format
* @param parameters The objects to format
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessageFactory.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessageFactory.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessageFactory.java
index 28a041d..f75e68b 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessageFactory.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessageFactory.java
@@ -19,7 +19,7 @@ package org.apache.logging.log4j.message;
/**
* Creates {@link FormattedMessage} instances for {@link MessageFactory2} methods (and {@link MessageFactory} by
* extension.)
- *
+ *
* <h4>Note to implementors</h4>
* <p>
* This class implements all {@link MessageFactory2} methods.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/ObjectArrayMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/ObjectArrayMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/ObjectArrayMessage.java
index f208bf4..dc11a56 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/ObjectArrayMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/ObjectArrayMessage.java
@@ -1,134 +1,134 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.Arrays;
-
-/**
- * Handles messages that contain an Object[].
- * <p>
- * Created for use with the CSV layout. For example:
- * </p>
- * <p>
- * {@code logger.debug(new ObjectArrayMessage(1, 2, "Bob"));}
- * </p>
- *
- * @since 2.4
- */
-public final class ObjectArrayMessage implements Message {
-
- private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
-
- private static final long serialVersionUID = -5903272448334166185L;
-
- private transient Object[] array;
- private transient String arrayString;
-
- /**
- * Creates the ObjectMessage.
- *
- * @param obj
- * The Object to format.
- */
- public ObjectArrayMessage(final Object... obj) {
- this.array = obj == null ? EMPTY_OBJECT_ARRAY : obj;
- }
-
- private boolean equalObjectsOrStrings(final Object[] left, final Object[] right) {
- return Arrays.equals(left, right) || Arrays.toString(left).equals(Arrays.toString(right));
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- final ObjectArrayMessage that = (ObjectArrayMessage) o;
- return array == null ? that.array == null : equalObjectsOrStrings(array, that.array);
- }
-
- /**
- * Returns the object formatted using its toString method.
- *
- * @return the String representation of the object.
- */
- @Override
- public String getFormat() {
- return getFormattedMessage();
- }
-
- /**
- * Returns the formatted object message.
- *
- * @return the formatted object message.
- */
- @Override
- public String getFormattedMessage() {
- // LOG4J2-763: cache formatted string in case obj changes later
- if (arrayString == null) {
- arrayString = Arrays.toString(array);
- }
- return arrayString;
- }
-
- /**
- * Returns the object as if it were a parameter.
- *
- * @return The object.
- */
- @Override
- public Object[] getParameters() {
- return array;
- }
-
- /**
- * Returns null.
- *
- * @return null.
- */
- @Override
- public Throwable getThrowable() {
- return null;
- }
-
- @Override
- public int hashCode() {
- return Arrays.hashCode(array);
- }
-
- private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
- in.defaultReadObject();
- array = (Object[]) in.readObject();
- }
-
- @Override
- public String toString() {
- return getFormattedMessage();
- }
-
- private void writeObject(final ObjectOutputStream out) throws IOException {
- out.defaultWriteObject();
- out.writeObject(array);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.message;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.Arrays;
+
+/**
+ * Handles messages that contain an Object[].
+ * <p>
+ * Created for use with the CSV layout. For example:
+ * </p>
+ * <p>
+ * {@code logger.debug(new ObjectArrayMessage(1, 2, "Bob"));}
+ * </p>
+ *
+ * @since 2.4
+ */
+public final class ObjectArrayMessage implements Message {
+
+ private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
+
+ private static final long serialVersionUID = -5903272448334166185L;
+
+ private transient Object[] array;
+ private transient String arrayString;
+
+ /**
+ * Creates the ObjectMessage.
+ *
+ * @param obj
+ * The Object to format.
+ */
+ public ObjectArrayMessage(final Object... obj) {
+ this.array = obj == null ? EMPTY_OBJECT_ARRAY : obj;
+ }
+
+ private boolean equalObjectsOrStrings(final Object[] left, final Object[] right) {
+ return Arrays.equals(left, right) || Arrays.toString(left).equals(Arrays.toString(right));
+ }
+
+ @Override
+ public boolean equals(final Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+
+ final ObjectArrayMessage that = (ObjectArrayMessage) o;
+ return array == null ? that.array == null : equalObjectsOrStrings(array, that.array);
+ }
+
+ /**
+ * Returns the object formatted using its toString method.
+ *
+ * @return the String representation of the object.
+ */
+ @Override
+ public String getFormat() {
+ return getFormattedMessage();
+ }
+
+ /**
+ * Returns the formatted object message.
+ *
+ * @return the formatted object message.
+ */
+ @Override
+ public String getFormattedMessage() {
+ // LOG4J2-763: cache formatted string in case obj changes later
+ if (arrayString == null) {
+ arrayString = Arrays.toString(array);
+ }
+ return arrayString;
+ }
+
+ /**
+ * Returns the object as if it were a parameter.
+ *
+ * @return The object.
+ */
+ @Override
+ public Object[] getParameters() {
+ return array;
+ }
+
+ /**
+ * Returns null.
+ *
+ * @return null.
+ */
+ @Override
+ public Throwable getThrowable() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ return Arrays.hashCode(array);
+ }
+
+ private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
+ in.defaultReadObject();
+ array = (Object[]) in.readObject();
+ }
+
+ @Override
+ public String toString() {
+ return getFormattedMessage();
+ }
+
+ private void writeObject(final ObjectOutputStream out) throws IOException {
+ out.defaultWriteObject();
+ out.writeObject(array);
+ }
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessageFactory.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessageFactory.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessageFactory.java
index 1a0559d..5878cac 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessageFactory.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessageFactory.java
@@ -28,7 +28,7 @@ package org.apache.logging.log4j.message;
* <p>
* This class is immutable.
* </p>
- *
+ *
* <h4>Note to implementors</h4>
* <p>
* This class implements all {@link MessageFactory2} methods.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableObjectMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableObjectMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableObjectMessage.java
index 9144223..76917f3 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableObjectMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableObjectMessage.java
@@ -104,7 +104,7 @@ public class ReusableObjectMessage implements ReusableMessage, ParameterVisitabl
// go ahead and allocate the memory now;
// this saves an allocation in the future when this buffer is re-used
if (emptyReplacement.length == 0) {
- final Object[] params = new Object[10]; // Default reusable parameter buffer size
+ Object[] params = new Object[10]; // Default reusable parameter buffer size
params[0] = obj;
return params;
}
@@ -122,7 +122,7 @@ public class ReusableObjectMessage implements ReusableMessage, ParameterVisitabl
}
@Override
- public <S> void forEachParameter(final ParameterConsumer<S> action, final S state) {
+ public <S> void forEachParameter(ParameterConsumer<S> action, S state) {
action.accept(obj, 0, state);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableParameterizedMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableParameterizedMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableParameterizedMessage.java
index c206ab1..c0f5884 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableParameterizedMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableParameterizedMessage.java
@@ -109,8 +109,8 @@ public class ReusableParameterizedMessage implements ReusableMessage, ParameterV
}
@Override
- public <S> void forEachParameter(final ParameterConsumer<S> action, final S state) {
- final Object[] parameters = getParams();
+ public <S> void forEachParameter(ParameterConsumer<S> action, S state) {
+ Object[] parameters = getParams();
for (short i = 0; i < argCount; i++) {
action.accept(parameters[i], i, state);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableSimpleMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableSimpleMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableSimpleMessage.java
index de0b975..2a186be 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableSimpleMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableSimpleMessage.java
@@ -81,7 +81,7 @@ public class ReusableSimpleMessage implements ReusableMessage, CharSequence, Par
}
@Override
- public <S> void forEachParameter(final ParameterConsumer<S> action, final S state) {
+ public <S> void forEachParameter(ParameterConsumer<S> action, S state) {
}
@Override
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/SimpleMessageFactory.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/SimpleMessageFactory.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/SimpleMessageFactory.java
index d472ff8..e85b8c0 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/SimpleMessageFactory.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/SimpleMessageFactory.java
@@ -29,12 +29,12 @@ package org.apache.logging.log4j.message;
* <p>
* This class is immutable.
* </p>
- *
+ *
* <h4>Note to implementors</h4>
* <p>
* This class implements all {@link MessageFactory2} methods.
* </p>
- *
+ *
* @since 2.5
*/
public final class SimpleMessageFactory extends AbstractMessageFactory {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/StringFormattedMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/StringFormattedMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/StringFormattedMessage.java
index 8b54347..a99e2ef 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/StringFormattedMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/StringFormattedMessage.java
@@ -28,7 +28,7 @@ import org.apache.logging.log4j.status.StatusLogger;
/**
* Handles messages that consist of a format string conforming to {@link java.util.Formatter}.
- *
+ *
* <h4>Note to implementors</h4>
* <p>
* This class implements the unrolled args API even though StringFormattedMessage does not. This leaves the room for
@@ -49,10 +49,10 @@ public class StringFormattedMessage implements Message {
private transient String formattedMessage;
private transient Throwable throwable;
private final Locale locale;
-
+
/**
* Constructs a message.
- *
+ *
* @param locale the locale for this message format
* @param messagePattern the pattern for this message format
* @param arguments The objects to format
@@ -69,7 +69,7 @@ public class StringFormattedMessage implements Message {
/**
* Constructs a message.
- *
+ *
* @param messagePattern the pattern for this message format
* @param arguments The objects to format
* @since 2.6
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/StringMapMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/StringMapMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/StringMapMessage.java
index 499190e..9d05ce0 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/StringMapMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/StringMapMessage.java
@@ -23,7 +23,7 @@ import org.apache.logging.log4j.util.PerformanceSensitive;
/**
* A {@link StringMapMessage} typed to {@link String}-only values. This is like the MapMessage class before 2.9.
- *
+ *
* @since 2.9
*/
@PerformanceSensitive("allocation")
@@ -41,7 +41,7 @@ public class StringMapMessage extends MapMessage<StringMapMessage, String> {
/**
* Constructs a new instance.
- *
+ *
* @param initialCapacity
* the initial capacity.
*/
@@ -51,7 +51,7 @@ public class StringMapMessage extends MapMessage<StringMapMessage, String> {
/**
* Constructs a new instance based on an existing Map.
- *
+ *
* @param map
* The Map.
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataCollectionMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataCollectionMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataCollectionMessage.java
index 89ebd92..e58aed3 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataCollectionMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataCollectionMessage.java
@@ -29,9 +29,9 @@ public class StructuredDataCollectionMessage implements StringBuilderFormattable
MessageCollectionMessage<StructuredDataMessage> {
private static final long serialVersionUID = 5725337076388822924L;
- private final List<StructuredDataMessage> structuredDataMessageList;
+ private List<StructuredDataMessage> structuredDataMessageList;
- public StructuredDataCollectionMessage(final List<StructuredDataMessage> messages) {
+ public StructuredDataCollectionMessage(List<StructuredDataMessage> messages) {
this.structuredDataMessageList = messages;
}
@@ -42,15 +42,15 @@ public class StructuredDataCollectionMessage implements StringBuilderFormattable
@Override
public String getFormattedMessage() {
- final StringBuilder sb = new StringBuilder();
+ StringBuilder sb = new StringBuilder();
formatTo(sb);
return sb.toString();
}
@Override
public String getFormat() {
- final StringBuilder sb = new StringBuilder();
- for (final StructuredDataMessage msg : structuredDataMessageList) {
+ StringBuilder sb = new StringBuilder();
+ for (StructuredDataMessage msg : structuredDataMessageList) {
if (msg.getFormat() != null) {
if (sb.length() > 0) {
sb.append(", ");
@@ -62,27 +62,27 @@ public class StructuredDataCollectionMessage implements StringBuilderFormattable
}
@Override
- public void formatTo(final StringBuilder buffer) {
- for (final StructuredDataMessage msg : structuredDataMessageList) {
+ public void formatTo(StringBuilder buffer) {
+ for (StructuredDataMessage msg : structuredDataMessageList) {
msg.formatTo(buffer);
}
}
@Override
public Object[] getParameters() {
- final List<Object[]> objectList = new ArrayList<>();
+ List<Object[]> objectList = new ArrayList<>();
int count = 0;
- for (final StructuredDataMessage msg : structuredDataMessageList) {
- final Object[] objects = msg.getParameters();
+ for (StructuredDataMessage msg : structuredDataMessageList) {
+ Object[] objects = msg.getParameters();
if (objects != null) {
objectList.add(objects);
count += objects.length;
}
}
- final Object[] objects = new Object[count];
+ Object[] objects = new Object[count];
int index = 0;
- for (final Object[] objs : objectList) {
- for (final Object obj : objs) {
+ for (Object[] objs : objectList) {
+ for (Object obj : objs) {
objects[index++] = obj;
}
}
@@ -91,8 +91,8 @@ public class StructuredDataCollectionMessage implements StringBuilderFormattable
@Override
public Throwable getThrowable() {
- for (final StructuredDataMessage msg : structuredDataMessageList) {
- final Throwable t = msg.getThrowable();
+ for (StructuredDataMessage msg : structuredDataMessageList) {
+ Throwable t = msg.getThrowable();
if (t != null) {
return t;
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java
index d103aa5..32fa2a5 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java
@@ -83,7 +83,7 @@ public class StructuredDataMessage extends MapMessage<StructuredDataMessage, Str
this.type = type;
this.maxLength = maxLength;
}
-
+
/**
* Creates a StructuredDataMessage using an ID (max 32 characters), message, type (max 32 characters), and an
* initial map of structured data to include.
@@ -253,7 +253,7 @@ public class StructuredDataMessage extends MapMessage<StructuredDataMessage, Str
}
@Override
- public void formatTo(final String[] formats, final StringBuilder buffer) {
+ public void formatTo(String[] formats, StringBuilder buffer) {
asString(getFormat(formats), null, buffer);
}
@@ -355,7 +355,7 @@ public class StructuredDataMessage extends MapMessage<StructuredDataMessage, Str
}
}
- private void asXml(final StructuredDataId structuredDataId, final StringBuilder sb) {
+ private void asXml(StructuredDataId structuredDataId, StringBuilder sb) {
sb.append("<StructuredData>\n");
sb.append("<type>").append(type).append("</type>\n");
sb.append("<id>").append(structuredDataId).append("</id>\n");
@@ -386,7 +386,7 @@ public class StructuredDataMessage extends MapMessage<StructuredDataMessage, Str
return asString(getFormat(formats), null);
}
- private Format getFormat(final String[] formats) {
+ private Format getFormat(String[] formats) {
if (formats != null && formats.length > 0) {
for (int i = 0; i < formats.length; i++) {
final String format = formats[i];
@@ -468,7 +468,7 @@ public class StructuredDataMessage extends MapMessage<StructuredDataMessage, Str
protected void validate(final String key, final char value) {
validateKey(key);
}
-
+
/**
* @since 2.9
*/
@@ -476,7 +476,7 @@ public class StructuredDataMessage extends MapMessage<StructuredDataMessage, Str
protected void validate(final String key, final double value) {
validateKey(key);
}
-
+
/**
* @since 2.9
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-api/src/main/java/org/apache/logging/log4j/message/ThreadInformation.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/ThreadInformation.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/ThreadInformation.java
index 1a276f3..f3b4080 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/ThreadInformation.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/ThreadInformation.java
@@ -20,7 +20,7 @@ package org.apache.logging.log4j.message;
* Interface used to print basic or extended thread information.
*/
public interface ThreadInformation {
-
+
/**
* Formats the thread information into the provided StringBuilder.
* @param sb The StringBuilder.
[04/13] logging-log4j2 git commit: Revert "Use final. Remove trailing
spaces."
Posted by gg...@apache.org.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppenderRemapTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppenderRemapTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppenderRemapTest.java
index c4d647b..3c6d301 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppenderRemapTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppenderRemapTest.java
@@ -35,7 +35,7 @@ import static org.junit.Assert.*;
/**
* Tests that logged strings appear in the file, that the initial file size is the specified specified region length,
* that the file is extended by region length when necessary, and that the file is shrunk to its actual usage when done.
- *
+ *
* @since 2.1
*/
public class MemoryMappedFileAppenderRemapTest {
@@ -65,7 +65,7 @@ public class MemoryMappedFileAppenderRemapTest {
log.warn(new String(text));
assertEquals("grown", 256 * 2, f.length());
-
+
log.warn(new String(text));
assertEquals("grown again", 256 * 3, f.length());
} finally {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppenderSimpleTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppenderSimpleTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppenderSimpleTest.java
index ebab4cd..277e046 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppenderSimpleTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppenderSimpleTest.java
@@ -35,7 +35,7 @@ import static org.junit.Assert.*;
* Tests that logged strings appear in the file,
* that the default file size is used if not specified
* and that the file is shrunk to its actual usage when done.
- *
+ *
* @since 2.1
*/
public class MemoryMappedFileAppenderSimpleTest {
@@ -54,13 +54,13 @@ public class MemoryMappedFileAppenderSimpleTest {
assertTrue(f.delete());
}
assertTrue(!f.exists());
-
+
final Logger log = LogManager.getLogger();
try {
log.warn("Test log1");
assertTrue(f.exists());
assertEquals("initial length", MemoryMappedFileManager.DEFAULT_REGION_LENGTH, f.length());
-
+
log.warn("Test log2");
assertEquals("not grown", MemoryMappedFileManager.DEFAULT_REGION_LENGTH, f.length());
} finally {
@@ -68,7 +68,7 @@ public class MemoryMappedFileAppenderSimpleTest {
}
final int LINESEP = System.lineSeparator().length();
assertEquals("Shrunk to actual used size", 186 + 2 * LINESEP, f.length());
-
+
String line1, line2, line3;
try (final BufferedReader reader = new BufferedReader(new FileReader(LOGFILE))) {
line1 = reader.readLine();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ScriptAppenderSelectorTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ScriptAppenderSelectorTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ScriptAppenderSelectorTest.java
index 670eafc..a1fe45c 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ScriptAppenderSelectorTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ScriptAppenderSelectorTest.java
@@ -43,7 +43,7 @@ public class ScriptAppenderSelectorTest {
@Parameterized.Parameters(name = "{0}")
public static Object[][] getParameters() {
// @formatter:off
- return new Object[][] {
+ return new Object[][] {
{ "log4j-appender-selector-groovy.xml" },
{ "log4j-appender-selector-javascript.xml" },
};
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SmtpAppenderAsyncTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SmtpAppenderAsyncTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SmtpAppenderAsyncTest.java
index ccac7e6..91503d3 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SmtpAppenderAsyncTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SmtpAppenderAsyncTest.java
@@ -64,7 +64,7 @@ public class SmtpAppenderAsyncTest {
testSmtpAppender(ctx.getLogger("async"));
}
- private void testSmtpAppender(final Logger logger) {
+ private void testSmtpAppender(Logger logger) {
ThreadContext.put("MDC1", "mdc1");
logger.error("the message");
ctx.getLoggerContext().stop();
@@ -78,7 +78,7 @@ public class SmtpAppenderAsyncTest {
assertEquals("from@example.com", email.getHeaderValue("From"));
assertEquals("[mdc1]", email.getHeaderValue("Subject"));
- final String body = email.getBody();
+ String body = email.getBody();
if (!body.contains("Body:[mdc1]")) {
fail(body);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.java
index aefc8c4..08b7f20 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.java
@@ -132,7 +132,7 @@ public class SocketAppenderTest {
.withPort(tcpTestServer.getLocalPort())
.withReconnectDelayMillis(-1).setName("test")
.withImmediateFail(false)
- .withBufferSize(bufferSize).setLayout(JsonLayout.newBuilder().setProperties(true).build())
+ .withBufferSize(bufferSize).setLayout((Layout<? extends Serializable>) JsonLayout.newBuilder().setProperties(true).build())
.build();
// @formatter:on
appender.start();
@@ -177,7 +177,7 @@ public class SocketAppenderTest {
final SocketAppender appender = SocketAppender.newBuilder()
.withPort(tcpServer.getLocalPort())
.withReconnectDelayMillis(-1).setName("test")
- .withImmediateFail(false).setLayout(JsonLayout.newBuilder().setProperties(true).build())
+ .withImmediateFail(false).setLayout((Layout<? extends Serializable>) JsonLayout.newBuilder().setProperties(true).build())
.build();
// @formatter:on
assertNotNull(appender);
@@ -197,7 +197,7 @@ public class SocketAppenderTest {
.withProtocol(Protocol.UDP)
.withPort(tcpServer.getLocalPort())
.withReconnectDelayMillis(-1).setName("test")
- .withImmediateFail(false).setLayout(JsonLayout.newBuilder().setProperties(true).build())
+ .withImmediateFail(false).setLayout((Layout<? extends Serializable>) JsonLayout.newBuilder().setProperties(true).build())
.build();
// @formatter:on
appender.start();
@@ -221,7 +221,7 @@ public class SocketAppenderTest {
.withHost("localhost")
.withPort(DYN_PORT)
.withReconnectDelayMillis(100).setName("test")
- .withImmediateFail(false).setLayout(JsonLayout.newBuilder().setProperties(true).build())
+ .withImmediateFail(false).setLayout((Layout<? extends Serializable>) JsonLayout.newBuilder().setProperties(true).build())
.build();
// @formatter:on
appender.start();
@@ -250,7 +250,7 @@ public class SocketAppenderTest {
.withHost("localhost")
.withPort(ERROR_PORT)
.withReconnectDelayMillis(100).setName("test")
- .withImmediateFail(false).setIgnoreExceptions(false).setLayout(JsonLayout.newBuilder().setProperties(true).build())
+ .withImmediateFail(false).setIgnoreExceptions(false).setLayout((Layout<? extends Serializable>) JsonLayout.newBuilder().setProperties(true).build())
.build();
// @formatter:on
appender.start();
@@ -294,7 +294,7 @@ public class SocketAppenderTest {
thread.interrupt();
try {
thread.join(100);
- } catch (final InterruptedException ie) {
+ } catch (InterruptedException ie) {
System.out.println("Unable to stop server");
}
}
@@ -361,7 +361,7 @@ public class SocketAppenderTest {
interrupt();
try {
this.join(100);
- } catch (final InterruptedException ie) {
+ } catch (InterruptedException ie) {
System.out.println("Unable to stop server");
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderCustomLayoutTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderCustomLayoutTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderCustomLayoutTest.java
index 87e24cc..9888eb4 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderCustomLayoutTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderCustomLayoutTest.java
@@ -34,7 +34,7 @@ public class SyslogAppenderCustomLayoutTest extends SyslogAppenderTest {
@Override
protected Builder newSyslogAppenderBuilder(final String protocol, final String format, final boolean newLine) {
final Builder builder = super.newSyslogAppenderBuilder(protocol, format, newLine);
- builder.setLayout(SyslogLayout.newBuilder().setFacility(Facility.LOCAL3).setIncludeNewLine(true).build());
+ builder.setLayout((Layout<? extends Serializable>) SyslogLayout.newBuilder().setFacility(Facility.LOCAL3).setIncludeNewLine(true).build());
return builder;
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/XmlCompleteFileAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/XmlCompleteFileAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/XmlCompleteFileAppenderTest.java
index 9f38595..c77b464 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/XmlCompleteFileAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/XmlCompleteFileAppenderTest.java
@@ -21,6 +21,7 @@ import java.io.File;
import java.io.FileReader;
import java.nio.charset.Charset;
import java.nio.file.Files;
+import java.nio.file.Paths;
import java.util.List;
import org.apache.logging.log4j.Logger;
@@ -140,7 +141,7 @@ public class XmlCompleteFileAppenderTest {
logger.info(secondLogMsg);
CoreLoggerContexts.stopLoggerContext(false, logFile); // stop async thread
- final int[] indentations = {
+ int[] indentations = {
0, //"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
0, //"<Events xmlns=\"http://logging.apache.org/log4j/2.0/events\">\n"
-1, // empty
@@ -155,15 +156,15 @@ public class XmlCompleteFileAppenderTest {
2, //" </Event>\n" +
0, //"</Events>\n";
};
- final List<String> lines1 = Files.readAllLines(logFile.toPath(), Charset.forName("UTF-8"));
+ List<String> lines1 = Files.readAllLines(logFile.toPath(), Charset.forName("UTF-8"));
assertEquals("number of lines", indentations.length, lines1.size());
for (int i = 0; i < indentations.length; i++) {
- final String line = lines1.get(i);
+ String line = lines1.get(i);
if (line.trim().isEmpty()) {
assertEquals(-1, indentations[i]);
} else {
- final String padding = " ".substring(0, indentations[i]);
+ String padding = " ".substring(0, indentations[i]);
assertTrue("Expected " + indentations[i] + " leading spaces but got: " + line, line.startsWith(padding));
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/XmlFileAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/XmlFileAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/XmlFileAppenderTest.java
index d189860..f9cdff3 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/XmlFileAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/XmlFileAppenderTest.java
@@ -16,7 +16,9 @@
*/
package org.apache.logging.log4j.core.appender;
+import java.io.BufferedReader;
import java.io.File;
+import java.io.FileReader;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.util.List;
@@ -54,10 +56,10 @@ public class XmlFileAppenderTest {
log.info(logMsg);
CoreLoggerContexts.stopLoggerContext(false, file); // stop async thread
- final List<String> lines = Files.readAllLines(file.toPath(), Charset.forName("UTF8"));
+ List<String> lines = Files.readAllLines(file.toPath(), Charset.forName("UTF8"));
file.delete();
- final String[] expect = {
+ String[] expect = {
"", // ? unsure why initial empty line...
"<Event ", //
"<Instant epochSecond=", //
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManagerTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManagerTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManagerTest.java
index c042032..932724d 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManagerTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManagerTest.java
@@ -246,7 +246,7 @@ public class AbstractDatabaseManagerTest {
}
@Override
- protected void writeInternal(final LogEvent event, final Serializable serializable) {
+ protected void writeInternal(LogEvent event, Serializable serializable) {
// noop
}
@Override
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/DriverManagerConnectionSourceTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/DriverManagerConnectionSourceTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/DriverManagerConnectionSourceTest.java
index b7ad8ac..c6b2de1 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/DriverManagerConnectionSourceTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/DriverManagerConnectionSourceTest.java
@@ -28,14 +28,14 @@ public class DriverManagerConnectionSourceTest {
@Test
public void testH2Properties() throws SQLException {
- final Property[] properties = new Property[] {
+ Property[] properties = new Property[] {
// @formatter:off
Property.createProperty("username", JdbcH2TestHelper.USER_NAME),
Property.createProperty("password", JdbcH2TestHelper.PASSWORD),
// @formatter:on
};
// @formatter:off
- final DriverManagerConnectionSource source = DriverManagerConnectionSource.newBuilder()
+ DriverManagerConnectionSource source = DriverManagerConnectionSource.newBuilder()
.setConnectionString(JdbcH2TestHelper.CONNECTION_STRING_MEM)
.setProperties(properties)
.build();
@@ -48,7 +48,7 @@ public class DriverManagerConnectionSourceTest {
@Test
public void testH2UserAndPassword() throws SQLException {
// @formatter:off
- final DriverManagerConnectionSource source = DriverManagerConnectionSource.newBuilder()
+ DriverManagerConnectionSource source = DriverManagerConnectionSource.newBuilder()
.setConnectionString(JdbcH2TestHelper.CONNECTION_STRING_MEM)
.setUserName(JdbcH2TestHelper.USER_NAME.toCharArray())
.setPassword(JdbcH2TestHelper.PASSWORD.toCharArray())
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppenderMapMessageDataSourceTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppenderMapMessageDataSourceTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppenderMapMessageDataSourceTest.java
index 027919d..a45139b 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppenderMapMessageDataSourceTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppenderMapMessageDataSourceTest.java
@@ -97,7 +97,7 @@ public class JdbcAppenderMapMessageDataSourceTest {
writer.close();
final Logger logger = LogManager.getLogger(this.getClass().getName() + ".testDataSourceConfig");
- final MapMessage mapMessage = new MapMessage();
+ MapMessage mapMessage = new MapMessage();
mapMessage.with("Id", 1);
mapMessage.with("ColumnA", "ValueA");
mapMessage.with("ColumnB", "ValueB");
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppenderStringSubstitutionTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppenderStringSubstitutionTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppenderStringSubstitutionTest.java
index dca7dcf..f77ef56 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppenderStringSubstitutionTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppenderStringSubstitutionTest.java
@@ -36,17 +36,17 @@ public class JdbcAppenderStringSubstitutionTest {
public static void afterClass() {
System.getProperties().remove(KEY);
}
-
+
@Rule
public final LoggerContextRule rule = new LoggerContextRule("org/apache/logging/log4j/core/appender/db/jdbc/log4j2-jdbc-string-substitution.xml");
@Test
public void test() throws Exception {
- final JdbcAppender appender = rule.getAppender("databaseAppender", JdbcAppender.class);
+ JdbcAppender appender = rule.getAppender("databaseAppender", JdbcAppender.class);
Assert.assertNotNull(appender);
- final JdbcDatabaseManager manager = appender.getManager();
+ JdbcDatabaseManager manager = appender.getManager();
Assert.assertNotNull(manager);
- final String sqlStatement = manager.getSqlStatement();
+ String sqlStatement = manager.getSqlStatement();
Assert.assertFalse(sqlStatement, sqlStatement.contains(KEY));
Assert.assertTrue(sqlStatement, sqlStatement.contains(VALUE));
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/jeromq/JeroMqAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/jeromq/JeroMqAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/jeromq/JeroMqAppenderTest.java
index b639b4d..24b8d25 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/jeromq/JeroMqAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/jeromq/JeroMqAppenderTest.java
@@ -41,7 +41,7 @@ public class JeroMqAppenderTest {
private static final String APPENDER_NAME = "JeroMQAppender";
private static final int DEFAULT_TIMEOUT_MILLIS = 60000;
-
+
@ClassRule
public static LoggerContextRule ctx = new LoggerContextRule("JeroMqAppenderTest.xml");
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/jeromq/JeroMqTestClient.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/jeromq/JeroMqTestClient.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/jeromq/JeroMqTestClient.java
index f35e82a..ddd06ab 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/jeromq/JeroMqTestClient.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/jeromq/JeroMqTestClient.java
@@ -1,55 +1,55 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-package org.apache.logging.log4j.core.appender.mom.jeromq;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Callable;
-
-import org.zeromq.ZMQ;
-
-class JeroMqTestClient implements Callable<List<String>> {
-
- private final ZMQ.Context context;
-
- private final String endpoint;
- private final List<String> messages;
- private final int receiveCount;
-
- JeroMqTestClient(final ZMQ.Context context, final String endpoint, final int receiveCount) {
- super();
- this.context = context;
- this.endpoint = endpoint;
- this.receiveCount = receiveCount;
- this.messages = new ArrayList<>(receiveCount);
- }
-
- @Override
- public List<String> call() throws Exception {
- try (ZMQ.Socket subscriber = context.socket(ZMQ.SUB)) {
- subscriber.connect(endpoint);
- subscriber.subscribe(new byte[0]);
- for (int messageNum = 0; messageNum < receiveCount
- && !Thread.currentThread().isInterrupted(); messageNum++) {
- // Use trim to remove the tailing '0' character
- messages.add(subscriber.recvStr(0).trim());
- }
- }
- return messages;
- }
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.core.appender.mom.jeromq;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Callable;
+
+import org.zeromq.ZMQ;
+
+class JeroMqTestClient implements Callable<List<String>> {
+
+ private final ZMQ.Context context;
+
+ private final String endpoint;
+ private final List<String> messages;
+ private final int receiveCount;
+
+ JeroMqTestClient(final ZMQ.Context context, final String endpoint, final int receiveCount) {
+ super();
+ this.context = context;
+ this.endpoint = endpoint;
+ this.receiveCount = receiveCount;
+ this.messages = new ArrayList<>(receiveCount);
+ }
+
+ @Override
+ public List<String> call() throws Exception {
+ try (ZMQ.Socket subscriber = context.socket(ZMQ.SUB)) {
+ subscriber.connect(endpoint);
+ subscriber.subscribe(new byte[0]);
+ for (int messageNum = 0; messageNum < receiveCount
+ && !Thread.currentThread().isInterrupted(); messageNum++) {
+ // Use trim to remove the tailing '0' character
+ messages.add(subscriber.recvStr(0).trim());
+ }
+ }
+ return messages;
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppenderCloseTimeoutTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppenderCloseTimeoutTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppenderCloseTimeoutTest.java
index aaa5441..a8d3566 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppenderCloseTimeoutTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppenderCloseTimeoutTest.java
@@ -39,15 +39,15 @@ public class KafkaAppenderCloseTimeoutTest {
public void close() {
try {
Thread.sleep(3000);
- } catch (final InterruptedException ignore) {
+ } catch (InterruptedException ignore) {
}
}
@Override
- public void close(final long timeout, final TimeUnit timeUnit) {
+ public void close(long timeout, TimeUnit timeUnit) {
try {
Thread.sleep(timeUnit.toMillis(timeout));
- } catch (final InterruptedException ignore) {
+ } catch (InterruptedException ignore) {
}
}
};
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppenderTest.java
index 80a93a9..613bd74 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppenderTest.java
@@ -137,8 +137,8 @@ public class KafkaAppenderTest {
final ProducerRecord<byte[], byte[]> item = history.get(0);
assertNotNull(item);
assertEquals(TOPIC_NAME, item.topic());
- final String msgKey = item.key().toString();
- final byte[] keyValue = "key".getBytes(StandardCharsets.UTF_8);
+ String msgKey = item.key().toString();
+ byte[] keyValue = "key".getBytes(StandardCharsets.UTF_8);
assertArrayEquals(item.key(), keyValue);
assertEquals(LOG_MESSAGE, new String(item.value(), StandardCharsets.UTF_8));
}
@@ -147,15 +147,15 @@ public class KafkaAppenderTest {
public void testAppendWithKeyLookup() throws Exception {
final Appender appender = ctx.getRequiredAppender("KafkaAppenderWithKeyLookup");
final LogEvent logEvent = createLogEvent();
- final Date date = new Date();
- final SimpleDateFormat format = new SimpleDateFormat("dd-MM-yyyy");
+ Date date = new Date();
+ SimpleDateFormat format = new SimpleDateFormat("dd-MM-yyyy");
appender.append(logEvent);
final List<ProducerRecord<byte[], byte[]>> history = kafka.history();
assertEquals(1, history.size());
final ProducerRecord<byte[], byte[]> item = history.get(0);
assertNotNull(item);
assertEquals(TOPIC_NAME, item.topic());
- final byte[] keyValue = format.format(date).getBytes(StandardCharsets.UTF_8);
+ byte[] keyValue = format.format(date).getBytes(StandardCharsets.UTF_8);
assertArrayEquals(item.key(), keyValue);
assertEquals(LOG_MESSAGE, new String(item.value(), StandardCharsets.UTF_8));
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/LoggerNameLevelRewritePolicyTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/LoggerNameLevelRewritePolicyTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/LoggerNameLevelRewritePolicyTest.java
index 101f8fa..a30a0e6 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/LoggerNameLevelRewritePolicyTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/LoggerNameLevelRewritePolicyTest.java
@@ -26,7 +26,7 @@ import org.junit.Test;
/**
* Tests {@link LoggerNameLevelRewritePolicy}.
- *
+ *
* @since 2.4
*/
public class LoggerNameLevelRewritePolicyTest {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/MapRewritePolicyTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/MapRewritePolicyTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/MapRewritePolicyTest.java
index e360f83..3247f82 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/MapRewritePolicyTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/MapRewritePolicyTest.java
@@ -52,7 +52,7 @@ public class MapRewritePolicyTest {
public static void setupClass() {
stringMap.putValue("test1", "one");
stringMap.putValue("test2", "two");
- map = stringMap.toMap();
+ map = stringMap.toMap();
logEvent0 = Log4jLogEvent.newBuilder() //
.setLoggerName("test") //
.setContextData(stringMap) //
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/CronTriggeringPolicyTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/CronTriggeringPolicyTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/CronTriggeringPolicyTest.java
index 9fce567..8bf89e0 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/CronTriggeringPolicyTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/CronTriggeringPolicyTest.java
@@ -29,7 +29,7 @@ import org.junit.Test;
public class CronTriggeringPolicyTest {
private static final String CRON_EXPRESSION = "0 0 0 * * ?";
-
+
private NullConfiguration configuration;
// TODO Need a CleanRegexFiles("testcmd.\\.log\\..*");
@@ -96,7 +96,7 @@ public class CronTriggeringPolicyTest {
// @formatter:on
}
-
+
/**
* Tests LOG4J2-1474 CronTriggeringPolicy raise exception and fail to rollover log file when evaluateOnStartup is
* true.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/FileSizeTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/FileSizeTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/FileSizeTest.java
index 9b9bf45..8121ce7 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/FileSizeTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/FileSizeTest.java
@@ -25,7 +25,7 @@ import static org.junit.Assert.*;
public class FileSizeTest {
private final static long EXPECTED = 10 * 1024;
-
+
@Test
public void testFileSize() throws Exception {
long value = FileSize.parse("10KB", 0);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderDeleteNestedTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderDeleteNestedTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderDeleteNestedTest.java
index c1f08a6..7d335f0 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderDeleteNestedTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderDeleteNestedTest.java
@@ -77,7 +77,7 @@ public class RollingAppenderDeleteNestedTest {
System.out.println(file + " (" + file.length() + "B) "
+ FixedDateFormat.create(FixedFormat.ABSOLUTE).format(file.lastModified()));
}
-
+
final List<String> expected = Arrays.asList("my-1.log", "my-2.log", "my-3.log", "my-4.log", "my-5.log");
assertEquals(Arrays.toString(files), expected.size() + 3, files.length);
for (final File file : files) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderDirectWriteWithReconfigureTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderDirectWriteWithReconfigureTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderDirectWriteWithReconfigureTest.java
index d1398d3..0d8edaf 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderDirectWriteWithReconfigureTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderDirectWriteWithReconfigureTest.java
@@ -57,7 +57,7 @@ public class RollingAppenderDirectWriteWithReconfigureTest {
@SuppressWarnings("resource") // managed by the rule.
final LoggerContext context = loggerContextRule.getLoggerContext();
- final Configuration config = context.getConfiguration();
+ Configuration config = context.getConfiguration();
context.setConfigLocation(new URI(CONFIG));
context.reconfigure();
logger.debug("Force a rollover");
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderUncompressedTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderUncompressedTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderUncompressedTest.java
index 5a45f01..730e1b2 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderUncompressedTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderUncompressedTest.java
@@ -41,7 +41,7 @@ public class RollingAppenderUncompressedTest {
private static final String DIR = "target/rolling4";
private final Logger logger = LogManager.getLogger(RollingAppenderUncompressedTest.class.getName());
-
+
@ClassRule
public static CleanFolders rule = new CleanFolders(CONFIG);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderReconfigureTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderReconfigureTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderReconfigureTest.java
index d1112b0..8c4657a 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderReconfigureTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderReconfigureTest.java
@@ -27,8 +27,8 @@ import org.junit.Test;
public class RollingFileAppenderReconfigureTest {
@Rule
- public final LoggerContextRule loggerContextRule = new LoggerContextRule("src/test/rolling-file-appender-reconfigure.xml");
-
+ public final LoggerContextRule loggerContextRule = new LoggerContextRule("src/test/rolling-file-appender-reconfigure.xml");
+
@Test
public void testReconfigure() {
loggerContextRule.reconfigure();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderReconfigureUndefinedSystemPropertyTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderReconfigureUndefinedSystemPropertyTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderReconfigureUndefinedSystemPropertyTest.java
index 88b42d7..31a21b1 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderReconfigureUndefinedSystemPropertyTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderReconfigureUndefinedSystemPropertyTest.java
@@ -27,8 +27,8 @@ import org.junit.Test;
public class RollingFileAppenderReconfigureUndefinedSystemPropertyTest {
@Rule
- public final LoggerContextRule loggerContextRule = new LoggerContextRule("src/test/rolling-file-appender-reconfigure.original.xml");
-
+ public final LoggerContextRule loggerContextRule = new LoggerContextRule("src/test/rolling-file-appender-reconfigure.original.xml");
+
@Test
public void testReconfigure() {
loggerContextRule.reconfigure();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/DummyFileAttributes.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/DummyFileAttributes.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/DummyFileAttributes.java
index c2bbb1b..81e316f 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/DummyFileAttributes.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/DummyFileAttributes.java
@@ -1,86 +1,86 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-package org.apache.logging.log4j.core.appender.rolling.action;
-
-import java.nio.file.attribute.BasicFileAttributes;
-import java.nio.file.attribute.FileTime;
-
-/**
- * Test helper class: file attributes.
- */
-public class DummyFileAttributes implements BasicFileAttributes {
-
- public FileTime lastModified;
- public FileTime lastAccessTime;
- public FileTime creationTime;
- public boolean isRegularFile;
- public boolean isDirectory;
- public boolean isSymbolicLink;
- public boolean isOther;
- public long size;
- public Object fileKey;
-
- public DummyFileAttributes() {
- }
-
- @Override
- public FileTime lastModifiedTime() {
- return lastModified;
- }
-
- @Override
- public FileTime lastAccessTime() {
- return lastAccessTime;
- }
-
- @Override
- public FileTime creationTime() {
- return creationTime;
- }
-
- @Override
- public boolean isRegularFile() {
- return isRegularFile;
- }
-
- @Override
- public boolean isDirectory() {
- return isDirectory;
- }
-
- @Override
- public boolean isSymbolicLink() {
- return isSymbolicLink;
- }
-
- @Override
- public boolean isOther() {
- return isOther;
- }
-
- @Override
- public long size() {
- return size;
- }
-
- @Override
- public Object fileKey() {
- return fileKey;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.core.appender.rolling.action;
+
+import java.nio.file.attribute.BasicFileAttributes;
+import java.nio.file.attribute.FileTime;
+
+/**
+ * Test helper class: file attributes.
+ */
+public class DummyFileAttributes implements BasicFileAttributes {
+
+ public FileTime lastModified;
+ public FileTime lastAccessTime;
+ public FileTime creationTime;
+ public boolean isRegularFile;
+ public boolean isDirectory;
+ public boolean isSymbolicLink;
+ public boolean isOther;
+ public long size;
+ public Object fileKey;
+
+ public DummyFileAttributes() {
+ }
+
+ @Override
+ public FileTime lastModifiedTime() {
+ return lastModified;
+ }
+
+ @Override
+ public FileTime lastAccessTime() {
+ return lastAccessTime;
+ }
+
+ @Override
+ public FileTime creationTime() {
+ return creationTime;
+ }
+
+ @Override
+ public boolean isRegularFile() {
+ return isRegularFile;
+ }
+
+ @Override
+ public boolean isDirectory() {
+ return isDirectory;
+ }
+
+ @Override
+ public boolean isSymbolicLink() {
+ return isSymbolicLink;
+ }
+
+ @Override
+ public boolean isOther() {
+ return isOther;
+ }
+
+ @Override
+ public long size() {
+ return size;
+ }
+
+ @Override
+ public Object fileKey() {
+ return fileKey;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfAllTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfAllTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfAllTest.java
index aa4884a..12d5a05 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfAllTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfAllTest.java
@@ -1,54 +1,54 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-package org.apache.logging.log4j.core.appender.rolling.action;
-
-import org.apache.logging.log4j.core.appender.rolling.action.IfAll;
-import org.apache.logging.log4j.core.appender.rolling.action.PathCondition;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Tests the And composite condition.
- */
-public class IfAllTest {
-
- @Test
- public void testAccept() {
- final PathCondition TRUE = new FixedCondition(true);
- final PathCondition FALSE = new FixedCondition(false);
- assertTrue(IfAll.createAndCondition(TRUE, TRUE).accept(null, null, null));
- assertFalse(IfAll.createAndCondition(FALSE, TRUE).accept(null, null, null));
- assertFalse(IfAll.createAndCondition(TRUE, FALSE).accept(null, null, null));
- assertFalse(IfAll.createAndCondition(FALSE, FALSE).accept(null, null, null));
- }
-
- @Test
- public void testEmptyIsFalse() {
- assertFalse(IfAll.createAndCondition().accept(null, null, null));
- }
-
- @Test
- public void testBeforeTreeWalk() {
- final CountingCondition counter = new CountingCondition(true);
- final IfAll and = IfAll.createAndCondition(counter, counter, counter);
- and.beforeFileTreeWalk();
- assertEquals(3, counter.getBeforeFileTreeWalkCount());
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.core.appender.rolling.action;
+
+import org.apache.logging.log4j.core.appender.rolling.action.IfAll;
+import org.apache.logging.log4j.core.appender.rolling.action.PathCondition;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Tests the And composite condition.
+ */
+public class IfAllTest {
+
+ @Test
+ public void testAccept() {
+ final PathCondition TRUE = new FixedCondition(true);
+ final PathCondition FALSE = new FixedCondition(false);
+ assertTrue(IfAll.createAndCondition(TRUE, TRUE).accept(null, null, null));
+ assertFalse(IfAll.createAndCondition(FALSE, TRUE).accept(null, null, null));
+ assertFalse(IfAll.createAndCondition(TRUE, FALSE).accept(null, null, null));
+ assertFalse(IfAll.createAndCondition(FALSE, FALSE).accept(null, null, null));
+ }
+
+ @Test
+ public void testEmptyIsFalse() {
+ assertFalse(IfAll.createAndCondition().accept(null, null, null));
+ }
+
+ @Test
+ public void testBeforeTreeWalk() {
+ final CountingCondition counter = new CountingCondition(true);
+ final IfAll and = IfAll.createAndCondition(counter, counter, counter);
+ and.beforeFileTreeWalk();
+ assertEquals(3, counter.getBeforeFileTreeWalkCount());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfAnyTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfAnyTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfAnyTest.java
index ba63a27..52a8b27 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfAnyTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfAnyTest.java
@@ -1,52 +1,52 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-package org.apache.logging.log4j.core.appender.rolling.action;
-
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Tests the Or composite condition.
- */
-public class IfAnyTest {
-
- @Test
- public void test() {
- final PathCondition TRUE = new FixedCondition(true);
- final PathCondition FALSE = new FixedCondition(false);
- assertTrue(IfAny.createOrCondition(TRUE, TRUE).accept(null, null, null));
- assertTrue(IfAny.createOrCondition(FALSE, TRUE).accept(null, null, null));
- assertTrue(IfAny.createOrCondition(TRUE, FALSE).accept(null, null, null));
- assertFalse(IfAny.createOrCondition(FALSE, FALSE).accept(null, null, null));
- }
-
- @Test
- public void testEmptyIsFalse() {
- assertFalse(IfAny.createOrCondition().accept(null, null, null));
- }
-
- @Test
- public void testBeforeTreeWalk() {
- final CountingCondition counter = new CountingCondition(true);
- final IfAny or = IfAny.createOrCondition(counter, counter, counter);
- or.beforeFileTreeWalk();
- assertEquals(3, counter.getBeforeFileTreeWalkCount());
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.core.appender.rolling.action;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Tests the Or composite condition.
+ */
+public class IfAnyTest {
+
+ @Test
+ public void test() {
+ final PathCondition TRUE = new FixedCondition(true);
+ final PathCondition FALSE = new FixedCondition(false);
+ assertTrue(IfAny.createOrCondition(TRUE, TRUE).accept(null, null, null));
+ assertTrue(IfAny.createOrCondition(FALSE, TRUE).accept(null, null, null));
+ assertTrue(IfAny.createOrCondition(TRUE, FALSE).accept(null, null, null));
+ assertFalse(IfAny.createOrCondition(FALSE, FALSE).accept(null, null, null));
+ }
+
+ @Test
+ public void testEmptyIsFalse() {
+ assertFalse(IfAny.createOrCondition().accept(null, null, null));
+ }
+
+ @Test
+ public void testBeforeTreeWalk() {
+ final CountingCondition counter = new CountingCondition(true);
+ final IfAny or = IfAny.createOrCondition(counter, counter, counter);
+ or.beforeFileTreeWalk();
+ assertEquals(3, counter.getBeforeFileTreeWalkCount());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfFileNameTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfFileNameTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfFileNameTest.java
index 978031e..2e84aa9 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfFileNameTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfFileNameTest.java
@@ -1,131 +1,131 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-package org.apache.logging.log4j.core.appender.rolling.action;
-
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-public class IfFileNameTest {
-
- @Test(expected = IllegalArgumentException.class)
- public void testCreateNameConditionFailsIfBothRegexAndPathAreNull() {
- IfFileName.createNameCondition(null, null);
- }
-
- @Test()
- public void testCreateNameConditionAcceptsIfEitherRegexOrPathOrBothAreNonNull() {
- IfFileName.createNameCondition("bar", null);
- IfFileName.createNameCondition(null, "foo");
- IfFileName.createNameCondition("bar", "foo");
- }
-
- @Test
- public void testGetSyntaxAndPattern() {
- assertEquals("glob:path", IfFileName.createNameCondition("path", null).getSyntaxAndPattern());
- assertEquals("glob:path", IfFileName.createNameCondition("glob:path", null).getSyntaxAndPattern());
- assertEquals("regex:bar", IfFileName.createNameCondition(null, "bar").getSyntaxAndPattern());
- assertEquals("regex:bar", IfFileName.createNameCondition(null, "regex:bar").getSyntaxAndPattern());
- }
-
- @Test
- public void testAcceptUsesPathPatternIfExists() {
- final IfFileName filter = IfFileName.createNameCondition("path", "regex");
- final Path relativePath = Paths.get("path");
- assertTrue(filter.accept(null, relativePath, null));
-
- final Path pathMatchingRegex = Paths.get("regex");
- assertFalse(filter.accept(null, pathMatchingRegex, null));
- }
-
- @Test
- public void testAcceptUsesRegexIfNoPathPatternExists() {
- final IfFileName regexFilter = IfFileName.createNameCondition(null, "regex");
- final Path pathMatchingRegex = Paths.get("regex");
- assertTrue(regexFilter.accept(null, pathMatchingRegex, null));
-
- final Path noMatch = Paths.get("nomatch");
- assertFalse(regexFilter.accept(null, noMatch, null));
- }
-
- @Test
- public void testAcceptIgnoresBasePathAndAttributes() {
- final IfFileName pathFilter = IfFileName.createNameCondition("path", null);
- final Path relativePath = Paths.get("path");
- assertTrue(pathFilter.accept(null, relativePath, null));
-
- final IfFileName regexFilter = IfFileName.createNameCondition(null, "regex");
- final Path pathMatchingRegex = Paths.get("regex");
- assertTrue(regexFilter.accept(null, pathMatchingRegex, null));
- }
-
- @Test
- public void testAcceptCallsNestedConditionsOnlyIfPathAccepted1() {
- final CountingCondition counter = new CountingCondition(true);
- final IfFileName regexFilter = IfFileName.createNameCondition(null, "regex", counter);
- final Path pathMatchingRegex = Paths.get("regex");
-
- assertTrue(regexFilter.accept(null, pathMatchingRegex, null));
- assertEquals(1, counter.getAcceptCount());
- assertTrue(regexFilter.accept(null, pathMatchingRegex, null));
- assertEquals(2, counter.getAcceptCount());
- assertTrue(regexFilter.accept(null, pathMatchingRegex, null));
- assertEquals(3, counter.getAcceptCount());
-
- final Path noMatch = Paths.get("nomatch");
- assertFalse(regexFilter.accept(null, noMatch, null));
- assertEquals(3, counter.getAcceptCount()); // no increase
- assertFalse(regexFilter.accept(null, noMatch, null));
- assertEquals(3, counter.getAcceptCount());
- assertFalse(regexFilter.accept(null, noMatch, null));
- assertEquals(3, counter.getAcceptCount());
- }
-
- @Test
- public void testAcceptCallsNestedConditionsOnlyIfPathAccepted2() {
- final CountingCondition counter = new CountingCondition(true);
- final IfFileName globFilter = IfFileName.createNameCondition("glob", null, counter);
- final Path pathMatchingGlob = Paths.get("glob");
-
- assertTrue(globFilter.accept(null, pathMatchingGlob, null));
- assertEquals(1, counter.getAcceptCount());
- assertTrue(globFilter.accept(null, pathMatchingGlob, null));
- assertEquals(2, counter.getAcceptCount());
- assertTrue(globFilter.accept(null, pathMatchingGlob, null));
- assertEquals(3, counter.getAcceptCount());
-
- final Path noMatch = Paths.get("nomatch");
- assertFalse(globFilter.accept(null, noMatch, null));
- assertEquals(3, counter.getAcceptCount()); // no increase
- assertFalse(globFilter.accept(null, noMatch, null));
- assertEquals(3, counter.getAcceptCount());
- assertFalse(globFilter.accept(null, noMatch, null));
- assertEquals(3, counter.getAcceptCount());
- }
-
- @Test
- public void testBeforeTreeWalk() {
- final CountingCondition counter = new CountingCondition(true);
- final IfFileName pathFilter = IfFileName.createNameCondition("path", null, counter, counter, counter);
- pathFilter.beforeFileTreeWalk();
- assertEquals(3, counter.getBeforeFileTreeWalkCount());
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.core.appender.rolling.action;
+
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+public class IfFileNameTest {
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testCreateNameConditionFailsIfBothRegexAndPathAreNull() {
+ IfFileName.createNameCondition(null, null);
+ }
+
+ @Test()
+ public void testCreateNameConditionAcceptsIfEitherRegexOrPathOrBothAreNonNull() {
+ IfFileName.createNameCondition("bar", null);
+ IfFileName.createNameCondition(null, "foo");
+ IfFileName.createNameCondition("bar", "foo");
+ }
+
+ @Test
+ public void testGetSyntaxAndPattern() {
+ assertEquals("glob:path", IfFileName.createNameCondition("path", null).getSyntaxAndPattern());
+ assertEquals("glob:path", IfFileName.createNameCondition("glob:path", null).getSyntaxAndPattern());
+ assertEquals("regex:bar", IfFileName.createNameCondition(null, "bar").getSyntaxAndPattern());
+ assertEquals("regex:bar", IfFileName.createNameCondition(null, "regex:bar").getSyntaxAndPattern());
+ }
+
+ @Test
+ public void testAcceptUsesPathPatternIfExists() {
+ final IfFileName filter = IfFileName.createNameCondition("path", "regex");
+ final Path relativePath = Paths.get("path");
+ assertTrue(filter.accept(null, relativePath, null));
+
+ final Path pathMatchingRegex = Paths.get("regex");
+ assertFalse(filter.accept(null, pathMatchingRegex, null));
+ }
+
+ @Test
+ public void testAcceptUsesRegexIfNoPathPatternExists() {
+ final IfFileName regexFilter = IfFileName.createNameCondition(null, "regex");
+ final Path pathMatchingRegex = Paths.get("regex");
+ assertTrue(regexFilter.accept(null, pathMatchingRegex, null));
+
+ final Path noMatch = Paths.get("nomatch");
+ assertFalse(regexFilter.accept(null, noMatch, null));
+ }
+
+ @Test
+ public void testAcceptIgnoresBasePathAndAttributes() {
+ final IfFileName pathFilter = IfFileName.createNameCondition("path", null);
+ final Path relativePath = Paths.get("path");
+ assertTrue(pathFilter.accept(null, relativePath, null));
+
+ final IfFileName regexFilter = IfFileName.createNameCondition(null, "regex");
+ final Path pathMatchingRegex = Paths.get("regex");
+ assertTrue(regexFilter.accept(null, pathMatchingRegex, null));
+ }
+
+ @Test
+ public void testAcceptCallsNestedConditionsOnlyIfPathAccepted1() {
+ final CountingCondition counter = new CountingCondition(true);
+ final IfFileName regexFilter = IfFileName.createNameCondition(null, "regex", counter);
+ final Path pathMatchingRegex = Paths.get("regex");
+
+ assertTrue(regexFilter.accept(null, pathMatchingRegex, null));
+ assertEquals(1, counter.getAcceptCount());
+ assertTrue(regexFilter.accept(null, pathMatchingRegex, null));
+ assertEquals(2, counter.getAcceptCount());
+ assertTrue(regexFilter.accept(null, pathMatchingRegex, null));
+ assertEquals(3, counter.getAcceptCount());
+
+ final Path noMatch = Paths.get("nomatch");
+ assertFalse(regexFilter.accept(null, noMatch, null));
+ assertEquals(3, counter.getAcceptCount()); // no increase
+ assertFalse(regexFilter.accept(null, noMatch, null));
+ assertEquals(3, counter.getAcceptCount());
+ assertFalse(regexFilter.accept(null, noMatch, null));
+ assertEquals(3, counter.getAcceptCount());
+ }
+
+ @Test
+ public void testAcceptCallsNestedConditionsOnlyIfPathAccepted2() {
+ final CountingCondition counter = new CountingCondition(true);
+ final IfFileName globFilter = IfFileName.createNameCondition("glob", null, counter);
+ final Path pathMatchingGlob = Paths.get("glob");
+
+ assertTrue(globFilter.accept(null, pathMatchingGlob, null));
+ assertEquals(1, counter.getAcceptCount());
+ assertTrue(globFilter.accept(null, pathMatchingGlob, null));
+ assertEquals(2, counter.getAcceptCount());
+ assertTrue(globFilter.accept(null, pathMatchingGlob, null));
+ assertEquals(3, counter.getAcceptCount());
+
+ final Path noMatch = Paths.get("nomatch");
+ assertFalse(globFilter.accept(null, noMatch, null));
+ assertEquals(3, counter.getAcceptCount()); // no increase
+ assertFalse(globFilter.accept(null, noMatch, null));
+ assertEquals(3, counter.getAcceptCount());
+ assertFalse(globFilter.accept(null, noMatch, null));
+ assertEquals(3, counter.getAcceptCount());
+ }
+
+ @Test
+ public void testBeforeTreeWalk() {
+ final CountingCondition counter = new CountingCondition(true);
+ final IfFileName pathFilter = IfFileName.createNameCondition("path", null, counter, counter, counter);
+ pathFilter.beforeFileTreeWalk();
+ assertEquals(3, counter.getBeforeFileTreeWalkCount());
+ }
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfLastModifiedTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfLastModifiedTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfLastModifiedTest.java
index 520e68d..48d2a10 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfLastModifiedTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/IfLastModifiedTest.java
@@ -75,7 +75,7 @@ public class IfLastModifiedTest {
assertEquals(2, counter.getAcceptCount());
assertTrue(filter.accept(null, null, attrs));
assertEquals(3, counter.getAcceptCount());
-
+
final long tooYoung = 33 * 1000 - 5;
attrs.lastModified = FileTime.fromMillis(System.currentTimeMillis() - tooYoung);
assertFalse(filter.accept(null, null, attrs));
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/PathSortByModificationTimeTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/PathSortByModificationTimeTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/PathSortByModificationTimeTest.java
index 15b2eae..255fec4 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/PathSortByModificationTimeTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/PathSortByModificationTimeTest.java
@@ -49,15 +49,15 @@ public class PathSortByModificationTimeTest {
final DummyFileAttributes a2 = new DummyFileAttributes();
a1.lastModified = FileTime.fromMillis(100);
a2.lastModified = FileTime.fromMillis(222);
-
+
assertEquals("same path, 2nd more recent", 1, sorter.compare(path(p1, a1), path(p1, a2)));
assertEquals("path ignored, 2nd more recent", 1, sorter.compare(path(p1, a1), path(p2, a2)));
assertEquals("path ignored, 2nd more recent", 1, sorter.compare(path(p2, a1), path(p1, a2)));
-
+
assertEquals("same path, 1st more recent", -1, sorter.compare(path(p1, a2), path(p1, a1)));
assertEquals("path ignored, 1st more recent", -1, sorter.compare(path(p1, a2), path(p2, a1)));
assertEquals("path ignored, 1st more recent", -1, sorter.compare(path(p2, a2), path(p1, a1)));
-
+
assertEquals("same path, same time", 0, sorter.compare(path(p1, a1), path(p1, a1)));
assertEquals("p2 < p1, same time", 1, sorter.compare(path(p1, a1), path(p2, a1)));
assertEquals("p2 < p1, same time", -1, sorter.compare(path(p2, a1), path(p1, a1)));
@@ -72,15 +72,15 @@ public class PathSortByModificationTimeTest {
final DummyFileAttributes a2 = new DummyFileAttributes();
a1.lastModified = FileTime.fromMillis(100);
a2.lastModified = FileTime.fromMillis(222);
-
+
assertEquals("same path, 2nd more recent", -1, sorter.compare(path(p1, a1), path(p1, a2)));
assertEquals("path ignored, 2nd more recent", -1, sorter.compare(path(p1, a1), path(p2, a2)));
assertEquals("path ignored, 2nd more recent", -1, sorter.compare(path(p2, a1), path(p1, a2)));
-
+
assertEquals("same path, 1st more recent", 1, sorter.compare(path(p1, a2), path(p1, a1)));
assertEquals("path ignored, 1st more recent", 1, sorter.compare(path(p1, a2), path(p2, a1)));
assertEquals("path ignored, 1st more recent", 1, sorter.compare(path(p2, a2), path(p1, a1)));
-
+
assertEquals("same path, same time", 0, sorter.compare(path(p1, a1), path(p1, a1)));
assertEquals("p1 < p2, same time", -1, sorter.compare(path(p1, a1), path(p2, a1)));
assertEquals("p1 < p2, same time", 1, sorter.compare(path(p2, a1), path(p1, a1)));
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/SortingVisitorTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/SortingVisitorTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/SortingVisitorTest.java
index 35cd870..dd32a0c 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/SortingVisitorTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/SortingVisitorTest.java
@@ -36,7 +36,7 @@ import static org.junit.Assert.*;
* Tests the SortingVisitor class.
*/
public class SortingVisitorTest {
-
+
private Path base;
private Path aaa;
private Path bbb;
@@ -48,14 +48,14 @@ public class SortingVisitorTest {
aaa = Files.createTempFile(base, "aaa", null, new FileAttribute<?>[0]);
bbb = Files.createTempFile(base, "bbb", null, new FileAttribute<?>[0]);
ccc = Files.createTempFile(base, "ccc", null, new FileAttribute<?>[0]);
-
+
// lastModified granularity is 1 sec(!) on some file systems...
final long now = System.currentTimeMillis();
Files.setLastModifiedTime(aaa, FileTime.fromMillis(now));
Files.setLastModifiedTime(bbb, FileTime.fromMillis(now + 1000));
Files.setLastModifiedTime(ccc, FileTime.fromMillis(now + 2000));
}
-
+
@After
public void tearDown() throws Exception {
Files.deleteIfExists(ccc);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/DefaultRouteScriptAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/DefaultRouteScriptAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/DefaultRouteScriptAppenderTest.java
index c0a66e2..b112fb7 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/DefaultRouteScriptAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/DefaultRouteScriptAppenderTest.java
@@ -45,7 +45,7 @@ public class DefaultRouteScriptAppenderTest {
@Parameterized.Parameters(name = "{0} {1}")
public static Object[][] getParameters() {
// @formatter:off
- return new Object[][] {
+ return new Object[][] {
{ "log4j-routing-default-route-script-groovy.xml", false },
{ "log4j-routing-default-route-script-javascript.xml", false },
{ "log4j-routing-script-staticvars-javascript.xml", true },
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutesScriptAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutesScriptAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutesScriptAppenderTest.java
index f9bbbd9..12b571f 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutesScriptAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutesScriptAppenderTest.java
@@ -51,7 +51,7 @@ public class RoutesScriptAppenderTest {
@Parameterized.Parameters(name = "{0} {1}")
public static Object[][] getParameters() {
// @formatter:off
- return new Object[][] {
+ return new Object[][] {
{ "log4j-routing-routes-script-groovy.xml", false },
{ "log4j-routing-routes-script-javascript.xml", false },
{ "log4j-routing-script-staticvars-javascript.xml", true },
@@ -64,7 +64,7 @@ public class RoutesScriptAppenderTest {
public final LoggerContextRule loggerContextRule;
private final boolean expectBindingEntries;
-
+
public RoutesScriptAppenderTest(final String configLocation, final boolean expectBindingEntries) {
this.loggerContextRule = new LoggerContextRule(configLocation);
this.expectBindingEntries = expectBindingEntries;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigAutoFlushTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigAutoFlushTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigAutoFlushTest.java
index d7ae4a4..d032943 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigAutoFlushTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigAutoFlushTest.java
@@ -44,7 +44,7 @@ public class AsyncLoggerConfigAutoFlushTest {
public void testFlushAtEndOfBatch() throws Exception {
final File file = new File("target", "AsyncLoggerConfigAutoFlushTest.log");
assertTrue("Deleted old file before test", !file.exists() || file.delete());
-
+
final Logger log = LogManager.getLogger("com.foo.Bar");
final String msg = "Message flushed with immediate flush=false";
log.info(msg);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigTest2.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigTest2.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigTest2.java
index 6b0dc9b..3c09ff5 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigTest2.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigTest2.java
@@ -40,7 +40,7 @@ public class AsyncLoggerConfigTest2 {
"AsyncLoggerConfigTest2.xml");
final File file = new File("target", "AsyncLoggerConfigTest2.log");
assertTrue("Deleted old file before test", !file.exists() || file.delete());
-
+
final Logger log = LogManager.getLogger("com.foo.Bar");
final String msg = "Message before reconfig";
log.info(msg);
@@ -48,7 +48,7 @@ public class AsyncLoggerConfigTest2 {
final LoggerContext ctx = LoggerContext.getContext(false);
ctx.reconfigure();
ctx.reconfigure();
-
+
final String msg2 = "Message after reconfig";
log.info(msg2);
CoreLoggerContexts.stopLoggerContext(file); // stop async thread
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigTest3.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigTest3.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigTest3.java
index 1cf88c4..301fb73 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigTest3.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigTest3.java
@@ -53,7 +53,7 @@ public class AsyncLoggerConfigTest3 {
}
final Message msg = new ParameterizedMessage("{}", map);
- final Log4jLogEvent event = Log4jLogEvent.newBuilder()
+ Log4jLogEvent event = Log4jLogEvent.newBuilder()
.setLevel(Level.WARN)
.setLoggerName(getClass().getName())
.setMessage(msg)
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigUseAfterShutdownTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigUseAfterShutdownTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigUseAfterShutdownTest.java
index a4a2513..e7dcf82 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigUseAfterShutdownTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigUseAfterShutdownTest.java
@@ -42,7 +42,7 @@ public class AsyncLoggerConfigUseAfterShutdownTest {
log.info("some message");
CoreLoggerContexts.stopLoggerContext(); // stop async thread
- // call the #logMessage() method to bypass the isEnabled check:
+ // call the #logMessage() method to bypass the isEnabled check:
// before the LOG4J2-639 fix this would throw a NPE
((AbstractLogger) log).logMessage("com.foo.Bar", Level.INFO, null, new SimpleMessage("msg"), null);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigWithAsyncEnabledTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigWithAsyncEnabledTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigWithAsyncEnabledTest.java
index 00ddcf4..454c08e 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigWithAsyncEnabledTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigWithAsyncEnabledTest.java
@@ -57,7 +57,7 @@ public class AsyncLoggerConfigWithAsyncEnabledTest {
assertTrue("Deleted old file before test", !file.exists() || file.delete());
final Logger log = LogManager.getLogger("com.foo.Bar");
- final String format = "Additive logging: {} for the price of {}!";
+ String format = "Additive logging: {} for the price of {}!";
log.info(format, 2, 1);
CoreLoggerContexts.stopLoggerContext(file); // stop async thread
@@ -67,7 +67,7 @@ public class AsyncLoggerConfigWithAsyncEnabledTest {
reader.close();
file.delete();
- final String expected = "Additive logging: {} for the price of {}! [2,1] Additive logging: 2 for the price of 1!";
+ String expected = "Additive logging: {} for the price of {}! [2,1] Additive logging: 2 for the price of 1!";
assertThat(line1, containsString(expected));
assertThat(line2, containsString(expected));
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerContextSelectorTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerContextSelectorTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerContextSelectorTest.java
index 29f21a5..fc5cb63 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerContextSelectorTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerContextSelectorTest.java
@@ -27,7 +27,7 @@ import static org.junit.Assert.*;
@Category(AsyncLoggers.class)
public class AsyncLoggerContextSelectorTest {
-
+
private static final String FQCN = AsyncLoggerContextSelectorTest.class.getName();
@Test
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerCustomSelectorLocationTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerCustomSelectorLocationTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerCustomSelectorLocationTest.java
index e5984aa..56cbfc6 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerCustomSelectorLocationTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerCustomSelectorLocationTest.java
@@ -88,12 +88,12 @@ public class AsyncLoggerCustomSelectorLocationTest {
public static final class CustomAsyncContextSelector implements ContextSelector {
private static final LoggerContext CONTEXT = new AsyncLoggerContext("AsyncDefault");
@Override
- public LoggerContext getContext(final String fqcn, final ClassLoader loader, final boolean currentContext) {
+ public LoggerContext getContext(String fqcn, ClassLoader loader, boolean currentContext) {
return CONTEXT;
}
@Override
- public LoggerContext getContext(final String fqcn, final ClassLoader loader, final boolean currentContext, final URI configLocation) {
+ public LoggerContext getContext(String fqcn, ClassLoader loader, boolean currentContext, URI configLocation) {
return CONTEXT;
}
@@ -103,7 +103,7 @@ public class AsyncLoggerCustomSelectorLocationTest {
}
@Override
- public void removeContext(final LoggerContext context) {
+ public void removeContext(LoggerContext context) {
// does not remove anything
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerLocationTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerLocationTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerLocationTest.java
index 2642d2b..5b61d8e 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerLocationTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerLocationTest.java
@@ -41,7 +41,7 @@ public class AsyncLoggerLocationTest {
public static void beforeClass() {
final File file = new File("target", "AsyncLoggerLocationTest.log");
file.delete();
-
+
System.setProperty(Constants.LOG4J_CONTEXT_SELECTOR,
AsyncLoggerContextSelector.class.getName());
System.setProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY,
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerTest.java
index 27c6678..aad8ce7 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerTest.java
@@ -55,10 +55,10 @@ public class AsyncLoggerTest {
final File file = new File("target", "AsyncLoggerTest.log");
// System.out.println(f.getAbsolutePath());
file.delete();
-
+
final AsyncLogger log = (AsyncLogger) LogManager.getLogger("com.foo.Bar");
assertTrue(log.getNanoClock() instanceof DummyNanoClock);
-
+
final String msg = "Async logger msg";
log.info(msg, new InternalError("this is not a real error"));
CoreLoggerContexts.stopLoggerContext(false, file); // stop async thread
[02/13] logging-log4j2 git commit: Revert "Use final. Remove trailing
spaces."
Posted by gg...@apache.org.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MessagePatternConverterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MessagePatternConverterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MessagePatternConverterTest.java
index 577d26a..cd85071 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MessagePatternConverterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MessagePatternConverterTest.java
@@ -149,13 +149,13 @@ public class MessagePatternConverterTest {
@Test
public void testMapMessageFormatJson() throws Exception {
final MessagePatternConverter converter = MessagePatternConverter.newInstance(null, new String[]{"json"});
- final Message msg = new StringMapMessage()
+ Message msg = new StringMapMessage()
.with("key", "val");
- final LogEvent event = Log4jLogEvent.newBuilder() //
+ LogEvent event = Log4jLogEvent.newBuilder() //
.setLoggerName("MyLogger") //
.setLevel(Level.DEBUG) //
.setMessage(msg).build();
- final StringBuilder sb = new StringBuilder();
+ StringBuilder sb = new StringBuilder();
converter.format(event, sb);
assertEquals("Unexpected result", "{\"key\":\"val\"}", sb.toString());
}
@@ -163,13 +163,13 @@ public class MessagePatternConverterTest {
@Test
public void testMapMessageFormatXml() throws Exception {
final MessagePatternConverter converter = MessagePatternConverter.newInstance(null, new String[]{"xml"});
- final Message msg = new StringMapMessage()
+ Message msg = new StringMapMessage()
.with("key", "val");
- final LogEvent event = Log4jLogEvent.newBuilder() //
+ LogEvent event = Log4jLogEvent.newBuilder() //
.setLoggerName("MyLogger") //
.setLevel(Level.DEBUG) //
.setMessage(msg).build();
- final StringBuilder sb = new StringBuilder();
+ StringBuilder sb = new StringBuilder();
converter.format(event, sb);
assertEquals("Unexpected result", "<Map>\n <Entry key=\"key\">val</Entry>\n</Map>", sb.toString());
}
@@ -177,13 +177,13 @@ public class MessagePatternConverterTest {
@Test
public void testMapMessageFormatDefault() throws Exception {
final MessagePatternConverter converter = MessagePatternConverter.newInstance(null, null);
- final Message msg = new StringMapMessage()
+ Message msg = new StringMapMessage()
.with("key", "val");
- final LogEvent event = Log4jLogEvent.newBuilder() //
+ LogEvent event = Log4jLogEvent.newBuilder() //
.setLoggerName("MyLogger") //
.setLevel(Level.DEBUG) //
.setMessage(msg).build();
- final StringBuilder sb = new StringBuilder();
+ StringBuilder sb = new StringBuilder();
converter.format(event, sb);
assertEquals("Unexpected result", "key=\"val\"", sb.toString());
}
@@ -191,13 +191,13 @@ public class MessagePatternConverterTest {
@Test
public void testStructuredDataFormatFull() throws Exception {
final MessagePatternConverter converter = MessagePatternConverter.newInstance(null, new String[]{"FULL"});
- final Message msg = new StructuredDataMessage("id", "message", "type")
+ Message msg = new StructuredDataMessage("id", "message", "type")
.with("key", "val");
- final LogEvent event = Log4jLogEvent.newBuilder() //
+ LogEvent event = Log4jLogEvent.newBuilder() //
.setLoggerName("MyLogger") //
.setLevel(Level.DEBUG) //
.setMessage(msg).build();
- final StringBuilder sb = new StringBuilder();
+ StringBuilder sb = new StringBuilder();
converter.format(event, sb);
assertEquals("Unexpected result", "type [id key=\"val\"] message", sb.toString());
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/NdcPatternConverterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/NdcPatternConverterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/NdcPatternConverterTest.java
index 4088a17..92557ec 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/NdcPatternConverterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/NdcPatternConverterTest.java
@@ -31,7 +31,7 @@ import org.junit.Test;
public class NdcPatternConverterTest {
@Rule
- public final ThreadContextStackRule threadContextRule = new ThreadContextStackRule();
+ public final ThreadContextStackRule threadContextRule = new ThreadContextStackRule();
@Test
public void testEmpty() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/NoConsoleNoAnsiTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/NoConsoleNoAnsiTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/NoConsoleNoAnsiTest.java
index ee29c6f..cc9ac03 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/NoConsoleNoAnsiTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/NoConsoleNoAnsiTest.java
@@ -57,5 +57,5 @@ public class NoConsoleNoAnsiTest {
assertEquals("Incorrect number of messages. Should be 1 is " + msgs.size(), 1, msgs.size());
assertTrue("Replacement failed - expected ending " + EXPECTED + ", actual " + msgs.get(0), msgs.get(0).endsWith(EXPECTED));
}
-
+
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/PatternParserTest2.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/PatternParserTest2.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/PatternParserTest2.java
index 22f9c28..45c0a8b 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/PatternParserTest2.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/PatternParserTest2.java
@@ -74,7 +74,7 @@ public class PatternParserTest2 {
/**
* Format file name.
- *
+ *
* @param buf string buffer to which formatted file name is appended, may not be null.
* @param objects objects to be evaluated in formatting, may not be null.
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/RegexReplacementTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/RegexReplacementTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/RegexReplacementTest.java
index 16b08d9..f357111 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/RegexReplacementTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/RegexReplacementTest.java
@@ -46,7 +46,7 @@ public class RegexReplacementTest {
public static LoggerContextRule context = new LoggerContextRule(CONFIG);
@Rule
- public final ThreadContextMapRule threadContextRule = new ThreadContextMapRule();
+ public final ThreadContextMapRule threadContextRule = new ThreadContextMapRule();
@Before
public void setUp() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/time/MutableInstantTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/time/MutableInstantTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/time/MutableInstantTest.java
index 6bebbd1..63d3138 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/time/MutableInstantTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/time/MutableInstantTest.java
@@ -26,7 +26,7 @@ public class MutableInstantTest {
@Test
public void testGetEpochSecond() {
- final MutableInstant instant = new MutableInstant();
+ MutableInstant instant = new MutableInstant();
assertEquals("initial", 0, instant.getEpochSecond());
instant.initFromEpochSecond(123, 456);
@@ -35,7 +35,7 @@ public class MutableInstantTest {
instant.initFromEpochMilli(123456, 789012);
assertEquals("returns converted value when initialized from milllis", 123, instant.getEpochSecond());
- final MutableInstant other = new MutableInstant();
+ MutableInstant other = new MutableInstant();
other.initFromEpochSecond(788, 456);
instant.initFrom(other);
@@ -44,7 +44,7 @@ public class MutableInstantTest {
@Test
public void testGetNanoOfSecond() {
- final MutableInstant instant = new MutableInstant();
+ MutableInstant instant = new MutableInstant();
assertEquals("initial", 0, instant.getNanoOfSecond());
instant.initFromEpochSecond(123, 456);
@@ -53,7 +53,7 @@ public class MutableInstantTest {
instant.initFromEpochMilli(123456, 789012);
assertEquals("returns converted value when initialized from milllis", 456789012, instant.getNanoOfSecond());
- final MutableInstant other = new MutableInstant();
+ MutableInstant other = new MutableInstant();
other.initFromEpochSecond(788, 456);
instant.initFrom(other);
@@ -62,7 +62,7 @@ public class MutableInstantTest {
@Test
public void testGetEpochMillisecond() {
- final MutableInstant instant = new MutableInstant();
+ MutableInstant instant = new MutableInstant();
assertEquals("initial", 0, instant.getEpochMillisecond());
instant.initFromEpochMilli(123, 456);
@@ -71,7 +71,7 @@ public class MutableInstantTest {
instant.initFromEpochSecond(123, 456789012);
assertEquals("returns converted value when initialized from seconds", 123456, instant.getEpochMillisecond());
- final MutableInstant other = new MutableInstant();
+ MutableInstant other = new MutableInstant();
other.initFromEpochMilli(788, 456);
instant.initFrom(other);
@@ -80,7 +80,7 @@ public class MutableInstantTest {
@Test
public void getGetNanoOfMillisecond() {
- final MutableInstant instant = new MutableInstant();
+ MutableInstant instant = new MutableInstant();
assertEquals("initial", 0, instant.getNanoOfMillisecond());
instant.initFromEpochMilli(123, 456);
@@ -89,7 +89,7 @@ public class MutableInstantTest {
instant.initFromEpochSecond(123, 456789012);
assertEquals("returns converted value when initialized from milllis", 789012, instant.getNanoOfMillisecond());
- final MutableInstant other = new MutableInstant();
+ MutableInstant other = new MutableInstant();
other.initFromEpochMilli(788, 456);
instant.initFrom(other);
@@ -103,12 +103,12 @@ public class MutableInstantTest {
@Test
public void testInitFromInstantCopiesValues() {
- final MutableInstant other = new MutableInstant();
+ MutableInstant other = new MutableInstant();
other.initFromEpochSecond(788, 456);
assertEquals("epochSec", 788, other.getEpochSecond());
assertEquals("NanosOfSec", 456, other.getNanoOfSecond());
- final MutableInstant instant = new MutableInstant();
+ MutableInstant instant = new MutableInstant();
instant.initFrom(other);
assertEquals("epochSec", 788, instant.getEpochSecond());
@@ -117,7 +117,7 @@ public class MutableInstantTest {
@Test
public void testInitFromEpochMillis() {
- final MutableInstant instant = new MutableInstant();
+ MutableInstant instant = new MutableInstant();
instant.initFromEpochMilli(123456, 789012);
assertEquals("epochSec", 123, instant.getEpochSecond());
assertEquals("NanoOfSec", 456789012, instant.getNanoOfSecond());
@@ -127,26 +127,26 @@ public class MutableInstantTest {
@Test(expected = IllegalArgumentException.class)
public void testInitFromEpochMillisRejectsNegativeNanoOfMilli() {
- final MutableInstant instant = new MutableInstant();
+ MutableInstant instant = new MutableInstant();
instant.initFromEpochMilli(123456, -1);
}
@Test(expected = IllegalArgumentException.class)
public void testInitFromEpochMillisRejectsTooLargeNanoOfMilli() {
- final MutableInstant instant = new MutableInstant();
+ MutableInstant instant = new MutableInstant();
instant.initFromEpochMilli(123456, 1000_000);
}
@Test
public void testInitFromEpochMillisAcceptsTooMaxNanoOfMilli() {
- final MutableInstant instant = new MutableInstant();
+ MutableInstant instant = new MutableInstant();
instant.initFromEpochMilli(123456, 999_999);
assertEquals("NanoOfMilli", 999_999, instant.getNanoOfMillisecond());
}
@Test
public void testInitFromEpochSecond() {
- final MutableInstant instant = new MutableInstant();
+ MutableInstant instant = new MutableInstant();
instant.initFromEpochSecond(123, 456789012);
assertEquals("epochSec", 123, instant.getEpochSecond());
assertEquals("NanoOfSec", 456789012, instant.getNanoOfSecond());
@@ -156,26 +156,26 @@ public class MutableInstantTest {
@Test(expected = IllegalArgumentException.class)
public void testInitFromEpochSecondRejectsNegativeNanoOfMilli() {
- final MutableInstant instant = new MutableInstant();
+ MutableInstant instant = new MutableInstant();
instant.initFromEpochSecond(123456, -1);
}
@Test(expected = IllegalArgumentException.class)
public void testInitFromEpochSecondRejectsTooLargeNanoOfMilli() {
- final MutableInstant instant = new MutableInstant();
+ MutableInstant instant = new MutableInstant();
instant.initFromEpochSecond(123456, 1000_000_000);
}
@Test
public void testInitFromEpochSecondAcceptsTooMaxNanoOfMilli() {
- final MutableInstant instant = new MutableInstant();
+ MutableInstant instant = new MutableInstant();
instant.initFromEpochSecond(123456, 999_999_999);
assertEquals("NanoOfSec", 999_999_999, instant.getNanoOfSecond());
}
@Test
public void testInstantToMillisAndNanos() {
- final long[] values = new long[2];
+ long[] values = new long[2];
MutableInstant.instantToMillisAndNanos(123456, 999_999_999, values);
assertEquals(123456_999, values[0]);
assertEquals(999_999, values[1]);
@@ -183,9 +183,9 @@ public class MutableInstantTest {
@Test
public void testInitFromClock() {
- final MutableInstant instant = new MutableInstant();
+ MutableInstant instant = new MutableInstant();
- final PreciseClock clock = new FixedPreciseClock(123456, 789012);
+ PreciseClock clock = new FixedPreciseClock(123456, 789012);
instant.initFrom(clock);
assertEquals(123456, instant.getEpochMillisecond());
@@ -196,10 +196,10 @@ public class MutableInstantTest {
@Test
public void testEquals() {
- final MutableInstant instant = new MutableInstant();
+ MutableInstant instant = new MutableInstant();
instant.initFromEpochSecond(123, 456789012);
- final MutableInstant instant2 = new MutableInstant();
+ MutableInstant instant2 = new MutableInstant();
instant2.initFromEpochMilli(123456, 789012);
assertEquals(instant, instant2);
@@ -207,10 +207,10 @@ public class MutableInstantTest {
@Test
public void testHashCode() {
- final MutableInstant instant = new MutableInstant();
+ MutableInstant instant = new MutableInstant();
instant.initFromEpochSecond(123, 456789012);
- final MutableInstant instant2 = new MutableInstant();
+ MutableInstant instant2 = new MutableInstant();
instant2.initFromEpochMilli(123456, 789012);
assertEquals(instant.hashCode(), instant2.hashCode());
@@ -222,7 +222,7 @@ public class MutableInstantTest {
@Test
public void testToString() {
- final MutableInstant instant = new MutableInstant();
+ MutableInstant instant = new MutableInstant();
instant.initFromEpochSecond(123, 456789012);
assertEquals("MutableInstant[epochSecond=123, nano=456789012]", instant.toString());
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/tools/GenerateCustomLoggerTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/tools/GenerateCustomLoggerTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/tools/GenerateCustomLoggerTest.java
index 15f43d0..0642253 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/tools/GenerateCustomLoggerTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/tools/GenerateCustomLoggerTest.java
@@ -47,7 +47,7 @@ import org.junit.Test;
import static org.junit.Assert.*;
public class GenerateCustomLoggerTest {
-
+
@BeforeClass
public static void beforeClass() {
System.setProperty("log4j2.loggerContextFactory", "org.apache.logging.log4j.TestLoggerContextFactory");
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/tools/GenerateExtendedLoggerTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/tools/GenerateExtendedLoggerTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/tools/GenerateExtendedLoggerTest.java
index b97ef91..914ada8 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/tools/GenerateExtendedLoggerTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/tools/GenerateExtendedLoggerTest.java
@@ -49,7 +49,7 @@ import org.junit.Test;
import static org.junit.Assert.*;
public class GenerateExtendedLoggerTest {
-
+
@BeforeClass
public static void beforeClass() {
System.setProperty("log4j2.loggerContextFactory", "org.apache.logging.log4j.TestLoggerContextFactory");
@@ -142,7 +142,7 @@ public class GenerateExtendedLoggerTest {
final Method method = cls.getDeclaredMethod(name, String.class);
method.invoke(extendedLogger, "This is message " + n++);
}
-
+
// This logger extends o.a.l.log4j.spi.ExtendedLogger,
// so all the standard logging methods can be used as well
final ExtendedLogger logger = (ExtendedLogger) extendedLogger;
@@ -158,7 +158,7 @@ public class GenerateExtendedLoggerTest {
for (int i = 0; i < lines.size() - 6; i++) {
assertEquals(" " + levels.get(i).name + " This is message " + i, lines.get(i));
}
-
+
// test that the standard logging methods still work
int i = lines.size() - 6;
assertEquals(" TRACE trace message", lines.get(i++));
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FastDateParserSDFTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FastDateParserSDFTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FastDateParserSDFTest.java
index 55102a2..247dad8 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FastDateParserSDFTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FastDateParserSDFTest.java
@@ -36,8 +36,8 @@ import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
/**
- * Compare FastDateParser with SimpleDateFormat
- *
+ * Compare FastDateParser with SimpleDateFormat
+ *
* Copied from Apache Commons Lang 3 on 2016-11-16.
*/
@RunWith(Parameterized.class)
@@ -186,9 +186,9 @@ public class FastDateParserSDFTest {
fdfE = e.getClass();
}
if (valid) {
- assertEquals(locale.toString()+" "+formattedDate +"\n",expectedTime, actualTime);
+ assertEquals(locale.toString()+" "+formattedDate +"\n",expectedTime, actualTime);
} else {
- assertEquals(locale.toString()+" "+formattedDate + " expected same Exception ", sdfE, fdfE);
+ assertEquals(locale.toString()+" "+formattedDate + " expected same Exception ", sdfE, fdfE);
}
}
private void checkParsePosition(final String formattedDate) {
@@ -205,12 +205,12 @@ public class FastDateParserSDFTest {
final int length = formattedDate.length();
if (endIndex != length) {
// Error in test data
- throw new RuntimeException("Test data error: expected SDF parse to consume entire string; endindex " + endIndex + " != " + length);
+ throw new RuntimeException("Test data error: expected SDF parse to consume entire string; endindex " + endIndex + " != " + length);
}
} else {
final int errorIndex = sdfP.getErrorIndex();
if (errorIndex == -1) {
- throw new RuntimeException("Test data error: expected SDF parse to fail, but got " + expectedTime);
+ throw new RuntimeException("Test data error: expected SDF parse to fail, but got " + expectedTime);
}
}
@@ -227,6 +227,6 @@ public class FastDateParserSDFTest {
assertNotEquals("Test data error: expected FDF parse to fail, but got " + actualTime, -1, fdferrorIndex);
assertTrue("FDF error index ("+ fdferrorIndex + ") should approxiamate SDF index (" + sdferrorIndex + ")",
sdferrorIndex - fdferrorIndex <= 4);
- }
+ }
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FastDateParserTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FastDateParserTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FastDateParserTest.java
index 00588df..546780b 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FastDateParserTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FastDateParserTest.java
@@ -39,7 +39,7 @@ import org.junit.Test;
/**
* Unit tests {@link org.apache.commons.lang3.time.FastDateParser}.
- *
+ *
* Copied from Apache Commons Lang 3 on 2016-11-16.
*/
public class FastDateParserTest {
@@ -343,7 +343,7 @@ public class FastDateParserTest {
}
}
}
-
+
@Test
public void testJpLocales() {
@@ -421,7 +421,7 @@ public class FastDateParserTest {
testSdfAndFdp("''yyyyMMdd'A''B'HHmmssSSS''", "'20030210A'B153320989'", false); // OK
testSdfAndFdp("''''yyyyMMdd'A''B'HHmmssSSS''", "''20030210A'B153320989'", false); // OK
testSdfAndFdp("'$\\Ed'" ,"$\\Ed", false); // OK
-
+
// quoted charaters are case sensitive
testSdfAndFdp("'QED'", "QED", false);
testSdfAndFdp("'QED'", "qed", true);
@@ -429,7 +429,7 @@ public class FastDateParserTest {
testSdfAndFdp("yyyy-MM-dd 'QED'", "2003-02-10 QED", false);
testSdfAndFdp("yyyy-MM-dd 'QED'", "2003-02-10 qed", true);
}
-
+
@Test
public void testLANG_832() throws Exception {
testSdfAndFdp("'d'd" ,"d3", false); // OK
@@ -593,19 +593,19 @@ public class FastDateParserTest {
final DateParser parser= getInstance(yMdHmsSZ, REYKJAVIK);
assertEquals(REYKJAVIK, parser.getTimeZone());
}
-
+
@Test
public void testLang996() throws ParseException {
final Calendar expected = Calendar.getInstance(NEW_YORK, Locale.US);
expected.clear();
expected.set(2014, Calendar.MAY, 14);
- final DateParser fdp = getInstance("ddMMMyyyy", NEW_YORK, Locale.US);
+ final DateParser fdp = getInstance("ddMMMyyyy", NEW_YORK, Locale.US);
assertEquals(expected.getTime(), fdp.parse("14may2014"));
assertEquals(expected.getTime(), fdp.parse("14MAY2014"));
assertEquals(expected.getTime(), fdp.parse("14May2014"));
}
-
+
@Test(expected = IllegalArgumentException.class)
public void test1806Argument() {
getInstance("XXXX");
@@ -624,8 +624,8 @@ public class FastDateParserTest {
}
private static enum Expected1806 {
- India(INDIA, "+05", "+0530", "+05:30", true),
- Greenwich(GMT, "Z", "Z", "Z", false),
+ India(INDIA, "+05", "+0530", "+05:30", true),
+ Greenwich(GMT, "Z", "Z", "Z", false),
NewYork(NEW_YORK, "-05", "-0500", "-05:00", false);
private Expected1806(final TimeZone zone, final String one, final String two, final String three, final boolean hasHalfHourOffset) {
@@ -642,17 +642,17 @@ public class FastDateParserTest {
final String three;
final long offset;
}
-
+
@Test
public void test1806() throws ParseException {
final String formatStub = "yyyy-MM-dd'T'HH:mm:ss.SSS";
final String dateStub = "2001-02-04T12:08:56.235";
-
+
for (final Expected1806 trial : Expected1806.values()) {
final Calendar cal = initializeCalendar(trial.zone);
final String message = trial.zone.getDisplayName()+";";
-
+
DateParser parser = getInstance(formatStub+"X", trial.zone);
assertEquals(message+trial.one, cal.getTime().getTime(), parser.parse(dateStub+trial.one).getTime()-trial.offset);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FastDateParser_MoreOrLessTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FastDateParser_MoreOrLessTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FastDateParser_MoreOrLessTest.java
index e95631a..0caa8be 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FastDateParser_MoreOrLessTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FastDateParser_MoreOrLessTest.java
@@ -31,15 +31,15 @@ import org.junit.Test;
public class FastDateParser_MoreOrLessTest {
private static final TimeZone NEW_YORK = TimeZone.getTimeZone("America/New_York");
-
+
@Test
public void testInputHasPrecedingCharacters() {
final FastDateParser parser = new FastDateParser("MM/dd", TimeZone.getDefault(), Locale.getDefault());
final ParsePosition parsePosition = new ParsePosition(0);
final Date date = parser.parse("A 3/23/61", parsePosition);
Assert.assertNull(date);
- Assert.assertEquals(0, parsePosition.getIndex());
- Assert.assertEquals(0, parsePosition.getErrorIndex());
+ Assert.assertEquals(0, parsePosition.getIndex());
+ Assert.assertEquals(0, parsePosition.getErrorIndex());
}
@Test
@@ -54,7 +54,7 @@ public class FastDateParser_MoreOrLessTest {
calendar.setTime(date);
Assert.assertEquals(1961, calendar.get(Calendar.YEAR));
Assert.assertEquals(2, calendar.get(Calendar.MONTH));
- Assert.assertEquals(23, calendar.get(Calendar.DATE));
+ Assert.assertEquals(23, calendar.get(Calendar.DATE));
}
@Test
@@ -67,9 +67,9 @@ public class FastDateParser_MoreOrLessTest {
final Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
Assert.assertEquals(2, calendar.get(Calendar.MONTH));
- Assert.assertEquals(23, calendar.get(Calendar.DATE));
+ Assert.assertEquals(23, calendar.get(Calendar.DATE));
}
-
+
@Test
public void testInputHasWrongCharacters() {
final FastDateParser parser = new FastDateParser("MM-dd-yyy", TimeZone.getDefault(), Locale.getDefault());
@@ -77,7 +77,7 @@ public class FastDateParser_MoreOrLessTest {
Assert.assertNull(parser.parse("03/23/1961", parsePosition));
Assert.assertEquals(2, parsePosition.getErrorIndex());
}
-
+
@Test
public void testInputHasLessCharacters() {
final FastDateParser parser = new FastDateParser("MM/dd/yyy", TimeZone.getDefault(), Locale.getDefault());
@@ -85,21 +85,21 @@ public class FastDateParser_MoreOrLessTest {
Assert.assertNull(parser.parse("03/23", parsePosition));
Assert.assertEquals(5, parsePosition.getErrorIndex());
}
-
+
@Test
public void testInputHasWrongTimeZone() {
final FastDateParser parser = new FastDateParser("mm:ss z", NEW_YORK, Locale.US);
-
+
final String input = "11:23 Pacific Standard Time";
final ParsePosition parsePosition = new ParsePosition(0);
Assert.assertNotNull(parser.parse(input, parsePosition));
Assert.assertEquals(input.length(), parsePosition.getIndex());
-
+
parsePosition.setIndex(0);
Assert.assertNull(parser.parse( "11:23 Pacific Standard ", parsePosition));
Assert.assertEquals(6, parsePosition.getErrorIndex());
}
-
+
@Test
public void testInputHasWrongDay() {
final FastDateParser parser = new FastDateParser("EEEE, MM/dd/yyy", NEW_YORK, Locale.US);
@@ -107,7 +107,7 @@ public class FastDateParser_MoreOrLessTest {
final ParsePosition parsePosition = new ParsePosition(0);
Assert.assertNotNull(parser.parse(input, parsePosition));
Assert.assertEquals(input.length(), parsePosition.getIndex());
-
+
parsePosition.setIndex(0);
Assert.assertNull(parser.parse( "Thorsday, 03/23/61", parsePosition));
Assert.assertEquals(0, parsePosition.getErrorIndex());
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/junit/CleanFiles.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/junit/CleanFiles.java b/log4j-core/src/test/java/org/apache/logging/log4j/junit/CleanFiles.java
index 36d4b63..65458ba 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/junit/CleanFiles.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/junit/CleanFiles.java
@@ -26,7 +26,7 @@ import java.nio.file.Path;
* <p>
* For example:
* </p>
- *
+ *
* <pre>
* @Rule
* public CleanFiles files = new CleanFiles("path/to/file.txt");
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextRule.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextRule.java b/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextRule.java
index 09ce947..2d591d3 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextRule.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextRule.java
@@ -48,7 +48,7 @@ public class LoggerContextRule implements TestRule, LoggerContextAccessor {
public static LoggerContextRule createShutdownTimeoutLoggerContextRule(final String config) {
return new LoggerContextRule(config, 10, TimeUnit.SECONDS);
}
-
+
private static final String SYS_PROP_KEY_CLASS_NAME = "org.apache.logging.log4j.junit.LoggerContextRule#ClassName";
private static final String SYS_PROP_KEY_DISPLAY_NAME = "org.apache.logging.log4j.junit.LoggerContextRule#DisplayName";
private final String configLocation;
@@ -278,7 +278,7 @@ public class LoggerContextRule implements TestRule, LoggerContextAccessor {
public void reconfigure() {
loggerContext.reconfigure();
}
-
+
@Override
public String toString() {
final StringBuilder builder = new StringBuilder();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/message/MutableLogEventWithReusableParamMsgTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/message/MutableLogEventWithReusableParamMsgTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/message/MutableLogEventWithReusableParamMsgTest.java
index 2d3688d..1371ed2 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/message/MutableLogEventWithReusableParamMsgTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/message/MutableLogEventWithReusableParamMsgTest.java
@@ -53,8 +53,8 @@ public class MutableLogEventWithReusableParamMsgTest {
evt.setMessage(msg);
evt.clear();
- final Message mementoMessage = evt.memento();
- final Message mementoMessageSecondInvocation = evt.memento();
+ Message mementoMessage = evt.memento();
+ Message mementoMessageSecondInvocation = evt.memento();
// MutableLogEvent.memento should be cached
assertThat(mementoMessage, sameInstance(mementoMessageSecondInvocation));
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/test/RuleChainFactory.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/test/RuleChainFactory.java b/log4j-core/src/test/java/org/apache/logging/log4j/test/RuleChainFactory.java
index 6c3c435..30629b2 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/test/RuleChainFactory.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/test/RuleChainFactory.java
@@ -27,7 +27,7 @@ public class RuleChainFactory {
/**
* Creates a {@link RuleChain} where the rules are evaluated in the order you pass in.
- *
+ *
* @param testRules
* test rules to evaluate
* @return a new rule chain.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java
----------------------------------------------------------------------
diff --git a/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java b/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java
index 79afa21..d4c5219 100644
--- a/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java
+++ b/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java
@@ -75,7 +75,7 @@ public final class FlumeAppender extends AbstractAppender implements FlumeEventF
private FlumeAppender(final String name, final Filter filter, final Layout<? extends Serializable> layout,
final boolean ignoreExceptions, final String includes, final String excludes, final String required,
final String mdcPrefix, final String eventPrefix, final boolean compress, final FlumeEventFactory factory,
- final AbstractFlumeManager manager, final Property[] properties) {
+ final AbstractFlumeManager manager, Property[] properties) {
super(name, filter, layout, ignoreExceptions, properties);
this.manager = manager;
this.mdcIncludes = includes;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEventFactory.java
----------------------------------------------------------------------
diff --git a/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEventFactory.java b/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEventFactory.java
index 7a79f35..a95fd6b 100644
--- a/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEventFactory.java
+++ b/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEventFactory.java
@@ -22,7 +22,7 @@ import org.apache.logging.log4j.core.LogEvent;
* Factory to create Flume events.
*/
public interface FlumeEventFactory {
-
+
/**
* Creates a Flume event.
* @param event The Log4j LogEvent.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumePersistentAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumePersistentAppenderTest.java b/log4j-flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumePersistentAppenderTest.java
index 30ae580..d559904 100644
--- a/log4j-flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumePersistentAppenderTest.java
+++ b/log4j-flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumePersistentAppenderTest.java
@@ -278,7 +278,7 @@ public class FlumePersistentAppenderTest {
fields[i]);
}
}
-
+
@Test
public void testRFC5424Layout() throws IOException {
@@ -346,13 +346,12 @@ public class FlumePersistentAppenderTest {
}
}
}
-
+
@Test
public void testLogInterrupted() {
final ExecutorService executor = Executors.newSingleThreadExecutor();
executor.execute(new Runnable() {
- @Override
- public void run() {
+ public void run() {
executor.shutdownNow();
final Logger logger = LogManager.getLogger("EventLogger");
final Marker marker = MarkerManager.getMarker("EVENT");
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/ByteStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/ByteStreamLogger.java b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/ByteStreamLogger.java
index e53e038..114f35a 100644
--- a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/ByteStreamLogger.java
+++ b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/ByteStreamLogger.java
@@ -28,7 +28,7 @@ import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.spi.ExtendedLogger;
/**
- *
+ *
* @since 2.1
*/
public class ByteStreamLogger {
@@ -114,7 +114,7 @@ public class ByteStreamLogger {
this.logger.logIfEnabled(fqcn, this.level, this.marker, this.msg.toString());
this.msg.setLength(0);
}
-
+
private void logEnd(final String fqcn) {
if (this.msg.length() > 0) {
log(fqcn);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/CharStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/CharStreamLogger.java b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/CharStreamLogger.java
index a904480..8bd5d24 100644
--- a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/CharStreamLogger.java
+++ b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/CharStreamLogger.java
@@ -24,7 +24,7 @@ import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.spi.ExtendedLogger;
/**
- *
+ *
* @since 2.1
*/
public class CharStreamLogger {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerBufferedInputStream.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerBufferedInputStream.java b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerBufferedInputStream.java
index f7a7e55..54d9796 100644
--- a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerBufferedInputStream.java
+++ b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerBufferedInputStream.java
@@ -27,7 +27,7 @@ import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.spi.ExtendedLogger;
/**
- *
+ *
* @since 2.1
*/
public class LoggerBufferedInputStream extends BufferedInputStream {
@@ -48,17 +48,17 @@ public class LoggerBufferedInputStream extends BufferedInputStream {
public void close() throws IOException {
super.close();
}
-
+
@Override
public synchronized int read() throws IOException {
return super.read();
}
-
+
@Override
public int read(final byte[] b) throws IOException {
return super.read(b, 0, b.length);
}
-
+
@Override
public synchronized int read(final byte[] b, final int off, final int len) throws IOException {
return super.read(b, off, len);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerBufferedReader.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerBufferedReader.java b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerBufferedReader.java
index e63f612..584e61a 100644
--- a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerBufferedReader.java
+++ b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerBufferedReader.java
@@ -27,7 +27,7 @@ import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.spi.ExtendedLogger;
/**
- *
+ *
* @since 2.1
*/
public class LoggerBufferedReader extends BufferedReader {
@@ -42,27 +42,27 @@ public class LoggerBufferedReader extends BufferedReader {
final Level level, final Marker marker) {
super(new LoggerReader(reader, logger, fqcn == null ? FQCN : fqcn, level, marker), size);
}
-
+
@Override
public void close() throws IOException {
super.close();
}
-
+
@Override
public int read() throws IOException {
return super.read();
}
-
+
@Override
public int read(final char[] cbuf) throws IOException {
return super.read(cbuf, 0, cbuf.length);
}
-
+
@Override
public int read(final char[] cbuf, final int off, final int len) throws IOException {
return super.read(cbuf, off, len);
}
-
+
@Override
public int read(final CharBuffer target) throws IOException {
final int len = target.remaining();
@@ -73,7 +73,7 @@ public class LoggerBufferedReader extends BufferedReader {
}
return charsRead;
}
-
+
@Override
public String readLine() throws IOException {
return super.readLine();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerFilterOutputStream.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerFilterOutputStream.java b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerFilterOutputStream.java
index d3d476b..b608502 100644
--- a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerFilterOutputStream.java
+++ b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerFilterOutputStream.java
@@ -31,7 +31,7 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
* that follows the {@link java.io.OutputStream} methods in spirit, but doesn't require output to any external stream.
* This class should <em>not</em> be used as a stream for an underlying logger unless it's being used as a bridge.
* Otherwise, infinite loops may occur!
- *
+ *
* @since 2.1
*/
public class LoggerFilterOutputStream extends FilterOutputStream {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerFilterWriter.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerFilterWriter.java b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerFilterWriter.java
index d2da1ce..4b0991f 100644
--- a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerFilterWriter.java
+++ b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerFilterWriter.java
@@ -28,7 +28,7 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
/**
* Logs each line written to a pre-defined level. Can also be configured with a Marker. This class provides an interface
* that follows the {@link java.io.Writer} methods in spirit, but doesn't require output to any external out.
- *
+ *
* @since 2.1
*/
public class LoggerFilterWriter extends FilterWriter {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerInputStream.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerInputStream.java b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerInputStream.java
index ee77251..5366f19 100644
--- a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerInputStream.java
+++ b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerInputStream.java
@@ -28,7 +28,7 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
/**
* Logs each line read to a pre-defined level. Can also be configured with a Marker.
- *
+ *
* @since 2.1
*/
public class LoggerInputStream extends FilterInputStream {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerOutputStream.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerOutputStream.java b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerOutputStream.java
index 1267966..b8ea392 100644
--- a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerOutputStream.java
+++ b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerOutputStream.java
@@ -30,7 +30,7 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
* that follows the {@link java.io.OutputStream} methods in spirit, but doesn't require output to any external stream.
* This class should <em>not</em> be used as a stream for an underlying logger unless it's being used as a bridge.
* Otherwise, infinite loops may occur!
- *
+ *
* @since 2.1
*/
public class LoggerOutputStream extends OutputStream {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerPrintStream.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerPrintStream.java b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerPrintStream.java
index 5aa1e82..30bac34 100644
--- a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerPrintStream.java
+++ b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerPrintStream.java
@@ -33,7 +33,7 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
* that follows the {@link java.io.PrintStream} methods in spirit, but doesn't require output to any external stream.
* This class should <em>not</em> be used as a stream for an underlying logger unless it's being used as a bridge.
* Otherwise, infinite loops may occur!
- *
+ *
* @since 2.1
*/
public class LoggerPrintStream extends PrintStream {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerReader.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerReader.java b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerReader.java
index 6fb9579..265e8e7 100644
--- a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerReader.java
+++ b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerReader.java
@@ -28,7 +28,7 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
/**
* Logs each line read to a pre-defined level. Can also be configured with a Marker.
- *
+ *
* @since 2.1
*/
public class LoggerReader extends FilterReader {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerWriter.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerWriter.java b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerWriter.java
index 235d4eb..8fba24c 100644
--- a/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerWriter.java
+++ b/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/LoggerWriter.java
@@ -27,7 +27,7 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
/**
* Logs each line written to a pre-defined level. Can also be configured with a Marker. This class provides an interface
* that follows the {@link java.io.Writer} methods in spirit, but doesn't require output to any external writer.
- *
+ *
* @since 2.1
*/
public class LoggerWriter extends Writer {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerOutputStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerOutputStreamTest.java b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerOutputStreamTest.java
index 9f83788..188b422 100644
--- a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerOutputStreamTest.java
+++ b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerOutputStreamTest.java
@@ -28,7 +28,7 @@ import static org.mockito.BDDMockito.then;
import static org.mockito.Mockito.mock;
public abstract class AbstractLoggerOutputStreamTest extends AbstractStreamTest {
-
+
protected OutputStream out;
protected ByteArrayOutputStream wrapped;
protected abstract ByteArrayOutputStream createOutputStream();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractStreamTest.java b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractStreamTest.java
index a24e0f9..d73fd02 100644
--- a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractStreamTest.java
+++ b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractStreamTest.java
@@ -1,59 +1,59 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.logging.log4j.io;
-
-import java.util.List;
-
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.junit.LoggerContextRule;
-import org.apache.logging.log4j.spi.ExtendedLogger;
-import org.junit.Before;
-import org.junit.ClassRule;
-
-import static org.hamcrest.core.StringStartsWith.startsWith;
-import static org.junit.Assert.*;
-
-public abstract class AbstractStreamTest {
-
- protected static ExtendedLogger getExtendedLogger() {
- return ctx.getLogger("UnitTestLogger");
- }
-
- protected final static String NEWLINE = System.lineSeparator();
- protected final static Level LEVEL = Level.ERROR;
- protected final static String FIRST = "first";
-
- protected final static String LAST = "last";
-
- @ClassRule
- public static LoggerContextRule ctx = new LoggerContextRule("log4j2-streams-unit-test.xml");
-
- protected void assertMessages(final String... messages) {
- final List<String> actualMsgs = ctx.getListAppender("UnitTest").getMessages();
- assertEquals("Unexpected number of results.", messages.length, actualMsgs.size());
- for (int i = 0; i < messages.length; i++) {
- final String start = LEVEL.name() + ' ' + messages[i];
- assertThat(actualMsgs.get(i), startsWith(start));
- }
- }
-
- @Before
- public void clearAppender() {
- ctx.getListAppender("UnitTest").clear();
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.logging.log4j.io;
+
+import java.util.List;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.apache.logging.log4j.spi.ExtendedLogger;
+import org.junit.Before;
+import org.junit.ClassRule;
+
+import static org.hamcrest.core.StringStartsWith.startsWith;
+import static org.junit.Assert.*;
+
+public abstract class AbstractStreamTest {
+
+ protected static ExtendedLogger getExtendedLogger() {
+ return ctx.getLogger("UnitTestLogger");
+ }
+
+ protected final static String NEWLINE = System.lineSeparator();
+ protected final static Level LEVEL = Level.ERROR;
+ protected final static String FIRST = "first";
+
+ protected final static String LAST = "last";
+
+ @ClassRule
+ public static LoggerContextRule ctx = new LoggerContextRule("log4j2-streams-unit-test.xml");
+
+ protected void assertMessages(final String... messages) {
+ final List<String> actualMsgs = ctx.getListAppender("UnitTest").getMessages();
+ assertEquals("Unexpected number of results.", messages.length, actualMsgs.size());
+ for (int i = 0; i < messages.length; i++) {
+ final String start = LEVEL.name() + ' ' + messages[i];
+ assertThat(actualMsgs.get(i), startsWith(start));
+ }
+ }
+
+ @Before
+ public void clearAppender() {
+ ctx.getListAppender("UnitTest").clear();
+ }
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/IoBuilderCallerInfoTesting.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/IoBuilderCallerInfoTesting.java b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/IoBuilderCallerInfoTesting.java
index e255542..d81e173 100644
--- a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/IoBuilderCallerInfoTesting.java
+++ b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/IoBuilderCallerInfoTesting.java
@@ -1,55 +1,55 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.logging.log4j.io;
-
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.core.Logger;
-import org.apache.logging.log4j.junit.LoggerContextRule;
-import org.apache.logging.log4j.test.appender.ListAppender;
-import org.junit.Before;
-import org.junit.ClassRule;
-
-import static org.junit.Assert.*;
-
-public class IoBuilderCallerInfoTesting {
-
- protected static Logger getExtendedLogger() {
- return ctx.getLogger("ClassAndMethodLogger");
- }
-
- protected static Logger getLogger() {
- return getExtendedLogger();
- }
-
- protected final static Level LEVEL = Level.WARN;
-
- @ClassRule
- public static LoggerContextRule ctx = new LoggerContextRule("log4j2-streams-calling-info.xml");
-
- public void assertMessages(final String msg, final int size, final String methodName) {
- final ListAppender appender = ctx.getListAppender("ClassAndMethod");
- assertEquals(msg + ".size", size, appender.getMessages().size());
- for (final String message : appender.getMessages()) {
- assertEquals(msg + " has incorrect caller info", this.getClass().getName() + '.' + methodName, message);
- }
- }
-
- @Before
- public void clearAppender() {
- ctx.getListAppender("ClassAndMethod").clear();
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.logging.log4j.io;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.core.Logger;
+import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.apache.logging.log4j.test.appender.ListAppender;
+import org.junit.Before;
+import org.junit.ClassRule;
+
+import static org.junit.Assert.*;
+
+public class IoBuilderCallerInfoTesting {
+
+ protected static Logger getExtendedLogger() {
+ return ctx.getLogger("ClassAndMethodLogger");
+ }
+
+ protected static Logger getLogger() {
+ return getExtendedLogger();
+ }
+
+ protected final static Level LEVEL = Level.WARN;
+
+ @ClassRule
+ public static LoggerContextRule ctx = new LoggerContextRule("log4j2-streams-calling-info.xml");
+
+ public void assertMessages(final String msg, final int size, final String methodName) {
+ final ListAppender appender = ctx.getListAppender("ClassAndMethod");
+ assertEquals(msg + ".size", size, appender.getMessages().size());
+ for (final String message : appender.getMessages()) {
+ assertEquals(msg + " has incorrect caller info", this.getClass().getName() + '.' + methodName, message);
+ }
+ }
+
+ @Before
+ public void clearAppender() {
+ ctx.getListAppender("ClassAndMethod").clear();
+ }
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerBufferedInputStreamCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerBufferedInputStreamCallerInfoTest.java b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerBufferedInputStreamCallerInfoTest.java
index e00bb1b..5975407 100644
--- a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerBufferedInputStreamCallerInfoTest.java
+++ b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerBufferedInputStreamCallerInfoTest.java
@@ -34,7 +34,7 @@ public class LoggerBufferedInputStreamCallerInfoTest extends IoBuilderCallerInfo
this.logIn.close();
assertMessages("after close", 4, "close");
}
-
+
@Test
public void read() throws Exception {
this.logIn.read();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerBufferedReaderCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerBufferedReaderCallerInfoTest.java b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerBufferedReaderCallerInfoTest.java
index 4f07e56..6f83dbb 100644
--- a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerBufferedReaderCallerInfoTest.java
+++ b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerBufferedReaderCallerInfoTest.java
@@ -28,7 +28,7 @@ import org.junit.Test;
public class LoggerBufferedReaderCallerInfoTest extends IoBuilderCallerInfoTesting {
BufferedReader logReader;
-
+
@Test
public void close() throws Exception {
this.logReader.readLine();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerInputStreamCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerInputStreamCallerInfoTest.java b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerInputStreamCallerInfoTest.java
index d6b4efc..36f70f3 100644
--- a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerInputStreamCallerInfoTest.java
+++ b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerInputStreamCallerInfoTest.java
@@ -45,7 +45,7 @@ public class LoggerInputStreamCallerInfoTest extends IoBuilderCallerInfoTesting
this.logIn.close();
assertMessages("after close size", 4, "read");
}
-
+
@Before
public void setupStreams() {
final InputStream srcInputStream = new ByteArrayInputStream("a\nb\nc\nd".getBytes());
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerInputStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerInputStreamTest.java b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerInputStreamTest.java
index 65bc2db..9242eef 100644
--- a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerInputStreamTest.java
+++ b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerInputStreamTest.java
@@ -45,7 +45,7 @@ public class LoggerInputStreamTest extends AbstractStreamTest {
this.read = new ByteArrayOutputStream();
this.in = createInputStream();
}
-
+
@Test
public void testClose_HasRemainingData() throws IOException {
final byte[] bytes = new byte[1024];
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerOutputStreamCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerOutputStreamCallerInfoTest.java b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerOutputStreamCallerInfoTest.java
index 66002ca..1b5eb85 100644
--- a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerOutputStreamCallerInfoTest.java
+++ b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerOutputStreamCallerInfoTest.java
@@ -25,19 +25,19 @@ import org.junit.Test;
public class LoggerOutputStreamCallerInfoTest extends IoBuilderCallerInfoTesting {
private OutputStream logOut;
-
+
@Before
public void setupStreams() {
this.logOut = IoBuilder.forLogger(getExtendedLogger()).setLevel(Level.WARN).buildOutputStream();
}
-
+
@Test
public void write() throws Exception {
this.logOut.write('a');
assertMessages("before write int", 0, "write");
this.logOut.write('\n');
assertMessages("after write int", 1, "write");
-
+
this.logOut.write("b\n".getBytes());
assertMessages("after write byte array", 2, "write");
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintStreamCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintStreamCallerInfoTest.java b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintStreamCallerInfoTest.java
index e79ddaf..723336f 100644
--- a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintStreamCallerInfoTest.java
+++ b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintStreamCallerInfoTest.java
@@ -34,7 +34,7 @@ public class LoggerPrintStreamCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.close();
assertMessages("after close size", 2, "close");
}
-
+
@Test
public void print_boolean() throws Exception {
this.logOut.print(true);
@@ -42,7 +42,7 @@ public class LoggerPrintStreamCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.println(true);
assertMessages("println", 1, "print_boolean");
}
-
+
@Test
public void print_char() throws Exception {
this.logOut.print('a');
@@ -50,7 +50,7 @@ public class LoggerPrintStreamCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.println('b');
assertMessages("println", 1, "print_char");
}
-
+
@Test
public void print_chararray() throws Exception {
this.logOut.print("a".toCharArray());
@@ -58,7 +58,7 @@ public class LoggerPrintStreamCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.println("b".toCharArray());
assertMessages("println", 1, "print_chararray");
}
-
+
@Test
public void print_double() throws Exception {
this.logOut.print(1D);
@@ -66,7 +66,7 @@ public class LoggerPrintStreamCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.println(2D);
assertMessages("println", 1, "print_double");
}
-
+
@Test
public void print_float() throws Exception {
this.logOut.print(1f);
@@ -74,7 +74,7 @@ public class LoggerPrintStreamCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.println(2f);
assertMessages("println", 1, "print_float");
}
-
+
@Test
public void print_int() throws Exception {
this.logOut.print(1);
@@ -82,7 +82,7 @@ public class LoggerPrintStreamCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.println(2);
assertMessages("println", 1, "print_int");
}
-
+
@Test
public void print_long() throws Exception {
this.logOut.print(1L);
@@ -90,7 +90,7 @@ public class LoggerPrintStreamCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.println(2L);
assertMessages("println", 1, "print_long");
}
-
+
@Test
public void print_object() throws Exception {
this.logOut.print((Object) 'a');
@@ -98,19 +98,19 @@ public class LoggerPrintStreamCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.println((Object) 'b');
assertMessages("println", 1, "print_object");
}
-
+
@Test
public void print_printf() throws Exception {
this.logOut.printf("a\n");
assertMessages("println", 1, "print_printf");
}
-
+
@Test
public void print_printf_locale() throws Exception {
this.logOut.printf(Locale.getDefault(), "a\n");
assertMessages("println", 1, "print_printf_locale");
}
-
+
@Test
public void print_string() throws Exception {
this.logOut.print("a");
@@ -118,26 +118,26 @@ public class LoggerPrintStreamCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.println("b");
assertMessages("println", 1, "print_string");
}
-
+
@Before
public void setupStreams() {
this.logOut = IoBuilder.forLogger(getLogger())
.setLevel(Level.WARN)
.buildPrintStream();
}
-
+
@Test
public void write_bytes() throws Exception {
this.logOut.write("b\n".getBytes());
assertMessages("write", 1, "write_bytes");
}
-
+
@Test
public void write_bytes_offset() throws Exception {
this.logOut.write("c\n".getBytes(), 0, 2);
assertMessages("write", 1, "write_bytes_offset");
}
-
+
@Test
public void write_int() throws Exception {
this.logOut.write('a');
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterCallerInfoTest.java b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterCallerInfoTest.java
index 52c87c8..ca6ce01 100644
--- a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterCallerInfoTest.java
+++ b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterCallerInfoTest.java
@@ -26,7 +26,7 @@ import org.junit.Test;
public class LoggerPrintWriterCallerInfoTest extends IoBuilderCallerInfoTesting {
private PrintWriter logOut;
-
+
@Test
public void close() throws Exception {
this.logOut.print("a\nb");
@@ -34,7 +34,7 @@ public class LoggerPrintWriterCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.close();
assertMessages("after close size", 2, "close");
}
-
+
@Test
public void print_boolean() throws Exception {
this.logOut.print(true);
@@ -42,7 +42,7 @@ public class LoggerPrintWriterCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.println(true);
assertMessages("println", 1, "print_boolean");
}
-
+
@Test
public void print_char() throws Exception {
this.logOut.print('a');
@@ -50,7 +50,7 @@ public class LoggerPrintWriterCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.println('b');
assertMessages("println", 1, "print_char");
}
-
+
@Test
public void print_chararray() throws Exception {
this.logOut.print("a".toCharArray());
@@ -58,7 +58,7 @@ public class LoggerPrintWriterCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.println("b".toCharArray());
assertMessages("println", 1, "print_chararray");
}
-
+
@Test
public void print_double() throws Exception {
this.logOut.print(1D);
@@ -66,7 +66,7 @@ public class LoggerPrintWriterCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.println(2D);
assertMessages("println", 1, "print_double");
}
-
+
@Test
public void print_float() throws Exception {
this.logOut.print(1f);
@@ -74,7 +74,7 @@ public class LoggerPrintWriterCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.println(2f);
assertMessages("println", 1, "print_float");
}
-
+
@Test
public void print_int() throws Exception {
this.logOut.print(1);
@@ -82,7 +82,7 @@ public class LoggerPrintWriterCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.println(2);
assertMessages("println", 1, "print_int");
}
-
+
@Test
public void print_long() throws Exception {
this.logOut.print(1L);
@@ -90,7 +90,7 @@ public class LoggerPrintWriterCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.println(2L);
assertMessages("println", 1, "print_long");
}
-
+
@Test
public void print_object() throws Exception {
this.logOut.print((Object) 'a');
@@ -98,19 +98,19 @@ public class LoggerPrintWriterCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.println((Object) 'b');
assertMessages("println", 1, "print_object");
}
-
+
@Test
public void print_printf() throws Exception {
this.logOut.printf("a\n");
assertMessages("println", 1, "print_printf");
}
-
+
@Test
public void print_printf_locale() throws Exception {
this.logOut.printf(Locale.getDefault(), "a\n");
assertMessages("println", 1, "print_printf_locale");
}
-
+
@Test
public void print_string() throws Exception {
this.logOut.print("a");
@@ -118,26 +118,26 @@ public class LoggerPrintWriterCallerInfoTest extends IoBuilderCallerInfoTesting
this.logOut.println("b");
assertMessages("println", 1, "print_string");
}
-
+
@Before
public void setupStreams() {
this.logOut = IoBuilder.forLogger(getLogger())
.setLevel(Level.WARN)
.buildPrintWriter();
}
-
+
@Test
public void write_bytes() throws Exception {
this.logOut.write("b\n".toCharArray());
assertMessages("write", 1, "write_bytes");
}
-
+
@Test
public void write_bytes_offset() throws Exception {
this.logOut.write("c\n".toCharArray(), 0, 2);
assertMessages("write", 1, "write_bytes_offset");
}
-
+
@Test
public void write_int() throws Exception {
this.logOut.write('a');
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterJdbcH2Test.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterJdbcH2Test.java b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterJdbcH2Test.java
index dad446d..712ec62 100644
--- a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterJdbcH2Test.java
+++ b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterJdbcH2Test.java
@@ -1,96 +1,96 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.io;
-
-import java.io.PrintWriter;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.junit.LoggerContextRule;
-import org.apache.logging.log4j.test.appender.ListAppender;
-import org.apache.logging.log4j.util.Strings;
-import org.h2.jdbcx.JdbcDataSource;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Ignore;
-import org.junit.Test;
-
-public class LoggerPrintWriterJdbcH2Test {
-
- @ClassRule
- public static LoggerContextRule context = new LoggerContextRule("log4j2-jdbc-driver-manager.xml");
-
- private static final String H2_URL = "jdbc:h2:mem:Log4j";
-
- private static final String PASSWORD = Strings.EMPTY;
-
- private static final String USER_ID = "sa";
-
- private ListAppender listAppender;
-
- private PrintWriter createLoggerPrintWriter() {
- return IoBuilder.forLogger(context.getLogger()).setLevel(Level.ALL).buildPrintWriter();
- }
-
- private ListAppender getListAppender() {
- return listAppender;
- }
-
- protected Connection newConnection() throws SQLException {
- return DriverManager.getConnection(H2_URL, USER_ID, PASSWORD);
- }
-
- private void setListAppender(final ListAppender listAppender) {
- this.listAppender = listAppender;
- }
-
- @Before
- public void setUp() throws Exception {
- this.setListAppender(context.getListAppender("List").clear());
- Assert.assertEquals(0, this.getListAppender().getMessages().size());
- }
-
- @Test
- @Ignore("DataSource#setLogWriter() has no effect in H2, it uses its own internal logging and an SLF4J bridge.")
- public void testDataSource_setLogWriter() throws SQLException {
- final JdbcDataSource dataSource = new JdbcDataSource();
- dataSource.setUrl(H2_URL);
- dataSource.setUser(USER_ID);
- dataSource.setPassword(PASSWORD);
- dataSource.setLogWriter(createLoggerPrintWriter());
- // dataSource.setLogWriter(new PrintWriter(new OutputStreamWriter(System.out)));
- try (final Connection conn = dataSource.getConnection()) {
- conn.prepareCall("select 1");
- }
- Assert.assertTrue(this.getListAppender().getMessages().size() > 0);
- }
-
- @Test
- public void testDriverManager_setLogWriter() throws SQLException {
- DriverManager.setLogWriter(createLoggerPrintWriter());
- // DriverManager.setLogWriter(new PrintWriter(new OutputStreamWriter(System.out)));
- try (final Connection conn = this.newConnection()) {
- conn.rollback();
- } finally {
- DriverManager.setLogWriter(null);
- }
- Assert.assertTrue(this.getListAppender().getMessages().size() > 0);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.io;
+
+import java.io.PrintWriter;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.apache.logging.log4j.test.appender.ListAppender;
+import org.apache.logging.log4j.util.Strings;
+import org.h2.jdbcx.JdbcDataSource;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class LoggerPrintWriterJdbcH2Test {
+
+ @ClassRule
+ public static LoggerContextRule context = new LoggerContextRule("log4j2-jdbc-driver-manager.xml");
+
+ private static final String H2_URL = "jdbc:h2:mem:Log4j";
+
+ private static final String PASSWORD = Strings.EMPTY;
+
+ private static final String USER_ID = "sa";
+
+ private ListAppender listAppender;
+
+ private PrintWriter createLoggerPrintWriter() {
+ return IoBuilder.forLogger(context.getLogger()).setLevel(Level.ALL).buildPrintWriter();
+ }
+
+ private ListAppender getListAppender() {
+ return listAppender;
+ }
+
+ protected Connection newConnection() throws SQLException {
+ return DriverManager.getConnection(H2_URL, USER_ID, PASSWORD);
+ }
+
+ private void setListAppender(final ListAppender listAppender) {
+ this.listAppender = listAppender;
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ this.setListAppender(context.getListAppender("List").clear());
+ Assert.assertEquals(0, this.getListAppender().getMessages().size());
+ }
+
+ @Test
+ @Ignore("DataSource#setLogWriter() has no effect in H2, it uses its own internal logging and an SLF4J bridge.")
+ public void testDataSource_setLogWriter() throws SQLException {
+ final JdbcDataSource dataSource = new JdbcDataSource();
+ dataSource.setUrl(H2_URL);
+ dataSource.setUser(USER_ID);
+ dataSource.setPassword(PASSWORD);
+ dataSource.setLogWriter(createLoggerPrintWriter());
+ // dataSource.setLogWriter(new PrintWriter(new OutputStreamWriter(System.out)));
+ try (final Connection conn = dataSource.getConnection()) {
+ conn.prepareCall("select 1");
+ }
+ Assert.assertTrue(this.getListAppender().getMessages().size() > 0);
+ }
+
+ @Test
+ public void testDriverManager_setLogWriter() throws SQLException {
+ DriverManager.setLogWriter(createLoggerPrintWriter());
+ // DriverManager.setLogWriter(new PrintWriter(new OutputStreamWriter(System.out)));
+ try (final Connection conn = this.newConnection()) {
+ conn.rollback();
+ } finally {
+ DriverManager.setLogWriter(null);
+ }
+ Assert.assertTrue(this.getListAppender().getMessages().size() > 0);
+ }
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterTest.java b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterTest.java
index 37618ac..032e004 100644
--- a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterTest.java
+++ b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterTest.java
@@ -25,7 +25,7 @@ import org.junit.Test;
import static org.junit.Assert.*;
public class LoggerPrintWriterTest extends AbstractLoggerWriterTest {
- private PrintWriter print;
+ private PrintWriter print;
@Override
protected StringWriter createWriter() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerReaderCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerReaderCallerInfoTest.java b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerReaderCallerInfoTest.java
index 41393e5..ae009b2 100644
--- a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerReaderCallerInfoTest.java
+++ b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerReaderCallerInfoTest.java
@@ -26,7 +26,7 @@ import org.junit.Test;
public class LoggerReaderCallerInfoTest extends IoBuilderCallerInfoTesting {
Reader logReader;
-
+
@Test
public void read() throws Exception {
this.logReader.read();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerReaderTest.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerReaderTest.java b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerReaderTest.java
index fa48a31..b6383e2 100644
--- a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerReaderTest.java
+++ b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerReaderTest.java
@@ -39,7 +39,7 @@ public class LoggerReaderTest extends AbstractStreamTest {
.setLevel(LEVEL)
.buildReader();
}
-
+
@Before
public void createStream() {
this.wrapped = new StringReader(FIRST + "\r\n" + LAST);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-jcl/src/main/java/org/apache/logging/log4j/jcl/Log4jLog.java
----------------------------------------------------------------------
diff --git a/log4j-jcl/src/main/java/org/apache/logging/log4j/jcl/Log4jLog.java b/log4j-jcl/src/main/java/org/apache/logging/log4j/jcl/Log4jLog.java
index 1e644d5..1fb51aa 100644
--- a/log4j-jcl/src/main/java/org/apache/logging/log4j/jcl/Log4jLog.java
+++ b/log4j-jcl/src/main/java/org/apache/logging/log4j/jcl/Log4jLog.java
@@ -26,7 +26,7 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
*
*/
public class Log4jLog implements Log, Serializable {
-
+
private static final long serialVersionUID = 1L;
private static final String FQCN = Log4jLog.class.getName();
[05/13] logging-log4j2 git commit: Revert "Use final. Remove trailing
spaces."
Posted by gg...@apache.org.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ClockFactory.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ClockFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ClockFactory.java
index 01a448a..8b965b6 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ClockFactory.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ClockFactory.java
@@ -68,7 +68,7 @@ public final class ClockFactory {
}
private static Map<String, Supplier<Clock>> aliases() {
- final Map<String, Supplier<Clock>> result = new HashMap<>();
+ Map<String, Supplier<Clock>> result = new HashMap<>();
result.put("SystemClock", new Supplier<Clock>() { @Override public Clock get() { return new SystemClock(); } });
result.put("SystemMillisClock", new Supplier<Clock>() { @Override public Clock get() { return new SystemMillisClock(); } });
result.put("CachedClock", new Supplier<Clock>() { @Override public Clock get() { return CachedClock.instance(); } });
@@ -84,7 +84,7 @@ public final class ClockFactory {
LOGGER.trace("Using default SystemClock for timestamps.");
return logSupportedPrecision(new SystemClock());
}
- final Supplier<Clock> specified = aliases().get(userRequest);
+ Supplier<Clock> specified = aliases().get(userRequest);
if (specified != null) {
LOGGER.trace("Using specified {} for timestamps.", userRequest);
return logSupportedPrecision(specified.get());
@@ -100,8 +100,8 @@ public final class ClockFactory {
}
}
- private static Clock logSupportedPrecision(final Clock clock) {
- final String support = clock instanceof PreciseClock ? "supports" : "does not support";
+ private static Clock logSupportedPrecision(Clock clock) {
+ String support = clock instanceof PreciseClock ? "supports" : "does not support";
LOGGER.debug("{} {} precise timestamps.", clock.getClass().getName(), support);
return clock;
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/DummyNanoClock.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/DummyNanoClock.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/DummyNanoClock.java
index 91f5ae5..e3d6c2b 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/DummyNanoClock.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/DummyNanoClock.java
@@ -37,7 +37,7 @@ public final class DummyNanoClock implements NanoClock {
/**
* Returns the constructor value.
- *
+ *
* @return the constructor value
*/
@Override
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ExecutorServices.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ExecutorServices.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ExecutorServices.java
index 064b38b..37a44f5 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ExecutorServices.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ExecutorServices.java
@@ -32,7 +32,7 @@ public class ExecutorServices {
* <p>
* If the timeout is 0, then a plain shutdown takes place.
* </p>
- *
+ *
* @param executorService
* the pool to shutdown.
* @param timeout
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/FileUtils.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/FileUtils.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/FileUtils.java
index 6fd73c2..609a005 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/FileUtils.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/FileUtils.java
@@ -112,7 +112,7 @@ public final class FileUtils {
/**
* Asserts that the given directory exists and creates it if necessary.
- *
+ *
* @param dir the directory that shall exist
* @param createDirectoryIfNotExisting specifies if the directory shall be created if it does not exist.
* @throws java.io.IOException thrown if the directory could not be created.
@@ -131,10 +131,10 @@ public final class FileUtils {
throw new IOException("File " + dir + " exists and is not a directory. Unable to create directory.");
}
}
-
+
/**
* Creates the parent directories for the given File.
- *
+ *
* @param file
* @throws IOException
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/FileWatcher.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/FileWatcher.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/FileWatcher.java
index d7ddb54..ab7752e 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/FileWatcher.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/FileWatcher.java
@@ -20,14 +20,14 @@ import java.io.File;
/**
* Watches for changes in a {@link File} and performs an action when the file is modified.
- *
+ *
* @see WatchManager
*/
public interface FileWatcher {
/**
* Called when a {@link WatchManager} detects that the given {@link File} changed.
- *
+ *
* @param file
* the file that changed.
* @see WatchManager
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/JndiCloser.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/JndiCloser.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/JndiCloser.java
index 32178f1..2114b40 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/JndiCloser.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/JndiCloser.java
@@ -1,60 +1,60 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-package org.apache.logging.log4j.core.util;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-/**
- * Helper class for closing JNDI resources.
- *
- * This class is separate from {@link Closer} because JNDI is not in Android.
- */
-public final class JndiCloser {
-
- private JndiCloser() {
- }
-
- /**
- * Closes the specified {@code Context}.
- *
- * @param context the JNDI Context to close, may be {@code null}
- * @throws NamingException if a problem occurred closing the specified JNDI Context
- */
- public static void close(final Context context) throws NamingException {
- if (context != null) {
- context.close();
- }
- }
-
- /**
- * Closes the specified {@code Context}, ignoring any exceptions thrown by the close operation.
- *
- * @param context the JNDI Context to close, may be {@code null}
- */
- public static boolean closeSilently(final Context context) {
- try {
- close(context);
- return true;
- } catch (final NamingException ignored) {
- // ignored
- return false;
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.core.util;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+/**
+ * Helper class for closing JNDI resources.
+ *
+ * This class is separate from {@link Closer} because JNDI is not in Android.
+ */
+public final class JndiCloser {
+
+ private JndiCloser() {
+ }
+
+ /**
+ * Closes the specified {@code Context}.
+ *
+ * @param context the JNDI Context to close, may be {@code null}
+ * @throws NamingException if a problem occurred closing the specified JNDI Context
+ */
+ public static void close(final Context context) throws NamingException {
+ if (context != null) {
+ context.close();
+ }
+ }
+
+ /**
+ * Closes the specified {@code Context}, ignoring any exceptions thrown by the close operation.
+ *
+ * @param context the JNDI Context to close, may be {@code null}
+ */
+ public static boolean closeSilently(final Context context) {
+ try {
+ close(context);
+ return true;
+ } catch (final NamingException ignored) {
+ // ignored
+ return false;
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Loader.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Loader.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Loader.java
index ee36fea..1380b7a 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Loader.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Loader.java
@@ -276,7 +276,7 @@ public final class Loader {
InstantiationException,
NoSuchMethodException,
InvocationTargetException {
- final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+ ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getClassLoader());
return LoaderUtil.newInstanceOf(className);
@@ -305,7 +305,7 @@ public final class Loader {
IllegalAccessException,
InvocationTargetException,
InstantiationException {
- final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+ ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getClassLoader());
return LoaderUtil.newCheckedInstanceOf(className, clazz);
@@ -332,7 +332,7 @@ public final class Loader {
throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException,
IllegalAccessException {
final String className = PropertiesUtil.getProperties().getStringProperty(propertyName);
- final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+ ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getClassLoader());
return LoaderUtil.newCheckedInstanceOfProperty(propertyName, clazz);
@@ -348,7 +348,7 @@ public final class Loader {
* @return {@code true} if the class could be found or {@code false} otherwise.
*/
public static boolean isClassAvailable(final String className) {
- final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+ ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getClassLoader());
return LoaderUtil.isClassAvailable(className);
@@ -371,7 +371,7 @@ public final class Loader {
*/
public static Class<?> loadClass(final String className) throws ClassNotFoundException {
- final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+ ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getClassLoader());
return LoaderUtil.loadClass(className);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Log4jThreadFactory.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Log4jThreadFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Log4jThreadFactory.java
index 112b9d0..8b636f6 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Log4jThreadFactory.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Log4jThreadFactory.java
@@ -22,7 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
/**
* Creates {@link Log4jThread}s.
- *
+ *
* @since 2.7
*/
public class Log4jThreadFactory implements ThreadFactory {
@@ -31,7 +31,7 @@ public class Log4jThreadFactory implements ThreadFactory {
/**
* Creates a new daemon thread factory.
- *
+ *
* @param threadFactoryName
* The thread factory name.
* @return a new daemon thread factory.
@@ -64,7 +64,7 @@ public class Log4jThreadFactory implements ThreadFactory {
/**
* Constructs an initialized thread factory.
- *
+ *
* @param threadFactoryName
* The thread factory name.
* @param daemon
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/NetUtils.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/NetUtils.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/NetUtils.java
index 11df6e4..e72beb6 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/NetUtils.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/NetUtils.java
@@ -79,7 +79,7 @@ public final class NetUtils {
/**
* Converts a URI string or file path to a URI object.
- *
+ *
* @param path the URI string or path
* @return the URI object
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/NullOutputStream.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/NullOutputStream.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/NullOutputStream.java
index 8fe9008..7403215 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/NullOutputStream.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/NullOutputStream.java
@@ -26,13 +26,13 @@ import java.io.OutputStream;
* This output stream has no destination (file/socket etc.) and all bytes written to it are ignored and lost.
* </p>
* Originally from Apache Commons IO.
- *
+ *
* @since 2.3
*/
public class NullOutputStream extends OutputStream {
private static final NullOutputStream INSTANCE = new NullOutputStream();
-
+
/**
* @deprecated Deprecated in 2.7: use {@link #getInstance()}.
*/
@@ -41,20 +41,20 @@ public class NullOutputStream extends OutputStream {
/**
* Gets the singleton instance.
- *
+ *
* @return the singleton instance.
*/
public static NullOutputStream getInstance() {
return INSTANCE;
}
-
+
private NullOutputStream() {
// do nothing
}
-
+
/**
* Does nothing - output to <code>/dev/null</code>.
- *
+ *
* @param b
* The bytes to write
* @param off
@@ -69,7 +69,7 @@ public class NullOutputStream extends OutputStream {
/**
* Does nothing - output to <code>/dev/null</code>.
- *
+ *
* @param b
* The byte to write
*/
@@ -80,7 +80,7 @@ public class NullOutputStream extends OutputStream {
/**
* Does nothing - output to <code>/dev/null</code>.
- *
+ *
* @param b
* The bytes to write
* @throws IOException
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Patterns.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Patterns.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Patterns.java
index 5427197..1177148 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Patterns.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Patterns.java
@@ -18,7 +18,7 @@ package org.apache.logging.log4j.core.util;
/**
* Pattern strings used throughout Log4j.
- *
+ *
* @see java.util.regex.Pattern
*/
public final class Patterns {
@@ -38,7 +38,7 @@ public final class Patterns {
/**
* Creates a pattern string for {@code separator} surrounded by whitespace.
- *
+ *
* @param separator The separator.
* @return a pattern for {@code separator} surrounded by whitespace.
*/
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/StringBuilderWriter.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/StringBuilderWriter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/StringBuilderWriter.java
index 4dc823c..d366bd6 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/StringBuilderWriter.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/StringBuilderWriter.java
@@ -1,168 +1,168 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core.util;
-
-import java.io.Serializable;
-import java.io.Writer;
-
-/**
- * {@link Writer} implementation that outputs to a {@link StringBuilder}.
- * <p>
- * <strong>NOTE:</strong> This implementation, as an alternative to
- * <code>java.io.StringWriter</code>, provides an <i>un-synchronized</i>
- * (i.e. for use in a single thread) implementation for better performance.
- * For safe usage with multiple {@link Thread}s then
- * <code>java.io.StringWriter</code> should be used.
- *
- * <h3>History</h3>
- * <ol>
- * <li>Copied from Apache Commons IO revision 1681000.</li>
- * <li>Pick up Javadoc updates from revision 1722253.</li>
- * <ol>
- */
-public class StringBuilderWriter extends Writer implements Serializable {
-
- private static final long serialVersionUID = -146927496096066153L;
- private final StringBuilder builder;
-
- /**
- * Constructs a new {@link StringBuilder} instance with default capacity.
- */
- public StringBuilderWriter() {
- this.builder = new StringBuilder();
- }
-
- /**
- * Constructs a new {@link StringBuilder} instance with the specified capacity.
- *
- * @param capacity The initial capacity of the underlying {@link StringBuilder}
- */
- public StringBuilderWriter(final int capacity) {
- this.builder = new StringBuilder(capacity);
- }
-
- /**
- * Constructs a new instance with the specified {@link StringBuilder}.
- *
- * <p>If {@code builder} is null a new instance with default capacity will be created.</p>
- *
- * @param builder The String builder. May be null.
- */
- public StringBuilderWriter(final StringBuilder builder) {
- this.builder = builder != null ? builder : new StringBuilder();
- }
-
- /**
- * Appends a single character to this Writer.
- *
- * @param value The character to append
- * @return This writer instance
- */
- @Override
- public Writer append(final char value) {
- builder.append(value);
- return this;
- }
-
- /**
- * Appends a character sequence to this Writer.
- *
- * @param value The character to append
- * @return This writer instance
- */
- @Override
- public Writer append(final CharSequence value) {
- builder.append(value);
- return this;
- }
-
- /**
- * Appends a portion of a character sequence to the {@link StringBuilder}.
- *
- * @param value The character to append
- * @param start The index of the first character
- * @param end The index of the last character + 1
- * @return This writer instance
- */
- @Override
- public Writer append(final CharSequence value, final int start, final int end) {
- builder.append(value, start, end);
- return this;
- }
-
- /**
- * Closing this writer has no effect.
- */
- @Override
- public void close() {
- // no-op
- }
-
- /**
- * Flushing this writer has no effect.
- */
- @Override
- public void flush() {
- // no-op
- }
-
-
- /**
- * Writes a String to the {@link StringBuilder}.
- *
- * @param value The value to write
- */
- @Override
- public void write(final String value) {
- if (value != null) {
- builder.append(value);
- }
- }
-
- /**
- * Writes a portion of a character array to the {@link StringBuilder}.
- *
- * @param value The value to write
- * @param offset The index of the first character
- * @param length The number of characters to write
- */
- @Override
- public void write(final char[] value, final int offset, final int length) {
- if (value != null) {
- builder.append(value, offset, length);
- }
- }
-
- /**
- * Returns the underlying builder.
- *
- * @return The underlying builder
- */
- public StringBuilder getBuilder() {
- return builder;
- }
-
- /**
- * Returns {@link StringBuilder#toString()}.
- *
- * @return The contents of the String builder.
- */
- @Override
- public String toString() {
- return builder.toString();
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.core.util;
+
+import java.io.Serializable;
+import java.io.Writer;
+
+/**
+ * {@link Writer} implementation that outputs to a {@link StringBuilder}.
+ * <p>
+ * <strong>NOTE:</strong> This implementation, as an alternative to
+ * <code>java.io.StringWriter</code>, provides an <i>un-synchronized</i>
+ * (i.e. for use in a single thread) implementation for better performance.
+ * For safe usage with multiple {@link Thread}s then
+ * <code>java.io.StringWriter</code> should be used.
+ *
+ * <h3>History</h3>
+ * <ol>
+ * <li>Copied from Apache Commons IO revision 1681000.</li>
+ * <li>Pick up Javadoc updates from revision 1722253.</li>
+ * <ol>
+ */
+public class StringBuilderWriter extends Writer implements Serializable {
+
+ private static final long serialVersionUID = -146927496096066153L;
+ private final StringBuilder builder;
+
+ /**
+ * Constructs a new {@link StringBuilder} instance with default capacity.
+ */
+ public StringBuilderWriter() {
+ this.builder = new StringBuilder();
+ }
+
+ /**
+ * Constructs a new {@link StringBuilder} instance with the specified capacity.
+ *
+ * @param capacity The initial capacity of the underlying {@link StringBuilder}
+ */
+ public StringBuilderWriter(final int capacity) {
+ this.builder = new StringBuilder(capacity);
+ }
+
+ /**
+ * Constructs a new instance with the specified {@link StringBuilder}.
+ *
+ * <p>If {@code builder} is null a new instance with default capacity will be created.</p>
+ *
+ * @param builder The String builder. May be null.
+ */
+ public StringBuilderWriter(final StringBuilder builder) {
+ this.builder = builder != null ? builder : new StringBuilder();
+ }
+
+ /**
+ * Appends a single character to this Writer.
+ *
+ * @param value The character to append
+ * @return This writer instance
+ */
+ @Override
+ public Writer append(final char value) {
+ builder.append(value);
+ return this;
+ }
+
+ /**
+ * Appends a character sequence to this Writer.
+ *
+ * @param value The character to append
+ * @return This writer instance
+ */
+ @Override
+ public Writer append(final CharSequence value) {
+ builder.append(value);
+ return this;
+ }
+
+ /**
+ * Appends a portion of a character sequence to the {@link StringBuilder}.
+ *
+ * @param value The character to append
+ * @param start The index of the first character
+ * @param end The index of the last character + 1
+ * @return This writer instance
+ */
+ @Override
+ public Writer append(final CharSequence value, final int start, final int end) {
+ builder.append(value, start, end);
+ return this;
+ }
+
+ /**
+ * Closing this writer has no effect.
+ */
+ @Override
+ public void close() {
+ // no-op
+ }
+
+ /**
+ * Flushing this writer has no effect.
+ */
+ @Override
+ public void flush() {
+ // no-op
+ }
+
+
+ /**
+ * Writes a String to the {@link StringBuilder}.
+ *
+ * @param value The value to write
+ */
+ @Override
+ public void write(final String value) {
+ if (value != null) {
+ builder.append(value);
+ }
+ }
+
+ /**
+ * Writes a portion of a character array to the {@link StringBuilder}.
+ *
+ * @param value The value to write
+ * @param offset The index of the first character
+ * @param length The number of characters to write
+ */
+ @Override
+ public void write(final char[] value, final int offset, final int length) {
+ if (value != null) {
+ builder.append(value, offset, length);
+ }
+ }
+
+ /**
+ * Returns the underlying builder.
+ *
+ * @return The underlying builder
+ */
+ public StringBuilder getBuilder() {
+ return builder;
+ }
+
+ /**
+ * Returns {@link StringBuilder#toString()}.
+ *
+ * @return The contents of the String builder.
+ */
+ @Override
+ public String toString() {
+ return builder.toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/TypeUtil.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/TypeUtil.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/TypeUtil.java
index 68255ac..eb9c328 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/TypeUtil.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/TypeUtil.java
@@ -39,13 +39,13 @@ import java.util.Objects;
* @since 2.1
*/
public final class TypeUtil {
-
+
private TypeUtil() {
}
/**
* Gets all declared fields for the given class (including superclasses).
- *
+ *
* @param cls the class to examine
* @return all declared fields for the given class (including superclasses).
* @see Class#getDeclaredFields()
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/WatchManager.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/WatchManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/WatchManager.java
index 31a98ef..b38d899 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/WatchManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/WatchManager.java
@@ -32,7 +32,7 @@ import org.apache.logging.log4j.status.StatusLogger;
/**
* Manages {@link FileWatcher}s.
- *
+ *
* @see FileWatcher
* @see ConfigurationScheduler
*/
@@ -55,7 +55,7 @@ public class WatchManager extends AbstractLifeCycle {
* This allows you to start, stop, reset and start again a manager, without triggering file modified events if the a
* watched file has changed during the period of time when the manager was stopped.
* </p>
- *
+ *
* @since 2.11.0
*/
public void reset() {
@@ -72,7 +72,7 @@ public class WatchManager extends AbstractLifeCycle {
* This allows you to start, stop, reset and start again a manager, without triggering file modified events if the
* given watched file has changed during the period of time when the manager was stopped.
* </p>
- *
+ *
* @param file
* the file for the monitor to reset.
* @since 2.11.0
@@ -108,7 +108,7 @@ public class WatchManager extends AbstractLifeCycle {
/**
* Gets how often this manager checks for file modifications.
- *
+ *
* @return how often, in seconds, this manager checks for file modifications.
*/
public int getIntervalSeconds() {
@@ -134,7 +134,7 @@ public class WatchManager extends AbstractLifeCycle {
/**
* Unwatches the given file.
- *
+ *
* @param file
* the file to stop watching.
* @since 2.11.0
@@ -146,7 +146,7 @@ public class WatchManager extends AbstractLifeCycle {
/**
* Watches the given file.
- *
+ *
* @param file
* the file to watch.
* @param watcher
@@ -171,7 +171,7 @@ public class WatchManager extends AbstractLifeCycle {
private String millisToString(final long millis) {
return new Date(millis).toString();
}
-
+
private final class WatchRunnable implements Runnable {
// Use a hard class reference here in case a refactoring changes the class name.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/DateParser.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/DateParser.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/DateParser.java
index 8d4a359..16940c6 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/DateParser.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/DateParser.java
@@ -30,34 +30,34 @@ import java.util.TimeZone;
* <p>
* Warning: Since binary compatible methods may be added to this interface in any
* release, developers are not expected to implement this interface.
- *
+ *
* <p>
* Copied and modified from <a href="https://commons.apache.org/proper/commons-lang/">Apache Commons Lang</a>.
* </p>
- *
+ *
* @since Apache Commons Lang 3.2
*/
public interface DateParser {
/**
- * Equivalent to DateFormat.parse(String).
- *
- * See {@link java.text.DateFormat#parse(String)} for more information.
- * @param source A <code>String</code> whose beginning should be parsed.
+ * Equivalent to DateFormat.parse(String).
+ *
+ * See {@link java.text.DateFormat#parse(String)} for more information.
+ * @param source A <code>String</code> whose beginning should be parsed.
* @return A <code>Date</code> parsed from the string
* @throws ParseException if the beginning of the specified string cannot be parsed.
*/
Date parse(String source) throws ParseException;
/**
- * Equivalent to DateFormat.parse(String, ParsePosition).
- *
- * See {@link java.text.DateFormat#parse(String, ParsePosition)} for more information.
- *
+ * Equivalent to DateFormat.parse(String, ParsePosition).
+ *
+ * See {@link java.text.DateFormat#parse(String, ParsePosition)} for more information.
+ *
* @param source A <code>String</code>, part of which should be parsed.
- * @param pos A <code>ParsePosition</code> object with index and error index information
- * as described above.
- * @return A <code>Date</code> parsed from the string. In case of error, returns null.
+ * @param pos A <code>ParsePosition</code> object with index and error index information
+ * as described above.
+ * @return A <code>Date</code> parsed from the string. In case of error, returns null.
* @throws NullPointerException if text or pos is null.
*/
Date parse(String source, ParsePosition pos);
@@ -74,7 +74,7 @@ public interface DateParser {
* @return true, if source has been parsed (pos parsePosition is updated); otherwise false (and pos errorIndex is updated)
* @throws IllegalArgumentException when Calendar has been set to be not lenient, and a parsed field is
* out of range.
- *
+ *
* @since 3.5
*/
boolean parse(String source, ParsePosition pos, Calendar calendar);
@@ -83,7 +83,7 @@ public interface DateParser {
//-----------------------------------------------------------------------
/**
* <p>Gets the pattern used by this parser.</p>
- *
+ *
* @return the pattern, {@link java.text.SimpleDateFormat} compatible
*/
String getPattern();
@@ -92,40 +92,40 @@ public interface DateParser {
* <p>
* Gets the time zone used by this parser.
* </p>
- *
+ *
* <p>
* The default {@link TimeZone} used to create a {@link Date} when the {@link TimeZone} is not specified by
* the format pattern.
* </p>
- *
+ *
* @return the time zone
*/
TimeZone getTimeZone();
/**
* <p>Gets the locale used by this parser.</p>
- *
+ *
* @return the locale
*/
Locale getLocale();
/**
* Parses text from a string to produce a Date.
- *
+ *
* @param source A <code>String</code> whose beginning should be parsed.
* @return a <code>java.util.Date</code> object
* @throws ParseException if the beginning of the specified string cannot be parsed.
- * @see java.text.DateFormat#parseObject(String)
+ * @see java.text.DateFormat#parseObject(String)
*/
Object parseObject(String source) throws ParseException;
/**
* Parses a date/time string according to the given parse position.
- *
+ *
* @param source A <code>String</code> whose beginning should be parsed.
* @param pos the parse position
* @return a <code>java.util.Date</code> object
- * @see java.text.DateFormat#parseObject(String, ParsePosition)
+ * @see java.text.DateFormat#parseObject(String, ParsePosition)
*/
Object parseObject(String source, ParsePosition pos);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/DatePrinter.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/DatePrinter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/DatePrinter.java
index adcf59e..91f5e1a 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/DatePrinter.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/DatePrinter.java
@@ -23,18 +23,18 @@ import java.util.Locale;
import java.util.TimeZone;
/**
- * DatePrinter is the "missing" interface for the format methods of
+ * DatePrinter is the "missing" interface for the format methods of
* {@link java.text.DateFormat}. You can obtain an object implementing this
* interface by using one of the FastDateFormat factory methods.
* <p>
* Warning: Since binary compatible methods may be added to this interface in any
* release, developers are not expected to implement this interface.
* </p>
- *
+ *
* <p>
* Copied and modified from <a href="https://commons.apache.org/proper/commons-lang/">Apache Commons Lang</a>.
* </p>
- *
+ *
* @since Apache Commons Lang 3.2
*/
public interface DatePrinter {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDateFormat.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDateFormat.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDateFormat.java
index 0e8f036..db38bd1 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDateFormat.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDateFormat.java
@@ -29,16 +29,16 @@ import java.util.TimeZone;
* <p>FastDateFormat is a fast and thread-safe version of
* {@link java.text.SimpleDateFormat}.</p>
*
- * <p>To obtain an instance of FastDateFormat, use one of the static factory methods:
- * {@link #getInstance(String, TimeZone, Locale)}, {@link #getDateInstance(int, TimeZone, Locale)},
- * {@link #getTimeInstance(int, TimeZone, Locale)}, or {@link #getDateTimeInstance(int, int, TimeZone, Locale)}
+ * <p>To obtain an instance of FastDateFormat, use one of the static factory methods:
+ * {@link #getInstance(String, TimeZone, Locale)}, {@link #getDateInstance(int, TimeZone, Locale)},
+ * {@link #getTimeInstance(int, TimeZone, Locale)}, or {@link #getDateTimeInstance(int, int, TimeZone, Locale)}
* </p>
- *
+ *
* <p>Since FastDateFormat is thread safe, you can use a static member instance:</p>
* <code>
* private static final FastDateFormat DATE_FORMATTER = FastDateFormat.getDateTimeInstance(FastDateFormat.LONG, FastDateFormat.SHORT);
* </code>
- *
+ *
* <p>This class can be used as a direct replacement to
* {@code SimpleDateFormat} in most formatting and parsing situations.
* This class is especially useful in multi-threaded server environments.
@@ -65,15 +65,15 @@ import java.util.TimeZone;
* interpreted as a number.</i> Starting with Java 1.7 a pattern of 'Y' or
* 'YYY' will be formatted as '2003', while it was '03' in former Java
* versions. FastDateFormat implements the behavior of Java 7.</p>
- *
+ *
* <p>
* Copied and modified from <a href="https://commons.apache.org/proper/commons-lang/">Apache Commons Lang</a>.
* </p>
- *
+ *
* @since Apache Commons Lang 2.0
*/
public class FastDateFormat extends Format implements DateParser, DatePrinter {
-
+
/**
* Required for serialization support.
*
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDateParser.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDateParser.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDateParser.java
index 9e5e6ec..4ba5668 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDateParser.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDateParser.java
@@ -43,14 +43,14 @@ import java.util.regex.Pattern;
* <p>FastDateParser is a fast and thread-safe version of
* {@link java.text.SimpleDateFormat}.</p>
*
- * <p>To obtain a proxy to a FastDateParser, use {@link FastDateFormat#getInstance(String, TimeZone, Locale)}
+ * <p>To obtain a proxy to a FastDateParser, use {@link FastDateFormat#getInstance(String, TimeZone, Locale)}
* or another variation of the factory methods of {@link FastDateFormat}.</p>
- *
+ *
* <p>Since FastDateParser is thread safe, you can use a static member instance:</p>
* <code>
* private static final DateParser DATE_PARSER = FastDateFormat.getInstance("yyyy-MM-dd");
* </code>
- *
+ *
* <p>This class can be used as a direct replacement for
* <code>SimpleDateFormat</code> in most parsing situations.
* This class is especially useful in multi-threaded server environments.
@@ -66,11 +66,11 @@ import java.util.regex.Pattern;
*
* <p>Timing tests indicate this class is as about as fast as SimpleDateFormat
* in single thread applications and about 25% faster in multi-thread applications.</p>
- *
+ *
* <p>
* Copied and modified from <a href="https://commons.apache.org/proper/commons-lang/">Apache Commons Lang</a>.
* </p>
- *
+ *
* @since Apache Commons Lang 3.2
* @see FastDatePrinter
*/
@@ -107,8 +107,8 @@ public class FastDateParser implements DateParser, Serializable {
/**
* <p>Constructs a new FastDateParser.</p>
- *
- * Use {@link FastDateFormat#getInstance(String, TimeZone, Locale)} or another variation of the
+ *
+ * Use {@link FastDateFormat#getInstance(String, TimeZone, Locale)} or another variation of the
* factory methods of {@link FastDateFormat} to get a cached FastDateParser instance.
*
* @param pattern non-null {@link java.text.SimpleDateFormat} compatible
@@ -385,8 +385,8 @@ public class FastDateParser implements DateParser, Serializable {
/**
* This implementation updates the ParsePosition if the parse succeeds.
- * However, it sets the error index to the position before the failed field unlike
- * the method {@link java.text.SimpleDateFormat#parse(String, ParsePosition)} which sets
+ * However, it sets the error index to the position before the failed field unlike
+ * the method {@link java.text.SimpleDateFormat#parse(String, ParsePosition)} which sets
* the error index to after the failed field.
* <p>
* To determine if the parse has succeeded, the caller must check if the current parse position
@@ -409,7 +409,7 @@ public class FastDateParser implements DateParser, Serializable {
* Upon success, the ParsePosition index is updated to indicate how much of the source text was consumed.
* Not all source text needs to be consumed. Upon parse failure, ParsePosition error index is updated to
* the offset of the source text which does not match the supplied format.
- *
+ *
* @param source The text to parse.
* @param pos On input, the position in the source to start parsing, on output, updated position.
* @param calendar The calendar into which to set parsed fields.
@@ -570,7 +570,7 @@ public class FastDateParser implements DateParser, Serializable {
return getLocaleSpecificStrategy(Calendar.ERA, definingCalendar);
case 'H': // Hour in day (0-23)
return HOUR_OF_DAY_STRATEGY;
- case 'K': // Hour in am/pm (0-11)
+ case 'K': // Hour in am/pm (0-11)
return HOUR_STRATEGY;
case 'M':
return width>=3 ?getLocaleSpecificStrategy(Calendar.MONTH, definingCalendar) :NUMBER_MONTH_STRATEGY;
@@ -636,7 +636,7 @@ public class FastDateParser implements DateParser, Serializable {
final ConcurrentMap<Locale, Strategy> cache = getCache(field);
Strategy strategy = cache.get(locale);
if (strategy == null) {
- strategy = field == Calendar.ZONE_OFFSET
+ strategy = field == Calendar.ZONE_OFFSET
? new TimeZoneStrategy(locale)
: new CaseInsensitiveTextStrategy(field, definingCalendar, locale);
final Strategy inCache = cache.putIfAbsent(locale, strategy);
@@ -705,7 +705,7 @@ public class FastDateParser implements DateParser, Serializable {
CaseInsensitiveTextStrategy(final int field, final Calendar definingCalendar, final Locale locale) {
this.field = field;
this.locale = locale;
-
+
final StringBuilder regex = new StringBuilder();
regex.append("((?iu)");
lKeyValues = appendDisplayNames(definingCalendar, locale, field, regex);
@@ -905,9 +905,9 @@ public class FastDateParser implements DateParser, Serializable {
}
}
}
-
+
private static class ISO8601TimeZoneStrategy extends PatternStrategy {
- // Z, +hh, -hh, +hhmm, -hhmm, +hh:mm or -hh:mm
+ // Z, +hh, -hh, +hhmm, -hhmm, +hh:mm or -hh:mm
/**
* Construct a Strategy that parses a TimeZone
@@ -916,7 +916,7 @@ public class FastDateParser implements DateParser, Serializable {
ISO8601TimeZoneStrategy(final String pattern) {
createPattern(pattern);
}
-
+
/**
* {@inheritDoc}
*/
@@ -928,14 +928,14 @@ public class FastDateParser implements DateParser, Serializable {
cal.setTimeZone(TimeZone.getTimeZone("GMT" + value));
}
}
-
+
private static final Strategy ISO_8601_1_STRATEGY = new ISO8601TimeZoneStrategy("(Z|(?:[+-]\\d{2}))");
private static final Strategy ISO_8601_2_STRATEGY = new ISO8601TimeZoneStrategy("(Z|(?:[+-]\\d{2}\\d{2}))");
private static final Strategy ISO_8601_3_STRATEGY = new ISO8601TimeZoneStrategy("(Z|(?:[+-]\\d{2}(?::)\\d{2}))");
/**
* Factory method for ISO8601TimeZoneStrategies.
- *
+ *
* @param tokenLen a token indicating the length of the TimeZone String to be formatted.
* @return a ISO8601TimeZoneStrategy that can format TimeZone String of length {@code tokenLen}. If no such
* strategy exists, an IllegalArgumentException will be thrown.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDatePrinter.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDatePrinter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDatePrinter.java
index 307b16c..4f33b6b 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDatePrinter.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDatePrinter.java
@@ -37,14 +37,14 @@ import org.apache.logging.log4j.core.util.Throwables;
* <p>FastDatePrinter is a fast and thread-safe version of
* {@link java.text.SimpleDateFormat}.</p>
*
- * <p>To obtain a FastDatePrinter, use {@link FastDateFormat#getInstance(String, TimeZone, Locale)}
+ * <p>To obtain a FastDatePrinter, use {@link FastDateFormat#getInstance(String, TimeZone, Locale)}
* or another variation of the factory methods of {@link FastDateFormat}.</p>
- *
+ *
* <p>Since FastDatePrinter is thread safe, you can use a static member instance:</p>
* <code>
* private static final DatePrinter DATE_PRINTER = FastDateFormat.getInstance("yyyy-MM-dd");
* </code>
- *
+ *
* <p>This class can be used as a direct replacement to
* {@code SimpleDateFormat} in most formatting situations.
* This class is especially useful in multi-threaded server environments.
@@ -63,7 +63,7 @@ import org.apache.logging.log4j.core.util.Throwables;
* ISO 8601 extended format time zones (eg. {@code +08:00} or {@code -11:00}).
* This introduces a minor incompatibility with Java 1.4, but at a gain of
* useful functionality.</p>
- *
+ *
* <p>Starting with JDK7, ISO 8601 support was added using the pattern {@code 'X'}.
* To maintain compatibility, {@code 'ZZ'} will continue to be supported, but using
* one of the {@code 'X'} formats is recommended.
@@ -73,11 +73,11 @@ import org.apache.logging.log4j.core.util.Throwables;
* interpreted as a number.</i> Starting with Java 1.7 a pattern of 'Y' or
* 'YYY' will be formatted as '2003', while it was '03' in former Java
* versions. FastDatePrinter implements the behavior of Java 7.</p>
- *
+ *
* <p>
* Copied and modified from <a href="https://commons.apache.org/proper/commons-lang/">Apache Commons Lang</a>.
* </p>
- *
+ *
* @since Apache Commons Lang 3.2
* @see FastDateParser
*/
@@ -143,7 +143,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
//-----------------------------------------------------------------------
/**
* <p>Constructs a new FastDatePrinter.</p>
- * Use {@link FastDateFormat#getInstance(String, TimeZone, Locale)} or another variation of the
+ * Use {@link FastDateFormat#getInstance(String, TimeZone, Locale)} or another variation of the
* factory methods of {@link FastDateFormat} to get a cached FastDatePrinter instance.
*
* @param pattern {@link java.text.SimpleDateFormat} compatible pattern
@@ -280,9 +280,9 @@ public class FastDatePrinter implements DatePrinter, Serializable {
case 'K': // hour in am/pm (0..11)
rule = selectNumberRule(Calendar.HOUR, tokenLen);
break;
- case 'X': // ISO 8601
+ case 'X': // ISO 8601
rule = Iso8601_Rule.getRule(tokenLen);
- break;
+ break;
case 'z': // time zone (text)
if (tokenLen >= 4) {
rule = new TimeZoneNameRule(mTimeZone, mLocale, TimeZone.LONG);
@@ -607,7 +607,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
}
final FastDatePrinter other = (FastDatePrinter) obj;
return mPattern.equals(other.mPattern)
- && mTimeZone.equals(other.mTimeZone)
+ && mTimeZone.equals(other.mTimeZone)
&& mLocale.equals(other.mLocale);
}
@@ -1322,7 +1322,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
TimeZoneNameRule(final TimeZone timeZone, final Locale locale, final int style) {
mLocale = locale;
mStyle = style;
-
+
mStandard = getTimeZoneDisplay(timeZone, false, style, locale);
mDaylight = getTimeZoneDisplay(timeZone, true, style, locale);
}
@@ -1359,7 +1359,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
private static class TimeZoneNumberRule implements Rule {
static final TimeZoneNumberRule INSTANCE_COLON = new TimeZoneNumberRule(true);
static final TimeZoneNumberRule INSTANCE_NO_COLON = new TimeZoneNumberRule(false);
-
+
final boolean mColon;
/**
@@ -1384,7 +1384,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
*/
@Override
public void appendTo(final Appendable buffer, final Calendar calendar) throws IOException {
-
+
int offset = calendar.get(Calendar.ZONE_OFFSET) + calendar.get(Calendar.DST_OFFSET);
if (offset < 0) {
@@ -1411,9 +1411,9 @@ public class FastDatePrinter implements DatePrinter, Serializable {
* or {@code +/-HH:MM}.</p>
*/
private static class Iso8601_Rule implements Rule {
-
+
// Sign TwoDigitHours or Z
- static final Iso8601_Rule ISO8601_HOURS = new Iso8601_Rule(3);
+ static final Iso8601_Rule ISO8601_HOURS = new Iso8601_Rule(3);
// Sign TwoDigitHours Minutes or Z
static final Iso8601_Rule ISO8601_HOURS_MINUTES = new Iso8601_Rule(5);
// Sign TwoDigitHours : Minutes or Z
@@ -1435,10 +1435,10 @@ public class FastDatePrinter implements DatePrinter, Serializable {
case 3:
return Iso8601_Rule.ISO8601_HOURS_COLON_MINUTES;
default:
- throw new IllegalArgumentException("invalid number of X");
+ throw new IllegalArgumentException("invalid number of X");
}
- }
-
+ }
+
final int length;
/**
@@ -1468,7 +1468,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
buffer.append("Z");
return;
}
-
+
if (offset < 0) {
buffer.append('-');
offset = -offset;
@@ -1482,7 +1482,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
if (length<5) {
return;
}
-
+
if (length==6) {
buffer.append(':');
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java
index f58a29b..f814b62 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java
@@ -539,11 +539,11 @@ public class FixedDateFormat {
1, // 5
};
- private void formatNanoOfMillisecond(final int nanoOfMillisecond, final char[] buffer, int pos) {
+ private void formatNanoOfMillisecond(int nanoOfMillisecond, final char[] buffer, int pos) {
int temp;
int remain = nanoOfMillisecond;
for (int i = 0; i < secondFractionDigits - FixedFormat.MILLI_FRACTION_DIGITS; i++) {
- final int divisor = TABLE[i];
+ int divisor = TABLE[i];
temp = remain / divisor;
buffer[pos++] = ((char) (temp + '0'));
remain -= divisor * temp; // equivalent of remain % 10
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FormatCache.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FormatCache.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FormatCache.java
index 92f001a..e146a1d 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FormatCache.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FormatCache.java
@@ -27,31 +27,31 @@ import java.util.concurrent.ConcurrentMap;
/**
* <p>FormatCache is a cache and factory for {@link Format}s.</p>
- *
+ *
* <p>
* Copied and modified from <a href="https://commons.apache.org/proper/commons-lang/">Apache Commons Lang</a>.
* </p>
- *
+ *
* @since Apache Commons Lang 3.0
*/
// TODO: Before making public move from getDateTimeInstance(Integer,...) to int; or some other approach.
abstract class FormatCache<F extends Format> {
-
+
/**
* No date or no time. Used in same parameters as DateFormat.SHORT or DateFormat.LONG
*/
static final int NONE= -1;
-
- private final ConcurrentMap<MultipartKey, F> cInstanceCache
+
+ private final ConcurrentMap<MultipartKey, F> cInstanceCache
= new ConcurrentHashMap<>(7);
-
- private static final ConcurrentMap<MultipartKey, String> cDateTimeInstanceCache
+
+ private static final ConcurrentMap<MultipartKey, String> cDateTimeInstanceCache
= new ConcurrentHashMap<>(7);
/**
* <p>Gets a formatter instance using the default pattern in the
* default timezone and locale.</p>
- *
+ *
* @return a date/time formatter
*/
public F getInstance() {
@@ -61,7 +61,7 @@ abstract class FormatCache<F extends Format> {
/**
* <p>Gets a formatter instance using the specified pattern, time zone
* and locale.</p>
- *
+ *
* @param pattern {@link java.text.SimpleDateFormat} compatible
* pattern, non-null
* @param timeZone the time zone, null means use the default TimeZone
@@ -82,22 +82,22 @@ abstract class FormatCache<F extends Format> {
}
final MultipartKey key = new MultipartKey(pattern, timeZone, locale);
F format = cInstanceCache.get(key);
- if (format == null) {
+ if (format == null) {
format = createInstance(pattern, timeZone, locale);
final F previousValue= cInstanceCache.putIfAbsent(key, format);
if (previousValue != null) {
// another thread snuck in and did the same work
// we should return the instance that is in ConcurrentMap
- format= previousValue;
+ format= previousValue;
}
}
return format;
}
-
+
/**
* <p>Create a format instance using the specified pattern, time zone
* and locale.</p>
- *
+ *
* @param pattern {@link java.text.SimpleDateFormat} compatible pattern, this will not be null.
* @param timeZone time zone, this will not be null.
* @param locale locale, this will not be null.
@@ -106,11 +106,11 @@ abstract class FormatCache<F extends Format> {
* or <code>null</code>
*/
abstract protected F createInstance(String pattern, TimeZone timeZone, Locale locale);
-
+
/**
* <p>Gets a date/time formatter instance using the specified style,
* time zone and locale.</p>
- *
+ *
* @param dateStyle date style: FULL, LONG, MEDIUM, or SHORT, null indicates no date in format
* @param timeStyle time style: FULL, LONG, MEDIUM, or SHORT, null indicates no time in format
* @param timeZone optional time zone, overrides time zone of
@@ -120,7 +120,7 @@ abstract class FormatCache<F extends Format> {
* @throws IllegalArgumentException if the Locale has no date/time
* pattern defined
*/
- // This must remain private, see LANG-884
+ // This must remain private, see LANG-884
private F getDateTimeInstance(final Integer dateStyle, final Integer timeStyle, final TimeZone timeZone, Locale locale) {
if (locale == null) {
locale = Locale.getDefault();
@@ -132,7 +132,7 @@ abstract class FormatCache<F extends Format> {
/**
* <p>Gets a date/time formatter instance using the specified style,
* time zone and locale.</p>
- *
+ *
* @param dateStyle date style: FULL, LONG, MEDIUM, or SHORT
* @param timeStyle time style: FULL, LONG, MEDIUM, or SHORT
* @param timeZone optional time zone, overrides time zone of
@@ -150,7 +150,7 @@ abstract class FormatCache<F extends Format> {
/**
* <p>Gets a date formatter instance using the specified style,
* time zone and locale.</p>
- *
+ *
* @param dateStyle date style: FULL, LONG, MEDIUM, or SHORT
* @param timeZone optional time zone, overrides time zone of
* formatted date, null means use default Locale
@@ -167,7 +167,7 @@ abstract class FormatCache<F extends Format> {
/**
* <p>Gets a time formatter instance using the specified style,
* time zone and locale.</p>
- *
+ *
* @param timeStyle time style: FULL, LONG, MEDIUM, or SHORT
* @param timeZone optional time zone, overrides time zone of
* formatted date, null means use default Locale
@@ -183,7 +183,7 @@ abstract class FormatCache<F extends Format> {
/**
* <p>Gets a date/time format for the specified styles and locale.</p>
- *
+ *
* @param dateStyle date style: FULL, LONG, MEDIUM, or SHORT, null indicates no date in format
* @param timeStyle time style: FULL, LONG, MEDIUM, or SHORT, null indicates no time in format
* @param locale The non-null locale of the desired format
@@ -199,10 +199,10 @@ abstract class FormatCache<F extends Format> {
try {
DateFormat formatter;
if (dateStyle == null) {
- formatter = DateFormat.getTimeInstance(timeStyle.intValue(), locale);
+ formatter = DateFormat.getTimeInstance(timeStyle.intValue(), locale);
}
else if (timeStyle == null) {
- formatter = DateFormat.getDateInstance(dateStyle.intValue(), locale);
+ formatter = DateFormat.getDateInstance(dateStyle.intValue(), locale);
}
else {
formatter = DateFormat.getDateTimeInstance(dateStyle.intValue(), timeStyle.intValue(), locale);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsTest.java
index 7a480f3..7bb7297 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsTest.java
@@ -36,10 +36,10 @@ import org.junit.Test;
public class CustomLevelsTest {
private static final String CONFIG = "log4j-customLevels.xml";
-
+
@ClassRule
public static LoggerContextRule context = new LoggerContextRule(CONFIG);
-
+
private ListAppender listAppender;
private Level diagLevel;
private Level noticeLevel;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/DeadlockTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/DeadlockTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/DeadlockTest.java
index 0e27cea..c3cc5b4 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/DeadlockTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/DeadlockTest.java
@@ -26,7 +26,7 @@ import org.junit.Test;
public class DeadlockTest {
private static final String CONFIG = "log4j-deadlock.xml";
-
+
@ClassRule
public static LoggerContextRule context = new LoggerContextRule(CONFIG);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/EventParameterMemoryLeakTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/EventParameterMemoryLeakTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/EventParameterMemoryLeakTest.java
index 0205720..9996f8b 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/EventParameterMemoryLeakTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/EventParameterMemoryLeakTest.java
@@ -50,7 +50,7 @@ public class EventParameterMemoryLeakTest {
assertTrue("Deleted old file before test", !file.exists() || file.delete());
final Logger log = LogManager.getLogger("com.foo.Bar");
- final CountDownLatch latch = new CountDownLatch(1);
+ CountDownLatch latch = new CountDownLatch(1);
Object parameter = new ParameterObject("paramValue", latch);
log.info("Message with parameter {}", parameter);
log.info(parameter);
@@ -71,7 +71,7 @@ public class EventParameterMemoryLeakTest {
assertThat(line3, containsString("paramValue"));
assertThat(line4, containsString("paramValue"));
assertNull("Expected only three lines", line5);
- final GarbageCollectionHelper gcHelper = new GarbageCollectionHelper();
+ GarbageCollectionHelper gcHelper = new GarbageCollectionHelper();
gcHelper.run();
try {
assertTrue("Parameter should have been garbage collected", latch.await(30, TimeUnit.SECONDS));
@@ -83,7 +83,7 @@ public class EventParameterMemoryLeakTest {
private static final class ParameterObject {
private final String value;
private final CountDownLatch latch;
- ParameterObject(final String value, final CountDownLatch latch) {
+ ParameterObject(String value, CountDownLatch latch) {
this.value = value;
this.latch = latch;
}
@@ -103,7 +103,7 @@ public class EventParameterMemoryLeakTest {
private static final class ObjectThrowable extends RuntimeException {
private final Object object;
- ObjectThrowable(final Object object) {
+ ObjectThrowable(Object object) {
super(String.valueOf(object));
this.object = object;
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/GarbageCollectionHelper.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/GarbageCollectionHelper.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/GarbageCollectionHelper.java
index 0e0c9ad..01b9d8a 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/GarbageCollectionHelper.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/GarbageCollectionHelper.java
@@ -40,7 +40,7 @@ final class GarbageCollectionHelper implements Closeable, Runnable {
try {
// 1mb of heap
sink.write(new byte[1024 * 1024]);
- } catch (final IOException ignored) {
+ } catch (IOException ignored) {
}
// May no-op depending on the jvm configuration
System.gc();
@@ -64,7 +64,7 @@ final class GarbageCollectionHelper implements Closeable, Runnable {
try {
assertTrue("GarbageCollectionHelper did not shut down cleanly",
latch.await(10, TimeUnit.SECONDS));
- } catch (final InterruptedException e) {
+ } catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/LateConfigTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/LateConfigTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/LateConfigTest.java
index 0421e18..03d1575 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/LateConfigTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/LateConfigTest.java
@@ -47,7 +47,7 @@ public class LateConfigTest {
public static void tearDownClass() {
Configurator.shutdown(context);
StatusLogger.getLogger().reset();
- }
+ }
@Test
public void testReconfiguration() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/LogEventTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/LogEventTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/LogEventTest.java
index 3aa0559..bd5ae3e 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/LogEventTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/LogEventTest.java
@@ -96,7 +96,7 @@ public class LogEventTest {
final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
final ObjectInputStream ois = new FilteredObjectInputStream(bais);
-
+
final LogEvent actual = (LogEvent) ois.readObject();
assertNotEquals("Different event: nanoTime", copy, actual);
assertNotEquals("Different nanoTime", copy.getNanoTime(), actual.getNanoTime());
@@ -123,7 +123,7 @@ public class LogEventTest {
final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
final ObjectInputStream ois = new FilteredObjectInputStream(bais);
-
+
final LogEvent actual = (LogEvent) ois.readObject();
assertEquals("both zero nanoTime", event2, actual);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/ReusableParameterizedMessageMemoryLeakTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/ReusableParameterizedMessageMemoryLeakTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/ReusableParameterizedMessageMemoryLeakTest.java
index c4d212d..c08f705 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/ReusableParameterizedMessageMemoryLeakTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/ReusableParameterizedMessageMemoryLeakTest.java
@@ -30,12 +30,12 @@ public class ReusableParameterizedMessageMemoryLeakTest {
@Test
@SuppressWarnings("UnusedAssignment") // parameter set to null to allow garbage collection
public void testParametersAreNotLeaked() throws Exception {
- final CountDownLatch latch = new CountDownLatch(1);
- final ReusableMessage message = (ReusableMessage) ReusableMessageFactory.INSTANCE.newMessage(
+ CountDownLatch latch = new CountDownLatch(1);
+ ReusableMessage message = (ReusableMessage) ReusableMessageFactory.INSTANCE.newMessage(
"foo {}", new ParameterObject("paramValue", latch));
// Large enough for the parameters, but smaller than the default reusable array size.
message.swapParameters(new Object[5]);
- final GarbageCollectionHelper gcHelper = new GarbageCollectionHelper();
+ GarbageCollectionHelper gcHelper = new GarbageCollectionHelper();
gcHelper.run();
try {
assertTrue("Parameter should have been garbage collected", latch.await(30, TimeUnit.SECONDS));
@@ -47,7 +47,7 @@ public class ReusableParameterizedMessageMemoryLeakTest {
private static final class ParameterObject {
private final String value;
private final CountDownLatch latch;
- ParameterObject(final String value, final CountDownLatch latch) {
+ ParameterObject(String value, CountDownLatch latch) {
this.value = value;
this.latch = latch;
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/TestPatternConverters.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/TestPatternConverters.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/TestPatternConverters.java
index 0f6fca9..5cba8e0 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/TestPatternConverters.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/TestPatternConverters.java
@@ -44,7 +44,7 @@ public final class TestPatternConverters {
@Override
public void format(final LogEvent event, final StringBuilder toAppendTo) {
toAppendTo.append('[');
- final Object[] parameters = event.getMessage().getParameters();
+ Object[] parameters = event.getMessage().getParameters();
if (parameters != null) {
for (int i = 0; i < parameters.length; i++) {
StringBuilders.appendValue(toAppendTo, parameters[i]);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderBuilderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderBuilderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderBuilderTest.java
index 1b28e85..d0ff679 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderBuilderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderBuilderTest.java
@@ -35,7 +35,7 @@ public class ConsoleAppenderBuilderTest {
/**
* Tests https://issues.apache.org/jira/browse/LOG4J2-1636
- *
+ *
* Tested with Oracle 7 and 8 and IBM Java 8.
*/
@Test
@@ -53,7 +53,7 @@ public class ConsoleAppenderBuilderTest {
@Test
public void testSetNullErrorHandlerIsNotAllowed() {
final ConsoleAppender appender = ConsoleAppender.newBuilder().setName("test").build();
- final ErrorHandler handler = appender.getHandler();
+ ErrorHandler handler = appender.getHandler();
Assert.assertNotNull(handler);
// This could likely be allowed to throw, but we're just testing that
// setting null does not actually set a null handler.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderDefaultSuppressedThrowable.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderDefaultSuppressedThrowable.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderDefaultSuppressedThrowable.java
index 7587bf6..8437232 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderDefaultSuppressedThrowable.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderDefaultSuppressedThrowable.java
@@ -30,7 +30,7 @@ import org.apache.logging.log4j.core.config.Configurator;
* <p>
* Running from a Windows command line from the root of the project:
* </p>
- *
+ *
* <pre>
* java -classpath log4j-core\target\test-classes;log4j-core\target\classes;log4j-api\target\classes;%HOME%\.m2\repository\org\fusesource\jansi\jansi\1.14\jansi-1.14.jar; org.apache.logging.log4j.core.appender.ConsoleAppenderNoAnsiStyleLayoutMain log4j-core/target/test-classes/log4j2-console-style-ansi.xml
* </pre>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderPermissionsTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderPermissionsTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderPermissionsTest.java
index 4cf9b7a..0c2ed98 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderPermissionsTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderPermissionsTest.java
@@ -130,7 +130,7 @@ public class FileAppenderPermissionsTest {
}
assertFalse("Appender did not stop", appender.isStarted());
}
-
+
@Test
public void testFileUserGroupAPI() throws Exception {
final File file = new File(DIR, "AppenderTest-" + (1000 + fileIndex) + ".log");
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderPermissionsXmlConfigTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderPermissionsXmlConfigTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderPermissionsXmlConfigTest.java
index 636c6c5..b041aa6 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderPermissionsXmlConfigTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderPermissionsXmlConfigTest.java
@@ -62,5 +62,5 @@ public class FileAppenderPermissionsXmlConfigTest {
Files.getPosixFilePermissions(Paths.get("target/permissions1/AppenderTest-1.log"))));
}
-
+
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/HangingAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/HangingAppender.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/HangingAppender.java
index bfc6963..5e063ee 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/HangingAppender.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/HangingAppender.java
@@ -41,7 +41,7 @@ public class HangingAppender extends AbstractAppender {
private final long shutdownDelay;
public HangingAppender(final String name, final long delay, final long startupDelay, final long shutdownDelay,
- final Property[] properties) {
+ Property[] properties) {
super(name, null, null, true, Property.EMPTY_ARRAY);
this.delay = delay;
this.startupDelay = startupDelay;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/HttpAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/HttpAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/HttpAppenderTest.java
index e5097d4..ad83d5b 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/HttpAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/HttpAppenderTest.java
@@ -164,7 +164,7 @@ public class HttpAppenderTest {
wireMockRule.stubFor(post(urlEqualTo("/test/log4j/"))
.willReturn(SUCCESS_RESPONSE));
- final Appender appender = HttpAppender.newBuilder().setName("Http").setLayout(JsonLayout.createDefaultLayout())
+ final Appender appender = HttpAppender.newBuilder().setName("Http").setLayout((Layout<? extends Serializable>) JsonLayout.createDefaultLayout())
.setConfiguration(ctx.getConfiguration())
.setUrl(new URL("http://localhost:" + wireMockRule.port() + "/test/log4j/"))
.build();
@@ -181,7 +181,7 @@ public class HttpAppenderTest {
wireMockRule.stubFor(post(urlEqualTo("/test/log4j/"))
.willReturn(SUCCESS_RESPONSE));
- final Appender appender = HttpAppender.newBuilder().setName("Http").setLayout(JsonLayout.createDefaultLayout())
+ final Appender appender = HttpAppender.newBuilder().setName("Http").setLayout((Layout<? extends Serializable>) JsonLayout.createDefaultLayout())
.setConfiguration(ctx.getConfiguration())
.setUrl(new URL("https://localhost:" + wireMockRule.httpsPort() + "/test/log4j/"))
.setSslConfiguration(SslConfiguration.createSSLConfiguration(null,
@@ -202,7 +202,7 @@ public class HttpAppenderTest {
wireMockRule.stubFor(put(urlEqualTo("/test/log4j/1234"))
.willReturn(SUCCESS_RESPONSE));
- final Appender appender = HttpAppender.newBuilder().setName("Http").setLayout(JsonLayout.createDefaultLayout())
+ final Appender appender = HttpAppender.newBuilder().setName("Http").setLayout((Layout<? extends Serializable>) JsonLayout.createDefaultLayout())
.setConfiguration(ctx.getConfiguration())
.setMethod("PUT")
.setUrl(new URL("http://localhost:" + wireMockRule.port() + "/test/log4j/1234"))
@@ -220,7 +220,7 @@ public class HttpAppenderTest {
wireMockRule.stubFor(post(urlEqualTo("/test/log4j/"))
.willReturn(SUCCESS_RESPONSE));
- final Appender appender = HttpAppender.newBuilder().setName("Http").setLayout(JsonLayout.createDefaultLayout())
+ final Appender appender = HttpAppender.newBuilder().setName("Http").setLayout((Layout<? extends Serializable>) JsonLayout.createDefaultLayout())
.setConfiguration(ctx.getConfiguration())
.setUrl(new URL("http://localhost:" + wireMockRule.port() + "/test/log4j/"))
.setHeaders(new Property[] {
@@ -262,7 +262,7 @@ public class HttpAppenderTest {
error = null;
- final Appender appender = HttpAppender.newBuilder().setName("Http").setLayout(JsonLayout.createDefaultLayout())
+ final Appender appender = HttpAppender.newBuilder().setName("Http").setLayout((Layout<? extends Serializable>) JsonLayout.createDefaultLayout())
.setConfiguration(ctx.getConfiguration())
.setUrl(new URL("http://localhost:" + wireMockRule.port() + "/test/log4j/"))
.build();
@@ -283,7 +283,7 @@ public class HttpAppenderTest {
wireMockRule.stubFor(post(urlEqualTo("/test/log4j/"))
.willReturn(FAILURE_RESPONSE));
- final Appender appender = HttpAppender.newBuilder().setName("Http").setLayout(JsonLayout.createDefaultLayout())
+ final Appender appender = HttpAppender.newBuilder().setName("Http").setLayout((Layout<? extends Serializable>) JsonLayout.createDefaultLayout())
.setConfiguration(ctx.getConfiguration()).setIgnoreExceptions(false)
.setUrl(new URL("http://localhost:" + wireMockRule.port() + "/test/log4j/"))
.build();
@@ -292,7 +292,7 @@ public class HttpAppenderTest {
@Test(expected = AppenderLoggingException.class)
public void testAppendConnectError() throws Exception {
- final Appender appender = HttpAppender.newBuilder().setName("Http").setLayout(JsonLayout.createDefaultLayout())
+ final Appender appender = HttpAppender.newBuilder().setName("Http").setLayout((Layout<? extends Serializable>) JsonLayout.createDefaultLayout())
.setConfiguration(ctx.getConfiguration()).setIgnoreExceptions(false)
.setUrl(new URL("http://localhost:"+(wireMockRule.port()+1)+"/test/log4j/"))
.build();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/Jira739Test.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/Jira739Test.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/Jira739Test.java
index bfb233e..f46af07 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/Jira739Test.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/Jira739Test.java
@@ -27,7 +27,7 @@ import org.apache.logging.log4j.core.config.Configurator;
* <p>
* Running from a Windows command line from the root of the project:
* </p>
- *
+ *
* <pre>
* java -classpath log4j-core\target\test-classes;log4j-core\target\classes;log4j-api\target\classes;%HOME%\.m2\repository\org\fusesource\jansi\jansi\1.14\jansi-1.14.jar; org.apache.logging.log4j.core.appender.ConsoleAppenderAnsiMessagesMain log4j-core/target/test-classes/log4j2-console.xml
* </pre>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/JsonCompleteFileAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/JsonCompleteFileAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/JsonCompleteFileAppenderTest.java
index dd2d100..323ca13 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/JsonCompleteFileAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/JsonCompleteFileAppenderTest.java
@@ -16,13 +16,16 @@
*/
package org.apache.logging.log4j.core.appender;
+import java.io.BufferedReader;
import java.io.File;
+import java.io.FileReader;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.util.List;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.categories.Layouts;
+import org.apache.logging.log4j.core.filter.TimeFilterTest;
import org.apache.logging.log4j.core.impl.Log4jLogEventTest;
import org.apache.logging.log4j.core.selector.ContextSelector;
import org.apache.logging.log4j.core.selector.CoreContextSelectors;
@@ -84,9 +87,9 @@ public class JsonCompleteFileAppenderTest {
logger.error(logMsg, new IllegalArgumentException("badarg"));
this.loggerContextRule.getLoggerContext().stop(); // stops async thread
- final List<String> lines = Files.readAllLines(logFile.toPath(), Charset.forName("UTF8"));
+ List<String> lines = Files.readAllLines(logFile.toPath(), Charset.forName("UTF8"));
- final String[] expected = {
+ String[] expected = {
"[", // equals
"{", // equals
" \"thread\" : \"main\",", //
@@ -101,7 +104,7 @@ public class JsonCompleteFileAppenderTest {
" },", //
};
for (int i = 0; i < expected.length; i++) {
- final String line = lines.get(i);
+ String line = lines.get(i);
assertTrue("line " + i + " incorrect: [" + line + "], does not contain: [" + expected[i] + ']', line.contains(expected[i]));
}
final String location = "testFlushAtEndOfBatch";
[07/13] logging-log4j2 git commit: Revert "Use final. Remove trailing
spaces."
Posted by gg...@apache.org.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/tools/Generate.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/tools/Generate.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/tools/Generate.java
index cf49a53..0fca21e 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/tools/Generate.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/tools/Generate.java
@@ -55,17 +55,17 @@ public final class Generate {
@Override
String imports() {
//@formatter:off
- return ""
- + "import java.io.Serializable;%n"
- + "import org.apache.logging.log4j.Level;%n"
- + "import org.apache.logging.log4j.LogManager;%n"
- + "import org.apache.logging.log4j.Logger;%n"
- + "import org.apache.logging.log4j.Marker;%n"
- + "import org.apache.logging.log4j.message.Message;%n"
- + "import org.apache.logging.log4j.message.MessageFactory;%n"
- + "import org.apache.logging.log4j.spi.AbstractLogger;%n"
- + "import org.apache.logging.log4j.spi.ExtendedLoggerWrapper;%n"
- + "import org.apache.logging.log4j.util.MessageSupplier;%n"
+ return ""
+ + "import java.io.Serializable;%n"
+ + "import org.apache.logging.log4j.Level;%n"
+ + "import org.apache.logging.log4j.LogManager;%n"
+ + "import org.apache.logging.log4j.Logger;%n"
+ + "import org.apache.logging.log4j.Marker;%n"
+ + "import org.apache.logging.log4j.message.Message;%n"
+ + "import org.apache.logging.log4j.message.MessageFactory;%n"
+ + "import org.apache.logging.log4j.spi.AbstractLogger;%n"
+ + "import org.apache.logging.log4j.spi.ExtendedLoggerWrapper;%n"
+ + "import org.apache.logging.log4j.util.MessageSupplier;%n"
+ "import org.apache.logging.log4j.util.Supplier;%n"
+ "%n";
//@formatter:on
@@ -74,15 +74,15 @@ public final class Generate {
@Override
String declaration() {
//@formatter:off
- return ""
- + "/**%n"
- + " * Custom Logger interface with convenience methods for%n"
- + " * %s%n"
- + " * <p>Compatible with Log4j 2.6 or higher.</p>%n"
- + " */%n"
- + "public final class %s implements Serializable {%n"
- + " private static final long serialVersionUID = " + System.nanoTime() + "L;%n"
- + " private final ExtendedLoggerWrapper logger;%n"
+ return ""
+ + "/**%n"
+ + " * Custom Logger interface with convenience methods for%n"
+ + " * %s%n"
+ + " * <p>Compatible with Log4j 2.6 or higher.</p>%n"
+ + " */%n"
+ + "public final class %s implements Serializable {%n"
+ + " private static final long serialVersionUID = " + System.nanoTime() + "L;%n"
+ + " private final ExtendedLoggerWrapper logger;%n"
+ "%n";
//@formatter:on
}
@@ -90,11 +90,11 @@ public final class Generate {
@Override
String constructor() {
//@formatter:off
- return ""
- + "%n"
- + " private %s(final Logger logger) {%n"
+ return ""
+ + "%n"
+ + " private %s(final Logger logger) {%n"
+ " this.logger = new ExtendedLoggerWrapper((AbstractLogger) logger, logger.getName(), "
- + "logger.getMessageFactory());%n"
+ + "logger.getMessageFactory());%n"
+ " }%n";
//@formatter:on
}
@@ -108,16 +108,16 @@ public final class Generate {
@Override
String imports() {
//@formatter:off
- return ""
- + "import org.apache.logging.log4j.Level;%n"
- + "import org.apache.logging.log4j.LogManager;%n"
- + "import org.apache.logging.log4j.Logger;%n"
- + "import org.apache.logging.log4j.Marker;%n"
- + "import org.apache.logging.log4j.message.Message;%n"
- + "import org.apache.logging.log4j.message.MessageFactory;%n"
- + "import org.apache.logging.log4j.spi.AbstractLogger;%n"
- + "import org.apache.logging.log4j.spi.ExtendedLoggerWrapper;%n"
- + "import org.apache.logging.log4j.util.MessageSupplier;%n"
+ return ""
+ + "import org.apache.logging.log4j.Level;%n"
+ + "import org.apache.logging.log4j.LogManager;%n"
+ + "import org.apache.logging.log4j.Logger;%n"
+ + "import org.apache.logging.log4j.Marker;%n"
+ + "import org.apache.logging.log4j.message.Message;%n"
+ + "import org.apache.logging.log4j.message.MessageFactory;%n"
+ + "import org.apache.logging.log4j.spi.AbstractLogger;%n"
+ + "import org.apache.logging.log4j.spi.ExtendedLoggerWrapper;%n"
+ + "import org.apache.logging.log4j.util.MessageSupplier;%n"
+ "import org.apache.logging.log4j.util.Supplier;%n"
+ "%n";
//@formatter:on
@@ -126,15 +126,15 @@ public final class Generate {
@Override
String declaration() {
//@formatter:off
- return ""
- + "/**%n"
- + " * Extended Logger interface with convenience methods for%n"
- + " * %s%n"
- + " * <p>Compatible with Log4j 2.6 or higher.</p>%n"
- + " */%n"
- + "public final class %s extends ExtendedLoggerWrapper {%n"
- + " private static final long serialVersionUID = " + System.nanoTime() + "L;%n"
- + " private final ExtendedLoggerWrapper logger;%n"
+ return ""
+ + "/**%n"
+ + " * Extended Logger interface with convenience methods for%n"
+ + " * %s%n"
+ + " * <p>Compatible with Log4j 2.6 or higher.</p>%n"
+ + " */%n"
+ + "public final class %s extends ExtendedLoggerWrapper {%n"
+ + " private static final long serialVersionUID = " + System.nanoTime() + "L;%n"
+ + " private final ExtendedLoggerWrapper logger;%n"
+ "%n";
//@formatter:on
}
@@ -142,11 +142,11 @@ public final class Generate {
@Override
String constructor() {
//@formatter:off
- return ""
- + "%n"
- + " private %s(final Logger logger) {%n"
- + " super((AbstractLogger) logger, logger.getName(), logger.getMessageFactory());%n"
- + " this.logger = this;%n"
+ return ""
+ + "%n"
+ + " private %s(final Logger logger) {%n"
+ + " super((AbstractLogger) logger, logger.getName(), logger.getMessageFactory());%n"
+ + " this.logger = this;%n"
+ " }%n";
//@formatter:on
}
@@ -165,826 +165,826 @@ public final class Generate {
abstract Class<?> generator();
}
- static final String FQCN_FIELD = ""
+ static final String FQCN_FIELD = ""
+ " private static final String FQCN = %s.class.getName();%n";
- static final String LEVEL_FIELD = ""
+ static final String LEVEL_FIELD = ""
+ " private static final Level %s = Level.forName(\"%s\", %d);%n";
- static final String FACTORY_METHODS = ""
+ static final String FACTORY_METHODS = ""
//@formatter:off
- + "%n"
- + " /**%n"
- + " * Returns a custom Logger with the name of the calling class.%n"
- + " * %n"
- + " * @return The custom Logger for the calling class.%n"
- + " */%n"
- + " public static CLASSNAME create() {%n"
- + " final Logger wrapped = LogManager.getLogger();%n"
- + " return new CLASSNAME(wrapped);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Returns a custom Logger using the fully qualified name of the Class as%n"
- + " * the Logger name.%n"
- + " * %n"
- + " * @param loggerName The Class whose name should be used as the Logger name.%n"
- + " * If null it will default to the calling class.%n"
- + " * @return The custom Logger.%n"
- + " */%n"
- + " public static CLASSNAME create(final Class<?> loggerName) {%n"
- + " final Logger wrapped = LogManager.getLogger(loggerName);%n"
- + " return new CLASSNAME(wrapped);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Returns a custom Logger using the fully qualified name of the Class as%n"
- + " * the Logger name.%n"
- + " * %n"
- + " * @param loggerName The Class whose name should be used as the Logger name.%n"
- + " * If null it will default to the calling class.%n"
- + " * @param messageFactory The message factory is used only when creating a%n"
- + " * logger, subsequent use does not change the logger but will log%n"
- + " * a warning if mismatched.%n"
- + " * @return The custom Logger.%n"
- + " */%n"
- + " public static CLASSNAME create(final Class<?> loggerName, final MessageFactory"
- + " messageFactory) {%n"
- + " final Logger wrapped = LogManager.getLogger(loggerName, messageFactory);%n"
- + " return new CLASSNAME(wrapped);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Returns a custom Logger using the fully qualified class name of the value%n"
- + " * as the Logger name.%n"
- + " * %n"
- + " * @param value The value whose class name should be used as the Logger%n"
- + " * name. If null the name of the calling class will be used as%n"
- + " * the logger name.%n"
- + " * @return The custom Logger.%n"
- + " */%n"
- + " public static CLASSNAME create(final Object value) {%n"
- + " final Logger wrapped = LogManager.getLogger(value);%n"
- + " return new CLASSNAME(wrapped);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Returns a custom Logger using the fully qualified class name of the value%n"
- + " * as the Logger name.%n"
- + " * %n"
- + " * @param value The value whose class name should be used as the Logger%n"
- + " * name. If null the name of the calling class will be used as%n"
- + " * the logger name.%n"
- + " * @param messageFactory The message factory is used only when creating a%n"
- + " * logger, subsequent use does not change the logger but will log%n"
- + " * a warning if mismatched.%n"
- + " * @return The custom Logger.%n"
- + " */%n"
- + " public static CLASSNAME create(final Object value, final MessageFactory messageFactory) {%n"
- + " final Logger wrapped = LogManager.getLogger(value, messageFactory);%n"
- + " return new CLASSNAME(wrapped);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Returns a custom Logger with the specified name.%n"
- + " * %n"
- + " * @param name The logger name. If null the name of the calling class will%n"
- + " * be used.%n"
- + " * @return The custom Logger.%n"
- + " */%n"
- + " public static CLASSNAME create(final String name) {%n"
- + " final Logger wrapped = LogManager.getLogger(name);%n"
- + " return new CLASSNAME(wrapped);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Returns a custom Logger with the specified name.%n"
- + " * %n"
- + " * @param name The logger name. If null the name of the calling class will%n"
- + " * be used.%n"
- + " * @param messageFactory The message factory is used only when creating a%n"
- + " * logger, subsequent use does not change the logger but will log%n"
- + " * a warning if mismatched.%n"
- + " * @return The custom Logger.%n"
- + " */%n"
- + " public static CLASSNAME create(final String name, final MessageFactory messageFactory) {%n"
- + " final Logger wrapped = LogManager.getLogger(name, messageFactory);%n"
- + " return new CLASSNAME(wrapped);%n"
+ + "%n"
+ + " /**%n"
+ + " * Returns a custom Logger with the name of the calling class.%n"
+ + " * %n"
+ + " * @return The custom Logger for the calling class.%n"
+ + " */%n"
+ + " public static CLASSNAME create() {%n"
+ + " final Logger wrapped = LogManager.getLogger();%n"
+ + " return new CLASSNAME(wrapped);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Returns a custom Logger using the fully qualified name of the Class as%n"
+ + " * the Logger name.%n"
+ + " * %n"
+ + " * @param loggerName The Class whose name should be used as the Logger name.%n"
+ + " * If null it will default to the calling class.%n"
+ + " * @return The custom Logger.%n"
+ + " */%n"
+ + " public static CLASSNAME create(final Class<?> loggerName) {%n"
+ + " final Logger wrapped = LogManager.getLogger(loggerName);%n"
+ + " return new CLASSNAME(wrapped);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Returns a custom Logger using the fully qualified name of the Class as%n"
+ + " * the Logger name.%n"
+ + " * %n"
+ + " * @param loggerName The Class whose name should be used as the Logger name.%n"
+ + " * If null it will default to the calling class.%n"
+ + " * @param messageFactory The message factory is used only when creating a%n"
+ + " * logger, subsequent use does not change the logger but will log%n"
+ + " * a warning if mismatched.%n"
+ + " * @return The custom Logger.%n"
+ + " */%n"
+ + " public static CLASSNAME create(final Class<?> loggerName, final MessageFactory"
+ + " messageFactory) {%n"
+ + " final Logger wrapped = LogManager.getLogger(loggerName, messageFactory);%n"
+ + " return new CLASSNAME(wrapped);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Returns a custom Logger using the fully qualified class name of the value%n"
+ + " * as the Logger name.%n"
+ + " * %n"
+ + " * @param value The value whose class name should be used as the Logger%n"
+ + " * name. If null the name of the calling class will be used as%n"
+ + " * the logger name.%n"
+ + " * @return The custom Logger.%n"
+ + " */%n"
+ + " public static CLASSNAME create(final Object value) {%n"
+ + " final Logger wrapped = LogManager.getLogger(value);%n"
+ + " return new CLASSNAME(wrapped);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Returns a custom Logger using the fully qualified class name of the value%n"
+ + " * as the Logger name.%n"
+ + " * %n"
+ + " * @param value The value whose class name should be used as the Logger%n"
+ + " * name. If null the name of the calling class will be used as%n"
+ + " * the logger name.%n"
+ + " * @param messageFactory The message factory is used only when creating a%n"
+ + " * logger, subsequent use does not change the logger but will log%n"
+ + " * a warning if mismatched.%n"
+ + " * @return The custom Logger.%n"
+ + " */%n"
+ + " public static CLASSNAME create(final Object value, final MessageFactory messageFactory) {%n"
+ + " final Logger wrapped = LogManager.getLogger(value, messageFactory);%n"
+ + " return new CLASSNAME(wrapped);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Returns a custom Logger with the specified name.%n"
+ + " * %n"
+ + " * @param name The logger name. If null the name of the calling class will%n"
+ + " * be used.%n"
+ + " * @return The custom Logger.%n"
+ + " */%n"
+ + " public static CLASSNAME create(final String name) {%n"
+ + " final Logger wrapped = LogManager.getLogger(name);%n"
+ + " return new CLASSNAME(wrapped);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Returns a custom Logger with the specified name.%n"
+ + " * %n"
+ + " * @param name The logger name. If null the name of the calling class will%n"
+ + " * be used.%n"
+ + " * @param messageFactory The message factory is used only when creating a%n"
+ + " * logger, subsequent use does not change the logger but will log%n"
+ + " * a warning if mismatched.%n"
+ + " * @return The custom Logger.%n"
+ + " */%n"
+ + " public static CLASSNAME create(final String name, final MessageFactory messageFactory) {%n"
+ + " final Logger wrapped = LogManager.getLogger(name, messageFactory);%n"
+ + " return new CLASSNAME(wrapped);%n"
+ " }%n";
//@formatter:on
- static final String METHODS = ""
+ static final String METHODS = ""
//@formatter:off
- + "%n"
- + " /**%n"
- + " * Logs a message with the specific Marker at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param marker the marker data specific to this log statement%n"
- + " * @param msg the message string to be logged%n"
- + " */%n"
- + " public void methodName(final Marker marker, final Message msg) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, msg, (Throwable) null);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with the specific Marker at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param marker the marker data specific to this log statement%n"
- + " * @param msg the message string to be logged%n"
- + " * @param t A Throwable or null.%n"
- + " */%n"
- + " public void methodName(final Marker marker, final Message msg, final Throwable t) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, msg, t);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message object with the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param marker the marker data specific to this log statement%n"
- + " * @param message the message object to log.%n"
- + " */%n"
- + " public void methodName(final Marker marker, final Object message) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, (Throwable) null);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message CharSequence with the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param marker the marker data specific to this log statement%n"
- + " * @param message the message CharSequence to log.%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final Marker marker, final CharSequence message) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, (Throwable) null);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message at the {@code CUSTOM_LEVEL} level including the stack trace of%n"
- + " * the {@link Throwable} {@code t} passed as parameter.%n"
- + " * %n"
- + " * @param marker the marker data specific to this log statement%n"
- + " * @param message the message to log.%n"
- + " * @param t the exception to log, including its stack trace.%n"
- + " */%n"
- + " public void methodName(final Marker marker, final Object message, final Throwable t) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, t);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message at the {@code CUSTOM_LEVEL} level including the stack trace of%n"
- + " * the {@link Throwable} {@code t} passed as parameter.%n"
- + " * %n"
- + " * @param marker the marker data specific to this log statement%n"
- + " * @param message the CharSequence to log.%n"
- + " * @param t the exception to log, including its stack trace.%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final Marker marker, final CharSequence message, final Throwable t) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, t);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message object with the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param marker the marker data specific to this log statement%n"
- + " * @param message the message object to log.%n"
- + " */%n"
- + " public void methodName(final Marker marker, final String message) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, (Throwable) null);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param marker the marker data specific to this log statement%n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param params parameters to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " */%n"
- + " public void methodName(final Marker marker, final String message, final Object... params) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, params);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param marker the marker data specific to this log statement%n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final Marker marker, final String message, final Object p0) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param marker the marker data specific to this log statement%n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @param p1 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final Marker marker, final String message, final Object p0, "
- + "final Object p1) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0, p1);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param marker the marker data specific to this log statement%n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @param p1 parameter to the message.%n"
- + " * @param p2 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final Marker marker, final String message, final Object p0, "
- + "final Object p1, final Object p2) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0, p1, p2);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param marker the marker data specific to this log statement%n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @param p1 parameter to the message.%n"
- + " * @param p2 parameter to the message.%n"
- + " * @param p3 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final Marker marker, final String message, final Object p0, "
- + "final Object p1, final Object p2,%n"
- + " final Object p3) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0, p1, p2, p3);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param marker the marker data specific to this log statement%n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @param p1 parameter to the message.%n"
- + " * @param p2 parameter to the message.%n"
- + " * @param p3 parameter to the message.%n"
- + " * @param p4 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final Marker marker, final String message, final Object p0, "
- + "final Object p1, final Object p2,%n"
- + " final Object p3, final Object p4) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0, p1, p2, p3, p4);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param marker the marker data specific to this log statement%n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @param p1 parameter to the message.%n"
- + " * @param p2 parameter to the message.%n"
- + " * @param p3 parameter to the message.%n"
- + " * @param p4 parameter to the message.%n"
- + " * @param p5 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final Marker marker, final String message, final Object p0, "
- + "final Object p1, final Object p2,%n"
- + " final Object p3, final Object p4, final Object p5) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0, p1, p2, p3, p4, p5);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param marker the marker data specific to this log statement%n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @param p1 parameter to the message.%n"
- + " * @param p2 parameter to the message.%n"
- + " * @param p3 parameter to the message.%n"
- + " * @param p4 parameter to the message.%n"
- + " * @param p5 parameter to the message.%n"
- + " * @param p6 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final Marker marker, final String message, final Object p0, "
- + "final Object p1, final Object p2,%n"
- + " final Object p3, final Object p4, final Object p5, final Object p6) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0, p1, p2, p3, p4, p5, p6);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param marker the marker data specific to this log statement%n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @param p1 parameter to the message.%n"
- + " * @param p2 parameter to the message.%n"
- + " * @param p3 parameter to the message.%n"
- + " * @param p4 parameter to the message.%n"
- + " * @param p5 parameter to the message.%n"
- + " * @param p6 parameter to the message.%n"
- + " * @param p7 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final Marker marker, final String message, final Object p0, "
- + "final Object p1, final Object p2,%n"
- + " final Object p3, final Object p4, final Object p5, final Object p6,%n"
- + " final Object p7) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param marker the marker data specific to this log statement%n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @param p1 parameter to the message.%n"
- + " * @param p2 parameter to the message.%n"
- + " * @param p3 parameter to the message.%n"
- + " * @param p4 parameter to the message.%n"
- + " * @param p5 parameter to the message.%n"
- + " * @param p6 parameter to the message.%n"
- + " * @param p7 parameter to the message.%n"
- + " * @param p8 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final Marker marker, final String message, final Object p0, "
- + "final Object p1, final Object p2,%n"
- + " final Object p3, final Object p4, final Object p5, final Object p6,%n"
- + " final Object p7, final Object p8) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, "
- + "p8);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param marker the marker data specific to this log statement%n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @param p1 parameter to the message.%n"
- + " * @param p2 parameter to the message.%n"
- + " * @param p3 parameter to the message.%n"
- + " * @param p4 parameter to the message.%n"
- + " * @param p5 parameter to the message.%n"
- + " * @param p6 parameter to the message.%n"
- + " * @param p7 parameter to the message.%n"
- + " * @param p8 parameter to the message.%n"
- + " * @param p9 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final Marker marker, final String message, final Object p0, "
- + "final Object p1, final Object p2,%n"
- + " final Object p3, final Object p4, final Object p5, final Object p6,%n"
- + " final Object p7, final Object p8, final Object p9) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, "
- + "p8, p9);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message at the {@code CUSTOM_LEVEL} level including the stack trace of%n"
- + " * the {@link Throwable} {@code t} passed as parameter.%n"
- + " * %n"
- + " * @param marker the marker data specific to this log statement%n"
- + " * @param message the message to log.%n"
- + " * @param t the exception to log, including its stack trace.%n"
- + " */%n"
- + " public void methodName(final Marker marker, final String message, final Throwable t) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, t);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs the specified Message at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param msg the message string to be logged%n"
- + " */%n"
- + " public void methodName(final Message msg) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, msg, (Throwable) null);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs the specified Message at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param msg the message string to be logged%n"
- + " * @param t A Throwable or null.%n"
- + " */%n"
- + " public void methodName(final Message msg, final Throwable t) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, msg, t);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message object with the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param message the message object to log.%n"
- + " */%n"
- + " public void methodName(final Object message) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, (Throwable) null);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message at the {@code CUSTOM_LEVEL} level including the stack trace of%n"
- + " * the {@link Throwable} {@code t} passed as parameter.%n"
- + " * %n"
- + " * @param message the message to log.%n"
- + " * @param t the exception to log, including its stack trace.%n"
- + " */%n"
- + " public void methodName(final Object message, final Throwable t) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, t);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message CharSequence with the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param message the message CharSequence to log.%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final CharSequence message) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, (Throwable) null);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a CharSequence at the {@code CUSTOM_LEVEL} level including the stack trace of%n"
- + " * the {@link Throwable} {@code t} passed as parameter.%n"
- + " * %n"
- + " * @param message the CharSequence to log.%n"
- + " * @param t the exception to log, including its stack trace.%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final CharSequence message, final Throwable t) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, t);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message object with the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param message the message object to log.%n"
- + " */%n"
- + " public void methodName(final String message) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, (Throwable) null);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param params parameters to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " */%n"
- + " public void methodName(final String message, final Object... params) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, params);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final String message, final Object p0) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @param p1 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final String message, final Object p0, "
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with the specific Marker at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param marker the marker data specific to this log statement%n"
+ + " * @param msg the message string to be logged%n"
+ + " */%n"
+ + " public void methodName(final Marker marker, final Message msg) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, msg, (Throwable) null);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with the specific Marker at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param marker the marker data specific to this log statement%n"
+ + " * @param msg the message string to be logged%n"
+ + " * @param t A Throwable or null.%n"
+ + " */%n"
+ + " public void methodName(final Marker marker, final Message msg, final Throwable t) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, msg, t);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message object with the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param marker the marker data specific to this log statement%n"
+ + " * @param message the message object to log.%n"
+ + " */%n"
+ + " public void methodName(final Marker marker, final Object message) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, (Throwable) null);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message CharSequence with the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param marker the marker data specific to this log statement%n"
+ + " * @param message the message CharSequence to log.%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final Marker marker, final CharSequence message) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, (Throwable) null);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message at the {@code CUSTOM_LEVEL} level including the stack trace of%n"
+ + " * the {@link Throwable} {@code t} passed as parameter.%n"
+ + " * %n"
+ + " * @param marker the marker data specific to this log statement%n"
+ + " * @param message the message to log.%n"
+ + " * @param t the exception to log, including its stack trace.%n"
+ + " */%n"
+ + " public void methodName(final Marker marker, final Object message, final Throwable t) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, t);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message at the {@code CUSTOM_LEVEL} level including the stack trace of%n"
+ + " * the {@link Throwable} {@code t} passed as parameter.%n"
+ + " * %n"
+ + " * @param marker the marker data specific to this log statement%n"
+ + " * @param message the CharSequence to log.%n"
+ + " * @param t the exception to log, including its stack trace.%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final Marker marker, final CharSequence message, final Throwable t) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, t);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message object with the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param marker the marker data specific to this log statement%n"
+ + " * @param message the message object to log.%n"
+ + " */%n"
+ + " public void methodName(final Marker marker, final String message) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, (Throwable) null);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param marker the marker data specific to this log statement%n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param params parameters to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " */%n"
+ + " public void methodName(final Marker marker, final String message, final Object... params) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, params);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param marker the marker data specific to this log statement%n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final Marker marker, final String message, final Object p0) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param marker the marker data specific to this log statement%n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @param p1 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final Marker marker, final String message, final Object p0, "
+ "final Object p1) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0, p1);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @param p1 parameter to the message.%n"
- + " * @param p2 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final String message, final Object p0, "
- + "final Object p1, final Object p2) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0, p1, p2);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @param p1 parameter to the message.%n"
- + " * @param p2 parameter to the message.%n"
- + " * @param p3 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final String message, final Object p0, "
- + "final Object p1, final Object p2,%n"
- + " final Object p3) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0, p1, p2, p3);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @param p1 parameter to the message.%n"
- + " * @param p2 parameter to the message.%n"
- + " * @param p3 parameter to the message.%n"
- + " * @param p4 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final String message, final Object p0, "
- + "final Object p1, final Object p2,%n"
- + " final Object p3, final Object p4) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0, p1, p2, p3, p4);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @param p1 parameter to the message.%n"
- + " * @param p2 parameter to the message.%n"
- + " * @param p3 parameter to the message.%n"
- + " * @param p4 parameter to the message.%n"
- + " * @param p5 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final String message, final Object p0, "
- + "final Object p1, final Object p2,%n"
- + " final Object p3, final Object p4, final Object p5) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0, p1, p2, p3, p4, p5);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @param p1 parameter to the message.%n"
- + " * @param p2 parameter to the message.%n"
- + " * @param p3 parameter to the message.%n"
- + " * @param p4 parameter to the message.%n"
- + " * @param p5 parameter to the message.%n"
- + " * @param p6 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final String message, final Object p0, "
- + "final Object p1, final Object p2,%n"
- + " final Object p3, final Object p4, final Object p5, final Object p6) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0, p1, p2, p3, p4, p5, p6);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @param p1 parameter to the message.%n"
- + " * @param p2 parameter to the message.%n"
- + " * @param p3 parameter to the message.%n"
- + " * @param p4 parameter to the message.%n"
- + " * @param p5 parameter to the message.%n"
- + " * @param p6 parameter to the message.%n"
- + " * @param p7 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final String message, final Object p0, "
- + "final Object p1, final Object p2,%n"
- + " final Object p3, final Object p4, final Object p5, final Object p6,%n"
- + " final Object p7) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0, p1, p2, p3, p4, p5, p6, p7);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0, p1);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param marker the marker data specific to this log statement%n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @param p1 parameter to the message.%n"
+ + " * @param p2 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final Marker marker, final String message, final Object p0, "
+ + "final Object p1, final Object p2) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0, p1, p2);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param marker the marker data specific to this log statement%n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @param p1 parameter to the message.%n"
+ + " * @param p2 parameter to the message.%n"
+ + " * @param p3 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final Marker marker, final String message, final Object p0, "
+ + "final Object p1, final Object p2,%n"
+ + " final Object p3) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0, p1, p2, p3);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param marker the marker data specific to this log statement%n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @param p1 parameter to the message.%n"
+ + " * @param p2 parameter to the message.%n"
+ + " * @param p3 parameter to the message.%n"
+ + " * @param p4 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final Marker marker, final String message, final Object p0, "
+ + "final Object p1, final Object p2,%n"
+ + " final Object p3, final Object p4) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0, p1, p2, p3, p4);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param marker the marker data specific to this log statement%n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @param p1 parameter to the message.%n"
+ + " * @param p2 parameter to the message.%n"
+ + " * @param p3 parameter to the message.%n"
+ + " * @param p4 parameter to the message.%n"
+ + " * @param p5 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final Marker marker, final String message, final Object p0, "
+ + "final Object p1, final Object p2,%n"
+ + " final Object p3, final Object p4, final Object p5) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0, p1, p2, p3, p4, p5);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param marker the marker data specific to this log statement%n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @param p1 parameter to the message.%n"
+ + " * @param p2 parameter to the message.%n"
+ + " * @param p3 parameter to the message.%n"
+ + " * @param p4 parameter to the message.%n"
+ + " * @param p5 parameter to the message.%n"
+ + " * @param p6 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final Marker marker, final String message, final Object p0, "
+ + "final Object p1, final Object p2,%n"
+ + " final Object p3, final Object p4, final Object p5, final Object p6) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0, p1, p2, p3, p4, p5, p6);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param marker the marker data specific to this log statement%n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @param p1 parameter to the message.%n"
+ + " * @param p2 parameter to the message.%n"
+ + " * @param p3 parameter to the message.%n"
+ + " * @param p4 parameter to the message.%n"
+ + " * @param p5 parameter to the message.%n"
+ + " * @param p6 parameter to the message.%n"
+ + " * @param p7 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final Marker marker, final String message, final Object p0, "
+ + "final Object p1, final Object p2,%n"
+ + " final Object p3, final Object p4, final Object p5, final Object p6,%n"
+ + " final Object p7) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param marker the marker data specific to this log statement%n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @param p1 parameter to the message.%n"
+ + " * @param p2 parameter to the message.%n"
+ + " * @param p3 parameter to the message.%n"
+ + " * @param p4 parameter to the message.%n"
+ + " * @param p5 parameter to the message.%n"
+ + " * @param p6 parameter to the message.%n"
+ + " * @param p7 parameter to the message.%n"
+ + " * @param p8 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final Marker marker, final String message, final Object p0, "
+ + "final Object p1, final Object p2,%n"
+ + " final Object p3, final Object p4, final Object p5, final Object p6,%n"
+ + " final Object p7, final Object p8) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, "
+ + "p8);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param marker the marker data specific to this log statement%n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @param p1 parameter to the message.%n"
+ + " * @param p2 parameter to the message.%n"
+ + " * @param p3 parameter to the message.%n"
+ + " * @param p4 parameter to the message.%n"
+ + " * @param p5 parameter to the message.%n"
+ + " * @param p6 parameter to the message.%n"
+ + " * @param p7 parameter to the message.%n"
+ + " * @param p8 parameter to the message.%n"
+ + " * @param p9 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final Marker marker, final String message, final Object p0, "
+ + "final Object p1, final Object p2,%n"
+ + " final Object p3, final Object p4, final Object p5, final Object p6,%n"
+ + " final Object p7, final Object p8, final Object p9) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, "
+ + "p8, p9);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message at the {@code CUSTOM_LEVEL} level including the stack trace of%n"
+ + " * the {@link Throwable} {@code t} passed as parameter.%n"
+ + " * %n"
+ + " * @param marker the marker data specific to this log statement%n"
+ + " * @param message the message to log.%n"
+ + " * @param t the exception to log, including its stack trace.%n"
+ + " */%n"
+ + " public void methodName(final Marker marker, final String message, final Throwable t) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, marker, message, t);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs the specified Message at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param msg the message string to be logged%n"
+ + " */%n"
+ + " public void methodName(final Message msg) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, msg, (Throwable) null);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs the specified Message at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param msg the message string to be logged%n"
+ + " * @param t A Throwable or null.%n"
+ + " */%n"
+ + " public void methodName(final Message msg, final Throwable t) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, msg, t);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message object with the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param message the message object to log.%n"
+ + " */%n"
+ + " public void methodName(final Object message) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, (Throwable) null);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message at the {@code CUSTOM_LEVEL} level including the stack trace of%n"
+ + " * the {@link Throwable} {@code t} passed as parameter.%n"
+ + " * %n"
+ + " * @param message the message to log.%n"
+ + " * @param t the exception to log, including its stack trace.%n"
+ + " */%n"
+ + " public void methodName(final Object message, final Throwable t) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, t);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message CharSequence with the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param message the message CharSequence to log.%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final CharSequence message) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, (Throwable) null);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a CharSequence at the {@code CUSTOM_LEVEL} level including the stack trace of%n"
+ + " * the {@link Throwable} {@code t} passed as parameter.%n"
+ + " * %n"
+ + " * @param message the CharSequence to log.%n"
+ + " * @param t the exception to log, including its stack trace.%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final CharSequence message, final Throwable t) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, t);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message object with the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param message the message object to log.%n"
+ + " */%n"
+ + " public void methodName(final String message) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, (Throwable) null);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @param p1 parameter to the message.%n"
- + " * @param p2 parameter to the message.%n"
- + " * @param p3 parameter to the message.%n"
- + " * @param p4 parameter to the message.%n"
- + " * @param p5 parameter to the message.%n"
- + " * @param p6 parameter to the message.%n"
- + " * @param p7 parameter to the message.%n"
- + " * @param p8 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final String message, final Object p0, "
- + "final Object p1, final Object p2,%n"
- + " final Object p3, final Object p4, final Object p5, final Object p6,%n"
- + " final Object p7, final Object p8) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0, p1, p2, p3, p4, p5, p6, p7, "
- + "p8);%n"
+ + " * @param params parameters to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " */%n"
+ + " public void methodName(final String message, final Object... params) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, params);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final String message, final Object p0) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @param p1 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final String message, final Object p0, "
+ + "final Object p1) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0, p1);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @param p1 parameter to the message.%n"
+ + " * @param p2 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final String message, final Object p0, "
+ + "final Object p1, final Object p2) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0, p1, p2);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @param p1 parameter to the message.%n"
+ + " * @param p2 parameter to the message.%n"
+ + " * @param p3 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final String message, final Object p0, "
+ + "final Object p1, final Object p2,%n"
+ + " final Object p3) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0, p1, p2, p3);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @param p1 parameter to the message.%n"
+ + " * @param p2 parameter to the message.%n"
+ + " * @param p3 parameter to the message.%n"
+ + " * @param p4 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final String message, final Object p0, "
+ + "final Object p1, final Object p2,%n"
+ + " final Object p3, final Object p4) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0, p1, p2, p3, p4);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @param p1 parameter to the message.%n"
+ + " * @param p2 parameter to the message.%n"
+ + " * @param p3 parameter to the message.%n"
+ + " * @param p4 parameter to the message.%n"
+ + " * @param p5 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final String message, final Object p0, "
+ + "final Object p1, final Object p2,%n"
+ + " final Object p3, final Object p4, final Object p5) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0, p1, p2, p3, p4, p5);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @param p1 parameter to the message.%n"
+ + " * @param p2 parameter to the message.%n"
+ + " * @param p3 parameter to the message.%n"
+ + " * @param p4 parameter to the message.%n"
+ + " * @param p5 parameter to the message.%n"
+ + " * @param p6 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final String message, final Object p0, "
+ + "final Object p1, final Object p2,%n"
+ + " final Object p3, final Object p4, final Object p5, final Object p6) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0, p1, p2, p3, p4, p5, p6);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @param p1 parameter to the message.%n"
+ + " * @param p2 parameter to the message.%n"
+ + " * @param p3 parameter to the message.%n"
+ + " * @param p4 parameter to the message.%n"
+ + " * @param p5 parameter to the message.%n"
+ + " * @param p6 parameter to the message.%n"
+ + " * @param p7 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final String message, final Object p0, "
+ + "final Object p1, final Object p2,%n"
+ + " final Object p3, final Object p4, final Object p5, final Object p6,%n"
+ + " final Object p7) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0, p1, p2, p3, p4, p5, p6, p7);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @param p1 parameter to the message.%n"
+ + " * @param p2 parameter to the message.%n"
+ + " * @param p3 parameter to the message.%n"
+ + " * @param p4 parameter to the message.%n"
+ + " * @param p5 parameter to the message.%n"
+ + " * @param p6 parameter to the message.%n"
+ + " * @param p7 parameter to the message.%n"
+ + " * @param p8 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final String message, final Object p0, "
+ + "final Object p1, final Object p2,%n"
+ + " final Object p3, final Object p4, final Object p5, final Object p6,%n"
+ + " final Object p7, final Object p8) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0, p1, p2, p3, p4, p5, p6, p7, "
+ + "p8);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
+ + " * %n"
+ + " * @param message the message to log; the format depends on the message factory.%n"
+ + " * @param p0 parameter to the message.%n"
+ + " * @param p1 parameter to the message.%n"
+ + " * @param p2 parameter to the message.%n"
+ + " * @param p3 parameter to the message.%n"
+ + " * @param p4 parameter to the message.%n"
+ + " * @param p5 parameter to the message.%n"
+ + " * @param p6 parameter to the message.%n"
+ + " * @param p7 parameter to the message.%n"
+ + " * @param p8 parameter to the message.%n"
+ + " * @param p9 parameter to the message.%n"
+ + " * @see #getMessageFactory()%n"
+ + " * @since Log4j-2.6%n"
+ + " */%n"
+ + " public void methodName(final String message, final Object p0, "
+ + "final Object p1, final Object p2,%n"
+ + " final Object p3, final Object p4, final Object p5, final Object p6,%n"
+ + " final Object p7, final Object p8, final Object p9) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0, p1, p2, p3, p4, p5, p6, p7, "
+ + "p8, p9);%n"
+ + " }%n"
+ + "%n"
+ + " /**%n"
+ + " * Logs a message at the {@code CUSTOM_LEVEL} level including the stack trace of%n"
+ + " * the {@link Throwable} {@code t} passed as parameter.%n"
+ + " * %n"
+ + " * @param message the message to log.%n"
+ + " * @param t the exception to log, including its stack trace.%n"
+ + " */%n"
+ + " public void methodName(final String message, final Throwable t) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, t);%n"
+ " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message with parameters at the {@code CUSTOM_LEVEL} level.%n"
- + " * %n"
- + " * @param message the message to log; the format depends on the message factory.%n"
- + " * @param p0 parameter to the message.%n"
- + " * @param p1 parameter to the message.%n"
- + " * @param p2 parameter to the message.%n"
- + " * @param p3 parameter to the message.%n"
- + " * @param p4 parameter to the message.%n"
- + " * @param p5 parameter to the message.%n"
- + " * @param p6 parameter to the message.%n"
- + " * @param p7 parameter to the message.%n"
- + " * @param p8 parameter to the message.%n"
- + " * @param p9 parameter to the message.%n"
- + " * @see #getMessageFactory()%n"
- + " * @since Log4j-2.6%n"
- + " */%n"
- + " public void methodName(final String message, final Object p0, "
- + "final Object p1, final Object p2,%n"
- + " final Object p3, final Object p4, final Object p5, final Object p6,%n"
- + " final Object p7, final Object p8, final Object p9) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, p0, p1, p2, p3, p4, p5, p6, p7, "
- + "p8, p9);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message at the {@code CUSTOM_LEVEL} level including the stack trace of%n"
- + " * the {@link Throwable} {@code t} passed as parameter.%n"
- + " * %n"
- + " * @param message the message to log.%n"
- + " * @param t the exception to log, including its stack trace.%n"
- + " */%n"
- + " public void methodName(final String message, final Throwable t) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, message, t);%n"
- + " }%n"
- + "%n"
- + " /**%n"
+ + "%n"
+ + " /**%n"
+ " * Logs a message which is only to be constructed if the logging level is the {@code CUSTOM_LEVEL}"
- + "level.%n"
- + " *%n"
- + " * @param msgSupplier A function, which when called, produces the desired log message;%n"
- + " * the format depends on the message factory.%n"
- + " * @since Log4j-2.4%n"
- + " */%n"
- + " public void methodName(final Supplier<?> msgSupplier) {%n"
- + " logger.logIfEnabled(FQCN, CUSTOM_LEVEL, null, msgSupplier, (Throwable) null);%n"
- + " }%n"
- + "%n"
- + " /**%n"
- + " * Logs a message (only to be constructed if the logging level is the {@code CUSTOM_LEVEL}%n"
+ + "level.%n"
+ + " *%n"
+ + " * @param msgSupplier A function, which when called, produces the desired log message;%n"
+ + " * the format depends on the message factory.%n"
+ + " * @since Log4j-2.4%n"
+ + " */%n"
+ + " public void methodName(final Supplier<?> msgSupplier) {%n"
+ + " logger.logIfEnabled(FQCN, CUSTOM_L
<TRUNCATED>
[06/13] logging-log4j2 git commit: Revert "Use final. Remove trailing
spaces."
Posted by gg...@apache.org.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1f4c7962/log4j-core/src/main/java/org/apache/logging/log4j/core/tools/picocli/CommandLine.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/tools/picocli/CommandLine.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/tools/picocli/CommandLine.java
index f61d216..a4cc8d2 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/tools/picocli/CommandLine.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/tools/picocli/CommandLine.java
@@ -139,11 +139,11 @@ public class CommandLine {
private String commandName = Help.DEFAULT_COMMAND_NAME;
private boolean overwrittenOptionsAllowed = false;
private boolean unmatchedArgumentsAllowed = false;
- private final List<String> unmatchedArguments = new ArrayList<String>();
+ private List<String> unmatchedArguments = new ArrayList<String>();
private CommandLine parent;
private boolean usageHelpRequested;
private boolean versionHelpRequested;
- private final List<String> versionLines = new ArrayList<String>();
+ private List<String> versionLines = new ArrayList<String>();
/**
* Constructs a new {@code CommandLine} interpreter with the specified annotated object.
@@ -152,7 +152,7 @@ public class CommandLine {
* @param command the object to initialize from the command line arguments
* @throws InitializationException if the specified command object does not have a {@link Command}, {@link Option} or {@link Parameters} annotation
*/
- public CommandLine(final Object command) {
+ public CommandLine(Object command) {
interpreter = new Interpreter(command);
}
@@ -197,8 +197,8 @@ public class CommandLine {
* @since 0.9.7
* @see Command#subcommands()
*/
- public CommandLine addSubcommand(final String name, final Object command) {
- final CommandLine commandLine = toCommandLine(command);
+ public CommandLine addSubcommand(String name, Object command) {
+ CommandLine commandLine = toCommandLine(command);
commandLine.parent = this;
interpreter.commands.put(name, commandLine);
return this;
@@ -259,9 +259,9 @@ public class CommandLine {
* @return this {@code CommandLine} object, to allow method chaining
* @since 0.9.7
*/
- public CommandLine setOverwrittenOptionsAllowed(final boolean newValue) {
+ public CommandLine setOverwrittenOptionsAllowed(boolean newValue) {
this.overwrittenOptionsAllowed = newValue;
- for (final CommandLine command : interpreter.commands.values()) {
+ for (CommandLine command : interpreter.commands.values()) {
command.setOverwrittenOptionsAllowed(newValue);
}
return this;
@@ -288,9 +288,9 @@ public class CommandLine {
* @since 0.9.7
* @see #getUnmatchedArguments()
*/
- public CommandLine setUnmatchedArgumentsAllowed(final boolean newValue) {
+ public CommandLine setUnmatchedArgumentsAllowed(boolean newValue) {
this.unmatchedArgumentsAllowed = newValue;
- for (final CommandLine command : interpreter.commands.values()) {
+ for (CommandLine command : interpreter.commands.values()) {
command.setUnmatchedArgumentsAllowed(newValue);
}
return this;
@@ -325,8 +325,8 @@ public class CommandLine {
* @throws ParameterException if the specified command line arguments are invalid
* @since 0.9.7
*/
- public static <T> T populateCommand(final T command, final String... args) {
- final CommandLine cli = toCommandLine(command);
+ public static <T> T populateCommand(T command, String... args) {
+ CommandLine cli = toCommandLine(command);
cli.parse(args);
return command;
}
@@ -345,7 +345,7 @@ public class CommandLine {
* @throws ParameterException if the specified command line arguments are invalid; use
* {@link ParameterException#getCommandLine()} to get the command or subcommand whose user input was invalid
*/
- public List<CommandLine> parse(final String... args) {
+ public List<CommandLine> parse(String... args) {
return interpreter.parse(args);
}
/**
@@ -407,7 +407,7 @@ public class CommandLine {
* @since 2.0 */
public static class DefaultExceptionHandler implements IExceptionHandler {
@Override
- public List<Object> handleException(final ParameterException ex, final PrintStream out, final Help.Ansi ansi, final String... args) {
+ public List<Object> handleException(ParameterException ex, PrintStream out, Help.Ansi ansi, String... args) {
out.println(ex.getMessage());
ex.getCommandLine().usage(out, ansi);
return Collections.emptyList();
@@ -429,8 +429,8 @@ public class CommandLine {
* @param ansi for printing help messages using ANSI styles and colors
* @return {@code true} if help was printed, {@code false} otherwise
* @since 2.0 */
- public static boolean printHelpIfRequested(final List<CommandLine> parsedCommands, final PrintStream out, final Help.Ansi ansi) {
- for (final CommandLine parsed : parsedCommands) {
+ public static boolean printHelpIfRequested(List<CommandLine> parsedCommands, PrintStream out, Help.Ansi ansi) {
+ for (CommandLine parsed : parsedCommands) {
if (parsed.isUsageHelpRequested()) {
parsed.usage(out, ansi);
return true;
@@ -441,19 +441,19 @@ public class CommandLine {
}
return false;
}
- private static Object execute(final CommandLine parsed) {
- final Object command = parsed.getCommand();
+ private static Object execute(CommandLine parsed) {
+ Object command = parsed.getCommand();
if (command instanceof Runnable) {
try {
((Runnable) command).run();
return null;
- } catch (final Exception ex) {
+ } catch (Exception ex) {
throw new ExecutionException(parsed, "Error while running command (" + command + ")", ex);
}
} else if (command instanceof Callable) {
try {
return ((Callable<Object>) command).call();
- } catch (final Exception ex) {
+ } catch (Exception ex) {
throw new ExecutionException(parsed, "Error while calling command (" + command + ")", ex);
}
}
@@ -482,7 +482,7 @@ public class CommandLine {
* {@link ExecutionException#getCommandLine()} to get the command or subcommand where processing failed
*/
@Override
- public List<Object> handleParseResult(final List<CommandLine> parsedCommands, final PrintStream out, final Help.Ansi ansi) {
+ public List<Object> handleParseResult(List<CommandLine> parsedCommands, PrintStream out, Help.Ansi ansi) {
if (printHelpIfRequested(parsedCommands, out, ansi)) { return Collections.emptyList(); }
return Arrays.asList(execute(parsedCommands.get(0)));
}
@@ -533,9 +533,9 @@ public class CommandLine {
* {@link ExecutionException#getCommandLine()} to get the command or subcommand where processing failed
*/
@Override
- public List<Object> handleParseResult(final List<CommandLine> parsedCommands, final PrintStream out, final Help.Ansi ansi) {
+ public List<Object> handleParseResult(List<CommandLine> parsedCommands, PrintStream out, Help.Ansi ansi) {
if (printHelpIfRequested(parsedCommands, out, ansi)) { return Collections.emptyList(); }
- final CommandLine last = parsedCommands.get(parsedCommands.size() - 1);
+ CommandLine last = parsedCommands.get(parsedCommands.size() - 1);
return Arrays.asList(execute(last));
}
}
@@ -559,12 +559,12 @@ public class CommandLine {
* {@link ExecutionException#getCommandLine()} to get the command or subcommand where processing failed
*/
@Override
- public List<Object> handleParseResult(final List<CommandLine> parsedCommands, final PrintStream out, final Help.Ansi ansi) {
+ public List<Object> handleParseResult(List<CommandLine> parsedCommands, PrintStream out, Help.Ansi ansi) {
if (printHelpIfRequested(parsedCommands, out, ansi)) {
return null;
}
- final List<Object> result = new ArrayList<Object>();
- for (final CommandLine parsed : parsedCommands) {
+ List<Object> result = new ArrayList<Object>();
+ for (CommandLine parsed : parsedCommands) {
result.add(execute(parsed));
}
return result;
@@ -607,7 +607,7 @@ public class CommandLine {
* @see RunLast
* @see RunAll
* @since 2.0 */
- public List<Object> parseWithHandler(final IParseResultHandler handler, final PrintStream out, final String... args) {
+ public List<Object> parseWithHandler(IParseResultHandler handler, PrintStream out, String... args) {
return parseWithHandlers(handler, out, Help.Ansi.AUTO, new DefaultExceptionHandler(), args);
}
/**
@@ -652,11 +652,11 @@ public class CommandLine {
* @see RunAll
* @see DefaultExceptionHandler
* @since 2.0 */
- public List<Object> parseWithHandlers(final IParseResultHandler handler, final PrintStream out, final Help.Ansi ansi, final IExceptionHandler exceptionHandler, final String... args) {
+ public List<Object> parseWithHandlers(IParseResultHandler handler, PrintStream out, Help.Ansi ansi, IExceptionHandler exceptionHandler, String... args) {
try {
- final List<CommandLine> result = parse(args);
+ List<CommandLine> result = parse(args);
return handler.handleParseResult(result, out, ansi);
- } catch (final ParameterException ex) {
+ } catch (ParameterException ex) {
return exceptionHandler.handleException(ex, out, ansi, args);
}
}
@@ -666,7 +666,7 @@ public class CommandLine {
* @param out the print stream to print the help message to
* @throws IllegalArgumentException if the specified command object does not have a {@link Command}, {@link Option} or {@link Parameters} annotation
*/
- public static void usage(final Object command, final PrintStream out) {
+ public static void usage(Object command, PrintStream out) {
toCommandLine(command).usage(out);
}
@@ -678,7 +678,7 @@ public class CommandLine {
* @param ansi whether the usage message should contain ANSI escape codes or not
* @throws IllegalArgumentException if the specified command object does not have a {@link Command}, {@link Option} or {@link Parameters} annotation
*/
- public static void usage(final Object command, final PrintStream out, final Help.Ansi ansi) {
+ public static void usage(Object command, PrintStream out, Help.Ansi ansi) {
toCommandLine(command).usage(out, ansi);
}
@@ -690,7 +690,7 @@ public class CommandLine {
* @param colorScheme the {@code ColorScheme} defining the styles for options, parameters and commands when ANSI is enabled
* @throws IllegalArgumentException if the specified command object does not have a {@link Command}, {@link Option} or {@link Parameters} annotation
*/
- public static void usage(final Object command, final PrintStream out, final Help.ColorScheme colorScheme) {
+ public static void usage(Object command, PrintStream out, Help.ColorScheme colorScheme) {
toCommandLine(command).usage(out, colorScheme);
}
@@ -699,7 +699,7 @@ public class CommandLine {
* @param out the printStream to print to
* @see #usage(PrintStream, Help.ColorScheme)
*/
- public void usage(final PrintStream out) {
+ public void usage(PrintStream out) {
usage(out, Help.Ansi.AUTO);
}
@@ -709,7 +709,7 @@ public class CommandLine {
* @param ansi whether the usage message should include ANSI escape codes or not
* @see #usage(PrintStream, Help.ColorScheme)
*/
- public void usage(final PrintStream out, final Help.Ansi ansi) {
+ public void usage(PrintStream out, Help.Ansi ansi) {
usage(out, Help.defaultColorScheme(ansi));
}
/**
@@ -744,8 +744,8 @@ public class CommandLine {
* @param out the {@code PrintStream} to print the usage help message to
* @param colorScheme the {@code ColorScheme} defining the styles for options, parameters and commands when ANSI is enabled
*/
- public void usage(final PrintStream out, final Help.ColorScheme colorScheme) {
- final Help help = new Help(interpreter.command, colorScheme).addAllSubcommands(getSubcommands());
+ public void usage(PrintStream out, Help.ColorScheme colorScheme) {
+ Help help = new Help(interpreter.command, colorScheme).addAllSubcommands(getSubcommands());
if (!Help.DEFAULT_SEPARATOR.equals(getSeparator())) {
help.separator = getSeparator();
help.parameterLabelRenderer = help.createDefaultParamLabelRenderer(); // update for new separator
@@ -753,7 +753,7 @@ public class CommandLine {
if (!Help.DEFAULT_COMMAND_NAME.equals(getCommandName())) {
help.commandName = getCommandName();
}
- final StringBuilder sb = new StringBuilder()
+ StringBuilder sb = new StringBuilder()
.append(help.headerHeading())
.append(help.header())
.append(help.synopsisHeading()) //e.g. Usage:
@@ -777,7 +777,7 @@ public class CommandLine {
* @see #printVersionHelp(PrintStream, Help.Ansi)
* @since 0.9.8
*/
- public void printVersionHelp(final PrintStream out) { printVersionHelp(out, Help.Ansi.AUTO); }
+ public void printVersionHelp(PrintStream out) { printVersionHelp(out, Help.Ansi.AUTO); }
/**
* Prints version information from the {@link Command#version()} annotation to the specified {@code PrintStream}.
@@ -790,8 +790,8 @@ public class CommandLine {
* @see #isVersionHelpRequested()
* @since 0.9.8
*/
- public void printVersionHelp(final PrintStream out, final Help.Ansi ansi) {
- for (final String versionInfo : versionLines) {
+ public void printVersionHelp(PrintStream out, Help.Ansi ansi) {
+ for (String versionInfo : versionLines) {
out.println(ansi.new Text(versionInfo));
}
}
@@ -808,8 +808,8 @@ public class CommandLine {
* @see #isVersionHelpRequested()
* @since 1.0.0
*/
- public void printVersionHelp(final PrintStream out, final Help.Ansi ansi, final Object... params) {
- for (final String versionInfo : versionLines) {
+ public void printVersionHelp(PrintStream out, Help.Ansi ansi, Object... params) {
+ for (String versionInfo : versionLines) {
out.println(ansi.new Text(String.format(versionInfo, params)));
}
}
@@ -832,7 +832,7 @@ public class CommandLine {
* @see #parseWithHandlers(IParseResultHandler, PrintStream, Help.Ansi, IExceptionHandler, String...)
* @see RunFirst
*/
- public static <C extends Callable<T>, T> T call(final C callable, final PrintStream out, final String... args) {
+ public static <C extends Callable<T>, T> T call(C callable, PrintStream out, String... args) {
return call(callable, out, Help.Ansi.AUTO, args);
}
/**
@@ -880,9 +880,9 @@ public class CommandLine {
* @see #parseWithHandlers(IParseResultHandler, PrintStream, Help.Ansi, IExceptionHandler, String...)
* @see RunLast
*/
- public static <C extends Callable<T>, T> T call(final C callable, final PrintStream out, final Help.Ansi ansi, final String... args) {
- final CommandLine cmd = new CommandLine(callable); // validate command outside of try-catch
- final List<Object> results = cmd.parseWithHandlers(new RunLast(), out, ansi, new DefaultExceptionHandler(), args);
+ public static <C extends Callable<T>, T> T call(C callable, PrintStream out, Help.Ansi ansi, String... args) {
+ CommandLine cmd = new CommandLine(callable); // validate command outside of try-catch
+ List<Object> results = cmd.parseWithHandlers(new RunLast(), out, ansi, new DefaultExceptionHandler(), args);
return results == null || results.isEmpty() ? null : (T) results.get(0);
}
@@ -902,7 +902,7 @@ public class CommandLine {
* @see #parseWithHandlers(IParseResultHandler, PrintStream, Help.Ansi, IExceptionHandler, String...)
* @see RunFirst
*/
- public static <R extends Runnable> void run(final R runnable, final PrintStream out, final String... args) {
+ public static <R extends Runnable> void run(R runnable, PrintStream out, String... args) {
run(runnable, out, Help.Ansi.AUTO, args);
}
/**
@@ -948,8 +948,8 @@ public class CommandLine {
* @see #parseWithHandlers(IParseResultHandler, PrintStream, Help.Ansi, IExceptionHandler, String...)
* @see RunLast
*/
- public static <R extends Runnable> void run(final R runnable, final PrintStream out, final Help.Ansi ansi, final String... args) {
- final CommandLine cmd = new CommandLine(runnable); // validate command outside of try-catch
+ public static <R extends Runnable> void run(R runnable, PrintStream out, Help.Ansi ansi, String... args) {
+ CommandLine cmd = new CommandLine(runnable); // validate command outside of try-catch
cmd.parseWithHandlers(new RunLast(), out, ansi, new DefaultExceptionHandler(), args);
}
@@ -996,9 +996,9 @@ public class CommandLine {
* @return this CommandLine object, to allow method chaining
* @see #addSubcommand(String, Object)
*/
- public <K> CommandLine registerConverter(final Class<K> cls, final ITypeConverter<K> converter) {
+ public <K> CommandLine registerConverter(Class<K> cls, ITypeConverter<K> converter) {
interpreter.converterRegistry.put(Assert.notNull(cls, "class"), Assert.notNull(converter, "converter"));
- for (final CommandLine command : interpreter.commands.values()) {
+ for (CommandLine command : interpreter.commands.values()) {
command.registerConverter(cls, converter);
}
return this;
@@ -1014,7 +1014,7 @@ public class CommandLine {
* The separator may also be set declaratively with the {@link CommandLine.Command#separator()} annotation attribute.
* @param separator the String that separates option names from option values
* @return this {@code CommandLine} object, to allow method chaining */
- public CommandLine setSeparator(final String separator) {
+ public CommandLine setSeparator(String separator) {
interpreter.separator = Assert.notNull(separator, "separator");
return this;
}
@@ -1030,35 +1030,35 @@ public class CommandLine {
* The command name may also be set declaratively with the {@link CommandLine.Command#name()} annotation attribute.
* @param commandName command name (also called program name) displayed in the usage help synopsis
* @return this {@code CommandLine} object, to allow method chaining */
- public CommandLine setCommandName(final String commandName) {
+ public CommandLine setCommandName(String commandName) {
this.commandName = Assert.notNull(commandName, "commandName");
return this;
}
- private static boolean empty(final String str) { return str == null || str.trim().length() == 0; }
- private static boolean empty(final Object[] array) { return array == null || array.length == 0; }
- private static boolean empty(final Text txt) { return txt == null || txt.plain.toString().trim().length() == 0; }
- private static String str(final String[] arr, final int i) { return (arr == null || arr.length == 0) ? "" : arr[i]; }
- private static boolean isBoolean(final Class<?> type) { return type == Boolean.class || type == Boolean.TYPE; }
- private static CommandLine toCommandLine(final Object obj) { return obj instanceof CommandLine ? (CommandLine) obj : new CommandLine(obj);}
- private static boolean isMultiValue(final Field field) { return isMultiValue(field.getType()); }
- private static boolean isMultiValue(final Class<?> cls) { return cls.isArray() || Collection.class.isAssignableFrom(cls) || Map.class.isAssignableFrom(cls); }
- private static Class<?>[] getTypeAttribute(final Field field) {
- final Class<?>[] explicit = field.isAnnotationPresent(Parameters.class) ? field.getAnnotation(Parameters.class).type() : field.getAnnotation(Option.class).type();
+ private static boolean empty(String str) { return str == null || str.trim().length() == 0; }
+ private static boolean empty(Object[] array) { return array == null || array.length == 0; }
+ private static boolean empty(Text txt) { return txt == null || txt.plain.toString().trim().length() == 0; }
+ private static String str(String[] arr, int i) { return (arr == null || arr.length == 0) ? "" : arr[i]; }
+ private static boolean isBoolean(Class<?> type) { return type == Boolean.class || type == Boolean.TYPE; }
+ private static CommandLine toCommandLine(Object obj) { return obj instanceof CommandLine ? (CommandLine) obj : new CommandLine(obj);}
+ private static boolean isMultiValue(Field field) { return isMultiValue(field.getType()); }
+ private static boolean isMultiValue(Class<?> cls) { return cls.isArray() || Collection.class.isAssignableFrom(cls) || Map.class.isAssignableFrom(cls); }
+ private static Class<?>[] getTypeAttribute(Field field) {
+ Class<?>[] explicit = field.isAnnotationPresent(Parameters.class) ? field.getAnnotation(Parameters.class).type() : field.getAnnotation(Option.class).type();
if (explicit.length > 0) { return explicit; }
if (field.getType().isArray()) { return new Class<?>[] { field.getType().getComponentType() }; }
if (isMultiValue(field)) {
- final Type type = field.getGenericType(); // e.g. Map<Long, ? extends Number>
+ Type type = field.getGenericType(); // e.g. Map<Long, ? extends Number>
if (type instanceof ParameterizedType) {
- final ParameterizedType parameterizedType = (ParameterizedType) type;
- final Type[] paramTypes = parameterizedType.getActualTypeArguments(); // e.g. ? extends Number
- final Class<?>[] result = new Class<?>[paramTypes.length];
+ ParameterizedType parameterizedType = (ParameterizedType) type;
+ Type[] paramTypes = parameterizedType.getActualTypeArguments(); // e.g. ? extends Number
+ Class<?>[] result = new Class<?>[paramTypes.length];
for (int i = 0; i < paramTypes.length; i++) {
if (paramTypes[i] instanceof Class) { result[i] = (Class<?>) paramTypes[i]; continue; } // e.g. Long
if (paramTypes[i] instanceof WildcardType) { // e.g. ? extends Number
- final WildcardType wildcardType = (WildcardType) paramTypes[i];
- final Type[] lower = wildcardType.getLowerBounds(); // e.g. []
+ WildcardType wildcardType = (WildcardType) paramTypes[i];
+ Type[] lower = wildcardType.getLowerBounds(); // e.g. []
if (lower.length > 0 && lower[0] instanceof Class) { result[i] = (Class<?>) lower[0]; continue; }
- final Type[] upper = wildcardType.getUpperBounds(); // e.g. Number
+ Type[] upper = wildcardType.getUpperBounds(); // e.g. Number
if (upper.length > 0 && upper[0] instanceof Class) { result[i] = (Class<?>) upper[0]; continue; }
}
Arrays.fill(result, String.class); return result; // too convoluted generic type, giving up
@@ -1656,7 +1656,7 @@ public class CommandLine {
* @param unspecified {@code true} if no arity was specified on the option/parameter (value is based on type)
* @param originalValue the original value that was specified on the option or parameter
*/
- public Range(final int min, final int max, final boolean variable, final boolean unspecified, final String originalValue) {
+ public Range(int min, int max, boolean variable, boolean unspecified, String originalValue) {
this.min = min;
this.max = max;
this.isVariable = variable;
@@ -1667,7 +1667,7 @@ public class CommandLine {
* or the field type's default arity if no arity was specified.
* @param field the field whose Option annotation to inspect
* @return a new {@code Range} based on the Option arity annotation on the specified field */
- public static Range optionArity(final Field field) {
+ public static Range optionArity(Field field) {
return field.isAnnotationPresent(Option.class)
? adjustForType(Range.valueOf(field.getAnnotation(Option.class).arity()), field)
: new Range(0, 0, false, true, "0");
@@ -1676,7 +1676,7 @@ public class CommandLine {
* or the field type's default arity if no arity was specified.
* @param field the field whose Parameters annotation to inspect
* @return a new {@code Range} based on the Parameters arity annotation on the specified field */
- public static Range parameterArity(final Field field) {
+ public static Range parameterArity(Field field) {
return field.isAnnotationPresent(Parameters.class)
? adjustForType(Range.valueOf(field.getAnnotation(Parameters.class).arity()), field)
: new Range(0, 0, false, true, "0");
@@ -1684,12 +1684,12 @@ public class CommandLine {
/** Returns a new {@code Range} based on the {@link Parameters#index()} annotation on the specified field.
* @param field the field whose Parameters annotation to inspect
* @return a new {@code Range} based on the Parameters index annotation on the specified field */
- public static Range parameterIndex(final Field field) {
+ public static Range parameterIndex(Field field) {
return field.isAnnotationPresent(Parameters.class)
? Range.valueOf(field.getAnnotation(Parameters.class).index())
: new Range(0, 0, false, true, "0");
}
- static Range adjustForType(final Range result, final Field field) {
+ static Range adjustForType(Range result, Field field) {
return result.isUnspecified ? defaultArity(field) : result;
}
/** Returns the default arity {@code Range}: for {@link Option options} this is 0 for booleans and 1 for
@@ -1698,8 +1698,8 @@ public class CommandLine {
* @param field the field whose default arity to return
* @return a new {@code Range} indicating the default arity of the specified field
* @since 2.0 */
- public static Range defaultArity(final Field field) {
- final Class<?> type = field.getType();
+ public static Range defaultArity(Field field) {
+ Class<?> type = field.getType();
if (field.isAnnotationPresent(Option.class)) {
return defaultArity(type);
}
@@ -1711,14 +1711,14 @@ public class CommandLine {
/** Returns the default arity {@code Range} for {@link Option options}: booleans have arity 0, other types have arity 1.
* @param type the type whose default arity to return
* @return a new {@code Range} indicating the default arity of the specified type */
- public static Range defaultArity(final Class<?> type) {
+ public static Range defaultArity(Class<?> type) {
return isBoolean(type) ? Range.valueOf("0") : Range.valueOf("1");
}
private int size() { return 1 + max - min; }
- static Range parameterCapacity(final Field field) {
- final Range arity = parameterArity(field);
+ static Range parameterCapacity(Field field) {
+ Range arity = parameterArity(field);
if (!isMultiValue(field)) { return arity; }
- final Range index = parameterIndex(field);
+ Range index = parameterIndex(field);
if (arity.max == 0) { return arity; }
if (index.size() == 1) { return arity; }
if (index.isVariable) { return Range.valueOf(arity.min + "..*"); }
@@ -1734,7 +1734,7 @@ public class CommandLine {
* @return a new {@code Range} value */
public static Range valueOf(String range) {
range = range.trim();
- final boolean unspecified = range.length() == 0 || range.startsWith(".."); // || range.endsWith("..");
+ boolean unspecified = range.length() == 0 || range.startsWith(".."); // || range.endsWith("..");
int min = -1, max = -1;
boolean variable = false;
int dots = -1;
@@ -1747,13 +1747,13 @@ public class CommandLine {
variable = max == Integer.MAX_VALUE;
min = variable ? 0 : max;
}
- final Range result = new Range(min, max, variable, unspecified, range);
+ Range result = new Range(min, max, variable, unspecified, range);
return result;
}
- private static int parseInt(final String str, final int defaultValue) {
+ private static int parseInt(String str, int defaultValue) {
try {
return Integer.parseInt(str);
- } catch (final Exception ex) {
+ } catch (Exception ex) {
return defaultValue;
}
}
@@ -1761,25 +1761,25 @@ public class CommandLine {
* The {@code max} of the returned Range is guaranteed not to be less than the new {@code min} value.
* @param newMin the {@code min} value of the returned Range object
* @return a new Range object with the specified {@code min} value */
- public Range min(final int newMin) { return new Range(newMin, Math.max(newMin, max), isVariable, isUnspecified, originalValue); }
+ public Range min(int newMin) { return new Range(newMin, Math.max(newMin, max), isVariable, isUnspecified, originalValue); }
/** Returns a new Range object with the {@code max} value replaced by the specified value.
* The {@code min} of the returned Range is guaranteed not to be greater than the new {@code max} value.
* @param newMax the {@code max} value of the returned Range object
* @return a new Range object with the specified {@code max} value */
- public Range max(final int newMax) { return new Range(Math.min(min, newMax), newMax, isVariable, isUnspecified, originalValue); }
+ public Range max(int newMax) { return new Range(Math.min(min, newMax), newMax, isVariable, isUnspecified, originalValue); }
/**
* Returns {@code true} if this Range includes the specified value, {@code false} otherwise.
* @param value the value to check
* @return {@code true} if the specified value is not less than the minimum and not greater than the maximum of this Range
*/
- public boolean contains(final int value) { return min <= value && max >= value; }
+ public boolean contains(int value) { return min <= value && max >= value; }
@Override
- public boolean equals(final Object object) {
+ public boolean equals(Object object) {
if (!(object instanceof Range)) { return false; }
- final Range other = (Range) object;
+ Range other = (Range) object;
return other.max == this.max && other.min == this.min && other.isVariable == this.isVariable;
}
@Override
@@ -1791,32 +1791,32 @@ public class CommandLine {
return min == max ? String.valueOf(min) : min + ".." + (isVariable ? "*" : max);
}
@Override
- public int compareTo(final Range other) {
- final int result = min - other.min;
+ public int compareTo(Range other) {
+ int result = min - other.min;
return (result == 0) ? max - other.max : result;
}
}
- static void init(final Class<?> cls,
- final List<Field> requiredFields,
- final Map<String, Field> optionName2Field,
- final Map<Character, Field> singleCharOption2Field,
- final List<Field> positionalParametersFields) {
- final Field[] declaredFields = cls.getDeclaredFields();
- for (final Field field : declaredFields) {
+ static void init(Class<?> cls,
+ List<Field> requiredFields,
+ Map<String, Field> optionName2Field,
+ Map<Character, Field> singleCharOption2Field,
+ List<Field> positionalParametersFields) {
+ Field[] declaredFields = cls.getDeclaredFields();
+ for (Field field : declaredFields) {
field.setAccessible(true);
if (field.isAnnotationPresent(Option.class)) {
- final Option option = field.getAnnotation(Option.class);
+ Option option = field.getAnnotation(Option.class);
if (option.required()) {
requiredFields.add(field);
}
- for (final String name : option.names()) { // cannot be null or empty
- final Field existing = optionName2Field.put(name, field);
+ for (String name : option.names()) { // cannot be null or empty
+ Field existing = optionName2Field.put(name, field);
if (existing != null && existing != field) {
throw DuplicateOptionAnnotationsException.create(name, field, existing);
}
if (name.length() == 2 && name.startsWith("-")) {
- final char flag = name.charAt(1);
- final Field existing2 = singleCharOption2Field.put(flag, field);
+ char flag = name.charAt(1);
+ Field existing2 = singleCharOption2Field.put(flag, field);
if (existing2 != null && existing2 != field) {
throw DuplicateOptionAnnotationsException.create(name, field, existing2);
}
@@ -1829,17 +1829,17 @@ public class CommandLine {
+ field.getName() + "' is both.");
}
positionalParametersFields.add(field);
- final Range arity = Range.parameterArity(field);
+ Range arity = Range.parameterArity(field);
if (arity.min > 0) {
requiredFields.add(field);
}
}
}
}
- static void validatePositionalParameters(final List<Field> positionalParametersFields) {
+ static void validatePositionalParameters(List<Field> positionalParametersFields) {
int min = 0;
- for (final Field field : positionalParametersFields) {
- final Range index = Range.parameterIndex(field);
+ for (Field field : positionalParametersFields) {
+ Range index = Range.parameterIndex(field);
if (index.min > min) {
throw new ParameterIndexGapException("Missing field annotated with @Parameter(index=" + min +
"). Nearest field '" + field.getName() + "' has index=" + index.min);
@@ -1848,7 +1848,7 @@ public class CommandLine {
min = min == Integer.MAX_VALUE ? min : min + 1;
}
}
- private static <T> Stack<T> reverse(final Stack<T> stack) {
+ private static <T> Stack<T> reverse(Stack<T> stack) {
Collections.reverse(stack);
return stack;
}
@@ -1867,7 +1867,7 @@ public class CommandLine {
private String separator = Help.DEFAULT_SEPARATOR;
private int position;
- Interpreter(final Object command) {
+ Interpreter(Object command) {
converterRegistry.put(Path.class, new BuiltIn.PathConverter());
converterRegistry.put(Object.class, new BuiltIn.StringConverter());
converterRegistry.put(String.class, new BuiltIn.StringConverter());
@@ -1910,28 +1910,28 @@ public class CommandLine {
init(cls, requiredFields, optionName2Field, singleCharOption2Field, positionalParametersFields);
if (cls.isAnnotationPresent(Command.class)) {
hasCommandAnnotation = true;
- final Command cmd = cls.getAnnotation(Command.class);
+ Command cmd = cls.getAnnotation(Command.class);
declaredSeparator = (declaredSeparator == null) ? cmd.separator() : declaredSeparator;
declaredName = (declaredName == null) ? cmd.name() : declaredName;
CommandLine.this.versionLines.addAll(Arrays.asList(cmd.version()));
- for (final Class<?> sub : cmd.subcommands()) {
- final Command subCommand = sub.getAnnotation(Command.class);
+ for (Class<?> sub : cmd.subcommands()) {
+ Command subCommand = sub.getAnnotation(Command.class);
if (subCommand == null || Help.DEFAULT_COMMAND_NAME.equals(subCommand.name())) {
throw new InitializationException("Subcommand " + sub.getName() +
" is missing the mandatory @Command annotation with a 'name' attribute");
}
try {
- final Constructor<?> constructor = sub.getDeclaredConstructor();
+ Constructor<?> constructor = sub.getDeclaredConstructor();
constructor.setAccessible(true);
- final CommandLine commandLine = toCommandLine(constructor.newInstance());
+ CommandLine commandLine = toCommandLine(constructor.newInstance());
commandLine.parent = CommandLine.this;
commands.put(subCommand.name(), commandLine);
}
- catch (final InitializationException ex) { throw ex; }
- catch (final NoSuchMethodException ex) { throw new InitializationException("Cannot instantiate subcommand " +
+ catch (InitializationException ex) { throw ex; }
+ catch (NoSuchMethodException ex) { throw new InitializationException("Cannot instantiate subcommand " +
sub.getName() + ": the class has no constructor", ex); }
- catch (final Exception ex) {
+ catch (Exception ex) {
throw new InitializationException("Could not instantiate and add subcommand " +
sub.getName() + ": " + ex, ex);
}
@@ -1956,41 +1956,41 @@ public class CommandLine {
* @return a list with all commands and subcommands initialized by this method
* @throws ParameterException if the specified command line arguments are invalid
*/
- List<CommandLine> parse(final String... args) {
+ List<CommandLine> parse(String... args) {
Assert.notNull(args, "argument array");
if (tracer.isInfo()) {tracer.info("Parsing %d command line args %s%n", args.length, Arrays.toString(args));}
- final Stack<String> arguments = new Stack<String>();
+ Stack<String> arguments = new Stack<String>();
for (int i = args.length - 1; i >= 0; i--) {
arguments.push(args[i]);
}
- final List<CommandLine> result = new ArrayList<CommandLine>();
+ List<CommandLine> result = new ArrayList<CommandLine>();
parse(result, arguments, args);
return result;
}
- private void parse(final List<CommandLine> parsedCommands, final Stack<String> argumentStack, final String[] originalArgs) {
+ private void parse(List<CommandLine> parsedCommands, Stack<String> argumentStack, String[] originalArgs) {
// first reset any state in case this CommandLine instance is being reused
isHelpRequested = false;
CommandLine.this.versionHelpRequested = false;
CommandLine.this.usageHelpRequested = false;
- final Class<?> cmdClass = this.command.getClass();
+ Class<?> cmdClass = this.command.getClass();
if (tracer.isDebug()) {tracer.debug("Initializing %s: %d options, %d positional parameters, %d required, %d subcommands.%n", cmdClass.getName(), new HashSet<Field>(optionName2Field.values()).size(), positionalParametersFields.size(), requiredFields.size(), commands.size());}
parsedCommands.add(CommandLine.this);
- final List<Field> required = new ArrayList<Field>(requiredFields);
- final Set<Field> initialized = new HashSet<Field>();
+ List<Field> required = new ArrayList<Field>(requiredFields);
+ Set<Field> initialized = new HashSet<Field>();
Collections.sort(required, new PositionalParametersSorter());
try {
processArguments(parsedCommands, argumentStack, required, initialized, originalArgs);
- } catch (final ParameterException ex) {
+ } catch (ParameterException ex) {
throw ex;
- } catch (final Exception ex) {
- final int offendingArgIndex = originalArgs.length - argumentStack.size() - 1;
- final String arg = offendingArgIndex >= 0 && offendingArgIndex < originalArgs.length ? originalArgs[offendingArgIndex] : "?";
+ } catch (Exception ex) {
+ int offendingArgIndex = originalArgs.length - argumentStack.size() - 1;
+ String arg = offendingArgIndex >= 0 && offendingArgIndex < originalArgs.length ? originalArgs[offendingArgIndex] : "?";
throw ParameterException.create(CommandLine.this, ex, arg, offendingArgIndex, originalArgs);
}
if (!isAnyHelpRequested() && !required.isEmpty()) {
- for (final Field missing : required) {
+ for (Field missing : required) {
if (missing.isAnnotationPresent(Option.class)) {
throw MissingParameterException.create(CommandLine.this, required, separator);
} else {
@@ -2004,11 +2004,11 @@ public class CommandLine {
}
}
- private void processArguments(final List<CommandLine> parsedCommands,
- final Stack<String> args,
- final Collection<Field> required,
- final Set<Field> initialized,
- final String[] originalArgs) throws Exception {
+ private void processArguments(List<CommandLine> parsedCommands,
+ Stack<String> args,
+ Collection<Field> required,
+ Set<Field> initialized,
+ String[] originalArgs) throws Exception {
// arg must be one of:
// 1. the "--" double dash separating options from positional arguments
// 1. a stand-alone flag, like "-v" or "--verbose": no value required, must map to boolean or Boolean field
@@ -2045,13 +2045,13 @@ public class CommandLine {
// or an option may have one or more option parameters.
// A parameter may be attached to the option.
boolean paramAttachedToOption = false;
- final int separatorIndex = arg.indexOf(separator);
+ int separatorIndex = arg.indexOf(separator);
if (separatorIndex > 0) {
- final String key = arg.substring(0, separatorIndex);
+ String key = arg.substring(0, separatorIndex);
// be greedy. Consume the whole arg as an option if possible.
if (optionName2Field.containsKey(key) && !optionName2Field.containsKey(arg)) {
paramAttachedToOption = true;
- final String optionParam = arg.substring(separatorIndex + separator.length());
+ String optionParam = arg.substring(separatorIndex + separator.length());
args.push(optionParam);
arg = key;
if (tracer.isDebug()) {tracer.debug("Separated '%s' option from '%s' option parameter%n", key, optionParam);}
@@ -2081,44 +2081,43 @@ public class CommandLine {
}
}
}
- private boolean resemblesOption(final String arg) {
+ private boolean resemblesOption(String arg) {
int count = 0;
- for (final String optionName : optionName2Field.keySet()) {
+ for (String optionName : optionName2Field.keySet()) {
for (int i = 0; i < arg.length(); i++) {
if (optionName.length() > i && arg.charAt(i) == optionName.charAt(i)) { count++; } else { break; }
}
}
- final boolean result = count > 0 && count * 10 >= optionName2Field.size() * 9; // at least one prefix char in common with 9 out of 10 options
+ boolean result = count > 0 && count * 10 >= optionName2Field.size() * 9; // at least one prefix char in common with 9 out of 10 options
if (tracer.isDebug()) {tracer.debug("%s %s an option: %d matching prefix chars out of %d option names%n", arg, (result ? "resembles" : "doesn't resemble"), count, optionName2Field.size());}
return result;
}
- private void handleUnmatchedArguments(final String arg) {final Stack<String> args = new Stack<String>(); args.add(arg); handleUnmatchedArguments(args);}
- private void handleUnmatchedArguments(final Stack<String> args) {
+ private void handleUnmatchedArguments(String arg) {Stack<String> args = new Stack<String>(); args.add(arg); handleUnmatchedArguments(args);}
+ private void handleUnmatchedArguments(Stack<String> args) {
while (!args.isEmpty()) { unmatchedArguments.add(args.pop()); } // addAll would give args in reverse order
}
- private void processRemainderAsPositionalParameters(final Collection<Field> required, final Set<Field> initialized, final Stack<String> args) throws Exception {
+ private void processRemainderAsPositionalParameters(Collection<Field> required, Set<Field> initialized, Stack<String> args) throws Exception {
while (!args.empty()) {
processPositionalParameter(required, initialized, args);
}
}
- private void processPositionalParameter(final Collection<Field> required, final Set<Field> initialized, final Stack<String> args) throws Exception {
+ private void processPositionalParameter(Collection<Field> required, Set<Field> initialized, Stack<String> args) throws Exception {
if (tracer.isDebug()) {tracer.debug("Processing next arg as a positional parameter at index=%d. Remainder=%s%n", position, reverse((Stack<String>) args.clone()));}
int consumed = 0;
- for (final Field positionalParam : positionalParametersFields) {
- final Range indexRange = Range.parameterIndex(positionalParam);
+ for (Field positionalParam : positionalParametersFields) {
+ Range indexRange = Range.parameterIndex(positionalParam);
if (!indexRange.contains(position)) {
continue;
}
@SuppressWarnings("unchecked")
- final
Stack<String> argsCopy = (Stack<String>) args.clone();
- final Range arity = Range.parameterArity(positionalParam);
+ Range arity = Range.parameterArity(positionalParam);
if (tracer.isDebug()) {tracer.debug("Position %d is in index range %s. Trying to assign args to %s, arity=%s%n", position, indexRange, positionalParam, arity);}
assertNoMissingParameters(positionalParam, arity.min, argsCopy);
- final int originalSize = argsCopy.size();
+ int originalSize = argsCopy.size();
applyOption(positionalParam, Parameters.class, arity, false, argsCopy, initialized, "args[" + indexRange + "] at position " + position);
- final int count = originalSize - argsCopy.size();
+ int count = originalSize - argsCopy.size();
if (count > 0) { required.remove(positionalParam); }
consumed = Math.max(consumed, count);
}
@@ -2131,12 +2130,12 @@ public class CommandLine {
}
}
- private void processStandaloneOption(final Collection<Field> required,
- final Set<Field> initialized,
- final String arg,
- final Stack<String> args,
- final boolean paramAttachedToKey) throws Exception {
- final Field field = optionName2Field.get(arg);
+ private void processStandaloneOption(Collection<Field> required,
+ Set<Field> initialized,
+ String arg,
+ Stack<String> args,
+ boolean paramAttachedToKey) throws Exception {
+ Field field = optionName2Field.get(arg);
required.remove(field);
Range arity = Range.optionArity(field);
if (paramAttachedToKey) {
@@ -2146,19 +2145,19 @@ public class CommandLine {
applyOption(field, Option.class, arity, paramAttachedToKey, args, initialized, "option " + arg);
}
- private void processClusteredShortOptions(final Collection<Field> required,
- final Set<Field> initialized,
- final String arg,
- final Stack<String> args)
+ private void processClusteredShortOptions(Collection<Field> required,
+ Set<Field> initialized,
+ String arg,
+ Stack<String> args)
throws Exception {
- final String prefix = arg.substring(0, 1);
+ String prefix = arg.substring(0, 1);
String cluster = arg.substring(1);
boolean paramAttachedToOption = true;
do {
if (cluster.length() > 0 && singleCharOption2Field.containsKey(cluster.charAt(0))) {
- final Field field = singleCharOption2Field.get(cluster.charAt(0));
+ Field field = singleCharOption2Field.get(cluster.charAt(0));
Range arity = Range.optionArity(field);
- final String argDescription = "option " + prefix + cluster.charAt(0);
+ String argDescription = "option " + prefix + cluster.charAt(0);
if (tracer.isDebug()) {tracer.debug("Found option '%s%s' in %s: field %s, arity=%s%n", prefix, cluster.charAt(0), arg, field, arity);}
required.remove(field);
cluster = cluster.length() > 0 ? cluster.substring(1) : "";
@@ -2176,7 +2175,7 @@ public class CommandLine {
if (!empty(cluster)) {
args.push(cluster); // interpret remainder as option parameter
}
- final int consumed = applyOption(field, Option.class, arity, paramAttachedToOption, args, initialized, argDescription);
+ int consumed = applyOption(field, Option.class, arity, paramAttachedToOption, args, initialized, argDescription);
// only return if cluster (and maybe more) was consumed, otherwise continue do-while loop
if (empty(cluster) || consumed > 0 || args.isEmpty()) {
return;
@@ -2209,15 +2208,15 @@ public class CommandLine {
} while (true);
}
- private int applyOption(final Field field,
- final Class<?> annotation,
- final Range arity,
- final boolean valueAttachedToOption,
- final Stack<String> args,
- final Set<Field> initialized,
- final String argDescription) throws Exception {
+ private int applyOption(Field field,
+ Class<?> annotation,
+ Range arity,
+ boolean valueAttachedToOption,
+ Stack<String> args,
+ Set<Field> initialized,
+ String argDescription) throws Exception {
updateHelpRequested(field);
- final int length = args.size();
+ int length = args.size();
assertNoMissingParameters(field, arity.min, args);
Class<?> cls = field.getType();
@@ -2234,13 +2233,13 @@ public class CommandLine {
return applyValueToSingleValuedField(field, arity, args, cls, initialized, argDescription);
}
- private int applyValueToSingleValuedField(final Field field,
- final Range arity,
- final Stack<String> args,
- final Class<?> cls,
- final Set<Field> initialized,
- final String argDescription) throws Exception {
- final boolean noMoreValues = args.isEmpty();
+ private int applyValueToSingleValuedField(Field field,
+ Range arity,
+ Stack<String> args,
+ Class<?> cls,
+ Set<Field> initialized,
+ String argDescription) throws Exception {
+ boolean noMoreValues = args.isEmpty();
String value = args.isEmpty() ? null : trim(args.pop()); // unquote the value
int result = arity.min; // the number or args we need to consume
@@ -2254,16 +2253,16 @@ public class CommandLine {
if (value != null) {
args.push(value); // we don't consume the value
}
- final Boolean currentValue = (Boolean) field.get(command);
+ Boolean currentValue = (Boolean) field.get(command);
value = String.valueOf(currentValue == null ? true : !currentValue); // #147 toggle existing boolean value
}
}
if (noMoreValues && value == null) {
return 0;
}
- final ITypeConverter<?> converter = getTypeConverter(cls, field);
- final Object newValue = tryConvert(field, -1, converter, value, cls);
- final Object oldValue = field.get(command);
+ ITypeConverter<?> converter = getTypeConverter(cls, field);
+ Object newValue = tryConvert(field, -1, converter, value, cls);
+ Object oldValue = field.get(command);
TraceLevel level = TraceLevel.INFO;
String traceMessage = "Setting %s field '%s.%s' to '%5$s' (was '%4$s') for %6$s%n";
if (initialized != null) {
@@ -2282,34 +2281,34 @@ public class CommandLine {
field.set(command, newValue);
return result;
}
- private int applyValuesToMapField(final Field field,
- final Class<?> annotation,
- final Range arity,
- final Stack<String> args,
- final Class<?> cls,
- final String argDescription) throws Exception {
- final Class<?>[] classes = getTypeAttribute(field);
+ private int applyValuesToMapField(Field field,
+ Class<?> annotation,
+ Range arity,
+ Stack<String> args,
+ Class<?> cls,
+ String argDescription) throws Exception {
+ Class<?>[] classes = getTypeAttribute(field);
if (classes.length < 2) { throw new ParameterException(CommandLine.this, "Field " + field + " needs two types (one for the map key, one for the value) but only has " + classes.length + " types configured."); }
- final ITypeConverter<?> keyConverter = getTypeConverter(classes[0], field);
- final ITypeConverter<?> valueConverter = getTypeConverter(classes[1], field);
+ ITypeConverter<?> keyConverter = getTypeConverter(classes[0], field);
+ ITypeConverter<?> valueConverter = getTypeConverter(classes[1], field);
Map<Object, Object> result = (Map<Object, Object>) field.get(command);
if (result == null) {
result = createMap(cls);
field.set(command, result);
}
- final int originalSize = result.size();
+ int originalSize = result.size();
consumeMapArguments(field, arity, args, classes, keyConverter, valueConverter, result, argDescription);
return result.size() - originalSize;
}
- private void consumeMapArguments(final Field field,
- final Range arity,
- final Stack<String> args,
- final Class<?>[] classes,
- final ITypeConverter<?> keyConverter,
- final ITypeConverter<?> valueConverter,
- final Map<Object, Object> result,
- final String argDescription) throws Exception {
+ private void consumeMapArguments(Field field,
+ Range arity,
+ Stack<String> args,
+ Class<?>[] classes,
+ ITypeConverter<?> keyConverter,
+ ITypeConverter<?> valueConverter,
+ Map<Object, Object> result,
+ String argDescription) throws Exception {
// first do the arity.min mandatory parameters
for (int i = 0; i < arity.min; i++) {
consumeOneMapArgument(field, arity, args, classes, keyConverter, valueConverter, result, i, argDescription);
@@ -2325,19 +2324,19 @@ public class CommandLine {
}
}
- private void consumeOneMapArgument(final Field field,
- final Range arity,
- final Stack<String> args,
- final Class<?>[] classes,
- final ITypeConverter<?> keyConverter, final ITypeConverter<?> valueConverter,
- final Map<Object, Object> result,
- final int index,
- final String argDescription) throws Exception {
- final String[] values = split(trim(args.pop()), field);
- for (final String value : values) {
- final String[] keyValue = value.split("=");
+ private void consumeOneMapArgument(Field field,
+ Range arity,
+ Stack<String> args,
+ Class<?>[] classes,
+ ITypeConverter<?> keyConverter, ITypeConverter<?> valueConverter,
+ Map<Object, Object> result,
+ int index,
+ String argDescription) throws Exception {
+ String[] values = split(trim(args.pop()), field);
+ for (String value : values) {
+ String[] keyValue = value.split("=");
if (keyValue.length < 2) {
- final String splitRegex = splitRegex(field);
+ String splitRegex = splitRegex(field);
if (splitRegex.length() == 0) {
throw new ParameterException(CommandLine.this, "Value for option " + optionDescription("", field,
0) + " should be in KEY=VALUE format but was " + value);
@@ -2346,44 +2345,44 @@ public class CommandLine {
0) + " should be in KEY=VALUE[" + splitRegex + "KEY=VALUE]... format but was " + value);
}
}
- final Object mapKey = tryConvert(field, index, keyConverter, keyValue[0], classes[0]);
- final Object mapValue = tryConvert(field, index, valueConverter, keyValue[1], classes[1]);
+ Object mapKey = tryConvert(field, index, keyConverter, keyValue[0], classes[0]);
+ Object mapValue = tryConvert(field, index, valueConverter, keyValue[1], classes[1]);
result.put(mapKey, mapValue);
if (tracer.isInfo()) {tracer.info("Putting [%s : %s] in %s<%s, %s> field '%s.%s' for %s%n", String.valueOf(mapKey), String.valueOf(mapValue),
result.getClass().getSimpleName(), classes[0].getSimpleName(), classes[1].getSimpleName(), field.getDeclaringClass().getSimpleName(), field.getName(), argDescription);}
}
}
- private void checkMaxArityExceeded(final Range arity, final int remainder, final Field field, final String[] values) {
+ private void checkMaxArityExceeded(Range arity, int remainder, Field field, String[] values) {
if (values.length <= remainder) { return; }
- final String desc = arity.max == remainder ? "" + remainder : arity + ", remainder=" + remainder;
+ String desc = arity.max == remainder ? "" + remainder : arity + ", remainder=" + remainder;
throw new MaxValuesforFieldExceededException(CommandLine.this, optionDescription("", field, -1) +
" max number of values (" + arity.max + ") exceeded: remainder is " + remainder + " but " +
values.length + " values were specified: " + Arrays.toString(values));
}
- private int applyValuesToArrayField(final Field field,
- final Class<?> annotation,
- final Range arity,
- final Stack<String> args,
- final Class<?> cls,
- final String argDescription) throws Exception {
- final Object existing = field.get(command);
- final int length = existing == null ? 0 : Array.getLength(existing);
- final Class<?> type = getTypeAttribute(field)[0];
- final List<Object> converted = consumeArguments(field, annotation, arity, args, type, length, argDescription);
- final List<Object> newValues = new ArrayList<Object>();
+ private int applyValuesToArrayField(Field field,
+ Class<?> annotation,
+ Range arity,
+ Stack<String> args,
+ Class<?> cls,
+ String argDescription) throws Exception {
+ Object existing = field.get(command);
+ int length = existing == null ? 0 : Array.getLength(existing);
+ Class<?> type = getTypeAttribute(field)[0];
+ List<Object> converted = consumeArguments(field, annotation, arity, args, type, length, argDescription);
+ List<Object> newValues = new ArrayList<Object>();
for (int i = 0; i < length; i++) {
newValues.add(Array.get(existing, i));
}
- for (final Object obj : converted) {
+ for (Object obj : converted) {
if (obj instanceof Collection<?>) {
newValues.addAll((Collection<?>) obj);
} else {
newValues.add(obj);
}
}
- final Object array = Array.newInstance(type, newValues.size());
+ Object array = Array.newInstance(type, newValues.size());
field.set(command, array);
for (int i = 0; i < newValues.size(); i++) {
Array.set(array, i, newValues.get(i));
@@ -2392,21 +2391,21 @@ public class CommandLine {
}
@SuppressWarnings("unchecked")
- private int applyValuesToCollectionField(final Field field,
- final Class<?> annotation,
- final Range arity,
- final Stack<String> args,
- final Class<?> cls,
- final String argDescription) throws Exception {
+ private int applyValuesToCollectionField(Field field,
+ Class<?> annotation,
+ Range arity,
+ Stack<String> args,
+ Class<?> cls,
+ String argDescription) throws Exception {
Collection<Object> collection = (Collection<Object>) field.get(command);
- final Class<?> type = getTypeAttribute(field)[0];
- final int length = collection == null ? 0 : collection.size();
- final List<Object> converted = consumeArguments(field, annotation, arity, args, type, length, argDescription);
+ Class<?> type = getTypeAttribute(field)[0];
+ int length = collection == null ? 0 : collection.size();
+ List<Object> converted = consumeArguments(field, annotation, arity, args, type, length, argDescription);
if (collection == null) {
collection = createCollection(cls);
field.set(command, collection);
}
- for (final Object element : converted) {
+ for (Object element : converted) {
if (element instanceof Collection<?>) {
collection.addAll((Collection<?>) element);
} else {
@@ -2416,14 +2415,14 @@ public class CommandLine {
return converted.size();
}
- private List<Object> consumeArguments(final Field field,
- final Class<?> annotation,
- final Range arity,
- final Stack<String> args,
- final Class<?> type,
- final int originalSize,
- final String argDescription) throws Exception {
- final List<Object> result = new ArrayList<Object>();
+ private List<Object> consumeArguments(Field field,
+ Class<?> annotation,
+ Range arity,
+ Stack<String> args,
+ Class<?> type,
+ int originalSize,
+ String argDescription) throws Exception {
+ List<Object> result = new ArrayList<Object>();
// first do the arity.min mandatory parameters
for (int i = 0; i < arity.min; i++) {
@@ -2441,16 +2440,16 @@ public class CommandLine {
return result;
}
- private int consumeOneArgument(final Field field,
- final Range arity,
- final Stack<String> args,
- final Class<?> type,
- final List<Object> result,
+ private int consumeOneArgument(Field field,
+ Range arity,
+ Stack<String> args,
+ Class<?> type,
+ List<Object> result,
int index,
- final int originalSize,
- final String argDescription) throws Exception {
- final String[] values = split(trim(args.pop()), field);
- final ITypeConverter<?> converter = getTypeConverter(type, field);
+ int originalSize,
+ String argDescription) throws Exception {
+ String[] values = split(trim(args.pop()), field);
+ ITypeConverter<?> converter = getTypeConverter(type, field);
for (int j = 0; j < values.length; j++) {
result.add(tryConvert(field, index, converter, values[j], type));
@@ -2466,13 +2465,13 @@ public class CommandLine {
return ++index;
}
- private String splitRegex(final Field field) {
+ private String splitRegex(Field field) {
if (field.isAnnotationPresent(Option.class)) { return field.getAnnotation(Option.class).split(); }
if (field.isAnnotationPresent(Parameters.class)) { return field.getAnnotation(Parameters.class).split(); }
return "";
}
- private String[] split(final String value, final Field field) {
- final String regex = splitRegex(field);
+ private String[] split(String value, Field field) {
+ String regex = splitRegex(field);
return regex.length() == 0 ? new String[] {value} : value.split(regex);
}
@@ -2482,7 +2481,7 @@ public class CommandLine {
* @param arg the string to determine whether it is an option or not
* @return true if it is an option, false otherwise
*/
- private boolean isOption(final String arg) {
+ private boolean isOption(String arg) {
if ("--".equals(arg)) {
return true;
}
@@ -2490,7 +2489,7 @@ public class CommandLine {
if (optionName2Field.containsKey(arg)) { // -v or -f or --file (not attached to param or other option)
return true;
}
- final int separatorIndex = arg.indexOf(separator);
+ int separatorIndex = arg.indexOf(separator);
if (separatorIndex > 0) { // -f=FILE or --file==FILE (attached to param via separator)
if (optionName2Field.containsKey(arg.substring(0, separatorIndex))) {
return true;
@@ -2498,33 +2497,33 @@ public class CommandLine {
}
return (arg.length() > 2 && arg.startsWith("-") && singleCharOption2Field.containsKey(arg.charAt(1)));
}
- private Object tryConvert(final Field field, final int index, final ITypeConverter<?> converter, final String value, final Class<?> type)
+ private Object tryConvert(Field field, int index, ITypeConverter<?> converter, String value, Class<?> type)
throws Exception {
try {
return converter.convert(value);
- } catch (final TypeConversionException ex) {
+ } catch (TypeConversionException ex) {
throw new ParameterException(CommandLine.this, ex.getMessage() + optionDescription(" for ", field, index));
- } catch (final Exception other) {
- final String desc = optionDescription(" for ", field, index) + ": " + other;
+ } catch (Exception other) {
+ String desc = optionDescription(" for ", field, index) + ": " + other;
throw new ParameterException(CommandLine.this, "Could not convert '" + value + "' to " + type.getSimpleName() + desc, other);
}
}
- private String optionDescription(final String prefix, final Field field, final int index) {
- final Help.IParamLabelRenderer labelRenderer = Help.createMinimalParamLabelRenderer();
+ private String optionDescription(String prefix, Field field, int index) {
+ Help.IParamLabelRenderer labelRenderer = Help.createMinimalParamLabelRenderer();
String desc = "";
if (field.isAnnotationPresent(Option.class)) {
desc = prefix + "option '" + field.getAnnotation(Option.class).names()[0] + "'";
if (index >= 0) {
- final Range arity = Range.optionArity(field);
+ Range arity = Range.optionArity(field);
if (arity.max > 1) {
desc += " at index " + index;
}
desc += " (" + labelRenderer.renderParameterLabel(field, Help.Ansi.OFF, Collections.<IStyle>emptyList()) + ")";
}
} else if (field.isAnnotationPresent(Parameters.class)) {
- final Range indexRange = Range.parameterIndex(field);
- final Text label = labelRenderer.renderParameterLabel(field, Help.Ansi.OFF, Collections.<IStyle>emptyList());
+ Range indexRange = Range.parameterIndex(field);
+ Text label = labelRenderer.renderParameterLabel(field, Help.Ansi.OFF, Collections.<IStyle>emptyList());
desc = prefix + "positional parameter at index " + indexRange + " (" + label + ")";
}
return desc;
@@ -2532,19 +2531,19 @@ public class CommandLine {
private boolean isAnyHelpRequested() { return isHelpRequested || versionHelpRequested || usageHelpRequested; }
- private void updateHelpRequested(final Field field) {
+ private void updateHelpRequested(Field field) {
if (field.isAnnotationPresent(Option.class)) {
isHelpRequested |= is(field, "help", field.getAnnotation(Option.class).help());
CommandLine.this.versionHelpRequested |= is(field, "versionHelp", field.getAnnotation(Option.class).versionHelp());
CommandLine.this.usageHelpRequested |= is(field, "usageHelp", field.getAnnotation(Option.class).usageHelp());
}
}
- private boolean is(final Field f, final String description, final boolean value) {
+ private boolean is(Field f, String description, boolean value) {
if (value) { if (tracer.isInfo()) {tracer.info("Field '%s.%s' has '%s' annotation: not validating required fields%n", f.getDeclaringClass().getSimpleName(), f.getName(), description); }}
return value;
}
@SuppressWarnings("unchecked")
- private Collection<Object> createCollection(final Class<?> collectionClass) throws Exception {
+ private Collection<Object> createCollection(Class<?> collectionClass) throws Exception {
if (collectionClass.isInterface()) {
if (List.class.isAssignableFrom(collectionClass)) {
return new ArrayList<Object>();
@@ -2560,14 +2559,14 @@ public class CommandLine {
// custom Collection implementation class must have default constructor
return (Collection<Object>) collectionClass.newInstance();
}
- private Map<Object, Object> createMap(final Class<?> mapClass) throws Exception {
+ private Map<Object, Object> createMap(Class<?> mapClass) throws Exception {
try { // if it is an implementation class, instantiate it
return (Map<Object, Object>) mapClass.newInstance();
- } catch (final Exception ignored) {}
+ } catch (Exception ignored) {}
return new LinkedHashMap<Object, Object>();
}
- private ITypeConverter<?> getTypeConverter(final Class<?> type, final Field field) {
- final ITypeConverter<?> result = converterRegistry.get(type);
+ private ITypeConverter<?> getTypeConverter(final Class<?> type, Field field) {
+ ITypeConverter<?> result = converterRegistry.get(type);
if (result != null) {
return result;
}
@@ -2575,7 +2574,7 @@ public class CommandLine {
return new ITypeConverter<Object>() {
@Override
@SuppressWarnings("unchecked")
- public Object convert(final String value) throws Exception {
+ public Object convert(String value) throws Exception {
return Enum.valueOf((Class<Enum>) type, value);
}
};
@@ -2583,15 +2582,15 @@ public class CommandLine {
throw new MissingTypeConverterException(CommandLine.this, "No TypeConverter registered for " + type.getName() + " of field " + field);
}
- private void assertNoMissingParameters(final Field field, final int arity, final Stack<String> args) {
+ private void assertNoMissingParameters(Field field, int arity, Stack<String> args) {
if (arity > args.size()) {
if (arity == 1) {
if (field.isAnnotationPresent(Option.class)) {
throw new MissingParameterException(CommandLine.this, "Missing required parameter for " +
optionDescription("", field, 0));
}
- final Range indexRange = Range.parameterIndex(field);
- final Help.IParamLabelRenderer labelRenderer = Help.createMinimalParamLabelRenderer();
+ Range indexRange = Range.parameterIndex(field);
+ Help.IParamLabelRenderer labelRenderer = Help.createMinimalParamLabelRenderer();
String sep = "";
String names = "";
int count = 0;
@@ -2604,7 +2603,7 @@ public class CommandLine {
}
}
String msg = "Missing required parameter";
- final Range paramArity = Range.parameterArity(field);
+ Range paramArity = Range.parameterArity(field);
if (paramArity.isVariable) {
msg += "s at positions " + indexRange + ": ";
} else {
@@ -2620,11 +2619,11 @@ public class CommandLine {
" requires at least " + arity + " values, but only " + args.size() + " were specified: " + reverse(args));
}
}
- private String trim(final String value) {
+ private String trim(String value) {
return unquote(value);
}
- private String unquote(final String value) {
+ private String unquote(String value) {
return value == null
? null
: (value.length() > 1 && value.startsWith("\"") && value.endsWith("\""))
@@ -2634,8 +2633,8 @@ public class CommandLine {
}
private static class PositionalParametersSorter implements Comparator<Field> {
@Override
- public int compare(final Field o1, final Field o2) {
- final int result = Range.parameterIndex(o1).compareTo(Range.parameterIndex(o2));
+ public int compare(Field o1, Field o2) {
+ int result = Range.parameterIndex(o1).compareTo(Range.parameterIndex(o2));
return (result == 0) ? Range.parameterArity(o1).compareTo(Range.parameterArity(o2)) : result;
}
}
@@ -2648,25 +2647,25 @@ public class CommandLine {
}
static class StringConverter implements ITypeConverter<String> {
@Override
- public String convert(final String value) { return value; }
+ public String convert(String value) { return value; }
}
static class StringBuilderConverter implements ITypeConverter<StringBuilder> {
@Override
- public StringBuilder convert(final String value) { return new StringBuilder(value); }
+ public StringBuilder convert(String value) { return new StringBuilder(value); }
}
static class CharSequenceConverter implements ITypeConverter<CharSequence> {
@Override
- public String convert(final String value) { return value; }
+ public String convert(String value) { return value; }
}
/** Converts text to a {@code Byte} by delegating to {@link Byte#valueOf(String)}.*/
static class ByteConverter implements ITypeConverter<Byte> {
@Override
- public Byte convert(final String value) { return Byte.valueOf(value); }
+ public Byte convert(String value) { return Byte.valueOf(value); }
}
/** Converts {@code "true"} or {@code "false"} to a {@code Boolean}. Other values result in a ParameterException.*/
static class BooleanConverter implements ITypeConverter<Boolean> {
@Override
- public Boolean convert(final String value) {
+ public Boolean convert(String value) {
if ("true".equalsIgnoreCase(value) || "false".equalsIgnoreCase(value)) {
return Boolean.parseBoolean(value);
} else {
@@ -2676,7 +2675,7 @@ public class CommandLine {
}
static class CharacterConverter implements ITypeConverter<Character> {
@Override
- public Character convert(final String value) {
+ public Character convert(String value) {
if (value.length() > 1) {
throw new TypeConversionException("'" + value + "' is not a single character");
}
@@ -2686,45 +2685,45 @@ public class CommandLine {
/** Converts text to a {@code Short} by delegating to {@link Short#valueOf(String)}.*/
static class ShortConverter implements ITypeConverter<Short> {
@Override
- public Short convert(final String value) { return Short.valueOf(value); }
+ public Short convert(String value) { return Short.valueOf(value); }
}
/** Converts text to an {@code Integer} by delegating to {@link Integer#valueOf(String)}.*/
static class IntegerConverter implements ITypeConverter<Integer> {
@Override
- public Integer convert(final String value) { return Integer.valueOf(value); }
+ public Integer convert(String value) { return Integer.valueOf(value); }
}
/** Converts text to a {@code Long} by delegating to {@link Long#valueOf(String)}.*/
static class LongConverter implements ITypeConverter<Long> {
@Override
- public Long convert(final String value) { return Long.valueOf(value); }
+ public Long convert(String value) { return Long.valueOf(value); }
}
static class FloatConverter implements ITypeConverter<Float> {
@Override
- public Float convert(final String value) { return Float.valueOf(value); }
+ public Float convert(String value) { return Float.valueOf(value); }
}
static class DoubleConverter implements ITypeConverter<Double> {
@Override
- public Double convert(final String value) { return Double.valueOf(value); }
+ public Double convert(String value) { return Double.valueOf(value); }
}
static class FileConverter implements ITypeConverter<File> {
@Override
- public File convert(final String value) { return new File(value); }
+ public File convert(String value) { return new File(value); }
}
static class URLConverter implements ITypeConverter<URL> {
@Override
- public URL convert(final String value) throws MalformedURLException { return new URL(value); }
+ public URL convert(String value) throws MalformedURLException { return new URL(value); }
}
static class URIConverter implements ITypeConverter<URI> {
@Override
- public URI convert(final String value) throws URISyntaxException { return new URI(value); }
+ public URI convert(String value) throws URISyntaxException { return new URI(value); }
}
/** Converts text in {@code yyyy-mm-dd} format to a {@code java.util.Date}. ParameterException on failure. */
static class ISO8601DateConverter implements ITypeConverter<Date> {
@Override
- public Date convert(final String value) {
+ public Date convert(String value) {
try {
return new SimpleDateFormat("yyyy-MM-dd").parse(value);
- } catch (final ParseException e) {
+ } catch (ParseException e) {
throw new TypeConversionException("'" + value + "' is not a yyyy-MM-dd date");
}
}
@@ -2733,7 +2732,7 @@ public class CommandLine {
* {@code HH:mm:ss.SSS}, {@code HH:mm:ss,SSS}. Other formats result in a ParameterException. */
static class ISO8601TimeConverter implements ITypeConverter<Time> {
@Override
- public Time convert(final String value) {
+ public Time convert(String value) {
try {
if (value.length() <= 5) {
return new Time(new SimpleDateFormat("HH:mm").parse(value).getTime());
@@ -2742,11 +2741,11 @@ public class CommandLine {
} else if (value.length() <= 12) {
try {
return new Time(new SimpleDateFormat("HH:mm:ss.SSS").parse(value).getTime());
- } catch (final ParseException e2) {
+ } catch (ParseException e2) {
return new Time(new SimpleDateFormat("HH:mm:ss,SSS").parse(value).getTime());
}
}
- } catch (final ParseException ignored) {
+ } catch (ParseException ignored) {
// ignored because we throw a ParameterException below
}
throw new TypeConversionException("'" + value + "' is not a HH:mm[:ss[.SSS]] time");
@@ -2754,28 +2753,28 @@ public class CommandLine {
}
static class BigDecimalConverter implements ITypeConverter<BigDecimal> {
@Override
- public BigDecimal convert(final String value) { return new BigDecimal(value); }
+ public BigDecimal convert(String value) { return new BigDecimal(value); }
}
static class BigIntegerConverter implements ITypeConverter<BigIntege
<TRUNCATED>