Jeff Thomas created LOG4J2-3694:
-----------------------------------

             Summary: Javadoc: TypeConverters convert for "Level" incorrectly 
documents behaviour for invalid value
                 Key: LOG4J2-3694
                 URL: https://issues.apache.org/jira/browse/LOG4J2-3694
             Project: Log4j 2
          Issue Type: Bug
          Components: API, Configuration
    Affects Versions: 2.24.0
            Reporter: Jeff Thomas


Minor Javadoc correction.

In TypeConverters, the conversion for type "Level" says it returns 'null' for 
invalid levels:
{code:java}
/**
 * Converts a {@link String} into a Log4j {@link Level}. Returns {@code null} 
for invalid level names.
 */
@Plugin(name = "Level", category = CATEGORY)
public static class LevelConverter implements TypeConverter<Level> {
    @Override
    public Level convert(final String s) {
        return Level.valueOf(s);
    }
} {code}
But {{Level.valueOf(s)}} throws an IllegalArgumentException for unknown levels.
 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to