Releases: pmd/pmd
PMD 5.5.0 (25-June-2016)
25-June-2016 - 5.5.0
System requirements:
PMD and CPD need at least a java7 runtime environment. For analyzing Salesforce.com Apex source code,
you'll need a java8 runtime environment.
New Supported Languages:
- Salesforce.com Apex is now supported by PMD and CPD. See PR#86.
- CPD now supports Perl. See PR#82.
- CPD now supports Swift. See PR#33.
New and modified Rules:
- New rules in Java:
- java-logging-java/InvalidSlf4jMessageFormat: Check for invalid message format in slf4j loggers.
See PR#73. - java-design/ConstantsInInterface: Avoid constants in interfaces.
Interfaces should define types, constants are implementation details
better placed in classes or enums. See Effective Java, item 19.
See PR#93. - Modified rules in Java:
- java-comments/CommentRequired: New property
serialVersionUIDCommentRequired
which controls the comment requirements
for serialVersionUID fields. By default, no comment is required for this field. - java-design/UseVargs: public static void main method is ignored now and so are methods, that are annotated
with Override. See PR#79. - New rules for Salesforce.com Apex:
- apex-complexity: AvoidDeeplyNestedIfStmts, ExcessiveParameterList, ExcessiveClassLength,
NcssMethodCount, NcssTypeCount, NcssConstructorCount, StdCyclomaticComplexity,
TooManyFields, ExcessivePublicCount - apex-performance: AvoidDmlStatementsInLoops, AvoidSoqlInLoops
- apex-style: VariableNamingConventions, MethodNamingConventions, ClassNamingConventions,
MethodWithSameNameAsEnclosingClass, AvoidLogicInTrigger, AvoidGlobalModifier - Javascript
- New Rule: ecmascript-unnecessary/NoElseReturn: The else block in a if-else-construct is
unnecessary if theif
block contains a return. Then the content of the else block can be
put outside. See #1486.
Improvements and CLI changes:
- A JSON-renderer for PMD which is compatible with CodeClimate. See PR#83.
- #1360: [core] [java] Provide backwards compatibility for PMD configuration file
- CPD: If a complete filename is specified, the language dependent filename filter is not applied. This allows
to scan files, that are not using the standard file extension. If a directory is specified, the filename filter
is still applied and only those files with the correct file extension of the language are scanned. - CPD: If no problems found, an empty report will be output instead of nothing. See also #1481
- CPD: New command line parameter
--ignore-usings
: Ignore using directives in C# when comparing text. - PMD: New command line parameter:
-norulesetcompatibility
- this disables the ruleset factory
compatibility filter and fails, if e.g. an old rule name is used in the ruleset.
See also #1360.
This option is also available for the ant task:<noRuleSetCompatibility>true</noRuleSetCompatibility>
. - PMD: New command line parameter:
-filelist
- this provides an alternative way to define, which
files should be process by PMD. With this option, you can provide the path to a single file containing a comma
delimited list of files to analyze. If this is given, then you don't need to provide-dir
.
See PR#98.
Pull Requests:
- #25: [cs] Added option to exclude C# using directives from CPD analysis
- #27: [cpp] Added support for Raw String Literals (C++11).
- [#29)(https://github.com/adangel/pull/29): [jsp] Added support for files with UTF-8 BOM to JSP tokenizer.
- #30: [core] CPD: Removed file filter for files that are explicitly specified on the CPD command line using the '--files' command line option.
- #31: [core] CPD: Added file encoding detection to CPD.
- #32: [objectivec] Extended Objective-C grammar to accept UTF-8 escapes (\uXXXX) in string literals.
- #33: [swift] Added support for Swift to CPD.
- #34: multiple code improvements: squid:S1192, squid:S1118, squid:S1066, squid:S1854, squid:S2864
- #35: [javascript] Javascript tokenizer now ignores comment tokens.
- #72: [java] [jsp] Added capability in Java and JSP parser for tracking tokens.
- #73: [java] InvalidSlf4jMessageFormat: Add rule to look for invalid message format in slf4j loggers
- #74: [java] CommentDefaultAccessModifier: Fix rendering CommentDefaultAccessModifier description as code
- #75: [core] RuleSetFactory Performance Enhancement
- #76: [java] DoNotCallGarbageCollectionExplicitly: fix formatting typos in an example
- #77: [java] [plsql] Fix various typos
- #78: [java] MissingStaticMethodInNonInstantiatableClass: Add Builder pattern check
- #79: [java] UseVarargs: do not flag public static void main(String[]), ignore @OverRide
- #80: [site] Update mvn-plugin.md
- #82: [perl] Add Perl support to CPD.
- #83: [core] CodeClimateRenderer: Adds new Code Climate-compliant JSON renderer
- #84: [java] EmptyMethodInAbstractClassShouldBeAbstract: Change rule's description.
- #85: [java] UseStringBufferForStringAppends: False Positive with Ternary Operator (#1340)
- #86: [apex] Added language module for Salesforce.com Apex incl. rules ported from Java and new ones.
- #87: [core] [apex] Customize Code Climate Json "categories" + "remediation_points" as PMD rule properties
- #88: [core] [apex] Fixed typo in ruleset.xml and problems with the CodeClimate renderer
- #89: [core] Some code enhancements
- #90: [core] Refactored two test to stop using the deprecated ant class BuildFileTest
- #91: [core] [java] [jsp] [plsql] [test] [vm] Small code enhancements, basically reordering variable declarations, constructors and variable modifiers
- #92: [core] [apex] Improved Code Climate Renderer Output and a Bugfix for Apex StdCyclomaticComplexityRule on triggers
- #93: [java] ConstantsInInterface: Add ConstantsInInterface rule. Effective Java, 19
- #94: [core] [apex] Added property, fixed code climate renderer output and deleted unused rulessets
- #95: [apex] AvoidDmlStatementsInLoops: New apex rule AvoidDmlStatementsInLoops
- #96: [core] CodeClimateRenderer: Clean up Code Climate renderer
- #97: [java] BooleanGetMethodName: Don't report bad method names on @OverRide
- #98: [core] PMD: Input filelist parameter
- #99: [apex] Fixed Trigger name is reported incorrectly
- #100: [core] CSVRenderer: escape filenames with commas in csvrenderer
Bugfixes:
- java-basic
- #1471: [java] DoubleCheckedLocking: False positives
- #1424: [java] SimplifiedTernary: False positive with ternary operator
- java-codesize
- #1457: [java] TooManyMethods: counts inner class methods
- java-comments
- #1430: [java] CommentDefaultAccessModifier: triggers on field
annotated with @VisibleForTesting - #1434: [java] CommentRequired: raises violation on serialVersionUID field
- java-controversial
- #1449: [java] AvoidUsingShortType: false positive when casting a variable to short
- java-design
- #1452: [java] AccessorClassGenerationRule: ArrayIndexOutOfBoundsException with Annotations
- #1479: [java] CloseResource: false positive on Statement
- #1438: [java] UseNotifyAllInsteadOfNotify: false positive
- #1467: [java] UseUtilityClass: can't correctly check functions with multiple annotations
- java-finalizers
- #1440: [java] AvoidCallingFinalize: NPE
- java-imports
- #1436: [java] UnnecessaryFullyQualifiedName: false positive on clashing static imports with enums
- #1465: [java] UnusedImports: False Positve with javadoc @link
- java-junit
- [#1373](https:/...
PMD 5.4.2 (29-May-2016)
29-May-2016 - 5.4.2
New Supported Languages:
- CPD supports now Swift (see PR#33).
Feature Request and Improvements:
- A JSON-renderer for PMD which is compatible with CodeClimate. See PR#83.
- #1360: Provide backwards compatibility for PMD configuration file
Modified Rules:
- java-design/UseVargs: public static void main method is ignored now and so are methods, that are annotated
with Override. See PR#79.
Pull Requests:
- #27: Added support for Raw String Literals (C++11).
- #29: Added support for files with UTF-8 BOM to JSP tokenizer.
- #30: Removed file filter for files that are explicitly specified on the CPD command line using the '--files' command line option.
- #31: Added file encoding detection to CPD.
- #32: Extended Objective-C grammar to accept UTF-8 escapes (\uXXXX) in string literals.
- #33: Added support for Swift to CPD.
- #79: do not flag public static void main(String[]) as UseVarargs; ignore @OverRide for UseVarargs
- #80: Update mvn-plugin.md
- #83: Adds new Code Climate-compliant JSON renderer
- #85: #1340 UseStringBufferForStringAppends False Positive with Ternary Operator
Bugfixes:
- java-basic/DoubleCheckedLocking:
- #1471: False positives for DoubleCheckedLocking
- java-basic/SimplifiedTernary:
- #1424: False positive with ternary operator
- java-codesize/TooManyMethods:
- #1457: TooManyMethods counts inner class methods
- java-controversial/AvoidUsingShortType:
- #1449: false positive when casting a variable to short
- java-design/AccessorClassGeneration:
- #1452: ArrayIndexOutOfBoundsException with Annotations for AccessorClassGenerationRule
- java-design/CloseResource
- #1479: CloseResource false positive on Statement
- java-design/UseUtilityClass:
- #1467: UseUtilityClass can't correctly check functions with multiple annotations
- java-imports/UnusedImports:
- #1465: False Positve UnusedImports with javadoc @link
- java-junit/TestClassWithoutTestCases:
- #1453: Test Class Without Test Cases gives false positive
- java-optimizations/UseStringBufferForStringAppends:
- #1340: UseStringBufferForStringAppends False Positive with ternary operator
- java-sunsecure/ArrayIsStoredDirectly:
- #1475: False positive of MethodReturnsInternalArray
- #1476: False positive of ArrayIsStoredDirectly
- java-unnecessary/UnnecessaryFinalModifier:
- #1464: UnnecessaryFinalModifier false positive on a @SafeVarargs method
- java-unusedcode/UnusedFormalParameter:
- #1456: UnusedFormalParameter should ignore overriding methods
- java-unusedcode/UnusedLocalVariable
- #1484: UnusedLocalVariable - false positive - parenthesis
- java-unusedcode/UnusedModifier
- #1480: false positive on public modifier used with inner interface in enum
- General
- #1455: PMD doesn't handle Java 8 explicit receiver parameters
- #1458: Performance degradation scanning large XML files with XPath custom rules
- #1461: Possible threading issue due to PR#75
- #1470: Error with type-bound lambda
- #1481: no problems found results in blank file instead of empty xml
CLI Changes:
- CPD: If a complete filename is specified, the language dependent filename filter is not applied. This allows
to scan files, that are not using the standard file extension. If a directory is specified, the filename filter
is still applied and only those files with the correct file extension of the language are scanned. - CPD: If no problems found, an empty report will be output instead of nothing. See also #1481
- New command line parameter for PMD:
-norulesetcompatibility
- this disables the ruleset factory
compatibility filter and fails, if e.g. an old rule name is used in the ruleset.
See also #1360.
This option is also available for the ant task:<noRuleSetCompatibility>true</noRuleSetCompatibility>
.
PMD 5.3.7 (30-April-2016)
30-April-2016 - 5.3.7
New Supported Languages:
- CPD supports now Swift (see PR#33).
Feature Request and Improvements:
- A JSON-renderer for PMD which is compatible with CodeClimate. See PR#83.
Modified Rules:
- java-design/UseVargs: public static void main method is ignored now and so are methods, that are annotated
with Override. See PR#79.
Pull Requests:
- #27: Added support for Raw String Literals (C++11).
- #29: Added support for files with UTF-8 BOM to JSP tokenizer.
- #30: Removed file filter for files that are explicitly specified on the CPD command line using the '--files' command line option.
- #31: Added file encoding detection to CPD.
- #32: Extended Objective-C grammar to accept UTF-8 escapes (\uXXXX) in string literals.
- #33: Added support for Swift to CPD.
- #79: do not flag public static void main(String[]) as UseVarargs; ignore @OverRide for UseVarargs
- #80: Update mvn-plugin.md
- #83: Adds new Code Climate-compliant JSON renderer
- #85: #1340 UseStringBufferForStringAppends False Positive with Ternary Operator
Bugfixes:
- java-basic/DoubleCheckedLocking:
- #1471: False positives for DoubleCheckedLocking
- java-codesize/TooManyMethods:
- #1457: TooManyMethods counts inner class methods
- java-controversial/AvoidUsingShortType:
- #1449: false positive when casting a variable to short
- java-design/AccessorClassGeneration:
- #1452: ArrayIndexOutOfBoundsException with Annotations for AccessorClassGenerationRule
- java-design/UseUtilityClass:
- #1467: UseUtilityClass can't correctly check functions with multiple annotations
- java-imports/UnusedImports:
- #1465: False Positve UnusedImports with javadoc @link
- java-junit/TestClassWithoutTestCases:
- #1453: Test Class Without Test Cases gives false positive
- java-optimizations/UseStringBufferForStringAppends:
- #1340: UseStringBufferForStringAppends False Positive with ternary operator
- java-sunsecure/ArrayIsStoredDirectly:
- #1475: False positive of MethodReturnsInternalArray
- #1476: False positive of ArrayIsStoredDirectly
- java-unnecessary/UnnecessaryFinalModifier:
- #1464: UnnecessaryFinalModifier false positive on a @SafeVarargs method
- java-unusedcode/UnusedFormalParameter:
- #1456: UnusedFormalParameter should ignore overriding methods
- General
- #1455: PMD doesn't handle Java 8 explicit receiver parameters
- #1458: Performance degradation scanning large XML files with XPath custom rules
- #1461: Possible threading issue due to PR#75
- #1470: Error with type-bound lambda
CLI Changes:
- CPD: If a complete filename is specified, the language dependent filename filter is not applied. This allows
to scan files, that are not using the standard file extension. If a directory is specified, the filename filter
is still applied and only those files with the correct file extension of the language are scanned.
PMD 5.4.1 (04-December-2015)
04-December-2015 - 5.4.1
Feature Request and Improvements:
- CPD: New command line parameter
--ignore-usings
: Ignore using directives in C# when comparing text.
Modified Rules:
- java-comments/CommentRequired: New property
serialVersionUIDCommentRequired
which controls the comment requirements
for serialVersionUID fields. By default, no comment is required for this field.
Pull Requests:
- #25: Added option to exclude C# using directives from CPD analysis
- #72: Added capability in Java and JSP parser for tracking tokens.
- #74: Fix rendering CommentDefaultAccessModifier description as code
- #75: RuleSetFactory Performance Enhancement
Bugfixes:
- java-comments/CommentDefaultAccessModifier
- #1430: CommentDefaultAccessModifier triggers on field
annotated with @VisibleForTesting - java-comments/CommentRequired
- #1434: CommentRequired raises violation on serialVersionUID field
- java-design/UseNotifyAllInsteadOfNotify
- #1438: UseNotifyAllInsteadOfNotify gives false positive
- java-finalizers/AvoidCallingFinalize
- #1440: NPE in AvoidCallingFinalize
- java-imports/UnnecessaryFullyQualifiedName
- #1436: UnnecessaryFullyQualifiedName false positive on clashing static imports with enums
- java-junit/JUnitAssertionsShouldIncludeMessage
- #1373: JUnitAssertionsShouldIncludeMessage is no longer compatible with TestNG
- java-migrating/JUnit4TestShouldUseBeforeAnnotation
- #1446: False positive with JUnit4TestShouldUseBeforeAnnotation when TestNG is used
- java-naming/SuspiciousEqualsMethodName
- #1431: SuspiciousEqualsMethodName false positive
- java-optimizations/RedundantFieldInitializer
- #1443: RedundantFieldInitializer: False positive for small floats
- java-unnecessary/UselessQualifiedThis
- #1422: UselessQualifiedThis: False positive with Java 8 Function
- java-unusedcode/UnusedPrivateField
- #1428: False positive in UnusedPrivateField when local variable
hides member variable - General
- #1425: Invalid XML Characters in Output
- #1429: Java - Parse Error: Cast in return expression
- #1441: PMD: Update documentation how to compile after modularization
PMD 5.3.6 (04-December-2015)
04-December-2015 - 5.3.6
Feature Request and Improvements:
- CPD: New command line parameter
--ignore-usings
: Ignore using directives in C# when comparing text.
Modified Rules:
- java-comments/CommentRequired: New property
serialVersionUIDCommentRequired
which controls the comment requirements
for serialVersionUID fields. By default, no comment is required for this field.
Pull Requests:
- #25: Added option to exclude C# using directives from CPD analysis
- Note: This also contains the fix from #23
- #72: Added capability in Java and JSP parser for tracking tokens.
- #75: RuleSetFactory Performance Enhancement
Bugfixes:
- java-comments/CommentRequired
- #1434: CommentRequired raises violation on serialVersionUID field
- java-design/UseNotifyAllInsteadOfNotify
- #1438: UseNotifyAllInsteadOfNotify gives false positive
- java-finalizers/AvoidCallingFinalize
- #1440: NPE in AvoidCallingFinalize
- java-imports/UnnecessaryFullyQualifiedName
- #1436: UnnecessaryFullyQualifiedName false positive on clashing static imports with enums
- java-junit/JUnitAssertionsShouldIncludeMessage
- #1373: JUnitAssertionsShouldIncludeMessage is no longer compatible with TestNG
- java-migrating/JUnit4TestShouldUseBeforeAnnotation
- #1446: False positive with JUnit4TestShouldUseBeforeAnnotation when TestNG is used
- java-naming/SuspiciousEqualsMethodName
- #1431: SuspiciousEqualsMethodName false positive
- java-optimizations/RedundantFieldInitializer
- #1443: RedundantFieldInitializer: False positive for small floats
- java-unusedcode/UnusedPrivateField
- #1428: False positive in UnusedPrivateField when local variable hides member variable
- General
- #1429: Java - Parse Error: Cast in return expression
- #1425: Invalid XML Characters in Output
- #1441: PMD: Update documentation how to compile after modularization
PMD 5.4.0 (04-October-2015)
04-October-2015 - 5.4.0
Summary:
- 9 new rules
- 4 features requests
- 18 pull requests
Feature Request and Improvements:
- #1344: AbstractNaming should check reverse
- #1361: ShortVariable and ShortMethodName configuration
- #1414: Command line parameter to disable "failOnViolation" behavior
PMD and CPD Command Line Interfaces have a new optional parameter:failOnViolation
. Executing PMD with the option
-failOnViolation false
will perform the PMD checks but won't fail the build and still exit with status 0.
This is useful if you only want to generate the report with violations but don't want to fail your build. - #1420: UnusedPrivateField: Ignore fields if using lombok
New Rules:
- Java:
- Basic: SimplifiedTernary (rulesets/java/basic.xml/SimplifiedTernary)
Ternary operator with a boolean literal can be simplified with a boolean
expression. - Clone: CloneMethodMustBePublic (rulesets/java/clone.xml/CloneMethodMustBePublic)
The java manual says "By convention,
classes that implement theCloneable
interface should overrideObject.clone
(which is protected)
with a public method." - Clone: CloneMethodReturnTypeMustMatchClassName (rulesets/java/clone.xml/CloneMethodReturnTypeMustMatchClassName)
If a class implementsCloneable
the return type of the methodclone()
must be the class name. - Comments: CommentDefaultAccessModifier (rulesets/java/comments.xml/CommentDefaultAccessModifier)
In order to avoid mistakes with
forgotten access modifiers for methods, this rule ensures, that you explicitly mark the usage of the
default access modifier by placing a comment. - Design: SingletonClassReturningNewInstance (rulesets/java/design.xml/SingletonClassReturningNewInstance)
Verifies that the method calledgetInstance
returns a cached instance and not always a fresh, new instance. - Design: SingleMethodRule (rulesets/java/design.xml/SingleMethodSingletonRule)
Verifies that there is only one method called
getInstance
. If there are more methods that return the singleton, then it can easily happen, that these
are not the same instances - and thus no singleton. - Unnecessary: UselessQualifiedThis (rulesets/java/unnecessary.xml/UselessQualifiedThis)
Flags unnecessary qualified usages
of this, whenthis
alone would be unique. E.g. use justthis
instead ofFoo.this
. - Maven POM: (The rules can be found in the pmd-xml module)
- Basic: ProjectVersionAsDependencyVersion (rulesets/pom/basic.xml/ProjectVersionAsDependencyVersion)
Checks the usage of${project.version}
in Maven POM files. - Basic: InvalidDependencyTypes (rulesets/pom/basic.xml/InvalidDependencyTypes)
Verifies that only the default types (jar, war, ...) for dependencies are used.
Ruleset snippet to activate the new rules:
<rule ref="rulesets/java/basic.xml/SimplifiedTernary"/>
<rule ref="rulesets/java/clone.xml/CloneMethodReturnTypeMustMatchClassName"/>
<rule ref="rulesets/java/clone.xml/CloneMethodMustBePublic"/>
<rule ref="rulesets/java/comments.xml/CommentDefaultAccessModifier"/>
<rule ref="rulesets/java/design.xml/SingleMethodSingleton"/>
<rule ref="rulesets/java/design.xml/SingletonClassReturningNewInstance"/>
<rule ref="rulesets/java/unnecessary.xml/UselessQualifiedThis"/>
<rule ref="rulesets/pom/basic.xml/ProjectVersionAsDependencyVersion"/>
<rule ref="rulesets/pom/basic.xml/InvalidDependencyTypes"/>
Modified Rules:
- Java
- Basic: CheckResultSet (rulesets/java/basic.xml/CheckResultSet)
Do not require to check the result of a navigation method, if it is returned. - JUnit: UseAssertTrueInsteadOfAssertEquals (rulesets/java/junit.xml/UseAssertTrueInsteadOfAssertEquals)
This rule also flags assertEquals, that use Boolean.TRUE/FALSE constants. - Naming: AbstractNaming (rulesets/java/naming.xml/AbstractNaming)
By default, this rule flags now classes,
that are named "Abstract" but are not abstract. This behavior can be disabled by setting
the new propertystrict
to false. - Naming: ShortMethodName (rulesets/java/naming.xml/ShortMethodName)
Additional propertyminimum
to configure the minimum required length of a method name. - Naming: ShortVariable (rulesets/java/naming.xml/ShortVariable)
Additional propertyminimum
to configure the minimum required length of a variable name. - UnusedCode: UnusedPrivateField (rulesets/java/unusedcode.xml/UnusedPrivateField)
This rule won't trigger anymore if Lombok is in use.
See #1420.
Renamed Rules:
- Java
- Design:
UseSingleton- UseUtilityClass (rulesets/java/design.xml/UseUtilityClass)
The rule "UseSingleton" has been renamed to "UseUtilityClass".
See also bugs #1059 and #1339.
Removed Rules:
- Java
- Basic: The following rules of ruleset "Basic" were marked as deprecated and are removed with this release now:
EmptyCatchBlock, EmptyIfStatement, EmptyWhileStmt, EmptyTryBlock, EmptyFinallyBlock, EmptySwitchStatements, EmptySynchronizedBlock, EmptyStatementNotInLoop, EmptyInitializer, EmptyStatementBlock, EmptyStaticInitializer
UnnecessaryConversionTemporary, UnnecessaryReturn, UnnecessaryFinalModifier, UselessOverridingMethod, UselessOperationOnImmutable, UnusedNullCheckInEquals, UselessParentheses
These rules are still available in the rulesets "Empty" (rulesets/java/empty.xml) and
"Unnecessary" (rulesets/java/unnecessary.xml) respectively. - Design: The rule "UncommentedEmptyMethod" has been renamed last release to "UncommentedEmptyMethodBody". The
old rule name reference has been removed with this release now. - Controversial: The rule "BooleanInversion" has been deprecated last release
and has been removed with this release completely.
Pull Requests:
- #21: Added PMD Rules for Singleton pattern violations.
- #23: Extended Objective-C grammar to accept Unicode characters in identifiers
- #54: Add a new rulesets for Maven's POM rules
- #55: Fix run.sh for paths with spaces
- #56: Adding support for WSDL rules
- #57: Add default access modifier as comment rule
- #58: Add rule for unnecessary literal boolean in ternary operators
- #59: Add check to Boxed booleans in UseAssertTrueInsteadOfAssertEquals rule
- #60: Add UselessQualifiedThisRule
- #61: Add CloneMethodReturnTypeMustMatchClassName rule
- #62: Add CloneMethodMustBePublic rule
- #63: Change CheckResultSet to allow for the result of the navigation methods to be returned
- #65: Fix ClassCastException in UselessOverridingMethodRule.
- #66: #1370 ConsecutiveAppendsShouldReuse not detected properly on StringBuffer
- #67: Use Path instead of string to check file exclusions to fix windows-only bug
- #68: #1370 ConsecutiveAppendsShouldReuse not detected properly on StringBuffer
- #69: #1371 InsufficientStringBufferDeclaration not detected properly on StringBuffer
- #70: Fix code example
Bugfixes:
- java-unusedcode/UnusedPrivateMethod:
- #1412: UnusedPrivateMethod false positive: Issue #1403 not completely solved
API Changes:
- pmd requires now JDK 1.7 or above.
- pmd-core:
net.sourceforge.pmd.lang.symboltable.Scope
:
The method addNameOccurrence
returns now a Set of
NameDeclarations to which the given occurrence has been added. This is useful in case there are ambiguous declarations
of methods.
- pmd-core:
net.sourceforge.pmd.lang.symboltable.AbstractScope
:
The method findVariableHere
returns now
a Set of NameDeclarations which match the given occurrence. This is useful in case there are ambiguous declarations
of methods.
PMD 5.3.5 (04-October-2015)
04-October-2015 - 5.3.5
Modified Rules:
- java-design/CloseResource: New Property closeAsDefaultTarget which is true by default to stay
backwards compatible. If this property is true, the rule will make sure, thatclose
itself is
always considered as a closeTarget - no matter whether it is configured with the closeTargets property
or not.
Pull Requests:
Bugfixes:
- java-controversial/DefaultPackage:
- #1410: DefaultPackage triggers on field annotated with @VisibleForTesting
- java-design/CloseResource:
- #1387: CloseResource has false positive for ResultSet
- java-optimizations/RedundantFieldInitializer
- #1418: RedundantFieldInitializer false positive with large long value
- java-strings/InsufficientStringBufferDeclaration:
- #1409: NullPointerException in InsufficientStringBufferRule
- #1413: False positive StringBuffer constructor with ?: int value
- java-unnecessary/UselessParentheses:
- #1407: UselessParentheses "&" and "+" operator precedence
PMD 5.3.4 (18-September-2015)
18-September-2015 - 5.3.4
Bugfixes:
- #1370: ConsecutiveAppendsShouldReuse not detected properly on StringBuffer
- #1371: InsufficientStringBufferDeclaration not detected properly on StringBuffer
- #1380: InsufficientStringBufferDeclaration false positive when literal string passed to a lookup service
- #1384: NullPointerException in ConsecutiveLiteralAppendsRule
- #1388: ConstructorCallsOverridableMethodRule doesn't work with params?
- #1392: SimplifyStartsWith false-negative
- #1393: PMD hanging during DataflowAnomalyAnalysis
- #1394: dogfood.xml - Unable to exclude rules [UncommentedEmptyMethod]
- #1395: UnusedPrivateMethod false positive for array element method call
- #1396: PrematureDeclaration lambda false positive
- #1397: StringToString should ignore method references
- #1398: False positive for GuardLogStatementJavaUtil with Log4j
- #1399: False positive for VariableNamingConventions with annotation @interface
- #1400: False positive with JUnit4TestShouldUseBeforeAnnotation
- #1401: False positive for StringBuilder.append called with constructor
- #1402: Windows-Only: File exclusions are not case insensitive
- #1403: False positive UnusedPrivateMethod with JAVA8
- #1404: Java8 'Unnecessary use of fully qualified name' in Streams Collector
- #1405: UnusedPrivateMethod false positive?
PMD 5.3.3 (25-July-2015)
25-July-2015 - 5.3.3
Pull Requests:
- #55: Fix run.sh for paths with spaces
Bugfixes:
- #1364: FieldDeclarationsShouldBeAtStartOfClass false positive using multiple annotations
- #1365: Aggregated javadoc report is missing
- #1366: UselessParentheses false positive on multiple equality operators
- #1369: ConsecutiveLiteralAppends not detected properly on StringBuffer
- #1372: False Negative for CloseResource rule.
- #1375: CloseResource not detected properly
- #1376: CompareObjectsWithEquals fails for type annotated method parameter
- #1379: PMD CLI: Cannot specify multiple properties
- #1381: CPD Cannot use CSV/VS Renderers because they don't support encoding property
PMD 5.3.2 (22-May-2015)
22-May-2015 - 5.3.2
Bugfixes:
- #1330: AvoidReassigningParameters does not work with varargs
- #1335: GuardLogStatementJavaUtil should not apply to SLF4J Logger
- #1342: UseConcurrentHashMap false positive (with documentation example)
- #1343: MethodNamingConventions for overrided methods
- #1345: UseCollectionIsEmpty throws NullPointerException
- #1353: False positive "Only One Return" with lambda
- #1354: Complex FieldDeclarationsShouldBeAtStartOfClass false positive with Spring annotations
- #1355: NullPointerException in a java file having a single comment line