Apache logging services logo Apache log4j logo

PMD Results

The following document contains the results of PMD 5.6.1.

Files

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

Violation Line
Avoid unused private methods such as 'transfer(LogEvent)'. 180
Avoid empty catch blocks 416418
Avoid empty catch blocks 461463

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

Violation Line
Useless parentheses. 255

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

Violation Line
Avoid empty while statements 113115

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

Violation Line
Useless parentheses. 346

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

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

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

Violation Line
Useless parentheses. 231
Useless parentheses. 231
Useless parentheses. 231

org/apache/logging/log4j/core/appender/nosql/NoSqlDatabaseManager.java

Violation Line
Avoid unused imports such as 'javax.jms.JMSException' 21

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

Violation Line
Ternary operators that can be simplified with || or && 126

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

Violation Line
Avoid unused constructor parameters such as 'bufferSize'. 87
Ternary operators that can be simplified with || or && 628

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

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

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
Useless parentheses. 105
Useless parentheses. 107

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

Violation Line
These nested if statements could be combined 113116

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

Violation Line
Useless parentheses. 197

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

Violation Line
Useless parentheses. 226
These nested if statements could be combined 326328
These nested if statements could be combined 337339

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

Violation Line
Overriding method merely calls super 5658

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

Violation Line
Avoid empty catch blocks 151153
Avoid empty catch blocks 165167

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

Violation Line
Overriding method merely calls super 161163

org/apache/logging/log4j/core/config/plugins/convert/Base64Converter.java

Violation Line
Avoid empty catch blocks 4345
Avoid empty catch blocks 4547
Avoid empty catch blocks 4749
Avoid empty catch blocks 4951
Avoid empty catch blocks 5961

org/apache/logging/log4j/core/config/plugins/convert/DateTypeConverter.java

Violation Line
Avoid empty catch blocks 4345

org/apache/logging/log4j/core/config/plugins/visitors/PluginElementVisitor.java

Violation Line
Avoid empty if statements 100102

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

Violation Line
Avoid unused private methods such as 'createComponent(ComponentBuilder,String,Properties)'. 328330
Avoid unused private methods such as 'processRemainingProperties(B,Properties)'. 340341
Avoid unused private methods such as 'addFiltersToComponent(B,Properties)'. 357358
Avoid unused private methods such as 'addLoggersToComponent(B,Properties)'. 367368

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

Violation Line
Useless parentheses. 321

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

Violation Line
Useless parentheses. 90
Useless parentheses. 90
Useless parentheses. 103
Useless parentheses. 103
Useless parentheses. 116
Useless parentheses. 116

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

Violation Line
These nested if statements could be combined 146149

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

Violation Line
Useless parentheses. 84
Useless parentheses. 84

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

Violation Line
Useless parentheses. 109
Useless parentheses. 109

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

Violation Line
Avoid unused private fields such as 'HOUR_MS'. 49
Avoid unused private fields such as 'MINUTE_MS'. 54
Avoid unused private fields such as 'SECOND_MS'. 59

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

Violation Line
Useless parentheses. 260

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

Violation Line
Avoid empty catch blocks 9991001

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

Violation Line
Avoid empty if statements 257259

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

Violation Line
Avoid empty catch blocks 617619
Avoid unused method parameters such as 'stackTraceElement'. 647
Avoid empty catch blocks 668670

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/InstantMixIn.java

Violation Line
Avoid unused constructor parameters such as 'epochSecond'. 39
Avoid unused constructor parameters such as 'nanoOfSecond'. 40

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

Violation Line
Avoid unused private fields such as 'objectMessageAsJsonObject'. 37

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

Violation Line
Avoid empty if statements 7274

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/jackson/ThrowableProxyWithStacktraceAsStringMixIn.java

Violation Line
Avoid unused private fields such as 'causeProxy'. 33
Avoid unused private fields such as 'commonElementCount'. 37
Avoid unused private fields such as 'extendedStackTrace'. 40
Avoid unused private fields such as 'localizedMessage'. 44
Avoid unused private fields such as 'message'. 48
Avoid unused private fields such as 'name'. 52
Avoid unused private fields such as 'throwable'. 55

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

Violation Line
Avoid unused private fields such as 'causeProxy'. 33
Avoid unused private fields such as 'commonElementCount'. 37
Avoid unused private fields such as 'extendedStackTrace'. 40
Avoid unused private fields such as 'localizedMessage'. 44
Avoid unused private fields such as 'message'. 48
Avoid unused private fields such as 'name'. 52
Avoid unused private fields such as 'throwable'. 55

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

Violation Line
Avoid unused method parameters such as 'executor'. 279
Avoid unused method parameters such as 'executor'. 351
Avoid unused method parameters such as 'executor'. 368

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

Violation Line
Avoid unused imports such as 'org.apache.logging.log4j.core.appender.OutputStreamManager' 21

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

Violation Line
Avoid modifiers which are implied by the context 74100
Avoid empty catch blocks 231233

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'. 68

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

Violation Line
Useless parentheses. 336
Useless parentheses. 360
Useless parentheses. 509

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

Violation Line
These nested if statements could be combined 8386

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

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

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

Violation Line
Avoid empty catch blocks 9395
Avoid empty catch blocks 198200

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

Violation Line
Avoid empty catch blocks 328330

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/ExtendedThrowablePatternConverter.java

Violation Line
Avoid unused imports such as 'org.apache.logging.log4j.util.Strings' 23

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

Violation Line
Useless parentheses. 198

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

Violation Line
Avoid unused constructor parameters such as 'formats'. 24

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

Violation Line
Too many static imports may lead to messy code 17332

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

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

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

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

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

Violation Line
Useless parentheses. 295

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

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

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

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

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

Violation Line
Useless parentheses. 99

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

Violation Line
Useless parentheses. 53

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

Violation Line
Useless parentheses. 86

org/apache/logging/log4j/core/tools/Generate.java

Violation Line
Avoid modifiers which are implied by the context 53166

org/apache/logging/log4j/core/tools/picocli/CommandLine.java

Violation Line
Avoid modifiers which are implied by the context 364375
Avoid modifiers which are implied by the context 387398
Useless parentheses. 1040
Avoid using a branching statement as the last in a loop. 1064
These nested if statements could be combined 2170
Avoid unused method parameters such as 'valueAttachedToOption'. 2214
Avoid unused local variables such as 'length'. 2219
Ternary operators that can be simplified with || or && 2257
Avoid unused method parameters such as 'annotation'. 2285
These nested if statements could be combined 23192321
Avoid unused method parameters such as 'arity'. 2328
Avoid unused local variables such as 'desc'. 2358
Avoid unused method parameters such as 'cls'. 2368
These nested if statements could be combined 24342436
Avoid unused method parameters such as 'arity'. 2444
Avoid unused method parameters such as 'originalSize'. 2449
These nested if statements could be combined 24942496
Useless parentheses. 2498
These nested if statements could be combined 2542
Avoid empty catch blocks 2565
Avoid empty catch blocks 27482750
Ternary operators that can be simplified with || or && 2970
Ternary operators that can be simplified with || or && 2971
Ternary operators that can be simplified with || or && 2973
Unnecessary use of fully qualified name 'Help.Column.Overflow.SPAN' due to existing static import 'org.apache.logging.log4j.core.tools.picocli.CommandLine.Help.Column.Overflow.SPAN' 3329
Unnecessary use of fully qualified name 'Help.Column.Overflow.WRAP' due to existing static import 'org.apache.logging.log4j.core.tools.picocli.CommandLine.Help.Column.Overflow.WRAP' 3330
Useless parentheses. 3335
Useless parentheses. 3349
Avoid unused local variables such as 'o1'. 3872
Avoid unused local variables such as 'o2'. 3873
Avoid empty catch blocks 4344
Avoid empty catch blocks 4345
Avoid empty catch blocks 4356
Avoid empty catch blocks 4357
Useless parentheses. 4519
Useless parentheses. 4774

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

Violation Line
Useless parentheses. 37

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

Violation Line
Useless parentheses. 299
Useless parentheses. 299
Useless parentheses. 299
These nested if statements could be combined 488491
Useless parentheses. 510
Useless parentheses. 510
Useless parentheses. 510
Useless parentheses. 510
Useless parentheses. 510
Useless parentheses. 580
Useless parentheses. 628
Useless parentheses. 630
Useless parentheses. 632
Useless parentheses. 634
Useless parentheses. 773
Useless parentheses. 943
Useless parentheses. 949
Useless parentheses. 954
Useless parentheses. 955
Useless parentheses. 960
Useless parentheses. 965
These nested if statements could be combined 965969
Useless parentheses. 966
Useless parentheses. 1118
Unnecessary use of fully qualified name 'java.util.Calendar.getInstance' due to existing import 'java.util.Calendar' 1266
Unnecessary use of fully qualified name 'java.util.Calendar' due to existing import 'java.util.Calendar' 1266
Unnecessary use of fully qualified name 'java.util.Calendar' due to existing import 'java.util.Calendar' 1302
Unnecessary use of fully qualified name 'java.util.Calendar.getInstance' due to existing import 'java.util.Calendar' 1302
Unnecessary use of fully qualified name 'java.util.Calendar.HOUR_OF_DAY' due to existing import 'java.util.Calendar' 1566
Unnecessary use of fully qualified name 'java.util.Calendar.HOUR_OF_DAY' due to existing import 'java.util.Calendar' 1567
Unnecessary use of fully qualified name 'java.util.Calendar.HOUR_OF_DAY' due to existing import 'java.util.Calendar' 1568
Avoid unused local variables such as 'cl'. 1573
Useless parentheses. 1642
Useless parentheses. 1642
Useless parentheses. 1651

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

Violation Line
Useless parentheses. 6465
Useless parentheses. 65

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/JsonUtils.java

Violation Line
Useless parentheses. 97

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

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

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 6264

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. 219
Useless parentheses. 219
Useless parentheses. 219

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

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