Edit me

??-May-2021 - 6.35.0-SNAPSHOT

The PMD team is pleased to announce PMD 6.35.0-SNAPSHOT.

This is a minor release.

New and noteworthy

Modified rules

  • The Java rule CompareObjectsWithEquals has now a new property typesThatCompareByReference. With that property, you can configure types, that should be whitelisted for comparison by reference. By default, java.lang.Enum and java.lang.Class are allowed, but you could add custom types here. Additionally comparisons against constants are allowed now. This makes the rule less noisy when two constants are compared. Constants are identified by looking for an all-caps identifier.

Fixed Issues

  • apex
    • #3243: [apex] Correct findBoundary when traversing AST
  • doc
    • #3230: [doc] Remove “Edit me” button for language index pages
  • dist
    • #2466: [dist] Distribution archive doesn’t include all batch scripts
  • java
    • #3269: [java] Fix NPE in MethodTypeResolution
  • java-bestpractices
    • #1175: [java] UnusedPrivateMethod FP with Junit 5 @MethodSource
    • #2219: [java] Document Reasons to Avoid Reassigning Parameters
    • #2737: [java] Fix misleading rule message on rule SwitchStmtsShouldHaveDefault with non-exhaustive enum switch
    • #3236: [java] LiteralsFirstInComparisons should consider constant fields (cont’d)
    • #3254: [java] AvoidReassigningParameters reports violations on wrong line numbers
  • java-codestyle
    • #2655: [java] UnnecessaryImport false positive for on-demand imports
    • #3262: [java] FieldDeclarationsShouldBeAtStartOfClass: false negative with anon classes
    • #3265: [java] MethodArgumentCouldBeFinal: false negatives with interfaces and inner classes
    • #3266: [java] LocalVariableCouldBeFinal: false negatives with interfaces, anon classes
    • #3274: [java] OnlyOneReturn: false negative with anonymous class
    • #3275: [java] UnnecessaryLocalBeforeReturn: false negatives with lambda and anon class
  • java-design
    • #2780: [java] DataClass example from documentation results in false-negative
  • java-errorprone
    • #3110: [java] Enhance CompareObjectsWithEquals with list of exceptions
    • #3205: [java] Make CompareObjectWithEquals allow comparing against constants
    • #3248: [java] Documentation is wrong for SingletonClassReturningNewInstance rule
    • #3249: [java] AvoidFieldNameMatchingTypeName: False negative with interfaces
    • #3268: [java] ConstructorCallsOverridableMethod: IndexOutOfBoundsException with annotations

API Changes

External Contributions