Merge branch 'master' into cli-banner-display

This commit is contained in:
Andreas Dangel
2024-03-05 19:40:48 +01:00
1059 changed files with 5284 additions and 6084 deletions

View File

@ -7370,6 +7370,15 @@
"contributions": [
"bug"
]
},
{
"login": "liqingjun123",
"name": "liqingjun123",
"avatar_url": "https://avatars.githubusercontent.com/u/12873992?v=4",
"profile": "https://github.com/liqingjun123",
"contributions": [
"bug"
]
}
],
"contributorsPerLine": 7,

View File

@ -6,7 +6,7 @@
<!-- Input properties:
- lang-name: matches the grammar name (eg "Swift")
- lang-terse-name: uncapitalized package name (eg "swift")
- lang-id: the language id, used in the conventional package name (eg "swift")
- node-prefix: prefix for generated AST nodes (eg "Sw")
- root-node-name: name of the root node without prefix (eg "TopLevel"), will be made to implement RootNode
@ -14,10 +14,10 @@
-->
<property name="target-package-dir" value="${antlr4.outputDirectory}/net/sourceforge/pmd/lang/${lang-terse-name}/ast"/>
<property name="target-package-dir" value="${antlr4.outputDirectory}/net/sourceforge/pmd/lang/${lang-id}/ast"/>
<property name="lang-ast-package" value="net.sourceforge.pmd.lang.${lang-terse-name}.ast" />
<property name="lang-ast-package" value="net.sourceforge.pmd.lang.${lang-id}.ast" />
<property name="ast-api-package" value="net.sourceforge.pmd.lang.ast" />
<property name="ast-impl-package" value="${ast-api-package}.impl.antlr4" />

View File

@ -281,7 +281,7 @@ echo "Then proceed with releasing pmd-designer..."
echo "<https://github.com/pmd/pmd-designer/blob/master/releasing.md>"
echo
echo "Press enter to continue when pmd-designer is available in maven-central..."
echo "<https://repo.maven.apache.org/maven2/net/sourceforge/pmd/pmd-ui/maven-metadata.xml>."
echo "<https://repo.maven.apache.org/maven2/net/sourceforge/pmd/pmd-designer/maven-metadata.xml>."
echo
echo "Note: If there is no new pmd-designer release needed, you can directly proceed."
read -r

View File

@ -324,10 +324,10 @@ entries:
subfolderitems:
- title: Index
output: web, pdf
url: /pmd_rules_vf.html
url: /pmd_rules_visualforce.html
- title: Security
output: web, pdf
url: /pmd_rules_vf_security.html
url: /pmd_rules_visualforce_security.html
- title: null
output: web, pdf
subfolders:
@ -360,16 +360,16 @@ entries:
subfolderitems:
- title: Index
output: web, pdf
url: /pmd_rules_vm.html
url: /pmd_rules_velocity.html
- title: Best Practices
output: web, pdf
url: /pmd_rules_vm_bestpractices.html
url: /pmd_rules_velocity_bestpractices.html
- title: Design
output: web, pdf
url: /pmd_rules_vm_design.html
url: /pmd_rules_velocity_design.html
- title: Error Prone
output: web, pdf
url: /pmd_rules_vm_errorprone.html
url: /pmd_rules_velocity_errorprone.html
- title: null
output: web, pdf
subfolders:
@ -502,7 +502,7 @@ entries:
url: /pmd_languages_visualforce.html
output: web, pdf
- title: Velocity Template Language (VTL)
url: /pmd_languages_vm.html
url: /pmd_languages_velocity.html
output: web, pdf
- title: XML and XML dialects
url: /pmd_languages_xml.html

View File

@ -104,7 +104,7 @@ class JDocNamespaceDeclaration < Liquid::Tag
'javascript', 'jsp', 'julia',
'kotlin', 'lang-test', 'lua', 'matlab', 'objectivec', 'perl', 'php', 'plsql', 'python', 'ruby', 'scala', 'swift',
'test', 'test-schema', 'tsql', 'ui',
'modelica', 'visualforce', 'vm', 'xml'].flat_map {|m| [m, "pmd-" + m]}
'modelica', 'visualforce', 'velocity', 'xml'].flat_map {|m| [m, "pmd-" + m]}
def self.make_base_namespaces
res = {}

View File

@ -119,7 +119,7 @@ against a previously recorded version. If there are differences, the test fails.
This helps to detect anything in the AST structure that changed, maybe unexpectedly.
* Create a test class in the package `net.sourceforge.pmd.lang.$lang.ast` with the name `$langTreeDumpTest`.
* This test class must extend `net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest`. Note: This class
* This test class must extend `net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest`. Note: This class
is written in kotlin and is available in the module "lang-test".
* Add a default constructor, that calls the super constructor like so:
@ -131,7 +131,7 @@ This helps to detect anything in the AST structure that changed, maybe unexpecte
Replace "$lang" and "$extension" accordingly.
* Implement the method `getParser()`. It must return a
subclass of `net.sourceforge.pmd.lang.ast.test.BaseParsingHelper`. See
subclass of `net.sourceforge.pmd.lang.test.ast.BaseParsingHelper`. See
`net.sourceforge.pmd.lang.ecmascript.ast.JsParsingHelper` for an example.
With this parser helper you can also specify, where the test files are searched, by using
the method `withResourceContext(Class<?>, String)`.
@ -252,7 +252,7 @@ This can be achieved with Rule Designer:
* Fork and clone the [pmd/pmd-designer](https://github.com/pmd/pmd-designer) repository.
* Add a syntax highlighter implementation to `net.sourceforge.pmd.util.fxdesigner.util.codearea.syntaxhighlighting` (you could use Java as an example).
* Register it in the `AvailableSyntaxHighlighters` enumeration.
* Now build your implementation and place the `target/pmd-ui-<version>-SNAPSHOT.jar` to the `lib` directory inside your `pmd-bin-...` distribution (you have to delete old `pmd-ui-*.jar` from there).
* Now build your implementation and place the `target/pmd-designer-<version>-SNAPSHOT.jar` to the `lib` directory inside your `pmd-bin-...` distribution (you have to delete old `pmd-designer-*.jar` from there).
## Optional features

View File

@ -75,7 +75,7 @@ If your language only supports CPD, then you can subclass {% jdoc core::lang.imp
At this point the new language module should be available in {% jdoc core::lang.LanguageRegistry#CPD %} and usable by CPD like any other language.
4. Update the test that asserts the list of supported languages by updating the `SUPPORTED_LANGUAGES` constant in [BinaryDistributionIT](https://github.com/pmd/pmd/blob/master/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java).
4. Update the test that asserts the list of supported languages by updating the `SUPPORTED_LANGUAGES` constant in [BinaryDistributionIT](https://github.com/pmd/pmd/blob/master/pmd-dist/src/test/java/net/sourceforge/pmd/dist/BinaryDistributionIT.java).
5. Add some tests for your CpdLexer by following the [section below](#testing-your-implementation).

View File

@ -33,8 +33,10 @@ See [Apex language properties](pmd_languages_configuration.html#apex-language-pr
## Parser
We use Jorje, the Apex parsers that is shipped within the Apex Language Server. This is part of
the [Salesforce Extensions for VS Code](https://github.com/forcedotcom/salesforcedx-vscode).
Since PMD 7.0.0 we use the open source [apex-parser](https://github.com/apex-dev-tools/apex-parser),
together with [Summit AST](https://github.com/google/summit-ast) which translates the ANTLR parse tree
into an AST.
We take the binary from <https://github.com/forcedotcom/salesforcedx-vscode/tree/develop/packages/salesforcedx-vscode-apex/out>
and provide it as a maven dependency (see [pmd-apex-jorje](https://github.com/pmd/pmd/tree/master/pmd-apex-jorje)).
When PMD added Apex support with version 5.5.0, it utilized the Apex Jorje library to parse Apex source
and generate an AST. This library is however a binary-blob provided as part of the
[Salesforce Extensions for VS Code](https://github.com/forcedotcom/salesforcedx-vscode), and it is closed-source.

View File

@ -15,9 +15,10 @@ Usually the latest non-preview Java Version is the default version.
| Java Version | Alias | Supported by PMD since |
|--------------|-------|------------------------|
| 22-preview | | 7.0.0 |
| 22 (default) | | 7.0.0 |
| 21-preview | | 7.0.0 |
| 21 (default) | | 7.0.0 |
| 20-preview | | 6.55.0 |
| 21 | | 7.0.0 |
| 20 | | 6.55.0 |
| 19 | | 6.48.0 |
| 18 | | 6.44.0 |
@ -40,10 +41,10 @@ Usually the latest non-preview Java Version is the default version.
## Using Java preview features
In order to analyze a project with PMD that uses preview language features, you'll need to enable
it via the environment variable `PMD_JAVA_OPTS` and select the new language version, e.g. `21-preview`:
it via the environment variable `PMD_JAVA_OPTS` and select the new language version, e.g. `22-preview`:
export PMD_JAVA_OPTS=--enable-preview
pmd check --use-version java-21-preview ...
pmd check --use-version java-22-preview ...
Note: we only support preview language features for the latest two java versions.

View File

@ -2,7 +2,7 @@
title: Language configuration
permalink: pmd_languages_configuration.html
author: Clément Fournier
last_updated: August 2023 (7.0.0)
last_updated: February 2024 (7.0.0)
tags: [languages]
keywords: [pmd, cpd, options, command, auxclasspath, language, properties]
summary: "Summary of language configuration options and properties"
@ -114,13 +114,13 @@ The Java language can be configured with the following properties:
or relative to the Visualforce directory. Default is `../classes`. Specifying an
empty string will disable data type resolution for Apex Controller properties.
Environment variable: `PMD_VF_APEX_DIRECTORIES`
Environment variable: `PMD_VISUALFORCE_APEX_DIRECTORIES`
- `objectsDirectories`: Comma separated list of directories for Custom Objects.
Absolute or relative to the Visualforce directory. Default is `../objects`.
Specifying an empty string will disable data type resolution for Custom Object fields.
Environment variable: `PMD_VF_OBJECTS_DIRECTORIES`
Environment variable: `PMD_VISUALFORCE_OBJECTS_DIRECTORIES`
## CPP language properties

View File

@ -0,0 +1,18 @@
---
title: Velocity Template Language (VTL) support
permalink: pmd_languages_velocity.html
last_updated: February 2024 (7.0.0)
tags: [languages, PmdCapableLanguage, CpdCapableLanguage]
summary: "VTL-specific features and guidance"
---
> [Velocity](https://velocity.apache.org/engine/devel/vtl-reference.html) is a Java-based template engine.
> It permits web page designers to reference methods defined in Java code.
{% include language_info.html name='Velocity Template Language (VTL)' id='velocity' implementation='velocity::lang.velocity.VmLanguageModule' supports_pmd=true supports_cpd=true since='5.1.0' %}
{% capture id_change_note %}
The language id of the Velocity module was in PMD 6 just "vm". In PMD 7, this has been changed to "velocity". Also the
package name of the classes has been changed from vm to "velocity".
{% endcapture %}
{% include note.html content=id_change_note %}

View File

@ -10,7 +10,13 @@ summary: "Visualforce-specific features and guidance"
> [Visualforce](https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/) consists of a tag-based markup
> language that gives developers way to build applications and customize the Salesforce user interface.
{% include language_info.html name='Salesforce Visualforce' id='vf' implementation='visualforce::lang.vf.VfLanguageModule' supports_pmd=true supports_cpd=true since='5.6.0' %}
{% include language_info.html name='Salesforce Visualforce' id='visualforce' implementation='visualforce::lang.visualforce.VfLanguageModule' supports_pmd=true supports_cpd=true since='5.6.0' %}
{% capture vf_id_note %}
The language id of Visualforce was in PMD 6 just "vf". In PMD 7, this has been changed to "visualforce". Also the
package name of the classes has been changed from vf to "visualforce".
{% endcapture %}
{% include note.html content=vf_id_note %}
## Language Properties
@ -22,37 +28,37 @@ Since PMD 6.30.0 support for type resolution has been added.
The Visualforce AST now can resolve the data type of Visualforce expressions that reference
Apex Controller properties and Custom Object fields. This feature improves the precision of existing rules,
like {% rule vf/security/VfUnescapeEl %}.
like {% rule visualforce/security/VfUnescapeEl %}.
This can be configured using two language properties, which can be set as environment variables:
* `PMD_VF_APEX_DIRECTORIES`: Comma separated list of directories for Apex classes. Absolute or relative
* `PMD_VISUALFORCE_APEX_DIRECTORIES`: Comma separated list of directories for Apex classes. Absolute or relative
to the Visualforce directory. Default is `../classes`. Specifying an empty string will disable data type
resolution for Apex Controller properties.
* `PMD_VF_OBJECTS_DIRECTORIES`: Comma separated list of directories for Custom Objects. Absolute or relative
* `PMD_VISUALFORCE_OBJECTS_DIRECTORIES`: Comma separated list of directories for Custom Objects. Absolute or relative
to the Visualforce directory. Default is `../objects`. Specifying an empty string will disable data type
resolution for Custom Object fields.
{% include warning.html content="
These env vars have changed from PMD 6 to PMD 7:
* `PMD_VF_APEXDIRECTORIES` ➡️ `PMD_VF_APEX_DIRECTORIES`
* `PMD_VF_OBJECTSDIRECTORIES` ➡️ `PMD_VF_OBJECTS_DIRECTORIES`
* `PMD_VF_APEXDIRECTORIES` ➡️ `PMD_VISUALFORCE_APEX_DIRECTORIES`
* `PMD_VF_OBJECTSDIRECTORIES` ➡️ `PMD_VISUALFORCE_OBJECTS_DIRECTORIES`
"%}
### Sample usage
```
PMD_VF_APEXDIRECTORIES=../classes \
PMD_VF_OBJECTSDIRECTORIES=../objects \
PMD_VISUALFORCE_APEXDIRECTORIES=../classes \
PMD_VISUALFORCE_OBJECTSDIRECTORIES=../objects \
pmd check -d $GITHUB_WORKSPACE/force-app/main/default/pages \
-R category/vf/security.xml/VfUnescapeEl -f text
-R category/visualforce/security.xml/VfUnescapeEl -f text
```
If you run with debug logging turned on, you might see log messages like this:
```
Okt. 14, 2021 11:30:44 AM net.sourceforge.pmd.lang.vf.VfExpressionTypeVisitor visit
Okt. 14, 2021 11:30:44 AM net.sourceforge.pmd.lang.visualforce.VfExpressionTypeVisitor visit
FINE: Unable to determine type for: Account.NotFoundField__c
```

View File

@ -1,12 +0,0 @@
---
title: Velocity Template Language (VTL) support
permalink: pmd_languages_vm.html
last_updated: September 2023 (7.0.0)
tags: [languages, PmdCapableLanguage, CpdCapableLanguage]
summary: "VTL-specific features and guidance"
---
> [Velocity](https://velocity.apache.org/engine/devel/vtl-reference.html) is a Java-based template engine.
> It permits web page designers to reference methods defined in Java code.
{% include language_info.html name='Velocity Template Language (VTL)' id='vm' implementation='vm::lang.vm.VmLanguageModule' supports_pmd=true supports_cpd=true since='5.1.0' %}

View File

@ -919,127 +919,128 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="https://github.com/lasselindqvist"><img src="https://avatars.githubusercontent.com/u/13466645?v=4?s=100" width="100px;" alt=""/><br /><sub><b>lasselindqvist</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Alasselindqvist" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/lgemeinhardt"><img src="https://avatars.githubusercontent.com/u/1395165?v=4?s=100" width="100px;" alt=""/><br /><sub><b>lgemeinhardt</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Algemeinhardt" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/lihuaib"><img src="https://avatars.githubusercontent.com/u/3365643?v=4?s=100" width="100px;" alt=""/><br /><sub><b>lihuaib</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Alihuaib" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/liqingjun123"><img src="https://avatars.githubusercontent.com/u/12873992?v=4?s=100" width="100px;" alt=""/><br /><sub><b>liqingjun123</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Aliqingjun123" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/lonelyma1021"><img src="https://avatars.githubusercontent.com/u/22359014?v=4?s=100" width="100px;" alt=""/><br /><sub><b>lonelyma1021</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Alonelyma1021" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/lpeddy"><img src="https://avatars.githubusercontent.com/u/48803108?v=4?s=100" width="100px;" alt=""/><br /><sub><b>lpeddy</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Alpeddy" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/lpeddy"><img src="https://avatars.githubusercontent.com/u/48803108?v=4?s=100" width="100px;" alt=""/><br /><sub><b>lpeddy</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Alpeddy" title="Bug reports">🐛</a></td>
<td align="center"><a href="http://lujie.ac.cn/"><img src="https://avatars.githubusercontent.com/u/2918158?v=4?s=100" width="100px;" alt=""/><br /><sub><b>lujiefsi</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=lujiefsi" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/lukelukes"><img src="https://avatars.githubusercontent.com/u/45536418?v=4?s=100" width="100px;" alt=""/><br /><sub><b>lukelukes</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=lukelukes" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/lyriccoder"><img src="https://avatars.githubusercontent.com/u/20803206?v=4?s=100" width="100px;" alt=""/><br /><sub><b>lyriccoder</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Alyriccoder" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/marcelmore"><img src="https://avatars.githubusercontent.com/u/2975481?v=4?s=100" width="100px;" alt=""/><br /><sub><b>marcelmore</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Amarcelmore" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/matchboxy"><img src="https://avatars.githubusercontent.com/u/6457674?v=4?s=100" width="100px;" alt=""/><br /><sub><b>matchbox</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Amatchboxy" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/matthiaskraaz"><img src="https://avatars.githubusercontent.com/u/5954500?v=4?s=100" width="100px;" alt=""/><br /><sub><b>matthiaskraaz</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Amatthiaskraaz" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/mkeller-ergon"><img src="https://avatars.githubusercontent.com/u/23031669?v=4?s=100" width="100px;" alt=""/><br /><sub><b>meandonlyme</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Amkeller-ergon" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/mkeller-ergon"><img src="https://avatars.githubusercontent.com/u/23031669?v=4?s=100" width="100px;" alt=""/><br /><sub><b>meandonlyme</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Amkeller-ergon" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/mikesive"><img src="https://avatars.githubusercontent.com/u/4043189?v=4?s=100" width="100px;" alt=""/><br /><sub><b>mikesive</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Amikesive" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/milossesic"><img src="https://avatars.githubusercontent.com/u/20756244?v=4?s=100" width="100px;" alt=""/><br /><sub><b>milossesic</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Amilossesic" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/mluckam"><img src="https://avatars.githubusercontent.com/u/26581168?v=4?s=100" width="100px;" alt=""/><br /><sub><b>mluckam</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=mluckam" title="Code">💻</a></td>
<td align="center"><a href="https://mohan-chinnappan-n.github.io/about/cv.html"><img src="https://avatars.githubusercontent.com/u/5963194?v=4?s=100" width="100px;" alt=""/><br /><sub><b>mohan-chinnappan-n</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=mohan-chinnappan-n" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/mriddell95"><img src="https://avatars.githubusercontent.com/u/25618660?v=4?s=100" width="100px;" alt=""/><br /><sub><b>mriddell95</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Amriddell95" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/mrlzh"><img src="https://avatars.githubusercontent.com/u/13222791?v=4?s=100" width="100px;" alt=""/><br /><sub><b>mrlzh</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Amrlzh" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/msloan"><img src="https://avatars.githubusercontent.com/u/1783723?v=4?s=100" width="100px;" alt=""/><br /><sub><b>msloan</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Amsloan" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/msloan"><img src="https://avatars.githubusercontent.com/u/1783723?v=4?s=100" width="100px;" alt=""/><br /><sub><b>msloan</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Amsloan" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/mucharlaravalika"><img src="https://avatars.githubusercontent.com/u/32505587?v=4?s=100" width="100px;" alt=""/><br /><sub><b>mucharlaravalika</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Amucharlaravalika" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/mvenneman"><img src="https://avatars.githubusercontent.com/u/1266912?v=4?s=100" width="100px;" alt=""/><br /><sub><b>mvenneman</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Amvenneman" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/nareshl119"><img src="https://avatars.githubusercontent.com/u/39321364?v=4?s=100" width="100px;" alt=""/><br /><sub><b>nareshl119</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Anareshl119" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/nicolas-harraudeau-sonarsource"><img src="https://avatars.githubusercontent.com/u/40498978?v=4?s=100" width="100px;" alt=""/><br /><sub><b>nicolas-harraudeau-sonarsource</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Anicolas-harraudeau-sonarsource" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/noerremark"><img src="https://avatars.githubusercontent.com/u/4252411?v=4?s=100" width="100px;" alt=""/><br /><sub><b>noerremark</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Anoerremark" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/novsirion"><img src="https://avatars.githubusercontent.com/u/7797113?v=4?s=100" width="100px;" alt=""/><br /><sub><b>novsirion</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Anovsirion" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/nwcm"><img src="https://avatars.githubusercontent.com/u/111259588?v=4?s=100" width="100px;" alt=""/><br /><sub><b>nwcm</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=nwcm" title="Documentation">📖</a> <a href="https://github.com/pmd/pmd/issues?q=author%3Anwcm" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/nwcm"><img src="https://avatars.githubusercontent.com/u/111259588?v=4?s=100" width="100px;" alt=""/><br /><sub><b>nwcm</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=nwcm" title="Documentation">📖</a> <a href="https://github.com/pmd/pmd/issues?q=author%3Anwcm" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/oggboy"><img src="https://avatars.githubusercontent.com/u/4798818?v=4?s=100" width="100px;" alt=""/><br /><sub><b>oggboy</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Aoggboy" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://journal.lampetty.net/archive/category/in%20English"><img src="https://avatars.githubusercontent.com/u/78990?v=4?s=100" width="100px;" alt=""/><br /><sub><b>oinume</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Aoinume" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/orimarko"><img src="https://avatars.githubusercontent.com/u/17137249?v=4?s=100" width="100px;" alt=""/><br /><sub><b>orimarko</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=orimarko" title="Code">💻</a> <a href="https://github.com/pmd/pmd/issues?q=author%3Aorimarko" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/pacvz"><img src="https://avatars.githubusercontent.com/u/35453365?v=4?s=100" width="100px;" alt=""/><br /><sub><b>pacvz</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=pacvz" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/pagarwal-ignitetech"><img src="https://avatars.githubusercontent.com/u/30888430?v=4?s=100" width="100px;" alt=""/><br /><sub><b>pallavi agarwal</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Apagarwal-ignitetech" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/parksungrin"><img src="https://avatars.githubusercontent.com/u/29750262?v=4?s=100" width="100px;" alt=""/><br /><sub><b>parksungrin</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Aparksungrin" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/patpatpat123"><img src="https://avatars.githubusercontent.com/u/43899031?v=4?s=100" width="100px;" alt=""/><br /><sub><b>patpatpat123</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Apatpatpat123" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/patpatpat123"><img src="https://avatars.githubusercontent.com/u/43899031?v=4?s=100" width="100px;" alt=""/><br /><sub><b>patpatpat123</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Apatpatpat123" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/patriksevallius"><img src="https://avatars.githubusercontent.com/u/7291479?v=4?s=100" width="100px;" alt=""/><br /><sub><b>patriksevallius</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Apatriksevallius" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/pbrajesh1"><img src="https://avatars.githubusercontent.com/u/32388299?v=4?s=100" width="100px;" alt=""/><br /><sub><b>pbrajesh1</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Apbrajesh1" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/phoenix384"><img src="https://avatars.githubusercontent.com/u/3883662?v=4?s=100" width="100px;" alt=""/><br /><sub><b>phoenix384</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Aphoenix384" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/piotrszymanski-sc"><img src="https://avatars.githubusercontent.com/u/71124942?v=4?s=100" width="100px;" alt=""/><br /><sub><b>piotrszymanski-sc</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=piotrszymanski-sc" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/plan3d"><img src="https://avatars.githubusercontent.com/u/76825073?v=4?s=100" width="100px;" alt=""/><br /><sub><b>plan3d</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Aplan3d" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/poojasix"><img src="https://avatars.githubusercontent.com/u/85337280?v=4?s=100" width="100px;" alt=""/><br /><sub><b>poojasix</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Apoojasix" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/prabhushrikant"><img src="https://avatars.githubusercontent.com/u/6848200?v=4?s=100" width="100px;" alt=""/><br /><sub><b>prabhushrikant</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Aprabhushrikant" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/prabhushrikant"><img src="https://avatars.githubusercontent.com/u/6848200?v=4?s=100" width="100px;" alt=""/><br /><sub><b>prabhushrikant</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Aprabhushrikant" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/pujitha8783"><img src="https://avatars.githubusercontent.com/u/20646357?v=4?s=100" width="100px;" alt=""/><br /><sub><b>pujitha8783</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Apujitha8783" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/r-r-a-j"><img src="https://avatars.githubusercontent.com/u/33902071?v=4?s=100" width="100px;" alt=""/><br /><sub><b>r-r-a-j</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Ar-r-a-j" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/raghujayjunk"><img src="https://avatars.githubusercontent.com/u/48074475?v=4?s=100" width="100px;" alt=""/><br /><sub><b>raghujayjunk</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Araghujayjunk" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/rajeshveera"><img src="https://avatars.githubusercontent.com/u/1306514?v=4?s=100" width="100px;" alt=""/><br /><sub><b>rajeshveera</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Arajeshveera" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/rajeswarreddy88"><img src="https://avatars.githubusercontent.com/u/48543250?v=4?s=100" width="100px;" alt=""/><br /><sub><b>rajeswarreddy88</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Arajeswarreddy88" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/recdevs"><img src="https://avatars.githubusercontent.com/u/63118273?v=4?s=100" width="100px;" alt=""/><br /><sub><b>recdevs</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Arecdevs" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/reudismam"><img src="https://avatars.githubusercontent.com/u/1970407?v=4?s=100" width="100px;" alt=""/><br /><sub><b>reudismam</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=reudismam" title="Code">💻</a> <a href="https://github.com/pmd/pmd/issues?q=author%3Areudismam" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/reudismam"><img src="https://avatars.githubusercontent.com/u/1970407?v=4?s=100" width="100px;" alt=""/><br /><sub><b>reudismam</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=reudismam" title="Code">💻</a> <a href="https://github.com/pmd/pmd/issues?q=author%3Areudismam" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/rijkt"><img src="https://avatars.githubusercontent.com/u/56129985?v=4?s=100" width="100px;" alt=""/><br /><sub><b>rijkt</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Arijkt" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/rillig-tk"><img src="https://avatars.githubusercontent.com/u/46376960?v=4?s=100" width="100px;" alt=""/><br /><sub><b>rillig-tk</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Arillig-tk" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/rmohan20"><img src="https://avatars.githubusercontent.com/u/58573547?v=4?s=100" width="100px;" alt=""/><br /><sub><b>rmohan20</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=rmohan20" title="Code">💻</a> <a href="https://github.com/pmd/pmd/issues?q=author%3Armohan20" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/rnveach"><img src="https://avatars.githubusercontent.com/u/5427943?v=4?s=100" width="100px;" alt=""/><br /><sub><b>rnveach</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Arnveach" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://rxmicro.io/"><img src="https://avatars.githubusercontent.com/u/54791695?v=4?s=100" width="100px;" alt=""/><br /><sub><b>rxmicro</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Arxmicro" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/ryan-gustafson"><img src="https://avatars.githubusercontent.com/u/1227016?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ryan-gustafson</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=ryan-gustafson" title="Code">💻</a> <a href="https://github.com/pmd/pmd/issues?q=author%3Aryan-gustafson" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/sabi0"><img src="https://avatars.githubusercontent.com/u/11509875?v=4?s=100" width="100px;" alt=""/><br /><sub><b>sabi0</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Asabi0" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/sabi0"><img src="https://avatars.githubusercontent.com/u/11509875?v=4?s=100" width="100px;" alt=""/><br /><sub><b>sabi0</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Asabi0" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/scais"><img src="https://avatars.githubusercontent.com/u/4539192?v=4?s=100" width="100px;" alt=""/><br /><sub><b>scais</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Ascais" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/sebbASF"><img src="https://avatars.githubusercontent.com/u/16689231?v=4?s=100" width="100px;" alt=""/><br /><sub><b>sebbASF</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3AsebbASF" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/sergeygorbaty"><img src="https://avatars.githubusercontent.com/u/14813710?v=4?s=100" width="100px;" alt=""/><br /><sub><b>sergeygorbaty</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=sergeygorbaty" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/shilko2013"><img src="https://avatars.githubusercontent.com/u/33313482?v=4?s=100" width="100px;" alt=""/><br /><sub><b>shilko2013</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Ashilko2013" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/shiomiyan"><img src="https://avatars.githubusercontent.com/u/35842766?v=4?s=100" width="100px;" alt=""/><br /><sub><b>shiomiyan</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=shiomiyan" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/simeonKondr"><img src="https://avatars.githubusercontent.com/u/42644177?v=4?s=100" width="100px;" alt=""/><br /><sub><b>simeonKondr</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3AsimeonKondr" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/snajberk"><img src="https://avatars.githubusercontent.com/u/3585281?v=4?s=100" width="100px;" alt=""/><br /><sub><b>snajberk</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Asnajberk" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/snajberk"><img src="https://avatars.githubusercontent.com/u/3585281?v=4?s=100" width="100px;" alt=""/><br /><sub><b>snajberk</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Asnajberk" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/sniperrifle2004"><img src="https://avatars.githubusercontent.com/u/18223222?v=4?s=100" width="100px;" alt=""/><br /><sub><b>sniperrifle2004</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Asniperrifle2004" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/snuyanzin"><img src="https://avatars.githubusercontent.com/u/403174?v=4?s=100" width="100px;" alt=""/><br /><sub><b>snuyanzin</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Asnuyanzin" title="Bug reports">🐛</a> <a href="https://github.com/pmd/pmd/commits?author=snuyanzin" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/soyodream"><img src="https://avatars.githubusercontent.com/u/151845313?v=4?s=100" width="100px;" alt=""/><br /><sub><b>soyodream</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Asoyodream" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/sratz"><img src="https://avatars.githubusercontent.com/u/14908423?v=4?s=100" width="100px;" alt=""/><br /><sub><b>sratz</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Asratz" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/stonio"><img src="https://avatars.githubusercontent.com/u/19952825?v=4?s=100" width="100px;" alt=""/><br /><sub><b>stonio</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Astonio" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/sturton"><img src="https://avatars.githubusercontent.com/u/1734891?v=4?s=100" width="100px;" alt=""/><br /><sub><b>sturton</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=sturton" title="Code">💻</a> <a href="https://github.com/pmd/pmd/issues?q=author%3Asturton" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/sudharmohan"><img src="https://avatars.githubusercontent.com/u/16752281?v=4?s=100" width="100px;" alt=""/><br /><sub><b>sudharmohan</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Asudharmohan" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/sudharmohan"><img src="https://avatars.githubusercontent.com/u/16752281?v=4?s=100" width="100px;" alt=""/><br /><sub><b>sudharmohan</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Asudharmohan" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/suruchidawar"><img src="https://avatars.githubusercontent.com/u/30810931?v=4?s=100" width="100px;" alt=""/><br /><sub><b>suruchidawar</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Asuruchidawar" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/svenfinitiv"><img src="https://avatars.githubusercontent.com/u/5653724?v=4?s=100" width="100px;" alt=""/><br /><sub><b>svenfinitiv</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Asvenfinitiv" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/tashiscool"><img src="https://avatars.githubusercontent.com/u/1057457?v=4?s=100" width="100px;" alt=""/><br /><sub><b>tashiscool</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Atashiscool" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/test-git-hook"><img src="https://avatars.githubusercontent.com/u/49142715?v=4?s=100" width="100px;" alt=""/><br /><sub><b>test-git-hook</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Atest-git-hook" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/testation21"><img src="https://avatars.githubusercontent.com/u/47239708?v=4?s=100" width="100px;" alt=""/><br /><sub><b>testation21</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=testation21" title="Code">💻</a> <a href="https://github.com/pmd/pmd/issues?q=author%3Atestation21" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/thanosa"><img src="https://avatars.githubusercontent.com/u/24596498?v=4?s=100" width="100px;" alt=""/><br /><sub><b>thanosa</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Athanosa" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/tiandiyixian"><img src="https://avatars.githubusercontent.com/u/27055337?v=4?s=100" width="100px;" alt=""/><br /><sub><b>tiandiyixian</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Atiandiyixian" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/tiandiyixian"><img src="https://avatars.githubusercontent.com/u/27055337?v=4?s=100" width="100px;" alt=""/><br /><sub><b>tiandiyixian</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Atiandiyixian" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/tobwoerk"><img src="https://avatars.githubusercontent.com/u/11739442?v=4?s=100" width="100px;" alt=""/><br /><sub><b>tobwoerk</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Atobwoerk" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/tprouvot"><img src="https://avatars.githubusercontent.com/u/35368290?v=4?s=100" width="100px;" alt=""/><br /><sub><b>tprouvot</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Atprouvot" title="Bug reports">🐛</a> <a href="https://github.com/pmd/pmd/commits?author=tprouvot" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/trentchilders"><img src="https://avatars.githubusercontent.com/u/6664350?v=4?s=100" width="100px;" alt=""/><br /><sub><b>trentchilders</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Atrentchilders" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/triandicAnt"><img src="https://avatars.githubusercontent.com/u/2345902?v=4?s=100" width="100px;" alt=""/><br /><sub><b>triandicAnt</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3AtriandicAnt" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/trishul14"><img src="https://avatars.githubusercontent.com/u/24551131?v=4?s=100" width="100px;" alt=""/><br /><sub><b>trishul14</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Atrishul14" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/xmtsui"><img src="https://avatars.githubusercontent.com/u/1542690?v=4?s=100" width="100px;" alt=""/><br /><sub><b>tsui</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Axmtsui" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/winhkey"><img src="https://avatars.githubusercontent.com/u/4877808?v=4?s=100" width="100px;" alt=""/><br /><sub><b>winhkey</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Awinhkey" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/winhkey"><img src="https://avatars.githubusercontent.com/u/4877808?v=4?s=100" width="100px;" alt=""/><br /><sub><b>winhkey</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Awinhkey" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/witherspore"><img src="https://avatars.githubusercontent.com/u/813263?v=4?s=100" width="100px;" alt=""/><br /><sub><b>witherspore</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Awitherspore" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/wjljack"><img src="https://avatars.githubusercontent.com/u/1182478?v=4?s=100" width="100px;" alt=""/><br /><sub><b>wjljack</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Awjljack" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/wuchiuwong"><img src="https://avatars.githubusercontent.com/u/15967553?v=4?s=100" width="100px;" alt=""/><br /><sub><b>wuchiuwong</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Awuchiuwong" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/songxing10000"><img src="https://avatars.githubusercontent.com/u/10040131?v=4?s=100" width="100px;" alt=""/><br /><sub><b>xingsong</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Asongxing10000" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/xioayuge"><img src="https://avatars.githubusercontent.com/u/45328272?v=4?s=100" width="100px;" alt=""/><br /><sub><b>xioayuge</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Axioayuge" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/xnYi9wRezm"><img src="https://avatars.githubusercontent.com/u/61201892?v=4?s=100" width="100px;" alt=""/><br /><sub><b>xnYi9wRezm</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=xnYi9wRezm" title="Code">💻</a> <a href="https://github.com/pmd/pmd/issues?q=author%3AxnYi9wRezm" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/xuanuy"><img src="https://avatars.githubusercontent.com/u/3894777?v=4?s=100" width="100px;" alt=""/><br /><sub><b>xuanuy</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Axuanuy" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/xuanuy"><img src="https://avatars.githubusercontent.com/u/3894777?v=4?s=100" width="100px;" alt=""/><br /><sub><b>xuanuy</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Axuanuy" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/xyf0921"><img src="https://avatars.githubusercontent.com/u/17350974?v=4?s=100" width="100px;" alt=""/><br /><sub><b>xyf0921</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Axyf0921" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/yalechen-cyw3"><img src="https://avatars.githubusercontent.com/u/34886223?v=4?s=100" width="100px;" alt=""/><br /><sub><b>yalechen-cyw3</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Ayalechen-cyw3" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/yasuharu-sato"><img src="https://avatars.githubusercontent.com/u/45546628?v=4?s=100" width="100px;" alt=""/><br /><sub><b>yasuharu-sato</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Ayasuharu-sato" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/zenglian"><img src="https://avatars.githubusercontent.com/u/5268434?v=4?s=100" width="100px;" alt=""/><br /><sub><b>zenglian</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Azenglian" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/zgrzyt93"><img src="https://avatars.githubusercontent.com/u/54275965?v=4?s=100" width="100px;" alt=""/><br /><sub><b>zgrzyt93</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=zgrzyt93" title="Code">💻</a> <a href="https://github.com/pmd/pmd/issues?q=author%3Azgrzyt93" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/zhangxinngang"><img src="https://avatars.githubusercontent.com/u/6891146?v=4?s=100" width="100px;" alt=""/><br /><sub><b>zh3ng</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Azhangxinngang" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/yuchen1013"><img src="https://avatars.githubusercontent.com/u/17316917?v=4?s=100" width="100px;" alt=""/><br /><sub><b>zt_soft</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Ayuchen1013" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/yuchen1013"><img src="https://avatars.githubusercontent.com/u/17316917?v=4?s=100" width="100px;" alt=""/><br /><sub><b>zt_soft</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Ayuchen1013" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/ztt79"><img src="https://avatars.githubusercontent.com/u/48408552?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ztt79</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Aztt79" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/zzzzfeng"><img src="https://avatars.githubusercontent.com/u/8851007?v=4?s=100" width="100px;" alt=""/><br /><sub><b>zzzzfeng</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Azzzzfeng" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/magwas"><img src="https://avatars.githubusercontent.com/u/756838?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Árpád Magosányi</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Amagwas" title="Bug reports">🐛</a></td>

View File

@ -263,8 +263,8 @@ Example:
* [pom](pmd_rules_pom.html) (Maven POM)
* [scala](pmd_rules_scala.html)
* [swift](pmd_rules_swift.html)
* [vf](pmd_rules_vf.html) (Salesforce VisualForce)
* [vm](pmd_rules_vm.html) (Apache Velocity)
* [velocity](pmd_rules_velocity.html) (Apache Velocity Template Language)
* [visualforce](pmd_rules_visualforce.html) (Salesforce VisualForce)
* [xml](pmd_rules_xml.html)
* [xsl](pmd_rules_xsl.html)

View File

@ -4,7 +4,7 @@ short_title: Configuring rules
keywords: [property, properties, message, priority]
tags: [userdocs, getting_started]
summary: "Learn how to configure your rules directly from the ruleset XML."
last_updated: May 2023 (7.0.0)
last_updated: February 2024 (7.0.0)
permalink: pmd_userdocs_configuring_rules.html
author: Hooper Bloob <hooperbloob@users.sourceforge.net>, Romain Pelisse <rpelisse@users.sourceforge.net>, Clément Fournier <clement.fournier76@gmail.com>
---
@ -43,7 +43,10 @@ will cause the rule to be ignored.
## Rule properties
Properties make it easy to customise the behaviour of a rule directly from the xml. They come in several types, which correspond to the type of their values. For example, NPathComplexity declares a property "reportLevel", with an integer value type, and which corresponds to the threshold above which a method will be reported. If you believe that its default value of 200 is too high, you could lower it to e.g. 150 in the following way:
Properties make it easy to customise the behaviour of a rule directly from the xml. They come in several types,
which correspond to the type of their values. For example, NPathComplexity declares a property "reportLevel",
with an integer value type, and which corresponds to the threshold above which a method will be reported.
If you believe that its default value of 200 is too high, you could lower it to e.g. 150 in the following way:
```xml
<rule ref="category/java/design.xml/NPathComplexity">
@ -55,7 +58,9 @@ Properties make it easy to customise the behaviour of a rule directly from the x
</rule>
```
Properties are assigned a value with a `property` element, which should mention the name of a property as an attribute. The value of the property can be specified either in the content of the element, like above, or in the `value` attribute, e.g.
Properties are assigned a value with a `property` element, which should mention the name of a property as an
attribute. The value of the property can be specified either in the content of the element, like above, or
in the `value` attribute, e.g.
```xml
<property name="reportLevel" value="150"/>
@ -63,12 +68,17 @@ Properties are assigned a value with a `property` element, which should mention
All property assignments must be enclosed in a `properties` element, which is itself inside a `rule` element.
{%include tip.html content="The properties of a rule are documented with the rule, e.g. [here](pmd_rules_java_design.html#npathcomplexity) for NPathComplexity. Note that **assigning a value to a property that does not exist throws an error!**" %}
{% capture tip_content %}
The properties of a rule are documented with the rule, e.g. [here](pmd_rules_java_design.html#npathcomplexity)
for NPathComplexity. Note that **assigning a value to a property that does not exist throws an error!**
{% endcapture %}
{%include tip.html content=tip_content %}
Some properties take multiple values (a list), in which case you can provide them all by delimiting them with a delimiter character. It is usually a pipe ('\|'), or a comma (',') for numeric properties, e.g.
Some properties take multiple values (a list), in which case you can provide them all by delimiting them with
a comma (','), e.g.
```xml
<property name="legalCollectionTypes"
value="java.util.ArrayList|java.util.Vector|java.util.HashMap"/>
value="java.util.ArrayList,java.util.Vector,java.util.HashMap"/>
```
These properties are referred to as **multivalued properties** in this documentation.

View File

@ -3,7 +3,7 @@ title: The rule designer
short_title: Rule designer
tags: [extending, userdocs]
summary: "Learn about the usage and features of the rule designer."
last_updated: December 2023 (7.0.0)
last_updated: February 2024 (7.0.0)
permalink: pmd_userdocs_extending_designer_reference.html
author: Clément Fournier <clement.fournier76@gmail.com>
---
@ -25,7 +25,7 @@ If the bin directory of your PMD distribution is on your shell's path, then you
windows="pmd.bat designer" %}
{% include note.html content="pmd-ui.jar is not a runnable jar, because it doesn't include any PMD language module, or PMD Core. " %}
{% include note.html content="pmd-designer.jar is not a runnable jar, because it doesn't include any PMD language module, or PMD Core. " %}
This is to allow easy updating, and let you choose the dependencies you're interested in.
@ -36,7 +36,7 @@ standard PMD startup scripts, which setups the classpath with the available PMD
### Updating
The latest version of the designer currently **works with PMD 7.0.0 and above**. You can simply replace
pmd-ui-7.X.Y.jar with the [latest build](https://github.com/pmd/pmd-designer/releases) in the installation
pmd-designer-7.X.Y.jar with the [latest build](https://github.com/pmd/pmd-designer/releases) in the installation
folder of your PMD distribution, and run it normally. Note that updating may cause some persisted state
to get lost, for example the code snippet.

View File

@ -25,7 +25,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 {% jdoc test::testframework.PmdRuleTst %},
All the test classes inherit from {% jdoc test::test.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
@ -41,7 +41,7 @@ test case and just execute this one.
## Where to place the test code
The {% jdoc test::testframework.PmdRuleTst %} class searches the XML file, that describes the test cases
The {% jdoc test::test.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`.
@ -76,13 +76,13 @@ see [Using the test framework externally](#using-the-test-framework-externally).
### Test Class: AbstractClassWithoutAbstractMethodTest
This class inherits from {% jdoc test::testframework.PmdRuleTst %} and is located in the package "bestpractices",
This class inherits from {% jdoc test::test.PmdRuleTst %} and is located in the package "bestpractices",
since the rule belongs to the category "Best Practices":
``` java
package net.sourceforge.pmd.lang.java.rule.bestpractices;
import net.sourceforge.pmd.testframework.PmdRuleTst;
import net.sourceforge.pmd.test.PmdRuleTst;
class AbstractClassWithoutAbstractMethodTest extends PmdRuleTst {
// no additional unit tests
@ -251,7 +251,7 @@ the rule test manually, as SimpleAggregatorTst will fail to determine it correct
``` java
package com.example.pmd.rules;
import net.sourceforge.pmd.testframework.SimpleAggregatorTst;
import net.sourceforge.pmd.test.SimpleAggregatorTst;
class CustomRuleTest extends SimpleAggregatorTst {
@Override
@ -272,19 +272,19 @@ The test data should be placed in an XML file located in "src/test/resources" un
The framework uses the [dynamic test feature](https://junit.org/junit5/docs/current/user-guide/#writing-tests-dynamic-tests)
of JUnit5 under the hood, among a couple of utility classes:
* {% jdoc test::testframework.PmdRuleTst %}: This is the base class for tests in PMD's code base. It is a subclass of
{% jdoc test::testframework.RuleTst %} and just
* {% jdoc test::test.PmdRuleTst %}: This is the base class for tests in PMD's code base. It is a subclass of
{% jdoc test::test.RuleTst %} and just
contains the logic to determine the test resources based on the test class name.
* {% jdoc test::testframework.SimpleAggregatorTst %}: This is a more generic base class for the test classes.
* {% jdoc test::test.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 {% jdoc test::testframework.RuleTst %}.
It itself is a subclass of {% jdoc test::test.RuleTst %}.
* The maven module "pmd-test-schema" contains the logic to parse the XML files and provides a
{% jdoc test-schema::test.schema.RuleTestCollection %}. This in turn contains a list of
{% jdoc test-schema::test.schema.RuleTestDescriptor %}s. Each rule test descriptor describes a single test case.
* {% jdoc test::testframework.RuleTst %}: uses the {%jdoc test-schema::test.schema.TestSchemaParser %}
* {% jdoc test::test.RuleTst %}: uses the {%jdoc test-schema::test.schema.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.

View File

@ -74,6 +74,8 @@ You might encounter additionally the following types of problems:
see [Release downloads](#release-downloads).
* Some CLI options have been removed, because they have been deprecated. See [CLI Changes](#cli-changes) for details.
* If you call CPD programmatically, the API has changed, see [New Programmatic API for CPD](pmd_release_notes_pmd7.html#new-programmatic-api-for-cpd).
* If you use Visualforce, then you need to change "vf" to "visualforce", e.g. `category/vf/security.xml` ➡️ `category/visualforce/security.xml`
* If you use Velocity, then you need to change "vm" to "velocity", e.g. `category/vm/...` ➡️ `category/velocity/...`
The following topics describe well known migration challenges in more detail.
@ -115,9 +117,13 @@ Once you have reviewed your ruleset(s), you can switch to PMD 7.
### I'm using custom rules
#### Testing
Ideally, you have written good tests already for your custom rules - see [Testing your rules](pmd_userdocs_extending_testing.html).
This helps to identify problems early on.
The base test classes {%jdoc test::test.PmdRuleTst %} and {%jdoc test::test.SimpleAggregatorTst %} have been moved out
of package `net.sourceforge.pmd.testframework`. You'll need to adjust your imports.
#### Ruleset XML
The `<rule>` tag, that defines your custom rule, is required to have a `language` attribute now. This was always the
case for XPath rules, but is now a requirement for Java rules.

View File

@ -212,7 +212,7 @@ accordingly and this rule won't be executed.
The specific version of a language to be used is selected via the `sourceLanguage`
nested element. Example:
<sourceLanguage name="java" version="21"/>
<sourceLanguage name="java" version="22"/>
The available versions depend on the language. You can get a list of the currently supported language versions
via the CLI option `--help`.

View File

@ -73,6 +73,28 @@ As PMD 7 revamped the Java module, if you have custom rules, you need to migrate
See the use case [I'm using custom rules]({{ baseurl }}pmd_userdocs_migrating_to_pmd7.html#im-using-custom-rules)
in the Migration Guide.
##### Java 22 Support
This release of PMD brings support for Java 22. There are the following new standard language features,
that are supported now:
* [JEP 456: Unnamed Variables & Patterns](https://openjdk.org/jeps/456)
PMD also supports the following preview language features:
* [JEP 447: Statements before super(...) (Preview)](https://openjdk.org/jeps/447)
* [JEP 459: String Templates (Second Preview)](https://openjdk.org/jeps/459)
* [JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview)](https://openjdk.org/jeps/463)
In order to analyze a project with PMD that uses these language features,
you'll need to enable it via the environment variable `PMD_JAVA_OPTS` and select the new language
version `22-preview`:
export PMD_JAVA_OPTS=--enable-preview
pmd check --use-version java-22-preview ...
Note: Support for Java 20 preview language features have been removed. The version "20-preview" is no longer available.
##### Swift Support
* limited support for Swift 5.9 (Macro Expansions)
@ -102,7 +124,8 @@ Also having access to the source code, enhancements and modifications are easier
Under the hood, we use two open source libraries instead:
* [apex-parser](https://github.com/nawforce/apex-parser) by [Kevin Jones](https://github.com/nawforce) (@nawforce)
* [apex-parser](https://github.com/apex-dev-tools/apex-parser) originally by
[Kevin Jones](https://github.com/nawforce) (@nawforce).
This project provides the grammar for a ANTLR based parser.
* [Summit-AST](https://github.com/google/summit-ast) by [Google](https://github.com/google) (@google)
This project translates the ANTLR parse tree into an AST, that is similar to the AST Jorje provided.
@ -116,6 +139,17 @@ See [#3766](https://github.com/pmd/pmd/issues/3766) for details.
Contributors: [Aaron Hurst](https://github.com/aaronhurst-google) (@aaronhurst-google),
[Edward Klimoshenko](https://github.com/eklimo) (@eklimo)
##### Changed: Visualforce
There was an inconsistency between the naming of the maven module and the language id. The language id
used the abbreviation "vf", while the maven module used the longer name "visualforce". This has been
solved by renaming the language module to its full name "visualforce". The java packages have
been renamed as well.
If you import rules, you also need to adjust the paths, e.g.
* `category/vf/security.xml` ➡️ `category/visualforce/security.xml`
##### Changed: HTML support
Support for HTML was introduced in PMD 6.55.0 as an experimental feature. With PMD 7.0.0 this
@ -125,6 +159,15 @@ is now considered stable.
Experimental Kotlin support has been promoted as stable API now.
##### Changed: Velocity Template Language (VTL)
The module was named just "vm" which was not a good name. It module and language id and
package names have been renamed to "velocity".
If you import rules, you also need to ajdust the paths, e.g.
* `category/vm/...` ➡️ `category/velocity/...`
#### Rule Changes
**New Rules**
@ -138,6 +181,20 @@ Experimental Kotlin support has been promoted as stable API now.
* {% rule java/codestyle/EmptyControlStatement %}: The rule has a new property to allow empty blocks when
they contain a comment (`allowCommentedBlocks`).
* {% rule apex/codestyle/MethodNamingConventions %}: The deprecated rule property `skipTestMethodUnderscores` has
been removed. It was actually deprecated since PMD 6.15.0, but was not mentioned in the release notes
back then. Use the property `testPattern` instead to configure valid names for test methods.
* {% rule java/documentation/CommentRequired %}: The deprecated property `headerCommentRequirement` has been removed.
Use the property `classCommentRequirement` instead.
* {% rule java/errorprone/NonSerializableClass %}: The deprecated property `prefix` has been removed
without replacement. In a serializable class all fields have to be serializable regardless of the name.
**Renamed Rulesets**
* `category/vf/security.xml` ➡️ `category/visualforce/security.xml`
* `category/vm/bestpractices.xml` ➡️ `category/velocity/bestpractices.xml`
* `category/vm/design.xml` ➡️ `category/velocity/design.xml`
* `category/vm/errorprone.xml` ➡️ `category/velocity/errorprone.xml`
**Removed Rules**
@ -255,6 +312,7 @@ The rules have been moved into categories with PMD 6.
* [#4659](https://github.com/pmd/pmd/pull/4659): \[doc] Improve ant documentation
* [#4669](https://github.com/pmd/pmd/pull/4669): \[doc] Add bld PMD Extension to Tools / Integrations
* [#4676](https://github.com/pmd/pmd/issues/4676): \[doc] Clarify how CPD `--ignore-literals` and `--ignore-identifiers` work
* [#4704](https://github.com/pmd/pmd/issues/4704): \[doc] Multivalued properties do not accept | as a separator
* miscellaneous
* [#4699](https://github.com/pmd/pmd/pull/4699): Make PMD buildable with java 21
* [#4586](https://github.com/pmd/pmd/pull/4586): Use explicit encoding in ruleset xml files
@ -264,8 +322,13 @@ The rules have been moved into categories with PMD 6.
* [#4749](https://github.com/pmd/pmd/pull/4749): Fixes NoSuchMethodError on processing errors in pmd-compat6
* [#4776](https://github.com/pmd/pmd/issues/4776): \[ci] Upgrade to ruby 3
* [#4796](https://github.com/pmd/pmd/pull/4796): Remove deprecated and release rulesets
* [#4823](https://github.com/pmd/pmd/pull/4823): Update to use renamed pmd-designer
* [#4827](https://github.com/pmd/pmd/pull/4827): \[compat6] Support config errors and cpd for csharp
* [#4830](https://github.com/pmd/pmd/issues/4830): Consolidate packages in each maven module
* apex
* [#3766](https://github.com/pmd/pmd/issues/3766): \[apex] Replace Jorje with fully open source front-end
* apex-documentation
* [#4774](https://github.com/pmd/pmd/issues/4774): \[apex] ApexDoc false-positive for the first method of an annotated Apex class
* apex-performance
* [#4675](https://github.com/pmd/pmd/issues/4675): \[apex] New Rule: OperationWithHighCostInLoop
* groovy
@ -275,6 +338,7 @@ The rules have been moved into categories with PMD 6.
* [#3751](https://github.com/pmd/pmd/issues/3751): \[java] Rename some node types
* [#4628](https://github.com/pmd/pmd/pull/4628): \[java] Support loading classes from java runtime images
* [#4753](https://github.com/pmd/pmd/issues/4753): \[java] PMD crashes while using generics and wildcards
* [#4794](https://github.com/pmd/pmd/issues/4794): \[java] Support JDK 22
* java-bestpractices
* [#4603](https://github.com/pmd/pmd/issues/4603): \[java] UnusedAssignment false positive in record compact constructor
* [#4625](https://github.com/pmd/pmd/issues/4625): \[java] UnusedPrivateMethod false positive: Autoboxing into Number
@ -290,6 +354,7 @@ The rules have been moved into categories with PMD 6.
* [#174](https://github.com/pmd/pmd/issues/174): \[java] SingularField false positive with switch in method that both assigns and reads field
* java-errorprone
* [#718](https://github.com/pmd/pmd/issues/718): \[java] BrokenNullCheck false positive with parameter/field confusion
* [#932](https://github.com/pmd/pmd/issues/932): \[java] SingletonClassReturningNewInstance false positive with double assignment
* [#1831](https://github.com/pmd/pmd/issues/1831): \[java] DetachedTestCase reports abstract methods
* [#4719](https://github.com/pmd/pmd/pull/4719): \[java] UnnecessaryCaseChange: example doc toUpperCase() should compare to a capitalized string
* javascript
@ -303,6 +368,17 @@ The rules have been moved into categories with PMD 6.
#### API Changes
**pmd-java**
* Support for Java 20 preview language features have been removed. The version "20-preview" is no longer available.
* {%jdoc java::lang.java.ast.ASTPattern %}, {%jdoc java::lang.java.ast.ASTRecordPattern %},
{%jdoc java::lang.java.ast.ASTTypePattern %}, {%jdoc java::lang.java.ast.ASTUnnamedPattern %}
- method `getParenthesisDepth()` has been removed.
* {%jdoc java::lang.java.ast.ASTTemplateFragment %}: To get the content of the template, use now
{%jdoc java::lang.java.ast.ASTTemplateFragment#getContent() %} or `@Content` instead of `getImage()`/`@Image`.
* {%jdoc java::lang.java.ast.ASTUnnamedPattern %} is not experimental anymore. The language feature
has been standardized with Java 22.
**New API**
The API around {%jdoc core::util.treeexport.TreeRenderer %} has been declared as stable. It was previously
@ -336,6 +412,42 @@ in the migration guide for details.
* {%jdoc core::reporting.RuleViolation %}
* {%jdoc core::reporting.ViolationSuppressor %}
* {%jdoc core::lang.rule.xpath.XPathRule %} has been moved into subpackage {% jdoc_package core::lang.rule.xpath %}.
* pmd-html
* `net.sourceforge.pmd.lang.html.ast.HtmlCpdLexer` moved into package `cpd`: {%jdoc html::lang.html.cpd.HtmlCpdLexer %}.
* pmd-lang-test: All types have been moved under the new base package {%jdoc_package lang-test::lang.test %}:
* {%jdoc lang-test::lang.test.AbstractMetricTestRule %} (moved from `net.sourceforge.pmd.test.AbstractMetricTestRule`)
* {%jdoc lang-test::lang.test.BaseTextComparisonTest %} (moved from `net.sourceforge.pmd.test.BaseTextComparisonTest`)
* {%jdoc lang-test::lang.test.cpd.CpdTextComparisonTest %} (moved from `net.sourceforge.pmd.cpd.test.CpdTextComparisonTest`)
* {%jdoc lang-test::lang.test.ast.BaseTreeDumpTest %} (moved from `net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest`)
* Any many other types have been moved from `net.sourceforge.pmd.lang.ast.test` to `net.sourceforge.pmd.lang.test`.
* pmd-scala
* {%jdoc scala::lang.scala.cpd.ScalaCpdLexer %} (moved from `net.sourceforge.pmd.lang.scala.cpd.ScalaCpdLexer`)
* {%jdoc scala::lang.scala.cpd.ScalaTokenAdapter %} (moved from `net.sourceforge.pmd.lang.scala.cpd.ScalaTokenAdapter`)
* pmd-test
* {%jdoc test::test.lang.rule.AbstractRuleSetFactoryTest %} (moved from `net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest`)
* {%jdoc test::test.AbstractAntTestHelper %} (moved from `net.sourceforge.pmd.ant.AbstractAntTestHelper`)
* {%jdoc test::test.AbstractLanguageVersionTest %} (moved from `net.sourceforge.pmd.AbstractLanguageVersionTest`)
* {%jdoc test::test.PmdRuleTst %} (moved from `net.sourceforge.pmd.testframework.PmdRuleTst`)
* {%jdoc test::test.RuleTst %} (moved from `net.sourceforge.pmd.testframework.RuleTst`)
* {%jdoc test::test.SimpleAggregatorTst %} (moved from `net.sourceforge.pmd.testframework.SimpleAggregatorTst`)
* pmd-xml
* {%jdoc xml::lang.xml.pom.PomLanguageModule %} (moved from `net.sourceforge.pmd.lang.pom.PomLanguageModule`)
* {%jdoc xml::lang.xml.wsdl.WsdlLanguageModule %} (moved from `net.sourceforge.pmd.lang.wsdl.WsdlLanguageModule`)
* {%jdoc xml::lang.xml.xsl.XslLanguageModule %} (moved from `net.sourceforge.pmd.lang.xsl.XslLanguageModule`)
* pmd-visualforce
* The package `net.sourceforge.pmd.lang.vf` has been renamed to {%jdoc_package visualforce::lang.visualforce %}.
* The language id of visualforce has been changed to `visualforce` (it was previously just "vf")
* The ruleset changed: `category/vf/security.xml` ➡️ `category/visualforce/security.xml`
* pmd-velocity (renamed from pmd-vm)
* The package `net.sourceforge.pmd.lang.vm` has been renamed to {%jdoc_package velocity::lang.velocity %}.
* The language id of the Velocity module has been changed to `velocity` (it was previously just "vm")
* The rulesets changed: `category/vm/...` ➡️ `category/velocity/...`
* Many classes used the prefix `Vm`, e.g. `VmLanguageModule`. This has been changed to be `Vtl`:
* {%jdoc velocity::lang.velocity.VtlLanguageModule %}
* {%jdoc velocity::lang.velocity.ast.VtlNode %}
* {%jdoc velocity::lang.velocity.ast.VtlParser %}
* {%jdoc velocity::lang.velocity.cpd.VtlCpdLexer %}
* {%jdoc velocity::lang.velocity.rule.AbstractVtlRule %}
**Internalized classes and interfaces and methods**
@ -397,6 +509,10 @@ package or made (package) private and are _not accessible_ anymore.
* Method `replacementIfDeprecated()` is now package private.
* `net.sourceforge.pmd.properties.PropertyTypeId` - moved in subpackage `internal`.
* {%jdoc !!core::properties.PropertyDescriptor %} - method `getTypeId()` is now package private.
* pmd-doc
* The whole maven module `pmd-doc` is now considered internal API even though it was not declared so before.
It's used to generate the rule documentation for the built-in rules.
* All the classes have been moved into package `net.sourceforge.pmd.doc.internal`.
* pmd-ant
* {%jdoc !!ant::ant.Formatter %}
* Method `getRenderer()` has been removed.
@ -662,6 +778,7 @@ The annotation `@DeprecatedUntil700` has been removed.
* {%jdoc !!plsql::lang.plsql.ast.PLSQLNode %} - method `jjtAccept()` has been removed.
Use {%jdoc core::lang.ast.Node#acceptVisitor(core::lang.ast.AstVisitor,P) %} instead.
* pmd-scala
* The maven module `pmd-scala` has been removed. Use `pmd-scala_2.13` or `pmd-scala_2.12` instead.
* {%jdoc !!scala::lang.scala.ast.ScalaNode %}
* Method `accept()` has been removed. Use {%jdoc core::lang.ast.Node#acceptVisitor(core::lang.ast.AstVisitor,P) %} instead.
* Method `getNode()` has been removed. The underlying node is only available in AST nodes, but not in rule implementations.
@ -676,10 +793,10 @@ The annotation `@DeprecatedUntil700` has been removed.
* {%jdoc !!visualforce::lang.vf.DataType %} - method `fromBasicType(BasicType)` has been removed.
Use {%jdoc visualforce::lang.vf.DataType#fromTypeName(java.lang.String) %} instead.
* pmd-vm
* {%jdoc !!vm::lang.vm.ast.VmNode %} - method `jjtAccept()` has been removed.
* {%jdoc !!velocity::lang.vm.ast.VmNode %} - method `jjtAccept()` has been removed.
Use {%jdoc core::lang.ast.Node#acceptVisitor(core::lang.ast.AstVisitor,P) %} instead.
* `net.sourceforge.pmd.lang.vm.ast.VmParserVisitor`
Use {%jdoc vm::lang.vm.ast.VmVisitor %} or {%jdoc vm::lang.vm.ast.VmVisitorBase %} instead.
Use {%jdoc velocity::lang.vm.ast.VmVisitor %} or {%jdoc velocity::lang.vm.ast.VmVisitorBase %} instead.
* `net.sourceforge.pmd.lang.vm.ast.VmParserVisitorAdapter`
**Removed classes, interfaces and methods (not previously deprecated)**
@ -1076,7 +1193,7 @@ Contributors: [Aaron Hurst](https://github.com/aaronhurst-google) (@aaronhurst-g
{% rule plsql/design/ExcessiveParameterList %}, {% rule plsql/design/ExcessiveTypeLength %},
{% rule plsql/design/NcssMethodCount %}, {% rule plsql/design/NcssObjectCount %},
{% rule plsql/design/NPathComplexity %}
* VM: {% rule vm/design/ExcessiveTemplateLength %}
* Velocity: {% rule velocity/design/ExcessiveTemplateLength %}
* The general property `violationSuppressXPath` which is available for all rules to
[suppress warnings]({{ baseurl }}pmd_userdocs_suppressing_warnings.html) now uses XPath version 3.1 by default.
@ -1089,6 +1206,12 @@ Contributors: [Aaron Hurst](https://github.com/aaronhurst-google) (@aaronhurst-g
from all rules. These properties have been deprecated since PMD 6.13.0.
See [issue #1648](https://github.com/pmd/pmd/issues/1648) for more details.
**Apex Codestyle**
* {% rule apex/codestyle/MethodNamingConventions %}: The deprecated rule property `skipTestMethodUnderscores` has
been removed. It was actually deprecated since PMD 6.15.0, but was not mentioned in the release notes
back then. Use the property `testPattern` instead to configure valid names for test methods.
**Java General changes**
* Violations reported on methods or classes previously reported the line range of the entire method
@ -1159,6 +1282,8 @@ Contributors: [Aaron Hurst](https://github.com/aaronhurst-google) (@aaronhurst-g
See also [pull request #3757](https://github.com/pmd/pmd/pull/3757).
* Elements in annotation types are now detected as well. This might lead to an increased number of violations
for missing public method comments.
* The deprecated property `headerCommentRequirement` has been removed. Use the property `classCommentRequirement`
instead.
* {% rule java/documentation/CommentSize %}: When determining the line-length of a comment, the leading comment
prefix markers (e.g. `*` or `//`) are ignored and don't add up to the line-length.
See also [pull request #4369](https://github.com/pmd/pmd/pull/4369).
@ -1172,6 +1297,8 @@ Contributors: [Aaron Hurst](https://github.com/aaronhurst-google) (@aaronhurst-g
special-cased anymore. Rename the exception parameter to `ignored` to ignore them.
* {% rule java/errorprone/ImplicitSwitchFallThrough %}: Violations are now reported on the case statements
rather than on the switch statements. This is more accurate but might result in more violations now.
* {% rule java/errorprone/NonSerializableClass %}: The deprecated property `prefix` has been removed
without replacement. In a serializable class all fields have to be serializable regardless of the name.
#### Removed Rules
@ -1226,6 +1353,9 @@ See also [Detailed Release Notes for PMD 7]({{ baseurl }}pmd_release_notes_pmd7.
* [#4749](https://github.com/pmd/pmd/pull/4749): Fixes NoSuchMethodError on processing errors in pmd-compat6
* [#4776](https://github.com/pmd/pmd/issues/4776): \[ci] Upgrade to ruby 3
* [#4796](https://github.com/pmd/pmd/pull/4796): Remove deprecated and release rulesets
* [#4823](https://github.com/pmd/pmd/pull/4823): Update to use renamed pmd-designer
* [#4827](https://github.com/pmd/pmd/pull/4827): \[compat6] Support config errors and cpd for csharp
* [#4830](https://github.com/pmd/pmd/issues/4830): Consolidate packages in each maven module
* ant
* [#4080](https://github.com/pmd/pmd/issues/4080): \[ant] Split off Ant integration into a new submodule
* core
@ -1311,6 +1441,7 @@ See also [Detailed Release Notes for PMD 7]({{ baseurl }}pmd_release_notes_pmd7.
* [#4676](https://github.com/pmd/pmd/issues/4676): \[doc] Clarify how CPD `--ignore-literals` and `--ignore-identifiers` work
* [#4659](https://github.com/pmd/pmd/pull/4659): \[doc] Improve ant documentation
* [#4669](https://github.com/pmd/pmd/pull/4669): \[doc] Add bld PMD Extension to Tools / Integrations
* [#4704](https://github.com/pmd/pmd/issues/4704): \[doc] Multivalued properties do not accept | as a separator
* testing
* [#2435](https://github.com/pmd/pmd/issues/2435): \[test] Remove duplicated Dummy language module
* [#4234](https://github.com/pmd/pmd/issues/4234): \[test] Tests that change the logging level do not work
@ -1330,6 +1461,8 @@ Language specific fixes:
* [#2667](https://github.com/pmd/pmd/issues/2667): \[apex] Integrate nawforce/ApexLink to build robust Unused rule
* [#4509](https://github.com/pmd/pmd/issues/4509): \[apex] ExcessivePublicCount doesn't consider inner classes correctly
* [#4596](https://github.com/pmd/pmd/issues/4596): \[apex] ExcessivePublicCount ignores properties
* apex-documentation
* [#4774](https://github.com/pmd/pmd/issues/4774): \[apex] ApexDoc false-positive for the first method of an annotated Apex class
* apex-performance
* [#4675](https://github.com/pmd/pmd/issues/4675): \[apex] New Rule: OperationWithHighCostInLoop
* apex-security
@ -1369,6 +1502,7 @@ Language specific fixes:
* [#4583](https://github.com/pmd/pmd/issues/4583): \[java] Support JDK 21 (LTS)
* [#4628](https://github.com/pmd/pmd/pull/4628): \[java] Support loading classes from java runtime images
* [#4753](https://github.com/pmd/pmd/issues/4753): \[java] PMD crashes while using generics and wildcards
* [#4794](https://github.com/pmd/pmd/issues/4794): \[java] Support JDK 22
* java-bestpractices
* [#342](https://github.com/pmd/pmd/issues/342): \[java] AccessorMethodGeneration: Name clash with another public field not properly handled
* [#755](https://github.com/pmd/pmd/issues/755): \[java] AccessorClassGeneration false positive for private constructors
@ -1474,6 +1608,7 @@ Language specific fixes:
* java-errorprone
* [#659](https://github.com/pmd/pmd/issues/659): \[java] MissingBreakInSwitch - last default case does not contain a break
* [#718](https://github.com/pmd/pmd/issues/718): \[java] BrokenNullCheck false positive with parameter/field confusion
* [#932](https://github.com/pmd/pmd/issues/932): \[java] SingletonClassReturningNewInstance false positive with double assignment
* [#1005](https://github.com/pmd/pmd/issues/1005): \[java] CloneMethodMustImplementCloneable triggers for interfaces
* [#1669](https://github.com/pmd/pmd/issues/1669): \[java] NullAssignment - FP with ternay and null as constructor argument
* [#1831](https://github.com/pmd/pmd/issues/1831): \[java] DetachedTestCase reports abstract methods

View File

@ -214,6 +214,28 @@ module `pmd-coco`.
Contributors: [Wener](https://github.com/wener-tiobe) (@wener-tiobe)
### Java 22 Support
This release of PMD brings support for Java 22. There are the following new standard language features,
that are supported now:
* [JEP 456: Unnamed Variables & Patterns](https://openjdk.org/jeps/456)
PMD also supports the following preview language features:
* [JEP 447: Statements before super(...) (Preview)](https://openjdk.org/jeps/447)
* [JEP 459: String Templates (Second Preview)](https://openjdk.org/jeps/459)
* [JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview)](https://openjdk.org/jeps/463)
In order to analyze a project with PMD that uses these language features,
you'll need to enable it via the environment variable `PMD_JAVA_OPTS` and select the new language
version `22-preview`:
export PMD_JAVA_OPTS=--enable-preview
pmd check --use-version java-22-preview ...
Note: Support for Java 20 preview language features have been removed. The version "20-preview" is no longer available.
### New: Java 21 Support
This release of PMD brings support for Java 21. There are the following new standard language features,
@ -330,7 +352,7 @@ can be parsed now. PMD should now be able to parse Apex code up to version 59.0
{% rule plsql/design/ExcessiveParameterList %}, {% rule plsql/design/ExcessiveTypeLength %},
{% rule plsql/design/NcssMethodCount %}, {% rule plsql/design/NcssObjectCount %},
{% rule plsql/design/NPathComplexity %}
* VM: {% rule vm/design/ExcessiveTemplateLength %}
* Velocity: {% rule velocity/design/ExcessiveTemplateLength %}
* The general property `violationSuppressXPath` which is available for all rules to
[suppress warnings](pmd_userdocs_suppressing_warnings.html) now uses XPath version 3.1 by default.
@ -343,6 +365,12 @@ can be parsed now. PMD should now be able to parse Apex code up to version 59.0
from all rules. These properties have been deprecated since PMD 6.13.0.
See [issue #1648](https://github.com/pmd/pmd/issues/1648) for more details.
**Apex Codestyle**
* {% rule apex/codestyle/MethodNamingConventions %}: The deprecated rule property `skipTestMethodUnderscores` has
been removed. It was actually deprecated since PMD 6.15.0, but was not mentioned in the release notes
back then. Use the property `testPattern` instead to configure valid names for test methods.
**Java General changes**
* Violations reported on methods or classes previously reported the line range of the entire method
@ -384,6 +412,8 @@ can be parsed now. PMD should now be able to parse Apex code up to version 59.0
not necessary are allowed, if they separate expressions of different precedence.
The other property `ignoreBalancing` (default: true) is similar, in that it allows parentheses that help
reading and understanding the expressions.
* {% rule java/codestyle/EmptyControlStatement %}: The rule has a new property to allow empty blocks when
they contain a comment (`allowCommentedBlocks`).
**Java Design**
@ -411,6 +441,8 @@ can be parsed now. PMD should now be able to parse Apex code up to version 59.0
See also [pull request #3757](https://github.com/pmd/pmd/pull/3757).
* Elements in annotation types are now detected as well. This might lead to an increased number of violations
for missing public method comments.
* The deprecated property `headerCommentRequirement` has been removed. Use the property `classCommentRequirement`
instead.
* {% rule java/documentation/CommentSize %}: When determining the line-length of a comment, the leading comment
prefix markers (e.g. `*` or `//`) are ignored and don't add up to the line-length.
See also [pull request #4369](https://github.com/pmd/pmd/pull/4369).
@ -424,6 +456,8 @@ can be parsed now. PMD should now be able to parse Apex code up to version 59.0
special-cased anymore. Rename the exception parameter to `ignored` to ignore them.
* {% rule java/errorprone/ImplicitSwitchFallThrough %}: Violations are now reported on the case statements
rather than on the switch statements. This is more accurate but might result in more violations now.
* {% rule java/errorprone/NonSerializableClass %}: The deprecated property `prefix` has been removed
without replacement. In a serializable class all fields have to be serializable regardless of the name.
### Deprecated Rules
@ -1705,7 +1739,7 @@ These deprecations have already been rolled out in a previous version for the
following languages:
* Java: {% jdoc_package java::lang.java.ast %}
* Java Server Pages: {% jdoc_package jsp::lang.jsp.ast %}
* Velocity Template Language: {% jdoc_package vm::lang.vm.ast %}
* Velocity Template Language: {% jdoc_package velocity::lang.vm.ast %}
Outside of these packages, these changes also concern the following TokenManager
implementations, and their corresponding Parser if it exists (in the same package):
@ -1720,7 +1754,7 @@ implementations, and their corresponding Parser if it exists (in the same packag
* {% jdoc plsql::lang.plsql.PLSQLTokenManager %}
* {% jdoc python::lang.python.PythonTokenManager %}
* {% jdoc visualforce::lang.vf.VfTokenManager %}
* {% jdoc vm::lang.vm.VmTokenManager %}
* {% jdoc velocity::lang.vm.VmTokenManager %}
In the **Java AST** the following attributes are deprecated and will issue a warning when used in XPath rules:
@ -1855,19 +1889,19 @@ The following usages are now deprecated **in the VM AST** (with other languages
Those constructors will be made package private with 7.0.0.
* **Subclassing of abstract node classes, or usage of their type**. The base classes are internal API
and will be hidden in version 7.0.0. You should not couple your code to them.
* In the meantime you should use interfaces like {% jdoc vm::lang.vm.ast.VmNode %} or
* In the meantime you should use interfaces like {% jdoc velocity::lang.vm.ast.VmNode %} or
{% jdoc core::lang.ast.Node %}, or the other published interfaces in this package,
to refer to nodes generically.
* Concrete node classes will **be made final** with 7.0.0.
* Setters found in any node class or interface. **Rules should consider the AST immutable**.
We will make those setters package private with 7.0.0.
* The package {% jdoc_package vm::lang.vm.directive %} as well as the classes
{% jdoc vm::lang.vm.util.DirectiveMapper %} and {% jdoc vm::lang.vm.util.LogUtil %} are deprecated
* The package {% jdoc_package velocity::lang.vm.directive %} as well as the classes
{% jdoc velocity::lang.vm.util.DirectiveMapper %} and {% jdoc velocity::lang.vm.util.LogUtil %} are deprecated
for removal. They were only used internally during parsing.
* The class {% jdoc vm::lang.vm.VmParser %} is deprecated and should not be used directly.
* The class {% jdoc velocity::lang.vm.VmParser %} is deprecated and should not be used directly.
Use {% jdoc !!core::lang.LanguageVersionHandler#getParser(ParserOptions) %} instead.
Please look at {% jdoc_package vm::lang.vm.ast %} to find out the full list of deprecations.
Please look at {% jdoc_package velocity::lang.vm.ast %} to find out the full list of deprecations.
**PLSQL AST**
@ -2077,7 +2111,7 @@ of deprecations.
* {% jdoc !q!jsp::lang.jsp.ast.DumpFacade %}
* {% jdoc !q!plsql::lang.plsql.ast.DumpFacade %}
* {% jdoc !q!visualforce::lang.vf.ast.DumpFacade %}
* {% jdoc !q!vm::lang.vm.ast.AbstractVmNode#dump(String, boolean, Writer) %}
* {% jdoc !q!velocity::lang.vm.ast.AbstractVmNode#dump(String, boolean, Writer) %}
* {% jdoc !q!xml::lang.xml.ast.DumpFacade %}
* The method {% jdoc !c!core::lang.LanguageVersionHandler#getDumpFacade(Writer, String, boolean) %} will be
removed as well. It is deprecated, along with all its implementations in the subclasses of {% jdoc core::lang.LanguageVersionHandler %}.

View File

@ -17,7 +17,7 @@
whose name is an acronym, eg PLSQL (in camelcase, "Plsql").
Defaults to lang-name.
- lang-terse-name: Terse name, used in the conventional package names
- lang-id: The language id, used in the conventional package names
It also uses the following maven properties:
@ -34,12 +34,12 @@
</not>
</condition>
<property name="target-package-dir" value="${javacc.outputDirectory}/net/sourceforge/pmd/lang/${lang-terse-name}/ast" />
<property name="target-package-dir" value="${javacc.outputDirectory}/net/sourceforge/pmd/lang/${lang-id}/ast" />
<property name="stamp-file" value="${project.build.directory}/last-generated-timestamp" />
<property name="javacc-home.path" value="${project.build.directory}/lib/javacc" />
<property name="lang-ast-package" value="net.sourceforge.pmd.lang.${lang-terse-name}.ast" />
<property name="lang-ast-package" value="net.sourceforge.pmd.lang.${lang-id}.ast" />
<property name="ast-api-package" value="net.sourceforge.pmd.lang.ast" />
<property name="ast-impl-package" value="${ast-api-package}.impl.javacc" />

View File

@ -15,6 +15,24 @@
<name>PMD Ant Integration</name>
<description>Apache Ant integration for PMD.</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<!-- overrides the configuration from parent pom: we only have pmd-core yet -->
<offlineLinks combine.self="override">
<offlineLink>
<location>${project.basedir}/../pmd-core/target/apidocs</location>
<url>../../pmd-core/${project.version}</url>
</offlineLink>
</offlineLinks>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>net.sourceforge.pmd</groupId>

View File

@ -11,6 +11,7 @@ import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
@ -196,8 +197,21 @@ public class Formatter {
private static String getConsoleEncoding() {
Console console = System.console();
// in case of pipe or redirect, no interactive console.
// in case of pipe or redirect, no interactive console, we get null
if (console != null) {
// Since Java 22, this returns a console even for redirected streams.
// In that case, we need to check Console.isTerminal()
// See: JLine As The Default Console Provider (JDK-8308591)
try {
Boolean isTerminal = (Boolean) MethodUtils.invokeMethod(console, "isTerminal");
if (!isTerminal) {
// stop here, we don't have an interactive console.
return null;
}
} catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException ignored) {
// fall-through - we use a Java Runtime < 22.
}
try {
Object res = FieldUtils.readDeclaredField(console, "cs", true);
if (res instanceof Charset) {

View File

@ -76,10 +76,9 @@ import com.google.summit.ast.statement.WhileLoopStatement
import kotlin.reflect.KClass
@Suppress("DEPRECATION")
class ApexTreeBuilder(val task: ParserTask, val proc: ApexLanguageProcessor) {
private val sourceCode = task.getTextDocument()
private val commentBuilder = ApexCommentBuilder(sourceCode, proc.getProperties().getSuppressMarker())
class ApexTreeBuilder(private val task: ParserTask, private val proc: ApexLanguageProcessor) {
private val sourceCode = task.textDocument
private val commentBuilder = ApexCommentBuilder(sourceCode, proc.properties.suppressMarker)
/** Builds and returns an [ASTApexFile] corresponding to the given [CompilationUnit]. */
fun buildTree(compilationUnit: CompilationUnit): ASTApexFile {
@ -87,7 +86,7 @@ class ApexTreeBuilder(val task: ParserTask, val proc: ApexLanguageProcessor) {
val baseClass =
build(compilationUnit, parent = null) as? BaseApexClass<*>
?: throw ParseException("Unable to build tree")
val result = ASTApexFile(task, compilationUnit, commentBuilder.getSuppressMap(), proc)
val result = ASTApexFile(task, compilationUnit, commentBuilder.suppressMap, proc)
baseClass.setParent(result)
// Post-processing passes
@ -759,8 +758,8 @@ class ApexTreeBuilder(val task: ParserTask, val proc: ApexLanguageProcessor) {
}
}
for(i in 0..node.getNumChildren()-1) {
node.setChild(children.get(i) as AbstractApexNode, i)
for(i in 0 until node.getNumChildren()) {
node.setChild(children[i] as AbstractApexNode, i)
}
}
@ -794,12 +793,10 @@ class ApexTreeBuilder(val task: ParserTask, val proc: ApexLanguageProcessor) {
}
/**
* If [parent] is not null, adds this [ApexNode] as a [child][ApexNode.jjtAddChild] and sets
* [parent] as the [parent][ApexNode.jjtSetParent].
* If [parent] is not null, adds this [ApexNode] as a [child][AbstractApexNode.addChild] and sets
* [parent] as the [parent][AbstractApexNode.setParent].
*/
private fun AbstractApexNode.setParent(parent: AbstractApexNode?) {
if (parent != null) {
parent.addChild(this, parent.numChildren)
}
parent?.addChild(this, parent.numChildren)
}
}

View File

@ -4,8 +4,6 @@
package net.sourceforge.pmd.lang.apex.rule.codestyle;
import static net.sourceforge.pmd.properties.PropertyFactory.booleanProperty;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;
@ -30,14 +28,7 @@ public class MethodNamingConventionsRule extends AbstractNamingConventionsRule {
private static final PropertyDescriptor<Pattern> INSTANCE_REGEX = prop("instancePattern", "instance method",
DESCRIPTOR_TO_DISPLAY_NAME).defaultValue(CAMEL_CASE).build();
private static final PropertyDescriptor<Boolean> SKIP_TEST_METHOD_UNDERSCORES_DESCRIPTOR
= booleanProperty("skipTestMethodUnderscores")
.desc("deprecated! Skip underscores in test methods")
.defaultValue(false)
.build();
public MethodNamingConventionsRule() {
definePropertyDescriptor(SKIP_TEST_METHOD_UNDERSCORES_DESCRIPTOR);
definePropertyDescriptor(TEST_REGEX);
definePropertyDescriptor(STATIC_REGEX);
definePropertyDescriptor(INSTANCE_REGEX);
@ -65,11 +56,7 @@ public class MethodNamingConventionsRule extends AbstractNamingConventionsRule {
}
if (node.getModifiers().isTest()) {
if (getProperty(SKIP_TEST_METHOD_UNDERSCORES_DESCRIPTOR)) {
checkMatches(TEST_REGEX, CAMEL_CASE_WITH_UNDERSCORES, node, data);
} else {
checkMatches(TEST_REGEX, node, data);
}
} else if (node.getModifiers().isStatic()) {
checkMatches(STATIC_REGEX, node, data);
} else {

View File

@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.apex;
import java.util.Arrays;
import java.util.Collection;
import net.sourceforge.pmd.AbstractLanguageVersionTest;
import net.sourceforge.pmd.test.AbstractLanguageVersionTest;
class LanguageVersionTest extends AbstractLanguageVersionTest {

View File

@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest;
import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest;
import net.sourceforge.pmd.lang.rule.RuleSet;
import net.sourceforge.pmd.lang.rule.RuleSetLoader;

View File

@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.apex;
import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest;
import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest;
class RuleSetFactoryTest extends AbstractRuleSetFactoryTest {
// no additional tests yet

Some files were not shown because too many files have changed in this diff Show More