diff --git a/css/customstyles.css b/css/customstyles.css
index 98b6bee046..ba7a6b256d 100644
--- a/css/customstyles.css
+++ b/css/customstyles.css
@@ -1175,10 +1175,6 @@ a code {
color: #248ec2;
}
-code + a > code {
- margin-left: -7px;
-}
-
table th code {
color: white;
}
diff --git a/feed.xml b/feed.xml
index 61bb6e019c..fc0189d484 100644
--- a/feed.xml
+++ b/feed.xml
@@ -5,8 +5,8 @@
Or you can join the Mailing List or browse -through the archives (archive1, archive2).
+through the mailing list archive.Of course, you can also directly jump to our source code on github.
diff --git a/pmd_devdocs_development.html b/pmd_devdocs_development.html index d3964a8e78..c72d2f14d5 100644 --- a/pmd_devdocs_development.html +++ b/pmd_devdocs_development.html @@ -1871,11 +1871,9 @@ -The next version of PMD will be developed in parallel with this release. We will release additional bugfix versions as needed.
+The complete source code can be found on github:
+The complete source code can be found on Github:
We use Travis CI as our ci service. The main repo and the eclipse plugin are built for +
We use GitHub Actions as our ci service. The main repo and the eclipse plugin are built for every push. Each pull request is built as well.
The maven snapshot artifacts are deployed at Sonatypes OSS snapshot repository.
@@ -1896,7 +1894,11 @@ every push. Each pull request is built as well.A snapshot of the web site for the new version is generated travis-ci as well.
+Main documentation server is docs.pmd-code.org.
+ +A snapshot of the web site for the new version is generated by the ci job as well.
+ +The latest release documentation is always available under docs.pmd-code.org/latest
diff --git a/pmd_devdocs_major_adding_new_cpd_language.html b/pmd_devdocs_major_adding_new_cpd_language.html index ce4370b4b8..6aff4061f1 100644 --- a/pmd_devdocs_major_adding_new_cpd_language.html +++ b/pmd_devdocs_major_adding_new_cpd_language.html @@ -1875,7 +1875,7 @@
CPD works generically on the tokens produced by a Tokenizer
.
+
CPD works generically on the tokens produced by a CpdLexer
.
To add support for a new language, the crucial piece is writing a CpdLexer that
splits the source file into the tokens specific to your language. Thankfully you
can use a stock Antlr grammar or JavaCC
@@ -1894,7 +1894,7 @@ other languages.
Tokenizer
.
+ CpdLexer
.
For Antlr grammars you can take the grammar from antlr/grammars-v4 and place it in src/main/antlr4
followed by the package name of the language. You then need to call the appropriate ant wrapper to generate
@@ -1918,7 +1918,7 @@ Once that is done, mvn genera
etc/grammar
and edit the pom.xml
like the Python implementation does.
-You can then subclass JavaCCTokenizer
instead of AntlrTokenizer.JavaccCpdLexer
instead of AntlrCpdLexer.
To make the CpdLexer configurable, first define some property descriptors using
-PropertyFactory
. Look at CpdLexer
+PropertyFactory
. Look at CpdLanguageProperties
for some predefined ones which you can reuse (prefer reusing property descriptors if you can).
-You need to override newPropertyBundle
+You need to override newPropertyBundle
and call definePropertyDescriptor
to register the descriptors.
After that you can access the values of the properties from the parameter
of createCpdTokenizer
.
test
) in your pom.xml
.
This contains utilities to test your CpdLexer.
-Create a test class extending from CpdTextComparisonTest
.
+
Create a test class extending from CpdTextComparisonTest
.
To add tests, you need to write regular JUnit @Test
-annotated methods, and
call the method doTest
with the name of the test file.
reporting
s, to add additional language specific information to the
+ ViolationDecorator
s, to add additional language specific information to the
created violations. The Java language module uses this to
provide the method name or class name, where the violation occurred.reporting
ViolationDecorator
s, to add additional language specific information to the
created violations. The Java language module uses this to
provide the method name or class name, where the violation occurred.<summary>Language Info for Apex</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 5.5.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ApexLanguageModule.html#"><code>ApexLanguageModule</code></a></li>
- <li class="list-group-item">Id: apex</li>
- <li class="list-group-item">PMD: ✔️</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
ApexLanguageModule
<summary>Language Info for Coco</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 7.0.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-coco/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/coco/CocoLanguageModule.html#"><code>CocoLanguageModule</code></a></li>
- <li class="list-group-item">Id: coco</li>
- <li class="list-group-item">PMD: ❌</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
CocoLanguageModule
Properties whose name start with CPD are used to configure CPD CpdLexer options.
Programmatically, the language properties can be set on PMDConfiguration
(or CPDConfiguration
) before using the
-PmdAnalyzer
(or CpdAnalyzer
) instance
+PmdAnalysis
(or CpdAnalysis
) instance
to start the analysis:
PMDConfiguration configuration = new PMDConfiguration();
diff --git a/pmd_languages_cpp.html b/pmd_languages_cpp.html
index 76e56888b5..7313e5f888 100644
--- a/pmd_languages_cpp.html
+++ b/pmd_languages_cpp.html
@@ -1874,17 +1874,18 @@
- <summary>Language Info for C++</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 3.5</li>
- <li class="list-group-item">Implementation: <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 class="list-group-item">Id: cpp</li>
- <li class="list-group-item">PMD: ❌</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for C++
+
+
+
+
+- Since PMD 3.5
+- Implementation:
CppLanguageModule
+- Id: cpp
+- PMD: ❌
+- CPD: ✔️
+
+
Language Properties
diff --git a/pmd_languages_cs.html b/pmd_languages_cs.html
index d0a7f22709..c06f46828b 100644
--- a/pmd_languages_cs.html
+++ b/pmd_languages_cs.html
@@ -1874,17 +1874,18 @@
- <summary>Language Info for C#</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 4.3</li>
- <li class="list-group-item">Implementation: <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 class="list-group-item">Id: cs</li>
- <li class="list-group-item">PMD: ❌</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for C#
+
+
+
+
+- Since PMD 4.3
+- Implementation:
CsLanguageModule
+- Id: cs
+- PMD: ❌
+- CPD: ✔️
+
+
diff --git a/pmd_languages_dart.html b/pmd_languages_dart.html
index 5c28943df1..c4281c9f50 100644
--- a/pmd_languages_dart.html
+++ b/pmd_languages_dart.html
@@ -1878,17 +1878,18 @@
- <summary>Language Info for Dart</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 6.14.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-dart/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/dart/DartLanguageModule.html#"><code>DartLanguageModule</code></a></li>
- <li class="list-group-item">Id: dart</li>
- <li class="list-group-item">PMD: ❌</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Dart
+
+
+
+
+- Since PMD 6.14.0
+- Implementation:
DartLanguageModule
+- Id: dart
+- PMD: ❌
+- CPD: ✔️
+
+
diff --git a/pmd_languages_fortran.html b/pmd_languages_fortran.html
index 52a4029cc6..b17827c000 100644
--- a/pmd_languages_fortran.html
+++ b/pmd_languages_fortran.html
@@ -1874,17 +1874,18 @@
- <summary>Language Info for Fortran</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
-
- <li class="list-group-item">Implementation: <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 class="list-group-item">Id: fortran</li>
- <li class="list-group-item">PMD: ❌</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Fortran
+
+
+
+
+
+- Implementation:
FortranLanguageModule
+- Id: fortran
+- PMD: ❌
+- CPD: ✔️
+
+
diff --git a/pmd_languages_gherkin.html b/pmd_languages_gherkin.html
index 0d949afdb5..c704cc4ae0 100644
--- a/pmd_languages_gherkin.html
+++ b/pmd_languages_gherkin.html
@@ -1878,17 +1878,18 @@
The Gherkin syntax is designed to be non-technical, making it human-readable for a wide audience.
- <summary>Language Info for Gherkin</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 6.48.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-gherkin/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/gherkin/GherkinLanguageModule.html#"><code>GherkinLanguageModule</code></a></li>
- <li class="list-group-item">Id: gherkin</li>
- <li class="list-group-item">PMD: ❌</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Gherkin
+
+
+
+
+- Since PMD 6.48.0
+- Implementation:
GherkinLanguageModule
+- Id: gherkin
+- PMD: ❌
+- CPD: ✔️
+
+
Support in PMD
diff --git a/pmd_languages_go.html b/pmd_languages_go.html
index 4dd9a50699..498ff7f746 100644
--- a/pmd_languages_go.html
+++ b/pmd_languages_go.html
@@ -1878,17 +1878,18 @@
- <summary>Language Info for Go</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 5.2.0</li>
- <li class="list-group-item">Implementation: <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>
- <li class="list-group-item">Id: go</li>
- <li class="list-group-item">PMD: ❌</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Go
+
+
+
+
+- Since PMD 5.2.0
+- Implementation:
GoLanguageModule
+- Id: go
+- PMD: ❌
+- CPD: ✔️
+
+
diff --git a/pmd_languages_groovy.html b/pmd_languages_groovy.html
index cdb26d529e..f2bea676e3 100644
--- a/pmd_languages_groovy.html
+++ b/pmd_languages_groovy.html
@@ -1880,17 +1880,18 @@ familiar and easy to learn syntax.
- <summary>Language Info for Groovy</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 5.5.2</li>
- <li class="list-group-item">Implementation: <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 class="list-group-item">Id: groovy</li>
- <li class="list-group-item">PMD: ❌</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Groovy
+
+
+
+
+- Since PMD 5.5.2
+- Implementation:
GroovyLanguageModule
+- Id: groovy
+- PMD: ❌
+- CPD: ✔️
+
+
Support in PMD
diff --git a/pmd_languages_html.html b/pmd_languages_html.html
index 0547444e78..6c6ee20847 100644
--- a/pmd_languages_html.html
+++ b/pmd_languages_html.html
@@ -1874,17 +1874,18 @@
- <summary>Language Info for HTML</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 6.45.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-html/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/html/HtmlLanguageModule.html#"><code>HtmlLanguageModule</code></a></li>
- <li class="list-group-item">Id: html</li>
- <li class="list-group-item">PMD: ✔️</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for HTML
+
+
+
+
+- Since PMD 6.45.0
+- Implementation:
HtmlLanguageModule
+- Id: html
+- PMD: ✔️
+- CPD: ✔️
+
+
The HTML language module uses jsoup for parsing.
diff --git a/pmd_languages_java.html b/pmd_languages_java.html
index acc74ae399..ebb72e42e2 100644
--- a/pmd_languages_java.html
+++ b/pmd_languages_java.html
@@ -1874,17 +1874,18 @@
- <summary>Language Info for Java</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 1.0.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/JavaLanguageModule.html#"><code>JavaLanguageModule</code></a></li>
- <li class="list-group-item">Id: java</li>
- <li class="list-group-item">PMD: ✔️</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Java
+
+
+
+
+- Since PMD 1.0.0
+- Implementation:
JavaLanguageModule
+- Id: java
+- PMD: ✔️
+- CPD: ✔️
+
+
Overview of supported Java language versions
@@ -2112,11 +2113,11 @@ within scope.
if it e.g. references a variable name. In that case, you can access the referenced variable symbol
with the method getReferencedSym
.
-Declaration nodes, such as ASTVariableDeclaratorId
implement the interface
+
Declaration nodes, such as ASTVariableId
implement the interface
SymbolDeclaratorNode
. Through the method
getSymbol
you can also access the symbol.
-To find usages, you can call getLocalUsages
.
+To find usages, you can call getLocalUsages
.
Type resolution APIs
diff --git a/pmd_languages_js_ts.html b/pmd_languages_js_ts.html
index 54e0242f81..99aea09672 100644
--- a/pmd_languages_js_ts.html
+++ b/pmd_languages_js_ts.html
@@ -1874,31 +1874,33 @@
- <summary>Language Info for JavaScript</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
-
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-javascript/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ecmascript/EcmascriptLanguageModule.html#"><code>EcmascriptLanguageModule</code></a></li>
- <li class="list-group-item">Id: ecmascript</li>
- <li class="list-group-item">PMD: ✔️</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for JavaScript
+
+
+
+
+
+- Implementation:
EcmascriptLanguageModule
+- Id: ecmascript
+- PMD: ✔️
+- CPD: ✔️
+
+
- <summary>Language Info for TypeScript</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 7.0.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-javascript/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/ecmascript/EcmascriptLanguageModule.html#"><code>EcmascriptLanguageModule</code></a></li>
- <li class="list-group-item">Id: ts</li>
- <li class="list-group-item">PMD: ❌</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for TypeScript
+
+
+
+
+- Since PMD 7.0.0
+- Implementation:
TsLanguageModule
+- Id: ts
+- PMD: ❌
+- CPD: ✔️
+
+
JavaScript
diff --git a/pmd_languages_jsp.html b/pmd_languages_jsp.html
index 40cd0851fc..30e8d40cc1 100644
--- a/pmd_languages_jsp.html
+++ b/pmd_languages_jsp.html
@@ -1874,17 +1874,18 @@
- <summary>Language Info for Java Server Pages</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
-
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-jsp/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/jsp/JspLanguageModule.html#"><code>JspLanguageModule</code></a></li>
- <li class="list-group-item">Id: jsp</li>
- <li class="list-group-item">PMD: ✔️</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Java Server Pages
+
+
+
+
+
+- Implementation:
JspLanguageModule
+- Id: jsp
+- PMD: ✔️
+- CPD: ✔️
+
+
What is currently supported and what is not
diff --git a/pmd_languages_julia.html b/pmd_languages_julia.html
index 1e2347af55..e5af4375d1 100644
--- a/pmd_languages_julia.html
+++ b/pmd_languages_julia.html
@@ -1881,17 +1881,18 @@ Julia programs compile to efficient native code for multiple platforms via LLVM.
- <summary>Language Info for Julia</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 7.0.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-julia/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/julia/JuliaLanguageModule.html#"><code>JuliaLanguageModule</code></a></li>
- <li class="list-group-item">Id: julia</li>
- <li class="list-group-item">PMD: ❌</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Julia
+
+
+
+
+- Since PMD 7.0.0
+- Implementation:
JuliaLanguageModule
+- Id: julia
+- PMD: ❌
+- CPD: ✔️
+
+
Support in PMD
diff --git a/pmd_languages_kotlin.html b/pmd_languages_kotlin.html
index 9060be6dbc..0ae709ae11 100644
--- a/pmd_languages_kotlin.html
+++ b/pmd_languages_kotlin.html
@@ -1876,17 +1876,18 @@
Kotlin support in PMD is based on the official grammar from https://github.com/Kotlin/kotlin-spec.
- <summary>Language Info for Kotlin</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 7.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-kotlin/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/kotlin/JspLanguageModule.html#"><code>JspLanguageModule</code></a></li>
- <li class="list-group-item">Id: kotlin</li>
- <li class="list-group-item">PMD: ✔️</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Kotlin
+
+
+
+
+- Since PMD 7.0
+- Implementation:
KotlinLanguageModule
+- Id: kotlin
+- PMD: ✔️
+- CPD: ✔️
+
+
Java-based rules and XPath-based rules are supported.
diff --git a/pmd_languages_lua.html b/pmd_languages_lua.html
index 377826453f..b670c9f6aa 100644
--- a/pmd_languages_lua.html
+++ b/pmd_languages_lua.html
@@ -1878,17 +1878,18 @@
- <summary>Language Info for Lua</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 6.17.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-lua/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/lua/LuaLanguageModule.html#"><code>LuaLanguageModule</code></a></li>
- <li class="list-group-item">Id: lua</li>
- <li class="list-group-item">PMD: ❌</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Lua
+
+
+
+
+- Since PMD 6.17.0
+- Implementation:
LuaLanguageModule
+- Id: lua
+- PMD: ❌
+- CPD: ✔️
+
+
CPD support was added with PMD 6.17.0. Since PMD 6.50.0 support for Luau,
diff --git a/pmd_languages_matlab.html b/pmd_languages_matlab.html
index c79e31f25f..f02a3c7f8c 100644
--- a/pmd_languages_matlab.html
+++ b/pmd_languages_matlab.html
@@ -1876,17 +1876,18 @@
Matlab scripts are supported for Copy-Paste-Detection only.
- <summary>Language Info for Matlab</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 5.3.0</li>
- <li class="list-group-item">Implementation: <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 class="list-group-item">Id: matlab</li>
- <li class="list-group-item">PMD: ❌</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Matlab
+
+
+
+
+- Since PMD 5.3.0
+- Implementation:
MatlabLanguageModule
+- Id: matlab
+- PMD: ❌
+- CPD: ✔️
+
+
diff --git a/pmd_languages_modelica.html b/pmd_languages_modelica.html
index 323cf0813d..24644bcc6d 100644
--- a/pmd_languages_modelica.html
+++ b/pmd_languages_modelica.html
@@ -1873,20 +1873,21 @@
- Modelica is a language to model complex physical systems.
+ Modelica is a language to model complex physical systems.
- <summary>Language Info for Modelica</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 6.21.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-modelica/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/modelica/ModelicaLanguageModule.html#"><code>ModelicaLanguageModule</code></a></li>
- <li class="list-group-item">Id: modelica</li>
- <li class="list-group-item">PMD: ✔️</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Modelica
+
+
+
+
+- Since PMD 6.21.0
+- Implementation:
ModelicaLanguageModule
+- Id: modelica
+- PMD: ✔️
+- CPD: ✔️
+
+
diff --git a/pmd_languages_objectivec.html b/pmd_languages_objectivec.html
index 3fc1af6860..1c90ce2555 100644
--- a/pmd_languages_objectivec.html
+++ b/pmd_languages_objectivec.html
@@ -1879,17 +1879,18 @@ a superset of the C programming language and provides object-oriented capabiliti
- <summary>Language Info for objectivec</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 5.3.0</li>
- <li class="list-group-item">Implementation: <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 class="list-group-item">Id: objectivec</li>
- <li class="list-group-item">PMD: ❌</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for objectivec
+
+
+
+
+- Since PMD 5.3.0
+- Implementation:
ObjectiveCLanguageModule
+- Id: objectivec
+- PMD: ❌
+- CPD: ✔️
+
+
diff --git a/pmd_languages_perl.html b/pmd_languages_perl.html
index 4425e60b2e..30420a0dbf 100644
--- a/pmd_languages_perl.html
+++ b/pmd_languages_perl.html
@@ -1878,17 +1878,18 @@
- <summary>Language Info for Perl</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 5.5.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-perl/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/perl/PerlLanguageModule.html#"><code>PerlLanguageModule</code></a></li>
- <li class="list-group-item">Id: perl</li>
- <li class="list-group-item">PMD: ❌</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Perl
+
+
+
+
+- Since PMD 5.5.0
+- Implementation:
PerlLanguageModule
+- Id: perl
+- PMD: ❌
+- CPD: ✔️
+
+
diff --git a/pmd_languages_php.html b/pmd_languages_php.html
index a5bc347857..ef681553a5 100644
--- a/pmd_languages_php.html
+++ b/pmd_languages_php.html
@@ -1878,17 +1878,18 @@
- <summary>Language Info for PHP</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 1.1</li>
- <li class="list-group-item">Implementation: <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 class="list-group-item">Id: php</li>
- <li class="list-group-item">PMD: ❌</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for PHP
+
+
+
+
+- Since PMD 1.1
+- Implementation:
PhpLanguageModule
+- Id: php
+- PMD: ❌
+- CPD: ✔️
+
+
diff --git a/pmd_languages_plsql.html b/pmd_languages_plsql.html
index 2d3fa3eccb..551ae0f3e1 100644
--- a/pmd_languages_plsql.html
+++ b/pmd_languages_plsql.html
@@ -1879,17 +1879,18 @@ describes and explains how to use PL/SQL, the Oracle procedural extension of SQL
- <summary>Language Info for PLSQL</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 5.1.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-plsql/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/plsql/PLSQLLanguageModule.html#"><code>PLSQLLanguageModule</code></a></li>
- <li class="list-group-item">Id: plsql</li>
- <li class="list-group-item">PMD: ✔️</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for PLSQL
+
+
+
+
+- Since PMD 5.1.0
+- Implementation:
PLSQLLanguageModule
+- Id: plsql
+- PMD: ✔️
+- CPD: ✔️
+
+
Grammar
diff --git a/pmd_languages_python.html b/pmd_languages_python.html
index e58cb90b62..1385bbee29 100644
--- a/pmd_languages_python.html
+++ b/pmd_languages_python.html
@@ -1878,17 +1878,18 @@
- <summary>Language Info for Python</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 5.3.0</li>
- <li class="list-group-item">Implementation: <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 class="list-group-item">Id: python</li>
- <li class="list-group-item">PMD: ❌</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Python
+
+
+
+
+- Since PMD 5.3.0
+- Implementation:
PythonLanguageModule
+- Id: python
+- PMD: ❌
+- CPD: ✔️
+
+
diff --git a/pmd_languages_ruby.html b/pmd_languages_ruby.html
index 4c63da224c..68ce176cb1 100644
--- a/pmd_languages_ruby.html
+++ b/pmd_languages_ruby.html
@@ -1879,17 +1879,18 @@ productivity. It has an elegant syntax that is natural to read and easy to write
- <summary>Language Info for Ruby</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 3.0</li>
- <li class="list-group-item">Implementation: <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 class="list-group-item">Id: ruby</li>
- <li class="list-group-item">PMD: ❌</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Ruby
+
+
+
+
+- Since PMD 3.0
+- Implementation:
RubyLanguageModule
+- Id: ruby
+- PMD: ❌
+- CPD: ✔️
+
+
diff --git a/pmd_languages_scala.html b/pmd_languages_scala.html
index cfa69df3e2..dfb8f52fba 100644
--- a/pmd_languages_scala.html
+++ b/pmd_languages_scala.html
@@ -1880,17 +1880,18 @@ object-oriented and functional languages.
- <summary>Language Info for Scala</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 5.3.0</li>
- <li class="list-group-item">Implementation: <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 class="list-group-item">Id: scala</li>
- <li class="list-group-item">PMD: ✔️</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Scala
+
+
+
+
+- Since PMD 5.3.0
+- Implementation:
ScalaLanguageModule
+- Id: scala
+- PMD: ✔️
+- CPD: ✔️
+
+
diff --git a/pmd_languages_swift.html b/pmd_languages_swift.html
index 9d41111321..f4e41ddf40 100644
--- a/pmd_languages_swift.html
+++ b/pmd_languages_swift.html
@@ -1879,17 +1879,18 @@ powerful for experts. It is fast, modern, safe, and a joy to write.
- <summary>Language Info for Swift</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 5.3.7</li>
- <li class="list-group-item">Implementation: <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></li>
- <li class="list-group-item">Id: swift</li>
- <li class="list-group-item">PMD: ✔️</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Swift
+
+
+
+
+- Since PMD 5.3.7
+- Implementation:
SwiftLanguageModule
+- Id: swift
+- PMD: ✔️
+- CPD: ✔️
+
+
The grammar of the languages is documented in The Swift Language Reference.
diff --git a/pmd_languages_tsql.html b/pmd_languages_tsql.html
index 8cfd1a893b..5758f3a3ae 100644
--- a/pmd_languages_tsql.html
+++ b/pmd_languages_tsql.html
@@ -1879,17 +1879,18 @@ proprietary extension to the SQL (Structured Query Language) used to interact wi
- <summary>Language Info for T-SQL</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 6.55.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-tsql/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/tsql/TSqlLanguageModule.html#"><code>TSqlLanguageModule</code></a></li>
- <li class="list-group-item">Id: tsql</li>
- <li class="list-group-item">PMD: ❌</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for T-SQL
+
+
+
+
+- Since PMD 6.55.0
+- Implementation:
TSqlLanguageModule
+- Id: tsql
+- PMD: ❌
+- CPD: ✔️
+
+
diff --git a/pmd_languages_velocity.html b/pmd_languages_velocity.html
index 4909aba0ee..03a7255a86 100644
--- a/pmd_languages_velocity.html
+++ b/pmd_languages_velocity.html
@@ -1879,22 +1879,24 @@ It permits web page designers to reference methods defined in Java code.
- <summary>Language Info for Velocity Template Language (VTL)</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 5.1.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-velocity/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/velocity/VmLanguageModule.html#"><code>VmLanguageModule</code></a></li>
- <li class="list-group-item">Id: velocity</li>
- <li class="list-group-item">PMD: ✔️</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Velocity Template Language (VTL)
+
+
+
+
+- Since PMD 5.1.0
+- Implementation:
VtlLanguageModule
+- Id: velocity
+- PMD: ✔️
+- CPD: ✔️
+
+
Note:
The language id of the Velocity module was in PMD 6 just “vm”. In PMD 7, this has been changed to “velocity”. Also the
-package name of the classes has been changed from vm to “velocity”.
+package name of the classes has been changed from vm to “velocity”. For classes, that used the Vm
prefix, now Vtl
+is used as the prefix, e.g. VtlLanguageModule
, VtlNode
.
diff --git a/pmd_languages_visualforce.html b/pmd_languages_visualforce.html
index 44b35945d2..c5a25b38c0 100644
--- a/pmd_languages_visualforce.html
+++ b/pmd_languages_visualforce.html
@@ -1879,17 +1879,18 @@ language that gives developers way to build applications and customize the Sales
- <summary>Language Info for Salesforce Visualforce</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 5.6.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-visualforce/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/visualforce/VfLanguageModule.html#"><code>VfLanguageModule</code></a></li>
- <li class="list-group-item">Id: visualforce</li>
- <li class="list-group-item">PMD: ✔️</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Salesforce Visualforce
+
+
+
+
+- Since PMD 5.6.0
+- Implementation:
VfLanguageModule
+- Id: visualforce
+- PMD: ✔️
+- CPD: ✔️
+
+
Note:
diff --git a/pmd_languages_xml.html b/pmd_languages_xml.html
index 5f5be52408..dbe984113c 100644
--- a/pmd_languages_xml.html
+++ b/pmd_languages_xml.html
@@ -1874,59 +1874,63 @@
- <summary>Language Info for Maven POM</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 5.4.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-xml/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/pom/PomLanguageModule.html#"><code>PomLanguageModule</code></a></li>
- <li class="list-group-item">Id: pom</li>
- <li class="list-group-item">PMD: ✔️</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for Maven POM
+
+
+
+
+- Since PMD 5.4.0
+- Implementation:
PomLanguageModule
+- Id: pom
+- PMD: ✔️
+- CPD: ✔️
+
+
- <summary>Language Info for WSDL</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 5.4.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-xml/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/pom/PomLanguageModule.html#"><code>PomLanguageModule</code></a></li>
- <li class="list-group-item">Id: wsdl</li>
- <li class="list-group-item">PMD: ✔️</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for WSDL
+
+
+
+
+- Since PMD 5.4.0
+- Implementation:
WsdlLanguageModule
+- Id: wsdl
+- PMD: ✔️
+- CPD: ✔️
+
+
- <summary>Language Info for XML</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 5.0.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-xml/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/pom/PomLanguageModule.html#"><code>PomLanguageModule</code></a></li>
- <li class="list-group-item">Id: xml</li>
- <li class="list-group-item">PMD: ✔️</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for XML
+
+
+
+
+- Since PMD 5.0.0
+- Implementation:
XmlLanguageModule
+- Id: xml
+- PMD: ✔️
+- CPD: ✔️
+
+
- <summary>Language Info for XSL</summary>
-<div class="card">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Since PMD 5.0.0</li>
- <li class="list-group-item">Implementation: <a href="https://docs.pmd-code.org/apidocs/pmd-xml/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/pom/PomLanguageModule.html#"><code>PomLanguageModule</code></a></li>
- <li class="list-group-item">Id: xsl</li>
- <li class="list-group-item">PMD: ✔️</li>
- <li class="list-group-item">CPD: ✔️</li>
- </ul>
-</div>
-
+ Language Info for XSL
+
+
+
+
+- Since PMD 5.0.0
+- Implementation:
XslLanguageModule
+- Id: xsl
+- PMD: ✔️
+- CPD: ✔️
+
+
The XML language module
@@ -1982,7 +1986,7 @@ for more examples.
XPath rules in XML
-While other languages use XPathRule
to create XPath rules,
+
While other languages use XPathRule
to create XPath rules,
the use of this class is not recommended for XML languages. Instead, since 6.44.0, you
are advised to use DomXPathRule
. This rule class interprets
XPath queries exactly as regular XPath, while XPathRule
works on a wrapper for the
diff --git a/pmd_projectdocs_trivia_news.html b/pmd_projectdocs_trivia_news.html
index 43f098709e..9542aedcb3 100644
--- a/pmd_projectdocs_trivia_news.html
+++ b/pmd_projectdocs_trivia_news.html
@@ -1965,7 +1965,7 @@ mentions both PMD and CPD as useful code-checking tools.
October 2005 - Levent Gurses’ article “Improving Code Quality with PMD and Eclipse” in
-EclipseZone talks about the PMD Eclipse plugin and explains many
+EclipseZone talks about the PMD Eclipse plugin and explains many
different facets of PMD - XPath, writing rules, the AST, all that. Good stuff!
@@ -1998,7 +1998,7 @@ Andrew Glover’s CCM article featuring PMD
June 2004 - Open Source-Perlen - A German article on PMD in Java Magazin
- June 2004 - Improving Project Quality with PMD - Tom Wheeler’s
+
June 2004 - Improving Project Quality with PMD - Tom Wheeler’s
“Java News Brief”, June 2004 issue
diff --git a/pmd_release_notes.html b/pmd_release_notes.html
index 33db0a4d83..dffc2a3626 100644
--- a/pmd_release_notes.html
+++ b/pmd_release_notes.html
@@ -1941,7 +1941,7 @@ in the Migration Guide.
Note: Once the default version of PMD is upgraded to PMD7 in maven-pmd-plugin
(see MPMD-379), this
-compatibility module is no longer needed. The module pmd-compat6 might not be maintaned then
+compatibility module is no longer needed. The module pmd-compat6 might not be maintained then
any further, hence it is already declared as deprecated.
No guarantee is given, that the (deprecated) module pmd-compat6 is being maintained over the
@@ -2018,7 +2018,7 @@ This project translates the ANTLR parse tree into an AST, that is similar to the
Note: This is not an official Google product.
-Although the parsers is completely switched, there are only little known changes to the AST.
+
Although the parser is completely switched, there are only little known changes to the AST.
These are documented in the Migration Guide for PMD 7: Apex AST.
With the new Apex parser, the new language constructs like User Mode Database Operations
can be parsed now. PMD should be able to parse Apex code up to version 59.0 (Winter ‘23).
@@ -2048,14 +2048,15 @@ is now considered stable.
Changed: Kotlin support
-Experimental Kotlin support has been promoted as stable API now.
+Support for Kotlin was introduced with PMD 7.0.0-rc1 as an experimental feature. With PMD 7.0.0 this
+is now considered stable.
Changed: Velocity Template Language (VTL)
-The module was named just “vm” which was not a good name. It module and language id and
+
The module was named just “vm” which was not a good name. Its module name, language id and
package names have been renamed to “velocity”.
-If you import rules, you also need to ajdust the paths, e.g.
+If you import rules, you also need to adjust the paths, e.g.
category/vm/...
➡️ category/velocity/...
@@ -2130,63 +2131,69 @@ without replacement. In a serializable class all fields have to be serializable
The following previously deprecated rulesets have been removed. These were the left-over rulesets from PMD 5.
The rules have been moved into categories with PMD 6.
-
- - rulesets/apex/apexunit.xml
- - rulesets/apex/braces.xml
- - rulesets/apex/complexity.xml
- - rulesets/apex/empty.xml
- - rulesets/apex/metrics.xml
- - rulesets/apex/performance.xml
- - rulesets/apex/ruleset.xml
- - rulesets/apex/securty.xml
- - rulesets/apex/style.xml
- - rulesets/java/android.xml
- - rulesets/java/basic.xml
- - rulesets/java/clone.xml
- - rulesets/java/codesize.xml
- - rulesets/java/comments.xml
- - rulesets/java/controversial.xml
- - rulesets/java/coupling.xml
- - rulesets/java/design.xml
- - rulesets/java/empty.xml
- - rulesets/java/finalizers.xml
- - rulesets/java/imports.xml
- - rulesets/java/j2ee.xml
- - rulesets/java/javabeans.xml
- - rulesets/java/junit.xml
- - rulesets/java/logging-jakarta-commons.xml
- - rulesets/java/logging-java.xml
- - rulesets/java/metrics.xml
- - rulesets/java/migrating.xml
- - rulesets/java/migrating_to_13.xml
- - rulesets/java/migrating_to_14.xml
- - rulesets/java/migrating_to_15.xml
- - rulesets/java/migrating_to_junit4.xml
- - rulesets/java/naming.xml
- - rulesets/java/optimizations.xml
- - rulesets/java/strictexception.xml
- - rulesets/java/strings.xml
- - rulesets/java/sunsecure.xml
- - rulesets/java/typeresolution.xml
- - rulesets/java/unnecessary.xml
- - rulesets/java/unusedcode.xml
- - rulesets/ecmascript/basic.xml
- - rulesets/ecmascript/braces.xml
- - rulesets/ecmascript/controversial.xml
- - rulesets/ecmascript/unnecessary.xml
- - rulesets/jsp/basic.xml
- - rulesets/jsp/basic-jsf.xml
- - rulesets/plsql/codesize.xml
- - rulesets/plsql/dates.xml
- - rulesets/plsql/strictsyntax.xml
- - rulesets/plsql/TomKytesDespair.xml
- - rulesets/vf/security.xml
- - rulesets/vm/basic.xml
- - rulesets/pom/basic.xml
- - rulesets/xml/basic.xml
- - rulesets/xsl/xpath.xml
- - rulesets/releases/*
-
+
+ List of deprecated rulesets
+
+
+
+ - rulesets/apex/apexunit.xml
+ - rulesets/apex/braces.xml
+ - rulesets/apex/complexity.xml
+ - rulesets/apex/empty.xml
+ - rulesets/apex/metrics.xml
+ - rulesets/apex/performance.xml
+ - rulesets/apex/ruleset.xml
+ - rulesets/apex/securty.xml
+ - rulesets/apex/style.xml
+ - rulesets/java/android.xml
+ - rulesets/java/basic.xml
+ - rulesets/java/clone.xml
+ - rulesets/java/codesize.xml
+ - rulesets/java/comments.xml
+ - rulesets/java/controversial.xml
+ - rulesets/java/coupling.xml
+ - rulesets/java/design.xml
+ - rulesets/java/empty.xml
+ - rulesets/java/finalizers.xml
+ - rulesets/java/imports.xml
+ - rulesets/java/j2ee.xml
+ - rulesets/java/javabeans.xml
+ - rulesets/java/junit.xml
+ - rulesets/java/logging-jakarta-commons.xml
+ - rulesets/java/logging-java.xml
+ - rulesets/java/metrics.xml
+ - rulesets/java/migrating.xml
+ - rulesets/java/migrating_to_13.xml
+ - rulesets/java/migrating_to_14.xml
+ - rulesets/java/migrating_to_15.xml
+ - rulesets/java/migrating_to_junit4.xml
+ - rulesets/java/naming.xml
+ - rulesets/java/optimizations.xml
+ - rulesets/java/strictexception.xml
+ - rulesets/java/strings.xml
+ - rulesets/java/sunsecure.xml
+ - rulesets/java/typeresolution.xml
+ - rulesets/java/unnecessary.xml
+ - rulesets/java/unusedcode.xml
+ - rulesets/ecmascript/basic.xml
+ - rulesets/ecmascript/braces.xml
+ - rulesets/ecmascript/controversial.xml
+ - rulesets/ecmascript/unnecessary.xml
+ - rulesets/jsp/basic.xml
+ - rulesets/jsp/basic-jsf.xml
+ - rulesets/plsql/codesize.xml
+ - rulesets/plsql/dates.xml
+ - rulesets/plsql/strictsyntax.xml
+ - rulesets/plsql/TomKytesDespair.xml
+ - rulesets/vf/security.xml
+ - rulesets/vm/basic.xml
+ - rulesets/pom/basic.xml
+ - rulesets/xml/basic.xml
+ - rulesets/xsl/xpath.xml
+ - rulesets/releases/*
+
+
+
Fixed issues
@@ -2229,16 +2236,7 @@ The rules have been moved into categories with PMD 6.
- #4659: [doc] Improve ant documentation
- #4669: [doc] Add bld PMD Extension to Tools / Integrations
- #4676: [doc] Clarify how CPD
--ignore-literals
and --ignore-identifiers
work
- -
-
-
-
- #4704: [doc] Multivalued properties do not accept
- as a separator
-
-
-
-
+ - #4704: [doc] Multivalued properties do not accept | as a separator
miscellaneous
@@ -2346,7 +2344,7 @@ The rules have been moved into categories with PMD 6.
API Changes
-See Detailed Release Notes for PMD 7.0.0.
+See Detailed Release Notes for PMD 7.
External Contributions
@@ -2384,6 +2382,8 @@ The rules have been moved into categories with PMD 6.
+For more information, see the Detailed Release Notes for PMD 7.
+
Revamped Java module
@@ -2402,21 +2402,21 @@ The rules have been moved into categories with PMD 6.
Revamped Command Line Interface
- - unified and consistent Command Line Interface for both Linux/Unix and Windows across our different utilities
- - single script
pmd
(pmd.bat
for Windows) to launch the different utilities:
+ - Unified and consistent Command Line Interface for both Linux/Unix and Windows across our different utilities
+ - Single script
pmd
(pmd.bat
for Windows) to launch the different utilities:
pmd check
to run PMD rules and analyze a project
pmd cpd
to run CPD (copy paste detector)
pmd designer
to run the PMD Rule Designer
- - progress bar support for
pmd check
- - shell completion
+ - Progress bar support for
pmd check
+ - Shell completion
-For more information, see the Detailed Release Notes for PMD 7.
+For more information, see the Detailed Release Notes for PMD 7.
Contributors: Juan Martín Sotuyo Dodero (@jsotuyod)
@@ -2428,7 +2428,7 @@ The rules have been moved into categories with PMD 6.
- New supported languages: Swift and Kotlin
-For more information, see the Detailed Release Notes for PMD 7.
+For more information, see the Detailed Release Notes for PMD 7.
Contributors: Lucas Soncini (@lsoncini),
Matías Fraga (@matifraga),
@@ -2454,44 +2454,18 @@ It uses an XSLT stylesheet to convert CPD’s XML format into HTML.
See the example report.
+Contributors: Mohan Chinnappan (@mohan-chinnappan-n)
+
🎉 Language Related Changes
-Note that this is just a concise listing of the highlight.
-For more information on the languages, see the Detailed Release Notes for PMD 7.
+Note that this is just a concise listing of the highlights.
+For more information on the languages, see the Detailed Release Notes for PMD 7.
-New: Swift support
+New: CPD support for Apache Velocity Template Language (VTL)
-
- - use PMD to analyze Swift code with PMD rules
- - limited support for Swift 5.9 (Macro Expansions)
- - initially 4 built-in rules
-
-
-Contributors: Lucas Soncini (@lsoncini),
-Matías Fraga (@matifraga),
-Tomás De Lucca (@tomidelucca)
-
-New: Kotlin support
-
-
- - use PMD to analyze Kotlin code with PMD rules
- - Support for Kotlin 1.8 grammar
- - initially 2 built-in rules
-
-
-New: CPD support for TypeScript
-
-Thanks to a contribution, CPD now supports the TypeScript language. It is shipped
-with the rest of the JavaScript support in the module pmd-javascript
.
-
-Contributors: Paul Guyot (@pguyot)
-
-New: CPD support for Julia
-
-Thanks to a contribution, CPD now supports the Julia language. It is shipped
-in the new module pmd-julia
.
-
-Contributors: Wener (@wener-tiobe)
+PMD supported Apache Velocity for a very long time, but the CPD integration never got finished.
+This is now done and CPD supports Apache Velocity Template language for detecting copy and paste.
+It is shipped in the module pmd-velocity
.
New: CPD support for Coco
@@ -2501,24 +2475,40 @@ module pmd-coco
.
Contributors: Wener (@wener-tiobe)
-New: Java 22 Support
+New: CPD support for Julia
-This release of PMD brings support for Java 22. There are the following new standard language features,
+
Thanks to a contribution, CPD now supports the Julia language. It is shipped
+in the new module pmd-julia
.
+
+Contributors: Wener (@wener-tiobe)
+
+New: CPD support for TypeScript
+
+Thanks to a contribution, CPD now supports the TypeScript language. It is shipped
+with the rest of the JavaScript support in the module pmd-javascript
.
+
+Contributors: Paul Guyot (@pguyot)
+
+New: Java 21 and 22 Support
+
+This release of PMD brings support for Java 21 and 22. There are the following new standard language features,
that are supported now:
- - JEP 456: Unnamed Variables & Patterns
+ - JEP 456: Unnamed Variables & Patterns (Java 22)
+ - JEP 440: Record Patterns (Java 21)
+ - JEP 441: Pattern Matching for switch (Java 21)
PMD also supports the following preview language features:
- - JEP 447: Statements before super(…) (Preview)
- - JEP 459: String Templates (Second Preview)
- - JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview)
+ - JEP 447: Statements before super(…) (Preview) (Java 22)
+ - JEP 459: String Templates (Second Preview) (Java 21 and 22)
+ - JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview) (Java 21 and 22)
-In order to analyze a project with PMD that uses these language features,
+
In order to analyze a project with PMD that uses these preview language features,
you’ll need to enable it via the environment variable PMD_JAVA_OPTS
and select the new language
version 22-preview
:
@@ -2526,72 +2516,33 @@ version 22-preview
:
Note: Support for Java 20 preview language features have been removed. The version “20-preview” is no longer available.
+Note: Support for Java 19 and Java 20 preview language features have been removed. The versions “19-preview” and +“20-preview” are no longer available.
-This release of PMD brings support for Java 21. There are the following new standard language features, -that are supported now:
+PMD also supports the following preview language features:
+Contributors: Jeroen Borgers (@jborgers), +Peter Paul Bakker (@stokpop)
+ +In order to analyze a project with PMD that uses these language features,
-you’ll need to enable it via the environment variable PMD_JAVA_OPTS
and select the new language
-version 21-preview
:
export PMD_JAVA_OPTS=--enable-preview
-pmd check --use-version java-21-preview ...
-
Note: Support for Java 19 preview language features have been removed. The version “19-preview” is no longer available.
- -Support for HTML was introduced in PMD 6.55.0 as an experimental feature. With PMD 7.0.0 this -is now considered stable.
- -minimumLanguageVersion
and
-maximumLanguageVersion
attributes.--ignore-sequences
.--ignore-literal-sequences
, only
-literals were ignored. The new option additional ignores identifiers as well in sequences.CPD-ON
/CPD-OFF
comment pairs.Contributors: Lucas Soncini (@lsoncini), +Matías Fraga (@matifraga), +Tomás De Lucca (@tomidelucca)
Contributors: Aaron Hurst (@aaronhurst-google), Edward Klimoshenko (@eklimo)
+--ignore-sequences
.--ignore-literal-sequences
, only
+literals were ignored. The new option additionally ignores identifiers as well in sequences.Contributors: Wener (@wener-tiobe)
+ +CPD-ON
/CPD-OFF
comment pairs.Contributors: Juan Martín Sotuyo Dodero (@jsotuyod)
+ +Support for HTML was introduced in PMD 6.55.0 as an experimental feature. With PMD 7.0.0 this +is now considered stable.
+ +minimumLanguageVersion
and
+maximumLanguageVersion
attributes.The module was named just “vm” which was not a good name. Its module name, language id and +package names have been renamed to “velocity”.
+ +If you import rules, you also need to adjust the paths, e.g.
+ +category/vm/...
➡️ category/velocity/...
There was an inconsistency between the naming of the maven module and the language id. The language id +used the abbreviation “vf”, while the maven module used the longer name “visualforce”. This has been +solved by renaming the language module to its full name “visualforce”. The java packages have +been renamed as well.
+ +If you import rules, you also need to adjust the paths, e.g.
+ +category/vf/security.xml
➡️ category/visualforce/security.xml
Apex
UnusedMethod
finds unused methods in your code.OperationWithHighCostInLoop
finds Schema class methods called in a loop, which is a
potential performance issue.UnusedMethod
finds unused methods in your code.Java
@@ -2655,16 +2671,24 @@ potential performance issue.Kotlin
FunctionNameTooShort
OverrideBothEqualsAndHashcode
FunctionNameTooShort
finds functions with a too short name.OverrideBothEqualsAndHashcode
finds classes with only
+either equals
or hashCode
overridden, but not both. This leads to unexpected behavior once instances
+of such classes are used in collections (Lists, HashMaps, …).Swift
ProhibitedInterfaceBuilder
UnavailableFunction
ForceCast
ForceTry
ForceCast
flags all force casts, making sure you are
+defensively considering all types. Having the application crash shouldn’t be an option.ForceTry
flags all force tries, making sure you are
+defensively handling exceptions. Having the application crash shouldn’t be an option.ProhibitedInterfaceBuilder
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.UnavailableFunction
flags any function throwing
+a fatalError
not marked as @available(*, unavailable)
to ensure no calls are actually performed in
+the codebase.XML
@@ -2672,160 +2696,10 @@ potential performance issue.MissingEncoding
finds XML files without explicit encoding.General changes
- -topscore
and sigma
have been removed. The property minimum
is still there, however the type is not
-a decimal number anymore but has been changed to an integer. This affects rules in the languages Apex, Java, PLSQL
-and Velocity Template Language (vm):
- ExcessiveClassLength
, ExcessiveParameterList
,
-ExcessivePublicCount
, NcssConstructorCount
,
-NcssMethodCount
, NcssTypeCount
ExcessiveImports
, ExcessiveParameterList
,
-ExcessivePublicCount
, SwitchDensity
ExcessiveMethodLength
, ExcessiveObjectLength
,
-ExcessivePackageBodyLength
, ExcessivePackageSpecificationLength
,
-ExcessiveParameterList
, ExcessiveTypeLength
,
-NcssMethodCount
, NcssObjectCount
,
-NPathComplexity
ExcessiveTemplateLength
violationSuppressXPath
which is available for all rules to
-suppress warnings now uses XPath version 3.1 by default.
-This version of the XPath language is mostly identical to XPath 2.0. In PMD 6, XPath 1.0 has been used.
-If you upgrade from PMD 6, you need to verify your violationSuppressXPath
properties.Apex General changes
- -cc_categories
, cc_remediation_points_multiplier
, cc_block_highlighting
have been removed
-from all rules. These properties have been deprecated since PMD 6.13.0.
-See issue #1648 for more details.Apex Codestyle
- -MethodNamingConventions
: The deprecated rule property skipTestMethodUnderscores
has
-been removed. It was actually deprecated since PMD 6.15.0, but was not mentioned in the release notes
-back then. Use the property testPattern
instead to configure valid names for test methods.Java General changes
- -Violations reported on methods or classes previously reported the line range of the entire method
-or class. With PMD 7.0.0, the reported location is now just the identifier of the method or class.
-This affects various rules, e.g. CognitiveComplexity
.
The report location is controlled by the overrides of the method getReportLocation
-in different node types.
See issue #4439 and issue #730 -for more details.
-Java Best Practices
- -ArrayIsStoredDirectly
: Violations are now reported on the assignment and not
-anymore on the formal parameter. The reported line numbers will probably move.AvoidReassigningLoopVariables
: This rule might not report anymore all
-reassignments of the control variable in for-loops when the property forReassign
is set to skip
.
-See issue #4500 for more details.LooseCoupling
: The rule has a new property to allow some types to be coupled
-to (allowedTypes
).UnusedLocalVariable
: This rule has some important false-negatives fixed
-and finds many more cases now. For details see issues #2130,
-#4516, and #4517.Java Codestyle
- -MethodNamingConventions
: The property checkNativeMethods
has been removed. The
-property was deprecated since PMD 6.3.0. Use the property nativePattern
to control whether native methods
-should be considered or not.ShortVariable
: This rule now also reports short enum constant names.UseDiamondOperator
: The property java7Compatibility
has been removed. The rule now
-handles Java 7 properly without a property.UnnecessaryFullyQualifiedName
: The rule has two new properties,
-to selectively disable reporting on static field and method qualifiers. The rule also has been improved
-to be more precise.UselessParentheses
: The rule has two new properties which control how strict
-the rule should be applied. With ignoreClarifying
(default: true) parentheses that are strictly speaking
-not necessary are allowed, if they separate expressions of different precedence.
-The other property ignoreBalancing
(default: true) is similar, in that it allows parentheses that help
-reading and understanding the expressions.EmptyControlStatement
: The rule has a new property to allow empty blocks when
-they contain a comment (allowCommentedBlocks
).Java Design
- -CyclomaticComplexity
: The property reportLevel
has been removed. The property was
-deprecated since PMD 6.0.0. The report level can now be configured separated for classes and methods using
-classReportLevel
and methodReportLevel
instead.ImmutableField
: The property ignoredAnnotations
has been removed. The property was
-deprecated since PMD 6.52.0.LawOfDemeter
: The rule has a new property trustRadius
. This defines the maximum degree
-of trusted data. The default of 1 is the most restrictive.NPathComplexity
: The property minimum
has been removed. It was deprecated since PMD 6.0.0.
-Use the property reportLevel
instead.SingularField
: The properties checkInnerClasses
and disallowNotAssignment
have been removed.
-The rule is now more precise and will check these cases properly.UseUtilityClass
: The property ignoredAnnotations
has been removed.Java Documentation
- -CommentContent
: The properties caseSensitive
and disallowedTerms
are removed. The
-new property forbiddenRegex
can be used now to define the disallowed terms with a single regular
-expression.CommentRequired
:
- @Override
-annotation. This is relevant for the property methodWithOverrideCommentRequirement
.
-See also pull request #3757.headerCommentRequirement
has been removed. Use the property classCommentRequirement
-instead.CommentSize
: When determining the line-length of a comment, the leading comment
-prefix markers (e.g. *
or //
) are ignored and don’t add up to the line-length.
-See also pull request #4369.Java Error Prone
- -AvoidDuplicateLiterals
: The property exceptionfile
has been removed. The property was
-deprecated since PMD 6.10.0. Use the property exceptionList
instead.DontImportSun
: sun.misc.Signal
is not special-cased anymore.EmptyCatchBlock
: CloneNotSupportedException
and InterruptedException
are not
-special-cased anymore. Rename the exception parameter to ignored
to ignore them.ImplicitSwitchFallThrough
: Violations are now reported on the case statements
-rather than on the switch statements. This is more accurate but might result in more violations now.NonSerializableClass
: The deprecated property prefix
has been removed
-without replacement. In a serializable class all fields have to be serializable regardless of the name.Many rules, that were previously deprecated have been finally removed. -See Detailed Release Notes for PMD 7 for the complete list.
+The information about changed rules, removed rules and rulesets +can be found in the Detailed Release Notes for PMD 7.
Also, there are some improvement and changes in different areas. For the detailed description -of the changes listed here, see Detailed Release Notes for PMD 7.
+of the changes listed here, see Detailed Release Notes for PMD 7.A detailed documentation of required changes are available in the Migration Guide for PMD 7.
-See also Detailed Release Notes for PMD 7.
+See also Detailed Release Notes for PMD 7.
isFindBoundary
should not be an attributen.s.pmd.reporting
packagen.s.pmd.lang.rule
packagecolor
and system property pmd.color
in TextColorRenderer
--no-ruleset-compatibility
ClasspathClassLoader::getResource
child first--file-list
is specified--ignore-literals
and --ignore-identifiers
work#4704: [doc] Multivalued properties do not accept | -as a separator | -
Language specific fixes:
- -@SuppressWarnings
with constants instead of literalsisOverridden
in ASTMethodDeclarationfoo.bar().size()
Throwable.addSuppressed(...)
new BigDecimal(Expression)
this.run()
foo.bar.run()
foo.notify(bar)
More than 300 issues have been fixed in PMD 7. +See Detailed Release Notes for PMD 7 for the +complete list of fixed issues.
--file-list
is specified - Wener (@wener-tiobe)Many thanks to the following contributors: +@219sansim, @aaronhurst-google, @anastasiia-koba, @AndreyBozhko, @bergander, @ciufudean, @cyw3, @dague1, +@Debamoy, @eklimo, @ethauvin, @JerritEic, @joaodinissf, @kenji21, @krdabrowski, @lbovet, @lsoncini, +@LynnBroe, @marcindabrowski, @matifraga, @mohan-chinnappan-n, @mohui1999, @nawforce, @nirvikpatel, +@nwcm, @pguyot, @PimvanderLoos, @rcorfieldffdc, @sfdcsteve, @shai-bennathan, @tomidelucca, +@tprouvot, @wener-tiobe.
+ +See Detailed Release Notes for PMD 7 for the +full list of PRs.
Note: +The full detailed documentation of the changes to the Java AST are available in the +Migration Guide for PMD 7
Two languages (Swift and Kotlin) already use this new possibility.
+See the documentation page Adding a new language with ANTLR +for instructions on how to use this new feature.
+Contributors: Lucas Soncini (@lsoncini), Matías Fraga (@matifraga), Tomás De Lucca (@tomidelucca)
@@ -2019,8 +2023,86 @@ It uses an XSLT stylesheet to convert CPD’s XML format into HTML.See the example report.
+Contributors: Mohan Chinnappan (@mohan-chinnappan-n)
+PMD supported Apache Velocity for a very long time, but the CPD integration never got finished.
+This is now done and CPD supports Apache Velocity Template language for detecting copy and paste.
+It is shipped in the module pmd-velocity
.
Thanks to a contribution, CPD now supports Coco, a modern programming language
+designed specifically for building event-driven software. It is shipped in the new
+module pmd-coco
.
Contributors: Wener (@wener-tiobe)
+ +Thanks to a contribution, CPD now supports the Julia language. It is shipped
+in the new module pmd-julia
.
Contributors: Wener (@wener-tiobe)
+ +Thanks to a contribution, CPD now supports the TypeScript language. It is shipped
+with the rest of the JavaScript support in the module pmd-javascript
.
Contributors: Paul Guyot (@pguyot)
+ +This release of PMD brings support for Java 21 and 22. There are the following new standard language features, +that are supported now:
+ +PMD also supports the following preview language features:
+ +In order to analyze a project with PMD that uses these preview language features,
+you’ll need to enable it via the environment variable PMD_JAVA_OPTS
and select the new language
+version 22-preview
:
export PMD_JAVA_OPTS=--enable-preview
+pmd check --use-version java-22-preview ...
+
Note: Support for Java 19 and Java 20 preview language features have been removed. The versions “19-preview” and +“20-preview” are no longer available.
+ +PMD now supports Kotlin as an additional language for analyzing source code. It is based on +the official kotlin Antlr grammar for Kotlin 1.8. Java-based rules and XPath-based rules are supported.
+ +We are shipping the following rules:
+ +FunctionNameTooShort
finds functions with a too
+short name.OverrideBothEqualsAndHashcode
finds classes with only
+either equals
or hashCode
overridden, but not both. This leads to unexpected behavior once instances
+of such classes are used in collections (Lists, HashMaps, …).Contributors: Jeroen Borgers (@jborgers), +Peter Paul Bakker (@stokpop)
+Given the full Antlr support, PMD now fully supports Swift for creating rules. Previously only CPD was supported.
@@ -2031,14 +2113,14 @@ are supported, but other features are not.We are pleased to announce we are shipping a number of rules starting with PMD 7.
ForceCast
(swift-errorprone
) flags all force casts, making sure you are
+ ForceCast
flags all force casts, making sure you are
defensively considering all types. Having the application crash shouldn’t be an option.ForceTry
(swift-errorprone
) flags all force tries, making sure you are
+ ForceTry
flags all force tries, making sure you are
defensively handling exceptions. Having the application crash shouldn’t be an option.ProhibitedInterfaceBuilder
(swift-bestpractices
) flags any usage of interface
+ ProhibitedInterfaceBuilder
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.UnavailableFunction
(swift-bestpractices
) flags any function throwing
+ UnavailableFunction
flags any function throwing
a fatalError
not marked as @available(*, unavailable)
to ensure no calls are actually performed in
the codebase.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.
- -We are shipping the following rules:
- -FunctionNameTooShort
(kotlin-bestpractices
) finds functions with a too
-short name.OverrideBothEqualsAndHashcode
(kotlin-errorprone
) finds classes with only
-either equals
or hashCode
overridden, but not both. This leads to unexpected behavior once instances
-of such classes are used in collections (Lists, HashMaps, …).Contributors: Jeroen Borgers (@jborgers), -Peter Paul Bakker (@stokpop)
- -Thanks to a contribution, CPD now supports the TypeScript language. It is shipped
-with the rest of the JavaScript support in the module pmd-javascript
.
Contributors: Paul Guyot (@pguyot)
- -Thanks to a contribution, CPD now supports the Julia language. It is shipped
-in the new module pmd-julia
.
Contributors: Wener (@wener-tiobe)
- -Thanks to a contribution, CPD now supports Coco, a modern programming language
-designed specifically for building event-driven software. It is shipped in the new
-module pmd-coco
.
Contributors: Wener (@wener-tiobe)
- -This release of PMD brings support for Java 22. There are the following new standard language features, -that are supported now:
- - - -PMD also supports the following preview language features:
- -In order to analyze a project with PMD that uses these language features,
-you’ll need to enable it via the environment variable PMD_JAVA_OPTS
and select the new language
-version 22-preview
:
export PMD_JAVA_OPTS=--enable-preview
-pmd check --use-version java-22-preview ...
-
Note: Support for Java 20 preview language features have been removed. The version “20-preview” is no longer available.
- -This release of PMD brings support for Java 21. There are the following new standard language features, -that are supported now:
- - - -PMD also supports the following preview language features:
- -In order to analyze a project with PMD that uses these language features,
-you’ll need to enable it via the environment variable PMD_JAVA_OPTS
and select the new language
-version 21-preview
:
export PMD_JAVA_OPTS=--enable-preview
-pmd check --use-version java-21-preview ...
-
Note: Support for Java 19 preview language features have been removed. The version “19-preview” is no longer available.
- -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 pmd-vm
.
Support for HTML was introduced in PMD 6.55.0 as an experimental feature. With PMD 7.0.0 this -is now considered stable.
- -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 Rhino]), is the default. This should be fine for most -use cases.
- -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.
- -The language versions can be used to mark rules to be useful only for a specific language version via
-the minimumLanguageVersion
and maximumLanguageVersion
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.
Related issue: [core] Explicitly name all language versions (#4120)
- ---ignore-sequences
.--ignore-literal-sequences
, only
-literals were ignored. The new option additional ignores identifiers as well in sequences.When PMD added Apex support with version 5.5.0, it utilized the Apex Jorje library to parse Apex source @@ -2214,6 +2161,15 @@ can be parsed now. PMD should be able to parse Apex code up to version 59.0 (Win
Contributors: Aaron Hurst (@aaronhurst-google), Edward Klimoshenko (@eklimo)
+--ignore-sequences
.--ignore-literal-sequences
, only
+literals were ignored. The new option additionally ignores identifiers as well in sequences.Support for HTML was introduced in PMD 6.55.0 as an experimental feature. With PMD 7.0.0 this +is now considered stable.
+ +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 Rhino), is the default. This should be fine for most +use cases.
+ +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.
+ +The language versions can be used to mark rules to be useful only for a specific language version via
+the minimumLanguageVersion
and maximumLanguageVersion
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.
Related issue: [core] Explicitly name all language versions (#4120)
+ +IntProperty
and StringProperty
have been removed. Please use
+PropertyFactory
to create properties.,
) as a delimiter. The previous default was a
+pipe character (|
). The delimiter is not configurable anymore. If needed, the comma can be escaped
+with a backslash.min
and max
attributes in property definitions in the XML are now optional and can appear separately
+or be omitted.The module was named just “vm” which was not a good name. Its module name, language id and +package names have been renamed to “velocity”.
+ +If you import rules, you also need to adjust the paths, e.g.
+ +category/vm/...
➡️ category/velocity/...
There was an inconsistency between the naming of the maven module and the language id. The language id +used the abbreviation “vf”, while the maven module used the longer name “visualforce”. This has been +solved by renaming the language module to its full name “visualforce”. The java packages have +been renamed as well.
+ +If you import rules, you also need to adjust the paths, e.g.
+ +category/vf/security.xml
➡️ category/visualforce/security.xml
Apex
UnusedMethod
finds unused methods in your code.OperationWithHighCostInLoop
finds Schema class methods called in a loop, which is a
potential performance issue.UnusedMethod
finds unused methods in your code.Java
@@ -2241,16 +2258,24 @@ potential performance issue.Kotlin
FunctionNameTooShort
OverrideBothEqualsAndHashcode
FunctionNameTooShort
finds functions with a too short name.OverrideBothEqualsAndHashcode
finds classes with only
+either equals
or hashCode
overridden, but not both. This leads to unexpected behavior once instances
+of such classes are used in collections (Lists, HashMaps, …).Swift
ProhibitedInterfaceBuilder
UnavailableFunction
ForceCast
ForceTry
ForceCast
flags all force casts, making sure you are
+defensively considering all types. Having the application crash shouldn’t be an option.ForceTry
flags all force tries, making sure you are
+defensively handling exceptions. Having the application crash shouldn’t be an option.ProhibitedInterfaceBuilder
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.UnavailableFunction
flags any function throwing
+a fatalError
not marked as @available(*, unavailable)
to ensure no calls are actually performed in
+the codebase.XML
@@ -2266,7 +2291,7 @@ potential performance issue.topscore
and sigma
have been removed. The property minimum
is still there, however the type is not
a decimal number anymore but has been changed to an integer. This affects rules in the languages Apex, Java, PLSQL
-and Velocity Template Language (vm):
+and Velocity Template Language (velocity):
ExcessiveClassLength
, ExcessiveParameterList
,
ExcessivePublicCount
, NcssConstructorCount
,
@@ -2311,7 +2336,7 @@ back then. Use the property t
or class. With PMD 7.0.0, the reported location is now just the identifier of the method or class.
This affects various rules, e.g. CognitiveComplexity
.
- The report location is controlled by the overrides of the method getReportLocation
+
The report location is controlled by the overrides of the method Node#getReportLocation
in different node types.
See issue #4439 and issue #730
@@ -2500,24 +2525,88 @@ and codestyle.xml/WhileLoopsMustUseBraces (deleted) ➡️ use ControlStatementBraces
The following previously deprecated rulesets have been removed. These were the left-over rulesets from PMD 5. +The rules have been moved into categories with PMD 6.
+ +Note: The full detailed documentation of the changes are available in the -Migration Guide for PMD 7 +Migration Guide for PMD 7
run.sh pmd ...
➡️ pmd check ...
, run.sh cpd ...
, pmd cpd ...
).run.sh pmd ...
➡️ pmd check ...
, run.sh cpd ...
➡️ pmd cpd ...
).violationSuppressXPath
now requires XPath 3.1: Custom rulesets need
to be reviewed.buildTargetSelector
-using forTypes
.AbstractRule#buildTargetSelector
+using RuleTargetSelector#forTypes
.The asset filenames of PMD on GitHub Releases are
now pmd-dist-<version>-bin.zip
, pmd-dist-<version>-src.zip
and pmd-dist-<version>-doc.zip
.
@@ -2527,6 +2616,7 @@ Keep that in mind, if you have an automated download script.
pmd-bin-<version>
.
p
- PMD 7 is a major release where many things have been moved or rewritten.
- All integrators will require some level of change to adapt to the change in the API.
- - For more details look at the deprecations notes of the past PMD 6 releases.
- - The PMD Ant tasks, which were previously in the module
pmd-core
has been moved into its own module pmd-ant
+ - For more details look at the deprecations notes of the past PMD 6 releases. These are collected below
+under API Changes.
+ - The PMD Ant tasks, which were previously in the module
pmd-core
has been moved into its own module pmd-ant
,
+which needs to be added explicitly now as an additional dependency.
- The CLI classes have also been moved out of
pmd-core
into its own module pmd-cli
. The old entry point, the
-main class PMD
is gone.
+main class PMD
is gone.
🚨 API
@@ -2579,8 +2671,8 @@ build.xml files with the FQCN net.sourceforge.pmd.util
, that have previously marked as @InternalApi
have been finally
-moved to net.sourceforge.pmd.internal.util
. This includes ClasspathClassLoader, FileFinder, FileUtil, and
-IOUtil.
+moved to an internal sub package and are now longer available.
+This includes ClasspathClassLoader, FileFinder, FileUtil, and IOUtil.
- The following utility classes in
net.sourceforge.pmd.util
are now considered public API:
@@ -2593,12 +2685,13 @@ IOUtil.
StringUtil
- - Moved the two classes
AntlrTokenizer
and JavaCCTokenizer
from
+ - Moved the two classes
AntlrCpdLexer
and JavaccCpdLexer
from
internal
package into package net.sourceforge.pmd.cpd.impl
. These two classes are part of the API and
-are base classes for CPD language implementations. Since 7.0.0-rc2.
+are base classes for CPD language implementations. Since 7.0.0-rc2.
+Note: These two classes have been previously called “AntlrTokenizer” and “JavaCCTokenizer”.
AntlrBaseRule
is gone in favor of AbstractVisitorRule
. Since 7.0.0-rc2.
- - The classes
KotlinInnerNode
and SwiftInnerNode
-are package-private now. Since 7.0.0-rc2.
+ - The classes
net.sourceforge.pmd.lang.kotlin.ast.KotlinInnerNode
and
+net.sourceforge.pmd.lang.swift.ast.SwiftInnerNode
are package-private now. Since 7.0.0-rc2.
XPath 3.1 support
@@ -2647,14 +2740,17 @@ usually Integer
or This makes it so, that Double.NaN
is not an appropriate sentinel value to represent “not supported” anymore.
Instead, computeFor
may return null
in that case (or a garbage value). The value null
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 MetricsUtil
, we took care of making
+the language-specific metrics façades to replace them with the generic MetricsUtil
,
+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 MetricsUtil::computeMetric
with something like if (metric.supports(node))
. If you’re following
+calls to MetricsUtil#computeMetric
(and other overloads)
+with something like if (metric.supports(node))
. If you’re following
this pattern, then you won’t observe the undefined behavior.
-
-
The MetricKey
interface is not so useful and has been merged into the Metric
interface and removed. So
-the Metric
interface has the new method String name()
.
+ The MetricKey
interface is not so useful and has been merged into the Metric
+interface and removed. So the Metric
interface has the new method
+displayName
.
-
The framework is not tied to at most 2 node types per language anymore. Previously those were nodes for
@@ -2664,10 +2760,10 @@ be computed on any code block.
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 JavaClassMetric
, JavaOperationMetric
,
abstract classes for those, JavaClassMetricKey
, and JavaOperationMetricKey
. Metric constants are now all
-inside the JavaMetrics
utility class. The same was done in the Apex framework.
+inside the JavaMetrics
utility class. The same was done in the Apex framework.
We don’t really need abstract classes for metrics now. So AbstractMetric
is also removed from pmd-core.
-There is a factory method on the Metric
interface to create a metric easily.
+There is a factory method on the Metric
interface to create a metric easily.
-
This makes it so, that LanguageMetricsProvider
does not need type parameters.
@@ -2689,8 +2785,8 @@ removed. Node streams allow replacing their usages very easily.
net.sourceforge.pmd.testframework.TestDescriptor
- - Rule tests, that use
SimpleAggregatorTst
or
-PmdRuleTst
work as before without change, but use
+ - Rule tests, that use
SimpleAggregatorTst
or
+PmdRuleTst
work as before without change, but use
now JUnit5 under the hood. If you added additional JUnit4 tests to your rule test classes, then you’ll
need to upgrade them to use JUnit5.
@@ -2725,7 +2821,7 @@ or be omitted.
New Programmatic API for CPD
-This release introduces a new programmatic API to replace the old class CPD
. The new API uses a similar model to
+
This release introduces a new programmatic API to replace the old class CPD
. The new API uses a similar model to
PmdAnalysis
and is called CpdAnalysis
. Programmatic execution of CPD should now be
done with a CPDConfiguration
and a CpdAnalysis
, for instance:
@@ -2760,7 +2856,7 @@ this new programmatic API is recommended.
These are the changes between 7.0.0-rc4 and final 7.0.0.
-pmd-java
+pmd-java
- Support for Java 20 preview language features have been removed. The version “20-preview” is no longer available.
@@ -2776,25 +2872,26 @@ this new programmatic API is recommended.
has been standardized with Java 22.
-New API
+New API
The API around TreeRenderer
has been declared as stable. It was previously
experimental. It can be used via the CLI subcommand ast-dump
or programmatically, as described
on Creating XML dump of the AST.
-General AST Changes to avoid @Image
+General AST Changes to avoid @Image
See General AST Changes to avoid @Image
in the migration guide for details.
-XPath Rules
+XPath Rules
+
- The property
version
was already deprecated and has finally been removed. Please don’t define the version
property anymore in your custom XPath rules. By default, the latest XPath version will be used, which
is XPath 3.1.
-Moved classes/consolidated packages
+Moved classes/consolidated packages
- pmd-core
@@ -2804,7 +2901,7 @@ is XPath 3.1.
Rule
RulePriority
RuleSet
- RuleSetFactory
+ RuleSetFactory
RuleSetLoader
RuleSetLoadException
RuleSetWriter
@@ -2832,7 +2929,7 @@ is XPath 3.1.
BaseTextComparisonTest
(moved from net.sourceforge.pmd.test.BaseTextComparisonTest
)
CpdTextComparisonTest
(moved from net.sourceforge.pmd.cpd.test.CpdTextComparisonTest
)
BaseTreeDumpTest
(moved from net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest
)
- - Any many other types have been moved from
net.sourceforge.pmd.lang.ast.test
to net.sourceforge.pmd.lang.test
.
+ - And many other types have been moved from
net.sourceforge.pmd.lang.ast.test
to net.sourceforge.pmd.lang.test
.
- pmd-scala
@@ -2883,7 +2980,7 @@ is XPath 3.1.
-Internalized classes and interfaces and methods
+Internalized classes and interfaces and methods
The following classes/methods have been marked as @InternalApi before and are now moved into a internal
package or made (package) private and are not accessible anymore.
@@ -3014,18 +3111,18 @@ It’s used to generate the rule documentation for the built-in rules.
- pmd-apex
- net.sourceforge.pmd.ast.ApexNode
+ net.sourceforge.pmd.lang.apex.ast.ApexNode
- Method
getNode()
has been removed. It was only deprecated before and not marked with @InternalApi.
However, it gave access to the wrapped Jorje node and was thus internal API.
- net.sourceforge.pmd.ast.AbstractApexNode
+ net.sourceforge.pmd.lang.apex.ast.AbstractApexNode
- Method
getNode()
is now package private.
- net.sourceforge.pmd.multifile.ApexMultifileAnalysis
+ net.sourceforge.pmd.lang.apex.multifile.ApexMultifileAnalysis
- Constructor is now package private.
@@ -3038,12 +3135,12 @@ However, it gave access to the wrapped Jorje node and was thus internal API.
net.sourceforge.pmd.lang.java.rule.AbstractIgnoredAnnotationRule
(moved to internal)
net.sourceforge.pmd.lang.java.types.ast.LazyTypeResolver
(moved to internal)
- net.sourceforge.pmd.types.JMethodSig
+ net.sourceforge.pmd.lang.java.types.JMethodSig
- Method
internalApi()
has been removed.
- net.sourceforge.pmd.types.TypeOps
+ net.sourceforge.pmd.lang.java.types.TypeOps
- Method
isSameTypeInInference(JTypeMirror,JTypeMirror)
is now package private.
@@ -3052,7 +3149,7 @@ However, it gave access to the wrapped Jorje node and was thus internal API.
- pmd-jsp
- net.sourceforge.pmd.ast.JspParser
+ net.sourceforge.pmd.lang.jsp.ast.JspParser
- Method
getTokenBehavior()
has been removed.
@@ -3061,8 +3158,8 @@ However, it gave access to the wrapped Jorje node and was thus internal API.
- pmd-modelica
- net.sourceforge.pmd.ast.InternalApiBridge
renamed from InternalModelicaNodeApi
.
- net.sourceforge.pmd.resolver.InternalApiBridge
renamed from InternalModelicaResolverApi
.
+ net.sourceforge.pmd.lang.modelica.ast.InternalApiBridge
renamed from InternalModelicaNodeApi
.
+ net.sourceforge.pmd.lang.modelica.resolver.InternalApiBridge
renamed from InternalModelicaResolverApi
.
net.sourceforge.pmd.lang.modelica.resolver.ModelicaSymbolFacade
has been removed.
net.sourceforge.pmd.lang.modelica.resolver.ResolutionContext
(moved to internal)
net.sourceforge.pmd.lang.modelica.resolver.ResolutionState
(moved to internal). Note: it was not previously marked with @InternalApi.
@@ -3076,7 +3173,7 @@ However, it gave access to the wrapped Jorje node and was thus internal API.
- pmd-scala
- net.sourceforge.pmd.ScalaLanguageModule
+ net.sourceforge.pmd.lang.scala.ScalaLanguageModule
- Method
dialectOf(LanguageVersion)
has been removed.
@@ -3085,16 +3182,16 @@ However, it gave access to the wrapped Jorje node and was thus internal API.
-Removed classes and members (previously deprecated)
+Removed classes and members (previously deprecated)
The annotation @DeprecatedUntil700
has been removed.
- pmd-core
- net.sourceforge.pmd.cpd.CpdLanguageProperties
. The field DEFAULT_SKIP_BLOCKS_PATTERN
has been removed.
- net.sourceforge.pmd.lang.ast.impl.antlr4.BaseAntlrNode
- method joinTokenText()
has been removed.
- net.sourceforge.pmd.lang.ast.Node
- many methods have been removed:
+ CpdLanguageProperties
. The field DEFAULT_SKIP_BLOCKS_PATTERN
has been removed.
+ BaseAntlrNode
- method joinTokenText()
has been removed.
+ Node
- many methods have been removed:
findChildNodesWithXPath(String)
- Use the NodeStream
API instead.
- net.sourceforge.pmd.lang.ast.impl.GenericNode
- method getNthParent(int)
has been removed. Use ancestors
instead, e.g. node.ancestors().get(n-1)
- net.sourceforge.pmd.lang.document.FileCollector
- method addZipFile(java.nio.file.Path)
has been removed. Use addZipFileWithContent
instead
- net.sourceforge.pmd.lang.document.TextDocument
- method readOnlyString(CharSequence,String,LanguageVersion)
has been removed.
+ GenericNode
- method getNthParent(int)
has been removed. Use ancestors
instead, e.g. node.ancestors().get(n-1)
+ FileCollector
- method addZipFile(java.nio.file.Path)
has been removed. Use addZipFileWithContent
instead
+ TextDocument
- method readOnlyString(CharSequence,String,LanguageVersion)
has been removed.
Use readOnlyString
instead.
- net.sourceforge.pmd.lang.document.TextFile
- method dataSourceCompat(DataSource,PMDConfiguration)
has been removed.
-Use TextFile
directly, e.g. TextFile.forPath
- net.sourceforge.pmd.lang.rule.xpath.XPathVersion
+ TextFile
- method dataSourceCompat(DataSource,PMDConfiguration)
has been removed.
+Use TextFile
directly, e.g. forPath
+ XPathVersion
XPATH_1_0
XPATH_1_0_COMPATIBILITY
@@ -3124,41 +3221,42 @@ XPath 2.0. XPath rules by default use now net.sourceforge.pmd.lang.rule.AbstractDelegateRule
removed. It has been merged with RuleReference
.
- net.sourceforge.pmd.lang.rule.AbstractRule
- the following methods have been removed:
+ AbstractRule
- the following methods have been removed:
deepCopyValuesTo(AbstractRule)
- use deepCopy
instead.addRuleChainVisit(Class)
- override buildTargetSelector
in order to register nodes for rule chain visits.addViolation(...)
- use addViolation
instead, e.g. via asCtx(data).addViolation(...)
.
-Note: These methods were only marked as deprected in javadoc.addViolationWithMessage(...)
- use addViolationWithMessage
instead, e.g. via
-asCtx(data).addViolationWithMessage(...)
. Note: These methods were only marked as deprected in javadoc.addViolation(...)
- use addViolation
instead, e.g. via asCtx(data).addViolation(...)
.
+Note: These methods were only marked as deprecated in javadoc.addViolationWithMessage(...)
- use addViolationWithMessage
instead, e.g. via
+asCtx(data).addViolationWithMessage(...)
. Note: These methods were only marked as deprecated in javadoc.net.sourceforge.pmd.lang.rule.RuleReference
- the following methods have been removed:
+ RuleReference
- the following methods have been removed:
setRuleSetReference(RuleSetReference)
- without replacement. Just construct new RuleReference
instead.hasOverriddenProperty(PropertyDescriptor)
- use isPropertyOverridden
instead.net.sourceforge.pmd.lang.rule.XPathRule
+ XPathRule
XPATH_DESCRIPTOR
has been made private and is not accessible anymore.net.sourceforge.pmd.lang.Language
- method getTerseName()
removed. Use getId
instead.net.sourceforge.pmd.lang.LanguageModuleBase
- method getTerseName()
removed. Use getId
instead.net.sourceforge.pmd.lang.LanguageRegistry
- the following methods have been removed:
+ Language
- method getTerseName()
removed. Use getId
instead.LanguageModuleBase
- method getTerseName()
removed. Use getId
instead.LanguageRegistry
- the following methods have been removed:
getLanguage(String)
- use LanguageRegistry.getLanguageByFullName
+ getLanguage(String)
- use getLanguageByFullName
via PMD
or CPD
instead.findLanguageByTerseName(String)
- use getLanguageById
via PMD
or CPD
instead.findByExtension(String)
- removed without replacement.net.sourceforge.pmd.lang.LanguageVersionDiscoverer
- method getLanguagesForFile(java.io.File)
removed.
+ LanguageVersionDiscoverer
- method getLanguagesForFile(java.io.File)
removed.
Use getLanguagesForFile
instead.net.sourceforge.pmd.properties.AbstractPropertySource
+ AbstractPropertySource
propertyDescriptors
has been made private and is not accessible anymore.
Use getPropertyDescriptors
instead.getOverriddenPropertiesByPropertyDescriptor
instead.net.sourceforge.pmd.reporting.Reportable
- the following methods have been removed. Use getReportLocation
instead
+ Reportable
- the following methods have been removed. Use getReportLocation
instead
getBeginLine()
getBeginColumn()
net.sourceforge.pmd.util.datasource.ReaderDataSource
net.sourceforge.pmd.util.datasource.ZipDataSource
net.sourceforge.pmd.util.CollectionUtil
+ CollectionUtil
invertedMapFrom(...)
has been removed.mapFrom(...)
has been removed.net.sourceforge.pmd.AbstractConfiguration
- the following methods have been removed:
+ AbstractConfiguration
- the following methods have been removed:
setIgnoreFilePath(String)
- use setIgnoreFilePath
instead.setInputFilePath(String)
- use setInputFilePath
instead.setInputUri
instead.net.sourceforge.pmd.PMDConfiguration
- the following methods have been removed
+ PMDConfiguration
- the following methods have been removed
prependClasspath(String)
- use prependAuxClasspath
instead.getRuleSets()
- use getRuleSetPaths
instead.getReportFilePath
instead.net.sourceforge.pmd.Report
- method merge(Report)
has been removed. Use union
instead.net.sourceforge.pmd.RuleSetLoader
- method toFactory()
has been made package private and is not accessible anymore.net.sourceforge.pmd.RuleViolation
- the following methods have been removed:
+ Report
- method merge(Report)
has been removed. Use union
instead.RuleSetLoader
- method toFactory()
has been made package private and is not accessible anymore.RuleViolation
- the following methods have been removed:
getPackageName()
- use getAdditionalInfo
with PACKAGE_NAME
instead, e.g. getAdditionalInfo().get(PACKAGE_NAME)
.getClassName()
- use getAdditionalInfo
with CLASS_NAME
instead, e.g. getAdditionalInfo().get(CLASS_NAME)
.getMethodName()
- use getAdditionalInfo
with METHOD_NAME
instead, e.g. getAdditionalInfo().get(METHOD_NAME)
.getVariableName()
- use getAdditionalInfo
with VARIABLE_NAME
instead, e.g. getAdditionalInfo().get(VARIABLE_NAME)
.getPackageName()
- use getAdditionalInfo
with PACKAGE_NAME
instead, e.g. getAdditionalInfo().get(PACKAGE_NAME)
.getClassName()
- use getAdditionalInfo
with CLASS_NAME
instead, e.g. getAdditionalInfo().get(CLASS_NAME)
.getMethodName()
- use getAdditionalInfo
with METHOD_NAME
instead, e.g. getAdditionalInfo().get(METHOD_NAME)
.getVariableName()
- use getAdditionalInfo
with VARIABLE_NAME
instead, e.g. getAdditionalInfo().get(VARIABLE_NAME)
.net.sourceforge.pmd.lang.apex.ast.ApexNode
+ ApexNode
- method
jjtAccept()
has been removed.
Use acceptVisitor
instead.
- method
getNode()
has been removed. The underlying node is only available in AST nodes, but not in rule implementations.
- net.sourceforge.pmd.lang.apex.ast.AbstractApexNode
- method getNode()
is now package private.
+ AbstractApexNode
- method getNode()
is now package private.
AST nodes still have access to the underlying Jorje node via the protected property node
.
net.sourceforge.pmd.lang.apex.ast.ApexParserVisitor
Use ApexVisitor
or ApexVisitorBase
instead.
net.sourceforge.pmd.lang.apex.ast.ApexParserVisitorAdapter
- net.sourceforge.pmd.lang.apex.ast.ASTAssignmentExpression
- method getOperator()
removed.
+ ASTAssignmentExpression
- method getOperator()
removed.
Use getOp
instead.
- net.sourceforge.pmd.lang.apex.ast.ASTBinaryExpression
- method getOperator()
removed.
+ ASTBinaryExpression
- method getOperator()
removed.
Use getOp
instead.
- net.sourceforge.pmd.lang.apex.ast.ASTBooleanExpression
- method getOperator()
removed.
+ ASTBooleanExpression
- method getOperator()
removed.
Use getOp
instead.
- net.sourceforge.pmd.lang.apex.ast.ASTPostfixExpression
- method getOperator()
removed.
+ ASTPostfixExpression
- method getOperator()
removed.
Use getOp
instead.
- net.sourceforge.pmd.lang.apex.ast.ASTPrefixExpression
- method getOperator()
removed.
+ ASTPrefixExpression
- method getOperator()
removed.
Use getOp
instead.
net.sourceforge.pmd.lang.apex.rule.security.Helper
removed. This was actually internal API.
- pmd-java
- net.sourceforge.pmd.lang.java.ast.AbstractPackageNameModuleDirective
- method getImage()
has been removed.
+ AbstractPackageNameModuleDirective
- method getImage()
has been removed.
Use getPackageName
instead.
- net.sourceforge.pmd.lang.java.ast.AbstractTypeDeclaration
- method getImage()
has been removed.
-Use getSimpleName
instead.
- net.sourceforge.pmd.lang.java.ast.ASTAnnotation
- method getAnnotationName()
has been removed.
- net.sourceforge.pmd.lang.java.ast.ASTClassType
+ AbstractTypeDeclaration
- method getImage()
has been removed.
+Use getSimpleName()
instead.
+ ASTAnnotation
- method getAnnotationName()
has been removed.
+ ASTClassType
- constructor
ASTClassType(java.lang.String)
has been removed.
- method
getImage()
has been removed.
- method
isReferenceToClassSameCompilationUnit()
has been removed.
- net.sourceforge.pmd.lang.java.ast.ASTFieldDeclaration
- method getVariableName()
has been removed.
- net.sourceforge.pmd.lang.java.ast.ASTLiteral
- the following methods have been removed:
+ ASTFieldDeclaration
- method getVariableName()
has been removed.
+ ASTLiteral
- the following methods have been removed:
isStringLiteral()
- use node instanceof ASTStringLiteral
instead.
isCharLiteral()
- use node instanceof ASTCharLiteral
instead.
@@ -3287,12 +3385,12 @@ Use isDoubleLiteral()
- use isDoubleLiteral
instead.
- net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration
- methods getImage()
and getMethodName()
have been removed.
+ ASTMethodDeclaration
- methods getImage()
and getMethodName()
have been removed.
Use getName
instead.net.sourceforge.pmd.lang.java.ast.ASTMethodReference
- method getImage()
has been removed.net.sourceforge.pmd.lang.java.ast.ASTModuleName
- method getImage()
has been removed.net.sourceforge.pmd.lang.java.ast.ASTPrimitiveType
- method getImage()
has been removed.net.sourceforge.pmd.lang.java.ast.ASTType
+ ASTMethodReference
- method getImage()
has been removed.ASTModuleName
- method getImage()
has been removed.ASTPrimitiveType
- method getImage()
has been removed.ASTType
getTypeImage()
has been removed.getArrayDepth()
has been removed. It’s only available for arrays: getArrayDepth
.node instanceof ASTClassType
instead.net.sourceforge.pmd.lang.java.ast.ASTTypeDeclaration
- method getImage()
has been removed.net.sourceforge.pmd.lang.java.ast.ASTUnaryExpression
- method isPrefix()
has been removed.
+ ASTTypeDeclaration
- method getImage()
has been removed.ASTUnaryExpression
- method isPrefix()
has been removed.
Use getOperator
.isPrefix()
instead.net.sourceforge.pmd.lang.java.ast.ASTVariableId
- methods getImage()
and getVariableName()
have been removed.
+ ASTVariableId
- methods getImage()
and getVariableName()
have been removed.
Use getName
instead.net.sourceforge.pmd.lang.java.ast.JavaComment
- method getImage()
has been removed.
+ JavaComment
- method getImage()
has been removed.
Use getText
instead.net.sourceforge.pmd.lang.java.ast.JavaNode
- method jjtAccept()
has been removed.
+ JavaNode
- method jjtAccept()
has been removed.
Use acceptVisitor
instead.net.sourceforge.pmd.lang.java.ast.JavaParserVisitor
Use JavaVisitor
or JavaVisitorBase
instead.net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter
net.sourceforge.pmd.lang.java.ast.ModifierOwner
+ ModifierOwner
isFinal()
- This is still available in various subtypes, where it makes sense, e.g. isFinal
.isAbstract()
- This is still available in subtypes, e.g. isAbstract
.hasExplicitModifiers
instead, e.g. hasExplicitModifiers(FINAL)
.net.sourceforge.pmd.lang.java.ast.TypeNode
- method getType()
has been removed. Use getTypeMirror
instead.TypeNode
- method getType()
has been removed. Use getTypeMirror
instead.ASTTryStatement
isCatch()
has been removed. Use hasCatch
instead.isFinally()
has been removed. USe hasFinally
instead.isFinally()
has been removed. Use hasFinally
instead.EcmascriptNode
@@ -3364,7 +3462,7 @@ Use net.sourceforge.pmd.lang.jsp.ast.JspParserVisitor
Use JspVisitor
or JspVisitorBase
instead.net.sourceforge.pmd.lang.jsp.ast.JspParserVisitorAdapter
net.sourceforge.pmd.lang.jsp.ast.JspNode
- method jjtAccept()
has been removed.
+ JspNode
- method jjtAccept()
has been removed.
Use acceptVisitor
instead.ModelicaVisitor
or ModelicaVisitorBase
instead.
net.sourceforge.pmd.lang.modelica.ast.ModelicaParserVisitorAdapter
net.sourceforge.pmd.lang.modelica.ast.ModelicaNode
- method jjtAccept()
has been removed.
+ ModelicaNode
- method jjtAccept()
has been removed.
Use acceptVisitor
instead.net.sourceforge.pmd.lang.modelica.rule.AmbiguousResolutionRule
Use AmbiguousResolutionRule
instead.PlsqlVisitor
or PlsqlVisitorBase
instead.
net.sourceforge.pmd.lang.plsql.ast.PLSQLParserVisitorAdapter
net.sourceforge.pmd.lang.plsql.ast.PLSQLNode
- method jjtAccept()
has been removed.
+ PLSQLNode
- method jjtAccept()
has been removed.
Use acceptVisitor
instead.pmd-scala
has been removed. Use pmd-scala_2.13
or pmd-scala_2.12
instead.net.sourceforge.pmd.lang.scala.ast.ScalaNode
+ ScalaNode
accept()
has been removed. Use acceptVisitor
instead.getNode()
has been removed. The underlying node is only available in AST nodes, but not in rule implementations.net.sourceforge.pmd.lang.scala.ast.AbstractScalaNode
- method getNode()
has been removed. AST nodes still have access
+ AbstractScalaNode
- method getNode()
has been removed. AST nodes still have access
to the underlying Scala node via the protected property node
.net.sourceforge.pmd.lang.vf.ast.VfNode
- method jjtAccept()
has been removed.
+ VfNode
- method jjtAccept()
has been removed.
Use acceptVisitor
instead.net.sourceforge.pmd.lang.vf.ast.VfParserVisitor
-Use VfVisitor
or VfVisitorBase
instead.VfVisitor
or VfVisitorBase
instead.net.sourceforge.pmd.lang.vf.ast.VfParserVisitorAdapter
net.sourceforge.pmd.lang.vf.DataType
- method fromBasicType(BasicType)
has been removed.
-Use fromTypeName
instead.DataType
- method fromBasicType(BasicType)
has been removed.
+Use fromTypeName
instead.net.sourceforge.pmd.lang.vm.ast.VmNode
- method jjtAccept()
has been removed.
+ VtlNode
- method jjtAccept()
has been removed.
Use acceptVisitor
instead.net.sourceforge.pmd.lang.vm.ast.VmParserVisitor
-Use VmVisitor
or VmVisitorBase
instead.VtlVisitor
or VtlVisitorBase
instead.net.sourceforge.pmd.lang.vm.ast.VmParserVisitorAdapter
Removed classes, interfaces and methods (not previously deprecated)
Renamed classes, interfaces, methods
PmdReporter
- has been renamed from net.sourceforge.pmd.util.log.MessageReporter
MessageReporter
has been renamed to PmdReporter
TokenMgrError
has been renamed to LexException
Tokenizer
has been renamed to CpdLexer
. Along with this rename,
all the implementations have been renamed as well (Tokenizer
-> CpdLexer
), e.g. “CppCpdLexer”, “JavaCpdLexer”.
@@ -3484,22 +3582,22 @@ This affects all language modules.AccessNode
has been renamed to ModifierOwner
. This is only relevant
+ AccessNode
has been renamed to ModifierOwner
. This is only relevant
for Java rules, which use that type directly e.g. through downcasting.
Or when using the XPath function pmd-java:nodeIs()
.ASTClassOrInterfaceType
has been renamed to ASTClassType
. XPath rules
+ ASTClassOrInterfaceType
has been renamed to ASTClassType
. XPath rules
need to be adjusted.ASTClassOrInterfaceDeclaration
has been renamed to ASTClassDeclaration
.
+ ASTClassOrInterfaceDeclaration
has been renamed to ASTClassDeclaration
.
XPath rules need to be adjusted.ASTAnyTypeDeclaration
has been renamed to ASTTypeDeclaration
.
+ ASTAnyTypeDeclaration
has been renamed to ASTTypeDeclaration
.
This is only relevant for Java rules, which use that type directly, e.g. through downcasting.
Or when using the XPath function pmd-java:nodeIs()
.ASTMethodOrConstructorDeclaration
has been renamed to
-ASTExecutableDeclaration
. This is only relevant for Java rules, which sue that type
+ASTExecutableDeclaration
. This is only relevant for Java rules, which use that type
directly, e.g. through downcasting. Or when using the XPath function pmd-java:nodeIs()
.ASTVariableDeclaratorId
has been renamed to ASTVariableId
. XPath rules
+ ASTVariableDeclaratorId
has been renamed to ASTVariableId
. XPath rules
need to be adjusted.ASTClassOrInterfaceBody
has been renamed to ASTClassBody
. XPath rules
+ ASTClassOrInterfaceBody
has been renamed to ASTClassBody
. XPath rules
need to be adjusted.New API
These were annotated with @Experimental
, but can now be considered stable.
CPDReport#filterMatches
net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrToken.getKind
net.sourceforge.pmd.lang.ast.impl.javacc.AbstractJjtreeNode
net.sourceforge.pmd.lang.ast.impl.TokenDocument
net.sourceforge.pmd.lang.ast.AstInfo.getSuppressionComments
net.sourceforge.pmd.lang.ast.AstInfo.withSuppressMap
net.sourceforge.pmd.lang.ast.GenericToken.getKind
net.sourceforge.pmd.lang.document.FileCollector.addZipFileWithContent
AntlrToken#getKind
AbstractJjtreeNode
TokenDocument
AstInfo#getSuppressionComments
AstInfo#withSuppressMap
GenericToken#getKind
FileCollector#addZipFileWithContent
net.sourceforge.pmd.lang.document
net.sourceforge.pmd.lang.LanguageVersionHandler.getLanguageMetricsProvider
net.sourceforge.pmd.lang.LanguageVersionHandler.getDesignerBindings
net.sourceforge.pmd.lang.PlainTextLanguage
net.sourceforge.pmd.properties.PropertyConstraint.getXmlConstraint
net.sourceforge.pmd.properties.PropertyConstraint.toOptionalConstraint
net.sourceforge.pmd.properties.PropertyConstraint.fromPredicate
net.sourceforge.pmd.properties.PropertyConstraint.fromPredicate
net.sourceforge.pmd.renderers.AbstractRenderer.setReportFile
net.sourceforge.pmd.renderers.Renderer.setReportFile
net.sourceforge.pmd.util.designerbindings.DesignerBindings
net.sourceforge.pmd.util.designerbindings.DesignerBindings.TreeIconId
net.sourceforge.pmd.util.designerbindings.RelatedNodesSelector
net.sourceforge.pmd.Report.filterViolations
net.sourceforge.pmd.Report.union
LanguageVersionHandler#getLanguageMetricsProvider
LanguageVersionHandler#getDesignerBindings
PlainTextLanguage
PropertyConstraint#getXmlConstraint
PropertyConstraint#toOptionalConstraint
PropertyConstraint#fromPredicate
PropertyConstraint#fromPredicate
AbstractRenderer#setReportFile
Renderer#setReportFile
DesignerBindings
DesignerBindings.TreeIconId
RelatedNodesSelector
Report#filterViolations
Report#union
ASTExpression#getConversionContext
AbstractJavaRulechainRule#AbstractJavaRulechainRule
net.sourceforge.pmd.lang.java.symbols.table.JSymbolTable
net.sourceforge.pmd.lang.java.symbols.JElementSymbol
AbstractJavaRulechainRule#<init>
JSymbolTable
JElementSymbol
net.sourceforge.pmd.lang.java.symbols
net.sourceforge.pmd.lang.java.types.ast.ExprContext
ExprContext
JIntersectionType#getInducedClassType
JTypeMirror#streamMethods
JTypeMirror#streamDeclaredMethods
Removed functionality
--no-ruleset-compatibility
has been removed. It was only used to allow loading
@@ -3603,13 +3701,13 @@ has been removed as well. If you don’t want colors, use 7.0.0-rc4
-pmd-java
+pmd-java
- Support for Java 19 preview language features have been removed. The version “19-preview” is no longer available.
-Rule properties
+Rule properties
- The old deprecated classes like
IntProperty
and StringProperty
have been removed. Please use
@@ -3621,19 +3719,19 @@ with a backslash.
or be omitted.
New Programmatic API for CPD
See Detailed Release Notes for PMD 7 and PR #4397 for details.
-Removed classes and methods
The following previously deprecated classes have been removed:
net.sourceforge.pmd.cpd.AbstractTokenizer
➡️ use AnyTokenizer
insteadnet.sourceforge.pmd.cpd.AbstractTokenizer
➡️ use AnyCpdLexer
instead (previously known as AnyTokenizer)net.sourceforge.pmd.cpd.CPD
➡️ use PmdCli
from pmd-cli
module for CLI support or use
CpdAnalysis
for programmatic APInet.sourceforge.pmd.cpd.GridBagHelper
(now package private)Moved packages
NumericConstraints
(old package: net.sourceforge.pmd.properties.constraints.NumericConstraints
)PropertyConstraint
(old package: net.sourceforge.pmd.properties.constraints.PropertyConstraint
)
+ NumericConstraints
(old package: net.sourceforge.pmd.properties.constraints.NumericConstraints
)PropertyConstraint
(old package: net.sourceforge.pmd.properties.constraints.PropertyConstraint
)
Changed types and other changes
PropertyDescriptor
is now a class (was an interface)
+ PropertyDescriptor
is now a class (was an interface)
and it is not comparable anymore.AbstractConfiguration#setSourceEncoding
PmdConfiguration
and CPDConfiguration
+ PMDConfiguration
and CPDConfiguration
AbstractConfiguration
CPDReport#getNumberOfTokensPerFile
returns a Map
of FileId,Integer
instead of String
CPDReport#filterMatches
now takes a java.util.function.Predicate
as parameterTokenizer
+ CpdLexer
PropertyDescriptor
instead of String
,
to be used as language propertiestokenize
+ tokenize
changed parameters. Now takes a TextDocument
and a TokenFactory
-(instead of SourceCode
and Tokens
)SourceCode
and Tokens
).Language
@@ -3829,27 +3928,26 @@ instead of a String
.
Internal APIs
Tokens
PropertyTypeId
net.sourceforge.pmd.properties.internal.PropertyTypeId
Deprecated API
Language#getTerseName
➡️ use getId
instead
Language#getTerseName
➡️ use getId
instead
The method ASTPattern#getParenthesisDepth
has been deprecated and will be removed.
+
The method ASTPattern#getParenthesisDepth
has been deprecated and will be removed.
It was introduced for supporting parenthesized patterns, but that was removed with Java 21. It is only used when
parsing code as java-19-preview.
Experimental APIs
ASTRecordPattern
ASTPatternList
(Note: it was renamed from ASTComponentPatternList
)ast
(Note: it was renamed from ASTSwitchGuard
)ASTRecordPattern
ASTPatternList
(Note: it was renamed from ASTComponentPatternList
)ASTGuard
(Note: it was renamed from ASTSwitchGuard
)PMD Distribution
+net.sourceforge.pmd.PMD
net.sourceforge.pmd.cli.PMDCommandLineInterface
net.sourceforge.pmd.cli.PMDParameters
net.sourceforge.pmd.cli.PmdParametersParseResult
The asset filenames of PMD on GitHub Releases are
now pmd-dist-<version>-bin.zip
, pmd-dist-<version>-src.zip
and pmd-dist-<version>-doc.zip
.
@@ -3893,12 +3981,22 @@ Keep that in mind, if you have an automated download script.
The structure inside the ZIP files stay the same, e.g. we still provide inside the binary distribution
ZIP file the base directory pmd-bin-<version>
.
CLI
+ +--stress
(or -stress
) has been removed without replacement.--minimum-priority
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.pmd-core
+ +Replaced RuleViolation::getFilename
with new RuleViolation#getFileId
, that returns a
+
Replaced Removed classes and methods The following previously deprecated classes have been removed: CLIRuleViolation::getFilename
with new RuleViolation#getFileId
, that returns a
FileId
. This is an identifier for a TextFile
and could represent a path name. This allows to have a separate display name, e.g. renderers use
FileNameRenderer
to either display the full path name or a relative path name
@@ -3912,19 +4010,24 @@ a path-like name before have been adapted to use the new 7.0.0-rc2
+
-
+
+
-
-
- net.sourceforge.pmd.PMD
net.sourceforge.pmd.cli.PMDCommandLineInterface
net.sourceforge.pmd.cli.PMDParameters
net.sourceforge.pmd.cli.PmdParametersParseResult
net.sourceforge.pmd.PMD
net.sourceforge.pmd.cli.PMDCommandLineInterface
net.sourceforge.pmd.cli.PMDParameters
net.sourceforge.pmd.cli.PmdParametersParseResult
--minimum-priority
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.
CLI
+--stress
(or -stress
) has been removed without replacement.--minimum-priority
now takes one of the following values instead of an integer:
@@ -3947,7 +4052,7 @@ High, Medium High, Medium, Medium Low, Low.--short-namesFor removal
- ApexRootNode#getApexVersion
has been deprecated for removal. The version returned is
+ ApexRootNode#getApexVersion()
has been deprecated for removal. The version returned is
always Version.CURRENT
, as the apex compiler integration doesn’t use additional information which Apex version
actually is used. Therefore, this method can’t be used to determine the Apex version of the project
that is being analyzed.
- CPDConfiguration#setEncoding
and
-CPDConfiguration#getEncoding
. Use the methods
+ CPDConfiguration#setEncoding
and
+CPDConfiguration#getEncoding
. Use the methods
getSourceEncoding
and
-setSourceEncoding
instead. Both are available
+setSourceEncoding
instead. Both are available
for CPDConfiguration
which extends AbstractConfiguration
.
- BaseCLITest
and BaseCPDCLITest
have been deprecated for removal without
+ BaseCLITest
and BaseCPDCLITest
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
shouldn’t need to test the CLI integration logic again. Instead, the individual language modules should test their
functionality as unit tests.
-
-
+
-
-
FileCollector#addZipFile
has been deprecated. It is replaced
+
FileCollector#addZipFile
has been deprecated. It is replaced
by FileCollector#addZipFileWithContent
which directly adds the
content of the zip file for analysis.
- PMDConfiguration#setReportShortNames
and
-PMDConfiguration#isReportShortNames
have been deprecated for removal.
-Use PMDConfiguration#addRelativizeRoot
instead.
+ PMDConfiguration#setReportShortNames
and
+PMDConfiguration#isReportShortNames
have been deprecated for removal.
+Use AbstractConfiguration#addRelativizeRoot
instead.
Internal APIs
- CSVWriter
- - Some fields in
AbstractAntTestHelper
+ CSVWriter
+ - Some fields in
AbstractAntTestHelper
Experimental APIs
@@ -4012,7 +4117,7 @@ Use filterMatches
creates a new CPD report
+ filterMatches
creates a new CPD report
with some matches removed with a given predicate based filter.
These classes / APIs have been deprecated and will be removed with PMD 7.0.0.
ExcessiveLengthRule
(Java)ExcessiveLengthRule
(Java)
- The following core APIs have been marked as deprecated for removal in PMD 7:
- PMD
and StatusCode
- PMD 7 will ship with a revamped CLI split from pmd-core. To programmatically launch analysis you can use PmdAnalysis
.
- PMDConfiguration#getAllInputPaths
- It is now superseded by PMDConfiguration#getInputPathList
- PMDConfiguration#setInputPaths
- It is now superseded by PMDConfiguration#setInputPathList
- PMDConfiguration#addInputPath
- It is now superseded by PMDConfiguration#addInputPath
- PMDConfiguration#getInputFilePath
- It is now superseded by PMDConfiguration#getInputFile
- PMDConfiguration#getIgnoreFilePath
- It is now superseded by PMDConfiguration#getIgnoreFile
- PMDConfiguration#setInputFilePath
- It is now superseded by PMDConfiguration#setInputFilePath
- PMDConfiguration#setIgnoreFilePath
- It is now superseded by PMDConfiguration#setIgnoreFilePath
- PMDConfiguration#getInputUri
- It is now superseded by PMDConfiguration#getUri
- PMDConfiguration#setInputUri
- It is now superseded by PMDConfiguration#setInputUri
- PMDConfiguration#getReportFile
- It is now superseded by PMDConfiguration#getReportFilePath
- PMDConfiguration#setReportFile
- It is now superseded by PMDConfiguration#setReportFile
- PMDConfiguration#isStressTest
and PMDConfiguration#setStressTest
- Will be removed with no replacement.
- PMDConfiguration#isBenchmark
and PMDConfiguration#setBenchmark
- Will be removed with no replacement, the CLI will still support it.
- CPD
and StatusCode
- PMD 7 will ship with a revamped CLI split from pmd-core. An alterative to programatically launch CPD analysis will be added in due time.
+ PMD
and PMD.StatusCode
- PMD 7 will ship with a revamped CLI split from pmd-core. To programmatically launch analysis you can use PmdAnalysis
.
+ PMDConfiguration#getAllInputPaths
- It is now superseded by PMDConfiguration#getInputPathList
+ PMDConfiguration#setInputPaths
- It is now superseded by PMDConfiguration#setInputPathList
+ PMDConfiguration#addInputPath
- It is now superseded by PMDConfiguration#addInputPath
+ PMDConfiguration#getInputFilePath
- It is now superseded by PMDConfiguration#getInputFile
+ PMDConfiguration#getIgnoreFilePath
- It is now superseded by PMDConfiguration#getIgnoreFile
+ PMDConfiguration#setInputFilePath
- It is now superseded by PMDConfiguration#setInputFilePath
+ PMDConfiguration#setIgnoreFilePath
- It is now superseded by PMDConfiguration#setIgnoreFilePath
+ PMDConfiguration#getInputUri
- It is now superseded by PMDConfiguration#getUri
+ PMDConfiguration#setInputUri
- It is now superseded by PMDConfiguration#setInputUri
+ PMDConfiguration#getReportFile
- It is now superseded by PMDConfiguration#getReportFilePath
+ PMDConfiguration#setReportFile
- It is now superseded by PMDConfiguration#setReportFile
+ PMDConfiguration#isStressTest
and PMDConfiguration#setStressTest
- Will be removed with no replacement.
+ PMDConfiguration#isBenchmark
and PMDConfiguration#setBenchmark
- Will be removed with no replacement, the CLI will still support it.
+ CPD
and CPD.StatusCode
- PMD 7 will ship with a revamped CLI split from pmd-core. An alternative to programmatically launch CPD analysis will be added in due time.
- - In order to reduce the dependency on Apex Jorje classes, the method
DataType#fromBasicType
-has been deprecated. The equivalent method fromTypeName
should be used instead.
+ - In order to reduce the dependency on Apex Jorje classes, the method
DataType#fromBasicType
+has been deprecated. The equivalent method fromTypeName
should be used instead.
6.51.0
@@ -4117,11 +4222,11 @@ has been deprecated. The equivalent method ASTAssignmentExpression#getOperator
- ASTBinaryExpression#getOperator
- ASTBooleanExpression#getOperator
- ASTPostfixExpression#getOperator
- ASTPrefixExpression#getOperator
+ ASTAssignmentExpression#getOperator
+ ASTBinaryExpression#getOperator
+ ASTBooleanExpression#getOperator
+ ASTPostfixExpression#getOperator
+ ASTPrefixExpression#getOperator
All these classes have now a new getOp()
method. Existing code should be refactored to use this method instead.
@@ -4162,13 +4267,13 @@ They will not be replaced.
Deprecated API
- - The experimental Java AST class
ASTGuardedPattern
has been deprecated and
+ - The experimental Java AST class
net.sourceforge.pmd.lang.java.ast.ASTGuardedPattern
has been deprecated and
will be removed. It was introduced for Java 17 and Java 18 Preview as part of pattern matching for switch,
but it is no longer supported with Java 19 Preview.
- - The interface
CPDRenderer
is deprecated. For custom CPD renderers
-the new interface CPDReportRenderer
should be used.
- - The class
TestDescriptor
is deprecated, replaced with RuleTestDescriptor
.
- - Many methods of
RuleTst
have been deprecated as internal API.
+ - The interface
CPDRenderer
is deprecated. For custom CPD renderers
+the new interface CPDReportRenderer
should be used.
+ - The class
TestDescriptor
is deprecated, replaced with RuleTestDescriptor
.
+ - Many methods of
RuleTst
have been deprecated as internal API.
Experimental APIs
@@ -4177,9 +4282,9 @@ the new interface ASTSwitchGuard
- ASTRecordPattern
- ASTComponentPatternList
+ ASTSwitchGuard
+ ASTRecordPattern
+ ASTComponentPatternList
@@ -4190,13 +4295,13 @@ AST nodes have been introduced as experimental:
You can identify them with the @InternalApi
annotation. You’ll also get a deprecation warning.
- CPDConfiguration#setRenderer
- CPDConfiguration#setCPDRenderer
- CPDConfiguration#getRenderer
- CPDConfiguration#getCPDRenderer
- CPDConfiguration#getRendererFromString
- CPDConfiguration#getCPDRendererFromString
- CPDRendererAdapter
+ CPDConfiguration#setRenderer
+ CPDConfiguration#setCPDRenderer
+ CPDConfiguration#getRenderer
+ CPDConfiguration#getCPDRenderer
+ CPDConfiguration#getRendererFromString
+ CPDConfiguration#getCPDRendererFromString
+ CPDRendererAdapter
6.47.0
@@ -4219,11 +4324,11 @@ when used on the CLI or in a ruleset XML file:
Deprecated API
- toString
is now deprecated. The format of this
+ toString
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.
- getInputPaths
and
-setInputPaths
are now deprecated.
+ getInputPaths
and
+setInputPaths
are now deprecated.
A new set of methods have been added, which use lists and do not rely on comma splitting.
@@ -4233,13 +4338,13 @@ A new set of methods have been added, which use lists and do not rely on comma s
You can identify them with the @InternalApi
annotation. You’ll also get a deprecation warning.
- CPDCommandLineInterface
has been internalized. In order to execute CPD either
-CPD#run
or CPD#main
+ CPDCommandLineInterface
has been internalized. In order to execute CPD either
+CPD#runCpd
or CPD#main
should be used.
- - Several members of
BaseCPDCLITest
have been deprecated with replacements.
- - The methods
Formatter#start
,
-Formatter#end
, Formatter#getRenderer
,
-and Formatter#isNoOutputSupplied
have been internalized.
+ - Several members of
BaseCPDCLITest
have been deprecated with replacements.
+ - The methods
Formatter#start
,
+Formatter#end
, Formatter#getRenderer
,
+and Formatter#isNoOutputSupplied
have been internalized.
6.45.0
@@ -4249,12 +4354,12 @@ and Report#filterViolations
creates a new report with
+ Report#filterViolations
creates a new report with
some violations removed with a given predicate based filter.
- Report#union
can combine two reports into a single new Report.
+ Report#union
can combine two reports into a single new Report.
- net.sourceforge.pmd.util.Predicate
will be replaced in PMD7 with the standard Predicate interface from java8.
+ net.sourceforge.pmd.util.Predicate
will be replaced in PMD7 with the standard Predicate interface from java8.
- The module
pmd-html
is entirely experimental right now. Anything in the package
net.sourceforge.pmd.lang.html
should be used cautiously.
@@ -4264,7 +4369,7 @@ some violations removed with a given predicate based filter.
Deprecated API
- - Several members of
PMD
have been newly deprecated, including:
+ - Several members of
PMD
have been newly deprecated, including:
PMD#EOL
: use System#lineSeparator()
PMD#SUPPRESS_MARKER
: use DEFAULT_SUPPRESS_MARKER
@@ -4272,21 +4377,21 @@ some violations removed with a given predicate based filter.
PMD#getApplicableFiles
: is internal
- PMDConfiguration#prependClasspath
is deprecated
+ PMDConfiguration#prependClasspath
is deprecated
in favour of prependAuxClasspath
.
- PMDConfiguration#setRuleSets
and
-getRuleSets
are deprecated. Use instead
+ PMDConfiguration#setRuleSets
and
+getRuleSets
are deprecated. Use instead
setRuleSets
,
addRuleSet
,
and getRuleSetPaths
.
- - Several members of
BaseCLITest
have been deprecated with replacements.
+ - Several members of
BaseCLITest
have been deprecated with replacements.
-
-
Several members of PMDCommandLineInterface
have been explicitly deprecated.
+
Several members of PMDCommandLineInterface
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.
- - In modelica, the rule classes
AmbiguousResolutionRule
-and ConnectUsingNonConnector
have been deprecated,
+ - In modelica, the rule classes
AmbiguousResolutionRule
+and ConnectUsingNonConnector
have been deprecated,
since they didn’t comply to the usual rule class naming conventions yet.
The replacements are in the subpackage bestpractices
.
@@ -4297,7 +4402,7 @@ The replacements are in the subpackage TextFile
has been added as experimental. It intends
-to replace DataSource
and SourceCode
in the long term.
+to replace DataSource
and SourceCode
in the long term.
This interface will change in PMD 7 to support read/write operations
and other things. You don’t need to use it in PMD 6, as FileCollector
@@ -4311,12 +4416,12 @@ decouples you from this. A file collector is available through Report
: the constructor and other construction methods like addViolation or createReport
-
RuleContext
: all constructors, getters and setters. A new set
+ Report
: the constructor and other construction methods like addViolation or createReport
+ RuleContext
: all constructors, getters and setters. A new set
of stable methods, matching those in PMD 7, was added to replace the addViolation
-overloads of AbstractRule
. In PMD 7, RuleContext
will
+overloads of AbstractRule
. In PMD 7, RuleContext
will
be the API to report violations, and it can already be used as such in PMD 6.
- - The field
configuration
is unused and will be removed.
+ - The field
configuration
is unused and will be removed.
Internal API
@@ -4325,8 +4430,8 @@ be the API to report violations, and it can already be used as such in PMD 6.@InternalApi
annotation. You’ll also get a deprecation warning.
- RuleSet
: methods that serve to apply rules, including apply
, start
, end
, removeDysfunctionalRules
- AbstractAccumulatingRenderer#renderFileReport
is internal API
+ RuleSet
: methods that serve to apply rules, including apply
, start
, end
, removeDysfunctionalRules
+ AbstractAccumulatingRenderer#renderFileReport
is internal API
and should not be overridden in own renderers.
@@ -4342,8 +4447,8 @@ and should not be overridden in own renderers.
Note that the message is set from the XML rule declaration, so this is only relevant
if you instantiate rules manually.
-RuleContext
now requires setting the current rule before calling
-apply
. This is
+
RuleContext
now requires setting the current rule before calling
+apply
. This is
done automatically by RuleSet#apply
and such. Creating and configuring a
RuleContext
manually is strongly advised against, as the lifecycle of RuleContext
will change drastically in PMD 7.
@@ -4512,7 +4617,7 @@ compared to other cli tools.
- The interface
ASTCommentContainer
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
+It provides a way to check whether a node contains at least one comment. Currently, this is only implemented for
ASTCatchBlockStatement
and used by the rule
EmptyCatchBlock
.
This information is also available via XPath attribute @ContainsComment
.
@@ -4546,10 +4651,10 @@ See also the examples on ASTClassOrInterfaceDeclaration#isSealed
,
-ASTClassOrInterfaceDeclaration#isNonSealed
,
-ASTClassOrInterfaceDeclaration#getPermittedSubclasses
- ASTPermitsList
+ ASTClassOrInterfaceDeclaration#isSealed
,
+ASTClassOrInterfaceDeclaration#isNonSealed
,
+ASTClassOrInterfaceDeclaration#getPermittedSubclasses
+ ASTPermitsList
Internal API
@@ -4558,7 +4663,7 @@ See also the examples on @InternalApi
annotation. You’ll also get a deprecation warning.
net.sourceforge.pmd.cpd.TokenEntry.State
is considered to be internal API.
+ net.sourceforge.pmd.cpd.TokenEntry.State
is considered to be internal API.
It will probably be moved away with PMD 7.Deprecated API
PMD#doPMD
is deprecated.
-Use PMD#runPMD
instead.PMD#run
is deprecated.
-Use PMD#runPMD
instead.ThreadSafeReportListener
and the methods to use them in Report
-(addListener
,
-getListeners
, addListeners
)
+ PMD#doPMD
is deprecated.
+Use PMD#runPmd
instead.PMD#run
is deprecated.
+Use PMD#runPmd
instead.ThreadSafeReportListener
and the methods to use them in Report
+(addListener
,
+getListeners
, addListeners
)
are deprecated. This functionality will be replaced by another TBD mechanism in PMD 7.ASTRecordConstructorDeclaration
has been renamed to ASTCompactConstructorDeclaration
in order to align the naming to the JLS.ASTVariableDeclaratorId#isPatternBinding
ASTVariableId#isPatternBinding
ASTPattern
ASTTypePattern
ASTRecordDeclaration
@InternalApi
annotation. You’ll also get a deprecation warning.
AvoidUsingHardCodedIPRule
+ AvoidUsingHardCodedIPRule
are deprecated and considered to be internal API. They will be removed with PMD 7.Deprecated API
AbstractDomXmlRule
AbstractWsdlRule
AbstractXmlRule
AbstractDomXmlRule
AbstractWsdlRule
AbstractXmlRule
Experimental APIs
GenericToken#getKind
has been added as experimental. This
+ GenericToken#getKind
has been added as experimental. This
unifies the token interface for both JavaCC and Antlr. The already existing method
-AntlrToken#getKind
is therefore experimental as well. The
+AntlrToken#getKind
is therefore experimental as well. The
returned constant depends on the actual language and might change whenever the grammar
of the language is changed.Around RuleSet parsing
RuleSetFactory
and RulesetsFactoryUtils
have been deprecated in favor of RuleSetLoader
. This is easier to configure, and more maintainable than the multiple overloads of RulesetsFactoryUtils
.RuleSet
for simple cases, eg forSingleRule
. These replace some counterparts in RuleSetFactory
RuleSets
is also deprecated, many APIs that require a RuleSets instance now are deprecated, and have a counterpart that expects a List<RuleSet>
.RuleSetReferenceId
, RuleSetReference
, RuleSetFactoryCompatibility
are deprecated. They are most likely not relevant outside of the implementation of pmd-core.RuleSetFactory
and RulesetsFactoryUtils
have been deprecated in favor of RuleSetLoader
. This is easier to configure, and more maintainable than the multiple overloads of RulesetsFactoryUtils
.RuleSet
for simple cases, eg forSingleRule
. These replace some counterparts in RuleSetFactory
RuleSets
is also deprecated, many APIs that require a RuleSets instance now are deprecated, and have a counterpart that expects a List<RuleSet>
.RuleSetReferenceId
, RuleSetReference
, RuleSetFactoryCompatibility
are deprecated. They are most likely not relevant outside of the implementation of pmd-core.Around the PMD
class
Many classes around PMD’s entry point (PMD
) have been deprecated as internal, including:
Many classes around PMD’s entry point (PMD
) have been deprecated as internal, including:
net.sourceforge.pmd.cli
, net.sourceforge.pmd.processor
SourceCodeProcessor
PMD
(the class will be made a utility class)net.sourceforge.pmd.cli
in pmd-core, net.sourceforge.pmd.processor
SourceCodeProcessor
PMD
(the class will be made a utility class)Miscellaneous
ASTPackageDeclaration#getPackageNameImage
,
-ASTTypeParameter#getParameterName
+ ASTPackageDeclaration#getPackageNameImage
,
+ASTTypeParameter#getParameterName
and the corresponding XPath attributes. In both cases they’re replaced with a new method getName
,
the attribute is @Name
.ASTClassOrInterfaceBody#isAnonymousInnerClass
,
-and ASTClassOrInterfaceBody#isEnumChild
,
+ ASTClassOrInterfaceBody#isAnonymousInnerClass
,
+and ASTClassOrInterfaceBody#isEnumChild
,
refs #905@InternalApi
annotation. You’ll also get a deprecation warning.
net.sourceforge.pmd.lang.ecmascript.Ecmascript3Handler
net.sourceforge.pmd.lang.ecmascript.Ecmascript3Parser
EcmascriptParser#parserOptions
EcmascriptParser#getSuppressMap
net.sourceforge.pmd.lang.rule.ParametricRuleViolation
ParserOptions#suppressMarker
net.sourceforge.pmd.lang.modelica.rule.ModelicaRuleViolationFactory
net.sourceforge.pmd.lang.ecmascript.Ecmascript3Handler
net.sourceforge.pmd.lang.ecmascript.Ecmascript3Parser
EcmascriptParser#parserOptions
EcmascriptParser#getSuppressMap
net.sourceforge.pmd.lang.rule.ParametricRuleViolation
ParserOptions#suppressMarker
net.sourceforge.pmd.lang.modelica.rule.ModelicaRuleViolationFactory
net.sourceforge.pmd.RuleViolationComparator
. Use RuleViolation#DEFAULT_COMPARATOR
instead.
- net.sourceforge.pmd.cpd.AbstractTokenizer
. Use net.sourceforge.pmd.cpd.AnyTokenizer
instead.
- net.sourceforge.pmd.cpd.FortranTokenizer
. Was replaced by an AnyTokenizer
. Use FortranLanguage#getTokenizer
anyway.
- net.sourceforge.pmd.cpd.PerlTokenizer
. Was replaced by an AnyTokenizer
. Use PerlLanguage#getTokenizer
anyway.
- net.sourceforge.pmd.cpd.RubyTokenizer
. Was replaced by an AnyTokenizer
. Use RubyLanguage#getTokenizer
anyway.
- RuleReference#getOverriddenLanguage
and
-RuleReference#setLanguage
+ net.sourceforge.pmd.RuleViolationComparator
. Use RuleViolation#DEFAULT_COMPARATOR
instead.
+ net.sourceforge.pmd.cpd.AbstractTokenizer
. Use net.sourceforge.pmd.cpd.AnyCpdLexer
instead (previously called AnyTokenizer).
+ net.sourceforge.pmd.cpd.FortranTokenizer
. Was replaced by an AnyCpdLexer
. Use FortranLanguageModule#createCpdLexer
anyway.
+ net.sourceforge.pmd.cpd.PerlTokenizer
. Was replaced by an AnyCpdLexer
. Use PerlLanguageModule#createCpdLexer
anyway.
+ net.sourceforge.pmd.cpd.RubyTokenizer
. Was replaced by an AnyCpdLexer
. Use RubyLanguageModule#createCpdLexer
anyway.
+ RuleReference#getOverriddenLanguage
and
+RuleReference#setLanguage
- Antlr4 generated lexers:
- net.sourceforge.pmd.lang.cs.antlr4.CSharpLexer
will be moved to package net.sourceforge.pmd.lang.cs.ast
with PMD 7.
- net.sourceforge.pmd.lang.dart.antlr4.Dart2Lexer
will be renamed to DartLexer
and moved to package
+ net.sourceforge.pmd.lang.cs.antlr4.CSharpLexer
will be moved to package net.sourceforge.pmd.lang.cs.ast
with PMD 7.
+ net.sourceforge.pmd.lang.dart.antlr4.Dart2Lexer
will be renamed to DartLexer
and moved to package
net.sourceforge.pmd.lang.dart.ast
with PMD 7. All other classes in the old package will be removed.
- net.sourceforge.pmd.lang.go.antlr4.GolangLexer
will be moved to package
+ net.sourceforge.pmd.lang.go.antlr4.GolangLexer
will be moved to package
net.sourceforge.pmd.lang.go.ast
with PMD 7. All other classes in the old package will be removed.
- net.sourceforge.pmd.lang.kotlin.antlr4.Kotlin
will be renamed to KotlinLexer
and moved to package
+ net.sourceforge.pmd.lang.kotlin.antlr4.Kotlin
will be renamed to KotlinLexer
and moved to package
net.sourceforge.pmd.lang.kotlin.ast
with PMD 7.
- net.sourceforge.pmd.lang.lua.antlr4.LuaLexer
will be moved to package
+ net.sourceforge.pmd.lang.lua.antlr4.LuaLexer
will be moved to package
net.sourceforge.pmd.lang.lua.ast
with PMD 7. All other classes in the old package will be removed.
@@ -4736,51 +4841,51 @@ reported as a forward compatibility warning.
For removal
- Rule#getParserOptions
- Parser#getParserOptions
- AbstractParser
- RuleContext#removeAttribute
- RuleContext#getAttribute
- RuleContext#setAttribute
- ApexParserOptions
- ASTThrowStatement#getFirstClassOrInterfaceTypeImage
- EcmascriptParserOptions
- EcmascriptXPathRule
- XmlParserOptions
- XmlXPathRule
+ Rule#getParserOptions
+ Parser#getParserOptions
+ AbstractParser
+ RuleContext#removeAttribute
+ RuleContext#getAttribute
+ RuleContext#setAttribute
+ ApexParserOptions
+ ASTThrowStatement#getFirstClassOrInterfaceTypeImage
+ EcmascriptParserOptions
+ EcmascriptXPathRule
+ XmlParserOptions
+ XmlXPathRule
-
-
Properties of AbstractXmlRule
+ Properties of AbstractXmlRule
- net.sourceforge.pmd.Report.ReadableDuration
+ net.sourceforge.pmd.Report.ReadableDuration
-
-
Many methods of net.sourceforge.pmd.Report
. They are replaced by accessors
-that produce a List. For example, iterator()
-(and implementing Iterable) and isEmpty()
are both
-replaced by getViolations()
.
+ Many methods of net.sourceforge.pmd.Report
. They are replaced by accessors
+that produce a List. For example, iterator()
+(and implementing Iterable) and isEmpty()
are both
+replaced by getViolations()
.
- - The dataflow codebase is deprecated for removal in PMD 7. This
-includes all code in the following packages, and their subpackages:
- net.sourceforge.pmd.lang.plsql.dfa
- net.sourceforge.pmd.lang.java.dfa
- net.sourceforge.pmd.lang.dfa
- -
-
and the class PLSQLDataFlowHandler
+ - The dataflow codebase is deprecated for removal in PMD 7. This includes all code in the following packages, and their subpackages:
+
-
-
+
- ASTJspDeclarations
- ASTJspDocument
- ScalaParserVisitorAdapter#zero
- ScalaParserVisitorAdapter#combine
- ApexParserVisitorReducedAdapter
+ ASTJspDeclarations
+ ASTJspDocument
+ ScalaParserVisitorAdapter#zero
+ ScalaParserVisitorAdapter#combine
+ ApexParserVisitorReducedAdapter
-
-
+
- TypeHelper
is deprecated in
+ TypeHelper
is deprecated in
favor of TypeTestUtil
, which has the
same functionality, but a slightly changed API.
- - Many of the classes in
net.sourceforge.pmd.lang.java.symboltable
+ - Many of the classes in
net.sourceforge.pmd.lang.java.symboltable
are deprecated as internal API.
@@ -4791,11 +4896,11 @@ are deprecated as internal API.
For removal
- RuleChainVisitor
and all implementations in language modules
- AbstractRuleChainVisitor
- Language#getRuleChainVisitorClass
- BaseLanguageModule#<init>
- ImportWrapper
+ RuleChainVisitor
and all implementations in language modules
+ AbstractRuleChainVisitor
+ Language#getRuleChainVisitorClass
+ BaseLanguageModule#<init>
+ ImportWrapper
6.25.0
@@ -4823,39 +4928,39 @@ in PMD 7.0.0 and onwards.
You can identify them with the @InternalApi
annotation. You’ll also get a deprecation warning.
- AbstractIgnoredAnnotationRule
(Java)
- AbstractInefficientZeroCheck
(Java)
- AbstractJUnitRule
(Java)
- AbstractJavaMetricsRule
(Java)
- AbstractLombokAwareRule
(Java)
- AbstractPoorMethodCall
(Java)
- AbstractSunSecureRule
(Java)
- AbstractNcssCountRule
(Java)
- AbstractCommentRule
(Java)
- AbstractOptimizationRule
(Java)
- RegexHelper
(Java)
- AbstractApexUnitTestRule
(Apex)
- AbstractNcssCountRule
(Apex)
- AbstractNcssCountRule
(PLSQL)
- ApexParser
- ApexHandler
- RuleChain
- RuleSets
- RulesetsFactoryUtils#getRuleSets
+ AbstractIgnoredAnnotationRule
(Java)
+ AbstractInefficientZeroCheck
(Java)
+ AbstractJUnitRule
(Java)
+ AbstractJavaMetricsRule
(Java)
+ AbstractLombokAwareRule
(Java)
+ AbstractPoorMethodCall
(Java)
+ AbstractSunSecureRule
(Java)
+ AbstractNcssCountRule
(Java)
+ AbstractCommentRule
(Java)
+ AbstractOptimizationRule
(Java)
+ RegexHelper
(Java)
+ AbstractApexUnitTestRule
(Apex)
+ AbstractNcssCountRule
(Apex)
+ AbstractNcssCountRule
(PLSQL)
+ ApexParser
+ ApexHandler
+ RuleChain
+ RuleSets
+ RulesetsFactoryUtils#getRuleSets
For removal
- TokenEntry#TokenEntry
- AbstractTokenizerTest
. Use CpdTextComparisonTest in module pmd-lang-test instead.
+ TokenEntry#TokenEntry
+ AbstractTokenizerTest
. Use CpdTextComparisonTest in module pmd-lang-test instead.
For details see
Testing your implementation
in the developer documentation.
- ASTAnnotation#suppresses
(Apex)
- ApexXPathRule
(Apex)
- SymbolTableTestRule
(Java)
- InefficientStringBufferingRule#isInStringBufferOperation
+ ASTAnnotation#suppresses
(Apex)
+ ApexXPathRule
(Apex)
+ SymbolTableTestRule
(Java)
+ InefficientStringBufferingRule#isInStringBufferOperation
6.24.0
@@ -4863,10 +4968,10 @@ in the developer documentation.
Deprecated APIs
- BaseLanguageModule#addVersion(String, LanguageVersionHandler, boolean)
- - Some members of
TokenMgrError
, in particular, a new constructor is available
+ BaseLanguageModule#addVersion(String, LanguageVersionHandler, boolean)
+ - Some members of
TokenMgrError
, in particular, a new constructor is available
that should be preferred to the old ones
- ANTLRSyntaxError
+ ANTLRSyntaxError
Experimental APIs
@@ -4875,7 +4980,7 @@ that should be preferred to the old ones
see its javadoc for details
- - The experimental methods in
BaseLanguageModule
have been replaced by a
+ - The experimental methods in
BaseLanguageModule
have been replaced by a
definitive API.
@@ -4889,10 +4994,10 @@ definitive API.
You can identify them with the @InternalApi
annotation. You’ll also get a deprecation warning.
- AbstractXPathRuleQuery
- JaxenXPathRuleQuery
- SaxonXPathRuleQuery
- XPathRuleQuery
+ AbstractXPathRuleQuery
+ JaxenXPathRuleQuery
+ SaxonXPathRuleQuery
+ XPathRuleQuery
In ASTs
@@ -4908,76 +5013,76 @@ which for rules, means that they never need to instantiate node themselves.
Those constructors will be made package private with 7.0.0.
- Subclassing of abstract node classes, or usage of their type. The base classes are internal API
and will be hidden in version 7.0.0. You should not couple your code to them.
- - In the meantime you should use interfaces like
VfNode
or
+ - In the meantime you should use interfaces like
VfNode
or
Node
, or the other published interfaces in this package,
to refer to nodes generically.
- Concrete node classes will be made final with 7.0.0.
- Setters found in any node class or interface. Rules should consider the AST immutable.
We will make those setters package private with 7.0.0.
- - The implementation classes of
Parser
(eg VfParser
) are deprecated and should not be used directly.
-Use LanguageVersionHandler#getParser
instead.
- - The implementation classes of
TokenManager
(eg VfTokenManager
) are deprecated and should not be used outside of our implementation.
+ - The implementation classes of
Parser
(eg VfParser
) are deprecated and should not be used directly.
+Use LanguageVersionHandler#getParser
instead.
+ - The implementation classes of
TokenManager
(eg VfTokenManager
) are deprecated and should not be used outside of our implementation.
This also affects CPD-only modules.
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.
- - Apex:
net.sourceforge.pmd.lang.apex.ast
- - Javascript:
net.sourceforge.pmd.lang.ecmascript.ast
- - PL/SQL:
net.sourceforge.pmd.lang.plsql.ast
- - Scala:
net.sourceforge.pmd.lang.scala.ast
- - Visualforce:
net.sourceforge.pmd.lang.vf.ast
+ - Apex:
net.sourceforge.pmd.lang.apex.ast
+ - Javascript:
net.sourceforge.pmd.lang.ecmascript.ast
+ - PL/SQL:
net.sourceforge.pmd.lang.plsql.ast
+ - Scala:
net.sourceforge.pmd.lang.scala.ast
+ - Visualforce:
net.sourceforge.pmd.lang.vf.ast
These deprecations have already been rolled out in a previous version for the
following languages:
- - Java:
net.sourceforge.pmd.lang.java.ast
- - Java Server Pages:
net.sourceforge.pmd.lang.jsp.ast
- - Velocity Template Language:
net.sourceforge.pmd.lang.vm.ast
+ - Java:
net.sourceforge.pmd.lang.java.ast
+ - Java Server Pages:
net.sourceforge.pmd.lang.jsp.ast
+ - Velocity Template Language:
net.sourceforge.pmd.lang.vm.ast
Outside of these packages, these changes also concern the following TokenManager
implementations, and their corresponding Parser if it exists (in the same package):
- CppTokenManager
- JavaTokenManager
- Ecmascript5TokenManager
- JspTokenManager
- MatlabTokenManager
- ModelicaTokenManager
- ObjectiveCTokenManager
- PLSQLTokenManager
- PythonTokenManager
- VfTokenManager
- VmTokenManager
+ CppTokenManager
+ JavaTokenManager
+ Ecmascript5TokenManager
+ JspTokenManager
+ MatlabTokenManager
+ ModelicaTokenManager
+ ObjectiveCTokenManager
+ PLSQLTokenManager
+ PythonTokenManager
+ VfTokenManager
+ VmTokenManager
In the Java AST the following attributes are deprecated and will issue a warning when used in XPath rules:
- ASTAdditiveExpression#getImage
- use getOperator()
instead
- ASTVariableDeclaratorId#getImage
- use getName()
instead
- ASTVariableDeclaratorId#getVariableName
- use getName()
instead
+ ASTAdditiveExpression#getImage
- use getOperator()
instead
+ ASTVariableDeclaratorId#getImage
- use getName()
instead
+ ASTVariableDeclaratorId#getVariableName
- use getName()
instead
For removal
- Parser#getTokenManager
- TokenManager#setFileName
- AbstractTokenManager#setFileName
- AbstractTokenManager#getFileName
- AntlrToken#getType
- use getKind()
instead.
- ImmutableLanguage
- MockRule
- Node#getFirstParentOfAnyType
- Node#getAsDocument
- AbstractNode#hasDescendantOfAnyType
- ASTRecordDeclaration#getComponentList
- - Multiple fields, constructors and methods in
XPathRule
. See javadoc for details.
+ Parser#getTokenManager
+ TokenManager#setFileName
+ AbstractTokenManager#setFileName
+ AbstractTokenManager#getFileName
+ AntlrToken#getType
- use getKind()
instead.
+ ImmutableLanguage
+ MockRule
+ Node#getFirstParentOfAnyType
+ Node#getAsDocument
+ AbstractNode#hasDescendantOfAnyType
+ ASTRecordDeclaration#getComponentList
+ - Multiple fields, constructors and methods in
XPathRule
. See javadoc for details.
6.22.0
@@ -4990,27 +5095,27 @@ implementations, and their corresponding Parser if it exists (in the same packag
You can identify them with the @InternalApi
annotation. You’ll also get a deprecation warning.
- JavaLanguageHandler
- JavaLanguageParser
- JavaDataFlowHandler
- - Implementations of
RuleViolationFactory
in each
-language module, eg JavaRuleViolationFactory
.
-See javadoc of RuleViolationFactory
.
+ JavaLanguageHandler
+ JavaLanguageParser
+ JavaDataFlowHandler
+ - Implementations of
RuleViolationFactory
in each
+language module, eg JavaRuleViolationFactory
.
+See javadoc of RuleViolationFactory
.
-
-
Implementations of RuleViolation
in each language module,
-eg JavaRuleViolation
. See javadoc of
-RuleViolation
.
+ Implementations of RuleViolation
in each language module,
+eg JavaRuleViolation
. See javadoc of
+RuleViolation
.
- RuleFactory
- RuleBuilder
- - Constructors of
RuleSetFactory
, use factory methods from RulesetsFactoryUtils
instead
+ RuleFactory
+ RuleBuilder
+ - Constructors of
RuleSetFactory
, use factory methods from RulesetsFactoryUtils
instead
-
-
+
- AbstractApexNode
- AbstractApexNodeBase
, and the related visit
-methods on ApexParserVisitor
and its implementations.
-Use ApexNode
instead, now considers comments too.
+ AbstractApexNode
+ AbstractApexNodeBase
, and the related visit
+methods on ApexParserVisitor
and its implementations.
+Use ApexNode
instead, now considers comments too.
For removal
@@ -5018,61 +5123,61 @@ Use DFAGraphRule
and its implementations
- DFAGraphMethod
- - Many methods on the
Node
interface
-and AbstractNode
base class. See their javadoc for details.
- Node#isFindBoundary
is deprecated for XPath queries.
- - Many APIs of
net.sourceforge.pmd.lang.metrics
, though most of them were internal and
+ DFAGraphRule
and its implementations
+ DFAGraphMethod
+ - Many methods on the
Node
interface
+and AbstractNode
base class. See their javadoc for details.
+ Node#isFindBoundary
is deprecated for XPath queries.
+ - Many APIs of
net.sourceforge.pmd.lang.metrics
, though most of them were internal and
probably not used directly outside of PMD. Use MetricsUtil
as
a replacement for the language-specific façades too.
- QualifiableNode
, QualifiedName
+ QualifiableNode
, QualifiedName
- pmd-java
- AbstractJavaParser
- AbstractJavaHandler
- ASTAnyTypeDeclaration.TypeKind
- ASTAnyTypeDeclaration#getKind
- JavaQualifiedName
- ASTCatchStatement#getBlock
- ASTCompilationUnit#declarationsAreInDefaultPackage
- JavaQualifiableNode
+ AbstractJavaParser
+ AbstractJavaHandler
+ ASTAnyTypeDeclaration.TypeKind
+ ASTAnyTypeDeclaration#getTypeKind
+ JavaQualifiedName
+ ASTCatchStatement#getBlock
+ ASTCompilationUnit#declarationsAreInDefaultPackage
+ JavaQualifiableNode
- net.sourceforge.pmd.lang.java.qname
and its contents
- MethodLikeNode
+ net.sourceforge.pmd.lang.java.qname
and its contents
+ MethodLikeNode
- Its methods will also be removed from its implementations,
-
ASTMethodOrConstructorDeclaration
,
-ASTLambdaExpression
.
+ASTMethodOrConstructorDeclaration
,
+ASTLambdaExpression
.
- ASTAnyTypeDeclaration#getImage
will be removed. Please use getSimpleName()
-instead. This affects ASTAnnotationTypeDeclaration#getImage
,
-ASTClassOrInterfaceDeclaration#getImage
, and
-ASTEnumDeclaration#getImage
.
- - Several methods of
ASTTryStatement
, replacements with other names
+ ASTAnyTypeDeclaration#getImage
will be removed. Please use getSimpleName()
+instead. This affects ASTAnnotationTypeDeclaration#getImage
,
+ASTClassOrInterfaceDeclaration#getImage
, and
+ASTEnumDeclaration#getImage
.
+ - Several methods of
ASTTryStatement
, replacements with other names
have been added. This includes the XPath attribute @Finally
, replace it with a test for child::FinallyStatement
.
- Several methods named
getGuardExpressionNode
are replaced with getCondition
. This affects the
following nodes: WhileStatement, DoStatement, ForStatement, IfStatement, AssertStatement, ConditionalExpression.
- ASTYieldStatement
will not implement TypeNode
+ ASTYieldStatement
will not implement TypeNode
anymore come 7.0.0. Test the type of the expression nested within it.
- JavaMetrics
, JavaMetricsComputer
- ASTArguments#getArgumentCount
.
-Use size
instead.
- ASTFormalParameters#getParameterCount
.
-Use size
instead.
+ JavaMetrics
, JavaMetricsComputer
+ ASTArguments#getArgumentCount
.
+Use size
instead.
+ ASTFormalParameters#getParameterCount
.
+Use size
instead.
- pmd-apex
@@ -5096,11 +5201,11 @@ to refer to nodes generically.
- Concrete node classes will be made final with 7.0.0.
- Setters found in any node class or interface. Rules should consider the AST immutable.
We will make those setters package private with 7.0.0.
- - The class
JspParser
is deprecated and should not be used directly.
-Use LanguageVersionHandler#getParser
instead.
+ - The class
JspParser
is deprecated and should not be used directly.
+Use LanguageVersionHandler#getParser
instead.
-Please look at net.sourceforge.pmd.lang.jsp.ast
to find out the full list of deprecations.
+Please look at net.sourceforge.pmd.lang.jsp.ast
to find out the full list of deprecations.
In ASTs (Velocity)
@@ -5115,25 +5220,25 @@ which for rules, means that they never need to instantiate node themselves.
Those constructors will be made package private with 7.0.0.
- Subclassing of abstract node classes, or usage of their type. The base classes are internal API
and will be hidden in version 7.0.0. You should not couple your code to them.
- - In the meantime you should use interfaces like
VmNode
or
+ - In the meantime you should use interfaces like
VtlNode
or
Node
, or the other published interfaces in this package,
to refer to nodes generically.
- Concrete node classes will be made final with 7.0.0.
- Setters found in any node class or interface. Rules should consider the AST immutable.
We will make those setters package private with 7.0.0.
- - The package
net.sourceforge.pmd.lang.vm.directive
as well as the classes
-DirectiveMapper
and LogUtil
are deprecated
+ - The package
net.sourceforge.pmd.lang.vm.directive
as well as the classes
+DirectiveMapper
and LogUtil
are deprecated
for removal. They were only used internally during parsing.
- - The class
VmParser
is deprecated and should not be used directly.
-Use LanguageVersionHandler#getParser
instead.
+ - The class
VmParser
is deprecated and should not be used directly.
+Use LanguageVersionHandler#getParser
instead.
-Please look at net.sourceforge.pmd.lang.vm.ast
to find out the full list of deprecations.
+Please look at net.sourceforge.pmd.lang.vm.ast
to find out the full list of deprecations.
PLSQL AST
-The production and node ASTCursorBody
was unnecessary, not used and has been removed. Cursors have been already
-parsed as ASTCursorSpecification
.
+The production and node ASTCursorBody
was unnecessary, not used and has been removed. Cursors have been already
+parsed as ASTCursorSpecification
.
6.21.0
@@ -5145,34 +5250,34 @@ parsed as ASTCursorSpecificat
You can identify them with the @InternalApi
annotation. You’ll also get a deprecation warning.
- JavaLanguageHandler
- JavaLanguageParser
- JavaDataFlowHandler
- - Implementations of
RuleViolationFactory
in each
-language module, eg JavaRuleViolationFactory
.
-See javadoc of RuleViolationFactory
.
+ JavaLanguageHandler
+ JavaLanguageParser
+ JavaDataFlowHandler
+ - Implementations of
RuleViolationFactory
in each
+language module, eg JavaRuleViolationFactory
.
+See javadoc of RuleViolationFactory
.
-
-
Implementations of RuleViolation
in each language module,
-eg JavaRuleViolation
. See javadoc of
-RuleViolation
.
+ Implementations of RuleViolation
in each language module,
+eg JavaRuleViolation
. See javadoc of
+RuleViolation
.
- RuleFactory
- RuleBuilder
- - Constructors of
RuleSetFactory
, use factory methods from RulesetsFactoryUtils
instead
+ RuleFactory
+ RuleBuilder
+ - Constructors of
RuleSetFactory
, use factory methods from RulesetsFactoryUtils
instead
-
-
+
- AbstractApexNode
+ AbstractApexNode
-
-
AbstractApexNodeBase
, and the related visit
-methods on ApexParserVisitor
and its implementations.
-Use ApexNode
instead, now considers comments too.
+ AbstractApexNodeBase
, and the related visit
+methods on ApexParserVisitor
and its implementations.
+Use ApexNode
instead, now considers comments too.
- CharStream
, JavaCharStream
,
-SimpleCharStream
: these are APIs used by our JavaCC
+ CharStream
, JavaCharStream
,
+SimpleCharStream
: 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.
- - All classes generated by JavaCC, eg
JJTJavaParserState
.
+ - All classes generated by JavaCC, eg
JJTJavaParserState
.
This includes token classes, which will be replaced with a single implementation, and
subclasses of ParseException
, whose usages will be replaced
by just that superclass.
@@ -5183,44 +5288,44 @@ by just that superclass.
- pmd-core
- - Many methods on the
Node
interface
-and AbstractNode
base class. See their javadoc for details.
- Node#isFindBoundary
is deprecated for XPath queries.
+ - Many methods on the
Node
interface
+and AbstractNode
base class. See their javadoc for details.
+ Node#isFindBoundary
is deprecated for XPath queries.
- pmd-java
- AbstractJavaParser
- AbstractJavaHandler
- ASTAnyTypeDeclaration.TypeKind
- ASTAnyTypeDeclaration#getKind
- JavaQualifiedName
- ASTCatchStatement#getBlock
- ASTCompilationUnit#declarationsAreInDefaultPackage
- JavaQualifiableNode
+ AbstractJavaParser
+ AbstractJavaHandler
+ ASTAnyTypeDeclaration.TypeKind
+ ASTAnyTypeDeclaration#getTypeKind
+ JavaQualifiedName
+ ASTCatchStatement#getBlock
+ ASTCompilationUnit#declarationsAreInDefaultPackage
+ JavaQualifiableNode
- net.sourceforge.pmd.lang.java.qname
and its contents
- MethodLikeNode
+ net.sourceforge.pmd.lang.java.qname
and its contents
+ MethodLikeNode
- Its methods will also be removed from its implementations,
-
ASTMethodOrConstructorDeclaration
,
-ASTLambdaExpression
.
+ASTMethodOrConstructorDeclaration
,
+ASTLambdaExpression
.
- ASTAnyTypeDeclaration#getImage
will be removed. Please use getSimpleName()
-instead. This affects ASTAnnotationTypeDeclaration#getImage
,
-ASTClassOrInterfaceDeclaration#getImage
, and
-ASTEnumDeclaration#getImage
.
- - Several methods of
ASTTryStatement
, replacements with other names
+ ASTAnyTypeDeclaration#getImage
will be removed. Please use getSimpleName()
+instead. This affects ASTAnnotationTypeDeclaration#getImage
,
+ASTClassOrInterfaceDeclaration#getImage
, and
+ASTEnumDeclaration#getImage
.
+ - Several methods of
ASTTryStatement
, replacements with other names
have been added. This includes the XPath attribute @Finally
, replace it with a test for child::FinallyStatement
.
- Several methods named
getGuardExpressionNode
are replaced with getCondition
. This affects the
following nodes: WhileStatement, DoStatement, ForStatement, IfStatement, AssertStatement, ConditionalExpression.
- ASTYieldStatement
will not implement TypeNode
+ ASTYieldStatement
will not implement TypeNode
anymore come 7.0.0. Test the type of the expression nested within it.
@@ -5239,40 +5344,40 @@ anymore come 7.0.0. Test the type of the expression nested within it.
- pmd-core
- - All the package
net.sourceforge.pmd.dcd
and its subpackages. See DCD
.
- - In
LanguageRegistry
:
+ - All the package
net.sourceforge.pmd.dcd
and its subpackages. See DCD
.
+ - In
LanguageRegistry
:
- RuleSet#getExcludePatterns
. Use the new method getFileExclusions
instead.
- RuleSet#getIncludePatterns
. Use the new method getFileInclusions
instead.
- Parser#canParse
- Parser#getSuppressMap
- RuleBuilder#RuleBuilder
. Use the new constructor with the correct ResourceLoader instead.
- RuleFactory#RuleFactory
. Use the new constructor with the correct ResourceLoader instead.
+ RuleSet#getExcludePatterns
. Use the new method getFileExclusions
instead.
+ RuleSet#getIncludePatterns
. Use the new method getFileInclusions
instead.
+ Parser#canParse
+ Parser#getSuppressMap
+ RuleBuilder#RuleBuilder
. Use the new constructor with the correct ResourceLoader instead.
+ RuleFactory#RuleFactory
. Use the new constructor with the correct ResourceLoader instead.
- pmd-java
- CanSuppressWarnings
and its implementations
- isSuppressed
- getDeclaringType
.
- isSupressed
- ASTMethodDeclarator
- getMethodName
- getBlock
- getParameterCount
+ CanSuppressWarnings
and its implementations
+ isSuppressed
+ getDeclaringType
.
+ isSupressed
+ ASTMethodDeclarator
+ getMethodName
+ getBlock
+ getParameterCount
- pmd-apex
- CanSuppressWarnings
and its implementations
- isSupressed
+ CanSuppressWarnings
and its implementations
+ isSupressed
@@ -5282,10 +5387,10 @@ anymore come 7.0.0. Test the type of the expression nested within it.
- pmd-core
- - All the package
net.sourceforge.pmd.util
and its subpackages,
-except net.sourceforge.pmd.util.datasource
and net.sourceforge.pmd.util.database
.
- GridBagHelper
- ColumnDescriptor
+ - All the package
net.sourceforge.pmd.util
and its subpackages,
+except net.sourceforge.pmd.util.datasource
and net.sourceforge.pmd.util.database
.
+ GridBagHelper
+ ColumnDescriptor
@@ -5296,10 +5401,10 @@ except Renderer#setUseShortNames
which
+ Each renderer has now a new method Renderer#setUseShortNames
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
-AbstractRenderer#determineFileName
should be used. This will change
+AbstractRenderer#determineFileName
should be used. This will change
the filename to a short name, if the CLI option “shortnames” is used.
Not adjusting custom renderers will make them render always the full file names and not honoring the
@@ -5312,19 +5417,19 @@ CLI option “shortnames”.
For removal
- - The methods
getImportedNameNode
and
-getPackage
have been deprecated and
+ - The methods
ASTImportDeclaration#getImportedNameNode
and
+ASTImportDeclaration#getPackage
have been deprecated and
will be removed with PMD 7.0.0.
- - The method
RuleContext#setSourceCodeFilename
has been deprecated
-and will be removed. The already existing method RuleContext#setSourceCodeFile
-should be used instead. The method RuleContext#getSourceCodeFilename
still
+ - The method
RuleContext#setSourceCodeFilename
has been deprecated
+and will be removed. The already existing method RuleContext#setSourceCodeFile
+should be used instead. The method RuleContext#getSourceCodeFilename
still
exists and returns just the filename without the full path.
- - The method
AbstractPMDProcessor#filenameFrom
has been
+ - The method
AbstractPMDProcessor#filenameFrom
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.
- - The method
Report#metrics
and Report
have
+ - The methods
Report#metrics
and Report#hasMetrics
have
been deprecated. They were leftovers from a previous deprecation round targeting
-StatisticalRule
.
+StatisticalRule
.
Internal APIs
@@ -5334,15 +5439,15 @@ been deprecated. They were leftovers from a previous deprecation round targeting
- pmd-core
- pmd-java
- net.sourceforge.pmd.lang.java.typeresolution
: Everything, including
-subpackages, except TypeHelper
and
-JavaTypeDefinition
.
- ASTCompilationUnit#getClassTypeResolver
+ net.sourceforge.pmd.lang.java.typeresolution
: Everything, including
+subpackages, except TypeHelper
and
+JavaTypeDefinition
.
+ ASTCompilationUnit#getClassTypeResolver
@@ -5356,7 +5461,8 @@ subpackages, except InternalApi
, as they will likely be removed, hidden, or otherwise intentionally broken with 7.0.0.
+ Reminder: Please don’t use members marked with the annotation InternalApi
, as they will
+likely be removed, hidden, or otherwise intentionally broken with 7.0.0.
In ASTs
@@ -5366,17 +5472,22 @@ hide some methods and constructors that rule writers should not have access to.
The following usages are now deprecated in the Java AST (with other languages to come):
- - Manual instantiation of nodes. Constructors of node classes are deprecated and marked
InternalApi
. 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.
- - Subclassing of abstract node classes, or usage of their type. 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.
+
- Manual instantiation of nodes. Constructors of node classes are deprecated and marked
+
InternalApi
. 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.
+ - Subclassing of abstract node classes, or usage of their type. 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.
- - In the meantime you should use interfaces like
JavaNode
or Node
, or the other published interfaces in this package, to refer to nodes generically.
+ - In the meantime you should use interfaces like
JavaNode
or
+Node
, or the other published interfaces in this package, to refer to nodes generically.
- Concrete node classes will be made final with 7.0.0.
- - Setters found in any node class or interface. Rules should consider the AST immutable. We will make those setters package private with 7.0.0.
+ - Setters found in any node class or interface. Rules should consider the AST immutable. We will make those
+setters package private with 7.0.0.
-Please look at net.sourceforge.pmd.lang.java.ast
to find out the full list
+
Please look at net.sourceforge.pmd.lang.java.ast
to find out the full list
of deprecations.
6.15.0
@@ -5388,16 +5499,16 @@ of deprecations.
- The
DumpFacades
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.
- net.sourceforge.pmd.lang.apex.ast.DumpFacade
- net.sourceforge.pmd.lang.java.ast.DumpFacade
- net.sourceforge.pmd.lang.ecmascript.ast.DumpFacade
- net.sourceforge.pmd.lang.jsp.ast.DumpFacade
- net.sourceforge.pmd.lang.plsql.ast.DumpFacade
- net.sourceforge.pmd.lang.vf.ast.DumpFacade
- net.sourceforge.pmd.lang.vm.ast.AbstractVmNode#dump
- net.sourceforge.pmd.lang.xml.ast.DumpFacade
- - The method
LanguageVersionHandler#getDumpFacade
will be
-removed as well. It is deprecated, along with all its implementations in the subclasses of LanguageVersionHandler
.
+ net.sourceforge.pmd.lang.apex.ast.DumpFacade
+ net.sourceforge.pmd.lang.java.ast.DumpFacade
+ net.sourceforge.pmd.lang.ecmascript.ast.DumpFacade
+ net.sourceforge.pmd.lang.jsp.ast.DumpFacade
+ net.sourceforge.pmd.lang.plsql.ast.DumpFacade
+ net.sourceforge.pmd.lang.vf.ast.DumpFacade
+ net.sourceforge.pmd.lang.vm.ast.AbstractVmNode#dump
+ net.sourceforge.pmd.lang.xml.ast.DumpFacade
+ - The method
LanguageVersionHandler#getDumpFacade
will be
+removed as well. It is deprecated, along with all its implementations in the subclasses of LanguageVersionHandler
.
6.14.0
@@ -5418,7 +5529,7 @@ or enable preview language features (e.g. CodeClimateRule
is deprecated in 7.0.0 because it was unused for 2 years and
+ CodeClimateRule
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 #1702 for more.
@@ -5436,13 +5547,13 @@ quickstart ruleset rulesets/a
6.11.0
- StatisticalRule
and the related helper classes and base rule classes
-are deprecated for removal in 7.0.0. This includes all of net.sourceforge.pmd.stat
and net.sourceforge.pmd.lang.rule.stat
,
-and also AbstractStatisticalJavaRule
, AbstractStatisticalApexRule
and the like.
-The methods Report#addMetric
and metricAdded
+ StatisticalRule
and the related helper classes and base rule classes
+are deprecated for removal in 7.0.0. This includes all of net.sourceforge.pmd.stat
and net.sourceforge.pmd.lang.rule.stat
,
+and also AbstractStatisticalJavaRule
, AbstractStatisticalApexRule
and the like.
+The methods Report#addMetric
and metricAdded
will also be removed.
- setProperty
is deprecated,
-because MultiValuePropertyDescriptor
is deprecated as well
+ setProperty
is deprecated,
+because MultiValuePropertyDescriptor
is deprecated as well.
6.10.0
@@ -5457,11 +5568,11 @@ to remove them in 7.0.0. The proposed changes to the API are described net.sourceforge.pmd.properties.builders
,
+construction through builders. The builder hierarchy, currently found in the package net.sourceforge.pmd.properties.builders
,
is being replaced by the simpler PropertyBuilder
. Their APIs enjoy a high degree of source compatibility.
-
-
Concrete property classes like IntegerProperty
and StringMultiProperty
will gradually
+
Concrete property classes like IntegerProperty
and StringMultiProperty
will gradually
all be deprecated until 7.0.0. Their usages should be replaced by direct usage of the PropertyDescriptor
interface, e.g. PropertyDescriptor<Integer>
or PropertyDescriptor<List<String>>
.
@@ -5470,48 +5581,47 @@ interface, e.g. PropertyDescr
from 7.0.0 on the only provider for property descriptor builders. Each current property type will be replaced
by a corresponding method on PropertyFactory
:
- IntegerProperty
is replaced by PropertyFactory#intProperty
+ IntegerProperty
is replaced by PropertyFactory#intProperty
- IntegerMultiProperty
is replaced by PropertyFactory#intListProperty
+ IntegerMultiProperty
is replaced by PropertyFactory#intListProperty
- FloatProperty
and DoubleProperty
are both replaced by PropertyFactory#doubleProperty
.
+ FloatProperty
and DoubleProperty
are both replaced by PropertyFactory#doubleProperty
.
Having a separate property for floats wasn’t that useful.
- - Similarly,
FloatMultiProperty
and DoubleMultiProperty
are replaced by PropertyFactory#doubleListProperty
.
+ - Similarly,
FloatMultiProperty
and DoubleMultiProperty
are replaced by PropertyFactory#doubleListProperty
.
- StringProperty
is replaced by PropertyFactory#stringProperty
+ StringProperty
is replaced by PropertyFactory#stringProperty
- StringMultiProperty
is replaced by PropertyFactory#stringListProperty
+ StringMultiProperty
is replaced by PropertyFactory#stringListProperty
-
-
RegexProperty
is replaced by PropertyFactory#regexProperty
+ RegexProperty
is replaced by PropertyFactory#regexProperty
- EnumeratedProperty
is replaced by PropertyFactory#enumProperty
+ EnumeratedProperty
is replaced by PropertyFactory#enumProperty
- EnumeratedProperty
is replaced by PropertyFactory#enumListProperty
+ EnumeratedProperty
is replaced by PropertyFactory#enumListProperty
- BooleanProperty
is replaced by PropertyFactory#booleanProperty
+ BooleanProperty
is replaced by PropertyFactory#booleanProperty
- - Its multi-valued counterpart,
BooleanMultiProperty
, is not replaced, because it doesn’t have a use case.
+ - Its multi-valued counterpart,
BooleanMultiProperty
, is not replaced, because it doesn’t have a use case.
- CharacterProperty
is replaced by PropertyFactory#charProperty
+ CharacterProperty
is replaced by PropertyFactory#charProperty
- CharacterMultiProperty
is replaced by PropertyFactory#charListProperty
+ CharacterMultiProperty
is replaced by PropertyFactory#charListProperty
- LongProperty
is replaced by PropertyFactory#longIntProperty
+ LongProperty
is replaced by PropertyFactory#longIntProperty
- LongMultiProperty
is replaced by PropertyFactory#longIntListProperty
+ LongMultiProperty
is replaced by PropertyFactory#longIntListProperty
- MethodProperty
, FileProperty
, TypeProperty
and their multi-valued counterparts
-are discontinued for lack of a use-case, and have no planned replacement in 7.0.0 for now.
-
+ MethodProperty
, FileProperty
, TypeProperty
and their multi-valued counterparts
+are discontinued for lack of a use-case, and have no planned replacement in 7.0.0 for now.
@@ -5531,19 +5641,19 @@ are discontinued for lack of a use-case, and have no planned replacement in 7.0.
-
-
EnumeratedPropertyDescriptor
, NumericPropertyDescriptor
, PackagedPropertyDescriptor
,
-and the related builders (in net.sourceforge.pmd.properties.builders
) will be removed.
+
EnumeratedPropertyDescriptor
, NumericPropertyDescriptor
, PackagedPropertyDescriptor
,
+and the related builders (in net.sourceforge.pmd.properties.builders
) 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 PropertyConstraint
s,
+to maintain. Their functionality will be mapped uniformly to PropertyConstraint
s,
which will allow virtually any constraint to be defined, and improve documentation and error reporting. The
-related methods PropertyTypeId#isPropertyNumeric
and
-PropertyTypeId#isPropertyPackaged
are also deprecated.
+related methods PropertyTypeId#isPropertyNumeric
and
+PropertyTypeId#isPropertyPackaged
are also deprecated.
-
-
MultiValuePropertyDescriptor
and SingleValuePropertyDescriptor
+
MultiValuePropertyDescriptor
and SingleValuePropertyDescriptor
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 PropertyDescriptor#isMultiValue
will be removed
+between single- and multi-valued properties. The method PropertyDescriptor#isMultiValue
will be removed
accordingly.
@@ -5551,21 +5661,21 @@ accordingly.
Changes to the PropertyDescriptor interface
- preferredRowCount
is deprecated with no intended replacement. It was never implemented, and does not belong
-in this interface. The methods uiOrder
and compareTo(PropertyDescriptor)
are deprecated for the
+ preferredRowCount
is deprecated with no intended replacement. It was never implemented, and does not belong
+in this interface. The methods uiOrder
and compareTo(PropertyDescriptor)
are deprecated for the
same reason. These methods mix presentation logic with business logic and are not necessary for PropertyDescriptors to work.
PropertyDescriptor
will not extend Comparable<PropertyDescriptor>
anymore come 7.0.0.
- - The method
propertyErrorFor
is deprecated and will be removed with no intended
+ - The method
propertyErrorFor
is deprecated and will be removed with no intended
replacement. It’s really just a shortcut for prop.errorFor(rule.getProperty(prop))
.
- T
valueFrom(String)
and String
asDelimitedString
(T)
are deprecated and will be removed. These were
+ T
valueFrom(String)
and String
asDelimitedString
(T)
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.
- isMultiValue
and type
are deprecated and won’t be replaced. The new XML syntax will remove the need
+ isMultiValue
and type
are deprecated and won’t 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, type
will become obsolete as it can’t 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.
- errorFor
is deprecated as its return type will be changed to Optional<String>
with the shift to Java 8.
+ errorFor
is deprecated as its return type will be changed to Optional<String>
with the shift to Java 8.
Deprecated APIs
@@ -5574,27 +5684,27 @@ new way to document these properties exhaustively will be added with 7.0.0.
-
-
The implementation of the adapters for the XPath engines Saxon and Jaxen (package net.sourceforge.pmd.lang.ast.xpath
)
-are now deprecated. They’ll be moved to an internal package come 7.0.0. Only Attribute
remains public API.
+ The implementation of the adapters for the XPath engines Saxon and Jaxen (package net.sourceforge.pmd.lang.ast.xpath
)
+are now deprecated. They’ll be moved to an internal package come 7.0.0. Only Attribute
remains public API.
-
-
The classes PropertyDescriptorField
, PropertyDescriptorBuilderConversionWrapper
, and the methods
-PropertyDescriptor#attributeValuesById
, PropertyDescriptor#isDefinedExternally
and PropertyTypeId#getFactory
.
+
The classes PropertyDescriptorField
, PropertyDescriptorBuilderConversionWrapper
, and the methods
+PropertyDescriptor#attributeValuesById
, PropertyDescriptor#isDefinedExternally
and PropertyTypeId#getFactory
.
These were used to read and write properties to and from XML, but were not intended as public API.
-
-
The class ValueParserConstants
and the interface ValueParser
.
+ The class ValueParserConstants
and the interface ValueParser
.
-
-
All classes from net.sourceforge.pmd.lang.java.metrics.impl.visitors
are now considered internal API. They’re deprecated
+
All classes from net.sourceforge.pmd.lang.java.metrics.impl.visitors
are now considered internal API. They’re deprecated
and will be moved into an internal package with 7.0.0. To implement your own metrics visitors,
-JavaParserVisitorAdapter
should be directly subclassed.
+JavaParserVisitorAdapter
should be directly subclassed.
-
-
LanguageVersionHandler#getDataFlowHandler()
, LanguageVersionHandler#getDFAGraphRule()
+ LanguageVersionHandler#getDataFlowHandler()
, LanguageVersionHandler#getDFAGraphRule()
-
-
+
@@ -5602,77 +5712,72 @@ and will be moved into an internal package with 7.0.0. To implement your own met
-
-
All classes from net.sourceforge.pmd.properties.modules
will be removed.
+ All classes from net.sourceforge.pmd.properties.modules
will be removed.
-
-
The interface Dimensionable
has been deprecated.
+
The interface Dimensionable
has been deprecated.
It gets in the way of a grammar change for 7.0.0 and won’t be needed anymore (see #997).
-
-
Several methods from ASTLocalVariableDeclaration
and ASTFieldDeclaration
have
+
Several methods from ASTLocalVariableDeclaration
and ASTFieldDeclaration
have
also been deprecated:
-
-
ASTFieldDeclaration
won’t be a TypeNode
come 7.0.0, so
-getType
and
-getTypeDefinition
are deprecated.
+ ASTFieldDeclaration
won’t be a TypeNode
come 7.0.0, so
+getType
and
+getTypeDefinition
are deprecated.
-
The method getVariableName
on those two nodes will be removed, too.
-
-
-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<`<a href="https://docs.pmd-code.org/apidocs/pmd-java/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/java/ast/ASTVariableDeclaratorId.html#"><code>ASTVariableDeclaratorId</code></a>`>`
-though, so you should iterate on each declared variable. See [#910](https://github.com/pmd/pmd/issues/910).
-
-
-
+ -
+
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<
ASTVariableId
>
+though, so you should iterate on each declared variable. See #910.
+
-
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 didn’t prove cost-effective.
-
-
In net.sourceforge.pmd.lang.java.ast
: JavaParserDecoratedVisitor
, JavaParserControllessVisitor
,
-JavaParserControllessVisitorAdapter
, and JavaParserVisitorDecorator
are deprecated with no intended replacement.
+ In net.sourceforge.pmd.lang.java.ast
: JavaParserDecoratedVisitor
, JavaParserControllessVisitor
,
+JavaParserControllessVisitorAdapter
, and JavaParserVisitorDecorator
are deprecated with no intended replacement.
-
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:
- CppHandler
- CppLanguageModule
- CppParser
- CsLanguageModule
- FortranLanguageModule
- GroovyLanguageModule
- MatlabHandler
- MatlabLanguageModule
- MatlabParser
- ObjectiveCHandler
- ObjectiveCLanguageModule
- ObjectiveCParser
- PhpLanguageModule
- PythonHandler
- PythonLanguageModule
- PythonParser
- RubyLanguageModule
- ScalaLanguageModule
+ CppHandler
+ CppLanguageModule
+ CppParser
+ CsLanguageModule
+ FortranLanguageModule
+ GroovyLanguageModule
+ MatlabHandler
+ MatlabLanguageModule
+ MatlabParser
+ ObjectiveCHandler
+ ObjectiveCLanguageModule
+ ObjectiveCParser
+ PhpLanguageModule
+ PythonHandler
+ PythonLanguageModule
+ PythonParser
-
-
+
- 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 #1426. Consequently, the following APIs are deprecated for
removal:
- - In
Rule
: isDfa()
, isTypeResolution()
, isMultifile()
and their
+ - In
Rule
: isDfa()
, isTypeResolution()
, isMultifile()
and their
respective setters.
- - In
RuleSet
: usesDFA(Language)
, usesTypeResolution(Language)
, usesMultifile(Language)
- - In
RuleSets
: usesDFA(Language)
, usesTypeResolution(Language)
, usesMultifile(Language)
- - In
LanguageVersionHandler
: getDataFlowFacade()
, getSymbolFacade()
, getSymbolFacade(ClassLoader)
,
-getTypeResolutionFacade(ClassLoader)
, getQualifiedNameResolutionFacade(ClassLoader)
+ - In
RuleSet
: usesDFA(Language)
, usesTypeResolution(Language)
, usesMultifile(Language)
+ - In
RuleSets
: usesDFA(Language)
, usesTypeResolution(Language)
, usesMultifile(Language)
+ - In
LanguageVersionHandler
: getDataFlowFacade()
, getSymbolFacade()
, getSymbolFacade(ClassLoader)
,
+getTypeResolutionFacade(ClassLoader)
, getQualifiedNameResolutionFacade(ClassLoader)
@@ -5685,24 +5790,24 @@ respective setters.
-
-
A couple of methods and fields in net.sourceforge.pmd.properties.AbstractPropertySource
have been
+
A couple of methods and fields in net.sourceforge.pmd.properties.AbstractPropertySource
have been
deprecated, as they are replaced by already existing functionality or expose internal implementation
details: propertyDescriptors
, propertyValuesByDescriptor
,
copyPropertyDescriptors()
, copyPropertyValues()
, ignoredProperties()
, usesDefaultValues()
,
useDefaultValueFor()
.
-
-
Some methods in net.sourceforge.pmd.properties.PropertySource
have been deprecated as well:
+
Some methods in net.sourceforge.pmd.properties.PropertySource
have been deprecated as well:
usesDefaultValues()
, useDefaultValueFor()
, ignoredProperties()
.
-
-
The class net.sourceforge.pmd.lang.rule.AbstractDelegateRule
has been deprecated and will
+
The class net.sourceforge.pmd.lang.rule.AbstractDelegateRule
has been deprecated and will
be removed with PMD 7.0.0. It is internally only in use by RuleReference.
-
-
The default constructor of net.sourceforge.pmd.lang.rule.RuleReference
has been deprecated
+
The default constructor of net.sourceforge.pmd.lang.rule.RuleReference
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: setRuleReference()
,
+a RuleSetReference. Furthermore, the following methods are deprecated: setRuleReference()
,
hasOverriddenProperty()
, usesDefaultValues()
, useDefaultValueFor()
.
@@ -5711,8 +5816,8 @@ a RuleSetReference. Furthermore the following methods are deprecated:
-
-
All classes in the package net.sourceforge.pmd.lang.dfa.report
have been deprecated and will be removed
-with PMD 7.0.0. This includes the class net.sourceforge.pmd.lang.dfa.report.ReportTree
. The reason is,
+
All classes in the package net.sourceforge.pmd.lang.dfa.report
have been deprecated and will be removed
+with PMD 7.0.0. This includes the class net.sourceforge.pmd.lang.dfa.report.ReportTree
. The reason is,
that this class is very specific to Java and not suitable for other languages. It has only been used for
YAHTMLRenderer
, which has been rewritten to work without these classes.
@@ -5728,7 +5833,7 @@ ShiftExpression#getOperator.
-
-
The utility class net.sourceforge.pmd.lang.java.ast.CommentUtil
has been deprecated and will be removed
+
The utility class CommentUtil
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 FormalComment
, which contains as children JavadocElement
nodes, which in
turn provide access to the JavadocTag
.
@@ -5747,14 +5852,14 @@ data they might be accompanied.
6.4.0
- - The following classes in package
net.sourceforge.pmd.benchmark
have been deprecated: Benchmark
, Benchmarker
,
-BenchmarkReport
, BenchmarkResult
, RuleDuration
, StringBuilderCR
and TextReport
. Their API is not supported anymore
-and is disconnected from the internals of PMD. Use the newer API based around TimeTracker
instead, which can be found
+ - The following classes in package
net.sourceforge.pmd.benchmark
have been deprecated: Benchmark
, Benchmarker
,
+BenchmarkReport
, BenchmarkResult
, RuleDuration
, StringBuilderCR
and TextReport
. Their API is not supported anymore
+and is disconnected from the internals of PMD. Use the newer API based around TimeTracker
instead, which can be found
in the same package.
- - The class
net.sourceforge.pmd.lang.java.xpath.TypeOfFunction
has been deprecated. Use the newer TypeIsFunction
in the same package.
- - The
typeof
methods in net.sourceforge.pmd.lang.java.xpath.JavaFunctions
have been deprecated.
-Use the newer typeIs
method in the same class instead..
- - The methods
isA
, isEither
and isNeither
of net.sourceforge.pmd.lang.java.typeresolution.TypeHelper
.
+ - The class
TypeOfFunction
has been deprecated. Use the newer TypeIsFunction
in the same package.
+ - The
typeof
methods in JavaFunctions
have been deprecated.
+Use the newer typeIs
method in the same class instead.
+ - The methods
isA
, isEither
and isNeither
of TypeHelper
.
Use the new isExactlyAny
and isExactlyNone
methods in the same class instead.
@@ -5762,44 +5867,526 @@ Use the new isExactlyAny
-
-
The static method PMDParameters.transformParametersIntoConfiguration(PMDParameters)
is now deprecated,
-for removal in 7.0.0. The new instance method PMDParameters.toConfiguration()
replaces it.
+ The static method PMDParameters#transformParametersIntoConfiguration
is now deprecated,
+for removal in 7.0.0. The new instance method toConfiguration
replaces it.
-
-
The method ASTConstructorDeclaration.getParameters()
has been deprecated in favor of the new method
-getFormalParameters()
. This method is available for both ASTConstructorDeclaration
and
-ASTMethodDeclaration
.
+ The method ASTConstructorDeclaration#getParameters
has been deprecated in favor of the new method
+getFormalParameters
. This method is available for both
+ASTConstructorDeclaration
and ASTMethodDeclaration
.
6.1.0
- - The method
getXPathNodeName
is added to the Node
interface, which removes the
-use of the toString
of a node to get its XPath element name (see #569).
+ - The method
getXPathNodeName
is added to the Node
interface, which removes the
+use of toString
of a node to get its XPath element name (see #569).
- - The default implementation provided in
AbstractNode
, will
-be removed with 7.0.0
+ - The default implementation provided in
AbstractNode
, will be removed with 7.0.0
- With 7.0.0, the
Node.toString
method will not necessarily provide its XPath node
name anymore.
-
-
The interface net.sourceforge.pmd.cpd.Renderer
has been deprecated. A new interface
-net.sourceforge.pmd.cpd.renderer.CPDRenderer
has been introduced to replace it. The main
+
The interface net.sourceforge.pmd.cpd.Renderer
has been deprecated. A new interface
+CPDRenderer
has been introduced to replace it. The main
difference is that the new interface is meant to render directly to a java.io.Writer
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 OutOfMemoryError
s (see #795).
- net.sourceforge.pmd.cpd.FileReporter
has also been deprecated as part of this change, as it’s no longer needed.
+ net.sourceforge.pmd.cpd.FileReporter
has also been deprecated as part of this change, as it’s no longer needed.
6.0.1
- - The constant
net.sourceforge.pmd.PMD.VERSION
has been deprecated and will be removed with PMD 7.0.0.
-Please use net.sourceforge.pmd.PMDVersion.VERSION
instead.
+ - The constant
PMD#VERSION
has been deprecated and will be removed with PMD 7.0.0.
+Please use PMDVersion#VERSION
instead.
+
+
+🐛 Fixed Issues
+
+
+ - miscellaneous
+
+ - #881: [all] Breaking API changes for 7.0.0
+ - #896: [all] Use slf4j
+ - #1431: [ui] Remove old GUI applications (designerold, bgastviewer)
+ - #1451: [core] RulesetFactoryCompatibility stores the whole ruleset file in memory as a string
+ - #2496: Update PMD 7 Logo on landing page
+ - #2497: PMD 7 Logo page
+ - #2498: Update PMD 7 Logo in documentation
+ - #3797: [all] Use JUnit5
+ - #4462: Provide Software Bill of Materials (SBOM)
+ - #4460: Fix assembly-plugin warnings
+ - #4582: [dist] Download link broken
+ - #4586: Use explicit encoding in ruleset xml files
+ - #4642: Update regression tests with Java 21 language features
+ - #4691: [CVEs] Critical and High CEVs reported on PMD and PMD dependencies
+ - #4699: Make PMD buildable with java 21
+ - #4736: [ci] Improve build procedure
+ - #4741: Add pmd-compat6 module for maven-pmd-plugin
+ - #4749: Fixes NoSuchMethodError on processing errors in pmd-compat6
+ - #4776: [ci] Upgrade to ruby 3
+ - #4796: Remove deprecated and release rulesets
+ - #4823: Update to use renamed pmd-designer
+ - #4827: [compat6] Support config errors and cpd for csharp
+ - #4830: Consolidate packages in each maven module
+
+
+ - ant
+
+ - #4080: [ant] Split off Ant integration into a new submodule
+
+
+ - core
+
+ - #880: [core] Make visitors generic
+ - #1027: [core] Apply the new PropertyDescriptor<Pattern> type where applicable
+ - #1204: [core] Allow numeric properties in XML to be within an unbounded range
+ - #1622: [core] NodeStream API
+ - #1687: [core] Deprecate and Remove XPath 1.0 support
+ - #1785: [core] Allow abstract node types to be valid rulechain visits
+ - #1825: [core] Support NoAttribute for XPath
+ - #2038: [core] Remove DCD
+ - #2218: [core]
isFindBoundary
should not be an attribute
+ - #2234: [core] Consolidate PMD CLI into a single command
+ - #2239: [core] Merging Javacc build scripts
+ - #2500: [core] Clarify API for ANTLR based languages
+ - #2518: [core] Language properties
+ - #2602: [core] Remove ParserOptions
+ - #2614: [core] Upgrade Saxon, add XPath 3.1, remove Jaxen
+ - #2696: [core] Remove DFA
+ - #2821: [core] Rule processing error filenames are missing paths
+ - #2873: [core] Utility classes in pmd 7
+ - #2885: [core] Error recovery mode
+ - #3203: [core] Replace RuleViolationFactory implementations with ViolationDecorator
+ - #3692: [core] Analysis listeners
+ - #3782: [core] Language lifecycle
+ - #3815: [core] Update Saxon HE to 10.7
+ - #3893: [core] Text documents
+ - #3902: [core] Violation decorators
+ - #3903: [core] Consolidate
n.s.pmd.reporting
package
+ - #3905: [core] Stabilize tree export API
+ - #3917: [core] Consolidate
n.s.pmd.lang.rule
package
+ - #3918: [core] Make LanguageRegistry non static
+ - #3919: [core] Merge CPD and PMD language
+ - #3922: [core] Better error reporting for the ruleset parser
+ - #4035: [core] ConcurrentModificationException in DefaultRuleViolationFactory
+ - #4065: [core] Rename TokenMgrError to LexException, Tokenizer to CpdLexer
+ - #4120: [core] Explicitly name all language versions
+ - #4204: [core] Provide a CpdAnalysis class as a programmatic entry point into CPD
+ - #4301: [core] Remove deprecated property concrete classes
+ - #4302: [core] Migrate Property Framework API to Java 8
+ - #4309: [core] Cleanups in XPath area
+ - #4312: [core] Remove unnecessary property
color
and system property pmd.color
in TextColorRenderer
+ - #4313: [core] Remove support for <lang>-<ruleset> hyphen notation for ruleset references
+ - #4314: [core] Remove ruleset compatibility filter (RuleSetFactoryCompatibility) and CLI option
--no-ruleset-compatibility
+ - #4323: [core] Refactor CPD integration
+ - #4348: [core] Consolidate @InternalApi classes
+ - #4349: [core] Cleanup remaining experimental and deprecated API
+ - #4353: [core] Micro optimizations for Node API
+ - #4365: [core] Improve benchmarking
+ - #4397: [core] Refactor CPD
+ - #4378: [core] Ruleset loading processes commented rules
+ - #4420: [core] Remove PMD.EOL
+ - #4425: [core] Replace TextFile::pathId
+ - #4454: [core] “Unknown option: ‘-min’” but is referenced in documentation
+ - #4611: [core] Fix loading language properties from env vars
+ - #4621: [core] Make
ClasspathClassLoader::getResource
child first
+ - #4674: [core] WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass
+ - #4694: [core] Fix line/col numbers in TokenMgrError
+ - #4717: [core] XSLTRenderer doesn’t close report file
+ - #4750: [core] Fix flaky SummaryHTMLRenderer
+ - #4782: [core] Avoid using getImage/@Image
+
+
+ - cli
+
+ - #2234: [core] Consolidate PMD CLI into a single command
+ - #3828: [core] Progress reporting
+ - #4079: [cli] Split off CLI implementation into a pmd-cli submodule
+ - #4423: [cli] Fix NPE when only
--file-list
is specified
+ - #4482: [cli] pmd.bat can only be executed once
+ - #4484: [cli] ast-dump with no properties produce an NPE
+ - #4594: [cli] Change completion generation to runtime
+ - #4685: [cli] Clarify CPD documentation, fix positional parameter handling
+ - #4723: [cli] Launch fails for “bash pmd”
+
+
+ - doc
+
+ - #995: [doc] Document API evolution principles as ADR
+ - #2501: [doc] Verify ANTLR Documentation
+ - #2511: [doc] Review guides for writing java/xpath rules for correctness with PMD 7
+ - #3175: [doc] Document language module features
+ - #4294: [doc] Migration Guide for upgrading PMD 6 ➡️ 7
+ - #4303: [doc] Document new property framework
+ - #4308: [doc] Document XPath API @DeprecatedAttribute
+ - #4319: [doc] Document TypeRes API and Symbols API
+ - #4438: [doc] Documentation links in VS Code are outdated
+ - #4521: [doc] Website is not mobile friendly
+ - #4676: [doc] Clarify how CPD
--ignore-literals
and --ignore-identifiers
work
+ - #4659: [doc] Improve ant documentation
+ - #4669: [doc] Add bld PMD Extension to Tools / Integrations
+ - #4704: [doc] Multivalued properties do not accept | as a separator
+
+
+ - testing
+
+
+
+
+Language specific fixes:
+
+
+ - apex
+
+ - #1937: [apex] Apex should only have a single RootNode
+ - #1648: [apex,vf] Remove CodeClimate dependency
+ - #1750: [apex] Remove apex statistical rules
+ - #2836: [apex] Remove Apex ProjectMirror
+ - #3766: [apex] Replace Jorje with fully open source front-end
+ - #3973: [apex] Update parser to support new ‘as user’ keywords (User Mode for Database Operations)
+ - #4427: [apex] ApexBadCrypto test failing to detect inline code
+ - #4453: [apex] [7.0-rc1] Exception while initializing Apexlink (Index 34812 out of bounds for length 34812)
+
+
+ - apex-design
+
+
+ - apex-documentation
+
+ - #4774: [apex] ApexDoc false-positive for the first method of an annotated Apex class
+
+
+ - apex-performance
+
+ - #4675: [apex] New Rule: OperationWithHighCostInLoop
+
+
+ - apex-security
+
+ - #4646: [apex] ApexSOQLInjection does not recognise SObjectType or SObjectField as safe variable types
+
+
+ - groovy
+
+ - #4726: [groovy] Support Groovy to 3 and 4 and CPD suppressions
+
+
+ - java
+
+ - #520: [java] Allow
@SuppressWarnings
with constants instead of literals
+ - #864: [java] Similar/duplicated implementations for determining FQCN
+ - #905: [java] Add new node for anonymous class declaration
+ - #910: [java] AST inconsistency between primitive and reference type arrays
+ - #997: [java] Java8 parsing corner case with annotated array types
+ - #998: [java] AST inconsistencies around FormalParameter
+ - #1019: [java] Breaking Java Grammar changes for PMD 7.0.0
+ - #1124: [java] ImmutableList implementation in the qname codebase
+ - #1128: [java] Improve ASTLocalVariableDeclaration
+ - #1150: [java] ClassOrInterfaceType AST improvements
+ - #1207: [java] Resolve explicit types using FQCNs, without hitting the classloader
+ - #1307: [java] AccessNode API changes
+ - #1367: [java] Parsing error on annotated inner class
+ - #1661: [java] About operator nodes
+ - #2366: [java] Remove qualified names
+ - #2819: [java] GLB bugs in pmd 7
+ - #3642: [java] Parse error on rare extra dimensions on method return type on annotation methods
+ - #3763: [java] Ambiguous reference error in valid code
+ - #3749: [java] Improve
isOverridden
in ASTMethodDeclaration
+ - #3750: [java] Make symbol table support instanceof pattern bindings
+ - #3751: [java] Rename some node types
+ - #3752: [java] Expose annotations in symbol API
+ - #4237: [java] Cleanup handling of Java comments
+ - #4317: [java] Some AST nodes should not be TypeNodes
+ - #4359: [java] Type resolution fails with NPE when the scope is not a type declaration
+ - #4367: [java] Move testrule TypeResTest into internal
+ - #4383: [java] IllegalStateException: Object is not an array type!
+ - #4401: [java] PMD 7 fails to build under Java 19
+ - #4405: [java] Processing error with ArrayIndexOutOfBoundsException
+ - #4583: [java] Support JDK 21 (LTS)
+ - #4628: [java] Support loading classes from java runtime images
+ - #4753: [java] PMD crashes while using generics and wildcards
+ - #4757: [java] Intermittent NPEs while analyzing Java code
+ - #4794: [java] Support JDK 22
+
+
+ - java-bestpractices
+
+ - #342: [java] AccessorMethodGeneration: Name clash with another public field not properly handled
+ - #755: [java] AccessorClassGeneration false positive for private constructors
+ - #770: [java] UnusedPrivateMethod yields false positive for counter-variant arguments
+ - #807: [java] AccessorMethodGeneration false positive with overloads
+ - #833: [java] ForLoopCanBeForeach should consider iterating on this
+ - #1189: [java] UnusedPrivateMethod false positive from inner class via external class
+ - #1205: [java] Improve ConstantsInInterface message to mention alternatives
+ - #1212: [java] Don’t raise JUnitTestContainsTooManyAsserts on JUnit 5’s assertAll
+ - #1422: [java] JUnitTestsShouldIncludeAssert false positive with inherited @Rule field
+ - #1455: [java] JUnitTestsShouldIncludeAssert: False positives for assert methods named “check” and “verify”
+ - #1563: [java] ForLoopCanBeForeach false positive with method call using index variable
+ - #1565: [java] JUnitAssertionsShouldIncludeMessage false positive with AssertJ
+ - #1747: [java] PreserveStackTrace false-positive
+ - #1969: [java] MissingOverride false-positive triggered by package-private method overwritten in another package by extending class
+ - #1998: [java] AccessorClassGeneration false-negative: subclass calls private constructor
+ - #2130: [java] UnusedLocalVariable: false-negative with array
+ - #2147: [java] JUnitTestsShouldIncludeAssert - false positives with lambdas and static methods
+ - #2464: [java] LooseCoupling must ignore class literals: ArrayList.class
+ - #2542: [java] UseCollectionIsEmpty can not detect the case
foo.bar().size()
+ - #2650: [java] UseTryWithResources false positive when AutoCloseable helper used
+ - #2796: [java] UnusedAssignment false positive with call chains
+ - #2797: [java] MissingOverride long-standing issues
+ - #2806: [java] SwitchStmtsShouldHaveDefault false-positive with Java 14 switch non-fallthrough branches
+ - #2822: [java] LooseCoupling rule: Extend to cover user defined implementations and interfaces
+ - #2843: [java] Fix UnusedAssignment FP with field accesses
+ - #2882: [java] UseTryWithResources - false negative for explicit close
+ - #2883: [java] JUnitAssertionsShouldIncludeMessage false positive with method call
+ - #2890: [java] UnusedPrivateMethod false positive with generics
+ - #2946: [java] SwitchStmtsShouldHaveDefault false positive on enum inside enums
+ - #3672: [java] LooseCoupling - fix false positive with generics
+ - #3675: [java] MissingOverride - fix false positive with mixing type vars
+ - #3858: [java] UseCollectionIsEmpty should infer local variable type from method invocation
+ - #4433: [java] [7.0-rc1] ReplaceHashtableWithMap on java.util.Properties
+ - #4492: [java] GuardLogStatement gives false positive when argument is a Java method reference
+ - #4503: [java] JUnitTestsShouldIncludeAssert: false negative with TestNG
+ - #4516: [java] UnusedLocalVariable: false-negative with try-with-resources
+ - #4517: [java] UnusedLocalVariable: false-negative with compound assignments
+ - #4518: [java] UnusedLocalVariable: false-positive with multiple for-loop indices
+ - #4603: [java] UnusedAssignment false positive in record compact constructor
+ - #4625: [java] UnusedPrivateMethod false positive: Autoboxing into Number
+ - #4634: [java] JUnit4TestShouldUseTestAnnotation false positive with TestNG
+
+
+ - java-codestyle
+
+ - #1208: [java] PrematureDeclaration rule false-positive on variable declared to measure time
+ - #1429: [java] PrematureDeclaration as result of method call (false positive)
+ - #1480: [java] IdenticalCatchBranches false positive with return expressions
+ - #1673: [java] UselessParentheses false positive with conditional operator
+ - #1790: [java] UnnecessaryFullyQualifiedName false positive with enum constant
+ - #1918: [java] UselessParentheses false positive with boolean operators
+ - #2134: [java] PreserveStackTrace not handling
Throwable.addSuppressed(...)
+ - #2299: [java] UnnecessaryFullyQualifiedName false positive with similar package name
+ - #2391: [java] UseDiamondOperator FP when expected type and constructed type have a different parameterization
+ - #2528: [java] MethodNamingConventions - JUnit 5 method naming not support ParameterizedTest
+ - #2739: [java] UselessParentheses false positive for string concatenation
+ - #2748: [java] UnnecessaryCast false positive with unchecked cast
+ - #2847: [java] New Rule: Use Explicit Types
+ - #2973: [java] New rule: UnnecessaryBoxing
+ - #3195: [java] Improve rule UnnecessaryReturn to detect more cases
+ - #3218: [java] Generalize UnnecessaryCast to flag all unnecessary casts
+ - #3221: [java] PrematureDeclaration false positive for unused variables
+ - #3238: [java] Improve ExprContext, fix FNs of UnnecessaryCast
+ - #3500: [java] UnnecessaryBoxing - check for Integer.valueOf(String) calls
+ - #4239: [java] UnnecessaryLocalBeforeReturn - false positive with catch clause
+ - #4268: [java] CommentDefaultAccessModifier: false positive with TestNG annotations
+ - #4273: [java] CommentDefaultAccessModifier ignoredAnnotations should include “org.junit.jupiter.api.extension.RegisterExtension” by default
+ - #4357: [java] Fix IllegalStateException in UseDiamondOperator rule
+ - #4432: [java] [7.0-rc1] UnnecessaryImport - Unused static import is being used
+ - #4455: [java] FieldNamingConventions: false positive with lombok’s @UtilityClass
+ - #4487: [java] UnnecessaryConstructor: false-positive with @Inject and @Autowired
+ - #4511: [java] LocalVariableCouldBeFinal shouldn’t report unused variables
+ - #4512: [java] MethodArgumentCouldBeFinal shouldn’t report unused parameters
+ - #4557: [java] UnnecessaryImport FP with static imports of overloaded methods
+ - #4578: [java] CommentDefaultAccessModifier comment needs to be before annotation if present
+ - #4631: [java] UnnecessaryFullyQualifiedName fails to recognize illegal self reference in enums
+ - #4645: [java] CommentDefaultAccessModifier - False Positive with JUnit5’s ParameterizedTest
+ - #4754: [java] EmptyControlStatementRule: Add allowCommentedBlocks property
+ - #4816: [java] UnnecessaryImport false-positive on generic method call with on lambda
+
+
+ - java-design
+
+ - #174: [java] SingularField false positive with switch in method that both assigns and reads field
+ - #1014: [java] LawOfDemeter: False positive with lambda expression
+ - #1605: [java] LawOfDemeter: False positive for standard UTF-8 charset name
+ - #2160: [java] Issues with Law of Demeter
+ - #2175: [java] LawOfDemeter: False positive for chained methods with generic method call
+ - #2179: [java] LawOfDemeter: False positive with static property access - should treat class-level property as global object, not dot-accessed property
+ - #2180: [java] LawOfDemeter: False positive with Thread and ThreadLocalRandom
+ - #2182: [java] LawOfDemeter: False positive with package-private access
+ - #2188: [java] LawOfDemeter: False positive with fields assigned to local vars
+ - #2536: [java] ClassWithOnlyPrivateConstructorsShouldBeFinal can’t detect inner class
+ - #3668: [java] ClassWithOnlyPrivateConstructorsShouldBeFinal - fix FP with inner private classes
+ - #3754: [java] SingularField false positive with read in while condition
+ - #3786: [java] SimplifyBooleanReturns should consider operator precedence
+ - #3840: [java] LawOfDemeter disallows method call on locally created object
+ - #4238: [java] Make LawOfDemeter not use the rulechain
+ - #4254: [java] ImmutableField - false positive with Lombok @Setter
+ - #4434: [java] [7.0-rc1] ExceptionAsFlowControl when simply propagating
+ - #4456: [java] FinalFieldCouldBeStatic: false positive with lombok’s @UtilityClass
+ - #4477: [java] SignatureDeclareThrowsException: false-positive with TestNG annotations
+ - #4490: [java] ImmutableField - false negative with Lombok @Getter
+ - #4549: [java] Make LawOfDemeter results deterministic
+
+
+ - java-documentation
+
+
+ - java-errorprone
+
+ - #659: [java] MissingBreakInSwitch - last default case does not contain a break
+ - #718: [java] BrokenNullCheck false positive with parameter/field confusion
+ - #932: [java] SingletonClassReturningNewInstance false positive with double assignment
+ - #1005: [java] CloneMethodMustImplementCloneable triggers for interfaces
+ - #1669: [java] NullAssignment - FP with ternay and null as constructor argument
+ - #1831: [java] DetachedTestCase reports abstract methods
+ - #1899: [java] Recognize @SuppressWanings(“fallthrough”) for MissingBreakInSwitch
+ - #2320: [java] NullAssignment - FP with ternary and null as method argument
+ - #2532: [java] AvoidDecimalLiteralsInBigDecimalConstructor can not detect the case
new BigDecimal(Expression)
+ - #2579: [java] MissingBreakInSwitch detects the lack of break in the last case
+ - #2880: [java] CompareObjectsWithEquals - false negative with type res
+ - #2893: [java] Remove special cases from rule EmptyCatchBlock
+ - #2894: [java] Improve MissingBreakInSwitch
+ - #3071: [java] BrokenNullCheck FP with PMD 6.30.0
+ - #3087: [java] UnnecessaryBooleanAssertion overlaps with SimplifiableTestAssertion
+ - #3100: [java] UseCorrectExceptionLogging FP in 6.31.0
+ - #3173: [java] UseProperClassLoader false positive
+ - #3351: [java] ConstructorCallsOverridableMethod ignores abstract methods
+ - #3400: [java] AvoidUsingOctalValues FN with underscores
+ - #3843: [java] UseEqualsToCompareStrings should consider return type
+ - #4063: [java] AvoidBranchingStatementAsLastInLoop: False-negative about try/finally block
+ - #4356: [java] Fix NPE in CloseResourceRule
+ - #4449: [java] AvoidAccessibilityAlteration: Possible false positive in AvoidAccessibilityAlteration rule when using Lambda expression
+ - #4457: [java] OverrideBothEqualsAndHashcode: false negative with anonymous classes
+ - #4493: [java] MissingStaticMethodInNonInstantiatableClass: false-positive about @Inject
+ - #4505: [java] ImplicitSwitchFallThrough NPE in PMD 7.0.0-rc1
+ - #4510: [java] ConstructorCallsOverridableMethod: false positive with lombok’s @Value
+ - #4513: [java] UselessOperationOnImmutable various false negatives with String
+ - #4514: [java] AvoidLiteralsInIfCondition false positive and negative for String literals when ignoreExpressions=true
+ - #4546: [java] OverrideBothEqualsAndHashCode ignores records
+ - #4719: [java] UnnecessaryCaseChange: example doc toUpperCase() should compare to a capitalized string
+
+
+ - java-multithreading
+
+ - #2537: [java] DontCallThreadRun can’t detect the case that call run() in
this.run()
+ - #2538: [java] DontCallThreadRun can’t detect the case that call run() in
foo.bar.run()
+ - #2577: [java] UseNotifyAllInsteadOfNotify falsely detect a special case with argument:
foo.notify(bar)
+ - #4483: [java] NonThreadSafeSingleton false positive with double-checked locking
+
+
+ - java-performance
+
+ - #1224: [java] InefficientEmptyStringCheck false negative in anonymous class
+ - #2587: [java] AvoidArrayLoops could also check for list copy through iterated List.add()
+ - #2712: [java] SimplifyStartsWith false-positive with AssertJ
+ - #3486: [java] InsufficientStringBufferDeclaration: Fix NPE
+ - #3848: [java] StringInstantiation: false negative when using method result
+ - #4070: [java] A false positive about the rule RedundantFieldInitializer
+ - #4458: [java] RedundantFieldInitializer: false positive with lombok’s @Value
+
+
+ - javascript
+
+ - #4673: [javascript] CPD: Added support for decorator notation
+
+
+ - kotlin
+
+
+ - plsql
+
+ - #4820: [plsql] WITH clause is ignored for SELECT INTO statements
+
+
+ - swift
+
+
+ - xml
+
+ - #1800: [xml] Unimplement org.w3c.dom.Node from the XmlNodeWrapper
+
+
+ - xml-bestpractices
+
+ - #4592: [xml] Add MissingEncoding rule
+
+
+
+
+✨ External Contributions
+
+
+ - #1658: [core] Node support for Antlr-based languages - Matías Fraga (@matifraga)
+ - #1698: [core] [swift] Antlr Base Parser adapter and Swift Implementation - Lucas Soncini (@lsoncini)
+ - #1774: [core] Antlr visitor rules - Lucas Soncini (@lsoncini)
+ - #1877: [swift] Feature/swift rules - Matías Fraga (@matifraga)
+ - #1881: [doc] Add ANTLR documentation - Matías Fraga (@matifraga)
+ - #1882: [swift] UnavailableFunction Swift rule - Tomás de Lucca (@tomidelucca)
+ - #2830: [apex] Apexlink POC - Kevin Jones (@nawforce)
+ - #3866: [core] Add CLI Progress Bar - @JerritEic (@JerritEic)
+ - #4093: [apex] Summit-AST Apex module - Part 1 - Edward Klimoshenko (@eklimo)
+ - #4151: [apex] Summit-AST Apex module - Part 2 - expression nodes - Aaron Hurst (@aaronhurst-google)
+ - #4171: [apex] Summit-AST Apex module - Part 3 - initializers - Aaron Hurst (@aaronhurst-google)
+ - #4206: [apex] Summit-AST Apex module - Part 4 - statements - Aaron Hurst (@aaronhurst-google)
+ - #4219: [apex] Summit-AST Apex module - Part 5 - annotations, triggers, misc. - Aaron Hurst (@aaronhurst-google)
+ - #4242: [apex] Merge 6.52 into experimental-apex-parser - Aaron Hurst (@aaronhurst-google)
+ - #4251: [apex] Summit-AST Apex module - Part 6 Passing testsuite - Aaron Hurst (@aaronhurst-google)
+ - #4402: [javascript] CPD: add support for Typescript using antlr4 grammar - Paul Guyot (@pguyot)
+ - #4403: [julia] CPD: Add support for Julia code duplication - Wener (@wener-tiobe)
+ - #4412: [doc] Added new error msg to ConstantsInInterface - David Ljunggren (@dague1)
+ - #4426: [cpd] New XML to HTML XLST report format for PMD CPD - mohan-chinnappan-n (@mohan-chinnappan-n)
+ - #4428: [apex] ApexBadCrypto bug fix for #4427 - inline detection of hard coded values - Steven Stearns (@sfdcsteve)
+ - #4431: [coco] CPD: Coco support for code duplication detection - Wener (@wener-tiobe)
+ - #4444: [java] CommentDefaultAccessModifier - ignore org.junit.jupiter.api.extension.RegisterExtension by default - Nirvik Patel (@nirvikpatel)
+ - #4448: [apex] Bump summit-ast to new release 2.1.0 (and remove workaround) - Aaron Hurst (@aaronhurst-google)
+ - #4450: [java] Fix #4449 AvoidAccessibilityAlteration: Correctly handle Lambda expressions in PrivilegedAction scenarios - Seren (@mohui1999)
+ - #4452: [doc] Update PMD_APEX_ROOT_DIRECTORY documentation reference - nwcm (@nwcm)
+ - #4470: [cpp] CPD: Added strings as literal and ignore identifiers in sequences - Wener (@wener-tiobe)
+ - #4474: [java] ImmutableField: False positive with lombok (fixes #4254) - Pim van der Loos (@PimvanderLoos)
+ - #4479: [apex] Merge main (7.x) branch into experimental-apex-parser and fix tests - Aaron Hurst (@aaronhurst-google)
+ - #4488: [java] Fix #4477: A false-positive about SignatureDeclareThrowsException - AnnaDev (@LynnBroe)
+ - #4494: [java] Fix #4487: A false-positive about UnnecessaryConstructor and @Inject and @Autowired - AnnaDev (@LynnBroe)
+ - #4495: [java] Fix #4493: false-positive about MissingStaticMethodInNonInstantiatableClass and @Inject - AnnaDev (@LynnBroe)
+ - #4507: [java] Fix #4503: A false negative about JUnitTestsShouldIncludeAssert and testng - AnnaDev (@LynnBroe)
+ - #4520: [doc] Fix typo: missing closing quotation mark after CPD-END - João Dinis Ferreira (@joaodinissf)
+ - #4528: [apex] Update to apexlink - Kevin Jones (@nawforce)
+ - #4533: [java] Fix #4063: False-negative about try/catch block in Loop - AnnaDev (@LynnBroe)
+ - #4536: [java] Fix #4268: CommentDefaultAccessModifier - false positive with TestNG’s @Test annotation - AnnaDev (@LynnBroe)
+ - #4537: [java] Fix #4455: A false positive about FieldNamingConventions and UtilityClass - AnnaDev (@LynnBroe)
+ - #4538: [java] Fix #4456: A false positive about FinalFieldCouldBeStatic and UtilityClass - AnnaDev (@LynnBroe)
+ - #4540: [java] Fix #4457: false negative about OverrideBothEqualsAndHashcode - AnnaDev (@LynnBroe)
+ - #4541: [java] Fix #4458: A false positive about RedundantFieldInitializer and @Value - AnnaDev (@LynnBroe)
+ - #4542: [java] Fix #4510: A false positive about ConstructorCallsOverridableMethod and @Value - AnnaDev (@LynnBroe)
+ - #4553: [java] Fix #4492: GuardLogStatement gives false positive when argument is a Java method reference - Anastasiia Koba (@anastasiia-koba)
+ - #4637: [java] fix #4634 - JUnit4TestShouldUseTestAnnotation false positive with TestNG - Krystian Dabrowski (@krdabrowski)
+ - #4640: [cli] Launch script fails if run via “bash pmd” - Shai Bennathan (@shai-bennathan)
+ - #4649: [apex] Add SObjectType and SObjectField to list of injectable SOQL variable types - Richard Corfield (@rcorfieldffdc)
+ - #4651: [doc] Add “Tencent Cloud Code Analysis” in Tools / Integrations - yale (@cyw3)
+ - #4664: [cli] CPD: Fix NPE when only
--file-list
is specified - Wener (@wener-tiobe)
+ - #4665: [java] Doc: Fix references AutoClosable -> AutoCloseable - Andrey Bozhko (@AndreyBozhko)
+ - #4673: [javascript] CPD: Added support for decorator notation - Wener (@wener-tiobe)
+ - #4677: [apex] Add new rule: OperationWithHighCostInLoop - Thomas Prouvot (@tprouvot)
+ - #4698: [swift] Add macro expansion support for swift 5.9 - Richard B. (@kenji21)
+ - #4706: [java] DetachedTestCase should not report on abstract methods - Debamoy Datta (@Debamoy)
+ - #4719: [java] UnnecessaryCaseChange: example doc toUpperCase() should compare to a capitalized string - ciufudean (@ciufudean)
+ - #4738: [doc] Added reference to the PMD extension for bld - Erik C. Thauvin (@ethauvin)
+ - #4749: Fixes NoSuchMethodError on processing errors in pmd-compat6 - Andreas Bergander (@bergander)
+ - #4750: [core] Fix flaky SummaryHTMLRenderer - 219sansim (@219sansim)
+ - #4754: [java] EmptyControlStatementRule: Add allowCommentedBlocks property - Andreas Bergander (@bergander)
+ - #4759: [java] fix: remove delimiter attribute from ruleset category/java/errorprone.xml - Marcin Dąbrowski (@marcindabrowski)
+ - #4825: [plsql] Fix ignored WITH clause for SELECT INTO statements - Laurent Bovet (@lbovet)
diff --git a/pmd_rules_java.html b/pmd_rules_java.html
index 9e3f943b86..d489154fd4 100644
--- a/pmd_rules_java.html
+++ b/pmd_rules_java.html
@@ -2180,7 +2180,7 @@
- UseArrayListInsteadOfVector: ArrayList is a much better Collection implementation than Vector if thread-safe operation is not …
- UseArraysAsList: The ‘java.util.Arrays’ class has a ‘asList()’ method that should be used when you want to create …
- UseIndexOfChar: Use String.indexOf(char) when checking for the index of a single character; it executes faster.
- - UseIOStreamsWithApacheCommonsFileItem: Problem: Use of [FileItem.get()](https://commons.apache.org/proper/commons-fileupload/apidocs/org…
+ - UseIOStreamsWithApacheCommonsFileItem: Problem: Use of [FileItem.get()](https://javadoc.io/static/commons-fileupload/commons-fileupload/…
- UselessStringValueOf: No need to call String.valueOf to append to a string; just use the valueOf() argument directly.
- UseStringBufferForStringAppends: The use of the ‘+=’ operator for appending strings causes the JVM to create and use an internal S…
- UseStringBufferLength: Use StringBuffer.length() to determine StringBuffer length rather than using StringBuffer.toStrin…
diff --git a/pmd_rules_java_errorprone.html b/pmd_rules_java_errorprone.html
index 8081caa80f..f403a303c5 100644
--- a/pmd_rules_java_errorprone.html
+++ b/pmd_rules_java_errorprone.html
@@ -1982,7 +1982,7 @@ If the call to setAccessible<
is assumed to be deliberate and is not reported.
Note that with Java 17 the Security Manager, which is used for PrivilegedAction
execution,
-is deprecated: JEP 411: Deprecate the Security Manager for Removal.
+is deprecated: JEP 411: Deprecate the Security Manager for Removal.
For future-proof code, deliberate access alteration should be suppressed using the usual
suppression methods (e.g. by using @SuppressWarnings
annotation).
diff --git a/pmd_rules_java_performance.html b/pmd_rules_java_performance.html
index 232827ce88..cbf0f446d3 100644
--- a/pmd_rules_java_performance.html
+++ b/pmd_rules_java_performance.html
@@ -2093,7 +2093,7 @@ calendar calculations are needed.
The FileInputStream and FileOutputStream classes contains a finalizer method which will cause garbage
collection pauses.
-See JDK-8080225 for details.
+See JDK-8080225 for details.
The FileReader and FileWriter constructors instantiate FileInputStream and FileOutputStream,
again causing garbage collection issues while finalizer methods are called.
@@ -2676,11 +2676,11 @@ You must use new ArrayList<
Priority: Medium (3)
-Problem: Use of FileItem.get()
-and FileItem.getString()
+
Problem: Use of FileItem.get()
+and FileItem.getString()
could exhaust memory since they load the entire file into memory.
-Solution: Use FileItem.getInputStream()
+
Solution: Use FileItem.getInputStream()
and buffering.
This rule is defined by the following XPath expression:
diff --git a/pmd_userdocs_cli_reference.html b/pmd_userdocs_cli_reference.html
index 6d6692932b..820f32cd25 100644
--- a/pmd_userdocs_cli_reference.html
+++ b/pmd_userdocs_cli_reference.html
@@ -2495,7 +2495,7 @@
Additional Java Runtime Options
PMD is executed via a Java runtime. In some cases, you might need to set additional runtime options, e.g.
-if you want to analyze a project, that uses one of OpenJDK’s Preview Language Features.
+if you want to analyze a project, that uses one of OpenJDK’s JEP 12: Preview Language Features.
Just set the environment variable PMD_JAVA_OPTS
before executing PMD, e.g.
diff --git a/pmd_userdocs_cpd.html b/pmd_userdocs_cpd.html
index 59f0caa8df..9713784de7 100644
--- a/pmd_userdocs_cpd.html
+++ b/pmd_userdocs_cpd.html
@@ -3213,7 +3213,7 @@ the comment based approach will be extended to those of them that can support it
-
Then it was completely rewritten by Brian Ewins using the
-Burrows-Wheeler transform.
+Burrows-Wheeler transform.
-
Finally, it was rewritten by Steve Hawkins to use the
diff --git a/pmd_userdocs_extending_writing_xpath_rules.html b/pmd_userdocs_extending_writing_xpath_rules.html
index 1a0e449af3..00775e9820 100644
--- a/pmd_userdocs_extending_writing_xpath_rules.html
+++ b/pmd_userdocs_extending_writing_xpath_rules.html
@@ -1887,7 +1887,7 @@ with opt-in support for XPath 2.0.
See the Saxonica documentation
for an introduction to new features in XPath 3.1.
-The property version
of XPathRule
is deprecated and
+
The property version
of XPathRule
is deprecated and
has been removed with PMD 7.
DOM representation of ASTs
diff --git a/pmd_userdocs_incremental_analysis.html b/pmd_userdocs_incremental_analysis.html
index 29b85f81b2..47a6717fef 100644
--- a/pmd_userdocs_incremental_analysis.html
+++ b/pmd_userdocs_incremental_analysis.html
@@ -1942,7 +1942,7 @@ is stored:
and the violations found in previous runs are the value.
The cache is in the end just a file with serialized data (binary). The implementation is
-FileAnalysisCache
.
+internal: net.sourceforge.pmd.cache.internal.FileAnalysisCache
.
How does PMD detect whether a file has been changed?
diff --git a/pmd_userdocs_installation.html b/pmd_userdocs_installation.html
index 4d22821042..c525314ec8 100644
--- a/pmd_userdocs_installation.html
+++ b/pmd_userdocs_installation.html
@@ -1893,7 +1893,7 @@ or Adoptium.
- Note: For executing the Designer (pmd designer
) using OpenJDK or Java 11+, you need additionally JavaFX. Download it, extract it and set the environment variable JAVAFX_HOME pointing at that directory.
+ Note: For executing the Designer (pmd designer
) using OpenJDK or Java 11+, you need additionally JavaFX. Download it, extract it and set the environment variable JAVAFX_HOME pointing at that directory.
Installation
diff --git a/pmd_userdocs_migrating_to_pmd7.html b/pmd_userdocs_migrating_to_pmd7.html
index 9f57440fcf..0f2405c12a 100644
--- a/pmd_userdocs_migrating_to_pmd7.html
+++ b/pmd_userdocs_migrating_to_pmd7.html
@@ -2493,7 +2493,7 @@ by deprecating the attribute and providing alternatives.
XML (and POM)
-When using XPathRule
, text of text nodes was exposed as @Image
of
+
When using XPathRule
, text of text nodes was exposed as @Image
of
normal element type nodes. Now the attribute is called @Text
.
Note: In general, it is recommended to use DomXPathRule
instead,
@@ -2538,10 +2538,9 @@ type is used to share the disambiguation logic.
-
- Annotation AST Examples</summary>
+ Annotation AST Examples
-