pmd/pmd_release_notes.html

2835 lines
101 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="keywords" content=" changelog, release notes">
<title>PMD Release Notes | PMD Source Code Analyzer</title>
<link rel="stylesheet" type="text/css" href="assets/fontawesome-free-5.15.4-web/css/all.min.css">
<link rel="stylesheet" type="text/css" href="assets/bootstrap-4.5.2-dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/syntax.css">
<link rel="stylesheet" type="text/css" href="css/modern-business.css">
<link rel="stylesheet" type="text/css" href="css/customstyles.css">
<link rel="stylesheet" type="text/css" href="css/theme-green.css">
<link rel="stylesheet" type="text/css" href="css/pmd-customstyles.css">
<link rel="shortcut icon" href="images/logo/favicon.ico" type="image/x-icon">
<link rel="icon" href="images/logo/favicon.ico" type="image/x-icon">
<link rel="alternate" type="application/rss+xml" title="" href="feed.xml">
</head>
<body>
<!-- Content is offset by the height of the topnav bar. -->
<!-- There's already a padding-top rule in modern-business.css, but it apparently doesn't work on Firefox 60 and Chrome 67 -->
<div id="topbar-content-offset">
<!-- Navigation -->
<nav class="navbar navbar-expand-lg fixed-top navbar-dark">
<div class="container topnavlinks">
<a class="navbar-brand fas fa-home fa-lg" href="index.html">&nbsp;<span class="projectTitle"> PMD Source Code Analyzer Project</span></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto mt-2 mt-lg-0"></ul>
<ul class="navbar-nav">
<!-- toggle sidebar button -->
<li class="nav-item"><a id="tg-sb-link" class="nav-link" href="#"><i id="tg-sb-icon" class="fas fa-toggle-on"></i> Nav</a></li>
<!-- entries without drop-downs appear here -->
<li class="nav-item"><a class="nav-link" href="https://github.com/pmd/pmd/releases/latest" target="_blank">Download</a></li>
<li class="nav-item"><a class="nav-link" href="https://github.com/pmd/pmd" target="_blank">Fork us on github</a></li>
<!-- entries with drop-downs appear here -->
<!-- conditional logic to control which topnav appears for the audience defined in the configuration file.-->
</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="search..." id="search-input">
<ul id="results-container"></ul>
</form>
</div>
</div>
</nav>
<!-- Page Content -->
<div class="container-toc-wrapper">
<div class="container">
<div class="col-lg-12">&nbsp;</div>
<!-- Content Row -->
<div class="row">
<!-- Sidebar Column -->
<div class="col-md-3" id="tg-sb-sidebar">
<ul id="mysidebar" class="nav">
<li class="sidebarTitle">PMD 7.0.0-SNAPSHOT</li>
<div class="sidebarTitleDate">Release date: ??-?????-2023</div>
<li>
<a href="#">About</a>
<ul>
<li><a href="index.html">Home</a></li>
<li class="active"><a href="pmd_release_notes.html">Release notes</a></li>
<li><a href="pmd_release_notes_pmd7.html">Release notes (PMD 7)</a></li>
<li><a href="pmd_about_help.html">Getting help</a></li>
</ul>
</li>
<li>
<a href="#">User Documentation</a>
<ul>
<li><a href="pmd_userdocs_migrating_to_pmd7.html">Migration Guide for PMD 7</a></li>
<li><a href="pmd_userdocs_installation.html">Installation and basic CLI usage</a></li>
<li><a href="pmd_userdocs_making_rulesets.html">Making rulesets</a></li>
<li><a href="pmd_userdocs_configuring_rules.html">Configuring rules</a></li>
<li><a href="pmd_userdocs_best_practices.html">Best practices</a></li>
<li><a href="pmd_userdocs_suppressing_warnings.html">Suppressing warnings</a></li>
<li><a href="pmd_userdocs_incremental_analysis.html">Incremental analysis</a></li>
<li><a href="pmd_userdocs_cli_reference.html">PMD CLI reference</a></li>
<li><a href="pmd_userdocs_report_formats.html">PMD Report formats</a></li>
<li><a href="pmd_userdocs_3rdpartyrulesets.html">3rd party rulesets</a></li>
<li class="subfolders">
<a href="#">CPD reference</a>
<ul>
<li><a href="pmd_userdocs_cpd.html">Copy-paste detection</a></li>
<li><a href="pmd_userdocs_cpd_report_formats.html">CPD Report formats</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Extending PMD</a>
<ul>
<li><a href="pmd_userdocs_extending_writing_rules_intro.html">Introduction to writing rules</a></li>
<li><a href="pmd_userdocs_extending_your_first_rule.html">Your first rule</a></li>
<li><a href="pmd_userdocs_extending_writing_xpath_rules.html">XPath rules</a></li>
<li><a href="pmd_userdocs_extending_writing_java_rules.html">Java rules</a></li>
<li><a href="pmd_userdocs_extending_designer_reference.html">Rule designer reference</a></li>
<li><a href="pmd_userdocs_extending_defining_properties.html">Defining rule properties</a></li>
<li><a href="pmd_userdocs_extending_rule_guidelines.html">Rule guidelines</a></li>
<li><a href="pmd_userdocs_extending_testing.html">Testing your rules</a></li>
<li><a href="pmd_userdocs_extending_ast_dump.html">Creating (XML) dump of the AST</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Tools / Integrations</a>
<ul>
<li><a href="pmd_userdocs_tools_maven.html">Maven PMD Plugin</a></li>
<li><a href="pmd_userdocs_tools_gradle.html">Gradle</a></li>
<li><a href="pmd_userdocs_tools_ant.html">Ant</a></li>
<li><a href="pmd_userdocs_tools_java_api.html">PMD Java API</a></li>
<li><a href="pmd_userdocs_tools_bld.html">bld PMD Extension</a></li>
<li><a href="pmd_userdocs_tools_ci.html">CI integrations</a></li>
<li><a href="pmd_userdocs_tools.html">Other Tools / Integrations</a></li>
</ul>
</li>
</ul>
</li>
<li>
<a href="#">Rule Reference</a>
<ul>
<li class="subfolders">
<a href="#">Apex Rules</a>
<ul>
<li><a href="pmd_rules_apex.html">Index</a></li>
<li><a href="pmd_rules_apex_bestpractices.html">Best Practices</a></li>
<li><a href="pmd_rules_apex_codestyle.html">Code Style</a></li>
<li><a href="pmd_rules_apex_design.html">Design</a></li>
<li><a href="pmd_rules_apex_documentation.html">Documentation</a></li>
<li><a href="pmd_rules_apex_errorprone.html">Error Prone</a></li>
<li><a href="pmd_rules_apex_performance.html">Performance</a></li>
<li><a href="pmd_rules_apex_security.html">Security</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">HTML Rules</a>
<ul>
<li><a href="pmd_rules_html.html">Index</a></li>
<li><a href="pmd_rules_html_bestpractices.html">Best Practices</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Java Rules</a>
<ul>
<li><a href="pmd_rules_java.html">Index</a></li>
<li><a href="pmd_rules_java_bestpractices.html">Best Practices</a></li>
<li><a href="pmd_rules_java_codestyle.html">Code Style</a></li>
<li><a href="pmd_rules_java_design.html">Design</a></li>
<li><a href="pmd_rules_java_documentation.html">Documentation</a></li>
<li><a href="pmd_rules_java_errorprone.html">Error Prone</a></li>
<li><a href="pmd_rules_java_multithreading.html">Multithreading</a></li>
<li><a href="pmd_rules_java_performance.html">Performance</a></li>
<li><a href="pmd_rules_java_security.html">Security</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Java Server Pages Rules</a>
<ul>
<li><a href="pmd_rules_jsp.html">Index</a></li>
<li><a href="pmd_rules_jsp_bestpractices.html">Best Practices</a></li>
<li><a href="pmd_rules_jsp_codestyle.html">Code Style</a></li>
<li><a href="pmd_rules_jsp_design.html">Design</a></li>
<li><a href="pmd_rules_jsp_errorprone.html">Error Prone</a></li>
<li><a href="pmd_rules_jsp_security.html">Security</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">JavaScript Rules</a>
<ul>
<li><a href="pmd_rules_ecmascript.html">Index</a></li>
<li><a href="pmd_rules_ecmascript_bestpractices.html">Best Practices</a></li>
<li><a href="pmd_rules_ecmascript_codestyle.html">Code Style</a></li>
<li><a href="pmd_rules_ecmascript_errorprone.html">Error Prone</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Kotlin Rules</a>
<ul>
<li><a href="pmd_rules_kotlin.html">Index</a></li>
<li><a href="pmd_rules_kotlin_bestpractices.html">Best Practices</a></li>
<li><a href="pmd_rules_kotlin_errorprone.html">Error Prone</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Maven POM Rules</a>
<ul>
<li><a href="pmd_rules_pom.html">Index</a></li>
<li><a href="pmd_rules_pom_errorprone.html">Error Prone</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Modelica Rules</a>
<ul>
<li><a href="pmd_rules_modelica.html">Index</a></li>
<li><a href="pmd_rules_modelica_bestpractices.html">Best Practices</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">PLSQL Rules</a>
<ul>
<li><a href="pmd_rules_plsql.html">Index</a></li>
<li><a href="pmd_rules_plsql_bestpractices.html">Best Practices</a></li>
<li><a href="pmd_rules_plsql_codestyle.html">Code Style</a></li>
<li><a href="pmd_rules_plsql_design.html">Design</a></li>
<li><a href="pmd_rules_plsql_errorprone.html">Error Prone</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Salesforce Visualforce Rules</a>
<ul>
<li><a href="pmd_rules_visualforce.html">Index</a></li>
<li><a href="pmd_rules_visualforce_security.html">Security</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Scala Rules</a>
<ul>
<li><a href="pmd_rules_scala.html">Index</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Swift Rules</a>
<ul>
<li><a href="pmd_rules_swift.html">Index</a></li>
<li><a href="pmd_rules_swift_bestpractices.html">Best Practices</a></li>
<li><a href="pmd_rules_swift_errorprone.html">Error Prone</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Velocity Template Language (VTL) Rules</a>
<ul>
<li><a href="pmd_rules_velocity.html">Index</a></li>
<li><a href="pmd_rules_velocity_bestpractices.html">Best Practices</a></li>
<li><a href="pmd_rules_velocity_design.html">Design</a></li>
<li><a href="pmd_rules_velocity_errorprone.html">Error Prone</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">WSDL Rules</a>
<ul>
<li><a href="pmd_rules_wsdl.html">Index</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">XML Rules</a>
<ul>
<li><a href="pmd_rules_xml.html">Index</a></li>
<li><a href="pmd_rules_xml_bestpractices.html">Best Practices</a></li>
<li><a href="pmd_rules_xml_errorprone.html">Error Prone</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">XSL Rules</a>
<ul>
<li><a href="pmd_rules_xsl.html">Index</a></li>
<li><a href="pmd_rules_xsl_codestyle.html">Code Style</a></li>
<li><a href="pmd_rules_xsl_performance.html">Performance</a></li>
</ul>
</li>
</ul>
</li>
<li>
<a href="#">Language-Specific Documentation</a>
<ul>
<li><a href="pmd_languages_index.html">Overview</a></li>
<li><a href="pmd_languages_configuration.html">Language configuration</a></li>
<li><a href="pmd_languages_apex.html">Apex</a></li>
<li><a href="pmd_languages_cpp.html">C/C++</a></li>
<li><a href="pmd_languages_cs.html">C#</a></li>
<li><a href="pmd_languages_coco.html">Coco</a></li>
<li><a href="pmd_languages_dart.html">Dart</a></li>
<li><a href="pmd_languages_fortran.html">Fortran</a></li>
<li><a href="pmd_languages_gherkin.html">Gherkin</a></li>
<li><a href="pmd_languages_go.html">Go</a></li>
<li><a href="pmd_languages_html.html">HTML</a></li>
<li><a href="pmd_languages_java.html">Java</a></li>
<li><a href="pmd_languages_js_ts.html">JavaScript / TypeScript</a></li>
<li><a href="pmd_languages_jsp.html">JSP</a></li>
<li><a href="pmd_languages_julia.html">Julia</a></li>
<li><a href="pmd_languages_kotlin.html">Kotlin</a></li>
<li><a href="pmd_languages_lua.html">Lua</a></li>
<li><a href="pmd_languages_matlab.html">Matlab</a></li>
<li><a href="pmd_languages_modelica.html">Modelica</a></li>
<li><a href="pmd_languages_objectivec.html">Objective-C</a></li>
<li><a href="pmd_languages_perl.html">Perl</a></li>
<li><a href="pmd_languages_php.html">PHP</a></li>
<li><a href="pmd_languages_plsql.html">PLSQL</a></li>
<li><a href="pmd_languages_python.html">Python</a></li>
<li><a href="pmd_languages_ruby.html">Ruby</a></li>
<li><a href="pmd_languages_scala.html">Scala</a></li>
<li><a href="pmd_languages_swift.html">Swift</a></li>
<li><a href="pmd_languages_tsql.html">T-SQL</a></li>
<li><a href="pmd_languages_visualforce.html">Visualforce</a></li>
<li><a href="pmd_languages_velocity.html">Velocity Template Language (VTL)</a></li>
<li><a href="pmd_languages_xml.html">XML and XML dialects</a></li>
</ul>
</li>
<li>
<a href="#">Developer Documentation</a>
<ul>
<li><a href="pmd_devdocs_development.html">Developer resources</a></li>
<li><a href="pmd_devdocs_building.html">Building PMD from source</a></li>
<li><a href="https://github.com/pmd/pmd/blob/master/CONTRIBUTING.md" target="_blank">Contributing</a></li>
<li><a href="pmd_devdocs_writing_documentation.html">Writing documentation</a></li>
<li><a href="pmd_devdocs_roadmap.html">Roadmap</a></li>
<li><a href="pmd_devdocs_how_pmd_works.html">How PMD works</a></li>
<li><a href="pmd_devdocs_pmdtester.html">Pmdtester</a></li>
<li><a href="pmd_devdocs_rule_deprecation_policy.html">Rule Deprecation Policy</a></li>
<li class="subfolders">
<a href="#">Major contributions</a>
<ul>
<li><a href="pmd_devdocs_major_rule_guidelines.html">Rule Guidelines</a></li>
<li><a href="pmd_devdocs_major_adding_new_language_javacc.html">Adding a new language (JavaCC)</a></li>
<li><a href="pmd_devdocs_major_adding_new_language_antlr.html">Adding a new language (ANTLR)</a></li>
<li><a href="pmd_devdocs_major_adding_new_cpd_language.html">Adding a new CPD language</a></li>
</ul>
</li>
<li class="subfolders">
<a href="#">Experimental features</a>
<ul>
<li><a href="tag_experimental.html">List of experimental Features</a></li>
</ul>
</li>
</ul>
</li>
<li>
<a href="#">Project documentation</a>
<ul>
<li class="subfolders">
<a href="#">Trivia about PMD</a>
<ul>
<li><a href="pmd_projectdocs_trivia_news.html">PMD in the press</a></li>
<li><a href="pmd_projectdocs_trivia_products.html">Products & books related to PMD</a></li>
<li><a href="pmd_projectdocs_trivia_similarprojects.html">Similar projects</a></li>
<li><a href="pmd_projectdocs_trivia_meaning.html">What does 'PMD' mean?</a></li>
</ul>
</li>
<li><a href="pmd_projectdocs_logo.html">Logo</a></li>
<li><a href="pmd_projectdocs_faq.html">FAQ</a></li>
<li><a href="license.html">License</a></li>
<li><a href="pmd_projectdocs_credits.html">Credits</a></li>
<li><a href="pmd_release_notes_old.html">Old release notes</a></li>
<li><a href="pmd_projectdocs_decisions.html">Decisions</a></li>
<li class="subfolders">
<a href="#">Project management</a>
<ul>
<li><a href="pmd_projectdocs_committers_infrastructure.html">Infrastructure</a></li>
<li><a href="pmd_projectdocs_committers_releasing.html">Release process</a></li>
<li><a href="pmd_projectdocs_committers_merging_pull_requests.html">Merging pull requests</a></li>
<li><a href="pmd_projectdocs_committers_main_landing_page.html">Main Landing page</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<!-- Content Column -->
<div class="col-md-9" id="tg-sb-content">
<header>
<div class="row">
<div class="col-lg-12">
<a href="./" role="button"
><i class="fa fa-home fa-lg"></i
></a>
» PMD Release Notes
<a
target="_blank"
href="https://github.com/pmd/pmd/blob/master/docs/pages/release_notes.md"
class="float-right"
role="button"
><i class="fab fa-github fa-lg"></i> Edit on GitHub</a
>
</div>
</div>
<hr />
</header>
<div class="post-header">
<h1 class="post-title-main">PMD Release Notes</h1>
</div>
<div class="post-content" data-github-edit-url="https://github.com/pmd/pmd/blob/master/docs/pages/release_notes.md">
<details id="inline-toc-details">
<summary>Table of Contents</summary>
<div id="inline-toc"><!-- empty, move TOC here when screen size too small --></div>
</details>
<h2 id="--2023---700-snapshot">??-?????-2023 - 7.0.0-SNAPSHOT</h2>
<p>🎉 After a long time, were excited to bring you now the next major version of PMD! 🎉</p>
<p>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 <a href="pmd_release_notes_pmd7.html">Detailed Release Notes for PMD 7.0.0</a>.</p>
<p>🤝🙏 Many thanks to all users and contributors who were testing the release candidates and
provided feedback and/or PRs!</p>
<p>✨ PMD 7…</p>
<ul>
<li>…has a new logo</li>
<li>…analyzes Java 21 and Java 22 projects with even better type resolution and symbol table support</li>
<li>…analyzes Kotlin and Swift</li>
<li>…analyzes Apex with a new parser</li>
<li>…finds duplicated code in Coco, Julia, TypeScript</li>
<li>…ships 11 new rules and tons of improvements for existing rules</li>
<li>…provides a new CLI interface with progress bar</li>
<li>…supports Antlr based languages</li>
<li>…and many more enhancements</li>
</ul>
<p>💥 Note: Since PMD 7 is a major release, it is not a drop-in replacement for PMD 6.55.0.
A detailed documentation of required changes are available in the <a href="pmd_userdocs_migrating_to_pmd7.html">Migration Guide for PMD 7</a>.</p>
<h3 id="changes-since-700-rc4">Changes since 7.0.0-rc4</h3>
<p>This section lists the most important changes from the last release candidate.
The remaining section describes the complete release notes for 7.0.0.</p>
<h4 id="new-and-noteworthy">New and Noteworthy</h4>
<h5 id="maven-pmd-plugin-compatibility-with-pmd-7">Maven PMD Plugin compatibility with PMD 7</h5>
<p>In order to use PMD 7 with <a href="https://maven.apache.org/plugins/maven-pmd-plugin/">maven-pmd-plugin</a> a new
compatibility module has been created. This allows to use PMD 7 by simply adding one additional dependency:</p>
<ol>
<li>Follow the guide <a href="https://maven.apache.org/plugins/maven-pmd-plugin/examples/upgrading-PMD-at-runtime.html">Upgrading PMD at Runtime</a></li>
<li>Add additionally the following dependency:</li>
</ol>
<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;dependency&gt;</span>
<span class="nt">&lt;groupId&gt;</span>net.sourceforge.pmd<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>pmd-compat6<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;version&gt;</span>${pmdVersion}<span class="nt">&lt;/version&gt;</span>
<span class="nt">&lt;/dependency&gt;</span>
</code></pre></div></div>
<p>It is important to add this dependency as the <strong>first</strong> in the list, so that maven-pmd-plugin sees the (old)
compatible versions of some classes.</p>
<p>This module is available beginning with version 7.0.0-rc4 and will be there at least for the first
final version PMD 7 (7.0.0). Its not decided yet, whether we will keep updating it, after PMD 7 is finally
released.</p>
<p>Note: This compatibility module only works for the built-in rules, that are still available in PMD 7. E.g. you need
to review your rulesets and look out for deprecated rules and such. See the use case
<a href="pmd_userdocs_migrating_to_pmd7.html#im-using-only-built-in-rules">Im using only built-in rules</a>
in the <a href="pmd_userdocs_migrating_to_pmd7.html">Migration Guide for PMD 7</a>.</p>
<p>As PMD 7 revamped the Java module, if you have custom rules, you need to migrate these rules.
See the use case <a href="pmd_userdocs_migrating_to_pmd7.html#im-using-custom-rules">Im using custom rules</a>
in the Migration Guide.</p>
<p>Note: Once the default version of PMD is upgraded to PMD7 in maven-pmd-plugin
(see <a href="https://issues.apache.org/jira/projects/MPMD/issues/MPMD-379">MPMD-379</a>), this
compatibility module is no longer needed. The module pmd-compat6 might not be maintained then
any further, hence it is already declared as deprecated.</p>
<p>No guarantee is given, that the (deprecated) module pmd-compat6 is being maintained over the
whole lifetime of PMD 7.</p>
<h5 id="java-22-support">Java 22 Support</h5>
<p>This release of PMD brings support for Java 22. There are the following new standard language features,
that are supported now:</p>
<ul>
<li><a href="https://openjdk.org/jeps/456">JEP 456: Unnamed Variables &amp; Patterns</a></li>
</ul>
<p>PMD also supports the following preview language features:</p>
<ul>
<li><a href="https://openjdk.org/jeps/447">JEP 447: Statements before super(…) (Preview)</a></li>
<li><a href="https://openjdk.org/jeps/459">JEP 459: String Templates (Second Preview)</a></li>
<li><a href="https://openjdk.org/jeps/463">JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview)</a></li>
</ul>
<p>In order to analyze a project with PMD that uses these language features,
youll need to enable it via the environment variable <code class="language-plaintext highlighter-rouge">PMD_JAVA_OPTS</code> and select the new language
version <code class="language-plaintext highlighter-rouge">22-preview</code>:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>export PMD_JAVA_OPTS=--enable-preview
pmd check --use-version java-22-preview ...
</code></pre></div></div>
<p>Note: Support for Java 20 preview language features have been removed. The version “20-preview” is no longer available.</p>
<h5 id="swift-support">Swift Support</h5>
<ul>
<li>limited support for Swift 5.9 (Macro Expansions)</li>
</ul>
<h5 id="groovy-support-cpd">Groovy Support (CPD)</h5>
<ul>
<li>We now support parsing all Groovy features from Groovy 3 and 4.</li>
<li>We now support <a href="pmd_userdocs_cpd.html#suppression">suppression</a> through <code class="language-plaintext highlighter-rouge">CPD-ON</code>/<code class="language-plaintext highlighter-rouge">CPD-OFF</code> comment pairs.</li>
<li>See <a href="https://github.com/pmd/pmd/pull/4726">PR #4726</a> for details.</li>
</ul>
<h5 id="updated-pmd-designer">Updated PMD Designer</h5>
<p>This PMD release ships a new version of the pmd-designer. The designer artifact has been
renamed from “pmd-ui” to “pmd-designer”. While the designer still works with Java 8, the
recommended Java Runtime is Java 11 (or later) with OpenJFX 17 (or later).</p>
<p>For the detailed changes, see <a href="https://github.com/pmd/pmd-designer/releases/tag/7.0.0">PMD Designer Changelog (7.0.0)</a>.</p>
<h5 id="apex-support-replaced-jorje-with-fully-open-source-front-end">Apex Support: Replaced Jorje with fully open source front-end</h5>
<p>When PMD added Apex support with version 5.5.0, it utilized the Apex Jorje library to parse Apex source
and generate an AST. This library is however a binary-blob provided as part of the
<a href="https://github.com/forcedotcom/salesforcedx-vscode">Salesforce Extensions for VS Code</a>, and it is closed-source.</p>
<p>This causes problems, if binary blobs are not allowed by e.g. a company-wide policy. In that case, the Jorje
library prevented that PMD Apex could be used at all.</p>
<p>Also having access to the source code, enhancements and modifications are easier to do.</p>
<p>Under the hood, we use two open source libraries instead:</p>
<ul>
<li><a href="https://github.com/apex-dev-tools/apex-parser">apex-parser</a> originally by
<a href="https://github.com/nawforce">Kevin Jones</a> (@nawforce).
This project provides the grammar for a ANTLR based parser.</li>
<li><a href="https://github.com/google/summit-ast">Summit-AST</a> by <a href="https://github.com/google">Google</a> (@google)
This project translates the ANTLR parse tree into an AST, that is similar to the AST Jorje provided.
Note: This is not an official Google product.</li>
</ul>
<p>Although the parser is completely switched, there are only little known changes to the AST.
These are documented in the <a href="pmd_userdocs_migrating_to_pmd7.html#apex-ast">Migration Guide for PMD 7: Apex AST</a>.</p>
<p>With the new Apex parser, the new language constructs like
<a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_enforce_usermode.htm">User Mode Database Operations</a>
and the new <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_NullCoalescingOperator.htm">Null Coalescing Operator <code class="language-plaintext highlighter-rouge">??</code></a>
can be parsed now. PMD should be able to parse Apex code up to version 60.0 (Spring 24).</p>
<p>See <a href="https://github.com/pmd/pmd/issues/3766">#3766</a> for details.</p>
<p>Contributors: <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google),
<a href="https://github.com/eklimo">Edward Klimoshenko</a> (@eklimo)</p>
<h5 id="changed-visualforce">Changed: Visualforce</h5>
<p>There was an inconsistency between the naming of the maven module and the language id. The language id
used the abbreviation “vf”, while the maven module used the longer name “visualforce”. This has been
solved by renaming the language module to its full name “visualforce”. The java packages have
been renamed as well.</p>
<p>If you import rules, you also need to adjust the paths, e.g.</p>
<ul>
<li><code class="language-plaintext highlighter-rouge">category/vf/security.xml</code> ➡️ <code class="language-plaintext highlighter-rouge">category/visualforce/security.xml</code></li>
</ul>
<h5 id="changed-html-support">Changed: HTML support</h5>
<p>Support for HTML was introduced in PMD 6.55.0 as an experimental feature. With PMD 7.0.0 this
is now considered stable.</p>
<h5 id="changed-kotlin-support">Changed: Kotlin support</h5>
<p>Support for Kotlin was introduced with PMD 7.0.0-rc1 as an experimental feature. With PMD 7.0.0 this
is now considered stable.</p>
<h5 id="changed-velocity-template-language-vtl">Changed: Velocity Template Language (VTL)</h5>
<p>The module was named just “vm” which was not a good name. Its module name, language id and
package names have been renamed to “velocity”.</p>
<p>If you import rules, you also need to adjust the paths, e.g.</p>
<ul>
<li><code class="language-plaintext highlighter-rouge">category/vm/...</code> ➡️ <code class="language-plaintext highlighter-rouge">category/velocity/...</code></li>
</ul>
<h4 id="rule-changes">Rule Changes</h4>
<p><strong>New Rules</strong></p>
<ul>
<li><a href="pmd_rules_apex_performance.html#operationwithhighcostinloop"><code class="language-plaintext highlighter-rouge">OperationWithHighCostInLoop</code></a> finds Schema class methods called in a loop, which is a
potential performance issue.</li>
<li><a href="pmd_rules_java_codestyle.html#useexplicittypes"><code class="language-plaintext highlighter-rouge">UseExplicitTypes</code></a> reports usages of <code class="language-plaintext highlighter-rouge">var</code> keyword, which was introduced with Java 10.</li>
<li><a href="pmd_rules_xml_bestpractices.html#missingencoding"><code class="language-plaintext highlighter-rouge">MissingEncoding</code></a> finds XML files without explicit encoding.</li>
</ul>
<p><strong>Changed Rules</strong></p>
<ul>
<li><a href="pmd_rules_java_codestyle.html#emptycontrolstatement"><code class="language-plaintext highlighter-rouge">EmptyControlStatement</code></a>: The rule has a new property to allow empty blocks when
they contain a comment (<code class="language-plaintext highlighter-rouge">allowCommentedBlocks</code>).</li>
<li><a href="pmd_rules_apex_codestyle.html#methodnamingconventions"><code class="language-plaintext highlighter-rouge">MethodNamingConventions</code></a>: The deprecated rule property <code class="language-plaintext highlighter-rouge">skipTestMethodUnderscores</code> has
been removed. It was actually deprecated since PMD 6.15.0, but was not mentioned in the release notes
back then. Use the property <code class="language-plaintext highlighter-rouge">testPattern</code> instead to configure valid names for test methods.</li>
<li><a href="pmd_rules_java_documentation.html#commentrequired"><code class="language-plaintext highlighter-rouge">CommentRequired</code></a>: The deprecated property <code class="language-plaintext highlighter-rouge">headerCommentRequirement</code> has been removed.
Use the property <code class="language-plaintext highlighter-rouge">classCommentRequirement</code> instead.</li>
<li><a href="pmd_rules_java_errorprone.html#nonserializableclass"><code class="language-plaintext highlighter-rouge">NonSerializableClass</code></a>: The deprecated property <code class="language-plaintext highlighter-rouge">prefix</code> has been removed
without replacement. In a serializable class all fields have to be serializable regardless of the name.</li>
</ul>
<p><strong>Renamed Rulesets</strong></p>
<ul>
<li><code class="language-plaintext highlighter-rouge">category/vf/security.xml</code> ➡️ <code class="language-plaintext highlighter-rouge">category/visualforce/security.xml</code></li>
<li><code class="language-plaintext highlighter-rouge">category/vm/bestpractices.xml</code> ➡️ <code class="language-plaintext highlighter-rouge">category/velocity/bestpractices.xml</code></li>
<li><code class="language-plaintext highlighter-rouge">category/vm/design.xml</code> ➡️ <code class="language-plaintext highlighter-rouge">category/velocity/design.xml</code></li>
<li><code class="language-plaintext highlighter-rouge">category/vm/errorprone.xml</code> ➡️ <code class="language-plaintext highlighter-rouge">category/velocity/errorprone.xml</code></li>
</ul>
<p><strong>Removed Rules</strong></p>
<p>The following previously deprecated rules have been finally removed:</p>
<ul>
<li>Apex
<ul>
<li>performance.xml/AvoidSoqlInLoops <span style="font-size: small;">(deleted)</span> ➡️ use <a href="pmd_rules_apex_performance.html#operationwithlimitsinloop"><code class="language-plaintext highlighter-rouge">OperationWithLimitsInLoop</code></a></li>
<li>performance.xml/AvoidSoslInLoops <span style="font-size: small;">(deleted)</span> ➡️ use <a href="pmd_rules_apex_performance.html#operationwithlimitsinloop"><code class="language-plaintext highlighter-rouge">OperationWithLimitsInLoop</code></a></li>
<li>performance.xml/AvoidDmlStatementsInLoops <span style="font-size: small;">(deleted)</span> ➡️ use <a href="pmd_rules_apex_performance.html#operationwithlimitsinloop"><code class="language-plaintext highlighter-rouge">OperationWithLimitsInLoop</code></a></li>
</ul>
</li>
<li>Java
<ul>
<li>design.xml/ExcessiveClassLength <span style="font-size: small;">(deleted)</span> ➡️ use <a href="pmd_rules_java_design.html#ncsscount"><code class="language-plaintext highlighter-rouge">NcssCount</code></a></li>
<li>design.xml/ExcessiveMethodLength <span style="font-size: small;">(deleted)</span> ➡️ use <a href="pmd_rules_java_design.html#ncsscount"><code class="language-plaintext highlighter-rouge">NcssCount</code></a></li>
<li>errorprone.xml/BeanMembersShouldSerialize <span style="font-size: small;">(deleted)</span> ➡️ use <a href="pmd_rules_java_errorprone.html#nonserializableclass"><code class="language-plaintext highlighter-rouge">NonSerializableClass</code></a></li>
<li>errorprone.xml/EmptyFinallyBlock <span style="font-size: small;">(deleted)</span> ➡️ use <a href="pmd_rules_java_codestyle.html#emptycontrolstatement"><code class="language-plaintext highlighter-rouge">EmptyControlStatement</code></a></li>
<li>errorprone.xml/EmptyIfStmt <span style="font-size: small;">(deleted)</span> ➡️ use <a href="pmd_rules_java_codestyle.html#emptycontrolstatement"><code class="language-plaintext highlighter-rouge">EmptyControlStatement</code></a></li>
<li>errorprone.xml/EmptyInitializer <span style="font-size: small;">(deleted)</span> ➡️ use <a href="pmd_rules_java_codestyle.html#emptycontrolstatement"><code class="language-plaintext highlighter-rouge">EmptyControlStatement</code></a></li>
<li>errorprone.xml/EmptyStatementBlock <span style="font-size: small;">(deleted)</span> ➡️ use <a href="pmd_rules_java_codestyle.html#emptycontrolstatement"><code class="language-plaintext highlighter-rouge">EmptyControlStatement</code></a></li>
<li>errorprone.xml/EmptyStatementNotInLoop <span style="font-size: small;">(deleted)</span> ➡️ use <a href="pmd_rules_java_codestyle.html#unnecessarysemicolon"><code class="language-plaintext highlighter-rouge">UnnecessarySemicolon</code></a></li>
<li>errorprone.xml/EmptySwitchStatements <span style="font-size: small;">(deleted)</span> ➡️ use <a href="pmd_rules_java_codestyle.html#emptycontrolstatement"><code class="language-plaintext highlighter-rouge">EmptyControlStatement</code></a></li>
<li>errorprone.xml/EmptySynchronizedBlock <span style="font-size: small;">(deleted)</span> ➡️ use <a href="pmd_rules_java_codestyle.html#emptycontrolstatement"><code class="language-plaintext highlighter-rouge">EmptyControlStatement</code></a></li>
<li>errorprone.xml/EmptyTryBlock <span style="font-size: small;">(deleted)</span> ➡️ use <a href="pmd_rules_java_codestyle.html#emptycontrolstatement"><code class="language-plaintext highlighter-rouge">EmptyControlStatement</code></a></li>
<li>errorprone.xml/EmptyWhileStmt <span style="font-size: small;">(deleted)</span> ➡️ use <a href="pmd_rules_java_codestyle.html#emptycontrolstatement"><code class="language-plaintext highlighter-rouge">EmptyControlStatement</code></a></li>
</ul>
</li>
</ul>
<p><strong>Removed deprecated rulesets</strong></p>
<p>The following previously deprecated rulesets have been removed. These were the left-over rulesets from PMD 5.
The rules have been moved into categories with PMD 6.</p>
<details>
<summary>List of deprecated rulesets
</summary>
<ul>
<li>rulesets/apex/apexunit.xml</li>
<li>rulesets/apex/braces.xml</li>
<li>rulesets/apex/complexity.xml</li>
<li>rulesets/apex/empty.xml</li>
<li>rulesets/apex/metrics.xml</li>
<li>rulesets/apex/performance.xml</li>
<li>rulesets/apex/ruleset.xml</li>
<li>rulesets/apex/securty.xml</li>
<li>rulesets/apex/style.xml</li>
<li>rulesets/java/android.xml</li>
<li>rulesets/java/basic.xml</li>
<li>rulesets/java/clone.xml</li>
<li>rulesets/java/codesize.xml</li>
<li>rulesets/java/comments.xml</li>
<li>rulesets/java/controversial.xml</li>
<li>rulesets/java/coupling.xml</li>
<li>rulesets/java/design.xml</li>
<li>rulesets/java/empty.xml</li>
<li>rulesets/java/finalizers.xml</li>
<li>rulesets/java/imports.xml</li>
<li>rulesets/java/j2ee.xml</li>
<li>rulesets/java/javabeans.xml</li>
<li>rulesets/java/junit.xml</li>
<li>rulesets/java/logging-jakarta-commons.xml</li>
<li>rulesets/java/logging-java.xml</li>
<li>rulesets/java/metrics.xml</li>
<li>rulesets/java/migrating.xml</li>
<li>rulesets/java/migrating_to_13.xml</li>
<li>rulesets/java/migrating_to_14.xml</li>
<li>rulesets/java/migrating_to_15.xml</li>
<li>rulesets/java/migrating_to_junit4.xml</li>
<li>rulesets/java/naming.xml</li>
<li>rulesets/java/optimizations.xml</li>
<li>rulesets/java/strictexception.xml</li>
<li>rulesets/java/strings.xml</li>
<li>rulesets/java/sunsecure.xml</li>
<li>rulesets/java/typeresolution.xml</li>
<li>rulesets/java/unnecessary.xml</li>
<li>rulesets/java/unusedcode.xml</li>
<li>rulesets/ecmascript/basic.xml</li>
<li>rulesets/ecmascript/braces.xml</li>
<li>rulesets/ecmascript/controversial.xml</li>
<li>rulesets/ecmascript/unnecessary.xml</li>
<li>rulesets/jsp/basic.xml</li>
<li>rulesets/jsp/basic-jsf.xml</li>
<li>rulesets/plsql/codesize.xml</li>
<li>rulesets/plsql/dates.xml</li>
<li>rulesets/plsql/strictsyntax.xml</li>
<li>rulesets/plsql/TomKytesDespair.xml</li>
<li>rulesets/vf/security.xml</li>
<li>rulesets/vm/basic.xml</li>
<li>rulesets/pom/basic.xml</li>
<li>rulesets/xml/basic.xml</li>
<li>rulesets/xsl/xpath.xml</li>
<li>rulesets/releases/*</li>
</ul>
</details>
<h4 id="fixed-issues">Fixed issues</h4>
<ul>
<li>cli
<ul>
<li><a href="https://github.com/pmd/pmd/pull/4594">#4594</a>: [cli] Change completion generation to runtime</li>
<li><a href="https://github.com/pmd/pmd/pull/4685">#4685</a>: [cli] Clarify CPD documentation, fix positional parameter handling</li>
<li><a href="https://github.com/pmd/pmd/issues/4723">#4723</a>: [cli] Launch fails for “bash pmd”</li>
</ul>
</li>
<li>core
<ul>
<li><a href="https://github.com/pmd/pmd/issues/1027">#1027</a>: [core] Apply the new PropertyDescriptor&lt;Pattern&gt; type where applicable</li>
<li><a href="https://github.com/pmd/pmd/issues/3903">#3903</a>: [core] Consolidate <code class="language-plaintext highlighter-rouge">n.s.pmd.reporting</code> package</li>
<li><a href="https://github.com/pmd/pmd/issues/3905">#3905</a>: [core] Stabilize tree export API</li>
<li><a href="https://github.com/pmd/pmd/issues/3917">#3917</a>: [core] Consolidate <code class="language-plaintext highlighter-rouge">n.s.pmd.lang.rule</code> package</li>
<li><a href="https://github.com/pmd/pmd/issues/4065">#4065</a>: [core] Rename TokenMgrError to LexException, Tokenizer to CpdLexer</li>
<li><a href="https://github.com/pmd/pmd/issues/4309">#4309</a>: [core] Cleanups in XPath area</li>
<li><a href="https://github.com/pmd/pmd/issues/4312">#4312</a>: [core] Remove unnecessary property <code class="language-plaintext highlighter-rouge">color</code> and system property <code class="language-plaintext highlighter-rouge">pmd.color</code> in <code class="language-plaintext highlighter-rouge">TextColorRenderer</code></li>
<li><a href="https://github.com/pmd/pmd/issues/4313">#4313</a>: [core] Remove support for &lt;lang&gt;-&lt;ruleset&gt; hyphen notation for ruleset references</li>
<li><a href="https://github.com/pmd/pmd/issues/4314">#4314</a>: [core] Remove ruleset compatibility filter (RuleSetFactoryCompatibility) and CLI option <code class="language-plaintext highlighter-rouge">--no-ruleset-compatibility</code></li>
<li><a href="https://github.com/pmd/pmd/issues/4348">#4348</a>: [core] Consolidate @<!-- -->InternalApi classes</li>
<li><a href="https://github.com/pmd/pmd/issues/4349">#4349</a>: [core] Cleanup remaining experimental and deprecated API</li>
<li><a href="https://github.com/pmd/pmd/issues/4378">#4378</a>: [core] Ruleset loading processes commented rules</li>
<li><a href="https://github.com/pmd/pmd/issues/4674">#4674</a>: [core] WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass</li>
<li><a href="https://github.com/pmd/pmd/pull/4694">#4694</a>: [core] Fix line/col numbers in TokenMgrError</li>
<li><a href="https://github.com/pmd/pmd/issues/4717">#4717</a>: [core] XSLTRenderer doesnt close report file</li>
<li><a href="https://github.com/pmd/pmd/pull/4750">#4750</a>: [core] Fix flaky SummaryHTMLRenderer</li>
<li><a href="https://github.com/pmd/pmd/pull/4782">#4782</a>: [core] Avoid using getImage/@<!-- -->Image</li>
</ul>
</li>
<li>doc
<ul>
<li><a href="https://github.com/pmd/pmd/issues/995">#995</a>: [doc] Document API evolution principles as ADR</li>
<li><a href="https://github.com/pmd/pmd/issues/2511">#2511</a>: [doc] Review guides for writing java/xpath rules for correctness with PMD 7</li>
<li><a href="https://github.com/pmd/pmd/issues/3175">#3175</a>: [doc] Document language module features</li>
<li><a href="https://github.com/pmd/pmd/issues/4308">#4308</a>: [doc] Document XPath API @<!-- ->NoAttribute and @<!-- -->DeprecatedAttribute</li>
<li><a href="https://github.com/pmd/pmd/issues/4319">#4319</a>: [doc] Document TypeRes API and Symbols API</li>
<li><a href="https://github.com/pmd/pmd/pull/4659">#4659</a>: [doc] Improve ant documentation</li>
<li><a href="https://github.com/pmd/pmd/pull/4669">#4669</a>: [doc] Add bld PMD Extension to Tools / Integrations</li>
<li><a href="https://github.com/pmd/pmd/issues/4676">#4676</a>: [doc] Clarify how CPD <code class="language-plaintext highlighter-rouge">--ignore-literals</code> and <code class="language-plaintext highlighter-rouge">--ignore-identifiers</code> work</li>
<li><a href="https://github.com/pmd/pmd/issues/4704">#4704</a>: [doc] Multivalued properties do not accept | as a separator</li>
</ul>
</li>
<li>miscellaneous
<ul>
<li><a href="https://github.com/pmd/pmd/pull/4699">#4699</a>: Make PMD buildable with java 21</li>
<li><a href="https://github.com/pmd/pmd/pull/4586">#4586</a>: Use explicit encoding in ruleset xml files</li>
<li><a href="https://github.com/pmd/pmd/issues/4642">#4642</a>: Update regression tests with Java 21 language features</li>
<li><a href="https://github.com/pmd/pmd/issues/4736">#4736</a>: [ci] Improve build procedure</li>
<li><a href="https://github.com/pmd/pmd/pull/4741">#4741</a>: Add pmd-compat6 module for maven-pmd-plugin</li>
<li><a href="https://github.com/pmd/pmd/pull/4749">#4749</a>: Fixes NoSuchMethodError on processing errors in pmd-compat6</li>
<li><a href="https://github.com/pmd/pmd/issues/4776">#4776</a>: [ci] Upgrade to ruby 3</li>
<li><a href="https://github.com/pmd/pmd/pull/4796">#4796</a>: Remove deprecated and release rulesets</li>
<li><a href="https://github.com/pmd/pmd/pull/4823">#4823</a>: Update to use renamed pmd-designer</li>
<li><a href="https://github.com/pmd/pmd/pull/4827">#4827</a>: [compat6] Support config errors and cpd for csharp</li>
<li><a href="https://github.com/pmd/pmd/issues/4830">#4830</a>: Consolidate packages in each maven module</li>
<li><a href="https://github.com/pmd/pmd/issues/4867">#4867</a>: [dist] ./mvnw command not found in dist-src</li>
</ul>
</li>
<li>apex
<ul>
<li><a href="https://github.com/pmd/pmd/issues/3766">#3766</a>: [apex] Replace Jorje with fully open source front-end</li>
<li><a href="https://github.com/pmd/pmd/issues/4828">#4828</a>: [apex] Support null coalescing operator ?? (apex 60)</li>
<li><a href="https://github.com/pmd/pmd/issues/4845">#4845</a>: [apex] Use same ANLTR version for apex-parser</li>
</ul>
</li>
<li>apex-bestpractices
<ul>
<li><a href="https://github.com/pmd/pmd/issues/4556">#4556</a>: [apex] UnusedLocalVariable flags for variables which are using in SOQL/SOSL binds</li>
</ul>
</li>
<li>apex-documentation
<ul>
<li><a href="https://github.com/pmd/pmd/issues/4774">#4774</a>: [apex] ApexDoc false-positive for the first method of an annotated Apex class</li>
</ul>
</li>
<li>apex-performance
<ul>
<li><a href="https://github.com/pmd/pmd/issues/4675">#4675</a>: [apex] New Rule: OperationWithHighCostInLoop</li>
</ul>
</li>
<li>groovy
<ul>
<li><a href="https://github.com/pmd/pmd/pull/4726">#4726</a>: [groovy] Support Groovy to 3 and 4 and CPD suppressions</li>
</ul>
</li>
<li>java
<ul>
<li><a href="https://github.com/pmd/pmd/issues/1307">#1307</a>: [java] AccessNode API changes</li>
<li><a href="https://github.com/pmd/pmd/issues/3751">#3751</a>: [java] Rename some node types</li>
<li><a href="https://github.com/pmd/pmd/pull/4628">#4628</a>: [java] Support loading classes from java runtime images</li>
<li><a href="https://github.com/pmd/pmd/issues/4753">#4753</a>: [java] PMD crashes while using generics and wildcards</li>
<li><a href="https://github.com/pmd/pmd/issues/4757">#4757</a>: [java] Intermittent NPEs while analyzing Java code</li>
<li><a href="https://github.com/pmd/pmd/issues/4794">#4794</a>: [java] Support JDK 22</li>
</ul>
</li>
<li>java-bestpractices
<ul>
<li><a href="https://github.com/pmd/pmd/issues/4603">#4603</a>: [java] UnusedAssignment false positive in record compact constructor</li>
<li><a href="https://github.com/pmd/pmd/issues/4625">#4625</a>: [java] UnusedPrivateMethod false positive: Autoboxing into Number</li>
<li><a href="https://github.com/pmd/pmd/issues/4817">#4817</a>: [java] UnusedPrivateMethod false-positive used in lambda</li>
</ul>
</li>
<li>java-codestyle
<ul>
<li><a href="https://github.com/pmd/pmd/issues/2847">#2847</a>: [java] New Rule: Use Explicit Types</li>
<li><a href="https://github.com/pmd/pmd/issues/4239">#4239</a>: [java] UnnecessaryLocalBeforeReturn - false positive with catch clause</li>
<li><a href="https://github.com/pmd/pmd/issues/4578">#4578</a>: [java] CommentDefaultAccessModifier comment needs to be before annotation if present</li>
<li><a href="https://github.com/pmd/pmd/issues/4631">#4631</a>: [java] UnnecessaryFullyQualifiedName fails to recognize illegal self reference in enums</li>
<li><a href="https://github.com/pmd/pmd/issues/4645">#4645</a>: [java] CommentDefaultAccessModifier - False Positive with JUnit5s ParameterizedTest</li>
<li><a href="https://github.com/pmd/pmd/pull/4754">#4754</a>: [java] EmptyControlStatementRule: Add allowCommentedBlocks property</li>
<li><a href="https://github.com/pmd/pmd/issues/4816">#4816</a>: [java] UnnecessaryImport false-positive on generic method call with on lambda</li>
</ul>
</li>
<li>java-design
<ul>
<li><a href="https://github.com/pmd/pmd/issues/174">#174</a>: [java] SingularField false positive with switch in method that both assigns and reads field</li>
</ul>
</li>
<li>java-errorprone
<ul>
<li><a href="https://github.com/pmd/pmd/issues/718">#718</a>: [java] BrokenNullCheck false positive with parameter/field confusion</li>
<li><a href="https://github.com/pmd/pmd/issues/932">#932</a>: [java] SingletonClassReturningNewInstance false positive with double assignment</li>
<li><a href="https://github.com/pmd/pmd/issues/1831">#1831</a>: [java] DetachedTestCase reports abstract methods</li>
<li><a href="https://github.com/pmd/pmd/pull/4719">#4719</a>: [java] UnnecessaryCaseChange: example doc toUpperCase() should compare to a capitalized string</li>
</ul>
</li>
<li>javascript
<ul>
<li><a href="https://github.com/pmd/pmd/issues/2305">#2305</a>: [javascript] UnnecessaryBlock - false positives with destructuring assignments</li>
<li><a href="https://github.com/pmd/pmd/pull/4673">#4673</a>: [javascript] CPD: Added support for decorator notation</li>
</ul>
</li>
<li>plsql
<ul>
<li><a href="https://github.com/pmd/pmd/issues/4820">#4820</a>: [plsql] WITH clause is ignored for SELECT INTO statements</li>
</ul>
</li>
<li>swift
<ul>
<li><a href="https://github.com/pmd/pmd/issues/4697">#4697</a>: [swift] Support Swift 5.9 features (mainly macros expansion expressions)</li>
</ul>
</li>
<li>xml-bestpractices
<ul>
<li><a href="https://github.com/pmd/pmd/pull/4592">#4592</a>: [xml] Add MissingEncoding rule</li>
</ul>
</li>
</ul>
<h4 id="api-changes">API Changes</h4>
<p>See <a href="pmd_release_notes_pmd7.html#700">Detailed Release Notes for PMD 7</a>.</p>
<h4 id="external-contributions">External Contributions</h4>
<ul>
<li><a href="https://github.com/pmd/pmd/pull/4093">#4093</a>: [apex] Summit-AST Apex module - Part 1 - <a href="https://github.com/eklimo">Edward Klimoshenko</a> (@eklimo)</li>
<li><a href="https://github.com/pmd/pmd/pull/4151">#4151</a>: [apex] Summit-AST Apex module - Part 2 - expression nodes - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
<li><a href="https://github.com/pmd/pmd/pull/4171">#4171</a>: [apex] Summit-AST Apex module - Part 3 - initializers - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
<li><a href="https://github.com/pmd/pmd/pull/4206">#4206</a>: [apex] Summit-AST Apex module - Part 4 - statements - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
<li><a href="https://github.com/pmd/pmd/pull/4219">#4219</a>: [apex] Summit-AST Apex module - Part 5 - annotations, triggers, misc. - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
<li><a href="https://github.com/pmd/pmd/pull/4242">#4242</a>: [apex] Merge 6.52 into experimental-apex-parser - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
<li><a href="https://github.com/pmd/pmd/pull/4251">#4251</a>: [apex] Summit-AST Apex module - Part 6 Passing testsuite - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
<li><a href="https://github.com/pmd/pmd/pull/4448">#4448</a>: [apex] Bump summit-ast to new release 2.1.0 (and remove workaround) - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
<li><a href="https://github.com/pmd/pmd/pull/4479">#4479</a>: [apex] Merge main (7.x) branch into experimental-apex-parser and fix tests - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
<li><a href="https://github.com/pmd/pmd/pull/4562">#4562</a>: [apex] Fixes #4556 - Update Apex bind regex match for all possible combinations - <a href="https://github.com/nwcm">nwcm</a> (@nwcm)</li>
<li><a href="https://github.com/pmd/pmd/pull/4640">#4640</a>: [cli] Launch script fails if run via “bash pmd” - <a href="https://github.com/shai-bennathan">Shai Bennathan</a> (@shai-bennathan)</li>
<li><a href="https://github.com/pmd/pmd/pull/4673">#4673</a>: [javascript] CPD: Added support for decorator notation - <a href="https://github.com/wener-tiobe">Wener</a> (@wener-tiobe)</li>
<li><a href="https://github.com/pmd/pmd/pull/4677">#4677</a>: [apex] Add new rule: OperationWithHighCostInLoop - <a href="https://github.com/tprouvot">Thomas Prouvot</a> (@tprouvot)</li>
<li><a href="https://github.com/pmd/pmd/pull/4698">#4698</a>: [swift] Add macro expansion support for swift 5.9 - <a href="https://github.com/kenji21">Richard B.</a> (@kenji21)</li>
<li><a href="https://github.com/pmd/pmd/pull/4706">#4706</a>: [java] DetachedTestCase should not report on abstract methods - <a href="https://github.com/Debamoy">Debamoy Datta</a> (@Debamoy)</li>
<li><a href="https://github.com/pmd/pmd/pull/4719">#4719</a>: [java] UnnecessaryCaseChange: example doc toUpperCase() should compare to a capitalized string - <a href="https://github.com/ciufudean">ciufudean</a> (@ciufudean)</li>
<li><a href="https://github.com/pmd/pmd/pull/4738">#4738</a>: [doc] Added reference to the PMD extension for bld - <a href="https://github.com/ethauvin">Erik C. Thauvin</a> (@ethauvin)</li>
<li><a href="https://github.com/pmd/pmd/pull/4749">#4749</a>: Fixes NoSuchMethodError on processing errors in pmd-compat6 - <a href="https://github.com/bergander">Andreas Bergander</a> (@bergander)</li>
<li><a href="https://github.com/pmd/pmd/pull/4750">#4750</a>: [core] Fix flaky SummaryHTMLRenderer - <a href="https://github.com/219sansim">219sansim</a> (@219sansim)</li>
<li><a href="https://github.com/pmd/pmd/pull/4752">#4752</a>: [core] Fix flaky LatticeRelationTest - <a href="https://github.com/219sansim">219sansim</a> (@219sansim)</li>
<li><a href="https://github.com/pmd/pmd/pull/4754">#4754</a>: [java] EmptyControlStatementRule: Add allowCommentedBlocks property - <a href="https://github.com/bergander">Andreas Bergander</a> (@bergander)</li>
<li><a href="https://github.com/pmd/pmd/pull/4759">#4759</a>: [java] fix: remove delimiter attribute from ruleset category/java/errorprone.xml - <a href="https://github.com/marcindabrowski">Marcin Dąbrowski</a> (@marcindabrowski)</li>
<li><a href="https://github.com/pmd/pmd/pull/4825">#4825</a>: [plsql] Fix ignored WITH clause for SELECT INTO statements - <a href="https://github.com/lbovet">Laurent Bovet</a> (@lbovet)</li>
<li><a href="https://github.com/pmd/pmd/pull/4857">#4857</a>: [javascript] Fix UnnecessaryBlock issues with empty statements - <a href="https://github.com/oleksandr-shvets">Oleksandr Shvets</a> (@oleksandr-shvets)</li>
</ul>
<h3 id="-major-features-and-enhancements">🚀 Major Features and Enhancements</h3>
<h4 id="new-official-logo">New official logo</h4>
<p>The new official logo of PMD:</p>
<p><img src="images/logo/pmd-logo-300px.png" alt="New PMD Logo" /></p>
<p>For more information, see the <a href="pmd_release_notes_pmd7.html#new-official-logo">Detailed Release Notes for PMD 7</a>.</p>
<h4 id="revamped-java-module">Revamped Java module</h4>
<ul>
<li>Java grammar substantially refactored - more correct regarding the Java Language Specification (JLS)</li>
<li>Built-in rules have been upgraded for the changed AST</li>
<li>Rewritten type resolution framework and symbol table correctly implements the JLS</li>
<li>AST exposes more semantic information (method calls, field accesses)</li>
</ul>
<p>For more information, see the <a href="pmd_release_notes_pmd7.html#revamped-java">Detailed Release Notes for PMD 7</a>.</p>
<p>Contributors: <a href="https://github.com/oowekyala">Clément Fournier</a> (@oowekyala),
<a href="https://github.com/adangel">Andreas Dangel</a> (@adangel),
<a href="https://github.com/jsotuyod">Juan Martín Sotuyo Dodero</a> (@jsotuyod)</p>
<h4 id="revamped-command-line-interface">Revamped Command Line Interface</h4>
<ul>
<li>Unified and consistent Command Line Interface for both Linux/Unix and Windows across our different utilities</li>
<li>Single script <code class="language-plaintext highlighter-rouge">pmd</code> (<code class="language-plaintext highlighter-rouge">pmd.bat</code> for Windows) to launch the different utilities:
<ul>
<li><code class="language-plaintext highlighter-rouge">pmd check</code> to run PMD rules and analyze a project</li>
<li><code class="language-plaintext highlighter-rouge">pmd cpd</code> to run CPD (copy paste detector)</li>
<li><code class="language-plaintext highlighter-rouge">pmd designer</code> to run the PMD Rule Designer</li>
</ul>
</li>
<li>Progress bar support for <code class="language-plaintext highlighter-rouge">pmd check</code></li>
<li>Shell completion</li>
</ul>
<p><img src="images/userdocs/pmd-demo.gif" alt="Demo" /></p>
<p>For more information, see the <a href="pmd_release_notes_pmd7.html#revamped-command-line-interface">Detailed Release Notes for PMD 7</a>.</p>
<p>Contributors: <a href="https://github.com/jsotuyod">Juan Martín Sotuyo Dodero</a> (@jsotuyod)</p>
<h4 id="full-antlr-support">Full Antlr support</h4>
<ul>
<li><a href="https://www.antlr.org/">Antlr</a> based grammars can now be used to build full-fledged PMD rules.</li>
<li>Previously, Antlr grammar could only be used for CPD</li>
<li>New supported languages: Swift and Kotlin</li>
</ul>
<p>For more information, see the <a href="pmd_release_notes_pmd7.html#full-antlr-support">Detailed Release Notes for PMD 7</a>.</p>
<p>Contributors: <a href="https://github.com/lsoncini">Lucas Soncini</a> (@lsoncini),
<a href="https://github.com/matifraga">Matías Fraga</a> (@matifraga),
<a href="https://github.com/tomidelucca">Tomás De Lucca</a> (@tomidelucca)</p>
<h4 id="updated-pmd-designer-1">Updated PMD Designer</h4>
<p>This PMD release ships a new version of the pmd-designer. The designer artifact has been
renamed from “pmd-ui” to “pmd-designer”. While the designer still works with Java 8, the
recommended Java Runtime is Java 11 (or later) with OpenJFX 17 (or later).</p>
<p>For the detailed changes, see</p>
<ul>
<li><a href="https://github.com/pmd/pmd-designer/releases/tag/7.0.0">PMD Designer Changelog (7.0.0)</a>.</li>
<li><a href="https://github.com/pmd/pmd-designer/releases/tag/7.0.0-rc4">PMD Designer Changelog (7.0.0-rc4)</a>.</li>
<li><a href="https://github.com/pmd/pmd-designer/releases/tag/7.0.0-rc1">PMD Designer Changelog (7.0.0-rc1)</a>.</li>
</ul>
<h4 id="new-cpd-report-format-cpdhtml-v2xslt">New CPD report format cpdhtml-v2.xslt</h4>
<p>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 CPDs XML format into HTML.</p>
<p>See <a href="report-examples/cpdhtml-v2.html">the example report</a>.</p>
<p>Contributors: <a href="https://github.com/mohan-chinnappan-n">Mohan Chinnappan</a> (@mohan-chinnappan-n)</p>
<h3 id="-language-related-changes">🎉 Language Related Changes</h3>
<p>Note that this is just a concise listing of the highlights.
For more information on the languages, see the <a href="pmd_release_notes_pmd7.html#-language-related-changes">Detailed Release Notes for PMD 7</a>.</p>
<h4 id="new-cpd-support-for-apache-velocity-template-language-vtl">New: CPD support for Apache Velocity Template Language (VTL)</h4>
<p>PMD supported Apache Velocity for a very long time, but the CPD integration never got finished.
This is now done and CPD supports Apache Velocity Template language for detecting copy and paste.
It is shipped in the module <code class="language-plaintext highlighter-rouge">pmd-velocity</code>.</p>
<h4 id="new-cpd-support-for-coco">New: CPD support for Coco</h4>
<p>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 <code class="language-plaintext highlighter-rouge">pmd-coco</code>.</p>
<p>Contributors: <a href="https://github.com/wener-tiobe">Wener</a> (@wener-tiobe)</p>
<h4 id="new-cpd-support-for-julia">New: CPD support for Julia</h4>
<p>Thanks to a contribution, CPD now supports the Julia language. It is shipped
in the new module <code class="language-plaintext highlighter-rouge">pmd-julia</code>.</p>
<p>Contributors: <a href="https://github.com/wener-tiobe">Wener</a> (@wener-tiobe)</p>
<h4 id="new-cpd-support-for-typescript">New: CPD support for TypeScript</h4>
<p>Thanks to a contribution, CPD now supports the TypeScript language. It is shipped
with the rest of the JavaScript support in the module <code class="language-plaintext highlighter-rouge">pmd-javascript</code>.</p>
<p>Contributors: <a href="https://github.com/pguyot">Paul Guyot</a> (@pguyot)</p>
<h4 id="new-java-21-and-22-support">New: Java 21 and 22 Support</h4>
<p>This release of PMD brings support for Java 21 and 22. There are the following new standard language features,
that are supported now:</p>
<ul>
<li><a href="https://openjdk.org/jeps/456">JEP 456: Unnamed Variables &amp; Patterns</a> (Java 22)</li>
<li><a href="https://openjdk.org/jeps/440">JEP 440: Record Patterns</a> (Java 21)</li>
<li><a href="https://openjdk.org/jeps/441">JEP 441: Pattern Matching for switch</a> (Java 21)</li>
</ul>
<p>PMD also supports the following preview language features:</p>
<ul>
<li><a href="https://openjdk.org/jeps/447">JEP 447: Statements before super(…) (Preview)</a> (Java 22)</li>
<li><a href="https://openjdk.org/jeps/459">JEP 459: String Templates (Second Preview)</a> (Java 21 and 22)</li>
<li><a href="https://openjdk.org/jeps/463">JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview)</a> (Java 21 and 22)</li>
</ul>
<p>In order to analyze a project with PMD that uses these preview language features,
youll need to enable it via the environment variable <code class="language-plaintext highlighter-rouge">PMD_JAVA_OPTS</code> and select the new language
version <code class="language-plaintext highlighter-rouge">22-preview</code>:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>export PMD_JAVA_OPTS=--enable-preview
pmd check --use-version java-22-preview ...
</code></pre></div></div>
<p>Note: Support for Java 19 and Java 20 preview language features have been removed. The versions “19-preview” and
“20-preview” are no longer available.</p>
<h4 id="new-kotlin-support">New: Kotlin support</h4>
<ul>
<li>Use PMD to analyze Kotlin code with PMD rules.</li>
<li>Support for Kotlin 1.8 grammar</li>
<li>Initially 2 built-in rules</li>
<li>Support for Kotlin was introduced with PMD 7.0.0-rc1 as an experimental feature. With PMD 7.0.0 this
is now considered stable.</li>
</ul>
<p>Contributors: <a href="https://github.com/jborgers">Jeroen Borgers</a> (@jborgers),
<a href="https://github.com/stokpop">Peter Paul Bakker</a> (@stokpop)</p>
<h4 id="new-swift-support">New: Swift support</h4>
<ul>
<li>Use PMD to analyze Swift code with PMD rules.</li>
<li>Limited support for Swift 5.9 (Macro Expansions)</li>
<li>Initially 4 built-in rules</li>
</ul>
<p>Contributors: <a href="https://github.com/lsoncini">Lucas Soncini</a> (@lsoncini),
<a href="https://github.com/matifraga">Matías Fraga</a> (@matifraga),
<a href="https://github.com/tomidelucca">Tomás De Lucca</a> (@tomidelucca)</p>
<h4 id="changed-apex-support-replaced-jorje-with-fully-open-source-front-end">Changed: Apex Support: Replaced Jorje with fully open source front-end</h4>
<p>When PMD added Apex support with version 5.5.0, it utilized the Apex Jorje library to parse Apex source
and generate an AST. This library is however a binary-blob provided as part of the
<a href="https://github.com/forcedotcom/salesforcedx-vscode">Salesforce Extensions for VS Code</a>, and it is closed-source.</p>
<p>This causes problems, if binary blobs are not allowed by e.g. a company-wide policy. In that case, the Jorje
library prevented that PMD Apex could be used at all.</p>
<p>Also having access to the source code, enhancements and modifications are easier to do.</p>
<p>Under the hood, we use two open source libraries instead:</p>
<ul>
<li><a href="https://github.com/nawforce/apex-parser">apex-parser</a> by <a href="https://github.com/nawforce">Kevin Jones</a> (@nawforce)
This project provides the grammar for a ANTLR based parser.</li>
<li><a href="https://github.com/google/summit-ast">Summit-AST</a> by <a href="https://github.com/google">Google</a> (@google)
This project translates the ANTLR parse tree into an AST, that is similar to the AST Jorje provided.
Note: This is not an official Google product.</li>
</ul>
<p>Although the parsers is completely switched, there are only little known changes to the AST.
These are documented in the <a href="pmd_userdocs_migrating_to_pmd7.html#apex-ast">Migration Guide for PMD 7: Apex AST</a>.
With the new Apex parser, the new language constructs like
<a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_enforce_usermode.htm">User Mode Database Operations</a>
and the new <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_NullCoalescingOperator.htm">Null Coalescing Operator <code class="language-plaintext highlighter-rouge">??</code></a>
can be parsed now. PMD should be able to parse Apex code up to version 60.0 (Spring 24).</p>
<p>See <a href="https://github.com/pmd/pmd/issues/3766">#3766</a> for details.</p>
<p>Contributors: <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google),
<a href="https://github.com/eklimo">Edward Klimoshenko</a> (@eklimo)</p>
<h4 id="changed-cpp-can-now-ignore-identifiers-in-sequences-cpd">Changed: CPP can now ignore identifiers in sequences (CPD)</h4>
<ul>
<li>New command line option for CPD: <code class="language-plaintext highlighter-rouge">--ignore-sequences</code>.</li>
<li>This option is used for CPP only: with the already existing option <code class="language-plaintext highlighter-rouge">--ignore-literal-sequences</code>, only
literals were ignored. The new option additionally ignores identifiers as well in sequences.</li>
<li>See <a href="https://github.com/pmd/pmd/pull/4470">PR #4470</a> for details.</li>
</ul>
<p>Contributors: <a href="https://github.com/wener-tiobe">Wener</a> (@wener-tiobe)</p>
<h4 id="changed-groovy-support-cpd">Changed: Groovy Support (CPD)</h4>
<ul>
<li>We now support parsing all Groovy features from Groovy 3 and 4.</li>
<li>We now support <a href="pmd_userdocs_cpd.html#suppression">suppression</a> through <code class="language-plaintext highlighter-rouge">CPD-ON</code>/<code class="language-plaintext highlighter-rouge">CPD-OFF</code> comment pairs.</li>
<li>See <a href="https://github.com/pmd/pmd/pull/4726">PR #4726</a> for details.</li>
</ul>
<p>Contributors: <a href="https://github.com/jsotuyod">Juan Martín Sotuyo Dodero</a> (@jsotuyod)</p>
<h4 id="changed-html-support-1">Changed: HTML support</h4>
<p>Support for HTML was introduced in PMD 6.55.0 as an experimental feature. With PMD 7.0.0 this
is now considered stable.</p>
<h4 id="changed-javascript-support">Changed: JavaScript support</h4>
<ul>
<li>Latest version supports ES6 and also some new constructs (see <a href="https://github.com/mozilla/rhino">Rhino</a>)</li>
<li>Comments are retained</li>
</ul>
<h4 id="changed-language-versions">Changed: Language versions</h4>
<ul>
<li>More predefined language versions for each supported language</li>
<li>Can be used to limit rule execution for specific versions only with <code class="language-plaintext highlighter-rouge">minimumLanguageVersion</code> and
<code class="language-plaintext highlighter-rouge">maximumLanguageVersion</code> attributes.</li>
</ul>
<h4 id="changed-rule-properties">Changed: Rule properties</h4>
<ul>
<li>The old deprecated classes like <code class="language-plaintext highlighter-rouge">IntProperty</code> and <code class="language-plaintext highlighter-rouge">StringProperty</code> have been removed. Please use
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyFactory.html#"><code>PropertyFactory</code></a> to create properties.</li>
<li>All properties which accept multiple values now use a comma (<code class="language-plaintext highlighter-rouge">,</code>) as a delimiter. The previous default was a
pipe character (<code class="language-plaintext highlighter-rouge">|</code>). The delimiter is not configurable anymore. If needed, the comma can be escaped
with a backslash.</li>
<li>The <code class="language-plaintext highlighter-rouge">min</code> and <code class="language-plaintext highlighter-rouge">max</code> attributes in property definitions in the XML are now optional and can appear separately
or be omitted.</li>
</ul>
<h4 id="changed-velocity-template-language-vtl-1">Changed: Velocity Template Language (VTL)</h4>
<p>The module was named just “vm” which was not a good name. Its module name, language id and
package names have been renamed to “velocity”.</p>
<p>If you import rules, you also need to adjust the paths, e.g.</p>
<ul>
<li><code class="language-plaintext highlighter-rouge">category/vm/...</code> ➡️ <code class="language-plaintext highlighter-rouge">category/velocity/...</code></li>
</ul>
<h4 id="changed-visualforce-1">Changed: Visualforce</h4>
<p>There was an inconsistency between the naming of the maven module and the language id. The language id
used the abbreviation “vf”, while the maven module used the longer name “visualforce”. This has been
solved by renaming the language module to its full name “visualforce”. The java packages have
been renamed as well.</p>
<p>If you import rules, you also need to adjust the paths, e.g.</p>
<ul>
<li><code class="language-plaintext highlighter-rouge">category/vf/security.xml</code> ➡️ <code class="language-plaintext highlighter-rouge">category/visualforce/security.xml</code></li>
</ul>
<h3 id="-new-and-changed-rules">🌟 New and changed rules</h3>
<h4 id="new-rules">New Rules</h4>
<p><strong>Apex</strong></p>
<ul>
<li><a href="pmd_rules_apex_performance.html#operationwithhighcostinloop"><code class="language-plaintext highlighter-rouge">OperationWithHighCostInLoop</code></a> finds Schema class methods called in a loop, which is a
potential performance issue.</li>
<li><a href="pmd_rules_apex_design.html#unusedmethod"><code class="language-plaintext highlighter-rouge">UnusedMethod</code></a> finds unused methods in your code.</li>
</ul>
<p><strong>Java</strong></p>
<ul>
<li><a href="pmd_rules_java_codestyle.html#unnecessaryboxing"><code class="language-plaintext highlighter-rouge">UnnecessaryBoxing</code></a> reports boxing and unboxing conversions that may be made implicit.</li>
<li><a href="pmd_rules_java_codestyle.html#useexplicittypes"><code class="language-plaintext highlighter-rouge">UseExplicitTypes</code></a> reports usages of <code class="language-plaintext highlighter-rouge">var</code> keyword, which was introduced with Java 10.</li>
</ul>
<p><strong>Kotlin</strong></p>
<ul>
<li><a href="pmd_rules_kotlin_bestpractices.html#functionnametooshort"><code class="language-plaintext highlighter-rouge">FunctionNameTooShort</code></a> finds functions with a too short name.</li>
<li><a href="pmd_rules_kotlin_errorprone.html#overridebothequalsandhashcode"><code class="language-plaintext highlighter-rouge">OverrideBothEqualsAndHashcode</code></a> finds classes with only
either <code class="language-plaintext highlighter-rouge">equals</code> or <code class="language-plaintext highlighter-rouge">hashCode</code> overridden, but not both. This leads to unexpected behavior once instances
of such classes are used in collections (Lists, HashMaps, …).</li>
</ul>
<p><strong>Swift</strong></p>
<ul>
<li><a href="pmd_rules_swift_errorprone.html#forcecast"><code class="language-plaintext highlighter-rouge">ForceCast</code></a> flags all force casts, making sure you are
defensively considering all types. Having the application crash shouldnt be an option.</li>
<li><a href="pmd_rules_swift_errorprone.html#forcetry"><code class="language-plaintext highlighter-rouge">ForceTry</code></a> flags all force tries, making sure you are
defensively handling exceptions. Having the application crash shouldnt be an option.</li>
<li><a href="pmd_rules_swift_bestpractices.html#prohibitedinterfacebuilder"><code class="language-plaintext highlighter-rouge">ProhibitedInterfaceBuilder</code></a> flags any usage of interface
builder. Interface builder files are prone to merge conflicts, and are impossible to code review, so larger
teams usually try to avoid it or reduce its usage.</li>
<li><a href="pmd_rules_swift_bestpractices.html#unavailablefunction"><code class="language-plaintext highlighter-rouge">UnavailableFunction</code></a> flags any function throwing
a <code class="language-plaintext highlighter-rouge">fatalError</code> not marked as <code class="language-plaintext highlighter-rouge">@available(*, unavailable)</code> to ensure no calls are actually performed in
the codebase.</li>
</ul>
<p><strong>XML</strong></p>
<ul>
<li><a href="pmd_rules_xml_bestpractices.html#missingencoding"><code class="language-plaintext highlighter-rouge">MissingEncoding</code></a> finds XML files without explicit encoding.</li>
</ul>
<h4 id="other-changes">Other changes</h4>
<p>The information about changed rules, removed rules and rulesets
can be found in the <a href="pmd_release_notes_pmd7.html#-new-and-changed-rules">Detailed Release Notes for PMD 7</a>.</p>
<h3 id="-api">🚨 API</h3>
<p>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.</p>
<p>Also, there are some improvement and changes in different areas. For the detailed description
of the changes listed here, see <a href="pmd_release_notes_pmd7.html#-api">Detailed Release Notes for PMD 7</a>.</p>
<ul>
<li>Miscellaneous smaller changes and cleanups</li>
<li>XPath 3.1 support for XPath-based rules</li>
<li>Node stream API for AST traversal</li>
<li>Metrics framework</li>
<li>Testing framework</li>
<li>Language Lifecycle and Language Properties</li>
<li>Rule Properties</li>
<li>New Programmatic API for CPD</li>
</ul>
<h3 id="-compatibility-and-migration-notes">💥 Compatibility and migration notes</h3>
<p>A detailed documentation of required changes are available in the
<a href="pmd_userdocs_migrating_to_pmd7.html">Migration Guide for PMD 7</a>.</p>
<p>See also <a href="pmd_release_notes_pmd7.html#-compatibility-and-migration-notes">Detailed Release Notes for PMD 7</a>.</p>
<h3 id="-fixed-issues">🐛 Fixed Issues</h3>
<p>More than 300 issues have been fixed in PMD 7.
See <a href="pmd_release_notes_pmd7.html#-fixed-issues">Detailed Release Notes for PMD 7</a> for the
complete list of fixed issues.</p>
<h3 id="-external-contributions">✨ External Contributions</h3>
<p>Many thanks to the following contributors:
@219sansim, @aaronhurst-google, @anastasiia-koba, @AndreyBozhko, @bergander, @ciufudean, @cyw3, @dague1,
@Debamoy, @eklimo, @ethauvin, @JerritEic, @joaodinissf, @kenji21, @krdabrowski, @lbovet, @lsoncini,
@LynnBroe, @marcindabrowski, @matifraga, @mohan-chinnappan-n, @mohui1999, @nawforce, @nirvikpatel,
@nwcm, @oleksandr-shvets, @pguyot, @PimvanderLoos, @rcorfieldffdc, @sfdcsteve, @shai-bennathan, @tomidelucca,
@tprouvot, @wener-tiobe.</p>
<p>See <a href="pmd_release_notes_pmd7.html#-external-contributions">Detailed Release Notes for PMD 7</a> for the
full list of PRs.</p>
<h3 id="-stats">📈 Stats</h3>
<ul>
<li>5662 commits</li>
<li>796 closed tickets &amp; PRs</li>
<li>Days since last release (6.55.0): 377</li>
<li>Days since last release (7.0.0-rc4): 160</li>
</ul>
<div class="tags">
</div>
</div>
<footer>
<hr />
<div>
This documentation is written in markdown. <br />
If there is something missing or can be improved, edit this page on
github and create a PR:
<a
target="_blank"
href="https://github.com/pmd/pmd/blob/master/docs/pages/release_notes.md"
role="button"
><i class="fab fa-github fa-lg"></i> Edit on GitHub</a
>
</div>
<hr />
<div class="row">
<div class="col-lg-12 footer">
&copy;2024 PMD Open Source Project. All rights
reserved. <br />
Site last generated: Mar 21, 2024 <br />
<p>
<img src="images/logo/pmd-logo-70px.png" alt="PMD
logo"/>
</p>
</div>
</div>
</footer>
</div>
<!-- /.row -->
</div>
<!-- /.container -->
</div>
<!-- Sticky TOC column -->
<div class="toc-col">
<div id="toc"></div>
</div>
<!-- /.toc-container-wrapper -->
</div>
</div>
<script type="application/javascript" src="assets/jquery-3.5.1/jquery-3.5.1.min.js"></script>
<script type="application/javascript" src="assets/anchorjs-4.2.2/anchor.min.js"></script>
<script type="application/javascript" src="assets/navgoco-0.2.1/src/jquery.navgoco.min.js"></script>
<script type="application/javascript" src="assets/bootstrap-4.5.2-dist/js/bootstrap.bundle.min.js"></script>
<script type="application/javascript" src="assets/Simple-Jekyll-Search-1.0.8/dest/jekyll-search.js"></script>
<script type="application/javascript" src="assets/jekyll-table-of-contents/toc.js"></script>
<script type="application/javascript" src="js/tabstate.js"></script>
<script type="application/javascript" src="js/customscripts.js"></script>
</body>
</html>