diff --git a/404.html b/404.html index fec1bee44c..9a98033e83 100644 --- a/404.html +++ b/404.html @@ -85,7 +85,7 @@
[tom@hal building]$ ls -l
total 5716
--rw-rw-r-- 1 tom tom 5837216 Jul 17 13:09 pmd-src-7.0.1-SNAPSHOT.zip
-[tom@hal building]$ unzip -q pmd-src-7.0.1-SNAPSHOT.zip
+-rw-rw-r-- 1 tom tom 5837216 Jul 17 13:09 pmd-src-7.1.0-SNAPSHOT.zip
+[tom@hal building]$ unzip -q pmd-src-7.1.0-SNAPSHOT.zip
[tom@hal building]$
Now cd down into the pmd
directory:
[tom@hal building]$ cd pmd-src-7.0.1-SNAPSHOT
-[tom@hal pmd-src-7.0.1-SNAPSHOT]$ ls -l | grep pom.xml
+[tom@hal building]$ cd pmd-src-7.1.0-SNAPSHOT
+[tom@hal pmd-src-7.1.0-SNAPSHOT]$ ls -l | grep pom.xml
-rw-rw-r-- 1 tom tom 36482 14\. Nov 17:36 pom.xml
-[tom@hal pmd-src-7.0.1-SNAPSHOT]$
+[tom@hal pmd-src-7.1.0-SNAPSHOT]$
That’s the project configuration for maven… let’s compile!
-[tom@hal pmd-src-7.0.1-SNAPSHOT]$ ./mvnw clean verify
+[tom@hal pmd-src-7.1.0-SNAPSHOT]$ ./mvnw clean verify
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
@@ -1942,7 +1942,7 @@ total 5716
[INFO] Finished at: 2015-11-14T17:46:06+01:00
[INFO] Final Memory: 63M/765M
[INFO] ------------------------------------------------------------------------
-[tom@hal pmd-src-7.0.1-SNAPSHOT]$
+[tom@hal pmd-src-7.1.0-SNAPSHOT]$
Now the source and binary distribution zip files can be found in the folder pmd-dist/target
.
diff --git a/pmd_devdocs_development.html b/pmd_devdocs_development.html
index 95060762fb..6ae6132f19 100644
--- a/pmd_devdocs_development.html
+++ b/pmd_devdocs_development.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_devdocs_how_pmd_works.html b/pmd_devdocs_how_pmd_works.html
index 31ca41f206..4c8d97bd8c 100644
--- a/pmd_devdocs_how_pmd_works.html
+++ b/pmd_devdocs_how_pmd_works.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1875,7 +1875,7 @@
Overview
-The processing starts with the main class PmdAnalysis
.
+The processing starts with the main class PmdAnalysis
.
- Parse command line parameters (see net.sourceforge.pmd.cli.PMDParameters)
diff --git a/pmd_devdocs_logging.html b/pmd_devdocs_logging.html
index ff542e94c0..eb91822d59 100644
--- a/pmd_devdocs_logging.html
+++ b/pmd_devdocs_logging.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_devdocs_major_adding_new_cpd_language.html b/pmd_devdocs_major_adding_new_cpd_language.html
index 45669d7ebe..9c655c60c5 100644
--- a/pmd_devdocs_major_adding_new_cpd_language.html
+++ b/pmd_devdocs_major_adding_new_cpd_language.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1875,7 +1875,7 @@
Adding support for a CPD language
-CPD works generically on the tokens produced by a CpdLexer
.
+
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,14 +1894,14 @@ other languages.
is automatically available in the binary distribution (pmd-dist).
- - Implement a
CpdLexer
.
+ - Implement a
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
the lexer from the grammar. To do so, edit pom.xml
(eg like the Golang module).
Once that is done, mvn generate-sources
should generate the lexer sources for you.
- You can now implement a CpdLexer, for instance by extending AntlrCpdLexer
. The following reproduces the Go implementation:
+
You can now implement a CpdLexer, for instance by extending AntlrCpdLexer
. The following reproduces the Go implementation:
```java
// mind the package convention if you are going to make a PR
package net.sourceforge.pmd.lang.go.cpd;
@@ -1918,13 +1918,13 @@ Once that is done, mvn genera
- For JavaCC grammars, place your grammar in
etc/grammar
and edit the pom.xml
like the Python implementation does.
-You can then subclass JavaccCpdLexer
instead of AntlrCpdLexer.
+You can then subclass JavaccCpdLexer
instead of AntlrCpdLexer.
- For any other scenario just implement the interface however you can. Look at the Scala or Apex module for existing implementations.
-
-
Create a Language
implementation, and make it implement CpdCapableLanguage
.
-If your language only supports CPD, then you can subclass CpdOnlyLanguageModuleBase
to get going:
+ Create a Language
implementation, and make it implement CpdCapableLanguage
.
+If your language only supports CPD, then you can subclass CpdOnlyLanguageModuleBase
to get going:
// mind the package convention if you are going to make a PR
package net.sourceforge.pmd.lang.go;
@@ -1946,7 +1946,7 @@ If your language only supports CPD, then you can subclass src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language
.
- At this point the new language module should be available in CPD
and usable by CPD like any other language.
+ At this point the new language module should be available in CPD
and usable by CPD like any other language.
-
Update the test that asserts the list of supported languages by updating the SUPPORTED_LANGUAGES
constant in BinaryDistributionIT.
@@ -1979,15 +1979,15 @@ There is also the following Jekyll Include, that creates summary box for the lan
Declaring CpdLexer options
To make the CpdLexer configurable, first define some property descriptors using
-PropertyFactory
. Look at CpdLanguageProperties
+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
.
+of createCpdTokenizer
.
-To implement simple token filtering, you can use BaseTokenFilter
-as a base class, or another base class in net.sourceforge.pmd.cpd.impl
.
+
To implement simple token filtering, you can use BaseTokenFilter
+as a base class, or another base class in net.sourceforge.pmd.cpd.impl
.
Take a look at the Kotlin token filter implementation, or the Java one.
Testing your implementation
@@ -1995,7 +1995,7 @@ Take a look at the pmd-lang-test (scope 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.
diff --git a/pmd_devdocs_major_adding_new_language_antlr.html b/pmd_devdocs_major_adding_new_language_antlr.html
index d2822e963b..6f10d50e24 100644
--- a/pmd_devdocs_major_adding_new_language_antlr.html
+++ b/pmd_devdocs_major_adding_new_language_antlr.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -2029,7 +2029,7 @@ implementation that you need to extend to create your own adapter as we do with
- It can be used to provide other features for your language like
- violation suppression logic
- ViolationDecorator
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.
- metrics
diff --git a/pmd_devdocs_major_adding_new_language_javacc.html b/pmd_devdocs_major_adding_new_language_javacc.html
index f94766c5ee..339145c1fb 100644
--- a/pmd_devdocs_major_adding_new_language_javacc.html
+++ b/pmd_devdocs_major_adding_new_language_javacc.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1965,7 +1965,7 @@ all the available tokens in the field ViolationDecorator
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.
- metrics (see below “Optional features”)
@@ -2120,7 +2120,7 @@ have more control over this, there are two annotations that can be used for AST
-
-
DeprecatedAttribute
: Getters might be annotated with that indicating, that
+
DeprecatedAttribute
: Getters might be annotated with that indicating, that
this getter method should not be used in XPath rules. When a XPath rule uses such a method, a warning is
issued. If the method additionally has the standard Java @Deprecated
annotation, then the getter is also
deprecated for java usage. Otherwise, the getter is only deprecated for usage in XPath rules.
@@ -2129,7 +2129,7 @@ deprecated for java usage. Otherwise, the getter is only deprecated for usage in
attribute replaceWith
should be used.
-
-
NoAttribute
: This annotation can be used on an AST node type or on individual
+
NoAttribute
: This annotation can be used on an AST node type or on individual
methods in order to filter out which methods are available for XPath rules.
When used on a type, either all methods can be filtered or only inherited methods (see attribute scope
).
When used directly on an individual method, then only this method will be filtered out.
@@ -2179,10 +2179,10 @@ This can be achieved with Rule Designer:
- Create a package
lang.<langname>.metrics
- Create a utility class
<langname>Metrics
- Implement new metrics and add them as static constants. Be sure to document them.
- - Implement
getLanguageMetricsProvider
, to make the metrics available in the designer.
+ - Implement
getLanguageMetricsProvider
, to make the metrics available in the designer.
-See JavaMetrics
for an example.
+See JavaMetrics
for an example.
Symbol table
@@ -2200,7 +2200,7 @@ see Java-specific features and guidance.
Note:
With PMD 7.0.0 the symbol table and type resolution implementation has been
rewritten from scratch. There is still an old API for symbol table support, that is used by PLSQL,
-see net.sourceforge.pmd.lang.symboltable
. This will be deprecated and should not be used.
+see net.sourceforge.pmd.lang.symboltable
. This will be deprecated and should not be used.
Type resolution
diff --git a/pmd_devdocs_major_rule_guidelines.html b/pmd_devdocs_major_rule_guidelines.html
index 816cbd952c..62057caf01 100644
--- a/pmd_devdocs_major_rule_guidelines.html
+++ b/pmd_devdocs_major_rule_guidelines.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_devdocs_pmdtester.html b/pmd_devdocs_pmdtester.html
index f32786c04c..1519029a46 100644
--- a/pmd_devdocs_pmdtester.html
+++ b/pmd_devdocs_pmdtester.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_devdocs_roadmap.html b/pmd_devdocs_roadmap.html
index 3974cd2c40..9a2d8ee38e 100644
--- a/pmd_devdocs_roadmap.html
+++ b/pmd_devdocs_roadmap.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_devdocs_rule_deprecation_policy.html b/pmd_devdocs_rule_deprecation_policy.html
index 015b7c789f..87d51273a6 100644
--- a/pmd_devdocs_rule_deprecation_policy.html
+++ b/pmd_devdocs_rule_deprecation_policy.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_devdocs_writing_documentation.html b/pmd_devdocs_writing_documentation.html
index c1e3d01ca5..169d703874 100644
--- a/pmd_devdocs_writing_documentation.html
+++ b/pmd_devdocs_writing_documentation.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1945,43 +1945,43 @@ all formatting inside the delimiters, and allow to write code samples without
{% jdoc core::lang.rule.Rule %}
- Rule
+ Rule
{% jdoc !q!core::lang.rule.Rule %}
- net.sourceforge.pmd.lang.rule.Rule
+ net.sourceforge.pmd.lang.rule.Rule
{% jdoc core::lang.rule.Rule#setName(java.lang.String) %}
- setName
+ setName
{% jdoc !c!core::lang.rule.Rule#setName(java.lang.String) %}
- Rule#setName
+ Rule#setName
{% jdoc !a!core::lang.rule.Rule#setName(java.lang.String) %}
- setName(String)
+ setName(String)
{% jdoc !ac!core::lang.rule.Rule#setName(java.lang.String) %}
- Rule#setName(String)
+ Rule#setName(String)
{% jdoc core::properties.PropertyDescriptor %}
- PropertyDescriptor
+ PropertyDescriptor
{% jdoc_nspace :jast java::lang.java.ast %}{% jdoc jast::ASTTypeDeclaration %}
- ASTTypeDeclaration
+ ASTTypeDeclaration
{% jdoc_nspace :jast java::lang.java.ast %}{% jdoc_package :jast %}
- net.sourceforge.pmd.lang.java.ast
+ net.sourceforge.pmd.lang.java.ast
{% jdoc_nspace :PrD core::properties.PropertyDescriptor %}{% jdoc !ac!:PrD#uiOrder() %}
- PropertyDescriptor#uiOrder()
+ PropertyDescriptor#uiOrder()
{% jdoc_old core::Rule %}
diff --git a/pmd_languages_apex.html b/pmd_languages_apex.html
index 62982fe973..68e264adfb 100644
--- a/pmd_languages_apex.html
+++ b/pmd_languages_apex.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1886,7 +1886,7 @@ transaction control statements on the Salesforce Platform server, in conjunction
- Since PMD 5.5.0
-- Implementation:
ApexLanguageModule
+- Implementation:
ApexLanguageModule
- Id: apex
- PMD: ✔️
- CPD: ✔️
@@ -1896,12 +1896,12 @@ transaction control statements on the Salesforce Platform server, in conjunction
Metrics framework
-In order to use code metrics in Apex, use the metrics constants in ApexMetrics
,
-together with MetricsUtil
.
+In order to use code metrics in Apex, use the metrics constants in ApexMetrics
,
+together with MetricsUtil
.
Multifile Analysis
-Integration happens in ApexMultifileAnalysis
. It uses
+
Integration happens in ApexMultifileAnalysis
. It uses
ApexLink. For detailed information, see also Apexlink POC #2830.
Note: ApexLink’s new home: https://github.com/apex-dev-tools
diff --git a/pmd_languages_coco.html b/pmd_languages_coco.html
index 694a7ce67d..7dc545119c 100644
--- a/pmd_languages_coco.html
+++ b/pmd_languages_coco.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1885,7 +1885,7 @@ It is part of the Coco Platform from https://cocot
- Since PMD 7.0.0
-- Implementation:
CocoLanguageModule
+- Implementation:
CocoLanguageModule
- Id: coco
- PMD: ❌
- CPD: ✔️
diff --git a/pmd_languages_configuration.html b/pmd_languages_configuration.html
index 540335122f..9e8f5c999a 100644
--- a/pmd_languages_configuration.html
+++ b/pmd_languages_configuration.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1893,7 +1893,7 @@ completely in uppercase:
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
-PmdAnalysis
(or CpdAnalysis
) instance
+PmdAnalysis
(or CpdAnalysis
) instance
to start the analysis:
PMDConfiguration configuration = new PMDConfiguration();
@@ -1923,7 +1923,7 @@ version of the language will be used.
CPD language properties
-Many languages support the following properties, which are centrally defined in CpdLanguageProperties
:
+Many languages support the following properties, which are centrally defined in CpdLanguageProperties
:
-
@@ -1960,8 +1960,8 @@ appear to have the same value.
-Note: CPDConfiguration
has convenience methods to control these options, e.g.
-setIgnoreAnnotations
.
+Note: CPDConfiguration
has convenience methods to control these options, e.g.
+setIgnoreAnnotations
.
Java language properties
diff --git a/pmd_languages_cpp.html b/pmd_languages_cpp.html
index e2d39c1945..0b823f1947 100644
--- a/pmd_languages_cpp.html
+++ b/pmd_languages_cpp.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1880,7 +1880,7 @@
- Since PMD 3.5
-- Implementation:
CppLanguageModule
+- Implementation:
CppLanguageModule
- Id: cpp
- PMD: ❌
- CPD: ✔️
diff --git a/pmd_languages_cs.html b/pmd_languages_cs.html
index 98196d9898..54191074ad 100644
--- a/pmd_languages_cs.html
+++ b/pmd_languages_cs.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1880,7 +1880,7 @@
- Since PMD 4.3
-- Implementation:
CsLanguageModule
+- Implementation:
CsLanguageModule
- Id: cs
- PMD: ❌
- CPD: ✔️
diff --git a/pmd_languages_dart.html b/pmd_languages_dart.html
index 2fd9bd8e2d..2f26f5d74e 100644
--- a/pmd_languages_dart.html
+++ b/pmd_languages_dart.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1884,7 +1884,7 @@
- Since PMD 6.14.0
-- Implementation:
DartLanguageModule
+- Implementation:
DartLanguageModule
- Id: dart
- PMD: ❌
- CPD: ✔️
diff --git a/pmd_languages_fortran.html b/pmd_languages_fortran.html
index ea64383dbe..74ac04b699 100644
--- a/pmd_languages_fortran.html
+++ b/pmd_languages_fortran.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1880,7 +1880,7 @@
-- Implementation:
FortranLanguageModule
+- Implementation:
FortranLanguageModule
- Id: fortran
- PMD: ❌
- CPD: ✔️
diff --git a/pmd_languages_gherkin.html b/pmd_languages_gherkin.html
index 7e5ca37f1b..8f0e7045ca 100644
--- a/pmd_languages_gherkin.html
+++ b/pmd_languages_gherkin.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1884,7 +1884,7 @@ The Gherkin syntax is designed to be non-technical, making it human-readable for
- Since PMD 6.48.0
-- Implementation:
GherkinLanguageModule
+- Implementation:
GherkinLanguageModule
- Id: gherkin
- PMD: ❌
- CPD: ✔️
diff --git a/pmd_languages_go.html b/pmd_languages_go.html
index 4ea71d0bfc..8363694deb 100644
--- a/pmd_languages_go.html
+++ b/pmd_languages_go.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1884,7 +1884,7 @@
- Since PMD 5.2.0
-- Implementation:
GoLanguageModule
+- Implementation:
GoLanguageModule
- Id: go
- PMD: ❌
- CPD: ✔️
diff --git a/pmd_languages_groovy.html b/pmd_languages_groovy.html
index 4faa1f806a..bdd4d271ad 100644
--- a/pmd_languages_groovy.html
+++ b/pmd_languages_groovy.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1886,7 +1886,7 @@ familiar and easy to learn syntax.
- Since PMD 5.5.2
-- Implementation:
GroovyLanguageModule
+- Implementation:
GroovyLanguageModule
- Id: groovy
- PMD: ❌
- CPD: ✔️
diff --git a/pmd_languages_html.html b/pmd_languages_html.html
index 096d93b9c7..7b5bf14ba3 100644
--- a/pmd_languages_html.html
+++ b/pmd_languages_html.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1880,7 +1880,7 @@
- Since PMD 6.45.0
-- Implementation:
HtmlLanguageModule
+- Implementation:
HtmlLanguageModule
- Id: html
- PMD: ✔️
- CPD: ✔️
diff --git a/pmd_languages_index.html b/pmd_languages_index.html
index 5042da383a..29411c7ae8 100644
--- a/pmd_languages_index.html
+++ b/pmd_languages_index.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_languages_java.html b/pmd_languages_java.html
index 8168f625f6..93727847f7 100644
--- a/pmd_languages_java.html
+++ b/pmd_languages_java.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1880,7 +1880,7 @@
- Since PMD 1.0.0
-- Implementation:
JavaLanguageModule
+- Implementation:
JavaLanguageModule
- Id: java
- PMD: ✔️
- CPD: ✔️
@@ -2102,42 +2102,42 @@ Java 11 (or later) for the auxClasspath allows PMD to correctly identify the mis
Symbol table APIs
-Symbol table API related classes are in the package net.sourceforge.pmd.lang.java.symbols
.
-The root interface for symbols is JElementSymbol
.
+Symbol table API related classes are in the package net.sourceforge.pmd.lang.java.symbols
.
+The root interface for symbols is JElementSymbol
.
-The symbol table can be requested on any node with the method getSymbolTable
.
-This returns a JSymbolTable
which gives you access to variables, methods and types that are
+
The symbol table can be requested on any node with the method getSymbolTable
.
+This returns a JSymbolTable
which gives you access to variables, methods and types that are
within scope.
-A ASTExpression
might represent a ASTAssignableExpr.ASTNamedReferenceExpr
+
A ASTExpression
might represent a ASTAssignableExpr.ASTNamedReferenceExpr
if it e.g. references a variable name. In that case, you can access the referenced variable symbol
-with the method getReferencedSym
.
+with the method getReferencedSym
.
-Declaration nodes, such as ASTVariableId
implement the interface
-SymbolDeclaratorNode
. Through the method
-getSymbol
you can also access the symbol.
+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
-Type resolution API related classes are in the package net.sourceforge.pmd.lang.java.types
.
+Type resolution API related classes are in the package net.sourceforge.pmd.lang.java.types
.
The core of the framework is a set of interfaces to represent types. The root interface is
-JTypeMirror
. Type mirrors are created by a
-TypeSystem
object. This object is analysis-global.
+JTypeMirror
. Type mirrors are created by a
+TypeSystem
object. This object is analysis-global.
-The utility class TypeTestUtil
provides simple methods to check types,
+
The utility class TypeTestUtil
provides simple methods to check types,
e.g. TypeTestUtil.isA(String.class, variableDeclaratorIdNode)
tests, whether the given
variableDeclaratorId is of type “String”.
-Any TypeNode
provides access to the type with the method getTypeMirror
.
-E.g. this can be called on ASTMethodCall
to retrieve the return type of the called method.
+Any TypeNode
provides access to the type with the method getTypeMirror
.
+E.g. this can be called on ASTMethodCall
to retrieve the return type of the called method.
Metrics framework
-In order to use code metrics in Java, use the metrics constants in JavaMetrics
,
-together with MetricsUtil
. For instance:
+In order to use code metrics in Java, use the metrics constants in JavaMetrics
,
+together with MetricsUtil
. For instance:
@Override
public Object visit(ASTMethodDeclaration node, Object data) {
@@ -2159,13 +2159,13 @@ together with VARIABLE_NAME
- METHOD_NAME
- CLASS_NAME
- PACKAGE_NAME
+ VARIABLE_NAME
+ METHOD_NAME
+ CLASS_NAME
+ PACKAGE_NAME
-You can access these via getAdditionalInfo
+You can access these via getAdditionalInfo
Dataflow
diff --git a/pmd_languages_js_ts.html b/pmd_languages_js_ts.html
index 5ac3ff5215..8226753c1b 100644
--- a/pmd_languages_js_ts.html
+++ b/pmd_languages_js_ts.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1880,7 +1880,7 @@
-- Implementation:
EcmascriptLanguageModule
+- Implementation:
EcmascriptLanguageModule
- Id: ecmascript
- PMD: ✔️
- CPD: ✔️
@@ -1895,7 +1895,7 @@
- Since PMD 7.0.0
-- Implementation:
TsLanguageModule
+- Implementation:
TsLanguageModule
- Id: ts
- PMD: ❌
- CPD: ✔️
diff --git a/pmd_languages_jsp.html b/pmd_languages_jsp.html
index d93cada703..c9428b893e 100644
--- a/pmd_languages_jsp.html
+++ b/pmd_languages_jsp.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1880,7 +1880,7 @@
-- Implementation:
JspLanguageModule
+- Implementation:
JspLanguageModule
- Id: jsp
- PMD: ✔️
- CPD: ✔️
diff --git a/pmd_languages_julia.html b/pmd_languages_julia.html
index 975e807c10..57fab2f60d 100644
--- a/pmd_languages_julia.html
+++ b/pmd_languages_julia.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1887,7 +1887,7 @@ Julia programs compile to efficient native code for multiple platforms via LLVM.
- Since PMD 7.0.0
-- Implementation:
JuliaLanguageModule
+- Implementation:
JuliaLanguageModule
- Id: julia
- PMD: ❌
- CPD: ✔️
diff --git a/pmd_languages_kotlin.html b/pmd_languages_kotlin.html
index 7f6b737b85..64786e24b0 100644
--- a/pmd_languages_kotlin.html
+++ b/pmd_languages_kotlin.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1882,7 +1882,7 @@
- Since PMD 7.0
-- Implementation:
KotlinLanguageModule
+- Implementation:
KotlinLanguageModule
- Id: kotlin
- PMD: ✔️
- CPD: ✔️
diff --git a/pmd_languages_lua.html b/pmd_languages_lua.html
index b76bd50826..8b8814b559 100644
--- a/pmd_languages_lua.html
+++ b/pmd_languages_lua.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1884,7 +1884,7 @@
- Since PMD 6.17.0
-- Implementation:
LuaLanguageModule
+- Implementation:
LuaLanguageModule
- Id: lua
- PMD: ❌
- CPD: ✔️
diff --git a/pmd_languages_matlab.html b/pmd_languages_matlab.html
index 75c08d4a15..8edf6e59b2 100644
--- a/pmd_languages_matlab.html
+++ b/pmd_languages_matlab.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1882,7 +1882,7 @@
- Since PMD 5.3.0
-- Implementation:
MatlabLanguageModule
+- Implementation:
MatlabLanguageModule
- Id: matlab
- PMD: ❌
- CPD: ✔️
diff --git a/pmd_languages_modelica.html b/pmd_languages_modelica.html
index ea3d235330..d5e988cb86 100644
--- a/pmd_languages_modelica.html
+++ b/pmd_languages_modelica.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1882,7 +1882,7 @@
- Since PMD 6.21.0
-- Implementation:
ModelicaLanguageModule
+- Implementation:
ModelicaLanguageModule
- Id: modelica
- PMD: ✔️
- CPD: ✔️
diff --git a/pmd_languages_objectivec.html b/pmd_languages_objectivec.html
index 14133f951f..17ed538a11 100644
--- a/pmd_languages_objectivec.html
+++ b/pmd_languages_objectivec.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1885,7 +1885,7 @@ a superset of the C programming language and provides object-oriented capabiliti
- Since PMD 5.3.0
-- Implementation:
ObjectiveCLanguageModule
+- Implementation:
ObjectiveCLanguageModule
- Id: objectivec
- PMD: ❌
- CPD: ✔️
diff --git a/pmd_languages_perl.html b/pmd_languages_perl.html
index 4284ca0693..14e9764734 100644
--- a/pmd_languages_perl.html
+++ b/pmd_languages_perl.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1884,7 +1884,7 @@
- Since PMD 5.5.0
-- Implementation:
PerlLanguageModule
+- Implementation:
PerlLanguageModule
- Id: perl
- PMD: ❌
- CPD: ✔️
diff --git a/pmd_languages_php.html b/pmd_languages_php.html
index 1d63e172d7..819092bb9f 100644
--- a/pmd_languages_php.html
+++ b/pmd_languages_php.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1884,7 +1884,7 @@
- Since PMD 1.1
-- Implementation:
PhpLanguageModule
+- Implementation:
PhpLanguageModule
- Id: php
- PMD: ❌
- CPD: ✔️
diff --git a/pmd_languages_plsql.html b/pmd_languages_plsql.html
index 8ff5112205..d13d8e3dea 100644
--- a/pmd_languages_plsql.html
+++ b/pmd_languages_plsql.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1885,7 +1885,7 @@ describes and explains how to use PL/SQL, the Oracle procedural extension of SQL
- Since PMD 5.1.0
-- Implementation:
PLSQLLanguageModule
+- Implementation:
PLSQLLanguageModule
- Id: plsql
- PMD: ✔️
- CPD: ✔️
diff --git a/pmd_languages_python.html b/pmd_languages_python.html
index 2a8a9865e8..01c320949f 100644
--- a/pmd_languages_python.html
+++ b/pmd_languages_python.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1884,7 +1884,7 @@
- Since PMD 5.3.0
-- Implementation:
PythonLanguageModule
+- Implementation:
PythonLanguageModule
- Id: python
- PMD: ❌
- CPD: ✔️
diff --git a/pmd_languages_ruby.html b/pmd_languages_ruby.html
index 348f4a733b..c7ab4aef18 100644
--- a/pmd_languages_ruby.html
+++ b/pmd_languages_ruby.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1885,7 +1885,7 @@ productivity. It has an elegant syntax that is natural to read and easy to write
- Since PMD 3.0
-- Implementation:
RubyLanguageModule
+- Implementation:
RubyLanguageModule
- Id: ruby
- PMD: ❌
- CPD: ✔️
diff --git a/pmd_languages_scala.html b/pmd_languages_scala.html
index 4a51fbe6ed..22dc4c06f7 100644
--- a/pmd_languages_scala.html
+++ b/pmd_languages_scala.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1886,7 +1886,7 @@ object-oriented and functional languages.
- Since PMD 5.3.0
-- Implementation:
ScalaLanguageModule
+- Implementation:
ScalaLanguageModule
- Id: scala
- PMD: ✔️
- CPD: ✔️
diff --git a/pmd_languages_swift.html b/pmd_languages_swift.html
index 92166ddb66..aedec81592 100644
--- a/pmd_languages_swift.html
+++ b/pmd_languages_swift.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1885,7 +1885,7 @@ powerful for experts. It is fast, modern, safe, and a joy to write.
- Since PMD 5.3.7
-- Implementation:
SwiftLanguageModule
+- Implementation:
SwiftLanguageModule
- Id: swift
- PMD: ✔️
- CPD: ✔️
diff --git a/pmd_languages_tsql.html b/pmd_languages_tsql.html
index 37cdee6d3f..3d49f89cd3 100644
--- a/pmd_languages_tsql.html
+++ b/pmd_languages_tsql.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1885,7 +1885,7 @@ proprietary extension to the SQL (Structured Query Language) used to interact wi
- Since PMD 6.55.0
-- Implementation:
TSqlLanguageModule
+- Implementation:
TSqlLanguageModule
- Id: tsql
- PMD: ❌
- CPD: ✔️
diff --git a/pmd_languages_velocity.html b/pmd_languages_velocity.html
index 25b1dc26e9..4ff47ca862 100644
--- a/pmd_languages_velocity.html
+++ b/pmd_languages_velocity.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1885,7 +1885,7 @@ It permits web page designers to reference methods defined in Java code.
- Since PMD 5.1.0
-- Implementation:
VtlLanguageModule
+- Implementation:
VtlLanguageModule
- Id: velocity
- PMD: ✔️
- CPD: ✔️
diff --git a/pmd_languages_visualforce.html b/pmd_languages_visualforce.html
index 16c8c0ba1a..85066b6118 100644
--- a/pmd_languages_visualforce.html
+++ b/pmd_languages_visualforce.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1885,7 +1885,7 @@ language that gives developers way to build applications and customize the Sales
- Since PMD 5.6.0
-- Implementation:
VfLanguageModule
+- Implementation:
VfLanguageModule
- Id: visualforce
- PMD: ✔️
- CPD: ✔️
diff --git a/pmd_languages_xml.html b/pmd_languages_xml.html
index c4ace4dc89..d8887d7762 100644
--- a/pmd_languages_xml.html
+++ b/pmd_languages_xml.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1880,7 +1880,7 @@
- Since PMD 5.4.0
-- Implementation:
PomLanguageModule
+- Implementation:
PomLanguageModule
- Id: pom
- PMD: ✔️
- CPD: ✔️
@@ -1895,7 +1895,7 @@
- Since PMD 5.4.0
-- Implementation:
WsdlLanguageModule
+- Implementation:
WsdlLanguageModule
- Id: wsdl
- PMD: ✔️
- CPD: ✔️
@@ -1910,7 +1910,7 @@
- Since PMD 5.0.0
-- Implementation:
XmlLanguageModule
+- Implementation:
XmlLanguageModule
- Id: xml
- PMD: ✔️
- CPD: ✔️
@@ -1925,7 +1925,7 @@
- Since PMD 5.0.0
-- Implementation:
XslLanguageModule
+- Implementation:
XslLanguageModule
- Id: xsl
- PMD: ✔️
- CPD: ✔️
@@ -1986,9 +1986,9 @@ 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
+are advised to use DomXPathRule
. This rule class interprets
XPath queries exactly as regular XPath, while XPathRule
works on a wrapper for the
DOM which is inconsistent with the XPath spec. Since DomXPathRule
conforms to the
XPath spec, you can
@@ -2018,7 +2018,7 @@ to help you write XPath queries.
</rule>
The most important change is the class
attribute, which doesn’t point to XPathRule
-but to DomXPathRule
. Please see the Javadoc for DomXPathRule
+but to DomXPathRule
. Please see the Javadoc for DomXPathRule
for more info about the differences with XPathRule
.
diff --git a/pmd_projectdocs_committers_infrastructure.html b/pmd_projectdocs_committers_infrastructure.html
index aecd6ec6f8..0a5239fe25 100644
--- a/pmd_projectdocs_committers_infrastructure.html
+++ b/pmd_projectdocs_committers_infrastructure.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_projectdocs_committers_main_landing_page.html b/pmd_projectdocs_committers_main_landing_page.html
index 16ebe5431b..3d5100139c 100644
--- a/pmd_projectdocs_committers_main_landing_page.html
+++ b/pmd_projectdocs_committers_main_landing_page.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_projectdocs_committers_merging_pull_requests.html b/pmd_projectdocs_committers_merging_pull_requests.html
index db9e33ecf1..a3cfadc435 100644
--- a/pmd_projectdocs_committers_merging_pull_requests.html
+++ b/pmd_projectdocs_committers_merging_pull_requests.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_projectdocs_committers_releasing.html b/pmd_projectdocs_committers_releasing.html
index e76bb1330f..91a33c1edc 100644
--- a/pmd_projectdocs_committers_releasing.html
+++ b/pmd_projectdocs_committers_releasing.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_projectdocs_credits.html b/pmd_projectdocs_credits.html
index 779ceffda6..b97f3c36da 100644
--- a/pmd_projectdocs_credits.html
+++ b/pmd_projectdocs_credits.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_projectdocs_decisions.html b/pmd_projectdocs_decisions.html
index 31a2fe4c14..0d0436a4f6 100644
--- a/pmd_projectdocs_decisions.html
+++ b/pmd_projectdocs_decisions.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_projectdocs_decisions_adr_1.html b/pmd_projectdocs_decisions_adr_1.html
index 14fdc88048..ab3b1e598e 100644
--- a/pmd_projectdocs_decisions_adr_1.html
+++ b/pmd_projectdocs_decisions_adr_1.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_projectdocs_decisions_adr_2.html b/pmd_projectdocs_decisions_adr_2.html
index f25e3a4cb4..fc017049c2 100644
--- a/pmd_projectdocs_decisions_adr_2.html
+++ b/pmd_projectdocs_decisions_adr_2.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_projectdocs_decisions_adr_3.html b/pmd_projectdocs_decisions_adr_3.html
index 8c426d3581..8f554ef882 100644
--- a/pmd_projectdocs_decisions_adr_3.html
+++ b/pmd_projectdocs_decisions_adr_3.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_projectdocs_decisions_adr_NNN.html b/pmd_projectdocs_decisions_adr_NNN.html
index 8415627bca..e1094e36cf 100644
--- a/pmd_projectdocs_decisions_adr_NNN.html
+++ b/pmd_projectdocs_decisions_adr_NNN.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_projectdocs_faq.html b/pmd_projectdocs_faq.html
index 36578e6688..a9c3c94728 100644
--- a/pmd_projectdocs_faq.html
+++ b/pmd_projectdocs_faq.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_projectdocs_logo.html b/pmd_projectdocs_logo.html
index 8716b564fb..8f14102899 100644
--- a/pmd_projectdocs_logo.html
+++ b/pmd_projectdocs_logo.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_projectdocs_trivia_meaning.html b/pmd_projectdocs_trivia_meaning.html
index edf9c3d35e..c7365a38be 100644
--- a/pmd_projectdocs_trivia_meaning.html
+++ b/pmd_projectdocs_trivia_meaning.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_projectdocs_trivia_news.html b/pmd_projectdocs_trivia_news.html
index c82d38ae72..624cdc0de2 100644
--- a/pmd_projectdocs_trivia_news.html
+++ b/pmd_projectdocs_trivia_news.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_projectdocs_trivia_products.html b/pmd_projectdocs_trivia_products.html
index 8ed906d406..617e6c8f5b 100644
--- a/pmd_projectdocs_trivia_products.html
+++ b/pmd_projectdocs_trivia_products.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_projectdocs_trivia_similarprojects.html b/pmd_projectdocs_trivia_similarprojects.html
index 1212729fec..7ecfe7b2c7 100644
--- a/pmd_projectdocs_trivia_similarprojects.html
+++ b/pmd_projectdocs_trivia_similarprojects.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_release_notes.html b/pmd_release_notes.html
index 76b32c07ff..59b8bd4550 100644
--- a/pmd_release_notes.html
+++ b/pmd_release_notes.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1871,11 +1871,11 @@
- 26-April-2024 - 7.0.1-SNAPSHOT
+ 26-April-2024 - 7.1.0-SNAPSHOT
-The PMD team is pleased to announce PMD 7.0.1-SNAPSHOT.
+The PMD team is pleased to announce PMD 7.1.0-SNAPSHOT.
-This is a bugfix release.
+This is a minor release.
🚀 New and noteworthy
diff --git a/pmd_release_notes_old.html b/pmd_release_notes_old.html
index ddce6e241e..0a260c169e 100644
--- a/pmd_release_notes_old.html
+++ b/pmd_release_notes_old.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_release_notes_pmd7.html b/pmd_release_notes_pmd7.html
index b7d82cc821..50d0ecb9a5 100644
--- a/pmd_release_notes_pmd7.html
+++ b/pmd_release_notes_pmd7.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_apex.html b/pmd_rules_apex.html
index 3dd251b9ef..0aa17b570a 100644
--- a/pmd_rules_apex.html
+++ b/pmd_rules_apex.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_apex_bestpractices.html b/pmd_rules_apex_bestpractices.html
index dddb8fd2a2..0734b72b1b 100644
--- a/pmd_rules_apex_bestpractices.html
+++ b/pmd_rules_apex_bestpractices.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_apex_codestyle.html b/pmd_rules_apex_codestyle.html
index 24fdd32b2e..951e236406 100644
--- a/pmd_rules_apex_codestyle.html
+++ b/pmd_rules_apex_codestyle.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_apex_design.html b/pmd_rules_apex_design.html
index 9af096eccc..568141c30c 100644
--- a/pmd_rules_apex_design.html
+++ b/pmd_rules_apex_design.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_apex_documentation.html b/pmd_rules_apex_documentation.html
index 6551c73d7a..e0e0cf1d9f 100644
--- a/pmd_rules_apex_documentation.html
+++ b/pmd_rules_apex_documentation.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_apex_errorprone.html b/pmd_rules_apex_errorprone.html
index 48ea52208c..027f190ba7 100644
--- a/pmd_rules_apex_errorprone.html
+++ b/pmd_rules_apex_errorprone.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_apex_performance.html b/pmd_rules_apex_performance.html
index be12448d63..4b8430b150 100644
--- a/pmd_rules_apex_performance.html
+++ b/pmd_rules_apex_performance.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_apex_security.html b/pmd_rules_apex_security.html
index 9f4209990b..55c3a8f99a 100644
--- a/pmd_rules_apex_security.html
+++ b/pmd_rules_apex_security.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_ecmascript.html b/pmd_rules_ecmascript.html
index 32373e747c..918c57da64 100644
--- a/pmd_rules_ecmascript.html
+++ b/pmd_rules_ecmascript.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_ecmascript_bestpractices.html b/pmd_rules_ecmascript_bestpractices.html
index 476e14dff3..7c2e3d3d3e 100644
--- a/pmd_rules_ecmascript_bestpractices.html
+++ b/pmd_rules_ecmascript_bestpractices.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_ecmascript_codestyle.html b/pmd_rules_ecmascript_codestyle.html
index 08b79ebfe8..5baf71e60b 100644
--- a/pmd_rules_ecmascript_codestyle.html
+++ b/pmd_rules_ecmascript_codestyle.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_ecmascript_errorprone.html b/pmd_rules_ecmascript_errorprone.html
index 7e0335241a..16e4d91bbd 100644
--- a/pmd_rules_ecmascript_errorprone.html
+++ b/pmd_rules_ecmascript_errorprone.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_html.html b/pmd_rules_html.html
index cb56064871..d38aefa65f 100644
--- a/pmd_rules_html.html
+++ b/pmd_rules_html.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_html_bestpractices.html b/pmd_rules_html_bestpractices.html
index b6103b5865..c6c811fb79 100644
--- a/pmd_rules_html_bestpractices.html
+++ b/pmd_rules_html_bestpractices.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_java.html b/pmd_rules_java.html
index a7d3201c93..816746414d 100644
--- a/pmd_rules_java.html
+++ b/pmd_rules_java.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_java_bestpractices.html b/pmd_rules_java_bestpractices.html
index 7079750d80..3e81f9861d 100644
--- a/pmd_rules_java_bestpractices.html
+++ b/pmd_rules_java_bestpractices.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_java_codestyle.html b/pmd_rules_java_codestyle.html
index 42858648ff..2a2fb38d0b 100644
--- a/pmd_rules_java_codestyle.html
+++ b/pmd_rules_java_codestyle.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_java_design.html b/pmd_rules_java_design.html
index 711a0b9a20..ea82df10f5 100644
--- a/pmd_rules_java_design.html
+++ b/pmd_rules_java_design.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -2400,7 +2400,7 @@ in a single method makes its behaviour hard to read and change.
Cyclomatic complexity assesses the complexity of a method by counting the number of decision points in a method,
plus one for the method entry. Decision points are places where the control flow jumps to another place in the
program. As such, they include all control flow statements, such as if
, while
, for
, and case
. For more
-details on the calculation, see the documentation CYCLO
.
+details on the calculation, see the documentation CYCLO
.
Generally, numbers ranging from 1-4 denote low complexity, 5-7 denote moderate complexity, 8-10 denote
high complexity, and 11+ is very high complexity. By default, this rule reports methods with a complexity >= 10.
@@ -2505,10 +2505,10 @@ into the former client classes.
The rule uses metrics to implement its detection strategy. The violation message
gives information about the values of these metrics:
- - WMC: a class complexity measure for a class, see
WEIGHED_METHOD_COUNT
- - WOC: a ‘non-triviality’ measure for a class, see
WEIGHT_OF_CLASS
- - NOPA: number of public attributes, see
NUMBER_OF_PUBLIC_FIELDS
- - NOAM: number of public accessor methods, see
NUMBER_OF_ACCESSORS
+ - WMC: a class complexity measure for a class, see
WEIGHED_METHOD_COUNT
+ - WOC: a ‘non-triviality’ measure for a class, see
WEIGHT_OF_CLASS
+ - NOPA: number of public attributes, see
NUMBER_OF_PUBLIC_FIELDS
+ - NOAM: number of public accessor methods, see
NUMBER_OF_ACCESSORS
The rule identifies a god class by looking for classes which have all of the following properties:
@@ -2813,9 +2813,9 @@ The violations are reported against the entire class.
The rule uses metrics to implement its detection strategy. The violation message
gives information about the values of these metrics:
- - WMC: a class complexity measure, see
WEIGHED_METHOD_COUNT
- - ATFD: a measure of how much data external data the class uses, see
ACCESS_TO_FOREIGN_DATA
- - TCC: a measure of how tightly related the methods are, see
TIGHT_CLASS_COHESION
+ - WMC: a class complexity measure, see
WEIGHED_METHOD_COUNT
+ - ATFD: a measure of how much data external data the class uses, see
ACCESS_TO_FOREIGN_DATA
+ - TCC: a measure of how tightly related the methods are, see
TIGHT_CLASS_COHESION
The rule identifies a god class by looking for classes which have all of the following properties:
@@ -3187,7 +3187,7 @@ rule This rule uses the NCSS (Non-Commenting Source Statements) metric to determine the number of lines
of code in a class, method or constructor. NCSS ignores comments, blank lines, and only counts actual
statements. For more details on the calculation, see the documentation
-NCSS
.
+NCSS
.
This rule is defined by the following Java class: net.sourceforge.pmd.lang.java.rule.design.NcssCountRule
@@ -3273,7 +3273,7 @@ statements. For more details on the calculation, see the documentation
While cyclomatic complexity counts the number of decision points in a method, NPath counts the number of
full paths from the beginning to the end of the block of the method. That metric grows exponentially, as
it multiplies the complexity of statements in the same block. For more details on the calculation, see the
-documentation NPATH
.
+documentation NPATH
.
A threshold of 200 is generally considered the point where measures should be taken to reduce
complexity and increase readability.
diff --git a/pmd_rules_java_documentation.html b/pmd_rules_java_documentation.html
index 2363946225..10cf972826 100644
--- a/pmd_rules_java_documentation.html
+++ b/pmd_rules_java_documentation.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_java_errorprone.html b/pmd_rules_java_errorprone.html
index 5f32b6a360..b28688198f 100644
--- a/pmd_rules_java_errorprone.html
+++ b/pmd_rules_java_errorprone.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_java_multithreading.html b/pmd_rules_java_multithreading.html
index c0c6767fff..cbe2165207 100644
--- a/pmd_rules_java_multithreading.html
+++ b/pmd_rules_java_multithreading.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_java_performance.html b/pmd_rules_java_performance.html
index 310bb14d6f..daede8d200 100644
--- a/pmd_rules_java_performance.html
+++ b/pmd_rules_java_performance.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_java_security.html b/pmd_rules_java_security.html
index 462f8ff2c1..56e8a181d3 100644
--- a/pmd_rules_java_security.html
+++ b/pmd_rules_java_security.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_jsp.html b/pmd_rules_jsp.html
index d2e2c5945f..42f85a8e60 100644
--- a/pmd_rules_jsp.html
+++ b/pmd_rules_jsp.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_jsp_bestpractices.html b/pmd_rules_jsp_bestpractices.html
index 4d287c9597..31d479abc1 100644
--- a/pmd_rules_jsp_bestpractices.html
+++ b/pmd_rules_jsp_bestpractices.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_jsp_codestyle.html b/pmd_rules_jsp_codestyle.html
index d00fc7dd25..1cf7722c59 100644
--- a/pmd_rules_jsp_codestyle.html
+++ b/pmd_rules_jsp_codestyle.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_jsp_design.html b/pmd_rules_jsp_design.html
index 2157bc4bf8..06f1836cca 100644
--- a/pmd_rules_jsp_design.html
+++ b/pmd_rules_jsp_design.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_jsp_errorprone.html b/pmd_rules_jsp_errorprone.html
index cf5c8d0282..ace877c1d4 100644
--- a/pmd_rules_jsp_errorprone.html
+++ b/pmd_rules_jsp_errorprone.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_jsp_security.html b/pmd_rules_jsp_security.html
index 8141bf8b5f..3ee46c548b 100644
--- a/pmd_rules_jsp_security.html
+++ b/pmd_rules_jsp_security.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_kotlin.html b/pmd_rules_kotlin.html
index 99d32d82e8..409ba3f390 100644
--- a/pmd_rules_kotlin.html
+++ b/pmd_rules_kotlin.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_kotlin_bestpractices.html b/pmd_rules_kotlin_bestpractices.html
index c2819b1168..40da02b76b 100644
--- a/pmd_rules_kotlin_bestpractices.html
+++ b/pmd_rules_kotlin_bestpractices.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_kotlin_errorprone.html b/pmd_rules_kotlin_errorprone.html
index e90e7e70b4..c401ca03aa 100644
--- a/pmd_rules_kotlin_errorprone.html
+++ b/pmd_rules_kotlin_errorprone.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_modelica.html b/pmd_rules_modelica.html
index cf55dffadc..2c17c945ba 100644
--- a/pmd_rules_modelica.html
+++ b/pmd_rules_modelica.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_modelica_bestpractices.html b/pmd_rules_modelica_bestpractices.html
index 3232af6490..d1968ae5f9 100644
--- a/pmd_rules_modelica_bestpractices.html
+++ b/pmd_rules_modelica_bestpractices.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_plsql.html b/pmd_rules_plsql.html
index 0aef914a80..d8086f79fb 100644
--- a/pmd_rules_plsql.html
+++ b/pmd_rules_plsql.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_plsql_bestpractices.html b/pmd_rules_plsql_bestpractices.html
index 571bd43b03..5f4475b789 100644
--- a/pmd_rules_plsql_bestpractices.html
+++ b/pmd_rules_plsql_bestpractices.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_plsql_codestyle.html b/pmd_rules_plsql_codestyle.html
index 5dbe5f9b71..91e63c392c 100644
--- a/pmd_rules_plsql_codestyle.html
+++ b/pmd_rules_plsql_codestyle.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_plsql_design.html b/pmd_rules_plsql_design.html
index 6b2a6c6ff4..d0736601d8 100644
--- a/pmd_rules_plsql_design.html
+++ b/pmd_rules_plsql_design.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_plsql_errorprone.html b/pmd_rules_plsql_errorprone.html
index d591589148..316a1703bc 100644
--- a/pmd_rules_plsql_errorprone.html
+++ b/pmd_rules_plsql_errorprone.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_pom.html b/pmd_rules_pom.html
index b6a557d825..7a64976de1 100644
--- a/pmd_rules_pom.html
+++ b/pmd_rules_pom.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_pom_errorprone.html b/pmd_rules_pom_errorprone.html
index 3e88c371e1..6027f97dae 100644
--- a/pmd_rules_pom_errorprone.html
+++ b/pmd_rules_pom_errorprone.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_scala.html b/pmd_rules_scala.html
index 832146f0e1..7b9c091643 100644
--- a/pmd_rules_scala.html
+++ b/pmd_rules_scala.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_swift.html b/pmd_rules_swift.html
index 75a36f5a54..a50089681c 100644
--- a/pmd_rules_swift.html
+++ b/pmd_rules_swift.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_swift_bestpractices.html b/pmd_rules_swift_bestpractices.html
index c74ae382fc..9419decd3f 100644
--- a/pmd_rules_swift_bestpractices.html
+++ b/pmd_rules_swift_bestpractices.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_swift_errorprone.html b/pmd_rules_swift_errorprone.html
index c9528c59d5..40610c4314 100644
--- a/pmd_rules_swift_errorprone.html
+++ b/pmd_rules_swift_errorprone.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_velocity.html b/pmd_rules_velocity.html
index e382dd0e73..039b0037a4 100644
--- a/pmd_rules_velocity.html
+++ b/pmd_rules_velocity.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_velocity_bestpractices.html b/pmd_rules_velocity_bestpractices.html
index 57b669ab1b..ad4f1d7dc1 100644
--- a/pmd_rules_velocity_bestpractices.html
+++ b/pmd_rules_velocity_bestpractices.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_velocity_design.html b/pmd_rules_velocity_design.html
index 2316391afe..488e080c04 100644
--- a/pmd_rules_velocity_design.html
+++ b/pmd_rules_velocity_design.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_velocity_errorprone.html b/pmd_rules_velocity_errorprone.html
index 87a1cf9785..57fdecc2d3 100644
--- a/pmd_rules_velocity_errorprone.html
+++ b/pmd_rules_velocity_errorprone.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_visualforce.html b/pmd_rules_visualforce.html
index c0d2b418a1..0ad7ae5cdd 100644
--- a/pmd_rules_visualforce.html
+++ b/pmd_rules_visualforce.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_visualforce_security.html b/pmd_rules_visualforce_security.html
index 44aab83682..d466fac598 100644
--- a/pmd_rules_visualforce_security.html
+++ b/pmd_rules_visualforce_security.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_xml.html b/pmd_rules_xml.html
index f517776d00..43ae8c299b 100644
--- a/pmd_rules_xml.html
+++ b/pmd_rules_xml.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_xml_bestpractices.html b/pmd_rules_xml_bestpractices.html
index 3d241732b8..448491fd08 100644
--- a/pmd_rules_xml_bestpractices.html
+++ b/pmd_rules_xml_bestpractices.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_xml_errorprone.html b/pmd_rules_xml_errorprone.html
index 9951401897..34169949ca 100644
--- a/pmd_rules_xml_errorprone.html
+++ b/pmd_rules_xml_errorprone.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_xsl.html b/pmd_rules_xsl.html
index 239d1d7f65..27f79f2b7e 100644
--- a/pmd_rules_xsl.html
+++ b/pmd_rules_xsl.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_xsl_codestyle.html b/pmd_rules_xsl_codestyle.html
index 1a30441046..f93b12e2c6 100644
--- a/pmd_rules_xsl_codestyle.html
+++ b/pmd_rules_xsl_codestyle.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_rules_xsl_performance.html b/pmd_rules_xsl_performance.html
index 6fce51d3a1..8e43460c8d 100644
--- a/pmd_rules_xsl_performance.html
+++ b/pmd_rules_xsl_performance.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_userdocs_3rdpartyrulesets.html b/pmd_userdocs_3rdpartyrulesets.html
index 0cd3d0695b..7c024ce1c5 100644
--- a/pmd_userdocs_3rdpartyrulesets.html
+++ b/pmd_userdocs_3rdpartyrulesets.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_userdocs_best_practices.html b/pmd_userdocs_best_practices.html
index 94a785fc1b..bd16f5f0fd 100644
--- a/pmd_userdocs_best_practices.html
+++ b/pmd_userdocs_best_practices.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_userdocs_cli_reference.html b/pmd_userdocs_cli_reference.html
index 05cb594eb6..fc55e25de9 100644
--- a/pmd_userdocs_cli_reference.html
+++ b/pmd_userdocs_cli_reference.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_userdocs_configuring_rules.html b/pmd_userdocs_configuring_rules.html
index 8d9ac1c708..54bf4f1552 100644
--- a/pmd_userdocs_configuring_rules.html
+++ b/pmd_userdocs_configuring_rules.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_userdocs_cpd.html b/pmd_userdocs_cpd.html
index abc7b8bdad..d16fd39058 100644
--- a/pmd_userdocs_cpd.html
+++ b/pmd_userdocs_cpd.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -2800,7 +2800,7 @@ to be “debug”.
Andy Glover wrote an Ant task for CPD; here’s how to use it:
<path id="pmd.classpath">
- <fileset dir="/home/joe/pmd-bin-7.0.1-SNAPSHOT/lib">
+ <fileset dir="/home/joe/pmd-bin-7.1.0-SNAPSHOT/lib">
<include name="*.jar"/>
</fileset>
</path>
diff --git a/pmd_userdocs_cpd_report_formats.html b/pmd_userdocs_cpd_report_formats.html
index b20e560002..12195506cd 100644
--- a/pmd_userdocs_cpd_report_formats.html
+++ b/pmd_userdocs_cpd_report_formats.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_userdocs_extending_ast_dump.html b/pmd_userdocs_extending_ast_dump.html
index 2567049af9..86dce2dfb4 100644
--- a/pmd_userdocs_extending_ast_dump.html
+++ b/pmd_userdocs_extending_ast_dump.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_userdocs_extending_defining_properties.html b/pmd_userdocs_extending_defining_properties.html
index 22a4df22f4..c4bb75144b 100644
--- a/pmd_userdocs_extending_defining_properties.html
+++ b/pmd_userdocs_extending_defining_properties.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1901,22 +1901,22 @@ that your rule uses it. A property descriptor defines a number of attributes for
The procedure to define a property is quite straightforward:
- Create a property descriptor of the type you want, by using a
-builder from
PropertyFactory
- - Call
definePropertyDescriptor(PropertyDescriptor)
+builder from PropertyFactory
+ - Call
definePropertyDescriptor(PropertyDescriptor)
in the rule’s noarg constructor.
You can then retrieve the value of the property at any time using
-getProperty(PropertyDescriptor)
.
+getProperty(PropertyDescriptor)
.
-Note: The base class for all rule implementations is AbstractRule
, which
-is a PropertySource
. So you can directly call definePropertyDescriptor(...)
+
Note: The base class for all rule implementations is AbstractRule
, which
+is a PropertySource
. So you can directly call definePropertyDescriptor(...)
or getProperty(...)
within your rule.
Creating a descriptor
Properties can be built using type-specific builders, which can be obtained
-from the factory methods of PropertyFactory
. For example, to build a
+from the factory methods of PropertyFactory
. For example, to build a
string property, you would call
PropertyFactory.stringProperty("myProperty")
.desc("This is my property")
@@ -1936,8 +1936,8 @@ and the default value are not optional.
.build();
-Predefined constraints such as positive
and below
are available in the class NumericConstraints
.
-A custom constraint can be implemented by implementing the interface PropertyConstraint
.
+Predefined constraints such as positive
and below
are available in the class NumericConstraints
.
+A custom constraint can be implemented by implementing the interface PropertyConstraint
.
Enumerated properties do not have a specific value type, instead,
you can choose any type of value, provided the values are from a closed set. To make
@@ -1964,7 +1964,7 @@ There are several things to notice here:
- The property descriptors are declared
static final
, which should generally be
the case, as descriptors are immutable and can be shared between instances of the same rule;
- - The property is declared using
definePropertyDescriptor
` in the constructor,
+ - The property is declared using
definePropertyDescriptor
` in the constructor,
which ensures the property gets recognised by PMD at the time the properties
are overridden (which happens before rule execution);
- The value of the property is not retrieved in the constructor, but in one of
diff --git a/pmd_userdocs_extending_designer_reference.html b/pmd_userdocs_extending_designer_reference.html
index 7c04d3c9cb..8d187e422d 100644
--- a/pmd_userdocs_extending_designer_reference.html
+++ b/pmd_userdocs_extending_designer_reference.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_userdocs_extending_rule_guidelines.html b/pmd_userdocs_extending_rule_guidelines.html
index 0efec9889b..f15c7205e0 100644
--- a/pmd_userdocs_extending_rule_guidelines.html
+++ b/pmd_userdocs_extending_rule_guidelines.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_userdocs_extending_testing.html b/pmd_userdocs_extending_testing.html
index 2bd8c2b937..a262f30b05 100644
--- a/pmd_userdocs_extending_testing.html
+++ b/pmd_userdocs_extending_testing.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1891,7 +1891,7 @@ Each category-ruleset has a single abstract base test class, from which the indi
We have one test class per rule, which executes all test cases for a single rule. The actual test cases are
stored in separate XML files, for each rule a separate file is used.
-All the test classes inherit from PmdRuleTst
,
+
All the test classes inherit from PmdRuleTst
,
which provides the seamless integration with JUnit5. This base class determines the language, the category name
and the rule name from the concrete test class. It then searches the test code on its own.
E.g. the individual rule test class
@@ -1907,7 +1907,7 @@ test case and just execute this one.
Where to place the test code
-The PmdRuleTst
class searches the XML file, that describes the test cases
+
The PmdRuleTst
class searches the XML file, that describes the test cases
for a certain rule using the following convention:
The XML file is a test resource, so it is searched in the tree under src/test/resources
.
@@ -1931,7 +1931,7 @@ which is under test.
src/test/resources/net/sourceforge/pmd/lang/<Language Id>/rule/<Category Name>/xml/<Rule Name>.xml
-Note: Language Id is the id defined by the language module, see getId
.
+Note: Language Id is the id defined by the language module, see getId
.
Tip: This convention allows you to quickly find the test cases for a given rule:
Just search in the project for a file <Rule Name>.xml
. Search for a class <Rule Name>Test
to find the
@@ -1945,7 +1945,7 @@ see Using the test framework exte
Test Class: AbstractClassWithoutAbstractMethodTest
-This class inherits from PmdRuleTst
and is located in the package “bestpractices”,
+
This class inherits from PmdRuleTst
and is located in the package “bestpractices”,
since the rule belongs to the category “Best Practices”:
package net.sourceforge.pmd.lang.java.rule.bestpractices;
@@ -2119,7 +2119,7 @@ In order to use the test framework you just need to reference the dependency <dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-test</artifactId>
- <version>7.0.1-SNAPSHOT</version>
+ <version>7.1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
@@ -2154,22 +2154,22 @@ of JUnit5 under the hood, among a couple of utility classes:
-
-
PmdRuleTst
: This is the base class for tests in PMD’s code base. It is a subclass of
-RuleTst
and just
+
PmdRuleTst
: This is the base class for tests in PMD’s code base. It is a subclass of
+RuleTst
and just
contains the logic to determine the test resources based on the test class name.
-
-
SimpleAggregatorTst
: This is a more generic base class for the test classes.
+
SimpleAggregatorTst
: This is a more generic base class for the test classes.
It doesn’t register any test cases on its own. You can register your own rule tests.
-It itself is a subclass of RuleTst
.
+It itself is a subclass of RuleTst
.
-
The maven module “pmd-test-schema” contains the logic to parse the XML files and provides a
-RuleTestCollection
. This in turn contains a list of
-RuleTestDescriptor
s. Each rule test descriptor describes a single test case.
+RuleTestCollection
. This in turn contains a list of
+RuleTestDescriptor
s. Each rule test descriptor describes a single test case.
-
-
RuleTst
: uses the TestSchemaParser
+
RuleTst
: uses the TestSchemaParser
from module “pmd-test-schema” to parse the test cases, executes each
rule test descriptor and asserts the results. It defines a test method ruleTests()
which is a test factory
and returns one dynamic test per rule test.
diff --git a/pmd_userdocs_extending_writing_java_rules.html b/pmd_userdocs_extending_writing_java_rules.html
index 78c9b1e461..1c0e9fe189 100644
--- a/pmd_userdocs_extending_writing_java_rules.html
+++ b/pmd_userdocs_extending_writing_java_rules.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1894,9 +1894,9 @@ very similar for other languages.
To write a rule in Java you’ll have to:
- - Write a Java class that implements the interface
Rule
. Each
+ - Write a Java class that implements the interface
Rule
. Each
language implementation provides a base rule class to ease your pain,
-e.g. AbstractJavaRule
.
+e.g. AbstractJavaRule
.
- Compile this class, linking it to PMD APIs (e.g. using PMD as a Maven dependency)
- Bundle this into a JAR and add it to the execution classpath of PMD
- Declare the rule in your ruleset XML
@@ -1924,7 +1924,7 @@ by default just visits the children.
Generally, a rule wants to check for only some node types. In our XPath example
in Your First Rule,
we wanted to check for some VariableId
nodes. That’s the XPath name,
-but in Java, you’ll get access to the ASTVariableId
+but in Java, you’ll get access to the ASTVariableId
full API.
If you want to check for some specific node types, you can override the
@@ -1972,12 +1972,12 @@ speed-up your rule by using the rulechain.
That mechanism doesn’t recurse on all the tree, instead, your rule will only be
passed the nodes it is interested in. To use the rulechain correctly:
- - Your rule must override the method
buildTargetSelector
. This method
+ - Your rule must override the method
buildTargetSelector
. This method
should return a target selector, that selects all the node types you are interested in. E.g. the factory
-method forTypes
can be used
+method forTypes
can be used
to create such a selector.
- For the Java language, there is another base class, to make it easier:
-
AbstractJavaRulechainRule
. You’ll need to call the super constructor and
+AbstractJavaRulechainRule
. You’ll need to call the super constructor and
provide the node types you are interested in.
- Your visit methods must not recurse! In effect, you should call never
call
super.visit
in the methods.
@@ -1988,18 +1988,18 @@ call super.visit
in th
In Java rule implementations, you often need to navigate the AST to find the interesting nodes.
In your visit
implementation, you can start navigating the AST from the given node.
-The Node
interface provides a couple of useful methods
-that return a NodeStream
and can be used to query the AST:
+The Node
interface provides a couple of useful methods
+that return a NodeStream
and can be used to query the AST:
- ancestors
- ancestorsOrSelf
- children
- descendants
- descendantsOrSelf
- ancestors
- children
- descendants
+ ancestors
+ ancestorsOrSelf
+ children
+ descendants
+ descendantsOrSelf
+ ancestors
+ children
+ descendants
The returned NodeStream API provides easy to use methods that follow the Java Stream API (java.util.stream
).
@@ -2019,38 +2019,38 @@ that return a .nonEmpty(); // If the stream is non empty here, then all the pipeline matched
-The Node
interface provides also an alternative way to navigate the AST for convenience:
+The Node
interface provides also an alternative way to navigate the AST for convenience:
- getParent
- getNumChildren
- getChild
- getFirstChild
- getLastChild
- getPreviousSibling
- getNextSibling
- firstChild
+ getParent
+ getNumChildren
+ getChild
+ getFirstChild
+ getLastChild
+ getPreviousSibling
+ getNextSibling
+ firstChild
Depending on the AST of the language, there might also be more specific methods that can be used to
-navigate. E.g. in Java there exists the method ASTIfStatement#getCondition
+navigate. E.g. in Java there exists the method ASTIfStatement#getCondition
to get the condition of an If-statement.
Reporting violations
-In your visit method, you have access to the RuleContext
which is the entry point into
+
In your visit method, you have access to the RuleContext
which is the entry point into
reporting back during the analysis.
- addViolation
reports a rule violation at
+ addViolation
reports a rule violation at
the position of the given node with the message defined in the rule declaration XML element.
- The message defined in the rule declaration XML element might contain placeholder, such as
{0}
.
-In that case, you need to call addViolation
+In that case, you need to call addViolation
and provide the values for the placeholders. The message is actually processed as a java.text.MessageFormat
.
- Sometimes a rule might want to differentiate between different cases of a violation and use different
messages. This is possible by calling the methods
-
addViolationWithMessage
or
-addViolationWithMessage
.
+addViolationWithMessage
or
+addViolationWithMessage
.
Using these methods, the message defined in the rule declaration XML element is not used.
- Rules can be customized using properties and sometimes you want to include the actual value of a property
in the message, e.g. if the rule enforces a specific limit.
@@ -2123,11 +2123,11 @@ a different set of files to analyse. Then, for each such file and for each
rule copy:
- start
is called once, before parsing
- apply
is called with the root
+ start
is called once, before parsing
+ apply
is called with the root
of the AST. That method performs the AST traversal that ultimately calls visit methods.
It’s not called for RuleChain rules.
- end
is called when the rule is done processing
+ end
is called when the rule is done processing
the file
diff --git a/pmd_userdocs_extending_writing_pmd_rules.html b/pmd_userdocs_extending_writing_pmd_rules.html
index 07866272a3..84fb0ae766 100644
--- a/pmd_userdocs_extending_writing_pmd_rules.html
+++ b/pmd_userdocs_extending_writing_pmd_rules.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_userdocs_extending_writing_rules_intro.html b/pmd_userdocs_extending_writing_rules_intro.html
index 66d91f92f0..1a2c7dc264 100644
--- a/pmd_userdocs_extending_writing_rules_intro.html
+++ b/pmd_userdocs_extending_writing_rules_intro.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1929,10 +1929,10 @@ of the specific thing the rule is trying to flag. Rules then report a violation
Discovering the AST
-ASTs are represented by Java classes deriving from Node
.
+
ASTs are represented by Java classes deriving from Node
.
Each PMD language has its own set of such classes, and its own rules about how
these classes relate to one another, based on the grammar of the language. For
-example, all Java AST nodes extend JavaNode
.
+example, all Java AST nodes extend JavaNode
.
The structure of the AST can be discovered through
diff --git a/pmd_userdocs_extending_writing_xpath_rules.html b/pmd_userdocs_extending_writing_xpath_rules.html
index b00918dda1..6344a409d1 100644
--- a/pmd_userdocs_extending_writing_xpath_rules.html
+++ b/pmd_userdocs_extending_writing_xpath_rules.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -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
@@ -1897,7 +1897,7 @@ defined on. Concretely, this means:
- Every AST node is viewed as an XML element
- - The element has for local name the value of
getXPathNodeName
+ - The element has for local name the value of
getXPathNodeName
for the given node
@@ -1905,7 +1905,7 @@ for the given node
- This means, that documentation for attributes can be found in our Javadocs. For
example, the attribute
@SimpleName
of the Java node EnumDeclaration
is backed
-by the Java getter getSimpleName
.
+by the Java getter getSimpleName
.
@@ -2437,7 +2437,7 @@ Column numbers are 1-based. The end column is exclusive.
nodeClassName
as xs:string
- - Simple name of a class or interface in package
net.sourceforge.pmd.lang.java.ast
, without the 'AST' prefix
+ - Simple name of a class or interface in package
net.sourceforge.pmd.lang.java.ast
, without the 'AST' prefix
@@ -2452,10 +2452,10 @@ Column numbers are 1-based. The end column is exclusive.
//*[pmd-java:nodeIs("Expression")]
- - Matches all nodes that implement
ASTExpression
+ - Matches all nodes that implement
ASTExpression
//*[pmd-java:nodeIs("TypeDeclaration")]
- - Matches all nodes that implement
ASTTypeDeclaration
+ - Matches all nodes that implement
ASTTypeDeclaration
//*[pmd-java:nodeIs("Foo")]
- Runtime error, there's no class ASTFoo in the package
@@ -2502,7 +2502,7 @@ Column numbers are 1-based. The end column is exclusive.
- Returns true if the context node's static Java type is a subtype of the given type. This tests for the resolved type of the Java construct, not the type of the AST node. For example, the AST node for a literal (e.g.
5d
) has type ASTNumericLiteral, however this function will compare the type of the literal (eg here, double
) against the argument.
- Remarks
- - The context node must be a
TypeNode
+ - The context node must be a
TypeNode
@@ -2577,7 +2577,7 @@ Column numbers are 1-based. The end column is exclusive.
- Returns true if the context node's static type is exactly the given type. In particular, returns false if the context node's type is a subtype of the given type.
- Remarks
- - The context node must be a
TypeNode
+ - The context node must be a
TypeNode
@@ -2662,7 +2662,7 @@ Column numbers are 1-based. The end column is exclusive.
metricKey
as xs:string
- - The name of a metric in
JavaMetrics
(or an alias thereof).
+ - The name of a metric in
JavaMetrics
(or an alias thereof).
@@ -2727,7 +2727,7 @@ Column numbers are 1-based. The end column is exclusive.
- Returns true if the node has an annotation with the given qualified name
- Remarks
- - The context node must be an
Annotatable
, otherwise this returns false
+ - The context node must be an
Annotatable
, otherwise this returns false
@@ -2796,10 +2796,10 @@ Column numbers are 1-based. The end column is exclusive.
- - Returns a sequence of the effective modifiers of a node as strings. This is documented on
getEffectiveModifiers
.
+ - Returns a sequence of the effective modifiers of a node as strings. This is documented on
getEffectiveModifiers
.
- Remarks
- - The context node must be an
ModifierOwner
, otherwise this returns an empty sequence
+ - The context node must be an
ModifierOwner
, otherwise this returns an empty sequence
@@ -2858,10 +2858,10 @@ Column numbers are 1-based. The end column is exclusive.
- - Returns a sequence of the explicit modifiers of a node as strings. This is documented on
getExplicitModifiers
.
+ - Returns a sequence of the explicit modifiers of a node as strings. This is documented on
getExplicitModifiers
.
- Remarks
- - The context node must be an
ModifierOwner
, otherwise this returns an empty sequence
+ - The context node must be an
ModifierOwner
, otherwise this returns an empty sequence
@@ -2914,10 +2914,10 @@ Column numbers are 1-based. The end column is exclusive.
- - Uses an
TypeTestUtil.InvocationMatcher
to test the method signature called by the context node. The format of the parameter is described on that class.
+ - Uses an
TypeTestUtil.InvocationMatcher
to test the method signature called by the context node. The format of the parameter is described on that class.
- Remarks
- - The context node must be an
InvocationNode
, otherwise this returns false
+ - The context node must be an
InvocationNode
, otherwise this returns false
@@ -2930,7 +2930,7 @@ Column numbers are 1-based. The end column is exclusive.
sig
as xs:string
- - A signature, in the format described on
TypeTestUtil.InvocationMatcher
+ - A signature, in the format described on
TypeTestUtil.InvocationMatcher
diff --git a/pmd_userdocs_extending_your_first_rule.html b/pmd_userdocs_extending_your_first_rule.html
index 89cb276b4b..421283a2d8 100644
--- a/pmd_userdocs_extending_your_first_rule.html
+++ b/pmd_userdocs_extending_your_first_rule.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_userdocs_incremental_analysis.html b/pmd_userdocs_incremental_analysis.html
index f917cc62c7..374690a212 100644
--- a/pmd_userdocs_incremental_analysis.html
+++ b/pmd_userdocs_incremental_analysis.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_userdocs_installation.html b/pmd_userdocs_installation.html
index 45d7ca65e8..624667fc96 100644
--- a/pmd_userdocs_installation.html
+++ b/pmd_userdocs_installation.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_userdocs_making_rulesets.html b/pmd_userdocs_making_rulesets.html
index 252c9366a3..e57b11ade1 100644
--- a/pmd_userdocs_making_rulesets.html
+++ b/pmd_userdocs_making_rulesets.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_userdocs_migrating_to_pmd7.html b/pmd_userdocs_migrating_to_pmd7.html
index 182ba073ea..b8d4e510cc 100644
--- a/pmd_userdocs_migrating_to_pmd7.html
+++ b/pmd_userdocs_migrating_to_pmd7.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1887,7 +1887,7 @@ deprecation warnings.
-
-
Properties: In order to define property descriptors, you should use PropertyFactory
now.
+
Properties: In order to define property descriptors, you should use PropertyFactory
now.
This factory can create properties of any type. E.g. instead of StringProperty.named(...)
use
PropertyFactory.stringProperty(...)
.
@@ -1897,7 +1897,7 @@ This factory can create properties of any type. E.g. instead of addViolation
methods. These methods have been moved
-to RuleContext
. E.g. instead of addViolation(data, node, ...)
use asCtx(data).addViolation(node, ...)
.
+to RuleContext
. E.g. instead of addViolation(data, node, ...)
use asCtx(data).addViolation(node, ...)
.
- When you are calling PMD from CLI, you need to stop using deprecated CLI params, e.g.
@@ -2000,7 +2000,7 @@ with a backslash. This affects the following rules:
Ideally, you have written good tests already for your custom rules - see Testing your rules.
This helps to identify problems early on.
-The base test classes PmdRuleTst
and SimpleAggregatorTst
have been moved out
+
The base test classes PmdRuleTst
and SimpleAggregatorTst
have been moved out
of package net.sourceforge.pmd.testframework
. You’ll need to adjust your imports.
Ruleset XML
@@ -2017,7 +2017,7 @@ can be expected to work in PMD 7 without any further changes. So the migration p
with PMD 7. PMD 7 by default uses XPath 3.1. See below XPath for details.
Then change the class
attribute of your rule to net.sourceforge.pmd.lang.rule.xpath.XPathRule
- because the
-class XPathRule
has been moved into subpackage net.sourceforge.pmd.lang.rule.xpath
.
+class XPathRule
has been moved into subpackage net.sourceforge.pmd.lang.rule.xpath
.
There are some general changes for AST nodes regarding the @Image
attribute.
See below General AST Changes to avoid @Image.
@@ -2034,7 +2034,7 @@ functions.
If you have Java based rules, and you are using rulechain, this works a bit different now. The RuleChain API
has changed, see [core] Simplify the rulechain (#2490) for the full details.
But in short, you don’t call addRuleChainVisit(...)
in the rule’s constructor anymore. Instead, you
-override the method buildTargetSelector
:
+override the method buildTargetSelector
:
protected RuleTargetSelector buildTargetSelector() {
return RuleTargetSelector.forTypes(ASTVariableId.class);
@@ -2065,15 +2065,15 @@ of the AST. See the section Java AST below for details.<
Adding a new language with ANTLR.
- There is a shared ant script that wraps the calls to javacc:
javacc-wrapper.xml
. This should be used now.
- PMD’s parser adapter for JavaCC generated parsers is called now
-
JjtreeParserAdapter
. This is the class that needs to be implemented now.
+JjtreeParserAdapter
. This is the class that needs to be implemented now.
- There is no need anymore to write a custom
TokenManager
- we have now a common base class for JavaCC generated
-token managers. This base class is AbstractTokenManager
.
+token managers. This base class is AbstractTokenManager
.
- A rule violation factory is not needed anymore. For language specific information on rule violations, there is
-now a
ViolationDecorator
that a language can implement. These ViolationDecorators
+now a ViolationDecorator
that a language can implement. These ViolationDecorators
are called when a violation is reported and they can provide the additional information. This information can be
-used by renderers via RuleViolation#getAdditionalInfo
.
+used by renderers via RuleViolation#getAdditionalInfo
.
- A parser visitor adapter is not needed anymore. The visitor interface now provides a default implementation.
-Instead, a base visitor for the language should be created, which extends
AstVisitorBase
.
+Instead, a base visitor for the language should be created, which extends AstVisitorBase
.
- A rule chain visitor is not needed anymore. PMD provides a common implementation that fits all languages.
@@ -2218,33 +2218,33 @@ That way you avoid being confronted with just compile errors.
Unchanged methods that work as before:
- getParent
- getChild
- getNumChildren
- getIndexInParent
+ getParent
+ getChild
+ getNumChildren
+ getIndexInParent
New methods:
- getFirstChild
- getLastChild
- getPreviousSibling
- getNextSibling
- getRoot
+ getFirstChild
+ getLastChild
+ getPreviousSibling
+ getNextSibling
+ getRoot
New methods that integrate with NodeStream:
- children
- returns a NodeStream containing all the children of this node.
+ children
- returns a NodeStream containing all the children of this node.
Note: in PMD 6, this method returned an Iterable
- descendants
- descendantsOrSelf
- ancestors
- ancestorsOrSelf
- children
- firstChild
- descendants
- ancestors
+ descendants
+ descendantsOrSelf
+ ancestors
+ ancestorsOrSelf
+ children
+ firstChild
+ descendants
+ ancestors
Methods removed completely:
@@ -2261,7 +2261,7 @@ Note: in PMD 6, this method returned an jjt*
like jjtGetParent
. These methods were implementation specific. Use the equivalent methods like getParent()
.
-See Node
for the details.
+See Node
for the details.
NodeStream API
@@ -2287,7 +2287,7 @@ E.g. the following tests if the node is a variable declarator id initialized to
.nonEmpty(); // If the stream is non empty here, then all the pipeline matched
-See NodeStream
for the details.
+
See NodeStream
for the details.
Note: This was implemented via PR #1622 [core] NodeStream API
XPath: Migrating from 1.0 to 2.0
@@ -2352,8 +2352,8 @@ simply remove the “pmd:” prefix.
General AST Changes to avoid @Image
An abstract syntax tree should be abstract, but in the same time, should not be too abstract. One of the
-base interfaces for PMD’s AST for all languages is Node
, which provides
-the methods getImage
and hasImageEqualTo
.
+base interfaces for PMD’s AST for all languages is Node
, which provides
+the methods getImage
and hasImageEqualTo
.
However, these methods don’t necessarily make sense for all nodes in all contexts. That’s why getImage()
often returns just null
. Also, the name is not very describing. AST nodes should try to use more specific
names, such as getValue()
or getName()
.
@@ -2371,7 +2371,7 @@ by deprecating the attribute and providing alternatives.
Html
- ASTHtmlTextNode
: @Image
➡️ @Text
, @NormalizedText
➡️ @Text
, @Text
➡️ @WholeText
.
+ ASTHtmlTextNode
: @Image
➡️ @Text
, @NormalizedText
➡️ @Text
, @Text
➡️ @WholeText
.
Java
@@ -2384,83 +2384,83 @@ by deprecating the attribute and providing alternatives.
Some nodes have already the image attribute (and others) deprecated. These deprecated attributes are removed now:
- ASTAnnotationTypeDeclaration
: @Image
➡️ @SimpleName
- ASTAnonymousClassDeclaration
: @Image
➡️ @SimpleName
- ASTClassDeclaration
(previously “ASTClassOrInterfaceDeclaration”): @Image
➡️ @SimpleName
- ASTEnumDeclaration
: @Image
➡️ @SimpleName
- ASTFieldDeclaration
: @VariableName
➡️ VariableId/@Name
- ASTMethodDeclaration
: @Image
➡️ @Name
- ASTMethodDeclaration
: @MethodName
➡️ @Name
- ASTRecordDeclaration
: @Image
➡️ @SimpleName
- ASTVariableId
(previously “ASTVariableDeclaratorId”): @Image
➡️ @Name
- ASTVariableId
(previously “ASTVariableDeclaratorId”): @VariableName
➡️ @Name
- ASTVariableId
(previously “ASTVariableDeclaratorId”): @Array
➡️ @ArrayType
+ ASTAnnotationTypeDeclaration
: @Image
➡️ @SimpleName
+ ASTAnonymousClassDeclaration
: @Image
➡️ @SimpleName
+ ASTClassDeclaration
(previously “ASTClassOrInterfaceDeclaration”): @Image
➡️ @SimpleName
+ ASTEnumDeclaration
: @Image
➡️ @SimpleName
+ ASTFieldDeclaration
: @VariableName
➡️ VariableId/@Name
+ ASTMethodDeclaration
: @Image
➡️ @Name
+ ASTMethodDeclaration
: @MethodName
➡️ @Name
+ ASTRecordDeclaration
: @Image
➡️ @SimpleName
+ ASTVariableId
(previously “ASTVariableDeclaratorId”): @Image
➡️ @Name
+ ASTVariableId
(previously “ASTVariableDeclaratorId”): @VariableName
➡️ @Name
+ ASTVariableId
(previously “ASTVariableDeclaratorId”): @Array
➡️ @ArrayType
JavaScript
- ASTAssignment
: @Image
➡️ @Operator
- ASTBigIntLiteral
: @Image
➡️ @Value
- ASTBreakStatement
: @Image
➡️ Name/@Identifier
- ASTContinueStatement
: @Image
➡️ Name/@Identifier
- ASTErrorNode
: @Image
➡️ @Message
- ASTFunctionNode
: @Image
➡️ Name/@Identifier
- ASTInfixExpression
: @Image
➡️ @Operator
- ASTKeywordLiteral
: @Image
➡️ @Literal
- ASTLabel
: @Image
➡️ @Name
- ASTName
: @Image
➡️ @Identifier
- ASTNumberLiteral
: @Image
➡️ @Value
- ASTObjectProperty
: @Image
➡️ @Operator
- ASTPropertyGet
: @Image
➡️ @Operator
- ASTRegExpLiteral
: @Image
➡️ @Value
- ASTStringLiteral
: @Image
➡️ @Value
- ASTUnaryExpression
: @Image
➡️ @Operator
- ASTUpdateExpression
: @Image
➡️ @Operator
- ASTXmlDotQuery
: @Image
➡️ @Operator
- ASTXmlMemberGet
: @Image
➡️ @Operator
- ASTXmlPropRef
: @Image
➡️ Name[last()]/@Identifier
- ASTXmlString
: @Image
➡️ @Xml
+ ASTAssignment
: @Image
➡️ @Operator
+ ASTBigIntLiteral
: @Image
➡️ @Value
+ ASTBreakStatement
: @Image
➡️ Name/@Identifier
+ ASTContinueStatement
: @Image
➡️ Name/@Identifier
+ ASTErrorNode
: @Image
➡️ @Message
+ ASTFunctionNode
: @Image
➡️ Name/@Identifier
+ ASTInfixExpression
: @Image
➡️ @Operator
+ ASTKeywordLiteral
: @Image
➡️ @Literal
+ ASTLabel
: @Image
➡️ @Name
+ ASTName
: @Image
➡️ @Identifier
+ ASTNumberLiteral
: @Image
➡️ @Value
+ ASTObjectProperty
: @Image
➡️ @Operator
+ ASTPropertyGet
: @Image
➡️ @Operator
+ ASTRegExpLiteral
: @Image
➡️ @Value
+ ASTStringLiteral
: @Image
➡️ @Value
+ ASTUnaryExpression
: @Image
➡️ @Operator
+ ASTUpdateExpression
: @Image
➡️ @Operator
+ ASTXmlDotQuery
: @Image
➡️ @Operator
+ ASTXmlMemberGet
: @Image
➡️ @Operator
+ ASTXmlPropRef
: @Image
➡️ Name[last()]/@Identifier
+ ASTXmlString
: @Image
➡️ @Xml
JSP
- ASTAttributeValue
: @Image
➡️ @Value
- ASTCData
: @Image
➡️ @Content
- ASTCommentTag
: @Image
➡️ @Content
- ASTElExpression
: @Image
➡️ @Content
- ASTHtmlScript
: @Image
➡️ @Content
- ASTJspComment
: @Image
➡️ @Content
- ASTJspDeclaration
: @Image
➡️ @Content
- ASTJspExpression
: @Image
➡️ @Content
- ASTJspExpressionInAttribute
: @Image
➡️ @Content
- ASTJspScriptlet
: @Image
➡️ @Content
- ASTText
: @Image
➡️ @Content
- ASTUnparsedText
: @Image
➡️ @Content
- ASTValueBinding
: @Image
➡️ @Content
+ ASTAttributeValue
: @Image
➡️ @Value
+ ASTCData
: @Image
➡️ @Content
+ ASTCommentTag
: @Image
➡️ @Content
+ ASTElExpression
: @Image
➡️ @Content
+ ASTHtmlScript
: @Image
➡️ @Content
+ ASTJspComment
: @Image
➡️ @Content
+ ASTJspDeclaration
: @Image
➡️ @Content
+ ASTJspExpression
: @Image
➡️ @Content
+ ASTJspExpressionInAttribute
: @Image
➡️ @Content
+ ASTJspScriptlet
: @Image
➡️ @Content
+ ASTText
: @Image
➡️ @Content
+ ASTUnparsedText
: @Image
➡️ @Content
+ ASTValueBinding
: @Image
➡️ @Content
Modelica
- ASTAddOp
: @Image
➡️ @Operator
- ASTDerClassSpecifier
: @Image
➡️ @SimpleClassName
- ASTEnumerationShortClassSpecifier
: @Image
➡️ @SimpleClassName
- ASTExtendingLongClassSpecifier
: @Image
➡️ @SimpleClassName
- ASTFactor
: @Image
➡️ @Operator
- ASTLanguageSpecification
: @Image
➡️ @ExternalLanguage
- ASTMulOp
: @Image
➡️ @Operator
- ASTName
: @Image
➡️ @Name
- ASTNumberLiteral
: @Image
➡️ @Value
- ASTRelOp
: @Image
➡️ @Operator
- ASTSimpleLongClassSpecifier
: @Image
➡️ @SimpleClassName
- ASTSimpleName
: @Image
➡️ @Name
- ASTSimpleShortClassSpecifier
: @Image
➡️ @SimpleClassName
- ASTStoredDefinition
: @Image
➡️ @Name
- ASTStringComment
: @Image
➡️ @Comment
- ASTStringLiteral
: @Image
➡️ @Value
- ASTWithinClause
: @Image
➡️ @Name
+ ASTAddOp
: @Image
➡️ @Operator
+ ASTDerClassSpecifier
: @Image
➡️ @SimpleClassName
+ ASTEnumerationShortClassSpecifier
: @Image
➡️ @SimpleClassName
+ ASTExtendingLongClassSpecifier
: @Image
➡️ @SimpleClassName
+ ASTFactor
: @Image
➡️ @Operator
+ ASTLanguageSpecification
: @Image
➡️ @ExternalLanguage
+ ASTMulOp
: @Image
➡️ @Operator
+ ASTName
: @Image
➡️ @Name
+ ASTNumberLiteral
: @Image
➡️ @Value
+ ASTRelOp
: @Image
➡️ @Operator
+ ASTSimpleLongClassSpecifier
: @Image
➡️ @SimpleClassName
+ ASTSimpleName
: @Image
➡️ @Name
+ ASTSimpleShortClassSpecifier
: @Image
➡️ @SimpleClassName
+ ASTStoredDefinition
: @Image
➡️ @Name
+ ASTStringComment
: @Image
➡️ @Comment
+ ASTStringLiteral
: @Image
➡️ @Value
+ ASTWithinClause
: @Image
➡️ @Name
PLSQL
@@ -2473,30 +2473,30 @@ by deprecating the attribute and providing alternatives.
Scala
- ASTLitBoolean
: @Image
➡️ @Value
- ASTLitByte
: @Image
➡️ @Value
- ASTLitChar
: @Image
➡️ @Value
- ASTLitDouble
: @Image
➡️ @Value
- ASTLitFloat
: @Image
➡️ @Value
- ASTLitInt
: @Image
➡️ @Value
- ASTLitLong
: @Image
➡️ @Value
- ASTLitNull
: @Image
➡️ @Value
- ASTLitShort
: @Image
➡️ @Value
- ASTLitString
: @Image
➡️ @Value
- ASTLitSymbol
: @Image
➡️ @Value
- ASTLitUnit
: @Image
➡️ @Value
- ASTNameAnonymous
: @Image
➡️ @Value
- ASTNameIndeterminate
: @Image
➡️ @Value
- ASTTermName
: @Image
➡️ @Value
- ASTTypeName
: @Image
➡️ @Value
+ ASTLitBoolean
: @Image
➡️ @Value
+ ASTLitByte
: @Image
➡️ @Value
+ ASTLitChar
: @Image
➡️ @Value
+ ASTLitDouble
: @Image
➡️ @Value
+ ASTLitFloat
: @Image
➡️ @Value
+ ASTLitInt
: @Image
➡️ @Value
+ ASTLitLong
: @Image
➡️ @Value
+ ASTLitNull
: @Image
➡️ @Value
+ ASTLitShort
: @Image
➡️ @Value
+ ASTLitString
: @Image
➡️ @Value
+ ASTLitSymbol
: @Image
➡️ @Value
+ ASTLitUnit
: @Image
➡️ @Value
+ ASTNameAnonymous
: @Image
➡️ @Value
+ ASTNameIndeterminate
: @Image
➡️ @Value
+ ASTTermName
: @Image
➡️ @Value
+ ASTTypeName
: @Image
➡️ @Value
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,
+
Note: In general, it is recommended to use DomXPathRule
instead,
which exposes text nodes as real XPath/XML text nodes which conforms to the XPath spec.
There is no difference, text of text nodes can be selected using text()
.
@@ -2514,21 +2514,21 @@ which can also display the AST.
Renamed classes / interfaces
- - AccessNode ➡️
ModifierOwner
- - ClassOrInterfaceType ➡️ ClassType (
ASTClassType
)
- - ClassOrInterfaceDeclaration ➡️ ClassDeclaration (
ASTClassDeclaration
)
- - AnyTypeDeclaration ➡️ TypeDeclaration (
ASTTypeDeclaration
)
- - MethodOrConstructorDeclaration ➡️ ExecutableDeclaration (
ASTExecutableDeclaration
)
- - VariableDeclaratorId ➡️ VariableId (
ASTVariableId
)
- - ClassOrInterfaceBody ➡️ ClassBody (
ASTClassBody
)
+ - AccessNode ➡️
ModifierOwner
+ - ClassOrInterfaceType ➡️ ClassType (
ASTClassType
)
+ - ClassOrInterfaceDeclaration ➡️ ClassDeclaration (
ASTClassDeclaration
)
+ - AnyTypeDeclaration ➡️ TypeDeclaration (
ASTTypeDeclaration
)
+ - MethodOrConstructorDeclaration ➡️ ExecutableDeclaration (
ASTExecutableDeclaration
)
+ - VariableDeclaratorId ➡️ VariableId (
ASTVariableId
)
+ - ClassOrInterfaceBody ➡️ ClassBody (
ASTClassBody
)
Annotations
- What: Annotations are consolidated into a single node.
SingleMemberAnnotation
, NormalAnnotation
and MarkerAnnotation
-are removed in favour of ASTAnnotation
. The Name node is removed, replaced by a
-ASTClassType
.
+are removed in favour of ASTAnnotation
. The Name node is removed, replaced by a
+ASTClassType
.
- Why: Those different node types implement a syntax-only distinction, that only makes semantically equivalent annotations
have different possible representations. For example,
@A
and @A()
are semantically equivalent, yet they were
parsed as MarkerAnnotation resp. NormalAnnotation. Similarly, @A("")
and @A(value="")
were parsed as
@@ -2679,9 +2679,9 @@ type is used to share the disambiguation logic.
Annotation nesting
- - What:
ASTAnnotation
s are now nested within the node, to which they are applied to.
-E.g. if a method is annotated, the Annotation node is now a child of a ASTModifierList
,
-inside the ASTMethodDeclaration
.
+ - What:
ASTAnnotation
s are now nested within the node, to which they are applied to.
+E.g. if a method is annotated, the Annotation node is now a child of a ASTModifierList
,
+inside the ASTMethodDeclaration
.
- Why: Fixes a lot of inconsistencies, where sometimes the annotations were inside the node, and sometimes just
somewhere in the parent, with no real structure.
- Related issue: [java] Move annotations inside the node they apply to (#1875)
@@ -3018,9 +3018,9 @@ Enum constants
- What:
- ASTType
and ASTReferenceType
have been turned into
-interfaces, implemented by ASTPrimitiveType
, ASTClassType
,
-and the new node ASTArrayType
. This reduces the depth of the relevant
+ ASTType
and ASTReferenceType
have been turned into
+interfaces, implemented by ASTPrimitiveType
, ASTClassType
,
+and the new node ASTArrayType
. This reduces the depth of the relevant
subtrees, and allows to explore them more easily and consistently.
@@ -3098,8 +3098,8 @@ The Java equivalent is TypeHe
Array changes
- - What: Additional nodes
ASTArrayType
, ASTArrayTypeDim
,
-ASTArrayDimensions
, ASTArrayAllocation
.
+ - What: Additional nodes
ASTArrayType
, ASTArrayTypeDim
,
+ASTArrayDimensions
, ASTArrayAllocation
.
- Why: Support annotated array types ([java] Java8 parsing corner case with annotated array types (#997))
- Related issue: [java] Simplify array allocation expressions (#1981)
@@ -3246,7 +3246,7 @@ The Java equivalent is TypeHe
ClassType nesting
- - What:
ASTClassType
(formerly ASTClassOrInterfaceType) appears to be left recursive now,
+ - What:
ASTClassType
(formerly ASTClassOrInterfaceType) appears to be left recursive now,
and encloses its qualifying type.
- Why: To preserve the position of annotations and type arguments
- Related issue: [java] ClassOrInterfaceType AST improvements (#1150)
@@ -3321,8 +3321,8 @@ and encloses its qualifying type.
- What:
- ASTTypeArgument
is removed. Instead, the ASTTypeArguments
node contains directly
-a sequence of ASTType
nodes. To support this, the new node type ASTWildcardType
+ ASTTypeArgument
is removed. Instead, the ASTTypeArguments
node contains directly
+a sequence of ASTType
nodes. To support this, the new node type ASTWildcardType
captures the syntax previously parsed as a TypeArgument.
- The
ASTWildcardBounds
node is removed. Instead, the bound is a direct child of the WildcardType.
@@ -3395,7 +3395,7 @@ of nesting off.
- What: Remove the Name node in imports and package declaration nodes.
- - Why: Name is a TypeNode, but it’s equivalent to
ASTAmbiguousName
in that it describes nothing
+ - Why: Name is a TypeNode, but it’s equivalent to
ASTAmbiguousName
in that it describes nothing
about what it represents. The name in an import may represent a method name, a type name, a field name…
It’s too ambiguous to treat in the parser and could just be the image of the import, or package, or module.
- Related issue: [java] Remove Name nodes in Import- and PackageDeclaration (#1888)
@@ -3453,7 +3453,7 @@ It’s too ambiguous to treat in the parser and could just be the image of the i
Modifier lists
- - What:
ModifierOwner
(formerly AccessNode) is now based on a node: ASTModifierList
.
+ - What:
ModifierOwner
(formerly AccessNode) is now based on a node: ASTModifierList
.
That node represents
modifiers occurring before a declaration. It provides a flexible API to query modifiers, both explicit and
implicit. All declaration nodes now have such a modifier list, even if it’s implicit (no explicit modifiers).
@@ -3635,7 +3635,7 @@ These were unnecessary since annotations are nested (see above Module declarations
- - What: Removes the generic Name node and uses instead
ASTClassType
where appropriate. Also
+ - What: Removes the generic Name node and uses instead
ASTClassType
where appropriate. Also
uses specific node types for different directives (requires, exports, uses, provides).
- Why: Simplify queries, support type resolution
- Related issue: [java] Improve module grammar (#3890)
@@ -3711,7 +3711,7 @@ uses specific node types for different directives (requires, exports, uses, prov
Anonymous class declarations
- - What: A separate node type
ASTAnonymousClassDeclaration
is introduced for anonymous classes.
+ - What: A separate node type
ASTAnonymousClassDeclaration
is introduced for anonymous classes.
- Why: Unify the AST for type declarations including anonymous class declaration in constructor calls
and enums.
- Related issues:
@@ -3892,14 +3892,14 @@ explicitly differentiate between these two.
Formal parameters
- - What: Use
ASTFormalParameter
only for method and constructor declaration. Lambdas use
-ASTLambdaParameter
, catch clauses use ASTCatchParameter
.
+ - What: Use
ASTFormalParameter
only for method and constructor declaration. Lambdas use
+ASTLambdaParameter
, catch clauses use ASTCatchParameter
.
- Why: FormalParameter’s API is different from the other ones.
- FormalParameter must mention a type node.
- LambdaParameter can be inferred
- CatchParameter cannot be varargs
- - CatchParameter can have multiple exception types (a
ASTUnionType
now)
+ - CatchParameter can have multiple exception types (a
ASTUnionType
now)
@@ -4053,11 +4053,11 @@ explicitly differentiate between these two.
New node for explicit receiver parameter
- - What: A separate node type
ASTReceiverParameter
is introduced to differentiate it from formal parameters.
+ - What: A separate node type
ASTReceiverParameter
is introduced to differentiate it from formal parameters.
- Why: A receiver parameter is not a formal parameter, even though it looks like one: it doesn’t declare a variable,
and doesn’t affect the arity of the method or constructor. It’s so rarely used that giving it its own node avoids
-matching it by mistake and simplifies the API and grammar of the ubiquitous
ASTFormalParameter
-and ASTVariableId
.
+matching it by mistake and simplifies the API and grammar of the ubiquitous ASTFormalParameter
+and ASTVariableId
.
- Related issue: [java] Separate receiver parameter from formal parameter (#1980)
@@ -4107,7 +4107,7 @@ and Varargs
- - What: parse the varargs ellipsis as an
ASTArrayType
.
+ - What: parse the varargs ellipsis as an
ASTArrayType
.
- Why: this improves regularity of the grammar, and allows type annotations to be added to the ellipsis
@@ -4201,7 +4201,7 @@ and Add void type node to replace ResultType
- - What: Add a
ASTVoidType
node to replace ASTResultType
.
+ - What: Add a
ASTVoidType
node to replace ASTResultType
.
- Why: This means we don’t need the ResultType wrapper when the method is not void, and the result type node is never null.
- Related issue: [java] Add void type node to replace ResultType (#2715)
@@ -4262,8 +4262,8 @@ and ASTBlock
are by definition
-ASTStatement
s, which is now an interface implemented by all statements.
+All children of a ASTBlock
are by definition
+ASTStatement
s, which is now an interface implemented by all statements.
- Why: This simplifies the tree traversal. The removed nodes BlockStatement and Statement didn’t add any
additional information. We only need a Statement abstraction. BlockStatement was used to enforce, that no
variable or local class declaration is found alone as the child of e.g. an unbraced if, else, for, etc.
@@ -4323,7 +4323,7 @@ This is a parser-only distinction that’s not that useful for analysis later on
New node for For-each statements
- - What: New node for For-each statements:
ASTForeachStatement
instead of ForStatement.
+ - What: New node for For-each statements:
ASTForeachStatement
instead of ForStatement.
- Why: This makes it a lot easier to distinguish in the AST between For-loops and For-Each-loops. E.g. some
rules only apply to one or the other, and it was complicated to write a rule that works with both different
subtrees (for loops have additional children ForInit and ForUpdate)
@@ -4393,12 +4393,12 @@ subtrees (for loops have additional children ForInit and ForUpdate)
New nodes for ExpressionStatement, LocalClassStatement
- - What: Renamed StatementExpression to
ASTExpressionStatement
.
-Added new node ASTLocalClassStatement
.
- - Why: ExpressionStatement is now a
ASTStatement
, that can be used as a child in a
-block. It itself has only one child, which is some kind of ASTExpression
,
+ - What: Renamed StatementExpression to
ASTExpressionStatement
.
+Added new node ASTLocalClassStatement
.
+ - Why: ExpressionStatement is now a
ASTStatement
, that can be used as a child in a
+block. It itself has only one child, which is some kind of ASTExpression
,
which can be really any kind of expression (like assignment).
-In order to allow local class declarations as part of a block, we introduced ASTLocalClassStatement
+In order to allow local class declarations as part of a block, we introduced ASTLocalClassStatement
which is a statement that carries a type declaration. Now blocks are just a list of statements.
This allows us to have two distinct hierarchies for expressions and statements.
- Related issue: [java] Improve statement grammar (#2164)
@@ -4448,7 +4448,7 @@ This allows us to have two distinct hierarchies for expressions and statements.<
- What: The AST representation of a try-with-resources statement has been simplified.
-It uses now
ASTLocalVariableDeclaration
unless it is a concise try-with-resources.
+It uses now ASTLocalVariableDeclaration
unless it is a concise try-with-resources.
- Why: Simpler integration try-with-resources into symboltable and type resolution.
- Related issue: [java] Improve try-with-resources grammar (#1897)
@@ -4536,7 +4536,7 @@ It uses now ASTExpression
and ASTPrimaryExpression
have
+ ASTExpression
and ASTPrimaryExpression
have
been turned into interfaces. These added no information to the AST and increased
its depth unnecessarily. All expressions implement the first interface. Both of
those nodes can no more be found in ASTs.
@@ -4556,14 +4556,14 @@ name tests won’t match anything anymore. However, the axis step *[@Expression=
- What:
- ASTLiteral
has been turned into an interface.
- ASTNumericLiteral
, ASTCharLiteral
, ASTStringLiteral
,
-and ASTClassLiteral
are new nodes that implement that interface.
- - ASTLiteral implements
ASTPrimaryExpression
+ ASTLiteral
has been turned into an interface.
+ ASTNumericLiteral
, ASTCharLiteral
, ASTStringLiteral
,
+and ASTClassLiteral
are new nodes that implement that interface.
+ - ASTLiteral implements
ASTPrimaryExpression
- - Why: The fact that
ASTNullLiteral
-and ASTBooleanLiteral
were nested within it but other literals types were all directly represented
+ - Why: The fact that
ASTNullLiteral
+and ASTBooleanLiteral
were nested within it but other literals types were all directly represented
by it was inconsistent, and ultimately that level of nesting was unnecessary.
- Related issue: [java] New expression and type grammar (#1759)
- Migrating:
@@ -4617,9 +4617,9 @@ by it was inconsistent, and ultimately that level of nesting was unnecessary.
- What: Extra nodes dedicated for method and constructor calls and array allocations
- Why: It was extremely difficult to identify method calls in PMD 6 - these consisted of multiple nodes with
@@ -4797,7 +4797,7 @@ without bothering with the placement details.
but hopefully firing up the designer to inspect the new structure should
give you the information you need quickly.
-
Note: this also affect binary expressions like ASTInfixExpression
.
+
Note: this also affect binary expressions like ASTInfixExpression
.
E.g. a+b+c
is not parsed as
AdditiveExpression
+ (a)
@@ -4819,9 +4819,9 @@ E.g. a+b+c
is not pars
- What: New nodes dedicated to accessing field, variables and referencing arrays.
Also provide info about the access type, like whether a variable is read or written.
- Why: Like MethodCalls, this was a missing abstraction in the AST that has been added now.
@@ -4936,8 +4936,8 @@ Also provide info about the access type, like whether a variable is read or writ
- What:
this
and super
are now explicit nodes instead of PrimaryPrefix.
- Why: That way these nodes can qualify other nodes like FieldAccess.
@@ -5032,8 +5032,8 @@ Also provide info about the access type, like whether a variable is read or writ
Type expressions
- - What: The node
ASTTypeExpression
wraps a ASTType
node (such as
-ASTClassType
) and is used to qualify a method call or field access or method reference.
+ - What: The node
ASTTypeExpression
wraps a ASTType
node (such as
+ASTClassType
) and is used to qualify a method call or field access or method reference.
- Why: Simplify the qualifier of method calls, treat instanceof as infix expression.
- Related issue: [java] Grammar type expr (#2039)
@@ -5117,7 +5117,7 @@ Also provide info about the access type, like whether a variable is read or writ
Merge unary expressions
- - What: Merge AST nodes for postfix and prefix expressions into the single
ASTUnaryExpression
node.
+ - What: Merge AST nodes for postfix and prefix expressions into the single
ASTUnaryExpression
node.
The merged nodes are:
- PreIncrementExpression
@@ -5339,7 +5339,7 @@ which is based on an open source grammar for Apex: Method
(ASTMethod
)
+
- Node
Method
(ASTMethod
)
- No attribute
@Synthetic
anymore. Unlike Jorje, Summit AST doesn’t generate synthetic methods anymore, so
this attribute would have been always false and is of no use. Therefore it has been removed completely.
@@ -5350,7 +5350,7 @@ this attribute would have been always false and is of no use. Therefore it has b
new parser doesn’t generate synthetic methods anymore, this node is not needed anymore.
- There is in general no attribute
@Namespace
anymore. The attribute has been removed, as it was never fully
implemented. It always returned an empty string.
- - Node
ReferenceExpression
(ASTReferenceExpression
)
+ - Node
ReferenceExpression
(ASTReferenceExpression
)
- No attribute
@Context
anymore. It was not used and always returned null
.
@@ -5373,14 +5373,14 @@ this default version will be used. Usually the latest version is the default ver
This is only relevant, if you are maintaining a CPD language module for a custom language.
- - Instead of
AbstractLanguage
extend now CpdOnlyLanguageModuleBase
.
- - Instead of
AntlrTokenManager
use now TokenManager
- - Instead of
AntlrTokenFilter
also use now TokenManager
- - Instead of
AntlrTokenFilter
extend now BaseTokenFilter
+ - Instead of
AbstractLanguage
extend now CpdOnlyLanguageModuleBase
.
+ - Instead of
AntlrTokenManager
use now TokenManager
+ - Instead of
AntlrTokenFilter
also use now TokenManager
+ - Instead of
AntlrTokenFilter
extend now BaseTokenFilter
- CPD Module discovery change. The service loader won’t load anymore
src/main/resources/META-INF/services/net.sourceforge.pmd.cpd.Language
but instead src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language
. This is the unified
language interface for both PMD and CPD capable languages. See also the subinterfaces
-CpdCapableLanguage
and PmdCapableLanguage
.
+CpdCapableLanguage
and PmdCapableLanguage
.
- The documentation How to add a new CPD language has been updated
to reflect these changes.
@@ -5396,7 +5396,7 @@ See the use case I’m using only built-
Ant
- - The Ant tasks
PMDTask
and CPDTask
have been moved from the module
+ - The Ant tasks
PMDTask
and CPDTask
have been moved from the module
pmd-core
into the new module pmd-ant
.
- You need to add this dependency/jar file onto the class path (
net.sourceforge.pmd:pmd-ant
) in order to
import the tasks into your build file.
@@ -5416,11 +5416,11 @@ the pmd-ant jar file is included in the binary distribution of PMD. It is part o
- Gradle uses internally PMD’s Ant task to execute PMD
- Gradle 8.6 supports PMD 7 out of the box, but does not yet use PMD 7 by default.
- - You can set
toolVersion = "7.0.1-SNAPSHOT"
.
+ - You can set
toolVersion = "7.1.0-SNAPSHOT"
.
- Only for older gradle versions you need to configure the dependencies manually for now, since
the ant task is in an own dependency with PMD 7:
-
pmd 'net.sourceforge.pmd:pmd-ant:7.0.1-SNAPSHOT'
-pmd 'net.sourceforge.pmd:pmd-java:7.0.1-SNAPSHOT'
+ pmd 'net.sourceforge.pmd:pmd-ant:7.1.0-SNAPSHOT'
+pmd 'net.sourceforge.pmd:pmd-java:7.1.0-SNAPSHOT'
- See Support for PMD 7.0
diff --git a/pmd_userdocs_report_formats.html b/pmd_userdocs_report_formats.html
index 7650392ad8..4878e4b78f 100644
--- a/pmd_userdocs_report_formats.html
+++ b/pmd_userdocs_report_formats.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_userdocs_suppressing_warnings.html b/pmd_userdocs_suppressing_warnings.html
index 9a8c0cb9df..6e86669390 100644
--- a/pmd_userdocs_suppressing_warnings.html
+++ b/pmd_userdocs_suppressing_warnings.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_userdocs_tools.html b/pmd_userdocs_tools.html
index e6180bcf07..1777229c76 100644
--- a/pmd_userdocs_tools.html
+++ b/pmd_userdocs_tools.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
diff --git a/pmd_userdocs_tools_ant.html b/pmd_userdocs_tools_ant.html
index d23e9dc23b..26608ab5eb 100644
--- a/pmd_userdocs_tools_ant.html
+++ b/pmd_userdocs_tools_ant.html
@@ -85,7 +85,7 @@
- - PMD 7.0.1-SNAPSHOT
+ - PMD 7.1.0-SNAPSHOT
Release date: 26-April-2024
@@ -1887,12 +1887,12 @@ Then you can either copy all “*.jar” files from PMD’s lib folder into one
(ANT_HOME/lib
, ${user.home}/.ant/lib
) or using the -lib
command line parameter.
However, the preferred way is to define a <classpath>
for pmd itself and use this classpath when
-adding the PMD Task. Assuming, you have extracted the PMD zip file to /home/joe/pmd-bin-7.0.1-SNAPSHOT
,
+adding the PMD Task. Assuming, you have extracted the PMD zip file to /home/joe/pmd-bin-7.1.0-SNAPSHOT
,
then you can make use of the PMD Task like this:
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask">
<classpath>
- <fileset dir="/home/joe/pmd-bin-7.0.1-SNAPSHOT/lib">
+ <fileset dir="/home/joe/pmd-bin-7.1.0-SNAPSHOT/lib">
<include name="*.jar"/>
</fileset>
</classpath>
@@ -1902,7 +1902,7 @@ then you can make use of the PMD Task like this:
Alternatively, a path can be defined and used via classpathref
:
<path id="pmd.classpath">
- <fileset dir="/home/joe/pmd-bin-7.0.1-SNAPSHOT/lib">
+ <fileset dir="/home/joe/pmd-bin-7.1.0-SNAPSHOT/lib">
<include name="*.jar"/>
</fileset>
</path>
@@ -2134,7 +2134,7 @@ make sure you use the XML formatter in the PMD task invocation, i.e.:
need to be configured when defining the task: