Merge branch 'master' into pr-2624

This commit is contained in:
Andreas Dangel
2020-07-17 15:16:24 +02:00
73 changed files with 5250 additions and 546 deletions

View File

@ -49,7 +49,7 @@ jobs:
env: BUILD=publish
before_install:
- bash .travis/before_install.sh "11.0.7+10"
- bash .travis/before_install.sh "11.0.8+10"
- source ${HOME}/java.env
install: true
before_script: true

View File

@ -4,7 +4,7 @@ set -e
source .travis/logger.sh
source .travis/common-functions.sh
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
VERSION=$(get_pom_version)
log_info "Building PMD Coveralls.io report ${VERSION} on branch ${TRAVIS_BRANCH}"
if ! travis_isPush; then

View File

@ -7,7 +7,7 @@ source .travis/github-releases-api.sh
source .travis/sourceforge-api.sh
source .travis/regression-tester.sh
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
VERSION=$(get_pom_version)
log_info "Building PMD ${VERSION} on branch ${TRAVIS_BRANCH}"
MVN_BUILD_FLAGS="-B -V"

View File

@ -8,7 +8,7 @@ source .travis/sourceforge-api.sh
source .travis/pmd-code-api.sh
function main() {
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
VERSION=$(get_pom_version)
log_info "Building PMD Documentation ${VERSION} on branch ${TRAVIS_BRANCH}"
#

View File

@ -6,7 +6,7 @@ source .travis/common-functions.sh
source .travis/github-releases-api.sh
source .travis/sourceforge-api.sh
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
VERSION=$(get_pom_version)
log_info "PMD Release ${VERSION}"
if ! travis_isPush; then

View File

@ -4,7 +4,7 @@ set -e
source .travis/logger.sh
source .travis/common-functions.sh
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
VERSION=$(get_pom_version)
log_info "Building PMD Sonar ${VERSION} on branch ${TRAVIS_BRANCH}"
if ! travis_isPush; then

View File

@ -53,3 +53,7 @@ function travis_isWindows() {
return 1
fi
}
function get_pom_version() {
echo $(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:3.0.0:exec)
}

View File

@ -25,7 +25,7 @@ echo "Releasing PMD"
echo "-------------------------------------------"
# see also https://gist.github.com/pdunnavant/4743895
CURRENT_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
CURRENT_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:3.0.0:exec)
RELEASE_VERSION=${CURRENT_VERSION%-SNAPSHOT}
MAJOR=$(echo $RELEASE_VERSION | cut -d . -f 1)
MINOR=$(echo $RELEASE_VERSION | cut -d . -f 2)

View File

@ -14,7 +14,26 @@ This is a {{ site.pmd.release_type }} release.
### New and noteworthy
#### New Rules
* The new Java rule {% rule "java/bestpractices/UnusedAssignment" %} (`java-bestpractices`) finds assignments
to variables, that are never used and are useless. The new rule is supposed to entirely replace
{% rule "java/errorprone/DataflowAnomalyAnalysis" %}.
### Fixed Issues
* apex
* [#2610](https://github.com/pmd/pmd/pull/2610): \[apex] Support top-level enums in rules
* apex-bestpractices
* [#2626](https://github.com/pmd/pmd/issues/2626): \[apex] UnusedLocalVariable - false positive on case insensitivity allowed in Apex
* core
* [#710](https://github.com/pmd/pmd/issues/710): \[core] Review used dependencies
* [#2594](https://github.com/pmd/pmd/issues/2594): \[core] Update exec-maven-plugin and align it in all project
* java-design
* [#2174](https://github.com/pmd/pmd/issues/2174): \[java] LawOfDemeter: False positive with 'this' pointer
* [#2189](https://github.com/pmd/pmd/issues/2189): \[java] LawOfDemeter: False positive when casting to derived class
* java-performance
* [#1736](https://github.com/pmd/pmd/issues/1736): \[java] UseStringBufferForStringAppends: False positive if only one concatenation
* [#2207](https://github.com/pmd/pmd/issues/2207): \[java] AvoidInstantiatingObjectsInLoops: False positive - should not flag objects when assigned to lists/arrays
### API Changes
@ -29,6 +48,10 @@ This is a {{ site.pmd.release_type }} release.
### External Contributions
* [#2558](https://github.com/pmd/pmd/pull/2558): \[java] Fix issue #1736 and issue #2207 - [Young Chan](https://github.com/YYoungC)
* [#2560](https://github.com/pmd/pmd/pull/2560): \[java] Fix false positives of LawOfDemeter: this and cast expressions - [xioayuge](https://github.com/xioayuge)
* [#2590](https://github.com/pmd/pmd/pull/2590): Update libraries snyk is referring to as `unsafe` - [Artem Krosheninnikov](https://github.com/KroArtem)
* [#2597](https://github.com/pmd/pmd/pull/2597): \[dependencies] Fix issue #2594, update exec-maven-plugin everywhere - [Artem Krosheninnikov](https://github.com/KroArtem)
{% endtocmaker %}

View File

@ -54,12 +54,12 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.7</version>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.1.7</version>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
@ -89,7 +89,6 @@
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr-runtime</artifactId>
<version>3.5.2</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
@ -119,7 +118,7 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.17</version>
<version>1.26</version>
</dependency>
<dependency>
<groupId>aopalliance</groupId>

View File

@ -1,125 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>pmd-apex</artifactId>
<name>PMD Apex</name>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>pmd-apex</artifactId>
<name>PMD Apex</name>
<parent>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd</artifactId>
<version>6.26.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<parent>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd</artifactId>
<version>6.26.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<properties>
<java.version>8</java.version>
</properties>
<properties>
<java.version>8</java.version>
</properties>
<build>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<useDefaultDelimiters>false</useDefaultDelimiters>
<delimiters>
<delimiter>${*}</delimiter>
</delimiters>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>pmd-apex-jorje</artifactId>
<version>${project.version}</version>
<classifier>lib</classifier>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>pmd-apex-jorje</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.saxon</groupId>
<artifactId>saxon</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.stefanbirkner</groupId>
<artifactId>system-rules</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-lang-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>designer</id>
<build>
<build>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<configuration>
<mainClass>net.sourceforge.pmd.util.designer.Designer</mainClass>
<includePluginDependencies>true</includePluginDependencies>
</configuration>
<dependencies>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<useDefaultDelimiters>false</useDefaultDelimiters>
<delimiters>
<delimiter>${*}</delimiter>
</delimiters>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</build>
<dependencies>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr-runtime</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>pmd-apex-jorje</artifactId>
<version>${project.version}</version>
<classifier>lib</classifier>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>pmd-apex-jorje</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.stefanbirkner</groupId>
<artifactId>system-rules</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-lang-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -7,8 +7,6 @@ package net.sourceforge.pmd.lang.apex.metrics;
import java.util.ArrayList;
import java.util.List;
import org.checkerframework.checker.nullness.qual.NonNull;
import net.sourceforge.pmd.lang.apex.ast.ASTMethod;
import net.sourceforge.pmd.lang.apex.ast.ASTUserClass;
import net.sourceforge.pmd.lang.apex.ast.ASTUserClassOrInterface;
@ -136,7 +134,6 @@ public final class ApexMetrics {
}
@NonNull
public static List<ASTMethod> findOps(ASTUserClassOrInterface<?> node) {
List<ASTMethod> candidates = node.findChildrenOfType(ASTMethod.class);
List<ASTMethod> result = new ArrayList<>(candidates);

View File

@ -8,6 +8,7 @@ import java.util.Stack;
import net.sourceforge.pmd.lang.apex.ast.ASTMethod;
import net.sourceforge.pmd.lang.apex.ast.ASTUserClassOrInterface;
import net.sourceforge.pmd.lang.apex.ast.ASTUserEnum;
import net.sourceforge.pmd.lang.apex.ast.ASTUserTrigger;
import net.sourceforge.pmd.lang.apex.ast.ApexParserVisitorReducedAdapter;
@ -41,6 +42,12 @@ public class ApexMultifileVisitor extends ApexParserVisitorReducedAdapter {
}
@Override
public Object visit(ASTUserEnum node, Object data) {
return data; // ignore
}
@Override
public Object visit(ASTMethod node, Object data) {
stack.peek().addOperation(node.getQualifiedName().getOperation(), node.getSignature());

View File

@ -1,4 +1,4 @@
/**
/*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
@ -7,6 +7,8 @@ package net.sourceforge.pmd.lang.apex.rule.bestpractices;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import net.sourceforge.pmd.lang.apex.ast.ASTBlockStatement;
import net.sourceforge.pmd.lang.apex.ast.ASTReferenceExpression;
import net.sourceforge.pmd.lang.apex.ast.ASTVariableDeclaration;
@ -41,7 +43,7 @@ public class UnusedLocalVariableRule extends AbstractApexRule {
continue;
}
if (usage.hasImageEqualTo(variableName)) {
if (StringUtils.equalsIgnoreCase(variableName, usage.getImage())) {
return data;
}
}

View File

@ -129,13 +129,6 @@ public class StdCyclomaticComplexityRule extends AbstractApexRule {
@Override
public Object visit(ASTUserEnum node, Object data) {
entryStack.push(new Entry());
super.visit(node, data);
Entry classEntry = entryStack.pop();
if (classEntry.getComplexityAverage() >= reportLevel || classEntry.highestDecisionPoints >= reportLevel) {
addViolation(data, node, new String[] { "class", node.getImage(),
classEntry.getComplexityAverage() + "(Highest = " + classEntry.highestDecisionPoints + ')', });
}
return data;
}

View File

@ -0,0 +1,86 @@
/*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.lang.apex.rule;
import static org.junit.Assert.assertEquals;
import java.util.Collections;
import org.junit.Test;
import net.sourceforge.pmd.RuleContext;
import net.sourceforge.pmd.lang.apex.ast.ASTAnonymousClass;
import net.sourceforge.pmd.lang.apex.ast.ASTUserClass;
import net.sourceforge.pmd.lang.apex.ast.ASTUserEnum;
import net.sourceforge.pmd.lang.apex.ast.ASTUserInterface;
import net.sourceforge.pmd.lang.apex.ast.ASTUserTrigger;
import net.sourceforge.pmd.lang.apex.ast.ApexNode;
import net.sourceforge.pmd.lang.apex.ast.ApexParserTestBase;
import apex.jorje.semantic.ast.compilation.Compilation;
public class AbstractApexRuleTest extends ApexParserTestBase {
@Test
public void shouldVisitTopLevelClass() {
run("class Foo { }");
}
@Test
public void shouldVisitTopLevelInterface() {
run("interface Foo { }");
}
@Test
public void shouldVisitTopLevelTrigger() {
run("trigger Foo on Account (before insert, before update) { }");
}
@Test
public void shouldVisitTopLevelEnum() {
run("enum Foo { }");
}
private void run(String code) {
ApexNode<Compilation> node = parse(code);
RuleContext ctx = new RuleContext();
ctx.setLanguageVersion(apex.getDefaultVersion());
TopLevelRule rule = new TopLevelRule();
rule.apply(Collections.singletonList(node), ctx);
assertEquals(1, ctx.getReport().size());
}
private static class TopLevelRule extends AbstractApexRule {
@Override
public Object visit(ASTUserClass node, Object data) {
addViolation(data, node);
return data;
}
@Override
public Object visit(ASTUserInterface node, Object data) {
addViolation(data, node);
return data;
}
@Override
public Object visit(ASTUserTrigger node, Object data) {
addViolation(data, node);
return data;
}
@Override
public Object visit(ASTUserEnum node, Object data) {
addViolation(data, node);
return data;
}
@Override
public Object visit(ASTAnonymousClass node, Object data) {
addViolation(data, node);
return data;
}
}
}

View File

@ -94,6 +94,20 @@ public class Foo {
trigger leadOwnerUpdate on Lead (after update) {
for(Lead Id : Trigger.new) {
}
}
]]></code>
</test-code>
<test-code>
<description>[apex] UnusedLocalVariable - false positive on case insensitivity allowed in Apex #2626</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
class Foo {
private String foo() {
String Bar;
bar = 'bar';
return bar;
}
}
]]></code>
</test-code>

View File

@ -63,6 +63,14 @@ public class Foo {
]]></code>
</test-code>
<test-code>
<description>top-level enum all is well</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public enum FooEnum { }
]]></code>
</test-code>
<test-code>
<description>test class default is title case</description>
<expected-problems>1</expected-problems>
@ -121,6 +129,17 @@ public class Foo {
]]></code>
</test-code>
<test-code>
<description>top-level enum default is title case</description>
<expected-problems>1</expected-problems>
<expected-messages>
<message>The enum name 'fooEnum' doesn't match '[A-Z][a-zA-Z0-9_]*'</message>
</expected-messages>
<code><![CDATA[
public enum fooEnum { }
]]></code>
</test-code>
<test-code>
<description>custom test class pattern</description>
<rule-property name="testClassPattern">[a-zA-Z0-9_]+</rule-property>
@ -157,4 +176,22 @@ public class FOO_CLASS { }
public interface FOO_INTERFACE { }
]]></code>
</test-code>
<test-code>
<description>custom enum pattern</description>
<rule-property name="enumPattern">E[a-zA-Z0-9_]+</rule-property>
<expected-problems>0</expected-problems>
<code><![CDATA[
public enum EFOO_ENUM { }
]]></code>
</test-code>
<test-code>
<description>custom enum pattern</description>
<rule-property name="enumPattern">E[a-zA-Z0-9_]+</rule-property>
<expected-problems>1</expected-problems>
<code><![CDATA[
public enum FooEnum { }
]]></code>
</test-code>
</test-data>

View File

@ -97,6 +97,12 @@
<artifactId>ant</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.java.dev.javacc</groupId>
<artifactId>javacc</artifactId>
<scope>provided</scope> <!-- only needed for generating the parser via ant -->
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
@ -122,10 +128,7 @@
-->
<optional>true</optional>
</dependency>
<dependency>
<groupId>net.java.dev.javacc</groupId>
<artifactId>javacc</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.saxon</groupId>
<artifactId>saxon</artifactId>

View File

@ -0,0 +1,13 @@
<?xml version="1.0"?>
<ruleset name="6260"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
<description>
This ruleset contains links to rules that are new in PMD v6.26.0
</description>
<rule ref="category/java/bestpractices.xml/UnusedAssignment" />
</ruleset>

View File

@ -70,21 +70,12 @@
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-test</artifactId>

View File

@ -36,8 +36,8 @@
<artifactId>pmd-core</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
</dependency>
<dependency>
@ -45,11 +45,6 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-test</artifactId>

View File

@ -31,17 +31,13 @@
</build>
<dependencies>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
</dependency>
<dependency>
@ -49,11 +45,6 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-test</artifactId>

View File

@ -230,13 +230,13 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -24,7 +24,6 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>generate-rule-docs</id>
@ -100,18 +99,18 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.19</version>
<version>1.26</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -29,21 +29,12 @@
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-test</artifactId>

View File

@ -29,25 +29,20 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-test</artifactId>

View File

@ -26,30 +26,20 @@
</build>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-test</artifactId>

View File

@ -107,10 +107,6 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>net.java.dev.javacc</groupId>
<artifactId>javacc</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
@ -132,13 +128,6 @@
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.saxon</groupId>
<artifactId>saxon</artifactId>
<classifier>dom</classifier>
<scope>runtime</scope>
</dependency>
<!-- TEST DEPENDENCIES -->
<dependency>
<groupId>net.sourceforge.pmd</groupId>
@ -150,23 +139,6 @@
<artifactId>pmd-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.12.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.12.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
@ -177,11 +149,6 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.stefanbirkner</groupId>
@ -193,6 +160,66 @@
<artifactId>ant-testutil</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.oowekyala.treeutils</groupId>
<artifactId>tree-matchers</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.oowekyala.treeutils</groupId>
<artifactId>tree-printers</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.kotlintest</groupId>
<artifactId>kotlintest-assertions</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.kotlintest</groupId>
<artifactId>kotlintest-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<scope>test</scope>
</dependency>
<!-- the following dependencies are there to support typeresolution in test cases -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.13.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>

View File

@ -26,7 +26,7 @@ import net.sourceforge.pmd.annotation.InternalApi;
public class ASTAnnotation extends AbstractJavaTypeNode {
private static final List<String> UNUSED_RULES
= Arrays.asList("UnusedPrivateField", "UnusedLocalVariable", "UnusedPrivateMethod", "UnusedFormalParameter");
= Arrays.asList("UnusedPrivateField", "UnusedLocalVariable", "UnusedPrivateMethod", "UnusedFormalParameter", "UnusedAssignment");
private static final List<String> SERIAL_RULES = Arrays.asList("BeanMembersShouldSerialize", "MissingSerialVersionUID");

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