This is an automated email from the ASF dual-hosted git repository.
jwthomas pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/2.x by this push:
new d8cbe77a0a Bugfix/log4 j 3359 2 (#3502)
d8cbe77a0a is described below
commit d8cbe77a0a1f60e6708a2bd8f84ea2fb8666c95a
Author: JWT <[email protected]>
AuthorDate: Thu Feb 27 13:25:15 2025 +0100
Bugfix/log4 j 3359 2 (#3502)
* Fixed TypeConverters#LevelConverter javadoc (#3359)
* Moved changelog to .2.x.x per PR Code Review (#3359)
---------
Co-authored-by: Jeff Thomas <[email protected]>
---
.../log4j/core/config/plugins/convert/TypeConverters.java | 9 ++++++++-
src/changelog/.2.x.x/3359_fix-javadoc.xml | 10 ++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
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 3e005f07c5..6c81224c2d 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
@@ -285,10 +285,17 @@ public final class TypeConverters {
}
/**
- * Converts a {@link String} into a Log4j {@link Level}. Returns {@code
null} for invalid level names.
+ * Converts a {@link String} into a Log4j {@link Level}.
*/
@Plugin(name = "Level", category = CATEGORY)
public static class LevelConverter implements TypeConverter<Level> {
+ /**
+ * {@inheritDoc}
+ * @param s the string to convert
+ * @return the resolved level
+ * @throws NullPointerException if the given value is {@code null}.
+ * @throws IllegalArgumentException if the given argument is not
resolvable to a level
+ */
@Override
public Level convert(final String s) {
return Level.valueOf(s);
diff --git a/src/changelog/.2.x.x/3359_fix-javadoc.xml
b/src/changelog/.2.x.x/3359_fix-javadoc.xml
new file mode 100644
index 0000000000..4e0a3dffb7
--- /dev/null
+++ b/src/changelog/.2.x.x/3359_fix-javadoc.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="https://logging.apache.org/xml/ns"
+ xsi:schemaLocation="https://logging.apache.org/xml/ns
https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
+ type="fixed">
+ <issue id="3359"
link="https://github.com/apache/logging-log4j2/issues/3359"/>
+ <description format="asciidoc">
+ TypeConverters convert for "Level" incorrectly documented behaviour for
invalid value - updated javadoc.
+ </description>
+</entry>