From 2c1c37b9663f3e0fcdfac4ae5975bcf5344901ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Wed, 22 Dec 2021 19:52:11 +0100 Subject: [PATCH] More fixes --- .../pmd/lang/java/ast/AbstractAnyTypeDeclaration.java | 1 - .../lang/java/rule/bestpractices/UseTryWithResourcesRule.java | 2 +- .../net/sourceforge/pmd/lang/plsql/ast/SelectIntoArray.txt | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractAnyTypeDeclaration.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractAnyTypeDeclaration.java index 104594b653..f492d9b9f2 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractAnyTypeDeclaration.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractAnyTypeDeclaration.java @@ -8,7 +8,6 @@ import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import net.sourceforge.pmd.lang.ast.Node; -import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken; import net.sourceforge.pmd.lang.java.symbols.JClassSymbol; import net.sourceforge.pmd.lang.java.types.JClassType; import net.sourceforge.pmd.lang.rule.xpath.DeprecatedAttribute; diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseTryWithResourcesRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseTryWithResourcesRule.java index 380a6716f8..7d3f7ed962 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseTryWithResourcesRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseTryWithResourcesRule.java @@ -34,7 +34,7 @@ public final class UseTryWithResourcesRule extends AbstractJavaRulechainRule { @Override public Object visit(ASTTryStatement node, Object data) { - boolean isJava9OrLater = node.getAstInfo().getLanguageVersion().compareToVersion("9") >= 0; + boolean isJava9OrLater = node.getLanguageVersion().compareToVersion("9") >= 0; ASTFinallyClause finallyClause = node.getFinallyClause(); if (finallyClause != null) { diff --git a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/SelectIntoArray.txt b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/SelectIntoArray.txt index ad8e4f1d2b..58f0ed86a6 100644 --- a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/SelectIntoArray.txt +++ b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/SelectIntoArray.txt @@ -1,4 +1,4 @@ -+- Input[@CanonicalImage = null, @ExcludedLinesCount = "0", @ExcludedRangesCount = "0", @Sourcecode = "--\n-- See https://github.com/pmd/pmd/issues/3515\n--\n\nCREATE OR REPLACE PROCEDURE EXAMPLE_PROCEDURE IS\n --\n TYPE example_data_rt IS RECORD(\n field_one PLS_INTEGER,\n field_two PLS_INTEGER,\n field_three PLS_INTEGER);\n --\n TYPE example_data_aat IS TABLE OF example_data_rt INDEX BY BINARY_INTEGER;\n --\n l_example_data example_data_aat;\n --\nBEGIN\n --\n SELECT 1 field_value_one, 2 field_value_two, 3 field_value_three\n INTO l_example_data(1).field_one,l_example_data(1).field_two,l_example_data(1).field_three\n FROM DUAL;\n --\nEND EXAMPLE_PROCEDURE;\n"] ++- Input[@CanonicalImage = null, @ExcludedLinesCount = "0", @ExcludedRangesCount = "0"] +- Global[@CanonicalImage = null] +- ProgramUnit[@CanonicalImage = null, @MethodName = "EXAMPLE_PROCEDURE", @Name = "EXAMPLE_PROCEDURE", @ObjectName = null] +- MethodDeclarator[@CanonicalImage = "EXAMPLE_PROCEDURE", @Image = "EXAMPLE_PROCEDURE", @ParameterCount = "1"]