Update documentation
https://github.com/pmd/pmd/actions/runs/8009070512
9e71e36ab1...f9d9ac63a4
This commit is contained in:
4
feed.xml
4
feed.xml
@ -5,8 +5,8 @@
|
||||
<description>Intended as a documentation theme based on Jekyll for technical writers documenting software and other technical products, this theme has all the elements you would need to handle multiple products with both multi-level sidebar navigation, tags, and other documentation features.</description>
|
||||
<link>https://docs.pmd-code.org/latest/</link>
|
||||
<atom:link href="https://docs.pmd-code.org/latest/feed.xml" rel="self" type="application/rss+xml"/>
|
||||
<pubDate>Thu, 22 Feb 2024 17:33:51 +0000</pubDate>
|
||||
<lastBuildDate>Thu, 22 Feb 2024 17:33:51 +0000</lastBuildDate>
|
||||
<pubDate>Thu, 22 Feb 2024 18:31:58 +0000</pubDate>
|
||||
<lastBuildDate>Thu, 22 Feb 2024 18:31:58 +0000</lastBuildDate>
|
||||
<generator>Jekyll v3.9.5</generator>
|
||||
|
||||
</channel>
|
||||
|
@ -1956,6 +1956,35 @@ For the changes, see</p>
|
||||
<li><a href="https://github.com/pmd/pmd-designer/releases/tag/7.0.0">PMD Designer Changelog (7.0.0)</a>.</li>
|
||||
</ul>
|
||||
|
||||
<h5 id="apex-support-replaced-jorje-with-fully-open-source-front-end">Apex Support: Replaced Jorje with fully open source front-end</h5>
|
||||
|
||||
<p>When PMD added Apex support with version 5.5.0, it utilized the Apex Jorje library to parse Apex source
|
||||
and generate an AST. This library is however a binary-blob provided as part of the
|
||||
<a href="https://github.com/forcedotcom/salesforcedx-vscode">Salesforce Extensions for VS Code</a>, and it is closed-source.</p>
|
||||
|
||||
<p>This causes problems, if binary blobs are not allowed by e.g. a company-wide policy. In that case, the Jorje
|
||||
library prevented that PMD Apex could be used at all.</p>
|
||||
|
||||
<p>Also having access to the source code, enhancements and modifications are easier to do.</p>
|
||||
|
||||
<p>Under the hood, we use two open source libraries instead:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="https://github.com/nawforce/apex-parser">apex-parser</a> by <a href="https://github.com/nawforce">Kevin Jones</a> (@nawforce)
|
||||
This project provides the grammar for a ANTLR based parser.</li>
|
||||
<li><a href="https://github.com/google/summit-ast">Summit-AST</a> by <a href="https://github.com/google">Google</a> (@google)
|
||||
This project translates the ANTLR parse tree into an AST, that is similar to the AST Jorje provided.
|
||||
Note: This is not an official Google product.</li>
|
||||
</ul>
|
||||
|
||||
<p>Although the parsers is completely switched, there are only little known changes to the AST.
|
||||
These are documented in the <a href="pmd_userdocs_migrating_to_pmd7.html#apex-ast">Migration Guide for PMD 7: Apex AST</a>.</p>
|
||||
|
||||
<p>See <a href="https://github.com/pmd/pmd/issues/3766">#3766</a> for details.</p>
|
||||
|
||||
<p>Contributors: <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google),
|
||||
<a href="https://github.com/eklimo">Edward Klimoshenko</a> (@eklimo)</p>
|
||||
|
||||
<h5 id="changed-html-support">Changed: HTML support</h5>
|
||||
|
||||
<p>Support for HTML was introduced in PMD 6.55.0 as an experimental feature. With PMD 7.0.0 this
|
||||
@ -2131,6 +2160,11 @@ The rules have been moved into categories with PMD 6.</p>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4796">#4796</a>: Remove deprecated and release rulesets</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>apex
|
||||
<ul>
|
||||
<li><a href="https://github.com/pmd/pmd/issues/3766">#3766</a>: [apex] Replace Jorje with fully open source front-end</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>apex-performance
|
||||
<ul>
|
||||
<li><a href="https://github.com/pmd/pmd/issues/4675">#4675</a>: [apex] New Rule: OperationWithHighCostInLoop</li>
|
||||
@ -2777,6 +2811,28 @@ Use <a href="https://docs.pmd-code.org/apidocs/pmd-vm/7.0.0-SNAPSHOT/net/sourcef
|
||||
<p><strong>Removed classes, interfaces and methods (not previously deprecated)</strong></p>
|
||||
|
||||
<ul>
|
||||
<li>pmd-apex
|
||||
<ul>
|
||||
<li>The method <code class="language-plaintext highlighter-rouge">isSynthetic()</code> in <a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ASTMethod.html#"><code>ASTMethod</code></a> has been removed.
|
||||
With the switch from Jorje to Summit AST as underlying parser, no synthetic methods are generated by the
|
||||
parser anymore. This also means, that there is no XPath attribute <code class="language-plaintext highlighter-rouge">@Synthetic</code> anymore.</li>
|
||||
<li>The constant <code class="language-plaintext highlighter-rouge">STATIC_INITIALIZER_METHOD_NAME</code> in <a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/rule/codestyle/FieldDeclarationsShouldBeAtStartRule.html#"><code>FieldDeclarationsShouldBeAtStartRule</code></a>
|
||||
has been removed. It was used to filter out synthetic methods, but these are not generated anymore with the
|
||||
new parser.</li>
|
||||
<li>The method <code class="language-plaintext highlighter-rouge">getContext()</code> in <a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ASTReferenceExpression.html#"><code>ASTReferenceExpression</code></a> has been removed.
|
||||
It was not used and always returned <code class="language-plaintext highlighter-rouge">null</code>.</li>
|
||||
<li>The method <code class="language-plaintext highlighter-rouge">getNamespace()</code> in all AST nodes (defined in <a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ApexNode.html#"><code>ApexNode</code></a>) has
|
||||
been removed, as it was never fully implemented. It always returned an empty string.</li>
|
||||
<li>The method <code class="language-plaintext highlighter-rouge">getNameSpace()</code> in <a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ApexQualifiedName.html#"><code>ApexQualifiedName</code></a> has been removed.</li>
|
||||
<li>The class <code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.lang.apex.ast.ASTBridgeMethodCreator</code> has been removed. This was a node that has
|
||||
been generated by the old Jorje parser only.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>pmd-apex-jorje
|
||||
<ul>
|
||||
<li>With the switch from Jorje to Summit AST, this maven module is no longer needed and has been removed.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>pmd-core
|
||||
<ul>
|
||||
<li><code class="language-plaintext highlighter-rouge">net.sourceforge.pmd.util.Predicate</code> has been removed. It was marked as Experimental before. Use
|
||||
@ -2939,6 +2995,15 @@ has been removed as well. If you don’t want colors, use <code class="language-
|
||||
|
||||
<h4 id="external-contributions">External Contributions</h4>
|
||||
<ul>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4093">#4093</a>: [apex] Summit-AST Apex module - Part 1 - <a href="https://github.com/eklimo">Edward Klimoshenko</a> (@eklimo)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4151">#4151</a>: [apex] Summit-AST Apex module - Part 2 - expression nodes - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4171">#4171</a>: [apex] Summit-AST Apex module - Part 3 - initializers - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4206">#4206</a>: [apex] Summit-AST Apex module - Part 4 - statements - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4219">#4219</a>: [apex] Summit-AST Apex module - Part 5 - annotations, triggers, misc. - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4242">#4242</a>: [apex] Merge 6.52 into experimental-apex-parser - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4251">#4251</a>: [apex] Summit-AST Apex module - Part 6 Passing testsuite - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4448">#4448</a>: [apex] Bump summit-ast to new release 2.1.0 (and remove workaround) - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4479">#4479</a>: [apex] Merge main (7.x) branch into experimental-apex-parser and fix tests - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4640">#4640</a>: [cli] Launch script fails if run via “bash pmd” - <a href="https://github.com/shai-bennathan">Shai Bennathan</a> (@shai-bennathan)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4673">#4673</a>: [javascript] CPD: Added support for decorator notation - <a href="https://github.com/wener-tiobe">Wener</a> (@wener-tiobe)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4677">#4677</a>: [apex] Add new rule: OperationWithHighCostInLoop - <a href="https://github.com/tprouvot">Thomas Prouvot</a> (@tprouvot)</li>
|
||||
@ -3132,11 +3197,6 @@ literals were ignored. The new option additional ignores identifiers as well in
|
||||
<li>See <a href="https://github.com/pmd/pmd/pull/4470">PR #4470</a> for details.</li>
|
||||
</ul>
|
||||
|
||||
<h4 id="changed-apex-jorje-updated">Changed: Apex Jorje Updated</h4>
|
||||
|
||||
<p>With the new version of Apex Jorje, the new language constructs like User Mode Database Operations
|
||||
can be parsed now. PMD should now be able to parse Apex code up to version 59.0 (Winter ‘23).</p>
|
||||
|
||||
<h4 id="changed-groovy-support-cpd">Changed: Groovy Support (CPD)</h4>
|
||||
|
||||
<ul>
|
||||
@ -3145,6 +3205,35 @@ can be parsed now. PMD should now be able to parse Apex code up to version 59.0
|
||||
<li>See <a href="https://github.com/pmd/pmd/pull/4726">PR #4726</a> for details.</li>
|
||||
</ul>
|
||||
|
||||
<h4 id="changed-apex-support-replaced-jorje-with-fully-open-source-front-end">Changed: Apex Support: Replaced Jorje with fully open source front-end</h4>
|
||||
|
||||
<p>When PMD added Apex support with version 5.5.0, it utilized the Apex Jorje library to parse Apex source
|
||||
and generate an AST. This library is however a binary-blob provided as part of the
|
||||
<a href="https://github.com/forcedotcom/salesforcedx-vscode">Salesforce Extensions for VS Code</a>, and it is closed-source.</p>
|
||||
|
||||
<p>This causes problems, if binary blobs are not allowed by e.g. a company-wide policy. In that case, the Jorje
|
||||
library prevented that PMD Apex could be used at all.</p>
|
||||
|
||||
<p>Also having access to the source code, enhancements and modifications are easier to do.</p>
|
||||
|
||||
<p>Under the hood, we use two open source libraries instead:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="https://github.com/nawforce/apex-parser">apex-parser</a> by <a href="https://github.com/nawforce">Kevin Jones</a> (@nawforce)
|
||||
This project provides the grammar for a ANTLR based parser.</li>
|
||||
<li><a href="https://github.com/google/summit-ast">Summit-AST</a> by <a href="https://github.com/google">Google</a> (@google)
|
||||
This project translates the ANTLR parse tree into an AST, that is similar to the AST Jorje provided.
|
||||
Note: This is not an official Google product.</li>
|
||||
</ul>
|
||||
|
||||
<p>Although the parsers is completely switched, there are only little known changes to the AST.
|
||||
These are documented in the <a href="pmd_userdocs_migrating_to_pmd7.html#apex-ast">Migration Guide for PMD 7: Apex AST</a>.</p>
|
||||
|
||||
<p>See <a href="https://github.com/pmd/pmd/issues/3766">#3766</a> for details.</p>
|
||||
|
||||
<p>Contributors: <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google),
|
||||
<a href="https://github.com/eklimo">Edward Klimoshenko</a> (@eklimo)</p>
|
||||
|
||||
<h4 id="changed-rule-properties">Changed: Rule properties</h4>
|
||||
|
||||
<ul>
|
||||
@ -3504,6 +3593,7 @@ of the changes listed here, see <a href="pmd_release_notes_pmd7.html">Detailed R
|
||||
<li><a href="https://github.com/pmd/pmd/issues/1648">#1648</a>: [apex,vf] Remove CodeClimate dependency</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/1750">#1750</a>: [apex] Remove apex statistical rules</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/2836">#2836</a>: [apex] Remove Apex ProjectMirror</li>
|
||||
<li><a href="https://github.com/pmd/pmd/issues/3766">#3766</a>: [apex] Replace Jorje with fully open source front-end</li>
|
||||
<li><a href="https://github.com/pmd/pmd/issues/3973">#3973</a>: [apex] Update parser to support new ‘as user’ keywords (User Mode for Database Operations)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/issues/4427">#4427</a>: [apex] ApexBadCrypto test failing to detect inline code</li>
|
||||
<li><a href="https://github.com/pmd/pmd/issues/4453">#4453</a>: [apex] [7.0-rc1] Exception while initializing Apexlink (Index 34812 out of bounds for length 34812)</li>
|
||||
@ -3775,6 +3865,13 @@ of the changes listed here, see <a href="pmd_release_notes_pmd7.html">Detailed R
|
||||
<li><a href="https://github.com/pmd/pmd/pull/1882">#1882</a>: [swift] UnavailableFunction Swift rule - <a href="https://github.com/tomidelucca">Tomás de Lucca</a> (@tomidelucca)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/2830">#2830</a>: [apex] Apexlink POC - <a href="https://github.com/nawforce">Kevin Jones</a> (@nawforce)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/3866">#3866</a>: [core] Add CLI Progress Bar - <a href="https://github.com/JerritEic">@JerritEic</a> (@JerritEic)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4093">#4093</a>: [apex] Summit-AST Apex module - Part 1 - <a href="https://github.com/eklimo">Edward Klimoshenko</a> (@eklimo)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4151">#4151</a>: [apex] Summit-AST Apex module - Part 2 - expression nodes - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4171">#4171</a>: [apex] Summit-AST Apex module - Part 3 - initializers - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4206">#4206</a>: [apex] Summit-AST Apex module - Part 4 - statements - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4219">#4219</a>: [apex] Summit-AST Apex module - Part 5 - annotations, triggers, misc. - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4242">#4242</a>: [apex] Merge 6.52 into experimental-apex-parser - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4251">#4251</a>: [apex] Summit-AST Apex module - Part 6 Passing testsuite - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4402">#4402</a>: [javascript] CPD: add support for Typescript using antlr4 grammar - <a href="https://github.com/pguyot">Paul Guyot</a> (@pguyot)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4403">#4403</a>: [julia] CPD: Add support for Julia code duplication - <a href="https://github.com/wener-tiobe">Wener</a> (@wener-tiobe)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4412">#4412</a>: [doc] Added new error msg to ConstantsInInterface - <a href="https://github.com/dague1">David Ljunggren</a> (@dague1)</li>
|
||||
@ -3782,10 +3879,12 @@ of the changes listed here, see <a href="pmd_release_notes_pmd7.html">Detailed R
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4428">#4428</a>: [apex] ApexBadCrypto bug fix for #4427 - inline detection of hard coded values - <a href="https://github.com/sfdcsteve">Steven Stearns</a> (@sfdcsteve)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4431">#4431</a>: [coco] CPD: Coco support for code duplication detection - <a href="https://github.com/wener-tiobe">Wener</a> (@wener-tiobe)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4444">#4444</a>: [java] CommentDefaultAccessModifier - ignore org.junit.jupiter.api.extension.RegisterExtension by default - <a href="https://github.com/nirvikpatel">Nirvik Patel</a> (@nirvikpatel)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4448">#4448</a>: [apex] Bump summit-ast to new release 2.1.0 (and remove workaround) - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4450">#4450</a>: [java] Fix #4449 AvoidAccessibilityAlteration: Correctly handle Lambda expressions in PrivilegedAction scenarios - <a href="https://github.com/mohui1999">Seren</a> (@mohui1999)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4452">#4452</a>: [doc] Update PMD_APEX_ROOT_DIRECTORY documentation reference - <a href="https://github.com/nwcm">nwcm</a> (@nwcm)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4470">#4470</a>: [cpp] CPD: Added strings as literal and ignore identifiers in sequences - <a href="https://github.com/wener-tiobe">Wener</a> (@wener-tiobe)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4474">#4474</a>: [java] ImmutableField: False positive with lombok (fixes #4254) - <a href="https://github.com/PimvanderLoos">Pim van der Loos</a> (@PimvanderLoos)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4479">#4479</a>: [apex] Merge main (7.x) branch into experimental-apex-parser and fix tests - <a href="https://github.com/aaronhurst-google">Aaron Hurst</a> (@aaronhurst-google)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4488">#4488</a>: [java] Fix #4477: A false-positive about SignatureDeclareThrowsException - <a href="https://github.com/LynnBroe">AnnaDev</a> (@LynnBroe)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4494">#4494</a>: [java] Fix #4487: A false-positive about UnnecessaryConstructor and @<!-- -->Inject and @<!-- -->Autowired - <a href="https://github.com/LynnBroe">AnnaDev</a> (@LynnBroe)</li>
|
||||
<li><a href="https://github.com/pmd/pmd/pull/4495">#4495</a>: [java] Fix #4493: false-positive about MissingStaticMethodInNonInstantiatableClass and @<!-- -->Inject - <a href="https://github.com/LynnBroe">AnnaDev</a> (@LynnBroe)</li>
|
||||
|
@ -2102,8 +2102,17 @@ or reported.</p>
|
||||
<p>Empty block statements serve no purpose and should be removed.</p>
|
||||
|
||||
<p><strong>This rule is defined by the following XPath expression:</strong></p>
|
||||
<div class="language-xpath highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">//</span><span class="nt">Method</span><span class="p">[</span><span class="nv">$reportEmptyPrivateNoArgConstructor</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="nf">true</span><span class="p">()</span><span class="w"> </span><span class="ow">or</span><span class="w"> </span><span class="p">(</span><span class="na">@Constructor</span><span class="w"> </span><span class="p">!</span><span class="err">=</span><span class="w"> </span><span class="nf">true</span><span class="p">()</span><span class="w"> </span><span class="ow">or</span><span class="w"> </span><span class="p">.</span><span class="o">/</span><span class="nt">ModifierNode</span><span class="p">[</span><span class="na">@Private</span><span class="w"> </span><span class="p">!</span><span class="err">=</span><span class="w"> </span><span class="nf">true</span><span class="p">()]</span><span class="w"> </span><span class="ow">or</span><span class="w"> </span><span class="p">.</span><span class="o">/</span><span class="nt">Parameter</span><span class="p">[</span><span class="nf">count</span><span class="p">(</span><span class="err">*</span><span class="p">)</span><span class="w"> </span><span class="o">></span><span class="w"> </span><span class="m">0</span><span class="p">])]</span><span class="o">/</span><span class="nt">ModifierNode</span><span class="p">[</span><span class="na">@Abstract</span><span class="w"> </span><span class="p">!</span><span class="err">=</span><span class="w"> </span><span class="nf">true</span><span class="p">()</span><span class="w"> </span><span class="ow">and</span><span class="w"> </span><span class="p">(</span><span class="nv">$reportEmptyVirtualMethod</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="nf">true</span><span class="p">()</span><span class="w"> </span><span class="ow">or</span><span class="w"> </span><span class="na">@Virtual</span><span class="w"> </span><span class="p">!</span><span class="err">=</span><span class="w"> </span><span class="nf">true</span><span class="p">())</span><span class="w"> </span><span class="ow">and</span><span class="w"> </span><span class="p">..</span><span class="o">/</span><span class="nt">BlockStatement</span><span class="p">[</span><span class="nf">count</span><span class="p">(</span><span class="err">*</span><span class="p">)</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="m">0</span><span class="p">]]</span><span class="w">
|
||||
</span><span class="p">|</span><span class="w"> </span><span class="o">//</span><span class="nt">Method</span><span class="o">/</span><span class="nt">BlockStatement</span><span class="o">//</span><span class="nt">BlockStatement</span><span class="p">[</span><span class="nf">count</span><span class="p">(</span><span class="err">*</span><span class="p">)</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="m">0</span><span class="w"> </span><span class="ow">and</span><span class="w"> </span><span class="na">@RealLoc</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="nf">true</span><span class="p">()]</span><span class="w">
|
||||
<div class="language-xpath highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">//</span><span class="nt">Method</span><span class="p">[</span><span class="nv">$reportEmptyPrivateNoArgConstructor</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="nf">true</span><span class="p">()</span><span class="w">
|
||||
</span><span class="ow">or</span><span class="w"> </span><span class="p">(</span><span class="na">@Constructor</span><span class="w"> </span><span class="p">!</span><span class="err">=</span><span class="w"> </span><span class="nf">true</span><span class="p">()</span><span class="w">
|
||||
</span><span class="ow">or</span><span class="w"> </span><span class="p">.</span><span class="o">/</span><span class="nt">ModifierNode</span><span class="p">[</span><span class="na">@Private</span><span class="w"> </span><span class="p">!</span><span class="err">=</span><span class="w"> </span><span class="nf">true</span><span class="p">()]</span><span class="w">
|
||||
</span><span class="ow">or</span><span class="w"> </span><span class="p">.</span><span class="o">/</span><span class="nt">Parameter</span><span class="p">[</span><span class="nf">count</span><span class="p">(</span><span class="err">*</span><span class="p">)</span><span class="w"> </span><span class="o">></span><span class="w"> </span><span class="m">0</span><span class="p">])]</span><span class="o">/</span><span class="nt">ModifierNode</span><span class="p">[</span><span class="na">@Abstract</span><span class="w"> </span><span class="p">!</span><span class="err">=</span><span class="w"> </span><span class="nf">true</span><span class="p">()</span><span class="w">
|
||||
</span><span class="ow">and</span><span class="w"> </span><span class="p">(</span><span class="nv">$reportEmptyVirtualMethod</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="nf">true</span><span class="p">()</span><span class="w"> </span><span class="ow">or</span><span class="w"> </span><span class="na">@Virtual</span><span class="w"> </span><span class="p">!</span><span class="err">=</span><span class="w"> </span><span class="nf">true</span><span class="p">())</span><span class="w">
|
||||
</span><span class="ow">and</span><span class="w"> </span><span class="p">..</span><span class="o">/</span><span class="nt">BlockStatement</span><span class="p">[</span><span class="nf">count</span><span class="p">(</span><span class="err">*</span><span class="p">)</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="m">0</span><span class="p">]</span><span class="w">
|
||||
</span><span class="p">]</span><span class="w">
|
||||
</span><span class="p">|</span><span class="w"> </span><span class="o">//</span><span class="nt">Method</span><span class="o">/</span><span class="nt">BlockStatement</span><span class="o">//</span><span class="nt">BlockStatement</span><span class="w">
|
||||
</span><span class="p">[</span><span class="ow">not</span><span class="p">(</span><span class="kn">parent::</span><span class="nt">CatchBlockStatement</span><span class="p">)]</span><span class="w">
|
||||
</span><span class="p">[</span><span class="nf">count</span><span class="p">(</span><span class="err">*</span><span class="p">)</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="m">0</span><span class="p">]</span><span class="w">
|
||||
</span><span class="p">[</span><span class="na">@RealLoc</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="nf">true</span><span class="p">()]</span><span class="w">
|
||||
</span></code></pre></div></div>
|
||||
|
||||
<p><strong>Example(s):</strong></p>
|
||||
|
@ -5328,6 +5328,32 @@ parenthesis, which makes it harder to fool rules that look at the structure of t
|
||||
|
||||
</details>
|
||||
|
||||
<h3 id="apex-ast">Apex AST</h3>
|
||||
|
||||
<p>PMD 7.0.0 switched the underlying parser for Apex code from Jorje to <a href="https://github.com/google/summit-ast">Summit AST</a>,
|
||||
which is based on an open source grammar for Apex: <a href="https://github.com/nawforce/apex-parser">apex-parser</a>.</p>
|
||||
|
||||
<p>The produced AST is mostly compatible, there are some unavoidable changes however:</p>
|
||||
|
||||
<ul>
|
||||
<li>Node <code class="language-plaintext highlighter-rouge">Method</code> (<a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ASTMethod.html#"><code>ASTMethod</code></a>)
|
||||
<ul>
|
||||
<li>No attribute <code class="language-plaintext highlighter-rouge">@Synthetic</code> anymore. Unlike Jorje, Summit AST doesn’t generate synthetic methods anymore, so
|
||||
this attribute would have been always false and is of no use. Therefore it has been removed completely.</li>
|
||||
<li>There will be no methods anymore with the name <code class="language-plaintext highlighter-rouge"><clinit></code>, <code class="language-plaintext highlighter-rouge"><init></code>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>There is no node <code class="language-plaintext highlighter-rouge">BridgeMethodCreator</code> anymore. This was an artificially generated node by Jorje. Since the
|
||||
new parser doesn’t generate synthetic methods anymore, this node is not needed anymore.</li>
|
||||
<li>There is in general no attribute <code class="language-plaintext highlighter-rouge">@Namespace</code> anymore. The attribute has been removed, as it was never fully
|
||||
implemented. It always returned an empty string.</li>
|
||||
<li>Node <code class="language-plaintext highlighter-rouge">ReferenceExpression</code> (<a href="https://docs.pmd-code.org/apidocs/pmd-apex/7.0.0-SNAPSHOT/net/sourceforge/pmd/lang/apex/ast/ASTReferenceExpression.html#"><code>ASTReferenceExpression</code></a>)
|
||||
<ul>
|
||||
<li>No attribute <code class="language-plaintext highlighter-rouge">@Context</code> anymore. It was not used and always returned <code class="language-plaintext highlighter-rouge">null</code>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="language-versions">Language versions</h3>
|
||||
|
||||
<ul>
|
||||
|
Reference in New Issue
Block a user