From 792fe44d0ba4211d88878183b78d82c57c238169 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 29 Sep 2022 15:54:50 +0200 Subject: [PATCH] Fixups from review (#4128) --- .../rule/codestyle/UnnecessaryFullyQualifiedNameRule.java | 2 +- .../java/rule/codestyle/xml/UnnecessaryFullyQualifiedName.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryFullyQualifiedNameRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryFullyQualifiedNameRule.java index 5348abca59..8091d944e3 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryFullyQualifiedNameRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryFullyQualifiedNameRule.java @@ -204,7 +204,7 @@ public class UnnecessaryFullyQualifiedNameRule extends AbstractJavaRule { String importStr = firstMatch.getImportedName() + (firstMatch.isImportOnDemand() ? ".*" : ""); String type = firstMatch.isStatic() ? "static " : ""; - addViolation(data, node, new Object[]{node.getImage(), importStr, type}); + asCtx(data).addViolation(node, node.getImage(), importStr, type); } } } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryFullyQualifiedName.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryFullyQualifiedName.xml index 426bb9b4b6..097e096767 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryFullyQualifiedName.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryFullyQualifiedName.xml @@ -623,7 +623,7 @@ public class UnnecessaryFullyQualifiedName { - False positive when same package inner class is referenced (not enum) + False positive when same package inner class is referenced (not enum) #4085 0 - Should report fully-qualified name usage of a class in itself. + Should report fully-qualified name usage of a class in itself #4085 1 4