Apache logging services logo Apache log4j logo

PMD Results

The following document contains the results of PMD 5.3.5.

Files

org/apache/logging/log4j/core/appender/AsyncAppender.java

Violation Line
Avoid empty catch blocks 295297
Avoid empty catch blocks 340342

org/apache/logging/log4j/core/appender/MemoryMappedFileManager.java

Violation Line
Useless parentheses. 344

org/apache/logging/log4j/core/appender/RollingRandomAccessFileAppender.java

Violation Line
Avoid unused constructor parameters such as 'bufferSize'. 57

org/apache/logging/log4j/core/appender/db/jdbc/ColumnConfig.java

Violation Line
Useless parentheses. 120
Useless parentheses. 120
Useless parentheses. 120

org/apache/logging/log4j/core/appender/db/jpa/converter/StackTraceElementAttributeConverter.java

Violation Line
Avoid empty catch blocks 7173

org/apache/logging/log4j/core/appender/mom/JmsManager.java

Violation Line
Avoid empty catch blocks 129130
Avoid empty catch blocks 133134

org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java

Violation Line
Overriding method merely calls super 7375

org/apache/logging/log4j/core/appender/rolling/OnStartupTriggeringPolicy.java

Violation Line
Avoid unused imports such as 'java.lang.reflect.Method' 19
Avoid unused imports such as 'org.apache.logging.log4j.core.util.Loader' 24
Avoid unused imports such as 'org.apache.logging.log4j.status.StatusLogger' 25
Avoid unused private fields such as 'manager'. 32

org/apache/logging/log4j/core/appender/rolling/PatternProcessor.java

Violation Line
Avoid unused private methods such as 'patternContains(String,char)'. 290

org/apache/logging/log4j/core/appender/rolling/RollingFileManager.java

Violation Line
Avoid unused constructor parameters such as 'bufferSize'. 62

org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java

Violation Line
Avoid unused constructor parameters such as 'immediateFlush'. 47

org/apache/logging/log4j/core/appender/rolling/action/Duration.java

Violation Line
These nested if statements could be combined 122138
Useless parentheses. 168

org/apache/logging/log4j/core/appender/rolling/action/FileRenameAction.java

Violation Line
Avoid unused imports such as 'java.io.FileInputStream' 20
Avoid unused imports such as 'java.io.FileOutputStream' 21
Avoid unused imports such as 'java.io.IOException' 22
Avoid unused imports such as 'java.nio.channels.FileChannel' 23

org/apache/logging/log4j/core/appender/rolling/action/ScriptCondition.java

Violation Line
These nested if statements could be combined 111114

org/apache/logging/log4j/core/async/AsyncLoggerConfigDisruptor.java

Violation Line
Useless parentheses. 199

org/apache/logging/log4j/core/async/DaemonThreadFactory.java

Violation Line
Avoid using java.lang.ThreadGroup; it is not thread safe 37

org/apache/logging/log4j/core/async/RingBufferLogEvent.java

Violation Line
These nested if statements could be combined 304306
These nested if statements could be combined 315317

org/apache/logging/log4j/core/config/ConfigurationSource.java

Violation Line
Avoid empty catch blocks 144146
Avoid empty catch blocks 158160

org/apache/logging/log4j/core/config/LoggerConfig.java

Violation Line
Overriding method merely calls super 147149

org/apache/logging/log4j/core/config/builder/api/ConfigurationBuilder.java

Violation Line
Avoid unused imports such as 'java.util.Map' 19

org/apache/logging/log4j/core/config/properties/PropertiesConfigurationBuilder.java

Violation Line
Avoid unused local variables such as 'rootProps'. 81

org/apache/logging/log4j/core/config/xml/XmlConfiguration.java

Violation Line
Useless parentheses. 298

org/apache/logging/log4j/core/filter/MapFilter.java

Violation Line
Useless parentheses. 84
Useless parentheses. 84

org/apache/logging/log4j/core/filter/ScriptFilter.java

Violation Line
These nested if statements could be combined 145148

org/apache/logging/log4j/core/filter/StructuredDataFilter.java

Violation Line
Useless parentheses. 76
Useless parentheses. 76

org/apache/logging/log4j/core/filter/ThreadContextMapFilter.java

Violation Line
Useless parentheses. 100
Useless parentheses. 100

org/apache/logging/log4j/core/impl/Log4jContextFactory.java

Violation Line
Useless parentheses. 259

org/apache/logging/log4j/core/impl/ThrowableFormatOptions.java

Violation Line
Avoid empty if statements 213215

org/apache/logging/log4j/core/impl/ThrowableProxy.java

Violation Line
Avoid empty catch blocks 491493
Avoid unused method parameters such as 'stackTraceElement'. 527
Avoid empty catch blocks 548550

org/apache/logging/log4j/core/jackson/ExtendedStackTraceElementMixIn.java

Violation Line
Avoid unused constructor parameters such as 'declaringClass'. 41
Avoid unused constructor parameters such as 'methodName'. 42
Avoid unused constructor parameters such as 'fileName'. 43
Avoid unused constructor parameters such as 'lineNumber'. 44
Avoid unused constructor parameters such as 'exact'. 45
Avoid unused constructor parameters such as 'location'. 46
Avoid unused constructor parameters such as 'version'. 47

org/apache/logging/log4j/core/jackson/Log4jStackTraceElementDeserializer.java

Violation Line
Avoid empty if statements 7274

org/apache/logging/log4j/core/jackson/LogEventJsonMixIn.java

Violation Line
Avoid unused imports such as 'com.fasterxml.jackson.databind.deser.std.MapDeserializer' 35
Avoid unused imports such as 'com.fasterxml.jackson.databind.ser.std.MapSerializer' 36

org/apache/logging/log4j/core/jackson/MarkerMixIn.java

Violation Line
Avoid unused constructor parameters such as 'name'. 61

org/apache/logging/log4j/core/jackson/StackTraceElementMixIn.java

Violation Line
Avoid unused constructor parameters such as 'declaringClass'. 37
Avoid unused constructor parameters such as 'methodName'. 38
Avoid unused constructor parameters such as 'fileName'. 39
Avoid unused constructor parameters such as 'lineNumber'. 40

org/apache/logging/log4j/core/jackson/ThrowableProxyMixIn.java

Violation Line
Avoid unused private fields such as 'causeProxy'. 34
Avoid unused private fields such as 'commonElementCount'. 38
Avoid unused private fields such as 'extendedStackTrace'. 43
Avoid unused private fields such as 'localizedMessage'. 47
Avoid unused private fields such as 'message'. 51
Avoid unused private fields such as 'name'. 55
Avoid unused private fields such as 'throwable'. 58

org/apache/logging/log4j/core/jmx/Server.java

Violation Line
Avoid unused method parameters such as 'executor'. 270
Avoid unused method parameters such as 'executor'. 342
Avoid unused method parameters such as 'executor'. 359

org/apache/logging/log4j/core/layout/AbstractJacksonLayout.java

Violation Line
Avoid unused imports such as 'org.apache.logging.log4j.core.impl.Log4jLogEvent' 25

org/apache/logging/log4j/core/layout/CsvParameterLayout.java

Violation Line
Avoid unused imports such as 'org.apache.commons.csv.CSVPrinter' 23

org/apache/logging/log4j/core/layout/HtmlLayout.java

Violation Line
Avoid empty catch blocks 217219

org/apache/logging/log4j/core/layout/LockingStringBuilderEncoder.java

Violation Line
Avoid unused private methods such as 'getCharBuffer()'. 48
Avoid unused method parameters such as 'destination'. 66

org/apache/logging/log4j/core/layout/Rfc5424Layout.java

Violation Line
Avoid unused private fields such as 'eventPrefix'. 107
Useless parentheses. 335
Useless parentheses. 358
Useless parentheses. 498

org/apache/logging/log4j/core/layout/ScriptPatternSelector.java

Violation Line
These nested if statements could be combined 113116

org/apache/logging/log4j/core/layout/StringBuilderEncoder.java

Violation Line
Avoid unused method parameters such as 'destination'. 125

org/apache/logging/log4j/core/net/MulticastDnsAdvertiser.java

Violation Line
Avoid empty catch blocks 9294
Avoid empty catch blocks 197199

org/apache/logging/log4j/core/net/TcpSocketManager.java

Violation Line
Avoid empty catch blocks 217219

org/apache/logging/log4j/core/net/server/AbstractSocketServer.java

Violation Line
Avoid empty catch blocks 6870
Avoid empty catch blocks 7577
Avoid empty catch blocks 7779
Avoid empty catch blocks 8688

org/apache/logging/log4j/core/net/server/JmsServer.java

Violation Line
Avoid empty catch blocks 103104

org/apache/logging/log4j/core/net/server/TcpSocketServer.java

Violation Line
Avoid empty catch blocks 7779

org/apache/logging/log4j/core/pattern/AnsiEscape.java

Violation Line
Avoid empty catch blocks 326328

org/apache/logging/log4j/core/pattern/CachedDateFormat.java

Violation Line
Useless parentheses. 211
Useless parentheses. 268
Useless parentheses. 268
Useless parentheses. 268
Useless parentheses. 381
Useless parentheses. 381

org/apache/logging/log4j/core/pattern/MarkerPatternConverter.java

Violation Line
Avoid unused constructor parameters such as 'options'. 34

org/apache/logging/log4j/core/pattern/MarkerSimpleNamePatternConverter.java

Violation Line
Avoid unused constructor parameters such as 'options'. 34

org/apache/logging/log4j/core/pattern/NameAbbreviator.java

Violation Line
Useless parentheses. 298

org/apache/logging/log4j/core/pattern/NanoTimePatternConverter.java

Violation Line
Avoid unused constructor parameters such as 'options'. 35

org/apache/logging/log4j/core/pattern/PatternParser.java

Violation Line
Avoid unused constructor parameters such as 'expectedClass'. 127
These nested if statements could be combined 180182

org/apache/logging/log4j/core/pattern/UuidPatternConverter.java

Violation Line
Useless parentheses. 53

org/apache/logging/log4j/core/script/ScriptManager.java

Violation Line
Avoid unused private fields such as 'SECURITY_MANAGER'. 53

org/apache/logging/log4j/core/util/Booleans.java

Violation Line
Useless parentheses. 37

org/apache/logging/log4j/core/util/Closer.java

Violation Line
Avoid empty catch blocks 4547
Avoid empty catch blocks 7072
Avoid empty catch blocks 9597
Avoid empty catch blocks 121123
Avoid empty catch blocks 147149

org/apache/logging/log4j/core/util/CronExpression.java

Violation Line
Useless parentheses. 294
Useless parentheses. 294
Useless parentheses. 294
These nested if statements could be combined 483486
Useless parentheses. 505
Useless parentheses. 505
Useless parentheses. 505
Useless parentheses. 505
Useless parentheses. 505
Useless parentheses. 575
Useless parentheses. 623
Useless parentheses. 625
Useless parentheses. 627
Useless parentheses. 629
Useless parentheses. 768
Useless parentheses. 938
Useless parentheses. 944
Useless parentheses. 949
Useless parentheses. 950
Useless parentheses. 955
These nested if statements could be combined 960964
Useless parentheses. 960
Useless parentheses. 961
Useless parentheses. 1113
Unnecessary use of fully qualified name 'java.util.Calendar' due to existing import 'java.util.Calendar' 1262
Unnecessary use of fully qualified name 'java.util.Calendar.getInstance' due to existing import 'java.util.Calendar' 1262
Unnecessary use of fully qualified name 'java.util.Calendar.getInstance' due to existing import 'java.util.Calendar' 1298
Unnecessary use of fully qualified name 'java.util.Calendar' due to existing import 'java.util.Calendar' 1298
Unnecessary use of fully qualified name 'java.util.Calendar.HOUR_OF_DAY' due to existing import 'java.util.Calendar' 1562
Unnecessary use of fully qualified name 'java.util.Calendar.HOUR_OF_DAY' due to existing import 'java.util.Calendar' 1563
Unnecessary use of fully qualified name 'java.util.Calendar.HOUR_OF_DAY' due to existing import 'java.util.Calendar' 1564
Useless parentheses. 1587
Useless parentheses. 1587
Useless parentheses. 1596

org/apache/logging/log4j/core/util/FileUtils.java

Violation Line
Useless parentheses. 5556
Useless parentheses. 5556

org/apache/logging/log4j/core/util/IOUtils.java

Violation Line
Avoid unused imports such as 'java.io.InputStream' 20
Avoid unused imports such as 'java.io.OutputStream' 21

org/apache/logging/log4j/core/util/JndiCloser.java

Violation Line
Avoid empty catch blocks 5355

org/apache/logging/log4j/core/util/JsonUtils.java

Violation Line
Useless parentheses. 72

org/apache/logging/log4j/core/util/StringEncoder.java

Violation Line
Useless parentheses. 81
Useless parentheses. 97
Useless parentheses. 97
Useless parentheses. 98
Useless parentheses. 105

org/apache/logging/log4j/core/util/Throwables.java

Violation Line
Avoid empty catch blocks 102104

org/apache/logging/log4j/core/util/Transform.java

Violation Line
Useless parentheses. 5053
Useless parentheses. 127134

org/apache/logging/log4j/core/util/TypeUtil.java

Violation Line
Useless parentheses. 198
Useless parentheses. 198
Useless parentheses. 198

org/apache/logging/log4j/core/util/UuidUtil.java

Violation Line
Useless parentheses. 143144
Useless parentheses. 143
Avoid empty catch blocks 183185