pmd/pmd_release_notes_pmd7.html

4432 lines
297 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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="These are the detailed release notes for PMD 7.">
<meta name="keywords" content=" changelog, release notes">
<title>Detailed Release Notes for PMD 7 | 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><a href="pmd_release_notes.html">Release notes</a></li>
<li class="active"><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>
</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_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_vf.html">Index</a></li>
<li><a href="pmd_rules_vf_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="#">VM Rules</a>
<ul>
<li><a href="pmd_rules_vm.html">Index</a></li>
<li><a href="pmd_rules_vm_bestpractices.html">Best Practices</a></li>
<li><a href="pmd_rules_vm_design.html">Design</a></li>
<li><a href="pmd_rules_vm_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_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_configuration.html">Language configuration</a></li>
<li><a href="pmd_languages_apex.html">Apex</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_kotlin.html">Kotlin</a></li>
<li><a href="pmd_languages_plsql.html">PLSQL</a></li>
<li><a href="pmd_languages_visualforce.html">Visualforce</a></li>
<li><a href="pmd_languages_xml.html">XML and XML dialects</a></li>
<li><a href="pmd_languages_html.html">HTML</a></li>
<li><a href="pmd_languages_gherkin.html">Gherkin</a></li>
<li><a href="pmd_languages_julia.html">Julia</a></li>
<li><a href="pmd_languages_coco.html">Coco</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="pmd_devdocs_experimental_ast_dump.html">Creating (XML) dump of the AST</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>
» Detailed Release Notes for PMD 7
<a
target="_blank"
href="https://github.com/pmd/pmd/blob/master/docs/pages/release_notes_pmd7.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">Detailed Release Notes for PMD 7</h1>
</div>
<div class="post-content" data-github-edit-url="https://github.com/pmd/pmd/blob/master/docs/pages/release_notes_pmd7.md">
<div class="summary">These are the detailed release notes for PMD 7.</div>
<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="-major-features-and-enhancements">🚀 Major Features and Enhancements</h2>
<h3 id="new-official-logo">New official logo</h3>
<p>Many of you probably have already seen the new logo, but now its time to actually ship it. The new logo
was long ago decided (see <a href="https://github.com/pmd/pmd/issues/1663">#1663</a>).</p>
<p>We decided its time to have a modernized logo and get rid of the gun. This allows to include
the logo anywhere without offense.</p>
<p>The official logo is also without a tagline (such as “Code Quality Matters!”) as the tagline created some
controversies. Without a tagline, we are not limited in the direction of future development of PMD.</p>
<p><img src="images/logo/pmd-logo-300px.png" alt="New PMD Logo" /></p>
<p>The new logo is available from the <a href="pmd_projectdocs_logo.html">Logo Project Page</a>.</p>
<h3 id="revamped-java">Revamped Java</h3>
<p>The Java grammar has been refactored substantially in order to make it easier to maintain and more correct
regarding the Java Language Specification. It supports now also the edge-cases where PMD 6 was failing
(e.g. annotations were not supported everywhere). Changing the grammar entails a changed AST and therefore changed
rules. The PMD built-in rules have all been upgraded and many bugs have been fixed on the way.
Unfortunately, if you are using custom rules, you will most probably need to accommodate these changes yourself.</p>
<p>The type resolution framework has been rewritten from scratch and should now cover the entire Java spec correctly.
The same is true for the symbol table.
PMD 6 on the other hand has always had problems with advanced type inference, e.g. with lambdas and call chains.
Since it was built on the core reflection API, it also was prone to linkage errors and classloader leaks for instance.
PMD 7 does not need to load classes, and does not have these problems.</p>
<p>The AST exposes much more semantic information now. For instance, you can jump from a method call to
the declaration of the method being called, or from a field access to the field declaration. These
improvements allow interesting rules to be written that need precise knowledge of the types
in the program, for instance to detect <a href="pmd_rules_java_codestyle.html#unnecessaryboxing"><code class="language-plaintext highlighter-rouge">UnnecessaryBoxing</code></a>
or <a href="pmd_rules_java_codestyle.html#usediamondoperator"><code class="language-plaintext highlighter-rouge">UseDiamondOperator</code></a>.
These are just a small preview of the new rules we will be adding in the PMD 7 release cycle.</p>
<p>Overall, the changes to the parser, AST, type resolution and symbol table code has made PMD for
Java <strong>significantly faster</strong>. On average, we have seen ~2-3X faster analysis, but as usual, this may change
depending on your workload, configuration and ruleset.</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>
<div class="alert alert-info" role="alert"><i class="fas fa-info-circle"></i> <b>Note:</b>
The full detailed documentation of the changes are available in the
<a href="pmd_userdocs_migrating_to_pmd7.html#java-ast">Migration Guide for PMD 7</a>
</div>
<h3 id="revamped-command-line-interface">Revamped Command Line Interface</h3>
<p>PMD now ships with a unified Command Line Interface for both Linux/Unix and Windows. Instead of having a collection
of scripts for the different utilities shipped with PMD, a single script <code class="language-plaintext highlighter-rouge">pmd</code> (<code class="language-plaintext highlighter-rouge">pmd.bat</code> for Windows) can now
launch all utilities using subcommands, e.g. <code class="language-plaintext highlighter-rouge">pmd check</code>, <code class="language-plaintext highlighter-rouge">pmd designer</code>. All commands and options are thoroughly
documented in the help, with full color support where available. Moreover, efforts were made to provide consistency
in the usage of all PMD utilities.</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>Usage: pmd <span class="o">[</span><span class="nt">-hV</span><span class="o">]</span> <span class="o">[</span>COMMAND]
<span class="nt">-h</span>, <span class="nt">--help</span> Show this <span class="nb">help </span>message and exit.
<span class="nt">-V</span>, <span class="nt">--version</span> Print version information and exit.
Commands:
check The PMD standard <span class="nb">source </span>code analyzer
cpd Copy/Paste Detector - find duplicate code
designer The PMD visual rule designer
cpd-gui GUI <span class="k">for </span>the Copy/Paste Detector
Warning: May not support the full CPD feature <span class="nb">set
</span>ast-dump Experimental: dumps the AST of parsing <span class="nb">source </span>code
Exit Codes:
0 Successful analysis, no violations found
1 An unexpected error occurred during execution
2 Usage error, please refer to the <span class="nb">command help
</span>4 Successful analysis, at least 1 violation found
</code></pre></div></div>
<p>For instance, where you previously would have run</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>run.sh pmd <span class="nt">-d</span> src <span class="nt">-R</span> ruleset.xml
</code></pre></div></div>
<p>you should now use</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pmd check <span class="nt">-d</span> src <span class="nt">-R</span> ruleset.xml
</code></pre></div></div>
<p>or even better, omit using <code class="language-plaintext highlighter-rouge">-d</code> / <code class="language-plaintext highlighter-rouge">--dir</code> and simply pass the sources at the end of the parameter list</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pmd check <span class="nt">-R</span> ruleset.xml src
</code></pre></div></div>
<p>Multiple source directories can be passed, such as:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pmd check <span class="nt">-R</span> ruleset.xml src/main/java src/test/java
</code></pre></div></div>
<p>And the exact same applies to CPD:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pmd cpd <span class="nt">--minimum-tokens</span> 100 src/main/java
</code></pre></div></div>
<p>Additionally, the CLI for the <code class="language-plaintext highlighter-rouge">check</code> command has been enhanced with a progress bar, which interactively displays the
current progress of the analysis.</p>
<p><img src="images/userdocs/pmd-demo.gif" alt="Demo" /></p>
<p>This can be disabled with the <code class="language-plaintext highlighter-rouge">--no-progress</code> flag.</p>
<p>Finally, we now provide a completion script for Bash/Zsh to further help daily usage.
This script can be found under <code class="language-plaintext highlighter-rouge">shell/pmd-completion.sh</code> in the binary distribution.
To use it, edit your <code class="language-plaintext highlighter-rouge">~/.bashrc</code> / <code class="language-plaintext highlighter-rouge">~/.zshrc</code> file and add the following line:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>source *path_to_pmd*/shell/pmd-completion.sh
</code></pre></div></div>
<p>Contributors: <a href="https://github.com/jsotuyod">Juan Martín Sotuyo Dodero</a> (@jsotuyod)</p>
<h3 id="full-antlr-support">Full Antlr support</h3>
<p>PMD 6 only supported JavaCC based grammars, but with <a href="https://www.antlr.org/">Antlr</a> parsers
can be generated as well. Languages backed by an Antlr grammar are now fully supported. This means, its now
possible not only to use Antlr grammars for CPD, but we can actually build full-fledged PMD rules for them as well.
Both the traditional Java visitor rules, and the simpler XPath rules are available to users. This allows
to leverage existing grammars.</p>
<p>We expect this to enable both our dev team and external contributors to largely extend PMD usage for more languages.</p>
<p>Two languages (Swift and Kotlin) already use this new possibility.</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>
<h3 id="updated-pmd-designer">Updated PMD Designer</h3>
<p>This PMD release ships a new version of the pmd-designer.
For the changes, see <a href="https://github.com/pmd/pmd-designer/releases/tag/7.0.0-rc1">PMD Designer Changelog</a>.</p>
<h3 id="new-cpd-report-format-cpdhtml-v2xslt">New CPD report format cpdhtml-v2.xslt</h3>
<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>
<h2 id="-language-related-changes">🎉 Language Related Changes</h2>
<h3 id="new-swift-support">New: Swift support</h3>
<p>Given the full Antlr support, PMD now fully supports Swift. We are pleased to announce we are shipping a number of
rules starting with PMD 7.</p>
<ul>
<li><a href="pmd_rules_swift_errorprone.html#forcecast"><code class="language-plaintext highlighter-rouge">ForceCast</code></a> (<code class="language-plaintext highlighter-rouge">swift-errorprone</code>) 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> (<code class="language-plaintext highlighter-rouge">swift-errorprone</code>) 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> (<code class="language-plaintext highlighter-rouge">swift-bestpractices</code>) 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> (<code class="language-plaintext highlighter-rouge">swift-bestpractices</code>) 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>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>
<h3 id="new-kotlin-support-experimental">New: Kotlin support (experimental)</h3>
<p>PMD now supports Kotlin as an additional language for analyzing source code. It is based on
the official kotlin Antlr grammar. Java-based rules and XPath-based rules are supported.</p>
<p>Kotlin support has <strong>experimental</strong> stability level, meaning no compatibility should
be expected between even incremental releases. Any functionality can be added, removed or changed without
warning.</p>
<p>We are shipping the following rules:</p>
<ul>
<li><a href="pmd_rules_kotlin_bestpractices.html#functionnametooshort"><code class="language-plaintext highlighter-rouge">FunctionNameTooShort</code></a> (<code class="language-plaintext highlighter-rouge">kotlin-bestpractices</code>) 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> (<code class="language-plaintext highlighter-rouge">kotlin-errorprone</code>) 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>Contributors: <a href="https://github.com/jborgers">Jeroen Borgers</a> (@jborgers),
<a href="https://github.com/stokpop">Peter Paul Bakker</a> (@stokpop)</p>
<h3 id="new-cpd-support-for-typescript">New: CPD support for TypeScript</h3>
<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>
<h3 id="new-cpd-support-for-julia">New: CPD support for Julia</h3>
<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>
<h3 id="new-cpd-support-for-coco">New: CPD support for Coco</h3>
<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>
<h3 id="new-cpd-support-for-apache-velocity-template-language">New: CPD support for Apache Velocity Template Language</h3>
<p>PMD supports 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-vm</code>.</p>
<h3 id="changed-javascript-support">Changed: JavaScript support</h3>
<p>The JS specific parser options have been removed. The parser now always retains comments and uses version ES6.
The language module registers a couple of different versions. The latest version, which supports ES6 and also some
new constructs (see <a href="https://github.com/mozilla/rhino">Rhino</a>]), is the default. This should be fine for most
use cases.</p>
<h3 id="changed-language-versions">Changed: Language versions</h3>
<p>We revisited the versions that were defined by each language module. Now many more versions are defined for each
language. In general, you can expect that PMD can parse all these different versions. There might be situations
where this fails and this can be considered a bug. Usually the latest version is selected as the default
language version.</p>
<p>The language versions can be used to mark rules to be useful only for a specific language version via
the <code class="language-plaintext highlighter-rouge">minimumLanguageVersion</code> and <code class="language-plaintext highlighter-rouge">maximumLanguageVersion</code> attributes. While this feature is currently only used by
the Java module, listing all possible versions enables other languages as well to use this feature.</p>
<p>Related issue: <a href="https://github.com/pmd/pmd/issues/4120">[core] Explicitly name all language versions (#4120)</a></p>
<h3 id="changed-cpp-can-now-ignore-identifiers-in-sequences-cpd">Changed: CPP can now ignore identifiers in sequences (CPD)</h3>
<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 additional 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>
<h2 id="-new-and-changed-rules">🌟 New and changed rules</h2>
<h3 id="new-rules">New Rules</h3>
<p><strong>Apex</strong></p>
<ul>
<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>
</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></li>
<li><a href="pmd_rules_kotlin_errorprone.html#overridebothequalsandhashcode"><code class="language-plaintext highlighter-rouge">OverrideBothEqualsAndHashcode</code></a></li>
</ul>
<p><strong>Swift</strong></p>
<ul>
<li><a href="pmd_rules_swift_bestpractices.html#prohibitedinterfacebuilder"><code class="language-plaintext highlighter-rouge">ProhibitedInterfaceBuilder</code></a></li>
<li><a href="pmd_rules_swift_bestpractices.html#unavailablefunction"><code class="language-plaintext highlighter-rouge">UnavailableFunction</code></a></li>
<li><a href="pmd_rules_swift_errorprone.html#forcecast"><code class="language-plaintext highlighter-rouge">ForceCast</code></a></li>
<li><a href="pmd_rules_swift_errorprone.html#forcetry"><code class="language-plaintext highlighter-rouge">ForceTry</code></a></li>
</ul>
<h3 id="changed-rules">Changed Rules</h3>
<p><strong>General changes</strong></p>
<ul>
<li>All statistical rules (like ExcessiveClassLength, ExcessiveParameterList) have been simplified and unified.
The properties <code class="language-plaintext highlighter-rouge">topscore</code> and <code class="language-plaintext highlighter-rouge">sigma</code> have been removed. The property <code class="language-plaintext highlighter-rouge">minimum</code> 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):
<ul>
<li>Apex: <a href="pmd_rules_apex_design.html#excessiveclasslength"><code class="language-plaintext highlighter-rouge">ExcessiveClassLength</code></a>, <a href="pmd_rules_apex_design.html#excessiveparameterlist"><code class="language-plaintext highlighter-rouge">ExcessiveParameterList</code></a>,
<a href="pmd_rules_apex_design.html#excessivepubliccount"><code class="language-plaintext highlighter-rouge">ExcessivePublicCount</code></a>, <a href="pmd_rules_apex_design.html#ncssconstructorcount"><code class="language-plaintext highlighter-rouge">NcssConstructorCount</code></a>,
<a href="pmd_rules_apex_design.html#ncssmethodcount"><code class="language-plaintext highlighter-rouge">NcssMethodCount</code></a>, <a href="pmd_rules_apex_design.html#ncsstypecount"><code class="language-plaintext highlighter-rouge">NcssTypeCount</code></a></li>
<li>Java: <a href="pmd_rules_java_design.html#excessiveimports"><code class="language-plaintext highlighter-rouge">ExcessiveImports</code></a>, <a href="pmd_rules_java_design.html#excessiveparameterlist"><code class="language-plaintext highlighter-rouge">ExcessiveParameterList</code></a>,
<a href="pmd_rules_java_design.html#excessivepubliccount"><code class="language-plaintext highlighter-rouge">ExcessivePublicCount</code></a>, <a href="pmd_rules_java_design.html#switchdensity"><code class="language-plaintext highlighter-rouge">SwitchDensity</code></a></li>
<li>PLSQL: <a href="pmd_rules_plsql_design.html#excessivemethodlength"><code class="language-plaintext highlighter-rouge">ExcessiveMethodLength</code></a>, <a href="pmd_rules_plsql_design.html#excessiveobjectlength"><code class="language-plaintext highlighter-rouge">ExcessiveObjectLength</code></a>,
<a href="pmd_rules_plsql_design.html#excessivepackagebodylength"><code class="language-plaintext highlighter-rouge">ExcessivePackageBodyLength</code></a>, <a href="pmd_rules_plsql_design.html#excessivepackagespecificationlength"><code class="language-plaintext highlighter-rouge">ExcessivePackageSpecificationLength</code></a>,
<a href="pmd_rules_plsql_design.html#excessiveparameterlist"><code class="language-plaintext highlighter-rouge">ExcessiveParameterList</code></a>, <a href="pmd_rules_plsql_design.html#excessivetypelength"><code class="language-plaintext highlighter-rouge">ExcessiveTypeLength</code></a>,
<a href="pmd_rules_plsql_design.html#ncssmethodcount"><code class="language-plaintext highlighter-rouge">NcssMethodCount</code></a>, <a href="pmd_rules_plsql_design.html#ncssobjectcount"><code class="language-plaintext highlighter-rouge">NcssObjectCount</code></a>,
<a href="pmd_rules_plsql_design.html#npathcomplexity"><code class="language-plaintext highlighter-rouge">NPathComplexity</code></a></li>
<li>VM: <a href="pmd_rules_vm_design.html#excessivetemplatelength"><code class="language-plaintext highlighter-rouge">ExcessiveTemplateLength</code></a></li>
</ul>
</li>
<li>The general property <code class="language-plaintext highlighter-rouge">violationSuppressXPath</code> which is available for all rules to
<a href="pmd_userdocs_suppressing_warnings.html">suppress warnings</a> 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 <code class="language-plaintext highlighter-rouge">violationSuppressXPath</code> properties.</li>
</ul>
<p><strong>Apex General changes</strong></p>
<ul>
<li>The properties <code class="language-plaintext highlighter-rouge">cc_categories</code>, <code class="language-plaintext highlighter-rouge">cc_remediation_points_multiplier</code>, <code class="language-plaintext highlighter-rouge">cc_block_highlighting</code> have been removed
from all rules. These properties have been deprecated since PMD 6.13.0.
See <a href="https://github.com/pmd/pmd/issues/1648">issue #1648</a> for more details.</li>
</ul>
<p><strong>Java General changes</strong></p>
<ul>
<li>
<p>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. <a href="pmd_rules_java_design.html#cognitivecomplexity"><code class="language-plaintext highlighter-rouge">CognitiveComplexity</code></a>.</p>
<p>The report location is controlled by the overrides of the method <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/Node.html#getReportLocation()"><code>getReportLocation</code></a>
in different node types.</p>
<p>See <a href="https://github.com/pmd/pmd/issues/4439">issue #4439</a> and <a href="https://github.com/pmd/pmd/issues/730">issue #730</a>
for more details.</p>
</li>
</ul>
<p><strong>Java Best Practices</strong></p>
<ul>
<li><a href="pmd_rules_java_bestpractices.html#arrayisstoreddirectly"><code class="language-plaintext highlighter-rouge">ArrayIsStoredDirectly</code></a>: Violations are now reported on the assignment and not
anymore on the formal parameter. The reported line numbers will probably move.</li>
<li><a href="pmd_rules_java_bestpractices.html#avoidreassigningloopvariables"><code class="language-plaintext highlighter-rouge">AvoidReassigningLoopVariables</code></a>: This rule might not report anymore all
reassignments of the control variable in for-loops when the property <code class="language-plaintext highlighter-rouge">forReassign</code> is set to <code class="language-plaintext highlighter-rouge">skip</code>.
See <a href="https://github.com/pmd/pmd/issues/4500">issue #4500</a> for more details.</li>
<li><a href="pmd_rules_java_bestpractices.html#loosecoupling"><code class="language-plaintext highlighter-rouge">LooseCoupling</code></a>: The rule has a new property to allow some types to be coupled
to (<code class="language-plaintext highlighter-rouge">allowedTypes</code>).</li>
<li><a href="pmd_rules_java_bestpractices.html#unusedlocalvariable"><code class="language-plaintext highlighter-rouge">UnusedLocalVariable</code></a>: This rule has some important false-negatives fixed
and finds many more cases now. For details see issues <a href="https://github.com/pmd/pmd/issues/2130">#2130</a>,
<a href="https://github.com/pmd/pmd/issues/4516">#4516</a>, and <a href="https://github.com/pmd/pmd/issues/4517">#4517</a>.</li>
</ul>
<p><strong>Java Codestyle</strong></p>
<ul>
<li><a href="pmd_rules_java_codestyle.html#methodnamingconventions"><code class="language-plaintext highlighter-rouge">MethodNamingConventions</code></a>: The property <code class="language-plaintext highlighter-rouge">checkNativeMethods</code> has been removed. The
property was deprecated since PMD 6.3.0. Use the property <code class="language-plaintext highlighter-rouge">nativePattern</code> to control whether native methods
should be considered or not.</li>
<li><a href="pmd_rules_java_codestyle.html#shortvariable"><code class="language-plaintext highlighter-rouge">ShortVariable</code></a>: This rule now also reports short enum constant names.</li>
<li><a href="pmd_rules_java_codestyle.html#usediamondoperator"><code class="language-plaintext highlighter-rouge">UseDiamondOperator</code></a>: The property <code class="language-plaintext highlighter-rouge">java7Compatibility</code> has been removed. The rule now
handles Java 7 properly without a property.</li>
<li><a href="pmd_rules_java_codestyle.html#unnecessaryfullyqualifiedname"><code class="language-plaintext highlighter-rouge">UnnecessaryFullyQualifiedName</code></a>: 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.</li>
<li><a href="pmd_rules_java_codestyle.html#uselessparentheses"><code class="language-plaintext highlighter-rouge">UselessParentheses</code></a>: The rule has two new properties which control how strict
the rule should be applied. With <code class="language-plaintext highlighter-rouge">ignoreClarifying</code> (default: true) parentheses that are strictly speaking
not necessary are allowed, if they separate expressions of different precedence.
The other property <code class="language-plaintext highlighter-rouge">ignoreBalancing</code> (default: true) is similar, in that it allows parentheses that help
reading and understanding the expressions.</li>
</ul>
<p><strong>Java Design</strong></p>
<ul>
<li><a href="pmd_rules_java_design.html#cyclomaticcomplexity"><code class="language-plaintext highlighter-rouge">CyclomaticComplexity</code></a>: The property <code class="language-plaintext highlighter-rouge">reportLevel</code> 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
<code class="language-plaintext highlighter-rouge">classReportLevel</code> and <code class="language-plaintext highlighter-rouge">methodReportLevel</code> instead.</li>
<li><a href="pmd_rules_java_design.html#immutablefield"><code class="language-plaintext highlighter-rouge">ImmutableField</code></a>: The property <code class="language-plaintext highlighter-rouge">ignoredAnnotations</code> has been removed. The property was
deprecated since PMD 6.52.0.</li>
<li><a href="pmd_rules_java_design.html#lawofdemeter"><code class="language-plaintext highlighter-rouge">LawOfDemeter</code></a>: The rule has a new property <code class="language-plaintext highlighter-rouge">trustRadius</code>. This defines the maximum degree
of trusted data. The default of 1 is the most restrictive.</li>
<li><a href="pmd_rules_java_design.html#npathcomplexity"><code class="language-plaintext highlighter-rouge">NPathComplexity</code></a>: The property <code class="language-plaintext highlighter-rouge">minimum</code> has been removed. It was deprecated since PMD 6.0.0.
Use the property <code class="language-plaintext highlighter-rouge">reportLevel</code> instead.</li>
<li><a href="pmd_rules_java_design.html#singularfield"><code class="language-plaintext highlighter-rouge">SingularField</code></a>: The properties <code class="language-plaintext highlighter-rouge">checkInnerClasses</code> and <code class="language-plaintext highlighter-rouge">disallowNotAssignment</code> have been removed.
The rule is now more precise and will check these cases properly.</li>
<li><a href="pmd_rules_java_design.html#useutilityclass"><code class="language-plaintext highlighter-rouge">UseUtilityClass</code></a>: The property <code class="language-plaintext highlighter-rouge">ignoredAnnotations</code> has been removed.</li>
</ul>
<p><strong>Java Documentation</strong></p>
<ul>
<li><a href="pmd_rules_java_documentation.html#commentcontent"><code class="language-plaintext highlighter-rouge">CommentContent</code></a>: The properties <code class="language-plaintext highlighter-rouge">caseSensitive</code> and <code class="language-plaintext highlighter-rouge">disallowedTerms</code> are removed. The
new property <code class="language-plaintext highlighter-rouge">forbiddenRegex</code> can be used now to define the disallowed terms with a single regular
expression.</li>
<li><a href="pmd_rules_java_documentation.html#commentrequired"><code class="language-plaintext highlighter-rouge">CommentRequired</code></a>:
<ul>
<li>Overridden methods are now detected even without the <code class="language-plaintext highlighter-rouge">@Override</code>
annotation. This is relevant for the property <code class="language-plaintext highlighter-rouge">methodWithOverrideCommentRequirement</code>.
See also <a href="https://github.com/pmd/pmd/pull/3757">pull request #3757</a>.</li>
<li>Elements in annotation types are now detected as well. This might lead to an increased number of violations
for missing public method comments.</li>
</ul>
</li>
<li><a href="pmd_rules_java_documentation.html#commentsize"><code class="language-plaintext highlighter-rouge">CommentSize</code></a>: When determining the line-length of a comment, the leading comment
prefix markers (e.g. <code class="language-plaintext highlighter-rouge">*</code> or <code class="language-plaintext highlighter-rouge">//</code>) are ignored and dont add up to the line-length.
See also <a href="https://github.com/pmd/pmd/pull/4369">pull request #4369</a>.</li>
</ul>
<p><strong>Java Error Prone</strong></p>
<ul>
<li><a href="pmd_rules_java_errorprone.html#avoidduplicateliterals"><code class="language-plaintext highlighter-rouge">AvoidDuplicateLiterals</code></a>: The property <code class="language-plaintext highlighter-rouge">exceptionfile</code> has been removed. The property was
deprecated since PMD 6.10.0. Use the property <code class="language-plaintext highlighter-rouge">exceptionList</code> instead.</li>
<li><a href="pmd_rules_java_errorprone.html#dontimportsun"><code class="language-plaintext highlighter-rouge">DontImportSun</code></a>: <code class="language-plaintext highlighter-rouge">sun.misc.Signal</code> is not special-cased anymore.</li>
<li><a href="pmd_rules_java_errorprone.html#emptycatchblock"><code class="language-plaintext highlighter-rouge">EmptyCatchBlock</code></a>: <code class="language-plaintext highlighter-rouge">CloneNotSupportedException</code> and <code class="language-plaintext highlighter-rouge">InterruptedException</code> are not
special-cased anymore. Rename the exception parameter to <code class="language-plaintext highlighter-rouge">ignored</code> to ignore them.</li>
<li><a href="pmd_rules_java_errorprone.html#implicitswitchfallthrough"><code class="language-plaintext highlighter-rouge">ImplicitSwitchFallThrough</code></a>: 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.</li>
</ul>
<h3 id="deprecated-rules">Deprecated Rules</h3>
<p>In PMD 7.0.0, there are no deprecated rules.</p>
<h3 id="removed-rules">Removed Rules</h3>
<p>The following previously deprecated rules have been finally removed:</p>
<p><strong>Apex</strong></p>
<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>
<li>codestyle.xml/VariableNamingConventions <span style="font-size: small;">(deleted)</span> ➡️ use <a href="pmd_rules_apex_codestyle.html#fieldnamingconventions"><code class="language-plaintext highlighter-rouge">FieldNamingConventions</code></a>,
<a href="pmd_rules_apex_codestyle.html#formalparameternamingconventions"><code class="language-plaintext highlighter-rouge">FormalParameterNamingConventions</code></a>, <a href="pmd_rules_apex_codestyle.html#localvariablenamingconventions"><code class="language-plaintext highlighter-rouge">LocalVariableNamingConventions</code></a>,
or <a href="pmd_rules_apex_codestyle.html#propertynamingconventions"><code class="language-plaintext highlighter-rouge">PropertyNamingConventions</code></a></li>
</ul>
<p><strong>Java</strong></p>
<ul>
<li>codestyle.xml/AbstractNaming <span style="font-size: small;">(deleted)</span> ➡️ use <a href="pmd_rules_java_codestyle.html#classnamingconventions"><code class="language-plaintext highlighter-rouge">ClassNamingConventions</code></a></li>
<li>AvoidFinalLocalVariable (java-codestyle) ➡️ not replaced</li>
<li>AvoidPrefixingMethodParameters (java-codestyle) ➡️ use <a href="pmd_rules_java_codestyle.html#formalparameternamingconventions"><code class="language-plaintext highlighter-rouge">FormalParameterNamingConventions</code></a></li>
<li>AvoidUsingShortType (java-performance) ➡️ not replaced</li>
<li>BadComparison (java-errorprone) ➡️ use <a href="pmd_rules_java_errorprone.html#comparisonwithnan"><code class="language-plaintext highlighter-rouge">ComparisonWithNaN</code></a></li>
<li>BeanMembersShouldSerialize (java-errorprone) ➡️ use <a href="pmd_rules_java_errorprone.html#nonserializableclass"><code class="language-plaintext highlighter-rouge">NonSerializableClass</code></a></li>
<li>BooleanInstantiation (java-performance) ➡️ use <a href="pmd_rules_java_codestyle.html#unnecessaryboxing"><code class="language-plaintext highlighter-rouge">UnnecessaryBoxing</code></a>
and <a href="pmd_rules_java_bestpractices.html#primitivewrapperinstantiation"><code class="language-plaintext highlighter-rouge">PrimitiveWrapperInstantiation</code></a></li>
<li>ByteInstantiation (java-performance) ➡️ use <a href="pmd_rules_java_codestyle.html#unnecessaryboxing"><code class="language-plaintext highlighter-rouge">UnnecessaryBoxing</code></a>
and <a href="pmd_rules_java_bestpractices.html#primitivewrapperinstantiation"><code class="language-plaintext highlighter-rouge">PrimitiveWrapperInstantiation</code></a></li>
<li>CloneThrowsCloneNotSupportedException (java-errorprone) ➡️ not replaced</li>
<li>DataflowAnomalyAnalysis (java-errorprone) ➡️ use <a href="pmd_rules_java_bestpractices.html#unusedassignment"><code class="language-plaintext highlighter-rouge">UnusedAssignment</code></a></li>
<li>DefaultPackage (java-codestyle) ➡️ use <a href="pmd_rules_java_codestyle.html#commentdefaultaccessmodifier"><code class="language-plaintext highlighter-rouge">CommentDefaultAccessModifier</code></a></li>
<li>DoNotCallSystemExit (java-errorprone) ➡️ use <a href="pmd_rules_java_errorprone.html#donotterminatevm"><code class="language-plaintext highlighter-rouge">DoNotTerminateVM</code></a></li>
<li>DontImportJavaLang (java-codestyle) ➡️ use <a href="pmd_rules_java_codestyle.html#unnecessaryimport"><code class="language-plaintext highlighter-rouge">UnnecessaryImport</code></a></li>
<li>DuplicateImports (java-codestyle) ➡️ use <a href="pmd_rules_java_codestyle.html#unnecessaryimport"><code class="language-plaintext highlighter-rouge">UnnecessaryImport</code></a></li>
<li>EmptyFinallyBlock (java-errorprone) ➡️ use <a href="pmd_rules_java_codestyle.html#emptycontrolstatement"><code class="language-plaintext highlighter-rouge">EmptyControlStatement</code></a></li>
<li>EmptyIfStmt (java-errorprone) ➡️ use <a href="pmd_rules_java_codestyle.html#emptycontrolstatement"><code class="language-plaintext highlighter-rouge">EmptyControlStatement</code></a></li>
<li>EmptyInitializer (java-errorprone) ➡️ use <a href="pmd_rules_java_codestyle.html#emptycontrolstatement"><code class="language-plaintext highlighter-rouge">EmptyControlStatement</code></a></li>
<li>EmptyStatementBlock (java-errorprone) ➡️ use <a href="pmd_rules_java_codestyle.html#emptycontrolstatement"><code class="language-plaintext highlighter-rouge">EmptyControlStatement</code></a></li>
<li>EmptyStatementNotInLoop (java-errorprone) ➡️ use <a href="pmd_rules_java_codestyle.html#unnecessarysemicolon"><code class="language-plaintext highlighter-rouge">UnnecessarySemicolon</code></a></li>
<li>EmptySwitchStatements (java-errorprone) ➡️ use <a href="pmd_rules_java_codestyle.html#emptycontrolstatement"><code class="language-plaintext highlighter-rouge">EmptyControlStatement</code></a></li>
<li>EmptySynchronizedBlock (java-errorprone) ➡️ use <a href="pmd_rules_java_codestyle.html#emptycontrolstatement"><code class="language-plaintext highlighter-rouge">EmptyControlStatement</code></a></li>
<li>EmptyTryBlock (java-errorprone) ➡️ use <a href="pmd_rules_java_codestyle.html#emptycontrolstatement"><code class="language-plaintext highlighter-rouge">EmptyControlStatement</code></a></li>
<li>EmptyWhileStmt (java-errorprone) ➡️ use <a href="pmd_rules_java_codestyle.html#emptycontrolstatement"><code class="language-plaintext highlighter-rouge">EmptyControlStatement</code></a></li>
<li>ExcessiveClassLength (java-design) ➡️ use <a href="pmd_rules_java_design.html#ncsscount"><code class="language-plaintext highlighter-rouge">NcssCount</code></a></li>
<li>ExcessiveMethodLength (java-design) ➡️ use <a href="pmd_rules_java_design.html#ncsscount"><code class="language-plaintext highlighter-rouge">NcssCount</code></a></li>
<li>ForLoopsMustUseBraces (java-codestyle) ➡️ use <a href="pmd_rules_java_codestyle.html#controlstatementbraces"><code class="language-plaintext highlighter-rouge">ControlStatementBraces</code></a></li>
<li>IfElseStmtsMustUseBraces (java-codestyle) ➡️ use <a href="pmd_rules_java_codestyle.html#controlstatementbraces"><code class="language-plaintext highlighter-rouge">ControlStatementBraces</code></a></li>
<li>IfStmtsMustUseBraces (java-codestyle) ➡️ use <a href="pmd_rules_java_codestyle.html#controlstatementbraces"><code class="language-plaintext highlighter-rouge">ControlStatementBraces</code></a></li>
<li>ImportFromSamePackage (java-errorprone) ➡️ use <a href="pmd_rules_java_codestyle.html#unnecessaryimport"><code class="language-plaintext highlighter-rouge">UnnecessaryImport</code></a></li>
<li>IntegerInstantiation (java-performance) ➡️ use <a href="pmd_rules_java_codestyle.html#unnecessaryboxing"><code class="language-plaintext highlighter-rouge">UnnecessaryBoxing</code></a>
and <a href="pmd_rules_java_bestpractices.html#primitivewrapperinstantiation"><code class="language-plaintext highlighter-rouge">PrimitiveWrapperInstantiation</code></a></li>
<li>InvalidSlf4jMessageFormat (java-errorprone) ➡️ use <a href="pmd_rules_java_errorprone.html#invalidlogmessageformat"><code class="language-plaintext highlighter-rouge">InvalidLogMessageFormat</code></a></li>
<li>LoggerIsNotStaticFinal (java-errorprone) ➡️ use <a href="pmd_rules_java_errorprone.html#properlogger"><code class="language-plaintext highlighter-rouge">ProperLogger</code></a></li>
<li>LongInstantiation (java-performance) ➡️ use <a href="pmd_rules_java_codestyle.html#unnecessaryboxing"><code class="language-plaintext highlighter-rouge">UnnecessaryBoxing</code></a>
and <a href="pmd_rules_java_bestpractices.html#primitivewrapperinstantiation"><code class="language-plaintext highlighter-rouge">PrimitiveWrapperInstantiation</code></a></li>
<li>MIsLeadingVariableName (java-codestyle) ➡️ use <a href="pmd_rules_java_codestyle.html#fieldnamingconventions"><code class="language-plaintext highlighter-rouge">FieldNamingConventions</code></a>,
<a href="pmd_rules_java_codestyle.html#formalparameternamingconventions"><code class="language-plaintext highlighter-rouge">FormalParameterNamingConventions</code></a>,
or <a href="pmd_rules_java_codestyle.html#localvariablenamingconventions"><code class="language-plaintext highlighter-rouge">LocalVariableNamingConventions</code></a></li>
<li>MissingBreakInSwitch (java-errorprone) ➡️ use <a href="pmd_rules_java_errorprone.html#implicitswitchfallthrough"><code class="language-plaintext highlighter-rouge">ImplicitSwitchFallThrough</code></a></li>
<li>ModifiedCyclomaticComplexity (java-design) ➡️ use <a href="pmd_rules_java_design.html#cyclomaticcomplexity"><code class="language-plaintext highlighter-rouge">CyclomaticComplexity</code></a></li>
<li>NcssConstructorCount (java-design) ➡️ use <a href="pmd_rules_java_design.html#ncsscount"><code class="language-plaintext highlighter-rouge">NcssCount</code></a></li>
<li>NcssMethodCount (java-design) ➡️ use <a href="pmd_rules_java_design.html#ncsscount"><code class="language-plaintext highlighter-rouge">NcssCount</code></a></li>
<li>NcssTypeCount (java-design) ➡️ use <a href="pmd_rules_java_design.html#ncsscount"><code class="language-plaintext highlighter-rouge">NcssCount</code></a></li>
<li>PositionLiteralsFirstInCaseInsensitiveComparisons (java-bestpractices) ➡️
use <a href="pmd_rules_java_bestpractices.html#literalsfirstincomparisons"><code class="language-plaintext highlighter-rouge">LiteralsFirstInComparisons</code></a></li>
<li>PositionLiteralsFirstInComparisons (java-bestpractices) ➡️
use <a href="pmd_rules_java_bestpractices.html#literalsfirstincomparisons"><code class="language-plaintext highlighter-rouge">LiteralsFirstInComparisons</code></a></li>
<li>ReturnEmptyArrayRatherThanNull (java-errorprone) ➡️
use <a href="pmd_rules_java_errorprone.html#returnemptycollectionratherthannull"><code class="language-plaintext highlighter-rouge">ReturnEmptyCollectionRatherThanNull</code></a></li>
<li>ShortInstantiation (java-performance) ➡️ use <a href="pmd_rules_java_codestyle.html#unnecessaryboxing"><code class="language-plaintext highlighter-rouge">UnnecessaryBoxing</code></a>
and <a href="pmd_rules_java_bestpractices.html#primitivewrapperinstantiation"><code class="language-plaintext highlighter-rouge">PrimitiveWrapperInstantiation</code></a></li>
<li>SimplifyBooleanAssertion (java-design) ➡️ use <a href="pmd_rules_java_bestpractices.html#simplifiabletestassertion"><code class="language-plaintext highlighter-rouge">SimplifiableTestAssertion</code></a></li>
<li>SimplifyStartsWith (java-performance) ➡️ not replaced</li>
<li>StdCyclomaticComplexity (java-design) ➡️ use <a href="pmd_rules_java_design.html#cyclomaticcomplexity"><code class="language-plaintext highlighter-rouge">CyclomaticComplexity</code></a></li>
<li>SuspiciousConstantFieldName (java-codestyle) ➡️ use <a href="pmd_rules_java_codestyle.html#fieldnamingconventions"><code class="language-plaintext highlighter-rouge">FieldNamingConventions</code></a></li>
<li>UnnecessaryWrapperObjectCreation (java-performance) ➡️ use the new rule <a href="pmd_rules_java_codestyle.html#unnecessaryboxing"><code class="language-plaintext highlighter-rouge">UnnecessaryBoxing</code></a></li>
<li>UnsynchronizedStaticDateFormatter (java-multithreading) ➡️
use <a href="pmd_rules_java_multithreading.html#unsynchronizedstaticformatter"><code class="language-plaintext highlighter-rouge">UnsynchronizedStaticFormatter</code></a></li>
<li>UnusedImports (java-bestpractices) ➡️ use <a href="pmd_rules_java_codestyle.html#unnecessaryimport"><code class="language-plaintext highlighter-rouge">UnnecessaryImport</code></a></li>
<li>UseAssertEqualsInsteadOfAssertTrue (java-bestpractices) ➡️
use <a href="pmd_rules_java_bestpractices.html#simplifiabletestassertion"><code class="language-plaintext highlighter-rouge">SimplifiableTestAssertion</code></a></li>
<li>UseAssertNullInsteadOfAssertEquals (java-bestpractices) ➡️
use <a href="pmd_rules_java_bestpractices.html#simplifiabletestassertion"><code class="language-plaintext highlighter-rouge">SimplifiableTestAssertion</code></a></li>
<li>UseAssertSameInsteadOfAssertEquals (java-bestpractices) ➡️
use <a href="pmd_rules_java_bestpractices.html#simplifiabletestassertion"><code class="language-plaintext highlighter-rouge">SimplifiableTestAssertion</code></a></li>
<li>UseAssertTrueInsteadOfAssertEquals (java-bestpractices) ➡️
use <a href="pmd_rules_java_bestpractices.html#simplifiabletestassertion"><code class="language-plaintext highlighter-rouge">SimplifiableTestAssertion</code></a></li>
<li>VariableNamingConventions (java-codestyle) ➡️ use <a href="pmd_rules_java_codestyle.html#fieldnamingconventions"><code class="language-plaintext highlighter-rouge">FieldNamingConventions</code></a>,
<a href="pmd_rules_java_codestyle.html#formalparameternamingconventions"><code class="language-plaintext highlighter-rouge">FormalParameterNamingConventions</code></a>,
or <a href="pmd_rules_java_codestyle.html#localvariablenamingconventions"><code class="language-plaintext highlighter-rouge">LocalVariableNamingConventions</code></a></li>
<li>WhileLoopsMustUseBraces (java-codestyle) ➡️ use <a href="pmd_rules_java_codestyle.html#controlstatementbraces"><code class="language-plaintext highlighter-rouge">ControlStatementBraces</code></a></li>
</ul>
<h2 id="-compatibility-and-migration-notes">💥 Compatibility and Migration Notes</h2>
<h3 id="for-endusers">For endusers</h3>
<ul>
<li>PMD 7 requires Java 8 or above to execute.</li>
<li>CLI changed: Custom scripts need to be updated (<code class="language-plaintext highlighter-rouge">run.sh pmd ...</code> ➡️ <code class="language-plaintext highlighter-rouge">pmd check ...</code>, <code class="language-plaintext highlighter-rouge">run.sh cpd ...</code>, <code class="language-plaintext highlighter-rouge">pmd cpd ...</code>).</li>
<li>Java module revamped: Custom rules need to be updated.</li>
<li>Removed rules: Custom rulesets need to be reviewed. See below for a list of new and removed rules.</li>
<li>XPath 1.0 support is removed, <code class="language-plaintext highlighter-rouge">violationSuppressXPath</code> now requires XPath 2.0 or 3.1: Custom rulesets need
to be reviewed.</li>
<li>Custom rules using rulechains: Need to override <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/AbstractRule.html#buildTargetSelector()"><code>buildTargetSelector</code></a>
using <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/RuleTargetSelector.html#forTypes(java.lang.Class,java.lang.Class...)"><code>forTypes</code></a>.</li>
<li>
<p>The asset filenames of PMD on <a href="https://github.com/pmd/pmd/releases">GitHub Releases</a> are
now <code class="language-plaintext highlighter-rouge">pmd-dist-&lt;version&gt;-bin.zip</code>, <code class="language-plaintext highlighter-rouge">pmd-dist-&lt;version&gt;-src.zip</code> and <code class="language-plaintext highlighter-rouge">pmd-dist-&lt;version&gt;-doc.zip</code>.
Keep that in mind, if you have an automated download script.</p>
<p>The structure inside the ZIP files stay the same, e.g. we still provide inside the binary distribution
ZIP file the base directory <code class="language-plaintext highlighter-rouge">pmd-bin-&lt;version&gt;</code>.</p>
</li>
</ul>
<h3 id="for-integrators">For integrators</h3>
<ul>
<li>PMD 7 is a major release where many things have been moved or rewritten.</li>
<li>All integrators will require some level of change to adapt to the change in the API.</li>
<li>For more details look at the deprecations notes of the past PMD 6 releases.</li>
<li>The PMD Ant tasks, which were previously in the module <code class="language-plaintext highlighter-rouge">pmd-core</code> has been moved into its own module <code class="language-plaintext highlighter-rouge">pmd-ant</code></li>
<li>The CLI classes have also been moved out of <code class="language-plaintext highlighter-rouge">pmd-core</code> into its own module <code class="language-plaintext highlighter-rouge">pmd-cli</code>. The old entry point, the
main class <code class="language-plaintext highlighter-rouge">PMD</code> is gone.</li>
</ul>
<h2 id="-api">🚨 API</h2>
<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>This however entails some incompatibilities and
deprecations, see also the sections <a href="#new-api-support-guidelines">New API support guidelines</a> and
<a href="#api-removals">API removals</a> below.</p>
<h3 id="new-api-support-guidelines">New API support guidelines</h3>
<p>Until now, all released public members and types were implicitly considered part
of PMDs public API, including inheritance-specific members (protected members, abstract methods).
We have maintained those APIs with the goal to preserve full binary compatibility between minor releases,
only breaking those APIs infrequently, for major releases.</p>
<p>In order to allow PMD to move forward at a faster pace, this implicit contract will
be invalidated with PMD 7.0.0. We now introduce more fine-grained distinctions between
the type of compatibility support we guarantee for our libraries, and ways to make
them explicit to clients of PMD.</p>
<p><strong><code class="language-plaintext highlighter-rouge">.internal</code> packages and <code class="language-plaintext highlighter-rouge">@InternalApi</code> annotation</strong></p>
<p><em>Internal API</em> is meant for use <em>only</em> by the main PMD codebase. Internal types and methods
may be modified in any way, or even removed, at any time.</p>
<p>Any API in a package that contains an <code class="language-plaintext highlighter-rouge">.internal</code> segment is considered internal.
The <code class="language-plaintext highlighter-rouge">@InternalApi</code> annotation will be used for APIs that have to live outside of
these packages, e.g. methods of a public type that shouldnt be used outside of PMD (again,
these can be removed anytime).</p>
<p><strong><code class="language-plaintext highlighter-rouge">@ReservedSubclassing</code></strong></p>
<p>Types marked with the <code class="language-plaintext highlighter-rouge">@ReservedSubclassing</code> annotation are only meant to be subclassed
by classes within PMD. As such, we may add new abstract methods, or remove protected methods,
at any time. All published public members remain supported. The annotation is <em>not</em> inherited, which
means a reserved interface doesnt prevent its implementors to be subclassed.</p>
<p><strong><code class="language-plaintext highlighter-rouge">@Experimental</code></strong></p>
<p>APIs marked with the <code class="language-plaintext highlighter-rouge">@Experimental</code> annotation at the class or method level are subject to change.
They can be modified in any way, or even removed, at any time. You should not use or rely
on them in any production code. They are purely to allow broad testing and feedback.</p>
<p><strong><code class="language-plaintext highlighter-rouge">@Deprecated</code></strong></p>
<p>APIs marked with the <code class="language-plaintext highlighter-rouge">@Deprecated</code> annotation at the class or method level will remain supported
until the next major release, but it is recommended to stop using them.</p>
<h3 id="small-changes-and-cleanups">Small Changes and cleanups</h3>
<ul>
<li>
<p><a href="https://github.com/pmd/pmd/issues/1648">#1648</a>: [apex,vf] Remove CodeClimate dependency - <a href="https://github.com/rsoesemann">Robert Sösemann</a>
Properties “cc_categories”, “cc_remediation_points_multiplier”, “cc_block_highlighting” can no longer be overridden in rulesets.
They were deprecated without replacement.</p>
</li>
<li>
<p>The old GUI applications accessible through <code class="language-plaintext highlighter-rouge">run.sh designerold</code> and <code class="language-plaintext highlighter-rouge">run.sh bgastviewer</code>
(and corresponding Batch scripts) have been removed from the PMD distribution. Please use the newer rule designer
with <code class="language-plaintext highlighter-rouge">pmd designer</code>. The corresponding classes in packages <code class="language-plaintext highlighter-rouge">java.net.sourceforge.pmd.util.viewer</code> and
<code class="language-plaintext highlighter-rouge">java.net.sourceforge.pmd.util.designer</code> have all been removed.</p>
</li>
<li>
<p>All API related to XPath support has been moved to the package <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/xpath/package-summary.html#"><code>net.sourceforge.pmd.lang.rule.xpath</code></a>.
This includes API that was previously dispersed over <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang</code>, <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang.ast.xpath</code>,
<code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang.rule.xpath</code>, <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang.rule</code>, and various language-specific packages
(which were made internal).</p>
</li>
<li>
<p>The implementation of the Ant integration has been moved from the module <code class="language-plaintext highlighter-rouge">pmd-core</code> to a new module <code class="language-plaintext highlighter-rouge">pmd-ant</code>.
This involves classes in package <a href="https://docs.pmd-code.org/apidocs/pmd-ant/7.0.0-SNAPSHOT/net/sourceforge/pmd/ant/package-summary.html#"><code>net.sourceforge.pmd.ant</code></a>. The ant CPDTask class <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.cpd.CPDTask</code>
has been moved into the same package <a href="https://docs.pmd-code.org/apidocs/pmd-ant/7.0.0-SNAPSHOT/net/sourceforge/pmd/ant/package-summary.html#"><code>net.sourceforge.pmd.ant</code></a>. Youll need to update your taskdef entries in your
build.xml files with the FQCN <a href="https://docs.pmd-code.org/apidocs/pmd-ant/7.0.0-SNAPSHOT/net/sourceforge/pmd/ant/CPDTask.html#"><code>net.sourceforge.pmd.ant.CPDTask</code></a> if you use it anywhere.</p>
</li>
<li>
<p>Utility classes in <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/util/package-summary.html#"><code>net.sourceforge.pmd.util</code></a>, that have previously marked as <code class="language-plaintext highlighter-rouge">@InternalApi</code> have been finally
moved to <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/internal/util/package-summary.html#"><code>net.sourceforge.pmd.internal.util</code></a>. This includes ClasspathClassLoader, FileFinder, FileUtil, and
IOUtil.</p>
</li>
<li>The following utility classes in <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/util/package-summary.html#"><code>net.sourceforge.pmd.util</code></a> are now considered public API:
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/util/AssertionUtil.html#"><code>AssertionUtil</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/util/CollectionUtil.html#"><code>CollectionUtil</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/util/ContextedAssertionError.html#"><code>ContextedAssertionError</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/util/ContextedStackOverflowError.html#"><code>ContextedStackOverflowError</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/util/GraphUtil.html#"><code>GraphUtil</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/util/IteratorUtil.html#"><code>IteratorUtil</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/util/StringUtil.html#"><code>StringUtil</code></a></li>
</ul>
</li>
<li>Moved the two classes <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/impl/AntlrTokenizer.html#"><code>AntlrTokenizer</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/impl/JavaCCTokenizer.html#"><code>JavaCCTokenizer</code></a> from
<code class="language-plaintext highlighter-rouge">internal</code> package into package <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/impl/package-summary.html#"><code>net.sourceforge.pmd.cpd.impl</code></a>. These two classes are part of the API and
are base classes for CPD language implementations. Since 7.0.0-rc2.</li>
<li><code class="language-plaintext highlighter-rouge">AntlrBaseRule</code> is gone in favor of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/AbstractVisitorRule.html#"><code>AbstractVisitorRule</code></a>. Since 7.0.0-rc2.</li>
<li>The classes <a href="https://docs.pmd-code.org/apidocs/pmd-kotlin/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/kotlin/ast/KotlinInnerNode.html#"><code>KotlinInnerNode</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-swift/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/swift/ast/SwiftInnerNode.html#"><code>SwiftInnerNode</code></a>
are package-private now. Since 7.0.0-rc2.</li>
</ul>
<h3 id="xpath-31-support">XPath 3.1 support</h3>
<p>Support for XPath versions 1.0, 1.0-compatibility was removed, support for XPath 2.0 is deprecated. The default
(and only) supported XPath version is now XPath 3.1. This version of the XPath language is mostly identical to
XPath 2.0.</p>
<p>Notable changes:</p>
<ul>
<li>The deprecated support for sequence-valued attributes is removed. Sequence-valued properties are still supported.</li>
<li>Refer to <a href="https://www.saxonica.com/html/documentation/expressions/xpath31new.html">the Saxonica documentation</a> for
an introduction to new features in XPath 3.1.</li>
</ul>
<h3 id="node-stream-api-for-ast-traversal">Node stream API for AST traversal</h3>
<p>This version includes a powerful API to navigate trees, similar in usage to the Java 8 Stream API:</p>
<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">node</span><span class="o">.</span><span class="na">descendants</span><span class="o">(</span><span class="nc">ASTMethodCall</span><span class="o">.</span><span class="na">class</span><span class="o">)</span>
<span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">m</span> <span class="o">-&gt;</span> <span class="s">"toString"</span><span class="o">.</span><span class="na">equals</span><span class="o">(</span><span class="n">m</span><span class="o">.</span><span class="na">getMethodName</span><span class="o">()))</span>
<span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">m</span> <span class="o">-&gt;</span> <span class="n">m</span><span class="o">.</span><span class="na">getQualifier</span><span class="o">())</span>
<span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">q</span> <span class="o">-&gt;</span> <span class="nc">TypeTestUtil</span><span class="o">.</span><span class="na">isA</span><span class="o">(</span><span class="nc">String</span><span class="o">.</span><span class="na">class</span><span class="o">,</span> <span class="n">q</span><span class="o">))</span>
<span class="o">.</span><span class="na">foreach</span><span class="o">(</span><span class="nc">System</span><span class="o">.</span><span class="na">out</span><span class="o">::</span><span class="n">println</span><span class="o">);</span>
</code></pre></div></div>
<p>A pipeline like shown here traverses the tree lazily, which is more efficient than traversing eagerly to put all
descendants in a list. It is also much easier to change than the old imperative way.</p>
<p>To make this API as accessible as possible, the <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/Node.html#"><code>Node</code></a> interface has been fitted with new
methods producing node streams. Those methods replace previous tree traversal methods like <code class="language-plaintext highlighter-rouge">Node#findDescendantsOfType</code>.
In all cases, they should be more efficient and more convenient.</p>
<p>See <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/NodeStream.html#"><code>NodeStream</code></a> for more details.</p>
<p>Contributors: <a href="https://github.com/oowekyala">Clément Fournier</a> (@oowekyala)</p>
<h3 id="metrics-framework">Metrics framework</h3>
<p>The metrics framework has been made simpler and more general.</p>
<ul>
<li>
<p>The metric interface takes an additional type parameter, representing the result type of the metric. This is
usually <code class="language-plaintext highlighter-rouge">Integer</code> or <code class="language-plaintext highlighter-rouge">Double</code>. It avoids widening the result to a <code class="language-plaintext highlighter-rouge">double</code> just to narrow it down.</p>
<p>This makes it so, that <code class="language-plaintext highlighter-rouge">Double.NaN</code> is not an appropriate sentinel value to represent “not supported” anymore.
Instead, <code class="language-plaintext highlighter-rouge">computeFor</code> may return <code class="language-plaintext highlighter-rouge">null</code> in that case (or a garbage value). The value <code class="language-plaintext highlighter-rouge">null</code> may have caused
problems with the narrowing casts, which through unboxing, might have thrown an NPE. But when we deprecated
the language-specific metrics façades to replace them with the generic <code class="language-plaintext highlighter-rouge">MetricsUtil</code>, we took care of making
the new methods throw an exception if the metric cannot be computed on the parameter. This forces you to guard
calls to <code class="language-plaintext highlighter-rouge">MetricsUtil::computeMetric</code> with something like <code class="language-plaintext highlighter-rouge">if (metric.supports(node))</code>. If youre following
this pattern, then you wont observe the undefined behavior.</p>
</li>
<li>
<p>The <code class="language-plaintext highlighter-rouge">MetricKey</code> interface is not so useful and has been merged into the <code class="language-plaintext highlighter-rouge">Metric</code> interface and removed. So
the <code class="language-plaintext highlighter-rouge">Metric</code> interface has the new method <code class="language-plaintext highlighter-rouge">String name()</code>.</p>
</li>
<li>
<p>The framework is not tied to at most 2 node types per language anymore. Previously those were nodes for
classes and for methods/constructors. Instead, many metrics support more node types. For example, NCSS can
be computed on any code block.</p>
<p>For that reason, keeping around a hard distinction between “class metrics” and “operation metrics” is not
useful. So in the Java framework for example, we removed the interfaces <code class="language-plaintext highlighter-rouge">JavaClassMetric</code>, <code class="language-plaintext highlighter-rouge">JavaOperationMetric</code>,
abstract classes for those, <code class="language-plaintext highlighter-rouge">JavaClassMetricKey</code>, and <code class="language-plaintext highlighter-rouge">JavaOperationMetricKey</code>. Metric constants are now all
inside the <code class="language-plaintext highlighter-rouge">JavaMetrics</code> utility class. The same was done in the Apex framework.</p>
<p>We dont really need abstract classes for metrics now. So <code class="language-plaintext highlighter-rouge">AbstractMetric</code> is also removed from pmd-core.
There is a factory method on the <code class="language-plaintext highlighter-rouge">Metric</code> interface to create a metric easily.</p>
</li>
<li>
<p>This makes it so, that <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/metrics/LanguageMetricsProvider.html#"><code>LanguageMetricsProvider</code></a> does not need type parameters.
It can just return a <code class="language-plaintext highlighter-rouge">Set&lt;Metric&lt;?, ?&gt;&gt;</code> to list available metrics.</p>
</li>
<li>
<p><a href="https://docs.pmd-code.org/apidocs/pmd-core/6.55.0/net/sourceforge/pmd/lang/metrics/Signature.html#"><code>Signature</code></a>s, their implementations, and the interface <code class="language-plaintext highlighter-rouge">SignedNode</code> have been
removed. Node streams allow replacing their usages very easily.</p>
</li>
</ul>
<h3 id="testing-framework">Testing framework</h3>
<ul>
<li>PMD 7 has been upgraded to use JUnit 5 only. That means, that JUnit4 related classes have been removed, namely
<ul>
<li><code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.testframework.PMDTestRunner</code></li>
<li><code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.testframework.RuleTestRunner</code></li>
<li><code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.testframework.TestDescriptor</code></li>
</ul>
</li>
<li>Rule tests, that use <a href="https://docs.pmd-code.org/apidocs/pmd-test/7.0.0-SNAPSHOT/net/sourceforge/pmd/testframework/SimpleAggregatorTst.html#"><code>SimpleAggregatorTst</code></a> or
<a href="https://docs.pmd-code.org/apidocs/pmd-test/7.0.0-SNAPSHOT/net/sourceforge/pmd/testframework/PmdRuleTst.html#"><code>PmdRuleTst</code></a> work as before without change, but use
now JUnit5 under the hood. If you added additional JUnit4 tests to your rule test classes, then youll
need to upgrade them to use JUnit5.</li>
</ul>
<h3 id="language-lifecycle-and-language-properties">Language Lifecycle and Language Properties</h3>
<ul>
<li>Language modules now provide a proper lifecycle and can store global information. This enables the implementation
of multifile analysis.</li>
<li>Language modules can define <a href="pmd_languages_configuration.html">custom language properties</a>
which can be set via environment variables. This allows to add and use language specific configuration options
without the need to change pmd-core.</li>
</ul>
<p>The documentation page has been updated:
<a href="pmd_devdocs_major_adding_new_language_javacc.html">Adding a new language with JavaCC</a>
and <a href="pmd_devdocs_major_adding_new_language_antlr.html">Adding a new language with ANTLR</a></p>
<p>Related issue: <a href="https://github.com/pmd/pmd/issues/3782">[core] Language lifecycle (#3782)</a></p>
<h3 id="rule-properties">Rule properties</h3>
<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>
<h3 id="new-programmatic-api-for-cpd">New Programmatic API for CPD</h3>
<p>This release introduces a new programmatic API to replace the old class <code class="language-plaintext highlighter-rouge">CPD</code>. The new API uses a similar model to
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PmdAnalysis.html#"><code>PmdAnalysis</code></a> and is called <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/CpdAnalysis.html#"><code>CpdAnalysis</code></a>. Programmatic execution of CPD should now be
done with a <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/CPDConfiguration.html#"><code>CPDConfiguration</code></a> and a <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/CpdAnalysis.html#"><code>CpdAnalysis</code></a>, for instance:</p>
<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nc">CPDConfiguration</span> <span class="n">config</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">CPDConfiguration</span><span class="o">();</span>
<span class="n">config</span><span class="o">.</span><span class="na">setMinimumTileSize</span><span class="o">(</span><span class="mi">100</span><span class="o">);</span>
<span class="n">config</span><span class="o">.</span><span class="na">setOnlyRecognizeLanguage</span><span class="o">(</span><span class="n">config</span><span class="o">.</span><span class="na">getLanguageRegistry</span><span class="o">().</span><span class="na">getLanguageById</span><span class="o">(</span><span class="s">"java"</span><span class="o">));</span>
<span class="n">config</span><span class="o">.</span><span class="na">setSourceEncoding</span><span class="o">(</span><span class="nc">StandardCharsets</span><span class="o">.</span><span class="na">UTF_8</span><span class="o">);</span>
<span class="n">config</span><span class="o">.</span><span class="na">addInputPath</span><span class="o">(</span><span class="nc">Path</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"src/main/java"</span><span class="o">)</span>
<span class="n">config</span><span class="o">.</span><span class="na">setIgnoreAnnotations</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
<span class="n">config</span><span class="o">.</span><span class="na">setIgnoreLiterals</span><span class="o">(</span><span class="kc">false</span><span class="o">);</span>
<span class="n">config</span><span class="o">.</span><span class="na">setRendererName</span><span class="o">(</span><span class="s">"text"</span><span class="o">);</span>
<span class="k">try</span> <span class="o">(</span><span class="nc">CpdAnalysis</span> <span class="n">cpd</span> <span class="o">=</span> <span class="nc">CpdAnalysis</span><span class="o">.</span><span class="na">create</span><span class="o">(</span><span class="n">config</span><span class="o">))</span> <span class="o">{</span>
<span class="c1">// note: don't use `config` once a CpdAnalysis has been created.</span>
<span class="c1">// optional: add more files</span>
<span class="n">cpd</span><span class="o">.</span><span class="na">files</span><span class="o">().</span><span class="na">addFile</span><span class="o">(</span><span class="nc">Paths</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"src"</span><span class="o">,</span> <span class="s">"main"</span><span class="o">,</span> <span class="s">"more-java"</span><span class="o">,</span> <span class="s">"ExtraSource.java"</span><span class="o">));</span>
<span class="n">cpd</span><span class="o">.</span><span class="na">performAnalysis</span><span class="o">();</span>
<span class="o">}</span>
</code></pre></div></div>
<p>CPD can of course still be called via command line or using the module <code class="language-plaintext highlighter-rouge">pmd-cli</code>. But for tight integration
this new programmatic API is recommended.</p>
<p>See <a href="https://github.com/pmd/pmd/pull/4397">PR #4397</a> for details.</p>
<h3 id="api-changes">API changes</h3>
<h4 id="700-rc3">7.0.0-rc3</h4>
<ul>
<li>The following previously deprecated classes have been removed:
<ul>
<li>pmd-core
<ul>
<li><code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.PMD</code></li>
<li><code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.cli.PMDCommandLineInterface</code></li>
<li><code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.cli.PMDParameters</code></li>
<li><code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.cli.PmdParametersParseResult</code></li>
</ul>
</li>
</ul>
</li>
<li>
<p>The asset filenames of PMD on <a href="https://github.com/pmd/pmd/releases">GitHub Releases</a> are
now <code class="language-plaintext highlighter-rouge">pmd-dist-&lt;version&gt;-bin.zip</code>, <code class="language-plaintext highlighter-rouge">pmd-dist-&lt;version&gt;-src.zip</code> and <code class="language-plaintext highlighter-rouge">pmd-dist-&lt;version&gt;-doc.zip</code>.
Keep that in mind, if you have an automated download script.</p>
<p>The structure inside the ZIP files stay the same, e.g. we still provide inside the binary distribution
ZIP file the base directory <code class="language-plaintext highlighter-rouge">pmd-bin-&lt;version&gt;</code>.</p>
</li>
<li>The CLI option <code class="language-plaintext highlighter-rouge">--stress</code> (or <code class="language-plaintext highlighter-rouge">-stress</code>) has been removed without replacement.</li>
<li>The CLI option <code class="language-plaintext highlighter-rouge">--minimum-priority</code> was changed with 7.0.0-rc1 to only take the following values:
High, Medium High, Medium, Medium Low, Low. With 7.0.0-rc2 compatibility has been restored, so that the equivalent
integer values (1 to 5) are supported as well.</li>
<li>
<p>Replaced <code class="language-plaintext highlighter-rouge">RuleViolation::getFilename</code> with new <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleViolation.html#getFileId()"><code>RuleViolation#getFileId</code></a>, that returns a
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/document/FileId.html#"><code>FileId</code></a>. This is an identifier for a <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/document/TextFile.html#"><code>TextFile</code></a>
and could represent a path name. This allows to have a separate display name, e.g. renderers use
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/reporting/FileNameRenderer.html#"><code>FileNameRenderer</code></a> to either display the full path name or a relative path name
(see <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/renderers/Renderer.html#setFileNameRenderer(net.sourceforge.pmd.reporting.FileNameRenderer)"><code>Renderer#setFileNameRenderer</code></a> and
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/reporting/ConfigurableFileNameRenderer.html#"><code>ConfigurableFileNameRenderer</code></a>). Many places where we used a simple String for
a path-like name before have been adapted to use the new <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/document/FileId.html#"><code>FileId</code></a>.</p>
<p>See <a href="https://github.com/pmd/pmd/pull/4425">PR #4425</a> for details.</p>
</li>
</ul>
<h4 id="700-rc2">7.0.0-rc2</h4>
<ul>
<li>The following previously deprecated classes have been removed:
<ul>
<li>pmd-core
<ul>
<li><code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.PMD</code></li>
<li><code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.cli.PMDCommandLineInterface</code></li>
<li><code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.cli.PMDParameters</code></li>
<li><code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.cli.PmdParametersParseResult</code></li>
</ul>
</li>
</ul>
</li>
<li>The CLI option <code class="language-plaintext highlighter-rouge">--minimum-priority</code> was changed with 7.0.0-rc1 to only take the following values:
High, Medium High, Medium, Medium Low, Low. With 7.0.0-rc2 compatibility has been restored, so that the equivalent
integer values (1 to 5) are supported as well.</li>
</ul>
<h4 id="700-rc1">7.0.0-rc1</h4>
<ul>
<li>The CLI option <code class="language-plaintext highlighter-rouge">--stress</code> (or <code class="language-plaintext highlighter-rouge">-stress</code>) has been removed without replacement.</li>
<li>The CLI option <code class="language-plaintext highlighter-rouge">--minimum-priority</code> now takes one of the following values instead of an integer:
High, Medium High, Medium, Medium Low, Low.</li>
</ul>
<h4 id="6550">6.55.0</h4>
<p><strong>Go</strong></p>
<ul>
<li>The LanguageModule of Go, that only supports CPD execution, has been deprecated. This language
is not fully supported by PMD, so having a language module does not make sense. The functionality of CPD is
not affected by this change. The following class has been deprecated and will be removed with PMD 7.0.0:
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-go/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/go/GoLanguageModule.html#"><code>GoLanguageModule</code></a></li>
</ul>
</li>
</ul>
<p><strong>Java</strong></p>
<ul>
<li>Support for Java 18 preview language features have been removed. The version “18-preview” is no longer available.</li>
<li>The experimental class <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang.java.ast.ASTGuardedPattern</code> has been removed.</li>
</ul>
<h4 id="6540">6.54.0</h4>
<p><strong>PMD CLI</strong></p>
<ul>
<li>PMD now supports a new <code class="language-plaintext highlighter-rouge">--relativize-paths-with</code> flag (or short <code class="language-plaintext highlighter-rouge">-z</code>), which replaces <code class="language-plaintext highlighter-rouge">--short-names</code>.
It serves the same purpose: Shortening the pathnames in the reports. However, with the new flag its possible
to explicitly define one or more pathnames that should be used as the base when creating relative paths.
The old flag <code class="language-plaintext highlighter-rouge">--short-names</code> is deprecated.</li>
</ul>
<p><strong>Deprecated APIs</strong></p>
<p><strong>For removal</strong></p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ApexRootNode.html#getApexVersion()"><code>ApexRootNode#getApexVersion</code></a> has been deprecated for removal. The version returned is
always <code class="language-plaintext highlighter-rouge">Version.CURRENT</code>, as the apex compiler integration doesnt use additional information which Apex version
actually is used. Therefore, this method cant be used to determine the Apex version of the project
that is being analyzed.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/CPDConfiguration.html#setEncoding(java.lang.String)"><code>CPDConfiguration#setEncoding</code></a> and
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/CPDConfiguration.html#getEncoding()"><code>CPDConfiguration#getEncoding</code></a>. Use the methods
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/AbstractConfiguration.html#getSourceEncoding()"><code>getSourceEncoding</code></a> and
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/AbstractConfiguration.html#setSourceEncoding(java.lang.String)"><code>setSourceEncoding</code></a> instead. Both are available
for <code class="language-plaintext highlighter-rouge">CPDConfiguration</code> which extends <code class="language-plaintext highlighter-rouge">AbstractConfiguration</code>.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-test/7.0.0-SNAPSHOT/net/sourceforge/pmd/cli/BaseCLITest.html#"><code>BaseCLITest</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-test/7.0.0-SNAPSHOT/net/sourceforge/pmd/cli/BaseCPDCLITest.html#"><code>BaseCPDCLITest</code></a> have been deprecated for removal without
replacement. CLI tests should be done in pmd-core only (and in PMD7 in pmd-cli). Individual language modules
shouldnt need to test the CLI integration logic again. Instead, the individual language modules should test their
functionality as unit tests.</li>
<li>
<p><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/CPDConfiguration.LanguageConverter.html#"><code>CPDConfiguration.LanguageConverter</code></a></p>
</li>
<li>
<p><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/document/FileCollector.html#addZipFile(java.nio.file.Path)"><code>FileCollector#addZipFile</code></a> has been deprecated. It is replaced
by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/document/FileCollector.html#addZipFileWithContent(java.nio.file.Path)"><code>FileCollector#addZipFileWithContent</code></a> which directly adds the
content of the zip file for analysis.</p>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#setReportShortNames(boolean)"><code>PMDConfiguration#setReportShortNames</code></a> and
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#isReportShortNames()"><code>PMDConfiguration#isReportShortNames</code></a> have been deprecated for removal.
Use <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#addRelativizeRoot(java.nio.file.Path)"><code>PMDConfiguration#addRelativizeRoot</code></a> instead.</li>
</ul>
<p><strong>Internal APIs</strong></p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/renderers/CSVWriter.html#"><code>CSVWriter</code></a></li>
<li>Some fields in <a href="https://docs.pmd-code.org/apidocs/pmd-test/7.0.0-SNAPSHOT/net/sourceforge/pmd/ant/AbstractAntTestHelper.html#"><code>AbstractAntTestHelper</code></a></li>
</ul>
<p><strong>Experimental APIs</strong></p>
<ul>
<li>CPDReport has a new method which limited mutation of a given report:
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/CPDReport.html#filterMatches(net.sourceforge.pmd.util.Predicate)"><code>filterMatches</code></a> creates a new CPD report
with some matches removed with a given predicate based filter.</li>
</ul>
</li>
</ul>
<h4 id="6530">6.53.0</h4>
<p><strong>Deprecated APIs</strong></p>
<p><strong>For removal</strong></p>
<p>These classes / APIs have been deprecated and will be removed with PMD 7.0.0.</p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/design/ExcessiveLengthRule.html#"><code>ExcessiveLengthRule</code></a> (Java)</li>
</ul>
<h4 id="6520">6.52.0</h4>
<p><strong>PMD CLI</strong></p>
<ul>
<li>
<p>PMD now supports a new <code class="language-plaintext highlighter-rouge">--use-version</code> flag, which receives a language-version pair (such as <code class="language-plaintext highlighter-rouge">java-8</code> or <code class="language-plaintext highlighter-rouge">apex-54</code>).
This supersedes the usage of <code class="language-plaintext highlighter-rouge">-language</code> / <code class="language-plaintext highlighter-rouge">-l</code> and <code class="language-plaintext highlighter-rouge">-version</code> / <code class="language-plaintext highlighter-rouge">-v</code>, allowing for multiple versions to be set in a single run.
PMD 7 will completely remove support for <code class="language-plaintext highlighter-rouge">-language</code> and <code class="language-plaintext highlighter-rouge">-version</code> in favor of this new flag.</p>
</li>
<li>
<p>Support for <code class="language-plaintext highlighter-rouge">-V</code> is being deprecated in favor of <code class="language-plaintext highlighter-rouge">--verbose</code> in preparation for PMD 7.
In PMD 7, <code class="language-plaintext highlighter-rouge">-v</code> will enable verbose mode and <code class="language-plaintext highlighter-rouge">-V</code> will show the PMD version for consistency with most Unix/Linux tools.</p>
</li>
<li>
<p>Support for <code class="language-plaintext highlighter-rouge">-min</code> is being deprecated in favor of <code class="language-plaintext highlighter-rouge">--minimum-priority</code> for consistency with most Unix/Linux tools, where <code class="language-plaintext highlighter-rouge">-min</code> would be equivalent to <code class="language-plaintext highlighter-rouge">-m -i -n</code>.</p>
</li>
</ul>
<p><strong>CPD CLI</strong></p>
<ul>
<li>CPD now supports using <code class="language-plaintext highlighter-rouge">-d</code> or <code class="language-plaintext highlighter-rouge">--dir</code> as an alias to <code class="language-plaintext highlighter-rouge">--files</code>, in favor of consistency with PMD.
PMD 7 will remove support for <code class="language-plaintext highlighter-rouge">--files</code> in favor of these new flags.</li>
</ul>
<p><strong>Linux run.sh parameters</strong></p>
<ul>
<li>
<p>Using <code class="language-plaintext highlighter-rouge">run.sh cpdgui</code> will now warn about it being deprecated. Use <code class="language-plaintext highlighter-rouge">run.sh cpd-gui</code> instead.</p>
</li>
<li>
<p>The old designer (<code class="language-plaintext highlighter-rouge">run.sh designerold</code>) is completely deprecated and will be removed in PMD 7. Switch to the new JavaFX designer: <code class="language-plaintext highlighter-rouge">run.sh designer</code>.</p>
</li>
<li>
<p>The old visual AST viewer (<code class="language-plaintext highlighter-rouge">run.sh bgastviewer</code>) is completely deprecated and will be removed in PMD 7. Switch to the new JavaFX designer: <code class="language-plaintext highlighter-rouge">run.sh designer</code> for a visual tool, or use <code class="language-plaintext highlighter-rouge">run.sh ast-dump</code> for a text-based alternative.</p>
</li>
</ul>
<p><strong>Deprecated API</strong></p>
<ul>
<li>The following core APIs have been marked as deprecated for removal in PMD 7:
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMD.html#"><code>PMD</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMD/StatusCode.html#"><code>StatusCode</code></a> - PMD 7 will ship with a revamped CLI split from pmd-core. To programmatically launch analysis you can use <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PmdAnalysis.html#"><code>PmdAnalysis</code></a>.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#getAllInputPaths()"><code>PMDConfiguration#getAllInputPaths</code></a> - It is now superseded by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#getInputPathList()"><code>PMDConfiguration#getInputPathList</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#setInputPaths(List)"><code>PMDConfiguration#setInputPaths</code></a> - It is now superseded by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#setInputPathList(List)"><code>PMDConfiguration#setInputPathList</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#addInputPath(String)"><code>PMDConfiguration#addInputPath</code></a> - It is now superseded by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#addInputPath(Path)"><code>PMDConfiguration#addInputPath</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#getInputFilePath()"><code>PMDConfiguration#getInputFilePath</code></a> - It is now superseded by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#getInputFile()"><code>PMDConfiguration#getInputFile</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#getIgnoreFilePath()"><code>PMDConfiguration#getIgnoreFilePath</code></a> - It is now superseded by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#getIgnoreFile()"><code>PMDConfiguration#getIgnoreFile</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#setInputFilePath(String)"><code>PMDConfiguration#setInputFilePath</code></a> - It is now superseded by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#setInputFilePath(Path)"><code>PMDConfiguration#setInputFilePath</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#setIgnoreFilePath(String)"><code>PMDConfiguration#setIgnoreFilePath</code></a> - It is now superseded by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#setIgnoreFilePath(Path)"><code>PMDConfiguration#setIgnoreFilePath</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#getInputUri()"><code>PMDConfiguration#getInputUri</code></a> - It is now superseded by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#getUri()"><code>PMDConfiguration#getUri</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#setInputUri(String)"><code>PMDConfiguration#setInputUri</code></a> - It is now superseded by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#setInputUri(URI)"><code>PMDConfiguration#setInputUri</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#getReportFile()"><code>PMDConfiguration#getReportFile</code></a> - It is now superseded by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#getReportFilePath()"><code>PMDConfiguration#getReportFilePath</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#setReportFile(String)"><code>PMDConfiguration#setReportFile</code></a> - It is now superseded by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#setReportFile(Path)"><code>PMDConfiguration#setReportFile</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#isStressTest()"><code>PMDConfiguration#isStressTest</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#setStressTest(boolean)"><code>PMDConfiguration#setStressTest</code></a> - Will be removed with no replacement.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#isBenchmark()"><code>PMDConfiguration#isBenchmark</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#setBenchmark(boolean)"><code>PMDConfiguration#setBenchmark</code></a> - Will be removed with no replacement, the CLI will still support it.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/CPD.html#"><code>CPD</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/CPD/StatusCode.html#"><code>StatusCode</code></a> - PMD 7 will ship with a revamped CLI split from pmd-core. An alterative to programatically launch CPD analysis will be added in due time.</li>
</ul>
</li>
<li>In order to reduce the dependency on Apex Jorje classes, the method <a href="https://docs.pmd-code.org/apidocs/pmd-visualforce/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/vf/DataType.html#fromBasicType(apex.jorje.semantic.symbol.type.BasicType)"><code>DataType#fromBasicType</code></a>
has been deprecated. The equivalent method <a href="https://docs.pmd-code.org/apidocs/pmd-visualforce/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/vf/DataType.html#fromTypeName(java.lang.String)"><code>fromTypeName</code></a> should be used instead.</li>
</ul>
<h4 id="6510">6.51.0</h4>
<p>No changes.</p>
<h4 id="6500">6.50.0</h4>
<p><strong>CPD CLI</strong></p>
<ul>
<li>CPD now supports the <code class="language-plaintext highlighter-rouge">--ignore-literal-sequences</code> argument when analyzing Lua code.</li>
</ul>
<h4 id="6490">6.49.0</h4>
<p><strong>Deprecated API</strong></p>
<ul>
<li>In order to reduce the dependency on Apex Jorje classes, the following methods have been deprecated.
These methods all leaked internal Jorje enums. These enums have been replaced now by enums the
PMDs AST package.
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ASTAssignmentExpression.html#getOperator()"><code>ASTAssignmentExpression#getOperator</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ASTBinaryExpression.html#getOperator()"><code>ASTBinaryExpression#getOperator</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ASTBooleanExpression.html#getOperator()"><code>ASTBooleanExpression#getOperator</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ASTPostfixExpression.html#getOperator()"><code>ASTPostfixExpression#getOperator</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ASTPrefixExpression.html#getOperator()"><code>ASTPrefixExpression#getOperator</code></a></li>
</ul>
<p>All these classes have now a new <code class="language-plaintext highlighter-rouge">getOp()</code> method. Existing code should be refactored to use this method instead.
It returns the new enums, like <a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/AssignmentOperator.html#"><code>AssignmentOperator</code></a>, and avoids
the dependency to Jorje.</p>
</li>
</ul>
<h4 id="6480">6.48.0</h4>
<p><strong>CPD CLI</strong></p>
<ul>
<li>CPD has a new CLI option <code class="language-plaintext highlighter-rouge">--debug</code>. This option has the same behavior as in PMD. It enables more verbose
logging output.</li>
</ul>
<p><strong>Rule Test Framework</strong></p>
<ul>
<li>The module “pmd-test”, which contains support classes to write rule tests, now <strong>requires Java 8</strong>. If you depend on
this module for testing your own custom rules, youll need to make sure to use at least Java 8.</li>
<li>The new module “pmd-test-schema” contains now the XSD schema and the code to parse the rule test XML files. The
schema has been extracted in order to easily share it with other tools like the Rule Designer or IDE plugins.</li>
<li>Test schema changes:
<ul>
<li>The attribute <code class="language-plaintext highlighter-rouge">isRegressionTest</code> of <code class="language-plaintext highlighter-rouge">test-code</code> is deprecated. The new
attribute <code class="language-plaintext highlighter-rouge">disabled</code> should be used instead for defining whether a rule test should be skipped or not.</li>
<li>The attributes <code class="language-plaintext highlighter-rouge">reinitializeRule</code> and <code class="language-plaintext highlighter-rouge">useAuxClasspath</code> of <code class="language-plaintext highlighter-rouge">test-code</code> are deprecated and assumed true.
They will not be replaced.</li>
<li>The new attribute <code class="language-plaintext highlighter-rouge">focused</code> of <code class="language-plaintext highlighter-rouge">test-code</code> allows disabling all tests except the focused one temporarily.</li>
</ul>
</li>
<li>More information about the rule test framework can be found in the documentation:
<a href="pmd_userdocs_extending_testing.html">Testing your rules</a></li>
</ul>
<p><strong>Deprecated API</strong></p>
<ul>
<li>The experimental Java AST class <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTGuardedPattern.html#"><code>ASTGuardedPattern</code></a> has been deprecated and
will be removed. It was introduced for Java 17 and Java 18 Preview as part of pattern matching for switch,
but it is no longer supported with Java 19 Preview.</li>
<li>The interface <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/renderer/CPDRenderer.html#"><code>CPDRenderer</code></a> is deprecated. For custom CPD renderers
the new interface <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/renderer/CPDReportRenderer.html#"><code>CPDReportRenderer</code></a> should be used.</li>
<li>The class <a href="https://docs.pmd-code.org/apidocs/pmd-test/7.0.0-SNAPSHOT/net/sourceforge/pmd/testframework/TestDescriptor.html#"><code>TestDescriptor</code></a> is deprecated, replaced with <a href="https://docs.pmd-code.org/apidocs/pmd-test-schema/7.0.0-SNAPSHOT/net/sourceforge/pmd/test/schema/RuleTestDescriptor.html#"><code>RuleTestDescriptor</code></a>.</li>
<li>Many methods of <a href="https://docs.pmd-code.org/apidocs/pmd-test/7.0.0-SNAPSHOT/net/sourceforge/pmd/testframework/RuleTst.html#"><code>RuleTst</code></a> have been deprecated as internal API.</li>
</ul>
<p><strong>Experimental APIs</strong></p>
<ul>
<li>To support the Java preview language features “Pattern Matching for Switch” and “Record Patterns”, the following
AST nodes have been introduced as experimental:
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTSwitchGuard.html#"><code>ASTSwitchGuard</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.html#"><code>ASTRecordPattern</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTComponentPatternList.html#"><code>ASTComponentPatternList</code></a></li>
</ul>
</li>
</ul>
<p><strong>Internal API</strong></p>
<p>Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0.
You can identify them with the <code class="language-plaintext highlighter-rouge">@InternalApi</code> annotation. Youll also get a deprecation warning.</p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/CPDConfiguration.html#setRenderer(net.sourceforge.pmd.cpd.Renderer)"><code>CPDConfiguration#setRenderer</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/CPDConfiguration.html#setCPDRenderer(net.sourceforge.pmd.cpd.renderer.CPDRenderer)"><code>CPDConfiguration#setCPDRenderer</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/CPDConfiguration.html#getRenderer()"><code>CPDConfiguration#getRenderer</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/CPDConfiguration.html#getCPDRenderer()"><code>CPDConfiguration#getCPDRenderer</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/CPDConfiguration.html#getRendererFromString(java.lang.String,java.lang.String)"><code>CPDConfiguration#getRendererFromString</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/CPDConfiguration.html#getCPDRendererFromString(java.lang.String,java.lang.String)"><code>CPDConfiguration#getCPDRendererFromString</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/renderer/CPDRendererAdapter.html#"><code>CPDRendererAdapter</code></a></li>
</ul>
<h4 id="6470">6.47.0</h4>
<p>No changes.</p>
<h4 id="6460">6.46.0</h4>
<p><strong>Deprecated ruleset references</strong></p>
<p>Ruleset references with the following formats are now deprecated and will produce a warning
when used on the CLI or in a ruleset XML file:</p>
<ul>
<li><code class="language-plaintext highlighter-rouge">&lt;lang-name&gt;-&lt;ruleset-name&gt;</code>, eg <code class="language-plaintext highlighter-rouge">java-basic</code>, which resolves to <code class="language-plaintext highlighter-rouge">rulesets/java/basic.xml</code></li>
<li>the internal release number, eg <code class="language-plaintext highlighter-rouge">600</code>, which resolves to <code class="language-plaintext highlighter-rouge">rulesets/releases/600.xml</code></li>
</ul>
<p>Use the explicit forms of these references to be compatible with PMD 7.</p>
<p><strong>Deprecated API</strong></p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSetReferenceId.html#toString()"><code>toString</code></a> is now deprecated. The format of this
method will remain the same until PMD 7. The deprecation is intended to steer users
away from relying on this format, as it may be changed in PMD 7.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#getInputPaths()"><code>getInputPaths</code></a> and
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#setInputPaths(java.lang.String)"><code>setInputPaths</code></a> are now deprecated.
A new set of methods have been added, which use lists and do not rely on comma splitting.</li>
</ul>
<p><strong>Internal API</strong></p>
<p>Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0.
You can identify them with the <code class="language-plaintext highlighter-rouge">@InternalApi</code> annotation. Youll also get a deprecation warning.</p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/CPDCommandLineInterface.html#"><code>CPDCommandLineInterface</code></a> has been internalized. In order to execute CPD either
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/CPD.html#run(java.lang.String...)"><code>CPD#run</code></a> or <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/CPD.html#main(java.lang.String[])"><code>CPD#main</code></a>
should be used.</li>
<li>Several members of <a href="https://docs.pmd-code.org/apidocs/pmd-test/7.0.0-SNAPSHOT/net/sourceforge/pmd/cli/BaseCPDCLITest.html#"><code>BaseCPDCLITest</code></a> have been deprecated with replacements.</li>
<li>The methods <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/ant/Formatter.html#start(java.lang.String)"><code>Formatter#start</code></a>,
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/ant/Formatter.html#end(net.sourceforge.pmd.Report)"><code>Formatter#end</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/ant/Formatter.html#getRenderer()"><code>Formatter#getRenderer</code></a>,
and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/ant/Formatter.html#isNoOutputSupplied()"><code>Formatter#isNoOutputSupplied</code></a> have been internalized.</li>
</ul>
<h4 id="6450">6.45.0</h4>
<p><strong>Experimental APIs</strong></p>
<ul>
<li>Report has two new methods which allow limited mutations of a given report:
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Report.html#filterViolations(net.sourceforge.pmd.util.Predicate)"><code>Report#filterViolations</code></a> creates a new report with
some violations removed with a given predicate based filter.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Report.html#union(net.sourceforge.pmd.Report)"><code>Report#union</code></a> can combine two reports into a single new Report.</li>
</ul>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/util/Predicate.html#"><code>net.sourceforge.pmd.util.Predicate</code></a> will be replaced in PMD7 with the standard Predicate interface from java8.</li>
<li>The module <code class="language-plaintext highlighter-rouge">pmd-html</code> is entirely experimental right now. Anything in the package
<code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang.html</code> should be used cautiously.</li>
</ul>
<h4 id="6440">6.44.0</h4>
<p><strong>Deprecated API</strong></p>
<ul>
<li>Several members of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMD.html#"><code>PMD</code></a> have been newly deprecated, including:
<ul>
<li><code class="language-plaintext highlighter-rouge">PMD#EOL</code>: use <code class="language-plaintext highlighter-rouge">System#lineSeparator()</code></li>
<li><code class="language-plaintext highlighter-rouge">PMD#SUPPRESS_MARKER</code>: use <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#DEFAULT_SUPPRESS_MARKER"><code>DEFAULT_SUPPRESS_MARKER</code></a></li>
<li><code class="language-plaintext highlighter-rouge">PMD#processFiles</code>: use the new programmatic API</li>
<li><code class="language-plaintext highlighter-rouge">PMD#getApplicableFiles</code>: is internal</li>
</ul>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#prependClasspath(java.lang.String)"><code>PMDConfiguration#prependClasspath</code></a> is deprecated
in favour of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#prependAuxClasspath(java.lang.String)"><code>prependAuxClasspath</code></a>.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#setRuleSets(java.lang.String)"><code>PMDConfiguration#setRuleSets</code></a> and
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#getRuleSets()"><code>getRuleSets</code></a> are deprecated. Use instead
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#setRuleSets(java.util.List)"><code>setRuleSets</code></a>,
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#addRuleSet(java.lang.String)"><code>addRuleSet</code></a>,
and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMDConfiguration.html#getRuleSetPaths()"><code>getRuleSetPaths</code></a>.</li>
<li>Several members of <a href="https://docs.pmd-code.org/apidocs/pmd-test/7.0.0-SNAPSHOT/net/sourceforge/pmd/cli/BaseCLITest.html#"><code>BaseCLITest</code></a> have been deprecated with replacements.</li>
<li>
<p>Several members of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cli/PMDCommandLineInterface.html#"><code>PMDCommandLineInterface</code></a> have been explicitly deprecated.
The whole class however was deprecated long ago already with 6.30.0. It is internal API and should
not be used.</p>
</li>
<li>In modelica, the rule classes <a href="https://docs.pmd-code.org/apidocs/pmd-modelica/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/modelica/rule/AmbiguousResolutionRule.html#"><code>AmbiguousResolutionRule</code></a>
and <a href="https://docs.pmd-code.org/apidocs/pmd-modelica/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/modelica/rule/ConnectUsingNonConnector.html#"><code>ConnectUsingNonConnector</code></a> have been deprecated,
since they didnt comply to the usual rule class naming conventions yet.
The replacements are in the subpackage <code class="language-plaintext highlighter-rouge">bestpractices</code>.</li>
</ul>
<p><strong>Experimental APIs</strong></p>
<ul>
<li>
<p>Together with the new programmatic API the interface
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/document/TextFile.html#"><code>TextFile</code></a> has been added as <em>experimental</em>. It intends
to replace <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/util/datasource/DataSource.html#"><code>DataSource</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/SourceCode.html#"><code>SourceCode</code></a> in the long term.</p>
<p>This interface will change in PMD 7 to support read/write operations
and other things. You dont need to use it in PMD 6, as <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/document/FileCollector.html#"><code>FileCollector</code></a>
decouples you from this. A file collector is available through <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PmdAnalysis.html#files()"><code>PmdAnalysis#files</code></a>.</p>
</li>
</ul>
<h4 id="6430">6.43.0</h4>
<p><strong>Deprecated API</strong></p>
<p>Some API deprecations were performed in core PMD classes, to improve compatibility with PMD 7.</p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Report.html#"><code>Report</code></a>: the constructor and other construction methods like addViolation or createReport</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleContext.html#"><code>RuleContext</code></a>: all constructors, getters and setters. A new set
of stable methods, matching those in PMD 7, was added to replace the <code class="language-plaintext highlighter-rouge">addViolation</code>
overloads of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/AbstractRule.html#"><code>AbstractRule</code></a>. In PMD 7, <code class="language-plaintext highlighter-rouge">RuleContext</code> will
be the API to report violations, and it can already be used as such in PMD 6.</li>
<li>The field <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMD.html#configuration"><code>configuration</code></a> is unused and will be removed.</li>
</ul>
<p><strong>Internal API</strong></p>
<p>Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0.
You can identify them with the <code class="language-plaintext highlighter-rouge">@InternalApi</code> annotation. Youll also get a deprecation warning.</p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSet.html#"><code>RuleSet</code></a>: methods that serve to apply rules, including <code class="language-plaintext highlighter-rouge">apply</code>, <code class="language-plaintext highlighter-rouge">start</code>, <code class="language-plaintext highlighter-rouge">end</code>, <code class="language-plaintext highlighter-rouge">removeDysfunctionalRules</code></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/renderers/AbstractAccumulatingRenderer.html#renderFileReport(Report)"><code>AbstractAccumulatingRenderer#renderFileReport</code></a> is internal API
and should not be overridden in own renderers.</li>
</ul>
<p><strong>Changed API</strong></p>
<p>It is now forbidden to report a violation:</p>
<ul>
<li>With a <code class="language-plaintext highlighter-rouge">null</code> node</li>
<li>With a <code class="language-plaintext highlighter-rouge">null</code> message</li>
<li>With a <code class="language-plaintext highlighter-rouge">null</code> set of format arguments (prefer a zero-length array)</li>
</ul>
<p>Note that the message is set from the XML rule declaration, so this is only relevant
if you instantiate rules manually.</p>
<p><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleContext.html#"><code>RuleContext</code></a> now requires setting the current rule before calling
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Rule.html#apply(java.util.List,net.sourceforge.pmd.RuleContext)"><code>apply</code></a>. This is
done automatically by <code class="language-plaintext highlighter-rouge">RuleSet#apply</code> and such. Creating and configuring a
<code class="language-plaintext highlighter-rouge">RuleContext</code> manually is strongly advised against, as the lifecycle of <code class="language-plaintext highlighter-rouge">RuleContext</code>
will change drastically in PMD 7.</p>
<h4 id="6420">6.42.0</h4>
<p>No changes.</p>
<h4 id="6410">6.41.0</h4>
<p><strong>Command Line Interface</strong></p>
<p>The command line options for PMD and CPD now use GNU-syle long options format. E.g. instead of <code class="language-plaintext highlighter-rouge">-rulesets</code> the
preferred usage is now <code class="language-plaintext highlighter-rouge">--rulesets</code>. Alternatively one can still use the short option <code class="language-plaintext highlighter-rouge">-R</code>.
Some options also have been renamed to a more consistent casing pattern at the same time
(<code class="language-plaintext highlighter-rouge">--fail-on-violation</code> instead of <code class="language-plaintext highlighter-rouge">-failOnViolation</code>).
The old single-dash options are still supported but are deprecated and will be removed with PMD 7.
This change makes the command line interface more consistent within PMD and also less surprising
compared to other cli tools.</p>
<p>The changes in detail for PMD:</p>
<table>
<thead>
<tr>
<th>old option</th>
<th>new option</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="language-plaintext highlighter-rouge">-rulesets</code></td>
<td><code class="language-plaintext highlighter-rouge">--rulesets</code> (or <code class="language-plaintext highlighter-rouge">-R</code>)</td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-uri</code></td>
<td><code class="language-plaintext highlighter-rouge">--uri</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-dir</code></td>
<td><code class="language-plaintext highlighter-rouge">--dir</code> (or <code class="language-plaintext highlighter-rouge">-d</code>)</td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-filelist</code></td>
<td><code class="language-plaintext highlighter-rouge">--file-list</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-ignorelist</code></td>
<td><code class="language-plaintext highlighter-rouge">--ignore-list</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-format</code></td>
<td><code class="language-plaintext highlighter-rouge">--format</code> (or <code class="language-plaintext highlighter-rouge">-f</code>)</td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-debug</code></td>
<td><code class="language-plaintext highlighter-rouge">--debug</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-verbose</code></td>
<td><code class="language-plaintext highlighter-rouge">--verbose</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-help</code></td>
<td><code class="language-plaintext highlighter-rouge">--help</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-encoding</code></td>
<td><code class="language-plaintext highlighter-rouge">--encoding</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-threads</code></td>
<td><code class="language-plaintext highlighter-rouge">--threads</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-benchmark</code></td>
<td><code class="language-plaintext highlighter-rouge">--benchmark</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-stress</code></td>
<td><code class="language-plaintext highlighter-rouge">--stress</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-shortnames</code></td>
<td><code class="language-plaintext highlighter-rouge">--short-names</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-showsuppressed</code></td>
<td><code class="language-plaintext highlighter-rouge">--show-suppressed</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-suppressmarker</code></td>
<td><code class="language-plaintext highlighter-rouge">--suppress-marker</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-minimumpriority</code></td>
<td><code class="language-plaintext highlighter-rouge">--minimum-priority</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-property</code></td>
<td><code class="language-plaintext highlighter-rouge">--property</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-reportfile</code></td>
<td><code class="language-plaintext highlighter-rouge">--report-file</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-force-language</code></td>
<td><code class="language-plaintext highlighter-rouge">--force-language</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-auxclasspath</code></td>
<td><code class="language-plaintext highlighter-rouge">--aux-classpath</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-failOnViolation</code></td>
<td><code class="language-plaintext highlighter-rouge">--fail-on-violation</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">--failOnViolation</code></td>
<td><code class="language-plaintext highlighter-rouge">--fail-on-violation</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-norulesetcompatibility</code></td>
<td><code class="language-plaintext highlighter-rouge">--no-ruleset-compatibility</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-cache</code></td>
<td><code class="language-plaintext highlighter-rouge">--cache</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-no-cache</code></td>
<td><code class="language-plaintext highlighter-rouge">--no-cache</code></td>
</tr>
</tbody>
</table>
<p>The changes in detail for CPD:</p>
<table>
<thead>
<tr>
<th>old option</th>
<th>new option</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="language-plaintext highlighter-rouge">--failOnViolation</code></td>
<td><code class="language-plaintext highlighter-rouge">--fail-on-violation</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">-failOnViolation</code></td>
<td><code class="language-plaintext highlighter-rouge">--fail-on-violation</code></td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">--filelist</code></td>
<td><code class="language-plaintext highlighter-rouge">--file-list</code></td>
</tr>
</tbody>
</table>
<h4 id="6400">6.40.0</h4>
<p><strong>Experimental APIs</strong></p>
<ul>
<li>The interface <a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ASTCommentContainer.html#"><code>ASTCommentContainer</code></a> has been added to the Apex AST.
It provides a way to check whether a node contains at least one comment. Currently this is only implemented for
<a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ASTCatchBlockStatement.html#"><code>ASTCatchBlockStatement</code></a> and used by the rule
<a href="pmd_rules_apex_errorprone.html#emptycatchblock"><code class="language-plaintext highlighter-rouge">EmptyCatchBlock</code></a>.
This information is also available via XPath attribute <code class="language-plaintext highlighter-rouge">@ContainsComment</code>.</li>
</ul>
<h4 id="6390">6.39.0</h4>
<p>No changes.</p>
<h4 id="6380">6.38.0</h4>
<p>No changes.</p>
<h4 id="6370">6.37.0</h4>
<p><strong>PMD CLI</strong></p>
<ul>
<li>
<p>PMD has a new CLI option <code class="language-plaintext highlighter-rouge">-force-language</code>. With that a language can be forced to be used for all input files,
irrespective of filenames. When using this option, the automatic language selection by extension is disabled
and all files are tried to be parsed with the given language. Parsing errors are ignored and unparsable files
are skipped.</p>
<p>This option allows to use the xml language for files, that dont use xml as extension.
See also the examples on <a href="pmd_userdocs_cli_reference.html#analyze-other-xml-formats">PMD CLI reference</a>.</p>
</li>
</ul>
<p><strong>Experimental APIs</strong></p>
<ul>
<li>The AST types and APIs around Sealed Classes are not experimental anymore:</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTClassOrInterfaceDeclaration.html#isSealed()"><code>ASTClassOrInterfaceDeclaration#isSealed</code></a>,
<a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTClassOrInterfaceDeclaration.html#isNonSealed()"><code>ASTClassOrInterfaceDeclaration#isNonSealed</code></a>,
<a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTClassOrInterfaceDeclaration.html#getPermittedSubclasses()"><code>ASTClassOrInterfaceDeclaration#getPermittedSubclasses</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTPermitsList.html#"><code>ASTPermitsList</code></a></li>
</ul>
<p><strong>Internal API</strong></p>
<p>Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0.
You can identify them with the <code class="language-plaintext highlighter-rouge">@InternalApi</code> annotation. Youll also get a deprecation warning.</p>
<ul>
<li>The inner class <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/TokenEntry.State.html#"><code>net.sourceforge.pmd.cpd.TokenEntry.State</code></a> is considered to be internal API.
It will probably be moved away with PMD 7.</li>
</ul>
<h4 id="6360">6.36.0</h4>
<p>No changes.</p>
<h4 id="6350">6.35.0</h4>
<p><strong>Deprecated API</strong></p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMD.html#doPMD(net.sourceforge.pmd.PMDConfiguration)"><code>PMD#doPMD</code></a> is deprecated.
Use <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMD.html#runPMD(net.sourceforge.pmd.PMDConfiguration)"><code>PMD#runPMD</code></a> instead.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMD.html#run(java.lang.String[])"><code>PMD#run</code></a> is deprecated.
Use <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMD.html#runPMD(java.lang.String...)"><code>PMD#runPMD</code></a> instead.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/ThreadSafeReportListener.html#"><code>ThreadSafeReportListener</code></a> and the methods to use them in <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Report.html#"><code>Report</code></a>
(<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Report.html#addListener(net.sourceforge.pmd.ThreadSafeReportListener)"><code>addListener</code></a>,
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Report.html#getListeners()"><code>getListeners</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Report.html#addListeners(java.util.List)"><code>addListeners</code></a>)
are deprecated. This functionality will be replaced by another TBD mechanism in PMD 7.</li>
</ul>
<h4 id="6340">6.34.0</h4>
<p>No changes.</p>
<h4 id="6330">6.33.0</h4>
<p>No changes.</p>
<h4 id="6320">6.32.0</h4>
<p><strong>Experimental APIs</strong></p>
<ul>
<li>The experimental class <code class="language-plaintext highlighter-rouge">ASTTypeTestPattern</code> has been renamed to <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTTypePattern.html#"><code>ASTTypePattern</code></a>
in order to align the naming to the JLS.</li>
<li>The experimental class <code class="language-plaintext highlighter-rouge">ASTRecordConstructorDeclaration</code> has been renamed to <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTCompactConstructorDeclaration.html#"><code>ASTCompactConstructorDeclaration</code></a>
in order to align the naming to the JLS.</li>
<li>The AST types and APIs around Pattern Matching and Records are not experimental anymore:</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTVariableDeclaratorId.html#isPatternBinding()"><code>ASTVariableDeclaratorId#isPatternBinding</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTPattern.html#"><code>ASTPattern</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTTypePattern.html#"><code>ASTTypePattern</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTRecordDeclaration.html#"><code>ASTRecordDeclaration</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTRecordComponentList.html#"><code>ASTRecordComponentList</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTRecordComponent.html#"><code>ASTRecordComponent</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTRecordBody.html#"><code>ASTRecordBody</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTCompactConstructorDeclaration.html#"><code>ASTCompactConstructorDeclaration</code></a></li>
</ul>
<p><strong>Internal API</strong></p>
<p>Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0.
You can identify them with the <code class="language-plaintext highlighter-rouge">@InternalApi</code> annotation. Youll also get a deprecation warning.</p>
<ul>
<li>The protected or public member of the Java rule <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPRule.html#"><code>AvoidUsingHardCodedIPRule</code></a>
are deprecated and considered to be internal API. They will be removed with PMD 7.</li>
</ul>
<h4 id="6310">6.31.0</h4>
<p><strong>Deprecated API</strong></p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-xml/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/xml/rule/AbstractDomXmlRule.html#"><code>AbstractDomXmlRule</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-xml/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/wsdl/rule/AbstractWsdlRule.html#"><code>AbstractWsdlRule</code></a></li>
<li>A few methods of <a href="https://docs.pmd-code.org/apidocs/pmd-xml/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/xml/rule/AbstractXmlRule.html#"><code>AbstractXmlRule</code></a></li>
</ul>
<p><strong>Experimental APIs</strong></p>
<ul>
<li>The method <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/GenericToken.html#getKind()"><code>GenericToken#getKind</code></a> has been added as experimental. This
unifies the token interface for both JavaCC and Antlr. The already existing method
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/token/AntlrToken.html#getKind()"><code>AntlrToken#getKind</code></a> is therefore experimental as well. The
returned constant depends on the actual language and might change whenever the grammar
of the language is changed.</li>
</ul>
<h4 id="6300">6.30.0</h4>
<p><strong>Deprecated API</strong></p>
<p><strong>Around RuleSet parsing</strong></p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSetFactory.html#"><code>RuleSetFactory</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RulesetsFactoryUtils.html#"><code>RulesetsFactoryUtils</code></a> have been deprecated in favor of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSetLoader.html#"><code>RuleSetLoader</code></a>. This is easier to configure, and more maintainable than the multiple overloads of <code class="language-plaintext highlighter-rouge">RulesetsFactoryUtils</code>.</li>
<li>Some static creation methods have been added to <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSet.html#"><code>RuleSet</code></a> for simple cases, eg <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSet.html#forSingleRule(net.sourceforge.pmd.Rule)"><code>forSingleRule</code></a>. These replace some counterparts in <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSetFactory.html#"><code>RuleSetFactory</code></a></li>
<li>Since <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSets.html#"><code>RuleSets</code></a> is also deprecated, many APIs that require a RuleSets instance now are deprecated, and have a counterpart that expects a <code class="language-plaintext highlighter-rouge">List&lt;RuleSet&gt;</code>.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSetReferenceId.html#"><code>RuleSetReferenceId</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSetReference.html#"><code>RuleSetReference</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSetFactoryCompatibility.html#"><code>RuleSetFactoryCompatibility</code></a> are deprecated. They are most likely not relevant outside of the implementation of pmd-core.</li>
</ul>
<p><strong>Around the <code class="language-plaintext highlighter-rouge">PMD</code> class</strong></p>
<p>Many classes around PMDs entry point (<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMD.html#"><code>PMD</code></a>) have been deprecated as internal, including:</p>
<ul>
<li>The contents of the packages <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cli/package-summary.html#"><code>net.sourceforge.pmd.cli</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/processor/package-summary.html#"><code>net.sourceforge.pmd.processor</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/SourceCodeProcessor.html#"><code>SourceCodeProcessor</code></a></li>
<li>The constructors of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/PMD.html#"><code>PMD</code></a> (the class will be made a utility class)</li>
</ul>
<p><strong>Miscellaneous</strong></p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTPackageDeclaration.html#getPackageNameImage()"><code>ASTPackageDeclaration#getPackageNameImage</code></a>,
<a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTTypeParameter.html#getParameterName()"><code>ASTTypeParameter#getParameterName</code></a>
and the corresponding XPath attributes. In both cases theyre replaced with a new method <code class="language-plaintext highlighter-rouge">getName</code>,
the attribute is <code class="language-plaintext highlighter-rouge">@Name</code>.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTClassOrInterfaceBody.html#isAnonymousInnerClass()"><code>ASTClassOrInterfaceBody#isAnonymousInnerClass</code></a>,
and <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTClassOrInterfaceBody.html#isEnumChild()"><code>ASTClassOrInterfaceBody#isEnumChild</code></a>,
refs <a href="https://github.com/pmd/pmd/issues/905">#905</a></li>
</ul>
<p><strong>Internal API</strong></p>
<p>Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0.
You can identify them with the <code class="language-plaintext highlighter-rouge">@InternalApi</code> annotation. Youll also get a deprecation warning.</p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-javascript/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ecmascript/Ecmascript3Handler.html#"><code>net.sourceforge.pmd.lang.ecmascript.Ecmascript3Handler</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-javascript/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ecmascript/Ecmascript3Parser.html#"><code>net.sourceforge.pmd.lang.ecmascript.Ecmascript3Parser</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-javascript/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ecmascript/ast/EcmascriptParser.html#parserOptions"><code>EcmascriptParser#parserOptions</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-javascript/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ecmascript/ast/EcmascriptParser.html#getSuppressMap()"><code>EcmascriptParser#getSuppressMap</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/ParametricRuleViolation.html#"><code>net.sourceforge.pmd.lang.rule.ParametricRuleViolation</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ParserOptions.html#suppressMarker"><code>ParserOptions#suppressMarker</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-modelica/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/modelica/rule/ModelicaRuleViolationFactory.html#"><code>net.sourceforge.pmd.lang.modelica.rule.ModelicaRuleViolationFactory</code></a></li>
</ul>
<h4 id="6290">6.29.0</h4>
<p>No changes.</p>
<h4 id="6280">6.28.0</h4>
<p><strong>Deprecated API</strong></p>
<p><strong>For removal</strong></p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleViolationComparator.html#"><code>net.sourceforge.pmd.RuleViolationComparator</code></a>. Use <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleViolation.html#DEFAULT_COMPARATOR"><code>RuleViolation#DEFAULT_COMPARATOR</code></a> instead.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/AbstractTokenizer.html#"><code>net.sourceforge.pmd.cpd.AbstractTokenizer</code></a>. Use <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/AnyTokenizer.html#"><code>net.sourceforge.pmd.cpd.AnyTokenizer</code></a> instead.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-fortran/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/FortranTokenizer.html#"><code>net.sourceforge.pmd.cpd.FortranTokenizer</code></a>. Was replaced by an <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/AnyTokenizer.html#"><code>AnyTokenizer</code></a>. Use <a href="https://docs.pmd-code.org/apidocs/pmd-fortran/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/FortranLanguage.html#getTokenizer()"><code>FortranLanguage#getTokenizer</code></a> anyway.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-perl/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/PerlTokenizer.html#"><code>net.sourceforge.pmd.cpd.PerlTokenizer</code></a>. Was replaced by an <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/AnyTokenizer.html#"><code>AnyTokenizer</code></a>. Use <a href="https://docs.pmd-code.org/apidocs/pmd-perl/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/PerlLanguage.html#getTokenizer()"><code>PerlLanguage#getTokenizer</code></a> anyway.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-ruby/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/RubyTokenizer.html#"><code>net.sourceforge.pmd.cpd.RubyTokenizer</code></a>. Was replaced by an <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/AnyTokenizer.html#"><code>AnyTokenizer</code></a>. Use <a href="https://docs.pmd-code.org/apidocs/pmd-ruby/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/RubyLanguage.html#getTokenizer()"><code>RubyLanguage#getTokenizer</code></a> anyway.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/RuleReference.html#getOverriddenLanguage()"><code>RuleReference#getOverriddenLanguage</code></a> and
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/RuleReference.html#setLanguage(net.sourceforge.pmd.lang.Language)"><code>RuleReference#setLanguage</code></a></li>
<li>Antlr4 generated lexers:
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-cs/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/cs/antlr4/CSharpLexer.html#"><code>net.sourceforge.pmd.lang.cs.antlr4.CSharpLexer</code></a> will be moved to package <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang.cs.ast</code> with PMD 7.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-dart/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/dart/antlr4/Dart2Lexer.html#"><code>net.sourceforge.pmd.lang.dart.antlr4.Dart2Lexer</code></a> will be renamed to <code class="language-plaintext highlighter-rouge">DartLexer</code> and moved to package
<code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang.dart.ast</code> with PMD 7. All other classes in the old package will be removed.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-go/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/go/antlr4/GolangLexer.html#"><code>net.sourceforge.pmd.lang.go.antlr4.GolangLexer</code></a> will be moved to package
<code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang.go.ast</code> with PMD 7. All other classes in the old package will be removed.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-kotlin/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/kotlin/antlr4/Kotlin.html#"><code>net.sourceforge.pmd.lang.kotlin.antlr4.Kotlin</code></a> will be renamed to <code class="language-plaintext highlighter-rouge">KotlinLexer</code> and moved to package
<code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang.kotlin.ast</code> with PMD 7.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-lua/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/lua/antlr4/LuaLexer.html#"><code>net.sourceforge.pmd.lang.lua.antlr4.LuaLexer</code></a> will be moved to package
<code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang.lua.ast</code> with PMD 7. All other classes in the old package will be removed.</li>
</ul>
</li>
</ul>
<h4 id="6270">6.27.0</h4>
<ul>
<li>XML rule definition in rulesets: In PMD 7, the <code class="language-plaintext highlighter-rouge">language</code> attribute will be required on all <code class="language-plaintext highlighter-rouge">rule</code>
elements that declare a new rule. Some base rule classes set the language implicitly in their
constructor, and so this is not required in all cases for the rule to work. But this
behavior will be discontinued in PMD 7, so missing <code class="language-plaintext highlighter-rouge">language</code> attributes are now
reported as a forward compatibility warning.</li>
</ul>
<p><strong>Deprecated API</strong></p>
<p><strong>For removal</strong></p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Rule.html#getParserOptions()"><code>Rule#getParserOptions</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/Parser.html#getParserOptions()"><code>Parser#getParserOptions</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/AbstractParser.html#"><code>AbstractParser</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleContext.html#removeAttribute(java.lang.String)"><code>RuleContext#removeAttribute</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleContext.html#getAttribute(java.lang.String)"><code>RuleContext#getAttribute</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleContext.html#setAttribute(java.lang.String,java.lang.Object)"><code>RuleContext#setAttribute</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ApexParserOptions.html#"><code>ApexParserOptions</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTThrowStatement.html#getFirstClassOrInterfaceTypeImage()"><code>ASTThrowStatement#getFirstClassOrInterfaceTypeImage</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-javascript/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ecmascript/EcmascriptParserOptions.html#"><code>EcmascriptParserOptions</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-javascript/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ecmascript/rule/EcmascriptXPathRule.html#"><code>EcmascriptXPathRule</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-xml/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/xml/XmlParserOptions.html#"><code>XmlParserOptions</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-xml/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/xml/rule/XmlXPathRule.html#"><code>XmlXPathRule</code></a></li>
<li>
<p>Properties of <a href="https://docs.pmd-code.org/apidocs/pmd-xml/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/xml/rule/AbstractXmlRule.html#"><code>AbstractXmlRule</code></a></p>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Report.ReadableDuration.html#"><code>net.sourceforge.pmd.Report.ReadableDuration</code></a></li>
<li>
<p>Many methods of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Report.html#"><code>net.sourceforge.pmd.Report</code></a>. They are replaced by accessors
that produce a List. For example, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Report.html#iterator()"><code>iterator()</code></a>
(and implementing Iterable) and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Report.html#isEmpty()"><code>isEmpty()</code></a> are both
replaced by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Report.html#getViolations()"><code>getViolations()</code></a>.</p>
</li>
<li>The dataflow codebase is deprecated for removal in PMD 7. This
includes all code in the following packages, and their subpackages:</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-plsql/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/plsql/dfa/package-summary.html#"><code>net.sourceforge.pmd.lang.plsql.dfa</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/dfa/package-summary.html#"><code>net.sourceforge.pmd.lang.java.dfa</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/dfa/package-summary.html#"><code>net.sourceforge.pmd.lang.dfa</code></a></li>
<li>
<p>and the class <a href="https://docs.pmd-code.org/apidocs/pmd-plsql/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/plsql/PLSQLDataFlowHandler.html#"><code>PLSQLDataFlowHandler</code></a></p>
</li>
<li>
<p><a href="https://docs.pmd-code.org/apidocs/pmd-visualforce/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/vf/VfSimpleCharStream.html#"><code>VfSimpleCharStream</code></a></p>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-jsp/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/jsp/ast/ASTJspDeclarations.html#"><code>ASTJspDeclarations</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-jsp/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/jsp/ast/ASTJspDocument.html#"><code>ASTJspDocument</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-scala_2.13/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/scala/ast/ScalaParserVisitorAdapter.html#zero()"><code>ScalaParserVisitorAdapter#zero</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-scala_2.13/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/scala/ast/ScalaParserVisitorAdapter.html#combine(Object,Object)"><code>ScalaParserVisitorAdapter#combine</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ApexParserVisitorReducedAdapter.html#"><code>ApexParserVisitorReducedAdapter</code></a></li>
<li>
<p><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/JavaParserVisitorReducedAdapter.html#"><code>JavaParserVisitorReducedAdapter</code></a></p>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/typeresolution/TypeHelper.html#"><code>TypeHelper</code></a> is deprecated in
favor of <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/types/TypeTestUtil.html#"><code>TypeTestUtil</code></a>, which has the
same functionality, but a slightly changed API.</li>
<li>Many of the classes in <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/symboltable/package-summary.html#"><code>net.sourceforge.pmd.lang.java.symboltable</code></a>
are deprecated as internal API.</li>
</ul>
<h4 id="6260">6.26.0</h4>
<p><strong>Deprecated API</strong></p>
<p><strong>For removal</strong></p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/RuleChainVisitor.html#"><code>RuleChainVisitor</code></a> and all implementations in language modules</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/AbstractRuleChainVisitor.html#"><code>AbstractRuleChainVisitor</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/Language.html#getRuleChainVisitorClass()"><code>Language#getRuleChainVisitorClass</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/BaseLanguageModule.html#&lt;init&gt;(java.lang.String,java.lang.String,java.lang.String,java.lang.Class,java.lang.String...)"><code>BaseLanguageModule#&lt;init&gt;</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/ImportWrapper.html#"><code>ImportWrapper</code></a></li>
</ul>
<h4 id="6250">6.25.0</h4>
<ul>
<li>
<p>The maven module <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd:pmd-scala</code> is deprecated. Use <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd:pmd-scala_2.13</code>
or <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd:pmd-scala_2.12</code> instead.</p>
</li>
<li>
<p>Rule implementation classes are internal API and should not be used by clients directly.
The rules should only be referenced via their entry in the corresponding category ruleset
(e.g. <code class="language-plaintext highlighter-rouge">&lt;rule ref="category/java/bestpractices.xml/AbstractClassWithoutAbstractMethod" /&gt;</code>).</p>
<p>While we definitely wont move or rename the rule classes in PMD 6.x, we might consider changes
in PMD 7.0.0 and onwards.</p>
</li>
</ul>
<p><strong>Deprecated APIs</strong></p>
<p><strong>Internal API</strong></p>
<p>Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0.
You can identify them with the <code class="language-plaintext highlighter-rouge">@InternalApi</code> annotation. Youll also get a deprecation warning.</p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/AbstractIgnoredAnnotationRule.html#"><code>AbstractIgnoredAnnotationRule</code></a> (Java)</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/AbstractInefficientZeroCheck.html#"><code>AbstractInefficientZeroCheck</code></a> (Java)</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/AbstractJUnitRule.html#"><code>AbstractJUnitRule</code></a> (Java)</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/AbstractJavaMetricsRule.html#"><code>AbstractJavaMetricsRule</code></a> (Java)</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/AbstractLombokAwareRule.html#"><code>AbstractLombokAwareRule</code></a> (Java)</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/AbstractPoorMethodCall.html#"><code>AbstractPoorMethodCall</code></a> (Java)</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/bestpractices/AbstractSunSecureRule.html#"><code>AbstractSunSecureRule</code></a> (Java)</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/design/AbstractNcssCountRule.html#"><code>AbstractNcssCountRule</code></a> (Java)</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/documentation/AbstractCommentRule.html#"><code>AbstractCommentRule</code></a> (Java)</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/performance/AbstractOptimizationRule.html#"><code>AbstractOptimizationRule</code></a> (Java)</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/regex/RegexHelper.html#"><code>RegexHelper</code></a> (Java)</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/rule/AbstractApexUnitTestRule.html#"><code>AbstractApexUnitTestRule</code></a> (Apex)</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/rule/design/AbstractNcssCountRule.html#"><code>AbstractNcssCountRule</code></a> (Apex)</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-plsql/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/plsql/rule/design/AbstractNcssCountRule.html#"><code>AbstractNcssCountRule</code></a> (PLSQL)</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ApexParser.html#"><code>ApexParser</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ApexHandler.html#"><code>ApexHandler</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleChain.html#"><code>RuleChain</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSets.html#"><code>RuleSets</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RulesetsFactoryUtils.html#getRuleSets(java.lang.String,net.sourceforge.pmd.RuleSetFactory)"><code>RulesetsFactoryUtils#getRuleSets</code></a></li>
</ul>
<p><strong>For removal</strong></p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/TokenEntry.html#TokenEntry(java.lang.String,java.lang.String,int)"><code>TokenEntry#TokenEntry</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-test/7.0.0-SNAPSHOT/net/sourceforge/pmd/testframework/AbstractTokenizerTest.html#"><code>AbstractTokenizerTest</code></a>. Use CpdTextComparisonTest in module pmd-lang-test instead.
For details see
<a href="pmd_devdocs_major_adding_new_cpd_language.html#testing-your-implementation">Testing your implementation</a>
in the developer documentation.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ASTAnnotation.html#suppresses(net.sourceforge.pmd.Rule)"><code>ASTAnnotation#suppresses</code></a> (Apex)</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/rule/ApexXPathRule.html#"><code>ApexXPathRule</code></a> (Apex)</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/SymbolTableTestRule.html#"><code>SymbolTableTestRule</code></a> (Java)</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingRule.html#isInStringBufferOperation(net.sourceforge.pmd.lang.ast.Node,int,java.lang.String)"><code>InefficientStringBufferingRule#isInStringBufferOperation</code></a></li>
</ul>
<h4 id="6240">6.24.0</h4>
<p><strong>Deprecated APIs</strong></p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/BaseLanguageModule.html#addVersion(String,LanguageVersionHandler,boolean)"><code>BaseLanguageModule#addVersion(String, LanguageVersionHandler, boolean)</code></a></li>
<li>Some members of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/TokenMgrError.html#"><code>TokenMgrError</code></a>, in particular, a new constructor is available
that should be preferred to the old ones</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/antlr/AntlrTokenManager/ANTLRSyntaxError.html#"><code>ANTLRSyntaxError</code></a></li>
</ul>
<p><strong>Experimental APIs</strong></p>
<p><strong>Note:</strong> Experimental APIs are identified with the annotation <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/annotation/Experimental.html#"><code>Experimental</code></a>,
see its javadoc for details</p>
<ul>
<li>The experimental methods in <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/BaseLanguageModule.html#"><code>BaseLanguageModule</code></a> have been replaced by a
definitive API.</li>
</ul>
<h4 id="6230">6.23.0</h4>
<p><strong>Deprecated APIs</strong></p>
<p><strong>Internal API</strong></p>
<p>Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0.
You can identify them with the <code class="language-plaintext highlighter-rouge">@InternalApi</code> annotation. Youll also get a deprecation warning.</p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/xpath/AbstractXPathRuleQuery.html#"><code>AbstractXPathRuleQuery</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/xpath/JaxenXPathRuleQuery.html#"><code>JaxenXPathRuleQuery</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/xpath/SaxonXPathRuleQuery.html#"><code>SaxonXPathRuleQuery</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/xpath/XPathRuleQuery.html#"><code>XPathRuleQuery</code></a></li>
</ul>
<p><strong>In ASTs</strong></p>
<p>As part of the changes wed like to do to AST classes for 7.0.0, we would like to
hide some methods and constructors that rule writers should not have access to.
The following usages are now deprecated in the <strong>Apex</strong>, <strong>Javascript</strong>, <strong>PL/SQL</strong>, <strong>Scala</strong> and <strong>Visualforce</strong> ASTs:</p>
<ul>
<li>Manual instantiation of nodes. <strong>Constructors of node classes are deprecated</strong> and
marked <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/annotation/InternalApi.html#"><code>InternalApi</code></a>. Nodes should only be obtained from the parser,
which for rules, means that they never need to instantiate node themselves.
Those constructors will be made package private with 7.0.0.</li>
<li><strong>Subclassing of abstract node classes, or usage of their type</strong>. The base classes are internal API
and will be hidden in version 7.0.0. You should not couple your code to them.</li>
<li>In the meantime you should use interfaces like <a href="https://docs.pmd-code.org/apidocs/pmd-visualforce/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/vf/ast/VfNode.html#"><code>VfNode</code></a> or
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/Node.html#"><code>Node</code></a>, or the other published interfaces in this package,
to refer to nodes generically.</li>
<li>Concrete node classes will <strong>be made final</strong> with 7.0.0.</li>
<li>Setters found in any node class or interface. <strong>Rules should consider the AST immutable</strong>.
We will make those setters package private with 7.0.0.</li>
<li>The implementation classes of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/Parser.html#"><code>Parser</code></a> (eg <a href="https://docs.pmd-code.org/apidocs/pmd-visualforce/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/vf/VfParser.html#"><code>VfParser</code></a>) are deprecated and should not be used directly.
Use <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/LanguageVersionHandler.html#getParser(ParserOptions)"><code>LanguageVersionHandler#getParser</code></a> instead.</li>
<li>The implementation classes of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/TokenManager.html#"><code>TokenManager</code></a> (eg <a href="https://docs.pmd-code.org/apidocs/pmd-visualforce/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/vf/VfTokenManager.html#"><code>VfTokenManager</code></a>) are deprecated and should not be used outside of our implementation.
<strong>This also affects CPD-only modules</strong>.</li>
</ul>
<p>These deprecations are added to the following language modules in this release.
Please look at the package documentation to find out the full list of deprecations.</p>
<ul>
<li>Apex: <strong><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/package-summary.html#"><code>net.sourceforge.pmd.lang.apex.ast</code></a></strong></li>
<li>Javascript: <strong><a href="https://docs.pmd-code.org/apidocs/pmd-javascript/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ecmascript/ast/package-summary.html#"><code>net.sourceforge.pmd.lang.ecmascript.ast</code></a></strong></li>
<li>PL/SQL: <strong><a href="https://docs.pmd-code.org/apidocs/pmd-plsql/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/plsql/ast/package-summary.html#"><code>net.sourceforge.pmd.lang.plsql.ast</code></a></strong></li>
<li>Scala: <strong><a href="https://docs.pmd-code.org/apidocs/pmd-scala_2.13/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/scala/ast/package-summary.html#"><code>net.sourceforge.pmd.lang.scala.ast</code></a></strong></li>
<li>Visualforce: <strong><a href="https://docs.pmd-code.org/apidocs/pmd-visualforce/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/vf/ast/package-summary.html#"><code>net.sourceforge.pmd.lang.vf.ast</code></a></strong></li>
</ul>
<p>These deprecations have already been rolled out in a previous version for the
following languages:</p>
<ul>
<li>Java: <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/package-summary.html#"><code>net.sourceforge.pmd.lang.java.ast</code></a></li>
<li>Java Server Pages: <a href="https://docs.pmd-code.org/apidocs/pmd-jsp/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/jsp/ast/package-summary.html#"><code>net.sourceforge.pmd.lang.jsp.ast</code></a></li>
<li>Velocity Template Language: <a href="https://docs.pmd-code.org/apidocs/pmd-vm/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/vm/ast/package-summary.html#"><code>net.sourceforge.pmd.lang.vm.ast</code></a></li>
</ul>
<p>Outside of these packages, these changes also concern the following TokenManager
implementations, and their corresponding Parser if it exists (in the same package):</p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-cpp/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/cpp/CppTokenManager.html#"><code>CppTokenManager</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/JavaTokenManager.html#"><code>JavaTokenManager</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-javascript/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ecmascript5/Ecmascript5TokenManager.html#"><code>Ecmascript5TokenManager</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-jsp/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/jsp/JspTokenManager.html#"><code>JspTokenManager</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-matlab/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/matlab/MatlabTokenManager.html#"><code>MatlabTokenManager</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-modelica/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/modelica/ModelicaTokenManager.html#"><code>ModelicaTokenManager</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-objectivec/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/objectivec/ObjectiveCTokenManager.html#"><code>ObjectiveCTokenManager</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-plsql/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/plsql/PLSQLTokenManager.html#"><code>PLSQLTokenManager</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-python/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/python/PythonTokenManager.html#"><code>PythonTokenManager</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-visualforce/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/vf/VfTokenManager.html#"><code>VfTokenManager</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-vm/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/vm/VmTokenManager.html#"><code>VmTokenManager</code></a></li>
</ul>
<p>In the <strong>Java AST</strong> the following attributes are deprecated and will issue a warning when used in XPath rules:</p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTAdditiveExpression.html#getImage()"><code>ASTAdditiveExpression#getImage</code></a> - use <code class="language-plaintext highlighter-rouge">getOperator()</code> instead</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTVariableDeclaratorId.html#getImage()"><code>ASTVariableDeclaratorId#getImage</code></a> - use <code class="language-plaintext highlighter-rouge">getName()</code> instead</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTVariableDeclaratorId.html#getVariableName()"><code>ASTVariableDeclaratorId#getVariableName</code></a> - use <code class="language-plaintext highlighter-rouge">getName()</code> instead</li>
</ul>
<p><strong>For removal</strong></p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/Parser.html#getTokenManager(java.lang.String,java.io.Reader)"><code>Parser#getTokenManager</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/TokenManager.html#setFileName(java.lang.String)"><code>TokenManager#setFileName</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/AbstractTokenManager.html#setFileName(java.lang.String)"><code>AbstractTokenManager#setFileName</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/AbstractTokenManager.html#getFileName(java.lang.String)"><code>AbstractTokenManager#getFileName</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/token/AntlrToken.html#getType()"><code>AntlrToken#getType</code></a> - use <code class="language-plaintext highlighter-rouge">getKind()</code> instead.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/ImmutableLanguage.html#"><code>ImmutableLanguage</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/MockRule.html#"><code>MockRule</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/Node.html#getFirstParentOfAnyType(java.lang.Class[])"><code>Node#getFirstParentOfAnyType</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/Node.html#getAsDocument()"><code>Node#getAsDocument</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/AbstractNode.html#hasDescendantOfAnyType(java.lang.Class[])"><code>AbstractNode#hasDescendantOfAnyType</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTRecordDeclaration.html#getComponentList()"><code>ASTRecordDeclaration#getComponentList</code></a></li>
<li>Multiple fields, constructors and methods in <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/XPathRule.html#"><code>XPathRule</code></a>. See javadoc for details.</li>
</ul>
<h4 id="6220">6.22.0</h4>
<p><strong>Deprecated APIs</strong></p>
<p><strong>Internal API</strong></p>
<p>Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0.
You can identify them with the <code class="language-plaintext highlighter-rouge">@InternalApi</code> annotation. Youll also get a deprecation warning.</p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/JavaLanguageHandler.html#"><code>JavaLanguageHandler</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/JavaLanguageParser.html#"><code>JavaLanguageParser</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/JavaDataFlowHandler.html#"><code>JavaDataFlowHandler</code></a></li>
<li>Implementations of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/RuleViolationFactory.html#"><code>RuleViolationFactory</code></a> in each
language module, eg <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/JavaRuleViolationFactory.html#"><code>JavaRuleViolationFactory</code></a>.
See javadoc of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/RuleViolationFactory.html#"><code>RuleViolationFactory</code></a>.</li>
<li>
<p>Implementations of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleViolation.html#"><code>RuleViolation</code></a> in each language module,
eg <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/JavaRuleViolation.html#"><code>JavaRuleViolation</code></a>. See javadoc of
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleViolation.html#"><code>RuleViolation</code></a>.</p>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/rules/RuleFactory.html#"><code>RuleFactory</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/rules/RuleBuilder.html#"><code>RuleBuilder</code></a></li>
<li>Constructors of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSetFactory.html#"><code>RuleSetFactory</code></a>, use factory methods from <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RulesetsFactoryUtils.html#"><code>RulesetsFactoryUtils</code></a> instead</li>
<li>
<p><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RulesetsFactoryUtils.html#getRulesetFactory(net.sourceforge.pmd.PMDConfiguration,net.sourceforge.pmd.util.ResourceLoader)"><code>getRulesetFactory</code></a></p>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/AbstractApexNode.html#"><code>AbstractApexNode</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/AbstractApexNodeBase.html#"><code>AbstractApexNodeBase</code></a>, and the related <code class="language-plaintext highlighter-rouge">visit</code>
methods on <a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ApexParserVisitor.html#"><code>ApexParserVisitor</code></a> and its implementations.
Use <a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ApexNode.html#"><code>ApexNode</code></a> instead, now considers comments too.</li>
</ul>
<p><strong>For removal</strong></p>
<ul>
<li>pmd-core
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/dfa/DFAGraphRule.html#"><code>DFAGraphRule</code></a> and its implementations</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/dfa/DFAGraphMethod.html#"><code>DFAGraphMethod</code></a></li>
<li>Many methods on the <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/Node.html#"><code>Node</code></a> interface
and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/AbstractNode.html#"><code>AbstractNode</code></a> base class. See their javadoc for details.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/Node.html#isFindBoundary()"><code>Node#isFindBoundary</code></a> is deprecated for XPath queries.</li>
<li>Many APIs of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/metrics/package-summary.html#"><code>net.sourceforge.pmd.lang.metrics</code></a>, though most of them were internal and
probably not used directly outside of PMD. Use <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/metrics/MetricsUtil.html#"><code>MetricsUtil</code></a> as
a replacement for the language-specific façades too.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/QualifiableNode.html#"><code>QualifiableNode</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/QualifiedName.html#"><code>QualifiedName</code></a></li>
</ul>
</li>
<li>pmd-java
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/AbstractJavaParser.html#"><code>AbstractJavaParser</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/AbstractJavaHandler.html#"><code>AbstractJavaHandler</code></a></li>
<li><a href="https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.21.0/net/sourceforge/pmd/lang/java/ast/ASTAnyTypeDeclaration.TypeKind.html"><code class="language-plaintext highlighter-rouge">ASTAnyTypeDeclaration.TypeKind</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTAnyTypeDeclaration.html#getKind()"><code>ASTAnyTypeDeclaration#getKind</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/JavaQualifiedName.html#"><code>JavaQualifiedName</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTCatchStatement.html#getBlock()"><code>ASTCatchStatement#getBlock</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.html#declarationsAreInDefaultPackage()"><code>ASTCompilationUnit#declarationsAreInDefaultPackage</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/JavaQualifiableNode.html#"><code>JavaQualifiableNode</code></a>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTAnyTypeDeclaration.html#getQualifiedName()"><code>ASTAnyTypeDeclaration#getQualifiedName</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTMethodOrConstructorDeclaration.html#getQualifiedName()"><code>ASTMethodOrConstructorDeclaration#getQualifiedName</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpression.html#getQualifiedName()"><code>ASTLambdaExpression#getQualifiedName</code></a></li>
</ul>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/qname/package-summary.html#"><code>net.sourceforge.pmd.lang.java.qname</code></a> and its contents</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/MethodLikeNode.html#"><code>MethodLikeNode</code></a>
<ul>
<li>Its methods will also be removed from its implementations,
<a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTMethodOrConstructorDeclaration.html#"><code>ASTMethodOrConstructorDeclaration</code></a>,
<a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpression.html#"><code>ASTLambdaExpression</code></a>.</li>
</ul>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTAnyTypeDeclaration.html#getImage()"><code>ASTAnyTypeDeclaration#getImage</code></a> will be removed. Please use <code class="language-plaintext highlighter-rouge">getSimpleName()</code>
instead. This affects <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTAnnotationTypeDeclaration.html#getImage()"><code>ASTAnnotationTypeDeclaration#getImage</code></a>,
<a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTClassOrInterfaceDeclaration.html#getImage()"><code>ASTClassOrInterfaceDeclaration#getImage</code></a>, and
<a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTEnumDeclaration.html#getImage()"><code>ASTEnumDeclaration#getImage</code></a>.</li>
<li>Several methods of <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTTryStatement.html#"><code>ASTTryStatement</code></a>, replacements with other names
have been added. This includes the XPath attribute <code class="language-plaintext highlighter-rouge">@Finally</code>, replace it with a test for <code class="language-plaintext highlighter-rouge">child::FinallyStatement</code>.</li>
<li>Several methods named <code class="language-plaintext highlighter-rouge">getGuardExpressionNode</code> are replaced with <code class="language-plaintext highlighter-rouge">getCondition</code>. This affects the
following nodes: WhileStatement, DoStatement, ForStatement, IfStatement, AssertStatement, ConditionalExpression.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTYieldStatement.html#"><code>ASTYieldStatement</code></a> will not implement <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/TypeNode.html#"><code>TypeNode</code></a>
anymore come 7.0.0. Test the type of the expression nested within it.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/metrics/JavaMetrics.html#"><code>JavaMetrics</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/metrics/JavaMetricsComputer.html#"><code>JavaMetricsComputer</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTArguments.html#getArgumentCount()"><code>ASTArguments#getArgumentCount</code></a>.
Use <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTArguments.html#size()"><code>size</code></a> instead.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTFormalParameters.html#getParameterCount()"><code>ASTFormalParameters#getParameterCount</code></a>.
Use <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTFormalParameters.html#size()"><code>size</code></a> instead.</li>
</ul>
</li>
<li>pmd-apex
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/metrics/ApexMetrics.html#"><code>ApexMetrics</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/metrics/ApexMetricsComputer.html#"><code>ApexMetricsComputer</code></a></li>
</ul>
</li>
</ul>
<p><strong>In ASTs (JSP)</strong></p>
<p>As part of the changes wed like to do to AST classes for 7.0.0, we would like to
hide some methods and constructors that rule writers should not have access to.
The following usages are now deprecated <strong>in the JSP AST</strong> (with other languages to come):</p>
<ul>
<li>Manual instantiation of nodes. <strong>Constructors of node classes are deprecated</strong> and
marked <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/annotation/InternalApi.html#"><code>InternalApi</code></a>. Nodes should only be obtained from the parser,
which for rules, means that they never need to instantiate node themselves.
Those constructors will be made package private with 7.0.0.</li>
<li><strong>Subclassing of abstract node classes, or usage of their type</strong>. The base classes are internal API
and will be hidden in version 7.0.0. You should not couple your code to them.</li>
<li>In the meantime you should use interfaces like <a href="https://docs.pmd-code.org/apidocs/pmd-jsp/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/jsp/ast/JspNode.html#"><code>JspNode</code></a> or
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/Node.html#"><code>Node</code></a>, or the other published interfaces in this package,
to refer to nodes generically.</li>
<li>Concrete node classes will <strong>be made final</strong> with 7.0.0.</li>
<li>Setters found in any node class or interface. <strong>Rules should consider the AST immutable</strong>.
We will make those setters package private with 7.0.0.</li>
<li>The class <a href="https://docs.pmd-code.org/apidocs/pmd-jsp/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/jsp/JspParser.html#"><code>JspParser</code></a> is deprecated and should not be used directly.
Use <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/LanguageVersionHandler.html#getParser(ParserOptions)"><code>LanguageVersionHandler#getParser</code></a> instead.</li>
</ul>
<p>Please look at <a href="https://docs.pmd-code.org/apidocs/pmd-jsp/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/jsp/ast/package-summary.html#"><code>net.sourceforge.pmd.lang.jsp.ast</code></a> to find out the full list of deprecations.</p>
<p><strong>In ASTs (Velocity)</strong></p>
<p>As part of the changes wed like to do to AST classes for 7.0.0, we would like to
hide some methods and constructors that rule writers should not have access to.
The following usages are now deprecated <strong>in the VM AST</strong> (with other languages to come):</p>
<ul>
<li>Manual instantiation of nodes. <strong>Constructors of node classes are deprecated</strong> and
marked <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/annotation/InternalApi.html#"><code>InternalApi</code></a>. Nodes should only be obtained from the parser,
which for rules, means that they never need to instantiate node themselves.
Those constructors will be made package private with 7.0.0.</li>
<li><strong>Subclassing of abstract node classes, or usage of their type</strong>. The base classes are internal API
and will be hidden in version 7.0.0. You should not couple your code to them.</li>
<li>In the meantime you should use interfaces like <a href="https://docs.pmd-code.org/apidocs/pmd-vm/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/vm/ast/VmNode.html#"><code>VmNode</code></a> or
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/Node.html#"><code>Node</code></a>, or the other published interfaces in this package,
to refer to nodes generically.</li>
<li>Concrete node classes will <strong>be made final</strong> with 7.0.0.</li>
<li>Setters found in any node class or interface. <strong>Rules should consider the AST immutable</strong>.
We will make those setters package private with 7.0.0.</li>
<li>The package <a href="https://docs.pmd-code.org/apidocs/pmd-vm/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/vm/directive/package-summary.html#"><code>net.sourceforge.pmd.lang.vm.directive</code></a> as well as the classes
<a href="https://docs.pmd-code.org/apidocs/pmd-vm/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/vm/util/DirectiveMapper.html#"><code>DirectiveMapper</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-vm/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/vm/util/LogUtil.html#"><code>LogUtil</code></a> are deprecated
for removal. They were only used internally during parsing.</li>
<li>The class <a href="https://docs.pmd-code.org/apidocs/pmd-vm/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/vm/VmParser.html#"><code>VmParser</code></a> is deprecated and should not be used directly.
Use <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/LanguageVersionHandler.html#getParser(ParserOptions)"><code>LanguageVersionHandler#getParser</code></a> instead.</li>
</ul>
<p>Please look at <a href="https://docs.pmd-code.org/apidocs/pmd-vm/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/vm/ast/package-summary.html#"><code>net.sourceforge.pmd.lang.vm.ast</code></a> to find out the full list of deprecations.</p>
<p><strong>PLSQL AST</strong></p>
<p>The production and node <code class="language-plaintext highlighter-rouge">ASTCursorBody</code> was unnecessary, not used and has been removed. Cursors have been already
parsed as <code class="language-plaintext highlighter-rouge">ASTCursorSpecification</code>.</p>
<h4 id="6210">6.21.0</h4>
<p><strong>Deprecated APIs</strong></p>
<p><strong>Internal API</strong></p>
<p>Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0.
You can identify them with the <code class="language-plaintext highlighter-rouge">@InternalApi</code> annotation. Youll also get a deprecation warning.</p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/JavaLanguageHandler.html#"><code>JavaLanguageHandler</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/JavaLanguageParser.html#"><code>JavaLanguageParser</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/JavaDataFlowHandler.html#"><code>JavaDataFlowHandler</code></a></li>
<li>Implementations of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/RuleViolationFactory.html#"><code>RuleViolationFactory</code></a> in each
language module, eg <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/JavaRuleViolationFactory.html#"><code>JavaRuleViolationFactory</code></a>.
See javadoc of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/RuleViolationFactory.html#"><code>RuleViolationFactory</code></a>.</li>
<li>
<p>Implementations of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleViolation.html#"><code>RuleViolation</code></a> in each language module,
eg <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/JavaRuleViolation.html#"><code>JavaRuleViolation</code></a>. See javadoc of
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleViolation.html#"><code>RuleViolation</code></a>.</p>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/rules/RuleFactory.html#"><code>RuleFactory</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/rules/RuleBuilder.html#"><code>RuleBuilder</code></a></li>
<li>Constructors of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSetFactory.html#"><code>RuleSetFactory</code></a>, use factory methods from <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RulesetsFactoryUtils.html#"><code>RulesetsFactoryUtils</code></a> instead</li>
<li>
<p><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RulesetsFactoryUtils.html#getRulesetFactory(net.sourceforge.pmd.PMDConfiguration,net.sourceforge.pmd.util.ResourceLoader)"><code>getRulesetFactory</code></a></p>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/AbstractApexNode.html#"><code>AbstractApexNode</code></a></li>
<li>
<p><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/AbstractApexNodeBase.html#"><code>AbstractApexNodeBase</code></a>, and the related <code class="language-plaintext highlighter-rouge">visit</code>
methods on <a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ApexParserVisitor.html#"><code>ApexParserVisitor</code></a> and its implementations.
Use <a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ApexNode.html#"><code>ApexNode</code></a> instead, now considers comments too.</p>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/CharStream.html#"><code>CharStream</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/JavaCharStream.html#"><code>JavaCharStream</code></a>,
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/SimpleCharStream.html#"><code>SimpleCharStream</code></a>: these are APIs used by our JavaCC
implementations and that will be moved/refactored for PMD 7.0.0. They should not
be used, extended or implemented directly.</li>
<li>All classes generated by JavaCC, eg <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/JJTJavaParserState.html#"><code>JJTJavaParserState</code></a>.
This includes token classes, which will be replaced with a single implementation, and
subclasses of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/ParseException.html#"><code>ParseException</code></a>, whose usages will be replaced
by just that superclass.</li>
</ul>
<p><strong>For removal</strong></p>
<ul>
<li>pmd-core
<ul>
<li>Many methods on the <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/Node.html#"><code>Node</code></a> interface
and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/AbstractNode.html#"><code>AbstractNode</code></a> base class. See their javadoc for details.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/Node.html#isFindBoundary()"><code>Node#isFindBoundary</code></a> is deprecated for XPath queries.</li>
</ul>
</li>
<li>pmd-java
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/AbstractJavaParser.html#"><code>AbstractJavaParser</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/AbstractJavaHandler.html#"><code>AbstractJavaHandler</code></a></li>
<li><a href="https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.21.0/net/sourceforge/pmd/lang/java/ast/ASTAnyTypeDeclaration.TypeKind.html"><code class="language-plaintext highlighter-rouge">ASTAnyTypeDeclaration.TypeKind</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTAnyTypeDeclaration.html#getKind()"><code>ASTAnyTypeDeclaration#getKind</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/JavaQualifiedName.html#"><code>JavaQualifiedName</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTCatchStatement.html#getBlock()"><code>ASTCatchStatement#getBlock</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.html#declarationsAreInDefaultPackage()"><code>ASTCompilationUnit#declarationsAreInDefaultPackage</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/JavaQualifiableNode.html#"><code>JavaQualifiableNode</code></a>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTAnyTypeDeclaration.html#getQualifiedName()"><code>ASTAnyTypeDeclaration#getQualifiedName</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTMethodOrConstructorDeclaration.html#getQualifiedName()"><code>ASTMethodOrConstructorDeclaration#getQualifiedName</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpression.html#getQualifiedName()"><code>ASTLambdaExpression#getQualifiedName</code></a></li>
</ul>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/qname/package-summary.html#"><code>net.sourceforge.pmd.lang.java.qname</code></a> and its contents</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/MethodLikeNode.html#"><code>MethodLikeNode</code></a>
<ul>
<li>Its methods will also be removed from its implementations,
<a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTMethodOrConstructorDeclaration.html#"><code>ASTMethodOrConstructorDeclaration</code></a>,
<a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpression.html#"><code>ASTLambdaExpression</code></a>.</li>
</ul>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTAnyTypeDeclaration.html#getImage()"><code>ASTAnyTypeDeclaration#getImage</code></a> will be removed. Please use <code class="language-plaintext highlighter-rouge">getSimpleName()</code>
instead. This affects <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTAnnotationTypeDeclaration.html#getImage()"><code>ASTAnnotationTypeDeclaration#getImage</code></a>,
<a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTClassOrInterfaceDeclaration.html#getImage()"><code>ASTClassOrInterfaceDeclaration#getImage</code></a>, and
<a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTEnumDeclaration.html#getImage()"><code>ASTEnumDeclaration#getImage</code></a>.</li>
<li>Several methods of <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTTryStatement.html#"><code>ASTTryStatement</code></a>, replacements with other names
have been added. This includes the XPath attribute <code class="language-plaintext highlighter-rouge">@Finally</code>, replace it with a test for <code class="language-plaintext highlighter-rouge">child::FinallyStatement</code>.</li>
<li>Several methods named <code class="language-plaintext highlighter-rouge">getGuardExpressionNode</code> are replaced with <code class="language-plaintext highlighter-rouge">getCondition</code>. This affects the
following nodes: WhileStatement, DoStatement, ForStatement, IfStatement, AssertStatement, ConditionalExpression.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTYieldStatement.html#"><code>ASTYieldStatement</code></a> will not implement <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/TypeNode.html#"><code>TypeNode</code></a>
anymore come 7.0.0. Test the type of the expression nested within it.</li>
</ul>
</li>
</ul>
<h4 id="6200">6.20.0</h4>
<p>No changes.</p>
<h4 id="6190">6.19.0</h4>
<p><strong>Deprecated APIs</strong></p>
<p><strong>For removal</strong></p>
<ul>
<li>pmd-core
<ul>
<li>All the package <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/dcd/package-summary.html#"><code>net.sourceforge.pmd.dcd</code></a> and its subpackages. See <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/dcd/DCD.html#"><code>DCD</code></a>.</li>
<li>In <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/LanguageRegistry.html#"><code>LanguageRegistry</code></a>:
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/LanguageRegistry.html#commaSeparatedTerseNamesForLanguageVersion(List)"><code>commaSeparatedTerseNamesForLanguageVersion</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/LanguageRegistry.html#commaSeparatedTerseNamesForLanguage(List)"><code>commaSeparatedTerseNamesForLanguage</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/LanguageRegistry.html#findAllVersions()"><code>findAllVersions</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/LanguageRegistry.html#findLanguageVersionByTerseName(String)"><code>findLanguageVersionByTerseName</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/LanguageRegistry.html#getInstance()"><code>getInstance</code></a></li>
</ul>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSet.html#getExcludePatterns()"><code>RuleSet#getExcludePatterns</code></a>. Use the new method <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSet.html#getFileExclusions()"><code>getFileExclusions</code></a> instead.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSet.html#getIncludePatterns()"><code>RuleSet#getIncludePatterns</code></a>. Use the new method <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSet.html#getFileInclusions()"><code>getFileInclusions</code></a> instead.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/Parser.html#canParse()"><code>Parser#canParse</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/Parser.html#getSuppressMap()"><code>Parser#getSuppressMap</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/rules/RuleBuilder.html#RuleBuilder(String,String,String)"><code>RuleBuilder#RuleBuilder</code></a>. Use the new constructor with the correct ResourceLoader instead.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/rules/RuleFactory.html#RuleFactory()"><code>RuleFactory#RuleFactory</code></a>. Use the new constructor with the correct ResourceLoader instead.</li>
</ul>
</li>
<li>pmd-java
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/CanSuppressWarnings.html#"><code>CanSuppressWarnings</code></a> and its implementations</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/AbstractJavaRule.html#isSuppressed(Node)"><code>isSuppressed</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/AbstractJavaRule.html#getDeclaringType(Node)"><code>getDeclaringType</code></a>.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/JavaRuleViolation.html#isSupressed(Node,Rule)"><code>isSupressed</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarator.html#"><code>ASTMethodDeclarator</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclaration.html#getMethodName()"><code>getMethodName</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclaration.html#getBlock()"><code>getBlock</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTConstructorDeclaration.html#getParameterCount()"><code>getParameterCount</code></a></li>
</ul>
</li>
<li>pmd-apex
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/CanSuppressWarnings.html#"><code>CanSuppressWarnings</code></a> and its implementations</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/rule/ApexRuleViolation.html#isSupressed(Node,Rule)"><code>isSupressed</code></a></li>
</ul>
</li>
</ul>
<p><strong>Internal APIs</strong></p>
<ul>
<li>pmd-core
<ul>
<li>All the package <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/util/package-summary.html#"><code>net.sourceforge.pmd.util</code></a> and its subpackages,
except <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/util/datasource/package-summary.html#"><code>net.sourceforge.pmd.util.datasource</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/util/database/package-summary.html#"><code>net.sourceforge.pmd.util.database</code></a>.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cpd/GridBagHelper.html#"><code>GridBagHelper</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/renderers/ColumnDescriptor.html#"><code>ColumnDescriptor</code></a></li>
</ul>
</li>
</ul>
<h4 id="6180">6.18.0</h4>
<p><strong>Changes to Renderer</strong></p>
<ul>
<li>
<p>Each renderer has now a new method <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/renderers/Renderer.html#setUseShortNames(List)"><code>Renderer#setUseShortNames</code></a> which
is used for implementing the “shortnames” CLI option. The method is automatically called by PMD, if this
CLI option is in use. When rendering filenames to the report, the new helper method
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/renderers/AbstractRenderer.html#determineFileName(String)"><code>AbstractRenderer#determineFileName</code></a> should be used. This will change
the filename to a short name, if the CLI option “shortnames” is used.</p>
<p>Not adjusting custom renderers will make them render always the full file names and not honoring the
CLI option “shortnames”.</p>
</li>
</ul>
<p><strong>Deprecated APIs</strong></p>
<p><strong>For removal</strong></p>
<ul>
<li>The methods <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTImportDeclaration.html#getImportedNameNode()"><code>getImportedNameNode</code></a> and
<a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTImportDeclaration.html#getPackage()"><code>getPackage</code></a> have been deprecated and
will be removed with PMD 7.0.0.</li>
<li>The method <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleContext.html#setSourceCodeFilename(String)"><code>RuleContext#setSourceCodeFilename</code></a> has been deprecated
and will be removed. The already existing method <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleContext.html#setSourceCodeFile(File)"><code>RuleContext#setSourceCodeFile</code></a>
should be used instead. The method <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleContext.html#getSourceCodeFilename()"><code>RuleContext#getSourceCodeFilename</code></a> still
exists and returns just the filename without the full path.</li>
<li>The method <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/processor/AbstractPMDProcessor.html#filenameFrom(DataSource)"><code>AbstractPMDProcessor#filenameFrom</code></a> has been
deprecated. It was used to determine a “short name” of the file being analyzed, so that the report
can use short names. However, this logic has been moved to the renderers.</li>
<li>The method <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Report.html#metrics()"><code>Report#metrics</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Report.html#"><code>Report</code></a> have
been deprecated. They were leftovers from a previous deprecation round targeting
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/stat/StatisticalRule.html#"><code>StatisticalRule</code></a>.</li>
</ul>
<p><strong>Internal APIs</strong></p>
<p>Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0. You can identify them with the <code class="language-plaintext highlighter-rouge">@InternalApi</code> annotation. Youll also get a deprecation warning.</p>
<ul>
<li>pmd-core
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/cache/package-summary.html#"><code>net.sourceforge.pmd.cache</code></a></li>
</ul>
</li>
<li>pmd-java
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/typeresolution/package-summary.html#"><code>net.sourceforge.pmd.lang.java.typeresolution</code></a>: Everything, including
subpackages, except <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/typeresolution/TypeHelper.html#"><code>TypeHelper</code></a> and
<a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/typeresolution/typedefinition/JavaTypeDefinition.html#"><code>JavaTypeDefinition</code></a>.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.html#getClassTypeResolver()"><code>ASTCompilationUnit#getClassTypeResolver</code></a></li>
</ul>
</li>
</ul>
<h4 id="6170">6.17.0</h4>
<p>No changes.</p>
<h4 id="6160">6.16.0</h4>
<p><strong>Deprecated APIs</strong></p>
<blockquote>
<p>Reminder: Please dont use members marked with the annotation <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/annotation/InternalApi.html#"><code>InternalApi</code></a>, as they will likely be removed, hidden, or otherwise intentionally broken with 7.0.0.</p>
</blockquote>
<p><strong>In ASTs</strong></p>
<p>As part of the changes wed like to do to AST classes for 7.0.0, we would like to
hide some methods and constructors that rule writers should not have access to.
The following usages are now deprecated <strong>in the Java AST</strong> (with other languages to come):</p>
<ul>
<li>Manual instantiation of nodes. <strong>Constructors of node classes are deprecated</strong> and marked <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/annotation/InternalApi.html#"><code>InternalApi</code></a>. Nodes should only be obtained from the parser, which for rules, means that never need to instantiate node themselves. Those constructors will be made package private with 7.0.0.</li>
<li><strong>Subclassing of abstract node classes, or usage of their type</strong>. Version 7.0.0 will bring a new set of abstractions that will be public API, but the base classes are and will stay internal. You should not couple your code to them.
<ul>
<li>In the meantime you should use interfaces like <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/JavaNode.html#"><code>JavaNode</code></a> or <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/Node.html#"><code>Node</code></a>, or the other published interfaces in this package, to refer to nodes generically.</li>
<li>Concrete node classes will <strong>be made final</strong> with 7.0.0.</li>
</ul>
</li>
<li>Setters found in any node class or interface. <strong>Rules should consider the AST immutable</strong>. We will make those setters package private with 7.0.0.</li>
</ul>
<p>Please look at <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/package-summary.html#"><code>net.sourceforge.pmd.lang.java.ast</code></a> to find out the full list
of deprecations.</p>
<h4 id="6150">6.15.0</h4>
<p><strong>Deprecated APIs</strong></p>
<p><strong>For removal</strong></p>
<ul>
<li>The <code class="language-plaintext highlighter-rouge">DumpFacades</code> in all languages, that could be used to transform a AST into a textual representation,
will be removed with PMD 7. The rule designer is a better way to inspect nodes.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/DumpFacade.html#"><code>net.sourceforge.pmd.lang.apex.ast.DumpFacade</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/DumpFacade.html#"><code>net.sourceforge.pmd.lang.java.ast.DumpFacade</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-javascript/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ecmascript/ast/DumpFacade.html#"><code>net.sourceforge.pmd.lang.ecmascript.ast.DumpFacade</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-jsp/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/jsp/ast/DumpFacade.html#"><code>net.sourceforge.pmd.lang.jsp.ast.DumpFacade</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-plsql/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/plsql/ast/DumpFacade.html#"><code>net.sourceforge.pmd.lang.plsql.ast.DumpFacade</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-visualforce/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/vf/ast/DumpFacade.html#"><code>net.sourceforge.pmd.lang.vf.ast.DumpFacade</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-vm/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/vm/ast/AbstractVmNode.html#dump(String,boolean,Writer)"><code>net.sourceforge.pmd.lang.vm.ast.AbstractVmNode#dump</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-xml/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/xml/ast/DumpFacade.html#"><code>net.sourceforge.pmd.lang.xml.ast.DumpFacade</code></a></li>
<li>The method <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/LanguageVersionHandler.html#getDumpFacade(Writer,String,boolean)"><code>LanguageVersionHandler#getDumpFacade</code></a> will be
removed as well. It is deprecated, along with all its implementations in the subclasses of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/LanguageVersionHandler.html#"><code>LanguageVersionHandler</code></a>.</li>
</ul>
<h4 id="6140">6.14.0</h4>
<p>No changes.</p>
<h4 id="6130">6.13.0</h4>
<p><strong>Command Line Interface</strong></p>
<p>The start scripts <code class="language-plaintext highlighter-rouge">run.sh</code>, <code class="language-plaintext highlighter-rouge">pmd.bat</code> and <code class="language-plaintext highlighter-rouge">cpd.bat</code> support the new environment variable <code class="language-plaintext highlighter-rouge">PMD_JAVA_OPTS</code>.
This can be used to set arbitrary JVM options for running PMD, such as memory settings (e.g. <code class="language-plaintext highlighter-rouge">PMD_JAVA_OPTS=-Xmx512m</code>)
or enable preview language features (e.g. <code class="language-plaintext highlighter-rouge">PMD_JAVA_OPTS=--enable-preview</code>).</p>
<p>The previously available variables such as <code class="language-plaintext highlighter-rouge">OPTS</code> or <code class="language-plaintext highlighter-rouge">HEAPSIZE</code> are deprecated and will be removed with PMD 7.0.0.</p>
<p><strong>Deprecated API</strong></p>
<ul>
<li>
<p><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/renderers/CodeClimateRule.html#"><code>CodeClimateRule</code></a> is deprecated in 7.0.0 because it was unused for 2 years and
created an unwanted dependency.
Properties “cc_categories”, “cc_remediation_points_multiplier”, “cc_block_highlighting” will also be removed.
See <a href="https://github.com/pmd/pmd/pull/1702">#1702</a> for more.</p>
</li>
<li>
<p>The Apex ruleset <code class="language-plaintext highlighter-rouge">rulesets/apex/ruleset.xml</code> has been deprecated and will be removed in 7.0.0. Please use the new
quickstart ruleset <code class="language-plaintext highlighter-rouge">rulesets/apex/quickstart.xml</code> instead.</p>
</li>
</ul>
<h4 id="6120">6.12.0</h4>
<p>No changes.</p>
<h4 id="6110">6.11.0</h4>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/stat/StatisticalRule.html#"><code>StatisticalRule</code></a> and the related helper classes and base rule classes
are deprecated for removal in 7.0.0. This includes all of <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/stat/package-summary.html#"><code>net.sourceforge.pmd.stat</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/rule/stat/package-summary.html#"><code>net.sourceforge.pmd.lang.rule.stat</code></a>,
and also <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/rule/AbstractStatisticalJavaRule.html#"><code>AbstractStatisticalJavaRule</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/rule/AbstractStatisticalApexRule.html#"><code>AbstractStatisticalApexRule</code></a> and the like.
The methods <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Report.html#addMetric(net.sourceforge.pmd.stat.Metric)"><code>Report#addMetric</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/ThreadSafeReportListener.html#metricAdded(net.sourceforge.pmd.stat.Metric)"><code>metricAdded</code></a>
will also be removed.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertySource.html#setProperty(net.sourceforge.pmd.properties.MultiValuePropertyDescriptor,Object[])"><code>setProperty</code></a> is deprecated,
because <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/MultiValuePropertyDescriptor.html#"><code>MultiValuePropertyDescriptor</code></a> is deprecated as well</li>
</ul>
<h4 id="6100">6.10.0</h4>
<p><strong>Properties framework</strong></p>
<p>The properties framework is about to get a lifting, and for that reason, we need to deprecate a lot of APIs
to remove them in 7.0.0. The proposed changes to the API are described <a href="https://github.com/pmd/pmd/wiki/Property-framework-7-0-0">on the wiki</a></p>
<p><strong>Changes to how you define properties</strong></p>
<ul>
<li>
<p>Construction of property descriptors has been possible through builders since 6.0.0. The 7.0.0 API will only allow
construction through builders. The builder hierarchy, currently found in the package <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/builders/package-summary.html#"><code>net.sourceforge.pmd.properties.builders</code></a>,
is being replaced by the simpler <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyBuilder.html#"><code>PropertyBuilder</code></a>. Their APIs enjoy a high degree of source compatibility.</p>
</li>
<li>
<p>Concrete property classes like <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/IntegerProperty.html#"><code>IntegerProperty</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/StringMultiProperty.html#"><code>StringMultiProperty</code></a> will gradually
all be deprecated until 7.0.0. Their usages should be replaced by direct usage of the <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyDescriptor.html#"><code>PropertyDescriptor</code></a>
interface, e.g. <code class="language-plaintext highlighter-rouge">PropertyDescriptor&lt;Integer&gt;</code> or <code class="language-plaintext highlighter-rouge">PropertyDescriptor&lt;List&lt;String&gt;&gt;</code>.</p>
</li>
<li>
<p>Instead of spreading properties across countless classes, the utility class <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyFactory.html#"><code>PropertyFactory</code></a> will become
from 7.0.0 on the only provider for property descriptor builders. Each current property type will be replaced
by a corresponding method on <code class="language-plaintext highlighter-rouge">PropertyFactory</code>:</p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/IntegerProperty.html#"><code>IntegerProperty</code></a> is replaced by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyFactory.html#intProperty(java.lang.String)"><code>PropertyFactory#intProperty</code></a>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/IntegerMultiProperty.html#"><code>IntegerMultiProperty</code></a> is replaced by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyFactory.html#intListProperty(java.lang.String)"><code>PropertyFactory#intListProperty</code></a></li>
</ul>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/FloatProperty.html#"><code>FloatProperty</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/DoubleProperty.html#"><code>DoubleProperty</code></a> are both replaced by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyFactory.html#doubleProperty(java.lang.String)"><code>PropertyFactory#doubleProperty</code></a>.
Having a separate property for floats wasnt that useful.
<ul>
<li>Similarly, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/FloatMultiProperty.html#"><code>FloatMultiProperty</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/DoubleMultiProperty.html#"><code>DoubleMultiProperty</code></a> are replaced by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyFactory.html#doubleListProperty(java.lang.String)"><code>PropertyFactory#doubleListProperty</code></a>.</li>
</ul>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/StringProperty.html#"><code>StringProperty</code></a> is replaced by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyFactory.html#stringProperty(java.lang.String)"><code>PropertyFactory#stringProperty</code></a>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/StringMultiProperty.html#"><code>StringMultiProperty</code></a> is replaced by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyFactory.html#stringListProperty(java.lang.String)"><code>PropertyFactory#stringListProperty</code></a></li>
</ul>
</li>
<li>
<p><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/RegexProperty.html#"><code>RegexProperty</code></a> is replaced by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyFactory.html#regexProperty(java.lang.String)"><code>PropertyFactory#regexProperty</code></a></p>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/EnumeratedProperty.html#"><code>EnumeratedProperty</code></a> is replaced by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyFactory.html#enumProperty(java.lang.String,java.util.Map)"><code>PropertyFactory#enumProperty</code></a>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/EnumeratedProperty.html#"><code>EnumeratedProperty</code></a> is replaced by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyFactory.html#enumListProperty(java.lang.String,java.util.Map)"><code>PropertyFactory#enumListProperty</code></a></li>
</ul>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/BooleanProperty.html#"><code>BooleanProperty</code></a> is replaced by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyFactory.html#booleanProperty(java.lang.String)"><code>PropertyFactory#booleanProperty</code></a>
<ul>
<li>Its multi-valued counterpart, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/BooleanMultiProperty.html#"><code>BooleanMultiProperty</code></a>, is not replaced, because it doesnt have a use case.</li>
</ul>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/CharacterProperty.html#"><code>CharacterProperty</code></a> is replaced by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyFactory.html#charProperty(java.lang.String)"><code>PropertyFactory#charProperty</code></a>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/CharacterMultiProperty.html#"><code>CharacterMultiProperty</code></a> is replaced by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyFactory.html#charListProperty(java.lang.String)"><code>PropertyFactory#charListProperty</code></a></li>
</ul>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/LongProperty.html#"><code>LongProperty</code></a> is replaced by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyFactory.html#longIntProperty(java.lang.String)"><code>PropertyFactory#longIntProperty</code></a>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/LongMultiProperty.html#"><code>LongMultiProperty</code></a> is replaced by <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyFactory.html#longIntListProperty(java.lang.String)"><code>PropertyFactory#longIntListProperty</code></a></li>
</ul>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/MethodProperty.html#"><code>MethodProperty</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/FileProperty.html#"><code>FileProperty</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/TypeProperty.html#"><code>TypeProperty</code></a> and their multi-valued counterparts
are discontinued for lack of a use-case, and have no planned replacement in 7.0.0 for now.
<!-- TODO complete that as we proceed. --></li>
</ul>
</li>
</ul>
<p>Heres an example:</p>
<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// Before 7.0.0, these are equivalent:</span>
<span class="nc">IntegerProperty</span> <span class="n">myProperty</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">IntegerProperty</span><span class="o">(</span><span class="s">"score"</span><span class="o">,</span> <span class="s">"Top score value"</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="mi">100</span><span class="o">,</span> <span class="mi">40</span><span class="o">,</span> <span class="mf">3.0f</span><span class="o">);</span>
<span class="nc">IntegerProperty</span> <span class="n">myProperty</span> <span class="o">=</span> <span class="nc">IntegerProperty</span><span class="o">.</span><span class="na">named</span><span class="o">(</span><span class="s">"score"</span><span class="o">).</span><span class="na">desc</span><span class="o">(</span><span class="s">"Top score value"</span><span class="o">).</span><span class="na">range</span><span class="o">(</span><span class="mi">1</span><span class="o">,</span> <span class="mi">100</span><span class="o">).</span><span class="na">defaultValue</span><span class="o">(</span><span class="mi">40</span><span class="o">).</span><span class="na">uiOrder</span><span class="o">(</span><span class="mf">3.0f</span><span class="o">);</span>
<span class="c1">// They both map to the following in 7.0.0</span>
<span class="nc">PropertyDescriptor</span><span class="o">&lt;</span><span class="nc">Integer</span><span class="o">&gt;</span> <span class="n">myProperty</span> <span class="o">=</span> <span class="nc">PropertyFactory</span><span class="o">.</span><span class="na">intProperty</span><span class="o">(</span><span class="s">"score"</span><span class="o">).</span><span class="na">desc</span><span class="o">(</span><span class="s">"Top score value"</span><span class="o">).</span><span class="na">require</span><span class="o">(</span><span class="n">inRange</span><span class="o">(</span><span class="mi">1</span><span class="o">,</span> <span class="mi">100</span><span class="o">)).</span><span class="na">defaultValue</span><span class="o">(</span><span class="mi">40</span><span class="o">);</span>
</code></pre></div></div>
<p>Youre highly encouraged to migrate to using this new API as soon as possible, to ease your migration to 7.0.0.</p>
<p><strong>Architectural simplifications</strong></p>
<ul>
<li>
<p><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/EnumeratedPropertyDescriptor.html#"><code>EnumeratedPropertyDescriptor</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/NumericPropertyDescriptor.html#"><code>NumericPropertyDescriptor</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PackagedPropertyDescriptor.html#"><code>PackagedPropertyDescriptor</code></a>,
and the related builders (in <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/builders/package-summary.html#"><code>net.sourceforge.pmd.properties.builders</code></a>) will be removed.
These specialized interfaces allowed additional constraints to be enforced on the
value of a property, but made the property class hierarchy very large and impractical
to maintain. Their functionality will be mapped uniformly to <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/constraints/PropertyConstraint.html#"><code>PropertyConstraint</code></a>s,
which will allow virtually any constraint to be defined, and improve documentation and error reporting. The
related methods <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyTypeId.html#isPropertyNumeric()"><code>PropertyTypeId#isPropertyNumeric</code></a> and
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyTypeId.html#isPropertyPackaged()"><code>PropertyTypeId#isPropertyPackaged</code></a> are also deprecated.</p>
</li>
<li>
<p><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/MultiValuePropertyDescriptor.html#"><code>MultiValuePropertyDescriptor</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/SingleValuePropertyDescriptor.html#"><code>SingleValuePropertyDescriptor</code></a>
are deprecated. 7.0.0 will introduce a new XML syntax which will remove the need for such a divide
between single- and multi-valued properties. The method <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyDescriptor.html#isMultiValue()"><code>PropertyDescriptor#isMultiValue</code></a> will be removed
accordingly.</p>
</li>
</ul>
<p><strong>Changes to the PropertyDescriptor interface</strong></p>
<ul>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyDescriptor.html#preferredRowCount()"><code>preferredRowCount</code></a> is deprecated with no intended replacement. It was never implemented, and does not belong
in this interface. The methods <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyDescriptor.html#uiOrder()"><code>uiOrder</code></a> and <code class="language-plaintext highlighter-rouge">compareTo(PropertyDescriptor)</code> are deprecated for the
same reason. These methods mix presentation logic with business logic and are not necessary for PropertyDescriptors to work.
<code class="language-plaintext highlighter-rouge">PropertyDescriptor</code> will not extend <code class="language-plaintext highlighter-rouge">Comparable&lt;PropertyDescriptor&gt;</code> anymore come 7.0.0.</li>
<li>The method <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyDescriptor.html#propertyErrorFor(net.sourceforge.pmd.Rule)"><code>propertyErrorFor</code></a> is deprecated and will be removed with no intended
replacement. Its really just a shortcut for <code class="language-plaintext highlighter-rouge">prop.errorFor(rule.getProperty(prop))</code>.</li>
<li><code class="language-plaintext highlighter-rouge">T </code><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyDescriptor.html#valueFrom(java.lang.String)"><code>valueFrom(String)</code></a> and <code class="language-plaintext highlighter-rouge">String </code><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyDescriptor.html#asDelimitedString(java.lang.Object)"><code>asDelimitedString</code></a><code class="language-plaintext highlighter-rouge">(T)</code> are deprecated and will be removed. These were
used to serialize and deserialize properties to/from a string, but 7.0.0 will introduce a more flexible
XML syntax which will make them obsolete.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyDescriptor.html#isMultiValue()"><code>isMultiValue</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyDescriptor.html#type()"><code>type</code></a> are deprecated and wont be replaced. The new XML syntax will remove the need
for a divide between multi- and single-value properties, and will allow arbitrary types to be represented.
Since arbitrary types may be represented, <code class="language-plaintext highlighter-rouge">type</code> will become obsolete as it cant represent generic types,
which will nevertheless be representable with the XML syntax. It was only used for documentation, but a
new way to document these properties exhaustively will be added with 7.0.0.</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyDescriptor.html#errorFor(java.lang.Object)"><code>errorFor</code></a> is deprecated as its return type will be changed to <code class="language-plaintext highlighter-rouge">Optional&lt;String&gt;</code> with the shift to Java 8.</li>
</ul>
<p><strong>Deprecated APIs</strong></p>
<p><strong>For internalization</strong></p>
<ul>
<li>
<p>The implementation of the adapters for the XPath engines Saxon and Jaxen (package <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/xpath/package-summary.html#"><code>net.sourceforge.pmd.lang.ast.xpath</code></a>)
are now deprecated. Theyll be moved to an internal package come 7.0.0. Only <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ast/xpath/Attribute.html#"><code>Attribute</code></a> remains public API.</p>
</li>
<li>
<p>The classes <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyDescriptorField.html#"><code>PropertyDescriptorField</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/builders/PropertyDescriptorBuilderConversionWrapper.html#"><code>PropertyDescriptorBuilderConversionWrapper</code></a>, and the methods
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyDescriptor.html#attributeValuesById"><code>PropertyDescriptor#attributeValuesById</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyDescriptor.html#isDefinedExternally()"><code>PropertyDescriptor#isDefinedExternally</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/PropertyTypeId.html#getFactory()"><code>PropertyTypeId#getFactory</code></a>.
These were used to read and write properties to and from XML, but were not intended as public API.</p>
</li>
<li>
<p>The class <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/ValueParserConstants.html#"><code>ValueParserConstants</code></a> and the interface <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/ValueParser.html#"><code>ValueParser</code></a>.</p>
</li>
<li>
<p>All classes from <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/metrics/impl/visitors/package-summary.html#"><code>net.sourceforge.pmd.lang.java.metrics.impl.visitors</code></a> are now considered internal API. Theyre deprecated
and will be moved into an internal package with 7.0.0. To implement your own metrics visitors,
<a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/JavaParserVisitorAdapter.html#"><code>JavaParserVisitorAdapter</code></a> should be directly subclassed.</p>
</li>
<li>
<p><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/LanguageVersionHandler.html#getDataFlowHandler()"><code>LanguageVersionHandler#getDataFlowHandler()</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/LanguageVersionHandler.html#getDFAGraphRule()"><code>LanguageVersionHandler#getDFAGraphRule()</code></a></p>
</li>
<li>
<p><a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/VisitorStarter.html#"><code>VisitorStarter</code></a></p>
</li>
</ul>
<p><strong>For removal</strong></p>
<ul>
<li>
<p>All classes from <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/properties/modules/package-summary.html#"><code>net.sourceforge.pmd.properties.modules</code></a> will be removed.</p>
</li>
<li>
<p>The interface <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/Dimensionable.html#"><code>Dimensionable</code></a> has been deprecated.
It gets in the way of a grammar change for 7.0.0 and wont be needed anymore (see <a href="https://github.com/pmd/pmd/issues/997">#997</a>).</p>
</li>
<li>
<p>Several methods from <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclaration.html#"><code>ASTLocalVariableDeclaration</code></a> and <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclaration.html#"><code>ASTFieldDeclaration</code></a> have
also been deprecated:</p>
</li>
<li>
<p><a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclaration.html#"><code>ASTFieldDeclaration</code></a> wont be a <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/TypeNode.html#"><code>TypeNode</code></a> come 7.0.0, so
<a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclaration.html#getType()"><code>getType</code></a> and
<a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclaration.html#getTypeDefinition()"><code>getTypeDefinition</code></a> are deprecated.</p>
</li>
<li>
<p>The method <code class="language-plaintext highlighter-rouge">getVariableName</code> on those two nodes will be removed, too.</p>
</li>
</ul>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>All these are deprecated because those nodes may declare several variables at once, possibly
with different types (and obviously with different names). They both implement `Iterator&lt;`&lt;a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTVariableDeclaratorId.html#"&gt;&lt;code&gt;ASTVariableDeclaratorId&lt;/code&gt;&lt;/a&gt;`&gt;`
though, so you should iterate on each declared variable. See [#910](https://github.com/pmd/pmd/issues/910).
</code></pre></div></div>
<ul>
<li>
<p>Visitor decorators are now deprecated and will be removed in PMD 7.0.0. They were originally a way to write
composable visitors, used in the metrics framework, but they didnt prove cost-effective.</p>
</li>
<li>
<p>In <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/package-summary.html#"><code>net.sourceforge.pmd.lang.java.ast</code></a>: <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/JavaParserDecoratedVisitor.html#"><code>JavaParserDecoratedVisitor</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/JavaParserControllessVisitor.html#"><code>JavaParserControllessVisitor</code></a>,
<a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/JavaParserControllessVisitorAdapter.html#"><code>JavaParserControllessVisitorAdapter</code></a>, and <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/JavaParserVisitorDecorator.html#"><code>JavaParserVisitorDecorator</code></a> are deprecated with no intended replacement.</p>
</li>
<li>
<p>The LanguageModules of several languages, that only support CPD execution, have been deprecated. These languages
are not fully supported by PMD, so having a language module does not make sense. The functionality of CPD is
not affected by this change. The following classes have been deprecated and will be removed with PMD 7.0.0:</p>
</li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-cpp/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/cpp/CppHandler.html#"><code>CppHandler</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-cpp/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/cpp/CppLanguageModule.html#"><code>CppLanguageModule</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-cpp/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/cpp/CppParser.html#"><code>CppParser</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-cs/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/cs/CsLanguageModule.html#"><code>CsLanguageModule</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-fortran/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/fortran/FortranLanguageModule.html#"><code>FortranLanguageModule</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-groovy/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/groovy/GroovyLanguageModule.html#"><code>GroovyLanguageModule</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-matlab/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/matlab/MatlabHandler.html#"><code>MatlabHandler</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-matlab/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/matlab/MatlabLanguageModule.html#"><code>MatlabLanguageModule</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-matlab/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/matlab/MatlabParser.html#"><code>MatlabParser</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-objectivec/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/objectivec/ObjectiveCHandler.html#"><code>ObjectiveCHandler</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-objectivec/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/objectivec/ObjectiveCLanguageModule.html#"><code>ObjectiveCLanguageModule</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-objectivec/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/objectivec/ObjectiveCParser.html#"><code>ObjectiveCParser</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-php/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/php/PhpLanguageModule.html#"><code>PhpLanguageModule</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-python/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/python/PythonHandler.html#"><code>PythonHandler</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-python/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/python/PythonLanguageModule.html#"><code>PythonLanguageModule</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-python/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/python/PythonParser.html#"><code>PythonParser</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-ruby/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ruby/RubyLanguageModule.html#"><code>RubyLanguageModule</code></a></li>
<li><a href="https://docs.pmd-code.org/apidocs/pmd-scala_2.13/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/scala/ScalaLanguageModule.html#"><code>ScalaLanguageModule</code></a></li>
<li>
<p><a href="https://docs.pmd-code.org/apidocs/pmd-swift/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/swift/SwiftLanguageModule.html#"><code>SwiftLanguageModule</code></a></p>
</li>
<li>Optional AST processing stages like symbol table, type resolution or data-flow analysis will be reified
in 7.0.0 to factorise common logic and make them extensible. Further explanations about this change can be
found on <a href="https://github.com/pmd/pmd/pull/1426">#1426</a>. Consequently, the following APIs are deprecated for
removal:
<ul>
<li>In <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Rule.html#"><code>Rule</code></a>: <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Rule.html#isDfa()"><code>isDfa()</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Rule.html#isTypeResolution()"><code>isTypeResolution()</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/Rule.html#isMultifile()"><code>isMultifile()</code></a> and their
respective setters.</li>
<li>In <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSet.html#"><code>RuleSet</code></a>: <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSet.html#usesDFA(net.sourceforge.pmd.lang.Language)"><code>usesDFA(Language)</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSet.html#usesTypeResolution(net.sourceforge.pmd.lang.Language)"><code>usesTypeResolution(Language)</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSet.html#usesMultifile(net.sourceforge.pmd.lang.Language)"><code>usesMultifile(Language)</code></a></li>
<li>In <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSets.html#"><code>RuleSets</code></a>: <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSets.html#usesDFA(net.sourceforge.pmd.lang.Language)"><code>usesDFA(Language)</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSets.html#usesTypeResolution(net.sourceforge.pmd.lang.Language)"><code>usesTypeResolution(Language)</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/RuleSets.html#usesMultifile(net.sourceforge.pmd.lang.Language)"><code>usesMultifile(Language)</code></a></li>
<li>In <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/LanguageVersionHandler.html#"><code>LanguageVersionHandler</code></a>: <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/LanguageVersionHandler.html#getDataFlowFacade()"><code>getDataFlowFacade()</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/LanguageVersionHandler.html#getSymbolFacade()"><code>getSymbolFacade()</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/LanguageVersionHandler.html#getSymbolFacade(java.lang.ClassLoader)"><code>getSymbolFacade(ClassLoader)</code></a>,
<a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/LanguageVersionHandler.html#getTypeResolutionFacade(java.lang.ClassLoader)"><code>getTypeResolutionFacade(ClassLoader)</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/LanguageVersionHandler.html#getQualifiedNameResolutionFacade(java.lang.ClassLoader)"><code>getQualifiedNameResolutionFacade(ClassLoader)</code></a></li>
</ul>
</li>
</ul>
<h4 id="690">6.9.0</h4>
<p>No changes.</p>
<h4 id="680">6.8.0</h4>
<ul>
<li>
<p>A couple of methods and fields in <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.properties.AbstractPropertySource</code> have been
deprecated, as they are replaced by already existing functionality or expose internal implementation
details: <code class="language-plaintext highlighter-rouge">propertyDescriptors</code>, <code class="language-plaintext highlighter-rouge">propertyValuesByDescriptor</code>,
<code class="language-plaintext highlighter-rouge">copyPropertyDescriptors()</code>, <code class="language-plaintext highlighter-rouge">copyPropertyValues()</code>, <code class="language-plaintext highlighter-rouge">ignoredProperties()</code>, <code class="language-plaintext highlighter-rouge">usesDefaultValues()</code>,
<code class="language-plaintext highlighter-rouge">useDefaultValueFor()</code>.</p>
</li>
<li>
<p>Some methods in <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.properties.PropertySource</code> have been deprecated as well:
<code class="language-plaintext highlighter-rouge">usesDefaultValues()</code>, <code class="language-plaintext highlighter-rouge">useDefaultValueFor()</code>, <code class="language-plaintext highlighter-rouge">ignoredProperties()</code>.</p>
</li>
<li>
<p>The class <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang.rule.AbstractDelegateRule</code> has been deprecated and will
be removed with PMD 7.0.0. It is internally only in use by RuleReference.</p>
</li>
<li>
<p>The default constructor of <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang.rule.RuleReference</code> has been deprecated
and will be removed with PMD 7.0.0. RuleReferences should only be created by providing a Rule and
a RuleSetReference. Furthermore the following methods are deprecated: <code class="language-plaintext highlighter-rouge">setRuleReference()</code>,
<code class="language-plaintext highlighter-rouge">hasOverriddenProperty()</code>, <code class="language-plaintext highlighter-rouge">usesDefaultValues()</code>, <code class="language-plaintext highlighter-rouge">useDefaultValueFor()</code>.</p>
</li>
</ul>
<h4 id="670">6.7.0</h4>
<ul>
<li>
<p>All classes in the package <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang.dfa.report</code> have been deprecated and will be removed
with PMD 7.0.0. This includes the class <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang.dfa.report.ReportTree</code>. The reason is,
that this class is very specific to Java and not suitable for other languages. It has only been used for
<code class="language-plaintext highlighter-rouge">YAHTMLRenderer</code>, which has been rewritten to work without these classes.</p>
</li>
<li>
<p>The nodes RUNSIGNEDSHIFT and RSIGNEDSHIFT are deprecated and will be removed from the AST with PMD 7.0.0.
These represented the operator of ShiftExpression in two cases out of three, but theyre not needed and
make ShiftExpression inconsistent. The operator of a ShiftExpression is now accessible through
ShiftExpression#getOperator.</p>
</li>
</ul>
<h4 id="650">6.5.0</h4>
<ul>
<li>
<p>The utility class <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang.java.ast.CommentUtil</code> has been deprecated and will be removed
with PMD 7.0.0. Its methods have been intended to parse javadoc tags. A more useful solution will be added
around the AST node <code class="language-plaintext highlighter-rouge">FormalComment</code>, which contains as children <code class="language-plaintext highlighter-rouge">JavadocElement</code> nodes, which in
turn provide access to the <code class="language-plaintext highlighter-rouge">JavadocTag</code>.</p>
<p>All comment AST nodes (<code class="language-plaintext highlighter-rouge">FormalComment</code>, <code class="language-plaintext highlighter-rouge">MultiLineComment</code>, <code class="language-plaintext highlighter-rouge">SingleLineComment</code>) have a new method
<code class="language-plaintext highlighter-rouge">getFilteredComment()</code> which provide access to the comment text without the leading <code class="language-plaintext highlighter-rouge">/*</code> markers.</p>
</li>
<li>
<p>The method <code class="language-plaintext highlighter-rouge">AbstractCommentRule.tagsIndicesIn()</code> has been deprecated and will be removed with
PMD 7.0.0. It is not very useful, since it doesnt extract the information
in a useful way. You would still need check, which tags have been found, and with which
data they might be accompanied.</p>
</li>
</ul>
<h4 id="640">6.4.0</h4>
<ul>
<li>The following classes in package <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.benchmark</code> have been deprecated: <code class="language-plaintext highlighter-rouge">Benchmark</code>, <code class="language-plaintext highlighter-rouge">Benchmarker</code>,
<code class="language-plaintext highlighter-rouge">BenchmarkReport</code>, <code class="language-plaintext highlighter-rouge">BenchmarkResult</code>, <code class="language-plaintext highlighter-rouge">RuleDuration</code>, <code class="language-plaintext highlighter-rouge">StringBuilderCR</code> and <code class="language-plaintext highlighter-rouge">TextReport</code>. Their API is not supported anymore
and is disconnected from the internals of PMD. Use the newer API based around <code class="language-plaintext highlighter-rouge">TimeTracker</code> instead, which can be found
in the same package.</li>
<li>The class <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang.java.xpath.TypeOfFunction</code> has been deprecated. Use the newer <code class="language-plaintext highlighter-rouge">TypeIsFunction</code> in the same package.</li>
<li>The <code class="language-plaintext highlighter-rouge">typeof</code> methods in <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang.java.xpath.JavaFunctions</code> have been deprecated.
Use the newer <code class="language-plaintext highlighter-rouge">typeIs</code> method in the same class instead..</li>
<li>The methods <code class="language-plaintext highlighter-rouge">isA</code>, <code class="language-plaintext highlighter-rouge">isEither</code> and <code class="language-plaintext highlighter-rouge">isNeither</code> of <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang.java.typeresolution.TypeHelper</code>.
Use the new <code class="language-plaintext highlighter-rouge">isExactlyAny</code> and <code class="language-plaintext highlighter-rouge">isExactlyNone</code> methods in the same class instead.</li>
</ul>
<h4 id="620">6.2.0</h4>
<ul>
<li>
<p>The static method <code class="language-plaintext highlighter-rouge">PMDParameters.transformParametersIntoConfiguration(PMDParameters)</code> is now deprecated,
for removal in 7.0.0. The new instance method <code class="language-plaintext highlighter-rouge">PMDParameters.toConfiguration()</code> replaces it.</p>
</li>
<li>
<p>The method <code class="language-plaintext highlighter-rouge">ASTConstructorDeclaration.getParameters()</code> has been deprecated in favor of the new method
<code class="language-plaintext highlighter-rouge">getFormalParameters()</code>. This method is available for both <code class="language-plaintext highlighter-rouge">ASTConstructorDeclaration</code> and
<code class="language-plaintext highlighter-rouge">ASTMethodDeclaration</code>.</p>
</li>
</ul>
<h4 id="610">6.1.0</h4>
<ul>
<li>The method <code class="language-plaintext highlighter-rouge">getXPathNodeName</code> is added to the <code class="language-plaintext highlighter-rouge">Node</code> interface, which removes the
use of the <code class="language-plaintext highlighter-rouge">toString</code> of a node to get its XPath element name (see <a href="https://github.com/pmd/pmd/issues/569">#569</a>).
<ul>
<li>The default implementation provided in <code class="language-plaintext highlighter-rouge">AbstractNode</code>, will
be removed with 7.0.0</li>
<li>With 7.0.0, the <code class="language-plaintext highlighter-rouge">Node.toString</code> method will not necessarily provide its XPath node
name anymore.</li>
</ul>
</li>
<li>
<p>The interface <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.cpd.Renderer</code> has been deprecated. A new interface
<code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.cpd.renderer.CPDRenderer</code> has been introduced to replace it. The main
difference is that the new interface is meant to render directly to a <code class="language-plaintext highlighter-rouge">java.io.Writer</code>
rather than to a String. This allows to greatly reduce the memory footprint of CPD, as on
large projects, with many duplications, it was causing <code class="language-plaintext highlighter-rouge">OutOfMemoryError</code>s (see <a href="https://github.com/pmd/pmd/issues/795">#795</a>).</p>
<p><code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.cpd.FileReporter</code> has also been deprecated as part of this change, as its no longer needed.</p>
</li>
</ul>
<h4 id="601">6.0.1</h4>
<ul>
<li>The constant <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.PMD.VERSION</code> has been deprecated and will be removed with PMD 7.0.0.
Please use <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.PMDVersion.VERSION</code> instead.</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_pmd7.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;2023 PMD Open Source Project. All rights
reserved. <br />
Site last generated: Sep 9, 2023 <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>