[pmd-devel] [ANNOUNCE] PMD 7.0.0-rc4 released
A source code analyzer
Brought to you by:
adangel,
juansotuyo
From: Andreas D. <and...@pm...> - 2023-09-30 18:19:29
|
* Downloads: https://github.com/pmd/pmd/releases/tag/pmd_releases%2F7.0.0-rc4 * Documentation: https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/ 30-September-2023 - 7.0.0-rc4 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 <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes_pmd7.html>. *βΉοΈ 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 <https://github.com/pmd/pmd/issues/3898>. If you find any problem or difficulty while updating from PMD 6, please provide feedback via our issue tracker <https://github.com/pmd/pmd/issues/new/choose>. That way we can improve the experience for all. Table Of Contents * Changes since 7.0.0-rc3 <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#changes-since-7.0.0-rc3> o New and Noteworthy <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#new-and-noteworthy> + Migration Guide for PMD 7 <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#migration-guide-for-pmd-7> + Apex Jorje Updated <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#apex-jorje-updated> + Java 21 Support <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#java-21-support> o Fixed issues <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#fixed-issues> o API Changes <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#api-changes> + pmd-java <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#pmd-java> + Rule properties <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#rule-properties> + New Programmatic API for CPD <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#new-programmatic-api-for-cpd> + Removed classes and methods <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#removed-classes-and-methods> + Moved packages <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#moved-packages> + Changed types and other changes <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#changed-types-and-other-changes> + Internal APIs <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#internal-apis> + Deprecated API <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#deprecated-api> + Experimental APIs <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#experimental-apis> o External Contributions <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#external-contributions> * π Major Features and Enhancements <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#π-major-features-and-enhancements> o New official logo <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#new-official-logo> o Revamped Java module <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#revamped-java-module> o Revamped Command Line Interface <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#revamped-command-line-interface> o Full Antlr support <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#full-antlr-support> o Updated PMD Designer <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#updated-pmd-designer> o New CPD report format cpdhtml-v2.xslt <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#new-cpd-report-format-cpdhtml-v2.xslt> * π Language Related Changes <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#π-language-related-changes> o New: Swift support <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#new:-swift-support> o New: Kotlin support (experimental) <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#new:-kotlin-support-(experimental)> o New: CPD support for TypeScript <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#new:-cpd-support-for-typescript> o New: CPD support for Julia <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#new:-cpd-support-for-julia> o New: CPD support for Coco <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#new:-cpd-support-for-coco> o New: Java 21 Support <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#new:-java-21-support> o Changed: JavaScript support <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#changed:-javascript-support> o Changed: Language versions <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#changed:-language-versions> o Changed: CPP can now ignore identifiers in sequences (CPD) <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#changed:-cpp-can-now-ignore-identifiers-in-sequences-(cpd)> o Changed: Apex Jorje Updated <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#changed:-apex-jorje-updated> o Changed: Rule properties <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#changed:-rule-properties> * π New and changed rules <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#π-new-and-changed-rules> o New Rules <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#new-rules> o Changed Rules <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#changed-rules> o Removed Rules <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#removed-rules> * π¨ API <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#π¨-api> * π₯ Compatibility and migration notes <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#π₯-compatibility-and-migration-notes> * π Fixed Issues <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#π-fixed-issues> * β¨ External Contributions <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#β¨-external-contributions> * π Stats <https://sourceforge.net/p/pmd/news/2023/09/pmd-700-rc4-30-september-2023-released/#π-stats> Changes since 7.0.0-rc3 This section lists the most important changes from the last release candidate. The remaining section describes the complete release notes for 7.0.0. New and Noteworthy Migration Guide for PMD 7 A detailed documentation of required changes are available in the Migration Guide for PMD 7 <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_userdocs_migrating_to_pmd7.html>. Apex Jorje Updated With the new version of Apex Jorje, the new language constructs like User Mode Database Operations can be parsed now. PMD should now be able to parse Apex code up to version 59.0 (Winter '23). Java 21 Support This release of PMD brings support for Java 21. There are the following new standard language features, that are supported now: * JEP 440: Record Patterns <https://openjdk.org/jeps/440> * JEP 441: Pattern Matching for switch <https://openjdk.org/jeps/441> PMD also supports the following preview language features: * JEP 430: String Templates (Preview) <https://openjdk.org/jeps/430> * JEP 443: Unnamed Patterns and Variables (Preview) <https://openjdk.org/jeps/443> * JEP 445: Unnamed Classes and Instance Main Methods (Preview) <https://openjdk.org/jeps/445> 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 |21-preview|: |exportPMD_JAVA_OPTS=--enable-preview pmdcheck--use-versionjava-21-preview... | Note: Support for Java 19 preview language features have been removed. The version "19-preview" is no longer available. Fixed issues * miscellaneous * #4582 <https://github.com/pmd/pmd/issues/4582>: [dist] Download link broken * #4691 <https://github.com/pmd/pmd/issues/4691>: [CVEs] Critical and High CEVs reported on PMD and PMD dependencies * core * #1204 <https://github.com/pmd/pmd/issues/1204>: [core] Allow numeric properties in XML to be within an unbounded range * #3919 <https://github.com/pmd/pmd/issues/3919>: [core] Merge CPD and PMD language * #4204 <https://github.com/pmd/pmd/issues/4204>: [core] Provide a CpdAnalysis class as a programmatic entry point into CPD * #4301 <https://github.com/pmd/pmd/issues/4301>: [core] Remove deprecated property concrete classes * #4302 <https://github.com/pmd/pmd/issues/4302>: [core] Migrate Property Framework API to Java 8 * #4323 <https://github.com/pmd/pmd/issues/4323>: [core] Refactor CPD integration * #4397 <https://github.com/pmd/pmd/pull/4397>: [core] Refactor CPD * #4611 <https://github.com/pmd/pmd/pull/4611>: [core] Fix loading language properties from env vars * #4621 <https://github.com/pmd/pmd/issues/4621>: [core] Make |ClasspathClassLoader::getResource| child first * cli * #4423 <https://github.com/pmd/pmd/pull/4423>: [cli] Fix NPE when only |--file-list| is specified * doc * #4294 <https://github.com/pmd/pmd/issues/4294>: [doc] Migration Guide for upgrading PMD 6 β‘οΈ 7 * #4303 <https://github.com/pmd/pmd/issues/4303>: [doc] Document new property framework * #4521 <https://github.com/pmd/pmd/issues/4521>: [doc] Website is not mobile friendly * apex * #3973 <https://github.com/pmd/pmd/issues/3973>: [apex] Update parser to support new 'as user' keywords (User Mode for Database Operations) * #4453 <https://github.com/pmd/pmd/issues/4453>: [apex] [7.0-rc1] Exception while initializing Apexlink (Index 34812 out of bounds for length 34812) * apex-design * #4596 <https://github.com/pmd/pmd/issues/4596>: [apex] ExcessivePublicCount ignores properties * apex-security * #4646 <https://github.com/pmd/pmd/issues/4646>: [apex] ApexSOQLInjection does not recognise SObjectType or SObjectField as safe variable types * java * #4401 <https://github.com/pmd/pmd/issues/4401>: [java] PMD 7 fails to build under Java 19 * #4583 <https://github.com/pmd/pmd/issues/4583>: [java] Support JDK 21 (LTS) * java-bestpractices * #4634 <https://github.com/pmd/pmd/issues/4634>: [java] JUnit4TestShouldUseTestAnnotation false positive with TestNG API Changes pmd-java * Support for Java 19 preview language features have been removed. The version "19-preview" is no longer available. Rule properties * The old deprecated classes like |IntProperty| and |StringProperty| have been removed. Please use |PropertyFactory| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/properties/PropertyFactory.html#> to create properties. * All properties which accept multiple values now use a comma (|,|) as a delimiter. The previous default was a pipe character (|||). The delimiter is not configurable anymore. If needed, the comma can be escaped with a backslash. * The |min| and |max| attributes in property definitions in the XML are now optional and can appear separately or be omitted. New Programmatic API for CPD See Detailed Release Notes for PMD 7 <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes_pmd7.html#new-programmatic-api-for-cpd> and PR #4397 <https://github.com/pmd/pmd/pull/4397> for details. Removed classes and methods The following previously deprecated classes have been removed: * pmd-core * |net.sourceforge.pmd.cpd.AbstractTokenizer| β‘οΈ use |AnyTokenizer| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/AnyTokenizer.html#> instead * |net.sourceforge.pmd.cpd.CPD| β‘οΈ use |PmdCli| <https://docs.pmd-code.org/apidocs/pmd-cli/7.0.0-rc4/net/sourceforge/pmd/cli/PmdCli.html#> from |pmd-cli| module for CLI support or use |CpdAnalysis| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/CpdAnalysis.html#> for programmatic API * |net.sourceforge.pmd.cpd.GridBagHelper| (now package private) * |net.sourceforge.pmd.cpd.TokenEntry.State| * |net.sourceforge.pmd.lang.document.CpdCompat| * |net.sourceforge.pmd.properties.BooleanMultiProperty| * |net.sourceforge.pmd.properties.BooleanProperty| * |net.sourceforge.pmd.properties.CharacterMultiProperty| * |net.sourceforge.pmd.properties.CharacterProperty| * |net.sourceforge.pmd.properties.DoubleMultiProperty| * |net.sourceforge.pmd.properties.DoubleProperty| * |net.sourceforge.pmd.properties.EnumeratedMultiProperty| * |net.sourceforge.pmd.properties.EnumeratedProperty| * |net.sourceforge.pmd.properties.EnumeratedPropertyDescriptor| * |net.sourceforge.pmd.properties.FileProperty| (note: without replacement) * |net.sourceforge.pmd.properties.FloatMultiProperty| * |net.sourceforge.pmd.properties.FloatProperty| * |net.sourceforge.pmd.properties.IntegerMultiProperty| * |net.sourceforge.pmd.properties.IntegerProperty| * |net.sourceforge.pmd.properties.LongMultiProperty| * |net.sourceforge.pmd.properties.LongProperty| * |net.sourceforge.pmd.properties.MultiValuePropertyDescriptor| * |net.sourceforge.pmd.properties.NumericPropertyDescriptor| * |net.sourceforge.pmd.properties.PropertyDescriptorField| * |net.sourceforge.pmd.properties.RegexProperty| * |net.sourceforge.pmd.properties.SingleValuePropertyDescriptor| * |net.sourceforge.pmd.properties.StringMultiProperty| * |net.sourceforge.pmd.properties.StringProperty| * |net.sourceforge.pmd.properties.ValueParser| * |net.sourceforge.pmd.properties.ValueParserConstants| * |net.sourceforge.pmd.properties.builders.MultiNumericPropertyBuilder| * |net.sourceforge.pmd.properties.builders.MultiPackagedPropertyBuilder| * |net.sourceforge.pmd.properties.builders.MultiValuePropertyBuilder| * |net.sourceforge.pmd.properties.builders.PropertyDescriptorBuilder| * |net.sourceforge.pmd.properties.builders.PropertyDescriptorBuilderConversionWrapper| * |net.sourceforge.pmd.properties.builders.PropertyDescriptorExternalBuilder| * |net.sourceforge.pmd.properties.builders.SingleNumericPropertyBuilder| * |net.sourceforge.pmd.properties.builders.SinglePackagedPropertyBuilder| * |net.sourceforge.pmd.properties.builders.SingleValuePropertyBuilder| * |net.sourceforge.pmd.properties.modules.EnumeratedPropertyModule| * |net.sourceforge.pmd.properties.modules.NumericPropertyModule| The following previously deprecated methods have been removed: * pmd-core * |net.sourceforge.pmd.properties.PropertyBuilder.GenericCollectionPropertyBuilder#delim(char)| * |net.sourceforge.pmd.properties.PropertySource#setProperty(...)| * |net.sourceforge.pmd.properties.PropertyTypeId#factoryFor(...)| * |net.sourceforge.pmd.properties.PropertyTypeId#typeIdFor(...)| * |net.sourceforge.pmd.properties.PropertyDescriptor|: removed methods errorFor, type, isMultiValue, uiOrder, compareTo, isDefinedExternally, valueFrom, asDelimitedString The following methods have been removed: * pmd-core * |CPDConfiguration| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/CPDConfiguration.html#> o |#sourceCodeFor(File)|, |#postConstruct()|, |#tokenizer()|, |#filenameFilter()| removed * |Mark| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/Mark.html#> o |#getSourceSlice()|, |#setLineCount(int)|, |#getLineCount()|, |#setSourceCode(SourceCode)| removed o |#getBeginColumn()|, |#getBeginLine()|, |#getEndLine()|, |#getEndColumn()| removed β‘οΈ use |getLocation| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/Mark.html#getLocation()> instead * |Match| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/Match.html#> o |#LABEL_COMPARATOR| removed o |#setMarkSet(...)|, |#setLabel(...)|, |#getLabel()|, |#addTokenEntry(...)| removed o |#getSourceCodeSlice()| removed β‘οΈ use |CPDReport#getSourceCodeSlice| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/CPDReport.html#getSourceCodeSlice(net.sourceforge.pmd.cpd.Mark)> instead * |TokenEntry| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/TokenEntry.html#> o |#getEOF()|, |#clearImages()|, |#getIdentifier()|, |#getIndex()|, |#setHashCode(int)| removed o |#EOF| removed β‘οΈ use |isEof| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/TokenEntry.html#isEof()> instead * |Parser.ParserTask| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/lang/ast/Parser.ParserTask.html#> o |#getFileDisplayName()| removed β‘οΈ use |getFileId| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/lang/ast/Parser.ParserTask.html#getFileId()> instead (|getFileId().getAbsolutePath()|) The following classes have been removed: * pmd-core * |net.sourceforge.pmd.cpd.AbstractLanguage| * |net.sourceforge.pmd.cpd.AnyLanguage| * |net.sourceforge.pmd.cpd.Language| * |net.sourceforge.pmd.cpd.LanguageFactory| * |net.sourceforge.pmd.cpd.MatchAlgorithm| (now package private) * |net.sourceforge.pmd.cpd.MatchCollector| (now package private) * |net.sourceforge.pmd.cpd.SourceCode| (and all inner classes like |FileCodeLoader|, ...) * |net.sourceforge.pmd.cpd.token.TokenFilter| Moved packages * pmd-core * |NumericConstraints| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/net/sourceforge/pmd/properties/NumericConstraints.html#> (old package: |net.sourceforge.pmd.properties.constraints.NumericConstraints|) * |PropertyConstraint| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/net/sourceforge/pmd/properties/PropertyConstraint.html#> (old package: |net.sourceforge.pmd.properties.constraints.PropertyConstraint|) o not experimental anymore * |ReportException| <https://docs.pmd-code.org/apidocs/pmd-ant/7.0.0-rc4/net/sourceforge/pmd/ant/ReportException.html#> (old package: |net.sourceforge.pmd.cpd|, moved to module |pmd-ant|) o it is now a RuntimeException * |CPDReportRenderer| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/CPDReportRenderer.html#> (old package: |net.sourceforge.pmd.cpd.renderer|) * |AntlrTokenFilter| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/impl/AntlrTokenFilter.html#> (old package: |net.sourceforge.pmd.cpd.token|) * |BaseTokenFilter| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/impl/BaseTokenFilter.html#> (old package: |net.sourceforge.pmd.cpd.token.internal|) * |JavaCCTokenFilter| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/impl/JavaCCTokenFilter.html#> (old package: |net.sourceforge.pmd.cpd.token|) Changed types and other changes * pmd-core * |PropertyDescriptor| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/net/sourceforge/pmd/properties/PropertyDescriptor.html#> is now a class (was an interface) and it is not comparable anymore. * |AbstractConfiguration#setSourceEncoding| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/AbstractConfiguration.html#setSourceEncoding(java.nio.charset.Charset)> o previously this method took a simple String for the encoding. * |PmdConfiguration| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/PmdConfiguration.html#> and |CPDConfiguration| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/CPDConfiguration.html#> o many getters and setters have been moved to the parent class |AbstractConfiguration| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/AbstractConfiguration.html#> * |CPDListener#addedFile| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/CPDListener.html#addedFile(int)> o no |File| parameter anymore * |CPDReport#getNumberOfTokensPerFile| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/CPDReport.html#getNumberOfTokensPerFile()> returns a |Map| of |FileId,Integer| instead of |String| * |CPDReport#filterMatches| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/CPDReport.html#filterMatches(java.util.function.Predicate)> now takes a |java.util.function.Predicate| as parameter * |Tokenizer| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/Tokenizer.html#> o constants are now |PropertyDescriptor| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/properties/PropertyDescriptor.html#> instead of |String|, to be used as language properties o |tokenize| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/Tokenizer.html#tokenize(net.sourceforge.pmd.lang.document.TextDocument,net.sourceforge.pmd.cpd.TokenFactory)> changed parameters. Now takes a |TextDocument| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/lang/document/TextDocument.html#> and a |TokenFactory| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/TokenFactory.html#> (instead of |SourceCode| and |Tokens|) * |Language| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/lang/Language.html#> o method |#createProcessor(LanguagePropertyBundle)| moved to |PmdCapableLanguage| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/lang/PmdCapableLanguage.html#> * |StringUtil#linesWithTrimIndent| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/util/StringUtil.html#linesWithTrimIndent(net.sourceforge.pmd.lang.document.Chars)> now takes a |Chars| instead of a |String|. * All language modules (like pmd-apex, pmd-cpp, ...) * consistent package naming: |net.sourceforge.pmd.lang.<langId>.cpd| * adapted to use |CpdCapableLanguage| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/CpdCapableLanguage.html#> * consistent static method |#getInstance()| * removed constants like |ID|, |TERSE_NAME| or |NAME|. Use |getInstance().getName()| etc. instead Internal APIs * |Tokens| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/cpd/Tokens.html#> * |PropertyTypeId| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/net/sourceforge/pmd/properties/PropertyTypeId.html#> Deprecated API * |Language#getTerseName| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/lang/Language.html#getTerseName()> β‘οΈ use |getId| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/lang/Language.html#getId()> instead * The method |ASTPattern#getParenthesisDepth| <https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-rc4/net/sourceforge/pmd/lang/java/ast/ASTPattern.html#getParenthesisDepth()> has been deprecated and will be removed. It was introduced for supporting parenthesized patterns, but that was removed with Java 21. It is only used when parsing code as java-19-preview. Experimental APIs * To support the Java preview language features "String Templates" and "Unnamed Patterns and Variables", the following AST nodes have been introduced as experimental: * |ASTTemplateExpression| <https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-rc4/net/sourceforge/pmd/lang/java/ast/ASTTemplateExpression.html#> * |ASTTemplate| <https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-rc4/net/sourceforge/pmd/lang/java/ast/ASTTemplate.html#> * |ASTTemplateFragment| <https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-rc4/net/sourceforge/pmd/lang/java/ast/ASTTemplateFragment.html#> * |ASTUnnamedPattern| <https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-rc4/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.html#> * The AST nodes for supporting "Record Patterns" and "Pattern Matching for switch" are not experimental anymore: * |ASTRecordPattern| <https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-rc4/net/sourceforge/pmd/lang/jast/ast/ASTRecordPattern.html#> * |ASTPatternList| <https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-rc4/net/sourceforge/pmd/lang/jast/ast/ASTPatternList.html#> (Note: it was renamed from |ASTComponentPatternList|) * |ast| <https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-rc4/net/sourceforge/pmd/lang/jast/ast.html#> (Note: it was renamed from |ASTSwitchGuard|) External Contributions * #4528 <https://github.com/pmd/pmd/pull/4528>: [apex] Update to apexlink - Kevin Jones <https://github.com/nawforce> (@nawforce) * #4637 <https://github.com/pmd/pmd/pull/4637>: [java] fix #4634 - JUnit4TestShouldUseTestAnnotation false positive with TestNG - Krystian Dabrowski <https://github.com/krdabrowski> (@krdabrowski) * #4649 <https://github.com/pmd/pmd/pull/4649>: [apex] Add SObjectType and SObjectField to list of injectable SOQL variable types - Richard Corfield <https://github.com/rcorfieldffdc> (@rcorfieldffdc) * #4651 <https://github.com/pmd/pmd/pull/4651>: [doc] Add "Tencent Cloud Code Analysis" in Tools / Integrations - yale <https://github.com/cyw3> (@cyw3) * #4664 <https://github.com/pmd/pmd/pull/4664>: [cli] CPD: Fix NPE when only |--file-list| is specified - Wener <https://github.com/wener-tiobe> (@wener-tiobe) * #4665 <https://github.com/pmd/pmd/pull/4665>: [java] Doc: Fix references AutoClosable -> AutoCloseable - Andrey Bozhko <https://github.com/AndreyBozhko> (@AndreyBozhko) π 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 <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes_pmd7.html#revamped-java>. Contributors: ClΓ©ment Fournier <https://github.com/oowekyala> (@oowekyala <https://sourceforge.net/u/oowekyala/>), Andreas Dangel <https://github.com/adangel> (@adangel <https://sourceforge.net/u/adangel/>), Juan MartΓn Sotuyo Dodero <https://github.com/jsotuyod> (@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: o |pmd check| to run PMD rules and analyze a project o |pmd cpd| to run CPD (copy paste detector) o |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 <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes_pmd7.html>. Contributors: Juan MartΓn Sotuyo Dodero <https://github.com/jsotuyod> (@jsotuyod) Full Antlr support * Antlr <https://www.antlr.org/> 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 <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes_pmd7.html>. Contributors: Lucas Soncini <https://github.com/lsoncini> (@lsoncini), MatΓas Fraga <https://github.com/matifraga> (@matifraga), TomΓ‘s De Lucca <https://github.com/tomidelucca> (@tomidelucca) Updated PMD Designer This PMD release ships a new version of the pmd-designer. For the changes, see PMD Designer Changelog <https://github.com/pmd/pmd-designer/releases/tag/7.0.0-rc1>. New CPD report format cpdhtml-v2.xslt Thanks to @mohan-chinnappan-n a new CPD report format has been added which features a data table. It uses an XSLT stylesheet to convert CPD's XML format into HTML. See the example report <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/report-examples/cpdhtml-v2.html>. π 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 <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes_pmd7.html>. New: Swift support * use PMD to analyze Swift code with PMD rules * initially 4 built-in rules Contributors: Lucas Soncini <https://github.com/lsoncini> (@lsoncini), MatΓas Fraga <https://github.com/matifraga> (@matifraga), TomΓ‘s De Lucca <https://github.com/tomidelucca> (@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 New: CPD support for TypeScript Thanks to a contribution, CPD now supports the TypeScript language. It is shipped with the rest of the JavaScript support in the module |pmd-javascript|. Contributors: Paul Guyot <https://github.com/pguyot> (@pguyot <https://sourceforge.net/u/pguyot/>) New: CPD support for Julia Thanks to a contribution, CPD now supports the Julia language. It is shipped in the new module |pmd-julia|. Contributors: Wener <https://github.com/wener-tiobe> (@wener-tiobe) New: CPD support for Coco Thanks to a contribution, CPD now supports Coco, a modern programming language designed specifically for building event-driven software. It is shipped in the new module |pmd-coco|. Contributors: Wener <https://github.com/wener-tiobe> (@wener-tiobe) New: Java 21 Support This release of PMD brings support for Java 21. There are the following new standard language features, that are supported now: * JEP 440: Record Patterns <https://openjdk.org/jeps/440> * JEP 441: Pattern Matching for switch <https://openjdk.org/jeps/441> PMD also supports the following preview language features: * JEP 430: String Templates (Preview) <https://openjdk.org/jeps/430> * JEP 443: Unnamed Patterns and Variables (Preview) <https://openjdk.org/jeps/443> * JEP 445: Unnamed Classes and Instance Main Methods (Preview) <https://openjdk.org/jeps/445> 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 |21-preview|: |exportPMD_JAVA_OPTS=--enable-preview pmdcheck--use-versionjava-21-preview... | Note: Support for Java 19 preview language features have been removed. The version "19-preview" is no longer available. Changed: JavaScript support * latest version supports ES6 and also some new constructs (see Rhino <https://github.com/mozilla/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. Changed: CPP can now ignore identifiers in sequences (CPD) * new command line option for CPD: |--ignore-sequences|. * This option is used for CPP only: with the already existing option |--ignore-literal-sequences|, only literals were ignored. The new option additional ignores identifiers as well in sequences. * See PR #4470 <https://github.com/pmd/pmd/pull/4470> for details. Changed: Apex Jorje Updated With the new version of Apex Jorje, the new language constructs like User Mode Database Operations can be parsed now. PMD should now be able to parse Apex code up to version 59.0 (Winter '23). Changed: Rule properties * The old deprecated classes like |IntProperty| and |StringProperty| have been removed. Please use |PropertyFactory| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/properties/PropertyFactory.html#> to create properties. * All properties which accept multiple values now use a comma (|,|) as a delimiter. The previous default was a pipe character (|||). The delimiter is not configurable anymore. If needed, the comma can be escaped with a backslash. * The |min| and |max| attributes in property definitions in the XML are now optional and can appear separately or be omitted. π New and changed rules New Rules *Apex* * |UnusedMethod| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_apex_design.html#unusedmethod> finds unused methods in your code. *Java* * |UnnecessaryBoxing| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_codestyle.html#unnecessaryboxing> reports boxing and unboxing conversions that may be made implicit. *Kotlin* * |FunctionNameTooShort| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_kotlin_bestpractices.html#functionnametooshort> * |OverrideBothEqualsAndHashcode| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_kotlin_errorprone.html#overridebothequalsandhashcode> *Swift* * |ProhibitedInterfaceBuilder| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_swift_bestpractices.html#prohibitedinterfacebuilder> * |UnavailableFunction| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_swift_bestpractices.html#unavailablefunction> * |ForceCast| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_swift_errorprone.html#forcecast> * |ForceTry| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_swift_errorprone.html#forcetry> Changed Rules *General changes* * All statistical rules (like ExcessiveClassLength, ExcessiveParameterList) have been simplified and unified. The properties |topscore| and |sigma| have been removed. The property |minimum| is still there, however the type is not a decimal number anymore but has been changed to an integer. This affects rules in the languages Apex, Java, PLSQL and Velocity Template Language (vm): o Apex: |ExcessiveClassLength| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_apex_design.html#excessiveclasslength>, |ExcessiveParameterList| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_apex_design.html#excessiveparameterlist>, |ExcessivePublicCount| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_apex_design.html#excessivepubliccount>, |NcssConstructorCount| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_apex_design.html#ncssconstructorcount>, |NcssMethodCount| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_apex_design.html#ncssmethodcount>, |NcssTypeCount| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_apex_design.html#ncsstypecount> o Java: |ExcessiveImports| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#excessiveimports>, |ExcessiveParameterList| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#excessiveparameterlist>, |ExcessivePublicCount| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#excessivepubliccount>, |SwitchDensity| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#switchdensity> o PLSQL: |ExcessiveMethodLength| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_plsql_design.html#excessivemethodlength>, |ExcessiveObjectLength| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_plsql_design.html#excessiveobjectlength>, |ExcessivePackageBodyLength| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_plsql_design.html#excessivepackagebodylength>, |ExcessivePackageSpecificationLength| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_plsql_design.html#excessivepackagespecificationlength>, |ExcessiveParameterList| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_plsql_design.html#excessiveparameterlist>, |ExcessiveTypeLength| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_plsql_design.html#excessivetypelength>, |NcssMethodCount| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_plsql_design.html#ncssmethodcount>, |NcssObjectCount| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_plsql_design.html#ncssobjectcount>, |NPathComplexity| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_plsql_design.html#npathcomplexity> o VM: |ExcessiveTemplateLength| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_vm_design.html#excessivetemplatelength> * The general property |violationSuppressXPath| which is available for all rules to suppress warnings <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_userdocs_suppressing_warnings.html> now uses XPath version 3.1 by default. This version of the XPath language is mostly identical to XPath 2.0. In PMD 6, XPath 1.0 has been used. If you upgrade from PMD 6, you need to verify your |violationSuppressXPath| properties. *Apex General changes* * The properties |cc_categories|, |cc_remediation_points_multiplier|, |cc_block_highlighting| have been removed from all rules. These properties have been deprecated since PMD 6.13.0. See issue #1648 <https://github.com/pmd/pmd/issues/1648> for more details. *Java General changes* * Violations reported on methods or classes previously reported the line range of the entire method or class. With PMD 7.0.0, the reported location is now just the identifier of the method or class. This affects various rules, e.g. |CognitiveComplexity| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#cognitivecomplexity>. The report location is controlled by the overrides of the method |getReportLocation| <https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-rc4/net/sourceforge/pmd/lang/ast/Node.html#getReportLocation()> in different node types. See issue #4439 <https://github.com/pmd/pmd/issues/4439> and issue #730 <https://github.com/pmd/pmd/issues/730> for more details. *Java Best Practices* * |ArrayIsStoredDirectly| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_bestpractices.html#arrayisstoreddirectly>: Violations are now reported on the assignment and not anymore on the formal parameter. The reported line numbers will probably move. * |AvoidReassigningLoopVariables| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_bestpractices.html#avoidreassigningloopvariables>: This rule might not report anymore all reassignments of the control variable in for-loops when the property |forReassign| is set to |skip|. See issue #4500 <https://github.com/pmd/pmd/issues/4500> for more details. * |LooseCoupling| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_bestpractices.html#loosecoupling>: The rule has a new property to allow some types to be coupled to (|allowedTypes|). * |UnusedLocalVariable| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_bestpractices.html#unusedlocalvariable>: This rule has some important false-negatives fixed and finds many more cases now. For details see issues #2130 <https://github.com/pmd/pmd/issues/2130>, #4516 <https://github.com/pmd/pmd/issues/4516>, and #4517 <https://github.com/pmd/pmd/issues/4517>. *Java Codestyle* * |MethodNamingConventions| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_codestyle.html#methodnamingconventions>: The property |checkNativeMethods| has been removed. The property was deprecated since PMD 6.3.0. Use the property |nativePattern| to control whether native methods should be considered or not. * |ShortVariable| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_codestyle.html#shortvariable>: This rule now also reports short enum constant names. * |UseDiamondOperator| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_codestyle.html#usediamondoperator>: The property |java7Compatibility| has been removed. The rule now handles Java 7 properly without a property. * |UnnecessaryFullyQualifiedName| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_codestyle.html#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| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_codestyle.html#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. *Java Design* * |CyclomaticComplexity| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#cyclomaticcomplexity>: The property |reportLevel| has been removed. The property was deprecated since PMD 6.0.0. The report level can now be configured separated for classes and methods using |classReportLevel| and |methodReportLevel| instead. * |ImmutableField| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#immutablefield>: The property |ignoredAnnotations| has been removed. The property was deprecated since PMD 6.52.0. * |LawOfDemeter| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#lawofdemeter>: The rule has a new property |trustRadius|. This defines the maximum degree of trusted data. The default of 1 is the most restrictive. * |NPathComplexity| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#npathcomplexity>: The property |minimum| has been removed. It was deprecated since PMD 6.0.0. Use the property |reportLevel| instead. * |SingularField| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#singularfield>: The properties |checkInnerClasses| and |disallowNotAssignment| have been removed. The rule is now more precise and will check these cases properly. * |UseUtilityClass| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_design.html#useutilityclass>: The property |ignoredAnnotations| has been removed. *Java Documentation* * |CommentContent| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_documentation.html#commentcontent>: The properties |caseSensitive| and |disallowedTerms| are removed. The new property |forbiddenRegex| can be used now to define the disallowed terms with a single regular expression. * |CommentRequired| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_documentation.html#commentrequired>: o Overridden methods are now detected even without the |@Override| annotation. This is relevant for the property |methodWithOverrideCommentRequirement|. See also pull request #3757 <https://github.com/pmd/pmd/pull/3757>. o Elements in annotation types are now detected as well. This might lead to an increased number of violations for missing public method comments. * |CommentSize| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_documentation.html#commentsize>: When determining the line-length of a comment, the leading comment prefix markers (e.g. |*| or |//|) are ignored and don't add up to the line-length. See also pull request #4369 <https://github.com/pmd/pmd/pull/4369>. *Java Error Prone* * |AvoidDuplicateLiterals| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_errorprone.html#avoidduplicateliterals>: The property |exceptionfile| has been removed. The property was deprecated since PMD 6.10.0. Use the property |exceptionList| instead. * |DontImportSun| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_errorprone.html#dontimportsun>: |sun.misc.Signal| is not special-cased anymore. * |EmptyCatchBlock| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_errorprone.html#emptycatchblock>: |CloneNotSupportedException| and |InterruptedException| are not special-cased anymore. Rename the exception parameter to |ignored| to ignore them. * |ImplicitSwitchFallThrough| <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_rules_java_errorprone.html#implicitswitchfallthrough>: Violations are now reported on the case statements rather than on the switch statements. This is more accurate but might result in more violations now. Removed Rules Many rules, that were previously deprecated have been finally removed. See Detailed Release Notes for PMD 7 <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes_pmd7.html> 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 detailed description of the changes listed here, see Detailed Release Notes for PMD 7 <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes_pmd7.html>. * Miscellaneous smaller changes and cleanups * XPath 3.1 support for XPath-based rules * Node stream API for AST traversal * Metrics framework * Testing framework * Language Lifecycle and Language Properties * Rule Properties * New Programmatic API for CPD π₯ Compatibility and migration notes A detailed documentation of required changes are available in the Migration Guide for PMD 7 <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_userdocs_migrating_to_pmd7.html>. See also Detailed Release Notes for PMD 7 <https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes_pmd7.html>. π Fixed Issues * miscellaneous o #881 <https://github.com/pmd/pmd/issues/881>: [all] Breaking API changes for 7.0.0 o #896 <https://github.com/pmd/pmd/issues/896>: [all] Use slf4j o #1431 <https://github.com/pmd/pmd/pull/1431>: [ui] Remove old GUI applications (designerold, bgastviewer) o #1451 <https://github.com/pmd/pmd/issues/1451>: [core] RulesetFactoryCompatibility stores the whole ruleset file in memory as a string o #2496 <https://github.com/pmd/pmd/issues/2496>: Update PMD 7 Logo on landing page o #2497 <https://github.com/pmd/pmd/issues/2497>: PMD 7 Logo page o #2498 <https://github.com/pmd/pmd/issues/2498>: Update PMD 7 Logo in documentation o #3797 <https://github.com/pmd/pmd/issues/3797>: [all] Use JUnit5 o #4462 <https://github.com/pmd/pmd/issues/4462>: Provide Software Bill of Materials (SBOM) o #4460 <https://github.com/pmd/pmd/pull/4460>: Fix assembly-plugin warnings o #4582 <https://github.com/pmd/pmd/issues/4582>: [dist] Download link broken o #4691 <https://github.com/pmd/pmd/issues/4691>: [CVEs] Critical and High CEVs reported on PMD and PMD dependencies * ant o #4080 <https://github.com/pmd/pmd/issues/4080>: [ant] Split off Ant integration into a new submodule * core o #880 <https://github.com/pmd/pmd/issues/880>: [core] Make visitors generic o #1204 <https://github.com/pmd/pmd/issues/1204>: [core] Allow numeric properties in XML to be within an unbounded range o #1622 <https://github.com/pmd/pmd/pull/1622>: [core] NodeStream API o #1687 <https://github.com/pmd/pmd/issues/1687>: [core] Deprecate and Remove XPath 1.0 support o #1785 <https://github.com/pmd/pmd/issues/1785>: [core] Allow abstract node types to be valid rulechain visits o #1825 <https://github.com/pmd/pmd/pull/1825>: [core] Support NoAttribute for XPath o #2038 <https://github.com/pmd/pmd/issues/2038>: [core] Remove DCD o #2218 <https://github.com/pmd/pmd/issues/2218>: [core] |isFindBoundary| should not be an attribute o #2234 <https://github.com/pmd/pmd/issues/2234>: [core] Consolidate PMD CLI into a single command o #2239 <https://github.com/pmd/pmd/issues/2239>: [core] Merging Javacc build scripts o #2500 <https://github.com/pmd/pmd/issues/2500>: [core] Clarify API for ANTLR based languages o #2518 <https://github.com/pmd/pmd/issues/2518>: [core] Language properties o #2602 <https://github.com/pmd/pmd/issues/2602>: [core] Remove ParserOptions o #2614 <https://github.com/pmd/pmd/pull/2614>: [core] Upgrade Saxon, add XPath 3.1, remove Jaxen o #2696 <https://github.com/pmd/pmd/pull/2696>: [core] Remove DFA o #2821 <https://github.com/pmd/pmd/issues/2821>: [core] Rule processing error filenames are missing paths o #2873 <https://github.com/pmd/pmd/issues/2873>: [core] Utility classes in pmd 7 o #2885 <https://github.com/pmd/pmd/issues/2885>: [core] Error recovery mode o #3203 <https://github.com/pmd/pmd/issues/3203>: [core] Replace RuleViolationFactory implementations with ViolationDecorator o #3692 <https://github.com/pmd/pmd/pull/3692>: [core] Analysis listeners o #3782 <https://github.com/pmd/pmd/issues/3782>: [core] Language lifecycle o #3815 <https://github.com/pmd/pmd/issues/3815>: [core] Update Saxon HE to 10.7 o #3893 <https://github.com/pmd/pmd/pull/3893>: [core] Text documents o #3902 <https://github.com/pmd/pmd/issues/3902>: [core] Violation decorators o #3918 <https://github.com/pmd/pmd/issues/3918>: [core] Make LanguageRegistry non static o #3919 <https://github.com/pmd/pmd/issues/3919>: [core] Merge CPD and PMD language o #3922 <https://github.com/pmd/pmd/pull/3922>: [core] Better error reporting for the ruleset parser o #4035 <https://github.com/pmd/pmd/issues/4035>: [core] ConcurrentModificationException in DefaultRuleViolationFactory o #4120 <https://github.com/pmd/pmd/issues/4120>: [core] Explicitly name all language versions o #4204 <https://github.com/pmd/pmd/issues/4204>: [core] Provide a CpdAnalysis class as a programmatic entry point into CPD o #4301 <https://github.com/pmd/pmd/issues/4301>: [core] Remove deprecated property concrete classes o #4302 <https://github.com/pmd/pmd/issues/4302>: [core] Migrate Property Framework API to Java 8 o #4323 <https://github.com/pmd/pmd/issues/4323>: [core] Refactor CPD integration o #4353 <https://github.com/pmd/pmd/pull/4353>: [core] Micro optimizations for Node API o #4365 <https://github.com/pmd/pmd/pull/4365>: [core] Improve benchmarking o #4397 <https://github.com/pmd/pmd/pull/4397>: [core] Refactor CPD o #4420 <https://github.com/pmd/pmd/pull/4420>: [core] Remove PMD.EOL o #4425 <https://github.com/pmd/pmd/pull/4425>: [core] Replace TextFile::pathId o #4454 <https://github.com/pmd/pmd/issues/4454>: [core] "Unknown option: '-min'" but is referenced in documentation o #4611 <https://github.com/pmd/pmd/pull/4611>: [core] Fix loading language properties from env vars o #4621 <https://github.com/pmd/pmd/issues/4621>: [core] Make |ClasspathClassLoader::getResource| child first * cli o #2234 <https://github.com/pmd/pmd/issues/2234>: [core] Consolidate PMD CLI into a single command o #3828 <https://github.com/pmd/pmd/issues/3828>: [core] Progress reporting o #4079 <https://github.com/pmd/pmd/issues/4079>: [cli] Split off CLI implementation into a pmd-cli submodule o #4423 <https://github.com/pmd/pmd/pull/4423>: [cli] Fix NPE when only |--file-list| is specified o #4482 <https://github.com/pmd/pmd/issues/4482>: [cli] pmd.bat can only be executed once o #4484 <https://github.com/pmd/pmd/issues/4484>: [cli] ast-dump with no properties produce an NPE * doc o #2501 <https://github.com/pmd/pmd/issues/2501>: [doc] Verify ANTLR Documentation o #4294 <https://github.com/pmd/pmd/issues/4294>: [doc] Migration Guide for upgrading PMD 6 β‘οΈ 7 o #4303 <https://github.com/pmd/pmd/issues/4303>: [doc] Document new property framework o #4438 <https://github.com/pmd/pmd/issues/4438>: [doc] Documentation links in VS Code are outdated o #4521 <https://github.com/pmd/pmd/issues/4521>: [doc] Website is not mobile friendly * testing o #2435 <https://github.com/pmd/pmd/issues/2435>: [test] Remove duplicated Dummy language module o #4234 <https://github.com/pmd/pmd/issues/4234>: [test] Tests that change the logging level do not work Language specific fixes: * apex o #1937 <https://github.com/pmd/pmd/issues/1937>: [apex] Apex should only have a single RootNode o #1648 <https://github.com/pmd/pmd/issues/1648>: [apex,vf] Remove CodeClimate dependency o #1750 <https://github.com/pmd/pmd/pull/1750>: [apex] Remove apex statistical rules o #2836 <https://github.com/pmd/pmd/pull/2836>: [apex] Remove Apex ProjectMirror o #3973 <https://github.com/pmd/pmd/issues/3973>: [apex] Update parser to support new 'as user' keywords (User Mode for Database Operations) o #4427 <https://github.com/pmd/pmd/issues/4427>: [apex] ApexBadCrypto test failing to detect inline code o #4453 <https://github.com/pmd/pmd/issues/4453>: [apex] [7.0-rc1] Exception while initializing Apexlink (Index 34812 out of bounds for length 34812) * apex-design o #2667 <https://github.com/pmd/pmd/issues/2667>: [apex] Integrate nawforce/ApexLink to build robust Unused rule o #4509 <https://github.com/pmd/pmd/issues/4509>: [apex] ExcessivePublicCount doesn't consider inner classes correctly o #4596 <https://github.com/pmd/pmd/issues/4596>: [apex] ExcessivePublicCount ignores properties * apex-security o #4646 <https://github.com/pmd/pmd/issues/4646>: [apex] ApexSOQLInjection does not recognise SObjectType or SObjectField as safe variable types * java o #520 <https://github.com/pmd/pmd/issues/520>: [java] Allow |@SuppressWarnings| with constants instead of literals o #864 <https://github.com/pmd/pmd/issues/864>: [java] Similar/duplicated implementations for determining FQCN o #905 <https://github.com/pmd/pmd/issues/905>: [java] Add new node for anonymous class declaration o #910 <https://github.com/pmd/pmd/issues/910>: [java] AST inconsistency between primitive and reference type arrays o #997 <https://github.com/pmd/pmd/issues/997>: [java] Java8 parsing corner case with annotated array types o #998 <https://github.com/pmd/pmd/issues/998>: [java] AST inconsistencies around FormalParameter o #1019 <https://github.com/pmd/pmd/issues/1019>: [java] Breaking Java Grammar changes for PMD 7.0.0 o #1124 <https://github.com/pmd/pmd/issues/1124>: [java] ImmutableList implementation in the qname codebase o #1128 <https://github.com/pmd/pmd/issues/1128>: [java] Improve ASTLocalVariableDeclaration o #1150 <https://github.com/pmd/pmd/issues/1150>: [java] ClassOrInterfaceType AST improvements o #1207 <https://github.com/pmd/pmd/issues/1207>: [java] Resolve explicit types using FQCNs, without hitting the classloader o #1367 <https://github.com/pmd/pmd/issues/1367>: [java] Parsing error on annotated inner class o #1661 <https://github.com/pmd/pmd/issues/1661>: [java] About operator nodes o #2366 <https://github.com/pmd/pmd/pull/2366>: [java] Remove qualified names o #2819 <https://github.com/pmd/pmd/issues/2819>: [java] GLB bugs in pmd 7 o #3642 <https://github.com/pmd/pmd/issues/3642>: [java] Parse error on rare extra dimensions on method return type on annotation methods o #3763 <https://github.com/pmd/pmd/issues/3763>: [java] Am... [truncated message content] |