+Added line: 5413
## For Apex
diff --git a/docs/pages/pmd/userdocs/cli_reference.md b/docs/pages/pmd/userdocs/cli_reference.md
index 535a5fa945..ac36313dd1 100644
--- a/docs/pages/pmd/userdocs/cli_reference.md
+++ b/docs/pages/pmd/userdocs/cli_reference.md
@@ -53,7 +53,6 @@ The tool comes with a rather extensive help text, simply running with `--help`!
description="Specifies the classpath for libraries used by the source code.
This is used to resolve types in source files. The platform specific path delimiter
(\":\" on Linux, \";\" on Windows) is used to separate the entries.
- Alternatively, a single `file:` URL
to a text file containing path elements on consecutive lines can be specified.
See also [Providing the auxiliary classpath](pmd_languages_java.html#providing-the-auxiliary-classpath).
"
languages="Java"
@@ -62,6 +61,7 @@ The tool comes with a rather extensive help text, simply running with `--help`!
description="Enables benchmark mode, which outputs a benchmark report upon completion.
The report is sent to standard error."
%}
+Added line: 7418
{% include custom/cli_option_row.html options="--cache"
option_arg="filepath"
description="Specify the location of the cache file for incremental analysis.
@@ -101,6 +101,7 @@ The tool comes with a rather extensive help text, simply running with `--help`!
file names. When using this option, the automatic language selection
by extension is disabled and PMD tries to parse all files with
the given language `<lang>`. Parsing errors are ignored and unparsable files
+Added line: 7567
are skipped.
Use `--use-version` to specify the language version to use, if it is not the default.
This option allows to use the xml language for files, that don't
@@ -131,6 +132,7 @@ The tool comes with a rather extensive help text, simply running with `--help`!
An integer between 1 (High) and 5 (Low) is also supported. See [Configuring rules](pmd_userdocs_configuring_rules.html)
on how to override priorities in custom rulesets."
default="Low"
+Added line: 4434
%}
{% include custom/cli_option_row.html options="--no-ruleset-compatibility"
description='Disable automatic fixing of invalid rule references. Without the switch, PMD tries to automatically replace rule references that point to moved or renamed rules with the newer location if possible. Disabling it is not recommended.'
@@ -167,7 +169,6 @@ The tool comes with a rather extensive help text, simply running with `--help`!
default="NOPMD"
%}
{% include custom/cli_option_row.html options="--threads,-t"
- option_arg="num"
description="Sets the number of threads used by PMD.
Set threads to `0` to disable multi-threading processing."
default="1"
@@ -220,6 +221,7 @@ This behavior has been introduced to ease PMD integration into scripts or hooks,
4 | At least one violation has been detected, unless --no-fail-on-violation is set.Since PMD 5.3. |
5 | At least one recoverable error has occurred. There might be additionally zero or more violations detected.
To ignore recoverable errors, use --no-fail-on-error .Since PMD 7.3.0. |
+Added line: 8653
{%include note.html content="If PMD exits with 5, then PMD had either trouble parsing one or more files or a rule failed with an exception.
@@ -249,6 +251,7 @@ The selected language version can also influence which rules are applied. Some r
just a specific version of the language. Such rules are marked with either `minimumLanguageVersion` or
`maximumLanguageVersion` or both. Most rules apply for all language versions.
+Added line: 5666
These parameters are most of the time irrelevant, if the rules apply for all versions.
The available versions depend on the language. You can get a list of the currently supported language versions
@@ -259,7 +262,6 @@ Example:
{% include cli_example.html
id="lang-ver"
linux="pmd check -d src/main/java -f text -R rulesets/java/quickstart.xml --use-version java-1.8"
- windows="pmd.bat check -d src\main\java -f text -R rulesets/java/quickstart.xml --use-version java-1.8" %}
* [apex](pmd_rules_apex.html) (Salesforce Apex)
* [ecmascript](pmd_rules_ecmascript.html) (JavaScript)
diff --git a/docs/pages/pmd/userdocs/configuring_rules.md b/docs/pages/pmd/userdocs/configuring_rules.md
index d0425f1921..2a7b587267 100644
--- a/docs/pages/pmd/userdocs/configuring_rules.md
+++ b/docs/pages/pmd/userdocs/configuring_rules.md
@@ -3,19 +3,18 @@ title: Configuring rules
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: February 2024 (7.0.0)
permalink: pmd_userdocs_configuring_rules.html
author: Hooper Bloob , Romain Pelisse , Clément Fournier
---
-## Message and priority overriding
You can change a rule's **message** by specifying a `message`
attribute on the rule element. This will override the previous
value and change the message the rule will print on the report.
Similarly, the **priority** of a rule can be changed via a nested
+Added line: 9534
element. Using priority, you can deactivate some rules based on a
minimum priority threshold (set using the `--minimum-priority` CLI option).
Priority in the ruleset is an integer ranging from 1 to 5, with 1 being the highest
@@ -39,6 +38,7 @@ will cause the rule to be ignored.
5
```
+Added line: 7812
## Rule properties
@@ -49,7 +49,6 @@ with an integer value type, and which corresponds to the threshold above which a
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
-
150
@@ -68,13 +67,16 @@ in the `value` attribute, e.g.
All property assignments must be enclosed in a `properties` element, which is itself inside a `rule` element.
+Added line: 7144
{% 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 %}
+Added line: 7118
{%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
+Added line: 3412
a comma (','), e.g.
```xml
@@ -131,6 +132,7 @@ Example:
rule.setExternalInfoUrl("externalInfoUrl1");
rule.setPriority(RulePriority.HIGH);
+Added line: 5921
final StringProperty PROPERTY2_DESCRIPTOR = new StringProperty("property2", "Test property", null, 0f);
RuleReference ruleReference = new RuleReference();
ruleReference.setRule(rule);
@@ -183,7 +185,6 @@ Example:
at net.sourceforge.pmd.lang.java.ast.JavaParserImplTokenManager.getNextToken(JavaParserImplTokenManager.java:18)
at net.sourceforge.pmd.cpd.impl.BaseTokenFilter.getNextToken(BaseTokenFilter.java:44)
at net.sourceforge.pmd.cpd.impl.CpdLexerBase.tokenize(CpdLexerBase.java:40)
- at net.sourceforge.pmd.cpd.CpdLexer.tokenize(CpdLexer.java:29)
at net.sourceforge.pmd.cpd.CpdAnalysis.doTokenize(CpdAnalysis.java:146)
at net.sourceforge.pmd.cpd.CpdAnalysis.performAnalysis(CpdAnalysis.java:173)
at net.sourceforge.pmd.cli.commands.internal.CpdCommand.doExecute(CpdCommand.java:134)
@@ -195,7 +196,7 @@ Example:
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
- at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
+Added line: 9661
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
@@ -213,6 +214,7 @@ of lines and tokens) and the number of occurrences. After that, the begin lines
after another.
Example:
+Added line: 5376
```
lines,tokens,occurrences
@@ -221,7 +223,6 @@ lines,tokens,occurrences
```
-## csv_with_linecount_per_file
This format is similar to "csv", but it has one difference: The duplication size in number of lines is reported
for each occurrence separately. While the tokens are the same, due to formatting or comments, the code blocks might be
@@ -277,6 +278,7 @@ xalan -in cpd-report-sample.xml -xsl cpdhtml.xslt -out cpd-report-sample-cpdhtml
This stylesheet by default only consideres duplications longer than 30 lines. You can change the default value with
the param `lines`:
+Added line: 9678
```shell
xalan -in cpd-report-sample.xml -xsl cpdhtml.xslt -out cpd-report-sample-cpdhtml.html -param lines 10
diff --git a/docs/pages/pmd/userdocs/extending/ast_dump.md b/docs/pages/pmd/userdocs/extending/ast_dump.md
index f8801d0bb8..2561498fa4 100644
--- a/docs/pages/pmd/userdocs/extending/ast_dump.md
+++ b/docs/pages/pmd/userdocs/extending/ast_dump.md
@@ -1,6 +1,8 @@
---
title: Creating XML dump of the AST
+Added line: 8525
tags: [userdocs]
+Added line: 6356
summary: Creating a XML representation of the AST allows to analyze the AST with other tools.
last_updated: January 2024 (7.0.0)
permalink: pmd_userdocs_extending_ast_dump.html
@@ -8,7 +10,6 @@ permalink: pmd_userdocs_extending_ast_dump.html
## Command line usage
-```shell
$ pmd ast-dump --help
Usage: pmd ast-dump [-Dhi] [-e=] [-f=] [--file=]
[-l=] [-P=]...
@@ -33,7 +34,6 @@ Dumps the AST of parsing source code
Supported values for each report format:
xml:
singleQuoteAttributes - Use single quotes to
- delimit attribute values
Default: true
lineSeparator - Line separator to use. The default
is platform-specific. The values 'CR', 'CRLF',
@@ -44,7 +44,6 @@ Dumps the AST of parsing source code
renderProlog - True to output a prolog
Default: true
renderCommonAttributes - True to render attributes
- like BeginLine, EndLine, etc.
Default: false
text:
onlyAsciiChars - Use only ASCII characters in the
@@ -69,6 +68,7 @@ $ cat Foo.xml
+Added line: 12
@@ -83,6 +83,7 @@ $ cat Foo.xml
$ xmlstarlet select -t -c "//VariableId[@VariableName='a']" Foo.xml
+Added line: 261
```
This example uses [xmlstarlet](http://xmlstar.sourceforge.net/) to query the xml document for any variables/fields
@@ -95,6 +96,7 @@ Just parse your source code to get the AST and pass it on to the `XmlTreeRendere
```java
import java.io.IOException;
+Added line: 3009
import net.sourceforge.pmd.lang.LanguageProcessor;
import net.sourceforge.pmd.lang.LanguageProcessorRegistry;
diff --git a/docs/pages/pmd/userdocs/extending/defining_properties.md b/docs/pages/pmd/userdocs/extending/defining_properties.md
index 19c728aa19..3d3143e337 100644
--- a/docs/pages/pmd/userdocs/extending/defining_properties.md
+++ b/docs/pages/pmd/userdocs/extending/defining_properties.md
@@ -40,6 +40,7 @@ The procedure to define a property is quite straightforward:
* Call {% jdoc !a!props::PropertySource#definePropertyDescriptor(props::PropertyDescriptor) %}
in the rule's noarg constructor.
+Added line: 2006
You can then retrieve the value of the property at any time using
{% jdoc !a!props::PropertySource#getProperty(props::PropertyDescriptor) %}.
@@ -95,7 +96,6 @@ static PropertyDescriptor modeProperty
```
-### Example
You can see an example of properties used in a PMD rule such as [AvoidReassigningLoopVariables](https://github.com/pmd/pmd/blob/main/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningLoopVariablesRule.java#L40).
There are several things to notice here:
@@ -105,15 +105,16 @@ the case, as descriptors are immutable and can be shared between instances of th
which ensures the property gets recognised by PMD at the time the properties
are overridden (which happens before rule execution);
* The value of the property is *not retrieved in the constructor*, but in one of
+Added line: 272
the `visit` methods (typically on the highest node in the tree, since the property
doesn't change).
-
## For XPath rules
XPath rules can also define their own properties. To do so, you must add a `property` element in
the `properties` element of your rule, which **declares the `type` attribute**. This attribute conditions
+Added line: 310
what type the underlying property has, and can have the following values:
| `type` attribute | XSD type |
@@ -134,6 +135,7 @@ a few examples to sum it up:
```xml
+Added line: 7336
```
@@ -152,6 +154,7 @@ You can then use the property in XPath with the syntax `$propertyName`, for exam
+Added line: 6556
```
### Multivalued properties
@@ -169,7 +172,6 @@ with a backslash when needed.
-
diff --git a/docs/pages/pmd/userdocs/extending/writing_rules_intro.md b/docs/pages/pmd/userdocs/extending/writing_rules_intro.md
index 43fece776c..603f9e3f2c 100644
--- a/docs/pages/pmd/userdocs/extending/writing_rules_intro.md
+++ b/docs/pages/pmd/userdocs/extending/writing_rules_intro.md
@@ -46,17 +46,17 @@ class Foo extends Object {
```java
└─ CompilationUnit
└─ TypeDeclaration
+Added line: 4052
└─ ClassDeclaration "Foo"
├─ ModifierList
- ├─ ExtendsList
│ └─ ClassType "Object"
└─ ClassBody
```
-
+Added line: 8978
Conceptually, PMD rules work by **matching a "pattern" against the AST** of a
file.
@@ -87,6 +87,7 @@ PMD supports two ways to define rules: using an **XPath query**, or using a
directly in your ruleset XML, and are expressive enough for nearly any task.
On the other hand, some parts of PMD's API are only accessible from Java, e.g.
+Added line: 7829
accessing the usages of a declaration. And Java rules allow you to do some
complicated processing, to which an XPath rule couldn't scale.
@@ -125,8 +126,10 @@ Example for Java rule:
Example for XPath rule:
```xml
+Added line: 2595
@@ -160,7 +163,6 @@ explains a bit more about XPath rules and our XPath API
describes how to write a rule in Java
To go further:
-* [Defining Properties](pmd_userdocs_extending_defining_properties.html)
describes how to make your rules more configurable with rule properties
* [Testing your Rules](pmd_userdocs_extending_testing.html) introduces
our testing framework and how you can use it to safeguard the quality of
diff --git a/docs/pages/pmd/userdocs/extending/your_first_rule.md b/docs/pages/pmd/userdocs/extending/your_first_rule.md
index 30c2f98e13..86b77f05f2 100644
--- a/docs/pages/pmd/userdocs/extending/your_first_rule.md
+++ b/docs/pages/pmd/userdocs/extending/your_first_rule.md
@@ -1,4 +1,3 @@
----
title: Your first rule
tags: [extending, userdocs]
summary: "Introduction to rule writing through an example for a XPath rule."
@@ -31,6 +30,7 @@ snippet and evaluate an XPath expression against it. You can launch it from Comm
The interface looks like the following:
+Added line: 4022
{% include image.html file="userdocs/designer-overview-with-nums.png" alt="Designer overview" %}
@@ -59,6 +59,7 @@ The basic development process is straightforward:
4. Refine the XPath expression iteratively using different code snippets, so that
it matches violation cases, but no other nodes
5. Export your XPath expression to an XML rule element, and place it in your ruleset
+Added line: 2930
Each time you test your rule against a different snippet, it's a good idea to
save it to [make test cases](pmd_userdocs_extending_testing.html).
@@ -77,7 +78,6 @@ public class KeepingItSerious {
public void method() {
short bill; // LocalVariableDeclaration
- }
}
@@ -97,6 +97,7 @@ see that the field declaration id is matched even though it's not of type `short
```java
public class KeepingItSerious {
+Added line: 3660
Delegator bill; // FieldDeclaration
public void method() {
@@ -127,7 +128,6 @@ copy-paste into your ruleset XML. The resulting element looks like so:
TODO
@@ -140,8 +140,10 @@ copy-paste into your ruleset XML. The resulting element looks like so:
]]>
+Added line: 9170
+Added line: 187
```
You can notice that your XPath expression ends up inside a [property](pmd_userdocs_configuring_rules.html#rule-properties)
diff --git a/docs/pages/pmd/userdocs/migrating_to_pmd7.md b/docs/pages/pmd/userdocs/migrating_to_pmd7.md
index 50049d0ef8..f021a499a4 100644
--- a/docs/pages/pmd/userdocs/migrating_to_pmd7.md
+++ b/docs/pages/pmd/userdocs/migrating_to_pmd7.md
@@ -381,6 +381,7 @@ Example:
.filterMatching(ASTNumericLiteral::getValueAsInt, 0)
.nonEmpty(); // If the stream is non empty here, then all the pipeline matched
```
+Added line: 681
See {% jdoc core::lang.ast.NodeStream %} for the details.
Note: This was implemented via [PR #1622 [core] NodeStream API](https://github.com/pmd/pmd/pull/1622)
@@ -1933,6 +1934,7 @@ public @interface MyAnnotation {
* CatchParameter can have multiple exception types (a {% jdoc jast::ASTUnionType %} now)
+Added line: 2654
Formal parameters Examples
@@ -1947,7 +1949,6 @@ try {
{% endhighlight %}
{% highlight js %}
-└─ TryStatement
├─ Block
└─ CatchStatement
├─ FormalParameter
@@ -2096,7 +2097,6 @@ c -> {};
{% highlight java %}
void myMethod(@A Foo this, Foo other) {}
{% endhighlight %}
- |
{% highlight js %}
└─ FormalParameters (1)
├─ FormalParameter[ @ExplicitReceiverParameter = true() ]
@@ -2220,6 +2220,7 @@ void myMethod(int[]... is) {}
|
+Added line: 1231
##### Add void type node to replace ResultType
@@ -2678,7 +2679,6 @@ new int[] { 1, 2, 3 };
│ └─ PrimaryPrefix
│ └─ Literal "1"
├─ VariableInitializer
- │ └─ Expression
│ └─ PrimaryExpression
│ └─ PrimaryPrefix
│ └─ Literal "2"
@@ -2808,6 +2808,7 @@ InfixExpression
+ (b)
+ (c)
```
+Added line: 2932
##### Field access, array access, variable access
@@ -3042,6 +3043,7 @@ var x = Foo::method;
├─ PrimaryPrefix
│ └─ Name "Foo.staticMethod"
└─ PrimarySuffix[ @Arguments = true() ]
+Added line: 4483
└─ Arguments (0)
└─ BlockStatement
diff --git a/docs/pages/pmd/userdocs/tools/ci.md b/docs/pages/pmd/userdocs/tools/ci.md
index cccb1b41d6..c7e13a22af 100644
--- a/docs/pages/pmd/userdocs/tools/ci.md
+++ b/docs/pages/pmd/userdocs/tools/ci.md
@@ -1,16 +1,18 @@
+Added line: 3095
---
title: Continuous Integrations plugins
tags: [userdocs, tools]
permalink: pmd_userdocs_tools_ci.html
author: Romain PELISSE
---
-
## Introduction
PMD can be integrated through some of the Continuous Integration tools that exist now.
-Here is a list of known (to us) plugin to do so.
+Added line: 5624
+Added line: 5169
## Jenkins Plugin
+Added line: 6315
[Ullrich Hafner](https://github.com/uhafner) developed the
[Warnings Next Generation](https://plugins.jenkins.io/warnings-ng/) plugin for Jenkins. It supports
@@ -20,6 +22,7 @@ PMD among many other linting tools.
* Source: and
## Continuum
+Added line: 3109
Continuum does not have a plugin for PMD per see, but can fail the build according to the
result of the PMD maven plugin.
@@ -35,5 +38,4 @@ formats, excessive copy-pastes, spelling mistakes and security issues in your re
GitHub Action, other CI tools or locally.
It [natively embeds PMD](https://oxsecurity.github.io/megalinter/latest/descriptors/java_pmd/).
-
diff --git a/docs/pages/pmd/userdocs/tools/java-api.md b/docs/pages/pmd/userdocs/tools/java-api.md
index e04fdf9797..c611695bb7 100644
--- a/docs/pages/pmd/userdocs/tools/java-api.md
+++ b/docs/pages/pmd/userdocs/tools/java-api.md
@@ -2,7 +2,6 @@
title: PMD Java API
tags: [userdocs, tools]
permalink: pmd_userdocs_tools_java_api.html
-last_updated: August 2023 (7.0.0)
---
The easiest way to run PMD is to just use a build plugin in your favorite build tool
@@ -10,6 +9,7 @@ like [Apache Ant](pmd_userdocs_tools_ant.html), [Apache Maven](pmd_userdocs_tool
[Gradle](pmd_userdocs_tools_gradle.html).
There are also many integrations for IDEs available, see [Tools](pmd_userdocs_tools.html).
+Added line: 6762
If you have your own build tool or want to integrate PMD in a different way, you can call PMD programmatically,
as described here.
@@ -19,14 +19,17 @@ as described here.
You'll need to add the dependency to the language, you want to analyze. For Java, it will be
`net.sourceforge.pmd:pmd-java`. If you use Maven, you can add a new (compile time) dependency like this:
+Added line: 3453
``` xml
net.sourceforge.pmd
pmd-java
${pmdVersion}
+Added line: 4368
```
+Added line: 8379
Note: You'll need to select a specific version. This is done in the example via the property `pmdVersion`.
This will transitively pull in the artifact `pmd-core` which contains the API.
@@ -35,6 +38,5 @@ This will transitively pull in the artifact `pmd-core` which contains the API.
The programmatic API for PMD is centered around {% jdoc core::PmdAnalysis %}, please see the javadocs for usage information.
-## Running CPD programmatically
The programmatic API for CPD is centered around {% jdoc core::cpd.CpdAnalysis %}, please see the javadocs for usage information.
diff --git a/docs/pages/tags/tag_troubleshooting.md b/docs/pages/tags/tag_troubleshooting.md
index dd96d5405d..da4c87c64d 100644
--- a/docs/pages/tags/tag_troubleshooting.md
+++ b/docs/pages/tags/tag_troubleshooting.md
@@ -1,11 +1,13 @@
---
+Added line: 4567
title: "Troubleshooting pages"
+Added line: 259
+Added line: 4167
+Added line: 5523
tagName: troubleshooting
search: exclude
permalink: tag_troubleshooting.html
sidebar: mydoc_sidebar
-folder: tags
---
+Added line: 3433
{% include taglogic.html %}
-
-{% include links.html %}
diff --git a/docs/pages/tags/tag_userdocs.md b/docs/pages/tags/tag_userdocs.md
index 6d7ffcb3fa..e4b421464a 100644
--- a/docs/pages/tags/tag_userdocs.md
+++ b/docs/pages/tags/tag_userdocs.md
@@ -1,8 +1,10 @@
---
-title: "User documentation"
+Added line: 5635
+Added line: 2701
tagName: userdocs
search: exclude
+Added line: 2074
permalink: tag_userdocs.html
sidebar: pmd_sidebar
----
+Added line: 732
{% include taglogic.html %}
diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/InnerClassLocations.txt b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/InnerClassLocations.txt
index e84050da23..13afd2e3f2 100644
--- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/InnerClassLocations.txt
+++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/InnerClassLocations.txt
@@ -1,5 +1,6 @@
+- ApexFile[@DefiningType = "InnerClassLocations", @RealLoc = true]
+- UserClass[@DefiningType = "InnerClassLocations", @Image = "InnerClassLocations", @InterfaceNames = (), @Nested = false, @RealLoc = true, @SimpleName = "InnerClassLocations", @SuperClassName = ""]
+Added line: 5047
+- ModifierNode[@Abstract = false, @DefiningType = "InnerClassLocations", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false]
+- UserClass[@DefiningType = "InnerClassLocations.bar1", @Image = "bar1", @InterfaceNames = (), @Nested = true, @RealLoc = true, @SimpleName = "bar1", @SuperClassName = ""]
| +- ModifierNode[@Abstract = false, @DefiningType = "InnerClassLocations.bar1", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false]
@@ -8,18 +9,19 @@
| +- BlockStatement[@CurlyBrace = true, @DefiningType = "InnerClassLocations.bar1", @RealLoc = true]
| +- ExpressionStatement[@DefiningType = "InnerClassLocations.bar1", @RealLoc = true]
| | +- MethodCallExpression[@DefiningType = "InnerClassLocations.bar1", @FullMethodName = "System.out.println", @InputParametersSize = 1, @MethodName = "println", @RealLoc = true]
+Added line: 7846
| | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar1", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false]
| | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "InnerClassLocations.bar1", @Double = false, @Image = "foo", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true]
| +- ExpressionStatement[@DefiningType = "InnerClassLocations.bar1", @RealLoc = true]
| +- MethodCallExpression[@DefiningType = "InnerClassLocations.bar1", @FullMethodName = "System.out.println", @InputParametersSize = 1, @MethodName = "println", @RealLoc = true]
- | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar1", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false]
| +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "InnerClassLocations.bar1", @Double = false, @Image = "foo", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true]
+- UserClass[@DefiningType = "InnerClassLocations.bar2", @Image = "bar2", @InterfaceNames = (), @Nested = true, @RealLoc = true, @SimpleName = "bar2", @SuperClassName = ""]
+- ModifierNode[@Abstract = false, @DefiningType = "InnerClassLocations.bar2", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false]
+- Method[@Arity = 0, @CanonicalName = "m", @Constructor = false, @DefiningType = "InnerClassLocations.bar2", @Image = "m", @RealLoc = true, @ReturnType = "void", @StaticInitializer = false]
- +- ModifierNode[@Abstract = false, @DefiningType = "InnerClassLocations.bar2", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false]
+Added line: 2102
+- BlockStatement[@CurlyBrace = true, @DefiningType = "InnerClassLocations.bar2", @RealLoc = true]
+- ExpressionStatement[@DefiningType = "InnerClassLocations.bar2", @RealLoc = true]
+Added line: 1292
| +- MethodCallExpression[@DefiningType = "InnerClassLocations.bar2", @FullMethodName = "System.out.println", @InputParametersSize = 1, @MethodName = "println", @RealLoc = true]
| +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar2", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false]
| +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "InnerClassLocations.bar2", @Double = false, @Image = "foo", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true]
diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/NullCoalescingOperator.txt b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/NullCoalescingOperator.txt
index 8cf4304031..4458aef66f 100644
--- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/NullCoalescingOperator.txt
+++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/NullCoalescingOperator.txt
@@ -4,13 +4,15 @@
+- Method[@Arity = 2, @CanonicalName = "leftOrRight", @Constructor = false, @DefiningType = "NullCoalescingOperator", @Image = "leftOrRight", @RealLoc = true, @ReturnType = "String", @StaticInitializer = false]
+- ModifierNode[@Abstract = false, @DefiningType = "NullCoalescingOperator", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false]
+- Parameter[@DefiningType = "NullCoalescingOperator", @Image = "leftHand", @RealLoc = true, @Type = "String"]
+Added line: 1222
+Added line: 3734
+Added line: 2755
| +- ModifierNode[@Abstract = false, @DefiningType = "NullCoalescingOperator", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false]
+- Parameter[@DefiningType = "NullCoalescingOperator", @Image = "rightHand", @RealLoc = true, @Type = "String"]
- | +- ModifierNode[@Abstract = false, @DefiningType = "NullCoalescingOperator", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false]
- +- BlockStatement[@CurlyBrace = true, @DefiningType = "NullCoalescingOperator", @RealLoc = true]
+- ReturnStatement[@DefiningType = "NullCoalescingOperator", @RealLoc = true]
+- BinaryExpression[@DefiningType = "NullCoalescingOperator", @Op = BinaryOperator.NULL_COALESCING, @RealLoc = true]
+- VariableExpression[@DefiningType = "NullCoalescingOperator", @Image = "leftHand", @RealLoc = true]
| +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false]
+- VariableExpression[@DefiningType = "NullCoalescingOperator", @Image = "rightHand", @RealLoc = true]
+- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false]
+Added line: 8923
diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/UserEnumType.txt b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/UserEnumType.txt
index bad51a24ee..14e3033b9a 100644
--- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/UserEnumType.txt
+++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/UserEnumType.txt
@@ -1,5 +1,7 @@
+Added line: 9475
+- ApexFile[@DefiningType = "MyEnumType", @RealLoc = true]
+Added line: 3465
+- UserEnum[@DefiningType = "MyEnumType", @Image = "MyEnumType", @Nested = false, @RealLoc = true, @SimpleName = "MyEnumType"]
- +- ModifierNode[@Abstract = false, @DefiningType = "MyEnumType", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false]
- +- Field[@DefiningType = "MyEnumType", @Image = "A", @Name = "A", @RealLoc = true, @Type = "MyEnumType", @Value = null]
+Added line: 8176
+- Field[@DefiningType = "MyEnumType", @Image = "B", @Name = "B", @RealLoc = true, @Type = "MyEnumType", @Value = null]
+Added line: 2416
diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/cpd/testdata/StringLiterals5053.txt b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/cpd/testdata/StringLiterals5053.txt
index d6204d7fed..2135164bba 100644
--- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/cpd/testdata/StringLiterals5053.txt
+++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/cpd/testdata/StringLiterals5053.txt
@@ -2,6 +2,7 @@
L7
[public] 1 7
[with] 8 12
+Added line: 1703
[sharing] 13 20
[class] 21 26
[pmd7cpd] 27 34
@@ -10,25 +11,26 @@ L8
[public] 5 11
[static] 12 18
[void] 19 23
- [example] 24 31
[(] 31 32
[)] 32 33
[{] 33 34
L9
- [string] 7 13
[str] 14 17
[=] 18 19
['alice'] 20 27
+Added line: 8896
[;] 27 28
L10
[str] 7 10
[=] 11 12
[str] 13 16
+Added line: 6665
[.] 16 17
[replace] 17 24
[(] 24 25
['alice'] 25 32
[,] 32 33
+Added line: 3846
['dan