<!-- this highlights the active parent class in the navgoco sidebar. this is critical so that the parent expands when you're viewing a page. This must appear below the sidebar code above. Otherwise, if placed inside customscripts.js, the script runs before the sidebar code runs and the class never gets inserted.-->
<!-- this handles the automatic toc. use ## for subheads to auto-generate the on-page minitoc. if you use html tags, you must supply an ID for the heading element in order for it to appear in the minitoc. -->
<li>The new Apex rule <ahref="pmd_rules_apex_performance.html#eagerlyloadeddescribesobjectresult"><codeclass="language-plaintext highlighter-rouge">EagerlyLoadedDescribeSObjectResult</code></a> finds
<codeclass="language-plaintext highlighter-rouge">DescribeSObjectResult</code>s which could have been loaded eagerly via <codeclass="language-plaintext highlighter-rouge">SObjectType.getDescribe()</code>.</li>
<p>The Apex rule <ahref="pmd_rules_apex_bestpractices.html#apexunittestclassshouldhaveasserts"><codeclass="language-plaintext highlighter-rouge">ApexUnitTestClassShouldHaveAsserts</code></a> has a new property
<codeclass="language-plaintext highlighter-rouge">additionalAssertMethodPattern</code>. When specified the pattern is evaluated against each invoked
method name to determine whether it represents a test assertion in addition to the standard names.</p>
</li>
<li>
<p>The Apex rule <ahref="pmd_rules_apex_documentation.html#apexdoc"><codeclass="language-plaintext highlighter-rouge">ApexDoc</code></a> has a new property <codeclass="language-plaintext highlighter-rouge">reportMissingDescription</code>.
If set to <codeclass="language-plaintext highlighter-rouge">false</code> (default is <codeclass="language-plaintext highlighter-rouge">true</code> if unspecified) doesn’t report an issue if the <codeclass="language-plaintext highlighter-rouge">@description</code>
tag is missing. This is consistent with the ApexDoc dialect supported by derivatives such as
<ahref="https://gitlab.com/StevenWCox/sfapexdoc">SfApexDoc</a> and also with analogous documentation tools for
other languages, e.g., JavaDoc, ESDoc/JSDoc, etc.</p>
</li>
<li>
<p>The Apex rule <ahref="pmd_rules_apex_security.html#apexcrudviolation"><codeclass="language-plaintext highlighter-rouge">ApexCRUDViolation</code></a> has a couple of new properties:
These allow specification of regular-expression-based patterns for additional methods that should
be considered valid for pre-CRUD authorization beyond those offered by the system Apex checks and
Two new properties have been added per-CRUD operation, one to specify the naming pattern for a method
that authorizes that operation and another to specify the argument passed to that method that contains
the <codeclass="language-plaintext highlighter-rouge">SObjectType</code> instance of the type being authorized. Here is an example of these new properties:</p>
<p>The Apex rule <ahref="pmd_rules_apex_errorprone.html#emptystatementblock"><codeclass="language-plaintext highlighter-rouge">EmptyStatementBlock</code></a> has two new properties:</p>
that are commonly used in singleton pattern implementations and utility classes in support of
prescribed best practices.</p>
<p>Setting <codeclass="language-plaintext highlighter-rouge">reportEmptyVirtualMethod</code> to <codeclass="language-plaintext highlighter-rouge">false</code> ignores empty virtual methods that are commonly used in
abstract base classes as default no-op implementations when derived classes typically only override a
subset of virtual methods.</p>
<p>By default, both properties are <codeclass="language-plaintext highlighter-rouge">true</code> to not change the default behaviour of this rule.</p>
<p>The Apex rule <ahref="pmd_rules_apex_errorprone.html#emptycatchblock"><codeclass="language-plaintext highlighter-rouge">EmptyCatchBlock</code></a> has two new properties modeled after the analgous Java rule:</p>
<p>The <codeclass="language-plaintext highlighter-rouge">allowCommentedBlocks</code> property, when set to <codeclass="language-plaintext highlighter-rouge">true</code> (defaults to <codeclass="language-plaintext highlighter-rouge">false</code>), ignores empty blocks containing comments, e.g.:</p>
<spanclass="n">System</span><spanclass="o">.</span><spanclass="nf">assert</span><spanclass="p">(</span><spanclass="kc">false</span><spanclass="p">,</span><spanclass="s1">'</span><spanclass="s2">Expected to catch an exception.'</span><spanclass="p">);</span>
<p>The <codeclass="language-plaintext highlighter-rouge">allowExceptionNameRegex</code> property is a regular expression for exception variable names for which empty catch blocks should be ignored by this rule. For example, using the default property value of <codeclass="language-plaintext highlighter-rouge">^(ignored|expected)$</code>, the following empty catch blocks will not be reported:</p>
<spanclass="n">System</span><spanclass="o">.</span><spanclass="nf">assert</span><spanclass="p">(</span><spanclass="kc">false</span><spanclass="p">,</span><spanclass="s1">'</span><spanclass="s2">Expected to catch an exception.'</span><spanclass="p">);</span>
<p>The Apex rule <ahref="pmd_rules_apex_codestyle.html#onedeclarationperline"><codeclass="language-plaintext highlighter-rouge">OneDeclarationPerLine</code></a> has a new property <codeclass="language-plaintext highlighter-rouge">reportInForLoopInitializer</code>:
If set to <codeclass="language-plaintext highlighter-rouge">false</code> (default is <codeclass="language-plaintext highlighter-rouge">true</code> if unspecified) doesn’t report an issue for multiple declarations in
a <codeclass="language-plaintext highlighter-rouge">for</code> loop’s initializer section. This is support the common idiom of one declaration for the loop variable
and another for the loop bounds condition, e.g.,</p>
<li><ahref="https://github.com/pmd/pmd/issues/1089">#1089</a>: [apex] ApexUnitTestClassShouldHaveAsserts: Test asserts in other methods not detected</li>
<li><ahref="https://github.com/pmd/pmd/issues/1090">#1090</a>: [apex] ApexCRUDViolation: checks not detected if done in another method</li>
<li><ahref="https://github.com/pmd/pmd/issues/3566">#3566</a>: [apex] ApexDoc rule should not require “@description”</li>
<li><ahref="https://github.com/pmd/pmd/issues/3568">#3568</a>: [apex] EmptyStatementBlock: should provide options to ignore empty private constructors and empty virtual methods</li>
<li><ahref="https://github.com/pmd/pmd/issues/3569">#3569</a>: [apex] EmptyCatchBlock: should provide an option to ignore empty catch blocks in test methods</li>
<li><ahref="https://github.com/pmd/pmd/issues/3570">#3570</a>: [apex] OneDeclarationPerLine: should provide an option to ignore multiple declarations in a for loop initializer</li>
<li><ahref="https://github.com/pmd/pmd/issues/3576">#3576</a>: [apex] ApexCRUDViolation should provide an option to specify additional patterns for methods that encapsulate authorization checks</li>
<li><ahref="https://github.com/pmd/pmd/issues/3579">#3579</a>: [apex] ApexCRUDViolation: false negative with undelete</li>
<li><ahref="https://github.com/pmd/pmd/issues/3560">#3560</a>: [java] InvalidLogMessageFormat: False positive with message and exception in a block inside a lambda</li>
<li><ahref="https://github.com/pmd/pmd/pull/3561">#3561</a>: [java] InvalidLogMessageFormat: False positive with message and exception in a block inside a lambda - <ahref="https://github.com/essobedo">Nicolas Filotto</a></li>
<li><ahref="https://github.com/pmd/pmd/pull/3565">#3565</a>: [doc] Fix resource leak due to Files.walk - <ahref="https://github.com/lujiefsi">lujiefsi</a></li>
<li><ahref="https://github.com/pmd/pmd/pull/3571">#3571</a>: [apex] Fix for #1089 - Added new configuration property additionalAssertMethodPattern to ApexUnitTestClassShouldHaveAssertsRule - <ahref="https://github.com/SCWells72">Scott Wells</a></li>
<li><ahref="https://github.com/pmd/pmd/pull/3572">#3572</a>: [apex] Fix for #3566 - Added new configuration property reportMissingDescription to ApexDocRule - <ahref="https://github.com/SCWells72">Scott Wells</a></li>
<li><ahref="https://github.com/pmd/pmd/pull/3573">#3573</a>: [apex] Fix for #3568 - Added new configuration properties reportEmptyPrivateNoArgConstructor and reportEmptyVirtualMethod to EmptyStatementBlock - <ahref="https://github.com/SCWells72">Scott Wells</a></li>
<li><ahref="https://github.com/pmd/pmd/pull/3574">#3574</a>: [apex] Fix for #3569 - Added new configuration properties allowCommentedBlocks and allowExceptionNameRegex to EmptyCatchBlock - <ahref="https://github.com/SCWells72">Scott Wells</a></li>
<li><ahref="https://github.com/pmd/pmd/pull/3575">#3575</a>: [apex] Fix for #3570 - Added new configuration property reportInForLoopInitializer to OneDeclarationPerLine - <ahref="https://github.com/SCWells72">Scott Wells</a></li>
<li><ahref="https://github.com/pmd/pmd/pull/3577">#3577</a>: [apex] Fix for #3576 - Added new configuration properties *AuthMethodPattern and *AuthMethodTypeParamIndex to ApexCRUDViolation rule - <ahref="https://github.com/SCWells72">Scott Wells</a></li>
<li><ahref="https://github.com/pmd/pmd/pull/3578">#3578</a>: [apex] ApexCRUDViolation: Documentation changes for #3576 - <ahref="https://github.com/SCWells72">Scott Wells</a></li>
<li><ahref="https://github.com/pmd/pmd/pull/3580">#3580</a>: [doc] Release notes updates for the changes in issue #3569 - <ahref="https://github.com/SCWells72">Scott Wells</a></li>