This is an automated email from the ASF dual-hosted git repository.
rgoers pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/master by this push:
new becc80a73a Fix Typos
becc80a73a is described below
commit becc80a73aeda5f2e504449679fa3a7f1554662e
Author: Ralph Goers <[email protected]>
AuthorDate: Wed Sep 7 15:38:48 2022 -0700
Fix Typos
---
.../src/main/java/org/apache/log4j/Category.java | 4 +-
.../org/apache/log4j/helpers/OptionConverter.java | 2 +-
.../org/apache/log4j/spi/AppenderAttachable.java | 2 +-
.../src/test/java/org/apache/log4j/xml/XLevel.java | 2 +-
.../log4j/util/Log4jCharsetsPropertiesTest.java | 2 +-
.../org/apache/logging/log4j/util/Strings.java | 2 +-
log4j-cassandra/src/test/resources/cassandra.yaml | 4 +-
.../appender/MemoryMappedFileAppenderTest.java | 2 +-
.../core/appender/ReconfigureAppenderTest.java | 2 +-
.../log4j/core/async/perftest/IdleStrategy.java | 2 +-
.../logging/log4j/core/appender/AppenderSet.java | 2 +-
.../core/appender/routing/RoutingAppender.java | 2 +-
.../logging/log4j/core/lookup/DateLookup.java | 2 +-
.../org/apache/logging/log4j/core/util/Loader.java | 4 +-
.../org/apache/logging/log4j/core/util/Source.java | 2 +-
.../apache/logging/log4j/docker/DockerLookup.java | 47 +++++++++++-----------
src/site/asciidoc/manual/configuration.adoc | 2 +-
17 files changed, 43 insertions(+), 42 deletions(-)
diff --git a/log4j-1.2-api/src/main/java/org/apache/log4j/Category.java
b/log4j-1.2-api/src/main/java/org/apache/log4j/Category.java
index 0ebffc9c77..56948f63c0 100644
--- a/log4j-1.2-api/src/main/java/org/apache/log4j/Category.java
+++ b/log4j-1.2-api/src/main/java/org/apache/log4j/Category.java
@@ -430,7 +430,7 @@ public class Category implements AppenderAttachable {
}
/**
- * Gets the the {@link LoggerRepository} where this <code>Category</code>
instance is attached.
+ * Gets the {@link LoggerRepository} where this <code>Category</code>
instance is attached.
*
* @deprecated Please use {@link #getLoggerRepository()} instead.
* @since 1.1
@@ -453,7 +453,7 @@ public class Category implements AppenderAttachable {
}
/**
- * Gets the the {@link LoggerRepository} where this <code>Category</code>
is attached.
+ * Gets the {@link LoggerRepository} where this <code>Category</code> is
attached.
*
* @since 1.2
*/
diff --git
a/log4j-1.2-api/src/main/java/org/apache/log4j/helpers/OptionConverter.java
b/log4j-1.2-api/src/main/java/org/apache/log4j/helpers/OptionConverter.java
index 54b01d06b2..a96282b061 100644
--- a/log4j-1.2-api/src/main/java/org/apache/log4j/helpers/OptionConverter.java
+++ b/log4j-1.2-api/src/main/java/org/apache/log4j/helpers/OptionConverter.java
@@ -559,7 +559,7 @@ public class OptionConverter {
* </p>
*
* <p>
- * Case of <code>value</code> is insignificant for the level level, but is
+ * Case of <code>value</code> is insignificant for the level, but is
* significant for the class name part, if present.
* </p>
*
diff --git
a/log4j-1.2-api/src/main/java/org/apache/log4j/spi/AppenderAttachable.java
b/log4j-1.2-api/src/main/java/org/apache/log4j/spi/AppenderAttachable.java
index bdc2aa9ec1..261c5bb84a 100644
--- a/log4j-1.2-api/src/main/java/org/apache/log4j/spi/AppenderAttachable.java
+++ b/log4j-1.2-api/src/main/java/org/apache/log4j/spi/AppenderAttachable.java
@@ -48,7 +48,7 @@ public interface AppenderAttachable {
/**
* Returns <code>true</code> if the specified appender is in list of
- * attached attached, <code>false</code> otherwise.
+ * attached, <code>false</code> otherwise.
* @param appender The Appender to check.
* @return true if the Appender is attached.
*
diff --git a/log4j-1.2-api/src/test/java/org/apache/log4j/xml/XLevel.java
b/log4j-1.2-api/src/test/java/org/apache/log4j/xml/XLevel.java
index b0503b76cc..d90438c070 100644
--- a/log4j-1.2-api/src/test/java/org/apache/log4j/xml/XLevel.java
+++ b/log4j-1.2-api/src/test/java/org/apache/log4j/xml/XLevel.java
@@ -20,7 +20,7 @@ package org.apache.log4j.xml;
import org.apache.log4j.Level;
/**
- * This class introduces a new level level called TRACE. TRACE has lower level
than DEBUG.
+ * This class introduces a new level called TRACE. TRACE has lower level than
DEBUG.
*/
public class XLevel extends Level {
private static final long serialVersionUID = 7288304330257085144L;
diff --git
a/log4j-api-test/src/test/java/org/apache/logging/log4j/util/Log4jCharsetsPropertiesTest.java
b/log4j-api-test/src/test/java/org/apache/logging/log4j/util/Log4jCharsetsPropertiesTest.java
index 4c71babf70..5666fa321d 100644
---
a/log4j-api-test/src/test/java/org/apache/logging/log4j/util/Log4jCharsetsPropertiesTest.java
+++
b/log4j-api-test/src/test/java/org/apache/logging/log4j/util/Log4jCharsetsPropertiesTest.java
@@ -42,7 +42,7 @@ public class Log4jCharsetsPropertiesTest {
String value = resourceBundle.getString(key);
assertTrue(
Charset.isSupported(value),
- String.format("The Charset %s is is not available and is
mapped from %s", value, key));
+ String.format("The Charset %s is not available and is
mapped from %s", value, key));
}
}
}
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 305a696c93..174cd618e1 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
@@ -67,7 +67,7 @@ public final class Strings {
* {@code null}, empty, or all characters are {@link
Character#isWhitespace(char)}.
*
* @param s the String to check, may be {@code null}
- * @return {@code true} if the String is {@code null}, empty, or or all
characters are {@link Character#isWhitespace(char)}
+ * @return {@code true} if the String is {@code null}, empty, or all
characters are {@link Character#isWhitespace(char)}
*/
public static boolean isBlank(final String s) {
if (s == null || s.isEmpty()) {
diff --git a/log4j-cassandra/src/test/resources/cassandra.yaml
b/log4j-cassandra/src/test/resources/cassandra.yaml
index 356e43dc2d..aab593b3e4 100644
--- a/log4j-cassandra/src/test/resources/cassandra.yaml
+++ b/log4j-cassandra/src/test/resources/cassandra.yaml
@@ -380,7 +380,7 @@ memtable_allocation_type: heap_buffers
# to the number of cores.
#memtable_flush_writers: 8
-# A fixed memory pool size in MB for for SSTable index summaries. If left
+# A fixed memory pool size in MB for SSTable index summaries. If left
# empty, this will default to 5% of the heap size. If the memory usage of
# all index summaries exceeds this limit, SSTables with low read rates will
# shrink their index summaries in order to meet this limit. However, this
@@ -549,7 +549,7 @@ rpc_server_type: sync
# Uncomment to set socket buffer size for internode communication
# Note that when setting this, the buffer size is limited by net.core.wmem_max
-# and when not setting it it is defined by net.ipv4.tcp_wmem
+# and when not setting it is defined by net.ipv4.tcp_wmem
# See:
# /proc/sys/net/core/wmem_max
# /proc/sys/net/core/rmem_max
diff --git
a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppenderTest.java
b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppenderTest.java
index ad7ee71ac1..d33b0ca6c5 100644
---
a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppenderTest.java
+++
b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppenderTest.java
@@ -36,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
- * Tests that logged strings appear in the file, that the initial file size is
the specified specified region length,
+ * Tests that logged strings appear in the file, that the initial file size is
the 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
diff --git
a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/ReconfigureAppenderTest.java
b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/ReconfigureAppenderTest.java
index 4188611f57..62be878899 100644
---
a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/ReconfigureAppenderTest.java
+++
b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/ReconfigureAppenderTest.java
@@ -46,7 +46,7 @@ public class ReconfigureAppenderTest {
this.createAndAddAppender();
// let's write something to the logger to ensure the output
stream is opened.
- // We expect this call to create a a new output stream (which
is does).
+ // We expect this call to create a new output stream (which is
does).
// see OutputStreamManager.writeToDestination(...).
Logger logger = (Logger)LogManager.getLogger(this.getClass());
logger.info("test message 1");
diff --git
a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/async/perftest/IdleStrategy.java
b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/async/perftest/IdleStrategy.java
index 65b97df77d..f73e3313b8 100644
---
a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/async/perftest/IdleStrategy.java
+++
b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/async/perftest/IdleStrategy.java
@@ -21,7 +21,7 @@ package org.apache.logging.log4j.core.async.perftest;
*
* <h3>Note regarding potential for TTSP(Time To Safe Point) issues</h3>
*
- * If the caller spins in a 'counted' loop, and the implementation does not
include a a safepoint poll this may cause a TTSP
+ * If the caller spins in a 'counted' loop, and the implementation does not
include a safepoint poll this may cause a TTSP
* (Time To SafePoint) problem. If this is the case for your application you
can solve it by preventing the idle method from
* being inlined by using a Hotspot compiler command as a JVM argument e.g:
*
<code>-XX:CompileCommand=dontinline,org.apache.logging.log4j.core.async.perftest.NoOpIdleStrategy::idle</code>
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 8e89c6a3db..0e95e350d5 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
@@ -66,7 +66,7 @@ public class AppenderSet {
for (final Node childNode : children) {
final String key = childNode.getAttributes().get("name");
if (key == null) {
- LOGGER.error("The attribute 'name' is missing from from
the node {} in AppenderSet {}",
+ LOGGER.error("The attribute 'name' is missing from the
node {} in AppenderSet {}",
childNode, children);
} else {
map.put(key, childNode);
diff --git
a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
index ddf7bde335..ad9ae0954b 100644
---
a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
+++
b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
@@ -406,7 +406,7 @@ public final class RoutingAppender extends AbstractAppender
{
* LOG4J2-2629: PurgePolicy implementations can invoke {@link
#deleteAppender(String)} after we have looked up
* an instance of a target appender but before events are appended, which
could result in events not being
* recorded to any appender.
- * This extension of {@link AppenderControl} allows to to mark usage of an
appender, allowing deferral of
+ * This extension of {@link AppenderControl} allows to mark usage of an
appender, allowing deferral of
* {@link Appender#stop()} until events have successfully been recorded.
* Alternative approaches considered:
* - More aggressive synchronization: Appenders may do expensive I/O that
shouldn't block routing.
diff --git
a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/DateLookup.java
b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/DateLookup.java
index cb8c8e9609..dd94ac07fc 100644
---
a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/DateLookup.java
+++
b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/DateLookup.java
@@ -49,7 +49,7 @@ public class DateLookup implements StrLookup {
}
/**
- * Looks up the the current date or the date in the LogEvent.
+ * Looks up d the current date or the date in the LogEvent.
* @param event The LogEvent for which the date is returned. If null,
current date is returned.
* @param key the format to use. If null, the default DateFormat will be
used.
* @return The formatted date, never null.
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 4cbed02b37..724a28ac13 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
@@ -76,7 +76,7 @@ public final class Loader {
* class ({@code Loader}). Under JDK 1.1, only the class
* loader that loaded this class ({@code Loader}) is used.</li>
* <li>Try one last time with
- * {@code ClassLoader.getSystemResource(resource)}, that is is
+ * {@code ClassLoader.getSystemResource(resource)}, that is
* using the system class loader in JDK 1.2 and virtual machine's
* built-in class loader in JDK 1.1.</li>
* </ol>
@@ -138,7 +138,7 @@ public final class Loader {
* class ({@code Loader}). Under JDK 1.1, only the class
* loader that loaded this class ({@code Loader}) is used.</li>
* <li>Try one last time with
- * {@code ClassLoader.getSystemResource(resource)}, that is is
+ * {@code ClassLoader.getSystemResource(resource)}, that is
* using the system class loader in JDK 1.2 and virtual machine's
* built-in class loader in JDK 1.1.</li>
* </ol>
diff --git
a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Source.java
b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Source.java
index e612634a62..8d45900075 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Source.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Source.java
@@ -145,7 +145,7 @@ public class Source {
* Constructs a new {@code Source} from the specified URL.
*
* @param url the URL where the input stream originated
- * @throws IllegalArgumentException if this URL is not formatted strictly
according to to RFC2396 and cannot be
+ * @throws IllegalArgumentException if this URL is not formatted strictly
according to RFC2396 and cannot be
* converted to a URI.
*/
public Source(final URL url) {
diff --git
a/log4j-docker/src/main/java/org/apache/logging/log4j/docker/DockerLookup.java
b/log4j-docker/src/main/java/org/apache/logging/log4j/docker/DockerLookup.java
index d030502956..95398667b6 100644
---
a/log4j-docker/src/main/java/org/apache/logging/log4j/docker/DockerLookup.java
+++
b/log4j-docker/src/main/java/org/apache/logging/log4j/docker/DockerLookup.java
@@ -16,29 +16,28 @@
*/
package org.apache.logging.log4j.docker;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.config.plugins.Plugin;
import org.apache.logging.log4j.core.lookup.AbstractLookup;
-import org.apache.logging.log4j.core.lookup.Lookup;
+import org.apache.logging.log4j.core.lookup.StrLookup;
import org.apache.logging.log4j.core.util.NetUtils;
import org.apache.logging.log4j.docker.model.Container;
import org.apache.logging.log4j.docker.model.Network;
-import org.apache.logging.log4j.plugins.Plugin;
import org.apache.logging.log4j.status.StatusLogger;
import org.apache.logging.log4j.util.PropertiesUtil;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.List;
-import java.util.Map;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
/**
- *
+ * Looks up keys for a Docker container.
*/
-@Lookup
-@Plugin("docker")
+@Plugin(name = "docker", category = StrLookup.CATEGORY)
public class DockerLookup extends AbstractLookup {
private static final Logger LOGGER = StatusLogger.getLogger();
@@ -46,10 +45,13 @@ public class DockerLookup extends AbstractLookup {
private static final String HTTP = "http";
private final Container container;
+ /**
+ * Constructs a new instance.
+ */
public DockerLookup() {
String baseUri = System.getenv(DOCKER_URI);
if (baseUri == null) {
- final PropertiesUtil props = PropertiesUtil.getProperties();
+ PropertiesUtil props = PropertiesUtil.getProperties();
baseUri = props.getStringProperty(DOCKER_URI);
}
if (baseUri == null) {
@@ -59,18 +61,17 @@ public class DockerLookup extends AbstractLookup {
}
Container current = null;
try {
- final URL url = new URL(baseUri + "/containers/json");
-
+ URL url= new URL(baseUri + "/containers/json");
if (url.getProtocol().equals(HTTP)) {
- final String macAddr = NetUtils.getMacAddressString();
- final ObjectMapper objectMapper = new ObjectMapper();
- final List<Container> containerList =
objectMapper.readValue(url, new TypeReference<List<Container>>(){});
+ String macAddr = NetUtils.getMacAddressString();
+ ObjectMapper objectMapper = new ObjectMapper();
+ List<Container> containerList = objectMapper.readValue(url,
new TypeReference<List<Container>>(){});
- for (final Container container : containerList) {
+ for (Container container : containerList) {
if (macAddr != null && container.getNetworkSettings() !=
null) {
- final Map<String, Network> networks =
container.getNetworkSettings().getNetworks();
+ Map<String, Network> networks =
container.getNetworkSettings().getNetworks();
if (networks != null) {
- for (final Network network: networks.values()) {
+ for (Network network: networks.values()) {
if (macAddr.equals(network.getMacAddress())) {
current = container;
break;
@@ -86,14 +87,14 @@ public class DockerLookup extends AbstractLookup {
if (current == null) {
LOGGER.warn("Unable to determine current container");
}
- } catch (final IOException ioe) {
+ } catch (IOException ioe) {
LOGGER.warn("Unable to read container information: " +
ioe.getMessage());
}
container = current;
}
@Override
- public String lookup(final LogEvent event, final String key) {
+ public String lookup(LogEvent event, String key) {
if (container == null) {
return null;
}
diff --git a/src/site/asciidoc/manual/configuration.adoc
b/src/site/asciidoc/manual/configuration.adoc
index 60fea2a03a..429166cca9 100644
--- a/src/site/asciidoc/manual/configuration.adoc
+++ b/src/site/asciidoc/manual/configuration.adoc
@@ -656,7 +656,7 @@ The concise format makes configuration very easy as the
element names match
the components they represent however it cannot be validated with an XML
schema. For example, the ConsoleAppender is configured by declaring an
XML element named Console under its parent appenders element. However,
-element and attribute names are are not case sensitive. In addition,
+element and attribute names are not case sensitive. In addition,
attributes can either be specified as an XML attribute or as an XML
element that has no attributes and has a text value. So