| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| ReadMe.md | 2022-11-26 | 14.6 kB | |
| pmd-doc-6.52.0.zip | 2022-11-26 | 5.8 MB | |
| pmd-src-6.52.0.zip | 2022-11-26 | 16.1 MB | |
| pmd-bin-6.52.0.zip | 2022-11-26 | 44.7 MB | |
| Totals: 4 Items | 66.6 MB | 0 | |
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
- The new Java rule
InvalidJavaBeanidentifies beans, that don't follow the JavaBeans API specification, like beans with missing getters or setters.
<rule ref="category/java/design.xml/InvalidJavaBean"/>
Renamed rules
- The Java rule
BeanMembersShouldSerializehas been renamed toNonSerializableClass. It has been revamped to only check for classes that are marked withSerializableand 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
ClassNamingConventionshas a new propertytestClassPattern, 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
ignoredAnnotationsof ruleImmutableFieldhas 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
- java-codestyle
- 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
- #4175: [java] ImmutableField - deprecate property
- 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-versionflag, which receives a language-version pair (such asjava-8orapex-54). This supersedes the usage of-language/-land-version/-v, allowing for multiple versions to be set in a single run. PMD 7 will completely remove support for-languageand-versionin favor of this new flag. -
Support for
-Vis being deprecated in favor of--verbosein preparation for PMD 7. In PMD 7,-vwill enable verbose mode and-Vwill show the PMD version for consistency with most Unix/Linux tools. -
Support for
-minis being deprecated in favor of--minimum-priorityfor consistency with most Unix/Linux tools, where-minwould be equivalent to-m -i -n.
CPD CLI
- CPD now supports using
-dor--diras an alias to--files, in favor of consistency with PMD. PMD 7 will remove support for--filesin favor of these new flags.
Linux run.sh parameters
-
Using
run.sh cpdguiwill now warn about it being deprecated. Userun.sh cpd-guiinstead. -
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 designerfor a visual tool, or userun.sh ast-dumpfor a text-based alternative.
Deprecated API
- The following core APIs have been marked as deprecated for removal in PMD 7:
PMDandPMD.StatusCode- PMD 7 will ship with a revamped CLI split from pmd-core. To programmatically launch analysis you can usePmdAnalysis.PMDConfiguration#getAllInputPaths- It is now superseded byPMDConfiguration#getInputPathListPMDConfiguration#setInputPaths- It is now superseded byPMDConfiguration#setInputPathListPMDConfiguration#addInputPath- It is now superseded byPMDConfiguration#addInputPathPMDConfiguration#getInputFilePath- It is now superseded byPMDConfiguration#getInputFilePMDConfiguration#getIgnoreFilePath- It is now superseded byPMDConfiguration#getIgnoreFilePMDConfiguration#setInputFilePath- It is now superseded byPMDConfiguration#setInputFilePathPMDConfiguration#setIgnoreFilePath- It is now superseded byPMDConfiguration#setIgnoreFilePathPMDConfiguration#getInputUri- It is now superseded byPMDConfiguration#getUriPMDConfiguration#setInputUri- It is now superseded byPMDConfiguration#setInputUriPMDConfiguration#getReportFile- It is now superseded byPMDConfiguration#getReportFilePathPMDConfiguration#setReportFile- It is now superseded byPMDConfiguration#setReportFilePMDConfiguration#isStressTestandPMDConfiguration#setStressTest- Will be removed with no replacement.PMDConfiguration#isBenchmarkandPMDConfiguration#setBenchmark- Will be removed with no replacement, the CLI will still support it.-
CPDandCPD.StatusCode- PMD 7 will ship with a revamped CLI split from pmd-core. An alterative to programatically launch CPD analysis will be added in due time. -
In order to reduce the dependency on Apex Jorje classes, the method
DataType#fromBasicTypehas been deprecated. The equivalent methodfromTypeNameshould be used instead.
External Contributions
- #4184: [java][doc] TestClassWithoutTestCases - fix small typo in description - Valery Yatsynovich (@valfirst)
- #4198: [doc] Add supported CPD languages - Jeroen van Wilgenburg (@jvwilge)
- #4202: [java] Fix #4200 and #4201: ClassWithOnlyPrivateConstructorsShouldBeFinal, CommentDefaultAccessModifier: Exclude lombok @Value annotation - Lynn (@LynnBroe)
- #4205: [doc] Clarify Scala support (no built-in rules) - Eldrick Wega (@Eldrick19)
- #4226: [visualforce] Replace uses of Jorje types in pmd-visualforce - Aaron Hurst (@aaronhurst-google)
- #4227: [java] Fix #4225 MissingStaticMethodInNonInstantiatableClass: Exclude lombok's @NoArgsConstructor annotation - Lynn (@LynnBroe)
- #4228: [java] Fix #4224 MissingStaticMethodInNonInstantiatableClass: Exclude lombok's UtilityClass - Lynn (@LynnBroe)
- #4232: [doc] Fixing typos - Andreas Deininger (@deining)
Stats
- 96 commits
- 40 closed tickets & PRs
- Days since last release: 28