diff --git a/.all-contributorsrc b/.all-contributorsrc index a7a64d18ce..e9c1649022 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -6520,6 +6520,15 @@ "contributions": [ "code" ] + }, + { + "login": "Vyom-Yadav", + "name": "Vyom Yadav", + "avatar_url": "https://avatars.githubusercontent.com/u/73882557?v=4", + "profile": "https://www.linkedin.com/in/vyom-yadav-66a97918b/", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/docs/pages/pmd/projectdocs/credits.md b/docs/pages/pmd/projectdocs/credits.md index 608d94edd7..b564d786ff 100644 --- a/docs/pages/pmd/projectdocs/credits.md +++ b/docs/pages/pmd/projectdocs/credits.md @@ -685,244 +685,245 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Vitaly Polonetsky

🐛
Vojtech Polivka

🐛
Vsevolod Zholobov

🐛 +
Vyom Yadav

💻
Wang Shidong

🐛 -
Waqas Ahmed

🐛 +
Waqas Ahmed

🐛
Wayne J. Earl

🐛
Wchenghui

🐛
Will Winder

🐛
William Brockhus

💻 🐛
Wilson Kurniawan

🐛
Wim Deblauwe

🐛 -
Woongsik Choi

🐛 +
Woongsik Choi

🐛
XenoAmess

💻 🐛
Yang

💻
YaroslavTER

🐛
Young Chan

💻 🐛
YuJin Kim

🐛
Yuri Dolzhenko

🐛 -
Yurii Dubinka

🐛 +
Yurii Dubinka

🐛
Zoltan Farkas

🐛
Zustin

🐛
aaronhurst-google

🐛
alexmodis

🐛
andreoss

🐛
andrey81inmd

💻 🐛 -
anicoara

🐛 +
anicoara

🐛
arunprasathav

🐛
asiercamara

🐛
astillich-igniti

💻
avesolovksyy

🐛
avishvat

🐛
avivmu

🐛 -
axelbarfod1

🐛 +
axelbarfod1

🐛
b-3-n

🐛
balbhadra9

🐛
base23de

🐛
bergander

🐛
berkam

💻 🐛
breizh31

🐛 -
caesarkim

🐛 +
caesarkim

🐛
carolyujing

🐛
cesares-basilico

🐛
chrite

🐛
cobratbq

🐛
coladict

🐛
cosmoJFH

🐛 -
cristalp

🐛 +
cristalp

🐛
crunsk

🐛
cwholmes

🐛
cyberjj999

🐛
cyw3

🐛
d1ss0nanz

🐛
danbrycefairsailcom

🐛 -
dariansanity

🐛 +
dariansanity

🐛
darrenmiliband

🐛
davidburstrom

🐛
dbirkman-paloalto

🐛
deepak-patra

🐛
dependabot[bot]

💻 🐛
dinesh150

🐛 -
diziaq

🐛 +
diziaq

🐛
dreaminpast123

🐛
duanyanan

🐛
dutt-sanjay

🐛
dylanleung

🐛
dzeigler

🐛
ekkirala

🐛 -
emersonmoura

🐛 +
emersonmoura

🐛
fairy

🐛
foxmason

🐛
frankegabor

🐛
frankl

🐛
freafrea

🐛
fsapatin

🐛 -
gracia19

🐛 +
gracia19

🐛
guo fei

🐛
gurmsc5

🐛
gwilymatgearset

💻 🐛
haigsn

🐛
hemanshu070

🐛
henrik242

🐛 -
hongpuwu

🐛 +
hongpuwu

🐛
hvbtup

💻 🐛
igniti GmbH

🐛
ilovezfs

🐛
itaigilo

🐛
jakivey32

🐛
jbennett2091

🐛 -
jcamerin

🐛 +
jcamerin

🐛
jkeener1

🐛
jmetertea

🐛
johnra2

💻
josemanuelrolon

💻 🐛
kabroxiko

💻 🐛
karwer

🐛 -
kaulonline

🐛 +
kaulonline

🐛
kdaemonv

🐛
kenji21

💻 🐛
kfranic

🐛
khalidkh

🐛
krzyk

🐛
lasselindqvist

🐛 -
lihuaib

🐛 +
lihuaib

🐛
lonelyma1021

🐛
lpeddy

🐛
lujiefsi

💻
lyriccoder

🐛
marcelmore

🐛
matchbox

🐛 -
matthiaskraaz

🐛 +
matthiaskraaz

🐛
meandonlyme

🐛
mikesive

🐛
milossesic

🐛
mriddell95

🐛
mrlzh

🐛
msloan

🐛 -
mucharlaravalika

🐛 +
mucharlaravalika

🐛
mvenneman

🐛
nareshl119

🐛
nicolas-harraudeau-sonarsource

🐛
noerremark

🐛
novsirion

🐛
oggboy

🐛 -
oinume

🐛 +
oinume

🐛
orimarko

💻 🐛
pallavi agarwal

🐛
parksungrin

🐛
patpatpat123

🐛
patriksevallius

🐛
pbrajesh1

🐛 -
phoenix384

🐛 +
phoenix384

🐛
piotrszymanski-sc

💻
plan3d

🐛
poojasix

🐛
prabhushrikant

🐛
pujitha8783

🐛
r-r-a-j

🐛 -
raghujayjunk

🐛 +
raghujayjunk

🐛
rajeshveera

🐛
rajeswarreddy88

🐛
recdevs

🐛
reudismam

💻 🐛
rijkt

🐛
rillig-tk

🐛 -
rmohan20

💻 🐛 +
rmohan20

💻 🐛
rxmicro

🐛
ryan-gustafson

💻 🐛
sabi0

🐛
scais

🐛
sebbASF

🐛
sergeygorbaty

💻 -
shilko2013

🐛 +
shilko2013

🐛
simeonKondr

🐛
snajberk

🐛
sniperrifle2004

🐛
snuyanzin

🐛 💻
sratz

🐛
stonio

🐛 -
sturton

💻 🐛 +
sturton

💻 🐛
sudharmohan

🐛
suruchidawar

🐛
svenfinitiv

🐛
tashiscool

🐛
test-git-hook

🐛
testation21

💻 🐛 -
thanosa

🐛 +
thanosa

🐛
tiandiyixian

🐛
tobwoerk

🐛
tprouvot

🐛
trentchilders

🐛
triandicAnt

🐛
trishul14

🐛 -
tsui

🐛 +
tsui

🐛
winhkey

🐛
witherspore

🐛
wjljack

🐛
wuchiuwong

🐛
xingsong

🐛
xioayuge

🐛 -
xnYi9wRezm

💻 🐛 +
xnYi9wRezm

💻 🐛
xuanuy

🐛
xyf0921

🐛
yalechen-cyw3

🐛
yasuharu-sato

🐛
zenglian

🐛
zgrzyt93

💻 🐛 -
zh3ng

🐛 +
zh3ng

🐛
zt_soft

🐛
ztt79

🐛
zzzzfeng

🐛 diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 03e17c841b..d481cf4fa4 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -57,6 +57,7 @@ This is a {{ site.pmd.release_type }} release. * [#3719](https://github.com/pmd/pmd/pull/3719): \[java] Upgrade log4j to 2.17.1 - [Daniel Paul Searles](https://github.com/squaresurf) * [#3720](https://github.com/pmd/pmd/pull/3720): \[java] New rule: FinalParameterInAbstractMethod - [Vincent Galloy](https://github.com/vgalloy) * [#3724](https://github.com/pmd/pmd/pull/3724): \[java] Fix for #3686 - fix FinalFieldCouldBeStatic - [Oleksii Dykov](https://github.com/dykov) +* [#3744](https://github.com/pmd/pmd/pull/3744): \[core] Updated SaxonXPathRuleQueryTest.java - [Vyom Yadav](https://github.com/Vyom-Yadav) {% endtocmaker %} diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/SaxonXPathRuleQueryTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/SaxonXPathRuleQueryTest.java index 7d78b75ea4..2583bf4d55 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/SaxonXPathRuleQueryTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/SaxonXPathRuleQueryTest.java @@ -237,7 +237,7 @@ public class SaxonXPathRuleQueryTest { return result; } - private static SaxonXPathRuleQuery createQuery(String xpath, PropertyDescriptor ...descriptors) { + private static SaxonXPathRuleQuery createQuery(String xpath, PropertyDescriptor... descriptors) { SaxonXPathRuleQuery query = new SaxonXPathRuleQuery(); query.setVersion(XPathRuleQuery.XPATH_2_0); if (descriptors != null) { diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/CpdExecutor.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/CpdExecutor.java index b7c25f023e..af4a465370 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/CpdExecutor.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/CpdExecutor.java @@ -25,7 +25,7 @@ public class CpdExecutor { // this is a helper class only } - private static ExecutionResult runCpdUnix(Path tempDir, String ... arguments) throws Exception { + private static ExecutionResult runCpdUnix(Path tempDir, String... arguments) throws Exception { String cmd = tempDir.resolve(PMD_BIN_PREFIX + PMDVersion.VERSION + "/bin/run.sh").toAbsolutePath().toString(); ProcessBuilder pb = new ProcessBuilder(cmd, "cpd"); pb.command().addAll(Arrays.asList(arguments)); @@ -37,7 +37,7 @@ public class CpdExecutor { return new ExecutionResult(result, output, null, null); } - private static ExecutionResult runCpdWindows(Path tempDir, String ... arguments) throws Exception { + private static ExecutionResult runCpdWindows(Path tempDir, String... arguments) throws Exception { String cmd = tempDir.resolve(PMD_BIN_PREFIX + PMDVersion.VERSION + "/bin/cpd.bat").toAbsolutePath().toString(); ProcessBuilder pb = new ProcessBuilder(cmd); pb.command().addAll(Arrays.asList(arguments)); @@ -56,7 +56,7 @@ public class CpdExecutor { * @return collected result of the execution * @throws Exception if the execution fails for any reason (executable not found, ...) */ - public static ExecutionResult runCpd(Path tempDir, String ... arguments) throws Exception { + public static ExecutionResult runCpd(Path tempDir, String... arguments) throws Exception { if (SystemUtils.IS_OS_WINDOWS) { return runCpdWindows(tempDir, arguments); } else { diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java index d25373ffab..78b0f040af 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java @@ -34,7 +34,7 @@ public class PMDExecutor { // this is a helper class only } - private static ExecutionResult runPMDUnix(Path tempDir, Path reportFile, String ... arguments) throws Exception { + private static ExecutionResult runPMDUnix(Path tempDir, Path reportFile, String... arguments) throws Exception { String cmd = tempDir.resolve(AbstractBinaryDistributionTest.PMD_BIN_PREFIX + PMDVersion.VERSION + "/bin/run.sh").toAbsolutePath().toString(); List args = new ArrayList<>(); args.add("pmd"); @@ -42,7 +42,7 @@ public class PMDExecutor { return runPMD(cmd, args, reportFile); } - private static ExecutionResult runPMDWindows(Path tempDir, Path reportFile, String ... arguments) throws Exception { + private static ExecutionResult runPMDWindows(Path tempDir, Path reportFile, String... arguments) throws Exception { String cmd = tempDir.resolve(AbstractBinaryDistributionTest.PMD_BIN_PREFIX + PMDVersion.VERSION + "/bin/pmd.bat").toAbsolutePath().toString(); return runPMD(cmd, Arrays.asList(arguments), reportFile); } @@ -123,7 +123,7 @@ public class PMDExecutor { * @return collected result of the execution * @throws Exception if the execution fails for any reason (executable not found, ...) */ - public static ExecutionResult runPMD(Path tempDir, String ... arguments) throws Exception { + public static ExecutionResult runPMD(Path tempDir, String... arguments) throws Exception { if (SystemUtils.IS_OS_WINDOWS) { return runPMDWindows(tempDir, null, arguments); } else { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementRule.java index 265c1dbd5f..0b744ca6f7 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementRule.java @@ -301,7 +301,7 @@ public class GuardLogStatementRule extends AbstractJavaRule implements Rule { * @return the found child node or null */ @SafeVarargs - private static N getFirstChild(Node root, Class ... childrenTypes) { + private static N getFirstChild(Node root, Class... childrenTypes) { Node current = root; for (Class clazz : childrenTypes) { Node child = current.getFirstChildOfType(clazz); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryCaseChangeRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryCaseChangeRule.java index 62512bedc8..af418a0390 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryCaseChangeRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryCaseChangeRule.java @@ -63,7 +63,7 @@ public class UnnecessaryCaseChangeRule extends AbstractJavaRule { return expr.getNumChildren() > pos; } - private boolean anyHasCaseChangingMethodCall(ASTPrimaryExpression ... exprs) { + private boolean anyHasCaseChangingMethodCall(ASTPrimaryExpression... exprs) { for (ASTPrimaryExpression expr : exprs) { if (expr != null && hasCaseChangingMethodCall(expr)) { return true; diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingRule.java index 1b4cd2fa6b..f83cf8aa50 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingRule.java @@ -218,7 +218,7 @@ public class InefficientStringBufferingRule extends AbstractJavaRule { // Note: The impl here is technically not correct: The type of a method call // chain is the result of the last method called, not the type of the // first receiver object (== PrimaryPrefix). - boolean isExactlyOfAnyType(Class clazz, Class ... clazzes) { + boolean isExactlyOfAnyType(Class clazz, Class... clazzes) { ASTPrimaryPrefix typeNode = getTypeNode(); if (TypeTestUtil.isExactlyA(clazz, typeNode)) { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/symboltable/AcceptanceTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/symboltable/AcceptanceTest.java index 0625cda190..67f7d189c5 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/symboltable/AcceptanceTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/symboltable/AcceptanceTest.java @@ -147,7 +147,7 @@ public class AcceptanceTest extends BaseNonParserTest { */ @Test public void testNullPointerEnumValueOfOverloaded() { - ASTCompilationUnit acu = parseCode("public enum EsmDcVoltageSensor {\n" + " A;\n" + " void bar(int ... args) {\n" + ASTCompilationUnit acu = parseCode("public enum EsmDcVoltageSensor {\n" + " A;\n" + " void bar(int... args) {\n" + " int idx;\n" + " int startIdx;\n" + " String name = EsmDcVoltageSensor.valueOf((byte) (idx - startIdx)).getName();\n" + " }\n" // that's the overloaded method diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.java index c542d56727..dd4fe5ee92 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.java +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.java @@ -43,7 +43,7 @@ public class Records { public void foo() { } } - public record VarRec(@Nullable @Deprecated String @Nullable ... x) {} + public record VarRec(@Nullable @Deprecated String @Nullable... x) {} public record ArrayRec(int[] x) {} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/jdk15_varargs.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/jdk15_varargs.java index bd8bd14090..0e5362221b 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/jdk15_varargs.java +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/jdk15_varargs.java @@ -1,3 +1,3 @@ public class Test { - void bar(Object ... args) {} + void bar(Object... args) {} } \ No newline at end of file diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/jdk9_anonymous_diamond.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/jdk9_anonymous_diamond.java index 722c104592..9d9d00c769 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/jdk9_anonymous_diamond.java +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/jdk9_anonymous_diamond.java @@ -2,7 +2,7 @@ import java.util.HashSet; import java.util.Set; public class Java9AnonymousDiamond { - public static void main(String ... args) { + public static void main(String... args) { Set set = new HashSet<>() { }; } } \ No newline at end of file diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/XmlCliTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/XmlCliTest.java index a3c0412a83..ee5722798b 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/XmlCliTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/XmlCliTest.java @@ -22,7 +22,7 @@ public class XmlCliTest extends BaseCLITest { private static final String BASE_DIR = "src/test/resources/net/sourceforge/pmd/lang/xml/cli-tests/sampleproject"; private static final String RULE_MESSAGE = "A tags are not allowed"; - private String[] createArgs(String directory, String ... args) { + private String[] createArgs(String directory, String... args) { List arguments = new ArrayList<>(); arguments.add("-f"); arguments.add("text");