Skip to content

Releases: pmd/pmd

PMD 7.0.0-rc1 (25-March-2023)

25 Mar 13:46
pmd_releases/7.0.0-rc1
356af8b
Compare
Choose a tag to compare

25-March-2023 - 7.0.0-rc1

We're excited to bring you the next major version of PMD!

Since this is a big release, we provide here only a concise version of the release notes. We prepared a separate
page with the full Detailed Release Notes for PMD 7.0.0.

ℹ️ Release Candidates

PMD 7.0.0 is finally almost ready. In order to gather feedback, we are going to ship a couple of release candidates. These are officially available on GitHub and Maven Central and can be used as usual (e.g. as a dependency). We encourage you to try out the new features, but keep in mind that we may introduce API breaking changes between the release candidates. It should be stable enough if you don't use custom rules.

We have still some tasks planned for the next release candidates. You can see the progress in PMD 7 Tracking Issue #3898.

If you find any problem or difficulty while updating from PMD 6, please provide feedback via our issue tracker. That way we can improve the experience for all.

Expand to see Release Notes

Table Of Contents

🚀 Major Features and Enhancements

New official logo

The new official logo of PMD:

New PMD Logo

Revamped Java module

  • Java grammar substantially refactored - more correct regarding the Java Language Specification (JLS)
  • Built-in rules have been upgraded for the changed AST
  • Rewritten type resolution framework and symbol table correctly implements the JLS
  • AST exposes more semantic information (method calls, field accesses)

For more information, see the Detailed Release Notes for PMD 7.

Contributors: Clément Fournier (@oowekyala),
Andreas Dangel (@adangel),
Juan Martín Sotuyo Dodero (@jsotuyod)

Revamped Command Line Interface

  • unified and consistent Command Line Interface for both Linux/Unix and Windows across our different utilities
  • single script pmd (pmd.bat for Windows) to launch the different utilities:
    • pmd check to run PMD rules and analyze a project
    • pmd cpd to run CPD (copy paste detector)
    • pmd designer to run the PMD Rule Designer
  • progress bar support for pmd check
  • shell completion

Demo

For more information, see the Detailed Release Notes for PMD 7.

Contributors: Juan Martín Sotuyo Dodero (@jsotuyod)

Full Antlr support

  • Antlr based grammars can now be used to build full-fledged PMD rules.
  • Previously, Antlr grammar could only be used for CPD
  • New supported languages: Swift and Kotlin

For more information, see the Detailed Release Notes for PMD 7.

Contributors: Lucas Soncini (@lsoncini),
Matías Fraga (@matifraga),
Tomás De Lucca (@tomidelucca)

🎉 Language Related Changes

Note that this is just a concise listing of the highlight.
For more information on the languages, see the Detailed Release Notes for PMD 7.

New: Swift support

  • use PMD to analyze Swift code with PMD rules
  • initially 4 built-in rules

Contributors: Lucas Soncini (@lsoncini),
Matías Fraga (@matifraga),
Tomás De Lucca (@tomidelucca)

New: Kotlin support (experimental)

  • use PMD to analyze Kotlin code with PMD rules
  • Support for Kotlin 1.8 grammar
  • initially 2 built-in rules

Changed: JavaScript support

  • latest version supports ES6 and also some new constructs (see Rhino])
  • comments are retained

Changed: Language versions

  • more predefined language versions for each supported language
  • can be used to limit rule execution for specific versions only with minimumLanguageVersion and
    maximumLanguageVersion attributes.

🌟 New and changed rules

New Rules

Apex

Java

  • UnnecessaryBoxing reports boxing and unboxing conversions that may be made implicit.

Kotlin

Swift

Changed Rules

Java

  • UnnecessaryFullyQualifiedName: the rule has two new properties,
    to selectively disable reporting on static field and method qualifiers. The rule also has been improved
    to be more precise.
  • UselessParentheses: the rule has two new properties which control how strict
    the rule should be applied. With ignoreClarifying (default: true) parentheses that are strictly speaking
    not necessary are allowed, if they separate expressions of different precedence.
    The other property ignoreBalancing (default: true) is similar, in that it allows parentheses that help
    reading and understanding the expressions.
  • LooseCoupling: the rule has a new property to allow some types to be coupled
    to (allowedTypes).
  • EmptyCatchBlock: CloneNotSupportedException and InterruptedException are not
    special-cased anymore. Rename the exception parameter to ignored to ignore them.
  • DontImportSun: sun.misc.Signal is not special-cased anymore.
  • UseDiamondOperator: the property java7Compatibility is removed. The rule now
    handles Java 7 properly without a property.
  • SingularField: Properties checkInnerClasses and disallowNotAssignment are removed.
    The rule is now more precise and will check these cases properly.
  • UseUtilityClass: The property ignoredAnnotations has been removed.
  • LawOfDemeter: the rule has a new property trustRadius. This defines the maximum degree
    of trusted data. The default of 1 is the most restrictive.
  • CommentContent: The properties caseSensitive and disallowedTerms are removed. The
    new property fobiddenRegex can be used now to define the disallowed terms with a single regular
    expression.

Removed Rules

Many rules, that were previously deprecated have been finally removed.
See Detailed Release Notes for PMD 7 for the complete list.

🚨 API

The API of PMD has been growing over the years and needed some cleanup. The goal is, to
have a clear separation between a well-defined API and the implementation, which is internal.
This should help us in future development.

Also, there are some improvement and changes in different areas. For the ...

Read more

PMD 6.55.0 (25-February-2023)

25 Feb 11:12
pmd_releases/6.55.0
ef34553
Compare
Choose a tag to compare

25-February-2023 - 6.55.0

The PMD team is pleased to announce PMD 6.55.0.

This is a minor release.

Table Of Contents

New and noteworthy

PMD 7 Development

This release is the last planned release of PMD 6. The first version 6.0.0 was released in December 2017.
Over the course of more than 5 years we published almost every month a new minor version of PMD 6
with new features and improvements.

Already in November 2018 we started in parallel the development of the next major version 7.0.0,
and we are now in the process of finalizing the scope of the major version. We want to release a couple of
release candidates before publishing the final version 7.0.0.

We plan to release 7.0.0-rc1 soon. You can see the progress in PMD 7 Tracking Issue #3898.

Java 20 Support

This release of PMD brings support for Java 20. There are no new standard language features.

PMD supports JEP 433: Pattern Matching for switch (Fourth Preview) and
JEP 432: Record Patterns (Second Preview) as preview language features.

In order to analyze a project with PMD that uses these language features,
you'll need to enable it via the environment variable PMD_JAVA_OPTS and select the new language
version 20-preview:

export PMD_JAVA_OPTS=--enable-preview
./run.sh pmd --use-version java-20-preview ...

T-SQL support

Thanks to the contribution from Paul Guyot PMD now has CPD support
for T-SQL (Transact-SQL).

Being based on a proper Antlr grammar, CPD can:

Fixed Issues

  • core
    • #4395: [core] Support environment variable CLASSPATH with pmd.bat under Windows
  • java
    • #4333: [java] Support JDK 20
  • java-errorprone
    • #4393: [java] MissingStaticMethodInNonInstantiatableClass false-positive for Lombok's @UtilityClass for classes with non-private fields

API Changes

Go

  • The LanguageModule of Go, that only supports CPD execution, has been deprecated. This language
    is not fully supported by PMD, so having a language module does not make sense. The functionality of CPD is
    not affected by this change. The following class has been deprecated and will be removed with PMD 7.0.0:

Java

  • Support for Java 18 preview language features have been removed. The version "18-preview" is no longer available.
  • The experimental class net.sourceforge.pmd.lang.java.ast.ASTGuardedPattern has been removed.

External Contributions

Stats

  • 40 commits
  • 11 closed tickets & PRs
  • Days since last release: 28

PMD 6.54.0 (28-January-2023)

28 Jan 13:13
pmd_releases/6.54.0
de1b12b
Compare
Choose a tag to compare

28-January-2023 - 6.54.0

The PMD team is pleased to announce PMD 6.54.0.

This is a minor release.

Table Of Contents

New and noteworthy

New report format html-report-v2.xslt

Thanks to @mohan-chinnappan-n a new PMD report format has been added which features a data table
with charting functions. It uses an XSLT stylesheet to convert PMD's XML format into HTML.

See the example report.

Fixed Issues

  • apex-bestpractices
    • #2669: [apex] UnusedLocalVariable false positive in dynamic SOQL
  • core
    • #4026: [cli] Filenames printed as absolute paths in the report despite parameter --short-names
    • #4279: [core] Can not set ruleset property value to empty
    • #4329: [core] Refactor usage of snakeyaml
    • #4340: [core] Allow to filter found matches in CPDReport
  • java
    • #4364: [java] Parsing error with textblock containing quote followed by two backslashes
  • testing
    • #4236: [test] kotest logs look broken

API Changes

PMD CLI

  • PMD now supports a new --relativize-paths-with flag (or short -z), which replaces --short-names.
    It serves the same purpose: Shortening the pathnames in the reports. However, with the new flag it's possible
    to explicitly define one or more pathnames that should be used as the base when creating relative paths.
    The old flag --short-names is deprecated.

Deprecated APIs

For removal
Internal APIs
Experimental APIs
  • CPDReport has a new method which limited mutation of a given report:
    • filterMatches creates a new CPD report
      with some matches removed with a given predicate based filter.

External Contributions

Stats

  • 107 commits
  • 19 closed tickets & PRs
  • Days since last release: 27

PMD 6.53.0 (31-December-2022)

31 Dec 17:40
pmd_releases/6.53.0
3710345
Compare
Choose a tag to compare

31-December-2022 - 6.53.0

The PMD team is pleased to announce PMD 6.53.0.

This is a minor release.

Table Of Contents

New and noteworthy

Modified rules

  • The Java rule UnusedPrivateField has a new property reportForAnnotations.
    This is a list of fully qualified names of the annotation types that should be reported anyway. If an unused field
    has any of these annotations, then it is reported. If it has any other annotation, then it is still considered
    to be used and is not reported.

Deprecated rules

Fixed Issues

  • core
    • #4248: [core] Can't analyze sources in zip files
  • apex-security
    • #4146: [apex] ApexCRUDViolation: Recognize User Mode in SOQL + DML
  • java
    • #4266: [java] PMD fails to process a record with lambda in compact constructor
  • java-bestpractices
    • #4166: [java] UnusedPrivateField doesn't find annotated unused private fields anymore
    • #4250: [java] WhileLoopWithLiteralBoolean - false negative with complex expressions still occurs in PMD 6.52.0
  • java-design
    • #2127: [java] Deprecate rules ExcessiveClassLength and ExcessiveMethodLength
  • java-errorprone
    • #4164: [java][doc] AvoidAssertAsIdentifier and AvoidEnumAsIdentifier - clarify use case
  • java-multithreading
    • #4210: [java] DoNotUseThreads report duplicate warnings

API Changes

Deprecated APIs

For removal

These classes / APIs have been deprecated and will be removed with PMD 7.0.0.

External Contributions

Stats

  • 43 commits
  • 17 closed tickets & PRs
  • Days since last release: 35

PMD 6.52.0 (26-November-2022)

26 Nov 09:47
pmd_releases/6.52.0
e90bf0f
Compare
Choose a tag to compare

26-November-2022 - 6.52.0

The PMD team is pleased to announce PMD 6.52.0.

This is a minor release.

Table Of Contents

New and noteworthy

New rules

<rule ref="category/java/design.xml/InvalidJavaBean"/>

Renamed rules

  • The Java rule BeanMembersShouldSerialize has been renamed to
    NonSerializableClass. It has been revamped to only check for classes that are marked with
    Serializable and reports each field in it, that is not serializable.

    The property prefix has been deprecated, since in a serializable class all fields have to be
    serializable regardless of the name.

Modified rules

  • The rule ClassNamingConventions has a new property testClassPattern, which is applied
    to test classes. By default, test classes should end with the suffix "Test". Test classes are top-level classes, that
    either inherit from JUnit 3 TestCase or have at least one method annotated with the Test annotations from
    JUnit4/5 or TestNG.

  • The property ignoredAnnotations of rule ImmutableField has been deprecated and doesn't
    have any effect anymore.
    Since PMD 6.47.0, the rule only considers fields, that are initialized once and never changed. If the field is just
    declared but never explicitly initialized, it won't be reported. That's the typical case when a framework sets
    the field value by reflection. Therefore, the property is not needed anymore. If there is a special case where
    this rule misidentifies fields as immutable, then the rule should be suppressed for these fields explicitly.

Fixed Issues

  • cli
    • #4215: NullPointerException when trying to open designer
  • doc
    • #4207: [doc] List all languages in rule doc
  • java
    • #3643: [java] More parser edge cases
    • #4152: [java] Parse error on array type annotations
  • java-codestyle
    • #2867: [java] Separate pattern for test classes in ClassNamingConventions rule for Java
    • #4201: [java] CommentDefaultAccessModifier should consider lombok's @Value
  • java-design
    • #4175: [java] ImmutableField - deprecate property ignoredAnnotations
    • #4177: [java] New Rule InvalidJavaBean
    • #4188: [java] ClassWithOnlyPrivateConstructorsShouldBeFinal false positive with Lombok's @NoArgsConstructor
    • #4189: [java] AbstractClassWithoutAnyMethod should consider lombok's @AllArgsConstructor
    • #4200: [java] ClassWithOnlyPrivateConstructorsShouldBeFinal should consider lombok's @Value
  • java-errorprone
    • #1668: [java] BeanMembersShouldSerialize is extremely noisy
    • #4172: [java] InvalidLogMessageFormat false positive on externally formatted strings
    • #4174: [java] MissingStaticMethodInNonInstantiatableClass does not consider nested builder class
    • #4176: [java] Rename BeanMembersShouldSerialize to NonSerializableClass
    • #4185: [java] InvalidLogMessageFormat rule produces a NPE
    • #4224: [java] MissingStaticMethodInNonInstantiatableClass should consider Lombok's @UtilityClass
    • #4225: [java] MissingStaticMethodInNonInstantiatableClass should consider Lombok's @NoArgsConstructor
  • java-performance
    • #4183: [java] AvoidArrayLoops regression: from false negative to false positive with final variables

API Changes

PMD CLI

  • PMD now supports a new --use-version flag, which receives a language-version pair (such as java-8 or apex-54).
    This supersedes the usage of -language / -l and -version / -v, allowing for multiple versions to be set in a single run.
    PMD 7 will completely remove support for -language and -version in favor of this new flag.

  • Support for -V is being deprecated in favor of --verbose in preparation for PMD 7.
    In PMD 7, -v will enable verbose mode and -V will show the PMD version for consistency with most Unix/Linux tools.

  • Support for -min is being deprecated in favor of --minimum-priority for consistency with most Unix/Linux tools, where -min would be equivalent to -m -i -n.

CPD CLI

  • CPD now supports using -d or --dir as an alias to --files, in favor of consistency with PMD.
    PMD 7 will remove support for --files in favor of these new flags.

Linux run.sh parameters

  • Using run.sh cpdgui will now warn about it being deprecated. Use run.sh cpd-gui instead.

  • The old designer (run.sh designerold) is completely deprecated and will be removed in PMD 7. Switch to the new JavaFX designer: run.sh designer.

  • The old visual AST viewer (run.sh bgastviewer) is completely deprecated and will be removed in PMD 7. Switch to the new JavaFX designer: run.sh designer for a visual tool, or use run.sh ast-dump for a text-based alternative.

Deprecated API

Read more

PMD 6.51.0 (29-October-2022)

29 Oct 07:50
pmd_releases/6.51.0
66e8340
Compare
Choose a tag to compare

29-October-2022 - 6.51.0

The PMD team is pleased to announce PMD 6.51.0.

This is a minor release.

Table Of Contents

New and noteworthy

New Rules

<rule ref="category/apex/bestpractices.xml/ApexUnitTestClassShouldHaveRunAs"/>

The rule is part of the quickstart.xml ruleset.

Modified Rules

  • The Java rule TestClassWithoutTestCases has a new property testClassPattern. This is
    used to detect empty test classes by name. Previously this rule could only detect empty JUnit3 test cases
    properly. To switch back to the old behavior, this property can be set to an empty value which disables the
    test class detection by pattern.

Fixed Issues

  • apex
    • #4149: [apex] New rule: ApexUnitTestClassShouldHaveRunAs
  • doc
    • #4144: [doc] Update docs to reflect supported languages
    • #4163: [doc] Broken links on page "Architecture Decisions"
  • java-bestpractices
    • #4140: [java] [doc] AccessorClassGeneration violations hidden with Java 11
  • java-codestyle
    • #4139: [java] UnnecessaryFullyQualifiedName FP when the same simple class name exists in the current package
  • java-documentation
    • #4141: [java] UncommentedEmptyConstructor FP when constructor annotated with @Autowired
  • java-performance
    • #1167: [java] AvoidArrayLoops false positive on double assignment
    • #2080: [java] StringToString rule false-positive with field access
    • #2692: [java] [doc] AvoidArrayLoops flags copy assignment in same array as sub-optimal
    • #3437: [java] StringToString doesn't trigger on Bar.class.getSimpleName().toString()
    • #3681: [java] StringToString doesn't trigger on string literals
    • #3847: [java] AvoidArrayLoops should consider final variables
    • #3977: [java] StringToString false-positive with local method name confusion
    • #4091: [java] AvoidArrayLoops false negative with do-while loops
    • #4148: [java] UseArrayListInsteadOfVector ignores Vector when other classes are imported
  • java-errorprone
    • #929: [java] Inconsistent results with TestClassWithoutTestCases
    • #2636: [java] TestClassWithoutTestCases false positive with JUnit5 ParameterizedTest
  • javascript
    • #4165: [javascript] InaccurateNumericLiteral underscore separator notation false positive

API Changes

No changes.

External Contributions

Stats

  • 63 commits
  • 28 closed tickets & PRs
  • Days since last release: 28

PMD 6.50.0 (30-September-2022)

30 Sep 13:58
pmd_releases/6.50.0
37f6d82
Compare
Choose a tag to compare

30-September-2022 - 6.50.0

The PMD team is pleased to announce PMD 6.50.0.

This is a minor release.

Table Of Contents

New and noteworthy

Lua now supports additionally Luau

This release of PMD adds support for Luau, a gradually typed language derived
from Lua. This means, that the Lua language in PMD can now parse both Lua and Luau.

Modified rules

  • The Java rule UnusedPrivateField now ignores private fields, if the fields are
    annotated with any annotation or the enclosing class has any annotation. Annotations often enable a
    framework (such as dependency injection, mocking or e.g. Lombok) which use the fields by reflection or other
    means. This usage can't be detected by static code analysis. Previously these frameworks where explicitly allowed
    by listing their annotations in the property "ignoredAnnotations", but that turned out to be prone of false
    positive for any not explicitly considered framework. That's why the property "ignoredAnnotations" has been
    deprecated for this rule.
  • The Java rule CommentDefaultAccessModifier now by default ignores JUnit5 annotated
    methods. This behavior can be customized using the property ignoredAnnotations.

Fixed Issues

  • cli
    • #4118: [cli] run.sh designer reports "integer expression expected"
  • core
    • #4116: [core] Missing --file arg in TreeExport CLI example
  • doc
    • #4072: [doc] Add architecture decision records
    • #4109: [doc] Add page for 3rd party rulesets
    • #4124: [doc] Fix typos in Java rule docs
  • java
    • #3431: [java] Add sample java project to regression-tester which uses new language constructs
  • java-bestpractices
    • #4033: [java] UnusedPrivateField - false positive with Lombok @ToString.Include
    • #4037: [java] UnusedPrivateField - false positive with Spring @SpyBean
  • java-codestyle
    • #3859: [java] CommentDefaultAccessModifier is triggered in JUnit5 test class
    • #4085: [java] UnnecessaryFullyQualifiedName false positive when nested and non-nested classes with the same name and in the same package are used together
    • #4133: [java] UnnecessaryFullyQualifiedName - FP for inner class pkg.ClassA.Foo implementing pkg.Foo
  • java-design
    • #4090: [java] FinalFieldCouldBeStatic false positive with non-static synchronized block (regression in 6.48, worked with 6.47)
  • java-errorprone
    • #1718: [java] ConstructorCallsOverridableMethod false positive when calling super method
    • #2348: [java] ConstructorCallsOverridableMethod occurs when unused overloaded method is defined
    • #4099: [java] ConstructorCallsOverridableMethod should consider method calls with var access
  • scala
    • #4138: [scala] Upgrade scala-library to 2.12.7 / 2.13.9 and scalameta to 4.6.0

API Changes

CPD CLI

  • CPD now supports the --ignore-literal-sequences argument when analyzing Lua code.

Financial Contributions

Many thanks to our sponsors:

External Contributions

Stats

  • 100 commits
  • 26 closed tickets & PRs
  • Days since last release: 29

PMD 6.49.0 (31-August-2022)

31 Aug 17:41
pmd_releases/6.49.0
4b4ebab
Compare
Choose a tag to compare

31-August-2022 - 6.49.0

The PMD team is pleased to announce PMD 6.49.0.

This is a minor release.

Table Of Contents

New and noteworthy

Updated PMD Designer

This PMD release ships a new version of the pmd-designer.
For the changes, see PMD Designer Changelog.

Fixed Issues

  • apex
    • #4096: [apex] ApexAssertionsShouldIncludeMessage and ApexUnitTestClassShouldHaveAsserts: support new Assert class (introduced with Apex v56.0)
  • core
    • #3970: [core] FileCollector.addFile ignores language parameter
  • java-codestyle
    • #4082: [java] UnnecessaryImport false positive for on-demand imports of nested classes

API Changes

Deprecated API

External Contributions

  • #4081: [apex] Remove Jorje leaks outside ast package - @eklimo
  • #4083: [java] UnnecessaryImport false positive for on-demand imports of nested classes (fix for #4082) - @abyss638
  • #4092: [apex] Implement ApexQualifiableNode for ASTUserEnum - @aaronhurst-google
  • #4095: [core] CPD: Added begin and end token to XML reports - @pacvz
  • #4097: [apex] ApexUnitTestClassShouldHaveAssertsRule: Support new Assert class (Apex v56.0) - @tprouvot
  • #4104: [doc] Add MegaLinter in the list of integrations - @nvuillam

Stats

  • 49 commits
  • 10 closed tickets & PRs
  • Days since last release: 32

PMD 6.48.0 (30-July-2022)

30 Jul 09:58
pmd_releases/6.48.0
6aa2b47
Compare
Choose a tag to compare

30-July-2022 - 6.48.0

The PMD team is pleased to announce PMD 6.48.0.

This is a minor release.

Table Of Contents

New and noteworthy

Java 19 Support

This release of PMD brings support for Java 19. There are no new standard language features.

PMD supports JEP 427: Pattern Matching for switch (Third Preview) and
JEP 405: Record Patterns (Preview) as preview language features.

In order to analyze a project with PMD that uses these language features,
you'll need to enable it via the environment variable PMD_JAVA_OPTS and select the new language
version 19-preview:

export PMD_JAVA_OPTS=--enable-preview
./run.sh pmd -language java -version 19-preview ...

Note: Support for Java 17 preview language features have been removed. The version "17-preview" is no longer available.

Gherkin support

Thanks to the contribution from Anne Brouwers PMD now has CPD support
for the Gherkin language. It is used to defined test cases for the
Cucumber testing tool for behavior-driven development.

Being based on a proper Antlr grammar, CPD can:

Fixed Issues

  • apex
    • #4056: [apex] ApexSOQLInjection: Add support count query
  • core
    • #3796: [core] CPD should also provide a --debug flag
    • #4021: [core] CPD: Add total number of tokens to XML reports
    • #4031: [core] If report is written to stdout, stdout should not be closed
    • #4051: [doc] Additional rulesets are not listed in documentation
    • #4053: [core] Allow building PMD under Java 18+
  • java
    • #4015: [java] Support JDK 19
  • java-bestpractices
    • #3455: [java] WhileLoopWithLiteralBoolean - false negative with complex expressions
  • java-design
    • #3729: [java] TooManyMethods ignores "real" methods which are named like getters or setters
    • #3949: [java] FinalFieldCouldBeStatic - false negative with unnecessary parenthesis
  • java-performance
    • #3625: [java] AddEmptyString - false negative with empty var
  • lua
    • #4061: [lua] Fix several related Lua parsing issues found when using CPD
  • test
    • #3302: [test] Improve xml test schema
    • #3758: [test] Move pmd-test to java 8
    • #3976: [test] Extract xml schema module

API Changes

CPD CLI

  • CPD has a new CLI option --debug. This option has the same behavior as in PMD. It enables more verbose
    logging output.

Rule Test Framework

  • The module "pmd-test", which contains support classes to write rule tests, now requires Java 8. If you depend on
    this module for testing your own custom rules, you'll need to make sure to use at least Java 8.
  • The new module "pmd-test-schema" contains now the XSD schema and the code to parse the rule test XML files. The
    schema has been extracted in order to easily share it with other tools like the Rule Designer or IDE plugins.
  • Test schema changes:
    • The attribute isRegressionTest of test-code is deprecated. The new
      attribute disabled should be used instead for defining whether a rule test should be skipped or not.
    • The attributes reinitializeRule and useAuxClasspath of test-code are deprecated and assumed true.
      They will not be replaced.
    • The new attribute focused of test-code allows disabling all tests except the focused one temporarily.
  • More information about the rule test framework can be found in the documentation:
    Testing your rules

Deprecated API

  • The experimental Java AST class ASTGuardedPattern has been deprecated and
    will be removed. It was introduced for Java 17 and Java 18 Preview as part of pattern matching for switch,
    but it is no longer supported with Java 19 Preview.
  • The interface CPDRenderer is deprecated. For custom CPD renderers
    the new interface CPDReportRenderer should be used.
  • The class TestDescriptor is deprecated, replaced with RuleTestDescriptor.
  • Many methods of RuleTst have been deprecated as internal API.

Experimental APIs

Internal API

Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0.
You can identify them with the @InternalApi annotation. You'll also get a deprecation warning.

Financial Contributions

Many thanks to our sponsors:

External Contributions

Stats

  • 102 commits
  • 26 closed tickets & PRs
  • Days since last release: 35

PMD 6.47.0 (25-June-2022)

25 Jun 07:50
pmd_releases/6.47.0
07eb3d2
Compare
Choose a tag to compare

25-June-2022 - 6.47.0

The PMD team is pleased to announce PMD 6.47.0.

This is a minor release.

Table Of Contents

Fixed Issues

  • core
    • #3999: [cli] All files are analyzed despite parameter --file-list
    • #4009: [core] Cannot build PMD with Temurin 17
  • java-bestpractices
    • #3824: [java] UnusedPrivateField: Do not flag fields annotated with @Version
    • #3825: [java] UnusedPrivateField: Do not flag fields annotated with @Id or @EmbeddedId
  • java-design
    • #3823: [java] ImmutableField: Do not flag fields in @Entity
    • #3981: [java] ImmutableField reports fields annotated with @Value (Spring)
    • #3998: [java] ImmutableField reports fields annotated with @Captor (Mockito)
    • #4004: [java] ImmutableField reports fields annotated with @GwtMock (GwtMockito) and @Spy (Mockito)
    • #4008: [java] ImmutableField not reporting fields that are only initialized in the declaration
    • #4011: [java] ImmutableField: Do not flag fields annotated with @Inject
    • #4020: [java] ImmutableField reports fields annotated with @FindBy and @FindBys (Selenium)
  • java-errorprone
    • #3936: [java] AvoidFieldNameMatchingMethodName should consider enum class
    • #3937: [java] AvoidDuplicateLiterals - uncompilable test cases

API Changes

No changes.

External Contributions

  • #3985: [java] Fix false negative problem about Enum in AvoidFieldNameMatchingMethodName #3936 - @Scrsloota
  • #3993: [java] AvoidDuplicateLiterals - Add the method "buz" definition to test cases - @dalizi007
  • #4002: [java] ImmutableField - Ignore fields annotated with @Value (Spring) or @Captor (Mockito) - @jjlharrison
  • #4003: [java] UnusedPrivateField - Ignore fields annotated with @Id/@EmbeddedId/@Version (JPA) or @Mock/@Spy/@MockBean (Mockito/Spring) - @jjlharrison
  • #4006: [doc] Fix eclipse plugin update site URL - @shiomiyan
  • #4010: [core] Bump kotlin to version 1.7.0 - @maikelsteneker

Stats

  • 45 commits
  • 23 closed tickets & PRs
  • Days since last release: 27