From 55686dbef43bc0b87a48886b0fb9099eef674c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Wed, 17 Apr 2024 15:57:23 -0300 Subject: [PATCH 01/46] Rename JUnit4TestShouldUseBeforeAnnotation - Call it JUnitTestShouldUseBeforeAnnotation as it applies to JUnit 4 and 5. - Improve the doc to clarify it's intended use. --- .../main/resources/category/java/bestpractices.xml | 13 +++++++++---- ... => JUnitTestShouldUseBeforeAnnotationTest.java} | 2 +- .../xml/JUnit4TestShouldUseAfterAnnotation.xml | 2 +- ...n.xml => JUnitTestShouldUseBeforeAnnotation.xml} | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) rename pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/{JUnit4TestShouldUseBeforeAnnotationTest.java => JUnitTestShouldUseBeforeAnnotationTest.java} (88%) rename pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/{JUnit4TestShouldUseBeforeAnnotation.xml => JUnitTestShouldUseBeforeAnnotation.xml} (97%) diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml index 31fc4fea2e..20339ec32e 100644 --- a/pmd-java/src/main/resources/category/java/bestpractices.xml +++ b/pmd-java/src/main/resources/category/java/bestpractices.xml @@ -710,15 +710,20 @@ public class MyTest2 { - + + + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_bestpractices.html#junittestshouldusebeforeannotation"> -In JUnit 3, the setUp method was used to set up all data entities required in running tests. -JUnit 4 skips the setUp method and executes all methods annotated with @Before before all tests. +This rule detects methods called setUp() that are not properly annotated as a setup method. +This is primarily intended to assist in upgrading from JUnit 3, where setup methods were required to be called setUp(). +To a lesser extent, this may help detect omissions even under newer JUnit versions, as long as you are following this convention to name the methods. + +JUnit 4 will only execute methods annotated with @Before before all tests. JUnit 5 introduced @BeforeEach and @BeforeAll annotations to execute methods before each test or before all tests in the class, respectively. 3 diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseBeforeAnnotationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestShouldUseBeforeAnnotationTest.java similarity index 88% rename from pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseBeforeAnnotationTest.java rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestShouldUseBeforeAnnotationTest.java index 6922491f02..018d75b855 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseBeforeAnnotationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestShouldUseBeforeAnnotationTest.java @@ -9,7 +9,7 @@ import org.junit.Before; import net.sourceforge.pmd.test.PmdRuleTst; -class JUnit4TestShouldUseBeforeAnnotationTest extends PmdRuleTst { +class JUnitTestShouldUseBeforeAnnotationTest extends PmdRuleTst { // no additional unit tests public static class BaseTest { diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/JUnit4TestShouldUseAfterAnnotation.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/JUnit4TestShouldUseAfterAnnotation.xml index 69118826e1..36d346b528 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/JUnit4TestShouldUseAfterAnnotation.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/JUnit4TestShouldUseAfterAnnotation.xml @@ -136,7 +136,7 @@ public class Foo { [java] JUnit4TestShouldUseBeforeAnnotation false positive when overriding setUp #1592 0 [java] JUnit4TestShouldUseBeforeAnnotation false positive when overriding setUp #1592 0 Date: Wed, 17 Apr 2024 16:01:09 -0300 Subject: [PATCH 02/46] Rename JUnit4TestShouldUseAfterAnnotation - Call it JUnitTestShouldUseAfterAnnotation instead as it not only applies to JUnit4 - Improve the doc to further clarify it's usages --- .../main/resources/category/java/bestpractices.xml | 13 +++++++++---- ...a => JUnitTestShouldUseAfterAnnotationTest.java} | 2 +- ...on.xml => JUnitTestShouldUseAfterAnnotation.xml} | 0 3 files changed, 10 insertions(+), 5 deletions(-) rename pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/{JUnit4TestShouldUseAfterAnnotationTest.java => JUnitTestShouldUseAfterAnnotationTest.java} (88%) rename pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/{JUnit4TestShouldUseAfterAnnotation.xml => JUnitTestShouldUseAfterAnnotation.xml} (100%) diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml index 20339ec32e..150725b5cb 100644 --- a/pmd-java/src/main/resources/category/java/bestpractices.xml +++ b/pmd-java/src/main/resources/category/java/bestpractices.xml @@ -666,15 +666,20 @@ public class GoodTest { - + + + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_bestpractices.html#junittestshoulduseafterannotation"> -In JUnit 3, the tearDown method was used to clean up all data entities required in running tests. -JUnit 4 skips the tearDown method and executes all methods annotated with @After after running each test. +This rule detects methods called tearDown() that are not properly annotated as a setup method. +This is primarily intended to assist in upgrading from JUnit 3, where tear down methods were required to be called tearDown(). +To a lesser extent, this may help detect omissions under newer JUnit versions, as long as you are following this convention to name the methods. + +JUnit 4 will only execute methods annotated with @After after running each test. JUnit 5 introduced @AfterEach and @AfterAll annotations to execute methods after each test or after all tests in the class, respectively. 3 diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseAfterAnnotationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestShouldUseAfterAnnotationTest.java similarity index 88% rename from pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseAfterAnnotationTest.java rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestShouldUseAfterAnnotationTest.java index 2ea2b290d2..272d7d9d88 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseAfterAnnotationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestShouldUseAfterAnnotationTest.java @@ -9,7 +9,7 @@ import org.junit.Before; import net.sourceforge.pmd.test.PmdRuleTst; -class JUnit4TestShouldUseAfterAnnotationTest extends PmdRuleTst { +class JUnitTestShouldUseAfterAnnotationTest extends PmdRuleTst { // no additional unit tests public static class BaseTest { diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/JUnit4TestShouldUseAfterAnnotation.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/JUnitTestShouldUseAfterAnnotation.xml similarity index 100% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/JUnit4TestShouldUseAfterAnnotation.xml rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/JUnitTestShouldUseAfterAnnotation.xml From 5301a8e852c839f4608b9efa5dbcc40df7d0463c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Wed, 17 Apr 2024 16:15:06 -0300 Subject: [PATCH 03/46] Rename JUnitAssertionsShouldIncludeMessageRule - The rule is now called UnitTestAssertionsShouldIncludeMessageRule as it applies to JUnit and TestNG. - The doc is updated to reflect this. --- ...TestAssertionsShouldIncludeMessageRule.java} | 4 ++-- .../resources/category/java/bestpractices.xml | 17 +++++++++++------ ...TestAssertionsShouldIncludeMessageTest.java} | 2 +- ... UnitTestAssertionsShouldIncludeMessage.xml} | 0 4 files changed, 14 insertions(+), 9 deletions(-) rename pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/{JUnitAssertionsShouldIncludeMessageRule.java => UnitTestAssertionsShouldIncludeMessageRule.java} (90%) rename pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/{JUnitAssertionsShouldIncludeMessageTest.java => UnitTestAssertionsShouldIncludeMessageTest.java} (76%) rename pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/{JUnitAssertionsShouldIncludeMessage.xml => UnitTestAssertionsShouldIncludeMessage.xml} (100%) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitAssertionsShouldIncludeMessageRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestAssertionsShouldIncludeMessageRule.java similarity index 90% rename from pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitAssertionsShouldIncludeMessageRule.java rename to pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestAssertionsShouldIncludeMessageRule.java index 915415a0a3..78be7c765e 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitAssertionsShouldIncludeMessageRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestAssertionsShouldIncludeMessageRule.java @@ -10,7 +10,7 @@ import net.sourceforge.pmd.lang.java.rule.internal.TestFrameworksUtil; import net.sourceforge.pmd.lang.java.types.InvocationMatcher; import net.sourceforge.pmd.lang.java.types.InvocationMatcher.CompoundInvocationMatcher; -public class JUnitAssertionsShouldIncludeMessageRule extends AbstractJavaRulechainRule { +public class UnitTestAssertionsShouldIncludeMessageRule extends AbstractJavaRulechainRule { private final CompoundInvocationMatcher checks = InvocationMatcher.parseAll( @@ -28,7 +28,7 @@ public class JUnitAssertionsShouldIncludeMessageRule extends AbstractJavaRulecha "_#assertEquals(double,double,double)" ); - public JUnitAssertionsShouldIncludeMessageRule() { + public UnitTestAssertionsShouldIncludeMessageRule() { super(ASTMethodCall.class); } diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml index 150725b5cb..ce67924d9d 100644 --- a/pmd-java/src/main/resources/category/java/bestpractices.xml +++ b/pmd-java/src/main/resources/category/java/bestpractices.xml @@ -885,20 +885,25 @@ class MyTest { // not public, that's fine - + + + message="Unit test assertions should include a message" + class="net.sourceforge.pmd.lang.java.rule.bestpractices.UnitTestAssertionsShouldIncludeMessageRule" + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_bestpractices.html#unittestassertionsshouldincludemessage"> -JUnit assertions should include an informative message - i.e., use the three-argument version of +Unit assertions should include an informative message - i.e., use the three-argument version of assertEquals(), not the two-argument version. + +This rule supports tests using JUnit (3, 4 and 5) and TestNg. 3 Date: Wed, 17 Apr 2024 16:21:36 -0300 Subject: [PATCH 04/46] Rename JUnitTestContainsTooManyAssertsRule - The rule is now called UnitTestContainsTooManyAssertsRule as it checks for JUnit and TestNG. - This is further cleared up in the documentation. --- ...le.java => UnitTestContainsTooManyAssertsRule.java} | 4 ++-- .../src/main/resources/category/java/bestpractices.xml | 10 ++++++---- ...st.java => UnitTestContainsTooManyAssertsTest.java} | 2 +- ...yAsserts.xml => UnitTestContainsTooManyAsserts.xml} | 0 4 files changed, 9 insertions(+), 7 deletions(-) rename pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/{JUnitTestContainsTooManyAssertsRule.java => UnitTestContainsTooManyAssertsRule.java} (94%) rename pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/{JUnitTestContainsTooManyAssertsTest.java => UnitTestContainsTooManyAssertsTest.java} (78%) rename pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/{JUnitTestContainsTooManyAsserts.xml => UnitTestContainsTooManyAsserts.xml} (100%) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestContainsTooManyAssertsRule.java similarity index 94% rename from pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsRule.java rename to pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestContainsTooManyAssertsRule.java index e68ac3e9ac..42168a10b5 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestContainsTooManyAssertsRule.java @@ -16,7 +16,7 @@ import net.sourceforge.pmd.properties.NumericConstraints; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; -public class JUnitTestContainsTooManyAssertsRule extends AbstractJavaRulechainRule { +public class UnitTestContainsTooManyAssertsRule extends AbstractJavaRulechainRule { private static final PropertyDescriptor MAX_ASSERTS = PropertyFactory.intProperty("maximumAsserts") @@ -33,7 +33,7 @@ public class JUnitTestContainsTooManyAssertsRule extends AbstractJavaRulechainRu .build(); - public JUnitTestContainsTooManyAssertsRule() { + public UnitTestContainsTooManyAssertsRule() { super(ASTMethodDeclaration.class); definePropertyDescriptor(MAX_ASSERTS); definePropertyDescriptor(EXTRA_ASSERT_METHOD_NAMES); diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml index ce67924d9d..fb8fb1d58e 100644 --- a/pmd-java/src/main/resources/category/java/bestpractices.xml +++ b/pmd-java/src/main/resources/category/java/bestpractices.xml @@ -915,18 +915,20 @@ public class Foo { - + + + class="net.sourceforge.pmd.lang.java.rule.bestpractices.UnitTestContainsTooManyAssertsRule" + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_bestpractices.html#unittestcontainstoomanyasserts"> Unit tests should not contain too many asserts. Many asserts are indicative of a complex test, for which it is harder to verify correctness. Consider breaking the test scenario into multiple, shorter test scenarios. Customize the maximum number of assertions used by this Rule to suit your needs. -This rule checks for JUnit4, JUnit5 and TestNG Tests, as well as methods starting with "test". +This rule checks for JUnit (3, 4 and 5) and TestNG Tests. 3 diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestContainsTooManyAssertsTest.java similarity index 78% rename from pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsTest.java rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestContainsTooManyAssertsTest.java index 30404275d4..e0d7780c95 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestContainsTooManyAssertsTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; import net.sourceforge.pmd.test.PmdRuleTst; -class JUnitTestContainsTooManyAssertsTest extends PmdRuleTst { +class UnitTestContainsTooManyAssertsTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/JUnitTestContainsTooManyAsserts.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnitTestContainsTooManyAsserts.xml similarity index 100% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/JUnitTestContainsTooManyAsserts.xml rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnitTestContainsTooManyAsserts.xml From 9f1ab89d31e5f8936fe9c13b95c219b45031b012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Wed, 17 Apr 2024 16:25:03 -0300 Subject: [PATCH 05/46] Rename JUnitTestsShouldIncludeAssertRule - It's now called UnitTestsShouldIncludeAssertRule as it applies to JUnit and TestNG - The doc is updated to reflect this --- ... => UnitTestsShouldIncludeAssertRule.java} | 4 +-- .../resources/category/java/bestpractices.xml | 27 ++++++++++++------- ... => UnitTestsShouldIncludeAssertTest.java} | 2 +- ...t.xml => UnitTestsShouldIncludeAssert.xml} | 0 4 files changed, 20 insertions(+), 13 deletions(-) rename pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/{JUnitTestsShouldIncludeAssertRule.java => UnitTestsShouldIncludeAssertRule.java} (92%) rename pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/{JUnitTestsShouldIncludeAssertTest.java => UnitTestsShouldIncludeAssertTest.java} (78%) rename pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/{JUnitTestsShouldIncludeAssert.xml => UnitTestsShouldIncludeAssert.xml} (100%) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestsShouldIncludeAssertRule.java similarity index 92% rename from pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertRule.java rename to pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestsShouldIncludeAssertRule.java index b5bf29134b..867ae52504 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestsShouldIncludeAssertRule.java @@ -15,7 +15,7 @@ import net.sourceforge.pmd.lang.java.rule.internal.TestFrameworksUtil; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; -public class JUnitTestsShouldIncludeAssertRule extends AbstractJavaRulechainRule { +public class UnitTestsShouldIncludeAssertRule extends AbstractJavaRulechainRule { private static final PropertyDescriptor> EXTRA_ASSERT_METHOD_NAMES = PropertyFactory.stringProperty("extraAssertMethodNames") @@ -24,7 +24,7 @@ public class JUnitTestsShouldIncludeAssertRule extends AbstractJavaRulechainRule .emptyDefaultValue() .build(); - public JUnitTestsShouldIncludeAssertRule() { + public UnitTestsShouldIncludeAssertRule() { super(ASTMethodDeclaration.class); definePropertyDescriptor(EXTRA_ASSERT_METHOD_NAMES); } diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml index fb8fb1d58e..61489edcf9 100644 --- a/pmd-java/src/main/resources/category/java/bestpractices.xml +++ b/pmd-java/src/main/resources/category/java/bestpractices.xml @@ -933,14 +933,16 @@ This rule checks for JUnit (3, 4 and 5) and TestNG Tests. 3 - + + + message="Unit tests should include assert() or fail()" + class="net.sourceforge.pmd.lang.java.rule.bestpractices.UnitTestsShouldIncludeAssertRule" + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_bestpractices.html#unittestsshouldincludeassert"> -JUnit tests should include at least one assertion. This makes the tests more robust, and using assert +Unit tests should include at least one assertion. This makes the tests more robust, and using assert with messages provide the developer a clearer idea of what the test does. + +This rule checks for JUnit (3, 4 and 5) and TestNG Tests. 3 diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestsShouldIncludeAssertTest.java similarity index 78% rename from pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertTest.java rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestsShouldIncludeAssertTest.java index 933f3f612c..b76c92f615 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestsShouldIncludeAssertTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; import net.sourceforge.pmd.test.PmdRuleTst; -class JUnitTestsShouldIncludeAssertTest extends PmdRuleTst { +class UnitTestsShouldIncludeAssertTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/JUnitTestsShouldIncludeAssert.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnitTestsShouldIncludeAssert.xml similarity index 100% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/JUnitTestsShouldIncludeAssert.xml rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnitTestsShouldIncludeAssert.xml From 77258973733e164e5fb40579dc8d1b15b6f8a0c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Wed, 17 Apr 2024 16:33:26 -0300 Subject: [PATCH 06/46] Rename JUnit4TestShouldUseTestAnnotation - The rule is now called UnitTestShouldUseTestAnnotation as it applies to both JUnit and TestNG. - The doc is further improved to reflect this. --- .../main/resources/category/java/bestpractices.xml | 11 +++++++---- ....java => UnitTestShouldUseTestAnnotationTest.java} | 2 +- ...tation.xml => UnitTestShouldUseTestAnnotation.xml} | 0 3 files changed, 8 insertions(+), 5 deletions(-) rename pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/{JUnit4TestShouldUseTestAnnotationTest.java => UnitTestShouldUseTestAnnotationTest.java} (77%) rename pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/{JUnit4TestShouldUseTestAnnotation.xml => UnitTestShouldUseTestAnnotation.xml} (100%) diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml index 61489edcf9..24457e334d 100644 --- a/pmd-java/src/main/resources/category/java/bestpractices.xml +++ b/pmd-java/src/main/resources/category/java/bestpractices.xml @@ -765,14 +765,17 @@ public class MyTest2 { - + + + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_bestpractices.html#unittestshouldusetestannotation"> -In JUnit 3, the framework executed all methods which started with the word test as a unit test. +The rule will detect any test method starting with "test" that is not properly annotated, and will therefore not be run. + In JUnit 4, only methods annotated with the @Test annotation are executed. In JUnit 5, one of the following annotations should be used for tests: @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest. In TestNG, only methods annotated with the @Test annotation are executed. diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseTestAnnotationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestShouldUseTestAnnotationTest.java similarity index 77% rename from pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseTestAnnotationTest.java rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestShouldUseTestAnnotationTest.java index 15b507dafb..3f50bf341c 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseTestAnnotationTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestShouldUseTestAnnotationTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; import net.sourceforge.pmd.test.PmdRuleTst; -class JUnit4TestShouldUseTestAnnotationTest extends PmdRuleTst { +class UnitTestShouldUseTestAnnotationTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/JUnit4TestShouldUseTestAnnotation.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnitTestShouldUseTestAnnotation.xml similarity index 100% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/JUnit4TestShouldUseTestAnnotation.xml rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnitTestShouldUseTestAnnotation.xml From bd89f9185b636fa141b90b2ee3ae9d6bc04af4f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Wed, 17 Apr 2024 16:35:32 -0300 Subject: [PATCH 07/46] Typo --- pmd-java/src/main/resources/category/java/bestpractices.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml index 24457e334d..629f0d8a36 100644 --- a/pmd-java/src/main/resources/category/java/bestpractices.xml +++ b/pmd-java/src/main/resources/category/java/bestpractices.xml @@ -900,7 +900,7 @@ class MyTest { // not public, that's fine Unit assertions should include an informative message - i.e., use the three-argument version of assertEquals(), not the two-argument version. -This rule supports tests using JUnit (3, 4 and 5) and TestNg. +This rule supports tests using JUnit (3, 4 and 5) and TestNG. 3 From 61a74592474c811d6e1607a500f482667ad520bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Wed, 17 Apr 2024 17:00:05 -0300 Subject: [PATCH 08/46] Update changelog --- docs/pages/release_notes.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 2df014843f..59d5b924d0 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -16,7 +16,23 @@ This is a {{ site.pmd.release_type }} release. ### 🌟 Rule Changes -* {%rule java/bestpractices/JUnitTestsShouldIncludeAssert %} and {% rule java/bestpractices/JUnitTestContainsTooManyAsserts %} +Several rules for unit testing have been renamed to better reflect their actual scope. Lots of them were called after JUnit / JUnit 4, even when they applied to JUnit 5 and / or TestNG. + +* `java/bestpractices/JUnit4TestShouldUseAfterAnnotation` has been renamed to {% rule java/bestpractices/JUnitTestShouldUseAfterAnnotation %} + +* `java/bestpractices/JUnit4TestShouldUseBeforeAnnotation` has been renamed to {% rule java/bestpractices/JUnitTestShouldUseBeforeAnnotation %} + +* `java/bestpractices/JUnit4TestShouldUseTestAnnotation` has been renamed to {% rule java/bestpractices/UnitTestShouldUseTestAnnotation %} + +* `java/bestpractices/JUnitAssertionsShouldIncludeMessage` has been renamed to {% rule java/bestpractices/UnitTestAssertionsShouldIncludeMessage %} + +* `java/bestpractices/JUnitTestContainsTooManyAsserts` has been renamed to {% rule java/bestpractices/UnitTestContainsTooManyAsserts %} + +* `java/bestpractices/JUnitTestsShouldIncludeAssert` has been renamed to {% rule java/bestpractices/UnitTestsShouldIncludeAssert %} + +Additionaly: + +* {%rule java/bestpractices/UnitTestsShouldIncludeAssert %} and {% rule java/bestpractices/UnitTestContainsTooManyAsserts %} have a new property named `extraAssertMethodNames`. With this property, you can configure which additional static methods should be considered as valid verification methods. This allows to use custom mocking or assertion libraries. From 5b42381061440c94150b26a1c71ce3c8144415be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sat, 27 Apr 2024 22:11:39 -0300 Subject: [PATCH 09/46] Reintroduce old class names - Don't break API compatibility, and set everything for removal in PMD 8 --- .../JUnitAssertionsShouldIncludeMessageRule.java | 13 +++++++++++++ .../JUnitTestContainsTooManyAssertsRule.java | 13 +++++++++++++ .../JUnitTestsShouldIncludeAssertRule.java | 13 +++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitAssertionsShouldIncludeMessageRule.java create mode 100644 pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsRule.java create mode 100644 pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertRule.java diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitAssertionsShouldIncludeMessageRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitAssertionsShouldIncludeMessageRule.java new file mode 100644 index 0000000000..4da48f44b0 --- /dev/null +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitAssertionsShouldIncludeMessageRule.java @@ -0,0 +1,13 @@ +/** + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.rule.bestpractices; + +/** + * @deprecated The rule was renamed {@link UnitTestAssertionsShouldIncludeMessageRule} + */ +@Deprecated +public class JUnitAssertionsShouldIncludeMessageRule extends UnitTestAssertionsShouldIncludeMessageRule { + +} diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsRule.java new file mode 100644 index 0000000000..13b9d247e1 --- /dev/null +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsRule.java @@ -0,0 +1,13 @@ +/** + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.rule.bestpractices; + +/** + * @deprecated The rule was renamed {@link UnitTestContainsTooManyAssertsRule} + */ +@Deprecated +public class JUnitTestContainsTooManyAssertsRule extends UnitTestContainsTooManyAssertsRule { + +} diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertRule.java new file mode 100644 index 0000000000..ad20f3cca5 --- /dev/null +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertRule.java @@ -0,0 +1,13 @@ +/** + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.rule.bestpractices; + +/** + * @deprecated The rule was renamed {@link UnitTestsShouldIncludeAssertRule} + */ +@Deprecated +public class JUnitTestsShouldIncludeAssertRule extends UnitTestsShouldIncludeAssertRule { + +} From 68820a4c775246f7cc6a080ebbadfa632683fb80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Tue, 3 Sep 2024 11:34:31 +0200 Subject: [PATCH 10/46] Fix #5046 - FPs in LocalVariableCouldBeFinal This adds FNs to UnusedAssignment --- .../lang/java/rule/internal/DataflowPass.java | 11 ++++++- .../lang/java/rule/AllDataflowRuleTests.java | 32 +++++++++++++++++++ .../bestpractices/UnusedAssignmentTest.java | 2 +- .../LocalVariableCouldBeFinalTest.java | 2 +- ...AvoidThrowingNullPointerExceptionTest.java | 2 +- .../java/rule/design/ImmutableFieldTest.java | 2 +- .../java/rule/design/LawOfDemeterTest.java | 2 +- .../java/rule/design/SingularFieldTest.java | 2 +- .../ImplicitSwitchFallThroughTest.java | 2 +- .../InvalidLogMessageFormatTest.java | 2 +- .../bestpractices/xml/UnusedAssignment.xml | 21 ++++++------ .../xml/LocalVariableCouldBeFinal.xml | 20 ++++++++++++ 12 files changed, 82 insertions(+), 18 deletions(-) create mode 100644 pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/AllDataflowRuleTests.java diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPass.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPass.java index c16c1a34ed..183cd71fd0 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPass.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPass.java @@ -636,7 +636,16 @@ public final class DataflowPass { SpanInfo exceptionalState = null; int i = 0; for (ASTCatchClause catchClause : node.getCatchClauses()) { - SpanInfo current = acceptOpt(catchClause, catchSpans.get(i)); + /* + Note: here we absorb the end state of the body, which is not necessary. + We do that to conform to the language's definition of "effective-finality", + which is more conservative than needed. Doing this fixes FPs in LocalVariableCouldBeFinal + at the cost of some FNs in UnusedAssignment. + */ + SpanInfo catchSpan = catchSpans.get(i); + catchSpan.absorb(bodyState); + + SpanInfo current = acceptOpt(catchClause, catchSpan); exceptionalState = current.absorb(exceptionalState); i++; } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/AllDataflowRuleTests.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/AllDataflowRuleTests.java new file mode 100644 index 0000000000..a0e8159ddc --- /dev/null +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/AllDataflowRuleTests.java @@ -0,0 +1,32 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.rule; + + +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.Suite; + +import net.sourceforge.pmd.lang.java.rule.bestpractices.UnusedAssignmentTest; +import net.sourceforge.pmd.lang.java.rule.codestyle.LocalVariableCouldBeFinalTest; +import net.sourceforge.pmd.lang.java.rule.design.AvoidThrowingNullPointerExceptionTest; +import net.sourceforge.pmd.lang.java.rule.design.ImmutableFieldTest; +import net.sourceforge.pmd.lang.java.rule.design.LawOfDemeterTest; +import net.sourceforge.pmd.lang.java.rule.design.SingularFieldTest; +import net.sourceforge.pmd.lang.java.rule.errorprone.ImplicitSwitchFallThroughTest; +import net.sourceforge.pmd.lang.java.rule.errorprone.InvalidLogMessageFormatTest; + +@Suite +@SelectClasses({ + LocalVariableCouldBeFinalTest.class, + ImmutableFieldTest.class, + UnusedAssignmentTest.class, + LawOfDemeterTest.class, + SingularFieldTest.class, + ImplicitSwitchFallThroughTest.class, + InvalidLogMessageFormatTest.class, + AvoidThrowingNullPointerExceptionTest.class +}) +public class AllDataflowRuleTests { +} diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentTest.java index 0401dd83ec..61f8a16b77 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; import net.sourceforge.pmd.test.PmdRuleTst; -class UnusedAssignmentTest extends PmdRuleTst { +public class UnusedAssignmentTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalTest.java index 5c49860210..d87bf490ac 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; import net.sourceforge.pmd.test.PmdRuleTst; -class LocalVariableCouldBeFinalTest extends PmdRuleTst { +public class LocalVariableCouldBeFinalTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNullPointerExceptionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNullPointerExceptionTest.java index c1b437ab41..e729824a6d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNullPointerExceptionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNullPointerExceptionTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.design; import net.sourceforge.pmd.test.PmdRuleTst; -class AvoidThrowingNullPointerExceptionTest extends PmdRuleTst { +public class AvoidThrowingNullPointerExceptionTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ImmutableFieldTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ImmutableFieldTest.java index eb0972d72b..7c614b7dcd 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ImmutableFieldTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ImmutableFieldTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.design; import net.sourceforge.pmd.test.PmdRuleTst; -class ImmutableFieldTest extends PmdRuleTst { +public class ImmutableFieldTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterTest.java index b4e94a6e26..88e54418ac 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.design; import net.sourceforge.pmd.test.PmdRuleTst; -class LawOfDemeterTest extends PmdRuleTst { +public class LawOfDemeterTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldTest.java index 81835c7c5b..b550b06f85 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.design; import net.sourceforge.pmd.test.PmdRuleTst; -class SingularFieldTest extends PmdRuleTst { +public class SingularFieldTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughTest.java index 3a14a27009..71f0e03495 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; import net.sourceforge.pmd.test.PmdRuleTst; -class ImplicitSwitchFallThroughTest extends PmdRuleTst { +public class ImplicitSwitchFallThroughTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InvalidLogMessageFormatTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InvalidLogMessageFormatTest.java index 933231b1bc..091595c70e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InvalidLogMessageFormatTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InvalidLogMessageFormatTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; import net.sourceforge.pmd.test.PmdRuleTst; -class InvalidLogMessageFormatTest extends PmdRuleTst { +public class InvalidLogMessageFormatTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnusedAssignment.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnusedAssignment.xml index 0d36b80ef7..5893fc117f 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnusedAssignment.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnusedAssignment.xml @@ -1199,11 +1199,12 @@ public class Foo { Definitions in try block reach catch blocks through method calls - 2 - 4,7 + 1 + 4 The initializer for variable 'halfway' is never used (overwritten on line 7) - The value assigned to variable 'halfway' is never used + + Definitions in try block reach catch blocks through method calls 3 - 1 - 8 - - The value assigned to variable 'halfway' is never used - + + 0 + + + + + 5,7,9 The initializer for variable 'a' is never used (overwritten on lines 7, 9 and 11) - The value assigned to variable 'a' is never used (overwritten on line 11) + The value assigned to variable 'a' is never used (overwritten on lines 9 and 11) The value assigned to variable 'a' is never used (overwritten on line 11) + + + [java] LocalVariableCouldBeFinal false positive with try/catch #5046 + 0 + createFileWatcher() { + Optional optionalFileWatcher; // false positive in PMD 7.2.0, cannot be final + try { + optionalFileWatcher = Optional.of(new FileWatcher()); + } catch (final IOException e) { + optionalFileWatcher = Optional.empty(); + } + return optionalFileWatcher; + } + } ]]> From 91f17838d4296ca47f4e52eb21b7a722efca7825 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 13 Sep 2024 09:59:51 +0200 Subject: [PATCH 11/46] Change branch master to main - Update documentation - Update release scripts - Update rule doc generation GitHub Action is only triggered from "main" branch now. --- .ci/README.md | 6 +- .ci/build.sh | 8 +-- .ci/inc/fetch_ci_scripts.bash | 2 +- .github/workflows/build.yml | 1 - .github/workflows/git-repo-sync.yml | 1 - CONTRIBUTING.md | 12 ++-- Dangerfile | 6 +- Gemfile | 2 +- README.md | 4 +- do-release.sh | 2 +- docs/_config.yml | 2 +- docs/_data/sidebars/pmd_sidebar.yml | 2 +- docs/pages/pmd/about/release_policies.md | 4 +- docs/pages/pmd/devdocs/development.md | 4 +- .../adding_a_new_antlr_based_language.md | 58 +++++++++---------- .../adding_new_cpd_language.md | 10 ++-- docs/pages/pmd/devdocs/pmdtester.md | 4 +- .../pmd/devdocs/writing_documentation.md | 4 +- docs/pages/pmd/languages/java.md | 2 +- .../committers/main_landing_page.md | 12 ++-- .../committers/merging_pull_requests.md | 36 ++++++------ .../pmd/projectdocs/committers/releasing.md | 12 ++-- .../pmd/userdocs/cpd/cpd_report_formats.md | 4 +- .../userdocs/extending/defining_properties.md | 2 +- docs/pages/pmd/userdocs/extending/testing.md | 2 +- docs/pages/pmd/userdocs/pmd_report_formats.md | 8 +-- docs/pages/pmd/userdocs/tools/tools.md | 6 +- docs/pages/release_notes.md | 24 ++++++++ docs/pages/release_notes_old.md | 2 +- docs/report-examples/pmd-report-html.html | 10 ++-- .../pmd-report-summaryhtml.html | 10 ++-- .../rule/internal/RuleSetReferenceId.java | 4 +- .../rule/internal/RuleSetReferenceIdTest.java | 4 +- .../pmd/renderers/HTMLRendererTest.java | 6 +- .../pmd/doc/internal/DeadLinksChecker.java | 2 +- .../pmd/doc/internal/RuleDocGenerator.java | 2 +- pmd-doc/src/test/resources/expected/sample.md | 2 +- 37 files changed, 152 insertions(+), 130 deletions(-) diff --git a/.ci/README.md b/.ci/README.md index 6286fd14b4..b2ce6f60b8 100644 --- a/.ci/README.md +++ b/.ci/README.md @@ -45,12 +45,12 @@ Start docker without binding to local directory, so that we can do a fresh check ``` export LANG=en_US.UTF-8 -export PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts +export PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/main/scripts export PMD_CI_SECRET_PASSPHRASE="xyz" export PMD_CI_DEBUG=true -MAIN_BRANCH="master" +MAIN_BRANCH="main" eval $(~/create-gh-actions-env.sh push pmd/pmd $MAIN_BRANCH) cd /workspaces/pmd @@ -108,7 +108,7 @@ $(~/create-gh-actions-env.sh push adangel/pmd $MAIN_BRANCH) ``` export LANG=en_US.UTF-8 -export PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts +export PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/main/scripts export PMD_CI_SECRET_PASSPHRASE="xyz" export PMD_CI_DEBUG=true diff --git a/.ci/build.sh b/.ci/build.sh index 4e843d4311..cd5200588a 100755 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -280,9 +280,9 @@ function pmd_ci_deploy_build_artifacts() { # Renders release notes and uploads them as ReadMe.md to sourceforge # function pmd_ci_build_and_upload_doc() { - # generate the site only for snapshots from master and for release builds for case a) (everything without cli/dist) + # generate the site only for snapshots from main and for release builds for case a) (everything without cli/dist) # to avoid building it twice during a release... - if pmd_ci_maven_isSnapshotBuild && [ "${PMD_CI_BRANCH}" = "master" ] || [ "${BUILD_CLI_DIST_ONLY}" = "false" ]; then + if pmd_ci_maven_isSnapshotBuild && [ "${PMD_CI_BRANCH}" = "main" ] || [ "${BUILD_CLI_DIST_ONLY}" = "false" ]; then pmd_doc_generate_jekyll_site pmd_doc_create_archive @@ -312,8 +312,8 @@ function pmd_ci_build_and_upload_doc() { pmd_ci_sourceforge_uploadReleaseNotes "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "${rendered_release_notes}" fi - if pmd_ci_maven_isSnapshotBuild && [ "${PMD_CI_BRANCH}" = "master" ]; then - # only for snapshot builds from branch master: https://docs.pmd-code.org/snapshot -> pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION} + if pmd_ci_maven_isSnapshotBuild && [ "${PMD_CI_BRANCH}" = "main" ]; then + # only for snapshot builds from branch main: https://docs.pmd-code.org/snapshot -> pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION} pmd_code_createSymlink "${PMD_CI_MAVEN_PROJECT_VERSION}" "snapshot" # update github pages https://pmd.github.io/pmd/ diff --git a/.ci/inc/fetch_ci_scripts.bash b/.ci/inc/fetch_ci_scripts.bash index d608e40531..835fe6782e 100644 --- a/.ci/inc/fetch_ci_scripts.bash +++ b/.ci/inc/fetch_ci_scripts.bash @@ -4,7 +4,7 @@ function fetch_ci_scripts() { local inc_dir local inc_url inc_dir="$(dirname "$0")/inc" - inc_url="${PMD_CI_SCRIPTS_URL:-https://raw.githubusercontent.com/pmd/build-tools/master/scripts}/inc" + inc_url="${PMD_CI_SCRIPTS_URL:-https://raw.githubusercontent.com/pmd/build-tools/main/scripts}/inc" mkdir -p "${inc_dir}" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f4bc12a42..d664bbbe3e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - master tags: - '**' pull_request: diff --git a/.github/workflows/git-repo-sync.yml b/.github/workflows/git-repo-sync.yml index e4413efb3f..fe2c156ce0 100644 --- a/.github/workflows/git-repo-sync.yml +++ b/.github/workflows/git-repo-sync.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - master tags: - '**' workflow_dispatch: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b4fe5f9d27..1622cb421f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,12 +7,12 @@ By participating in this project you agree to abide by its terms. You can find the code of conduct in the file [code_of_conduct.md](code_of_conduct.md). -| NB: the rule designer is developed over at [pmd/pmd-designer](https://github.com/pmd/pmd-designer). Please refer to the specific [contributor documentation](https://github.com/pmd/pmd-designer/blob/master/CONTRIBUTING.md) if your issue, feature request or PR touches the designer. | -| --- | +| NB: the rule designer is developed over at [pmd/pmd-designer](https://github.com/pmd/pmd-designer). Please refer to the specific [contributor documentation](https://github.com/pmd/pmd-designer/blob/main/CONTRIBUTING.md) if your issue, feature request or PR touches the designer. | +|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ## Pull requests -* Please create your pull request against the `master` branch. We will rebase/merge it to the maintenance +* Please create your pull request against the `main` branch. We will rebase/merge it to the maintenance branches, if necessary. * We are using [checkstyle](http://checkstyle.sourceforge.net/) to enforce a common code style. @@ -36,7 +36,7 @@ When filing a bug report, please provide as much information as possible, so tha There is some documentation available under . Feel free to create a bug report if documentation is missing, incomplete or outdated. See [Bug reports](#bug-reports). -The documentation is generated as a Jekyll site, the source is available at: . You can find build instructions there. +The documentation is generated as a Jekyll site, the source is available at: . You can find build instructions there. For more on contributing documentation check ## Questions @@ -53,8 +53,8 @@ There are various channels, on which you can ask questions: PMD uses [checkstyle](http://checkstyle.sourceforge.net/) to enforce a common code style. -See [pmd-checkstyle-config.xml](https://github.com/pmd/build-tools/blob/master/src/main/resources/net/sourceforge/pmd/pmd-checkstyle-config.xml) for the configuration and -[the eclipse configuration files](https://github.com/pmd/build-tools/tree/master/eclipse) that can +See [pmd-checkstyle-config.xml](https://github.com/pmd/build-tools/blob/main/src/main/resources/net/sourceforge/pmd/pmd-checkstyle-config.xml) for the configuration and +[the eclipse configuration files](https://github.com/pmd/build-tools/tree/main/eclipse) that can be imported into a fresh workspace. ## Add yourself as contributor diff --git a/Dangerfile b/Dangerfile index 97e38cf3c3..dea08b6960 100644 --- a/Dangerfile +++ b/Dangerfile @@ -39,9 +39,9 @@ def run_pmdtester FileUtils.mv 'target/reports/diff', 'target/diff1' message1 = create_message - # run against master branch (if the PR is not already against master) - unless ENV['PMD_CI_BRANCH'] == 'master' - @base_branch = 'master' + # run against main branch (if the PR is not already against main) + unless ENV['PMD_CI_BRANCH'] == 'main' + @base_branch = 'main' @logger.info "\n\n--------------------------------------" @logger.info "Run against #{@base_branch}" @summary = PmdTester::Runner.new(get_args(@base_branch, false, 'target/diff1/patch_config.xml')).run diff --git a/Gemfile b/Gemfile index 441384af04..6fccc49416 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org/' # bleeding edge from git -#gem 'pmdtester', :git => 'https://github.com/pmd/pmd-regression-tester.git', branch: 'master' +#gem 'pmdtester', :git => 'https://github.com/pmd/pmd-regression-tester.git', branch: 'main' gem 'pmdtester' gem 'danger' diff --git a/README.md b/README.md index a08c66d76c..0502c07ec1 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # PMD - source code analyzer -![PMD Logo](https://raw.githubusercontent.com/pmd/pmd/pmd/7.0.x/docs/images/logo/pmd-logo-300px.png) +![PMD Logo](https://raw.githubusercontent.com/pmd/pmd/pmd/main/docs/images/logo/pmd-logo-300px.png) [![Join the chat](https://img.shields.io/gitter/room/pmd/pmd)](https://app.gitter.im/#/room/#pmd_pmd:gitter.im?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![Build Status](https://github.com/pmd/pmd/workflows/build/badge.svg?branch=master)](https://github.com/pmd/pmd/actions) +[![Build Status](https://github.com/pmd/pmd/workflows/build/badge.svg?branch=main)](https://github.com/pmd/pmd/actions) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.sourceforge.pmd/pmd/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.sourceforge.pmd/pmd) [![Reproducible Builds](https://img.shields.io/badge/Reproducible_Builds-ok-green?labelColor=blue)](https://github.com/jvm-repo-rebuild/reproducible-central/tree/master/content/net/sourceforge/pmd#readme) [![Coverage Status](https://coveralls.io/repos/github/pmd/pmd/badge.svg)](https://coveralls.io/github/pmd/pmd) diff --git a/do-release.sh b/do-release.sh index 64435f8622..3440db6fc5 100755 --- a/do-release.sh +++ b/do-release.sh @@ -311,7 +311,7 @@ echo " " +echo "" echo echo "Press enter to continue when pmd-designer is available in maven-central..." echo "." diff --git a/docs/_config.yml b/docs/_config.yml index 372d019c17..4213ed8b41 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -21,7 +21,7 @@ site_title: PMD Source Code Analyzer company_name: PMD Open Source Project # this appears in the footer -github_editme_path: pmd/pmd/blob/master/docs/ +github_editme_path: pmd/pmd/blob/main/docs/ # if you're using Github, provide the basepath to the branch you've created for reviews, following the sample here. if not, leave this value blank. host: 127.0.0.1 diff --git a/docs/_data/sidebars/pmd_sidebar.yml b/docs/_data/sidebars/pmd_sidebar.yml index 148ef1624f..babf53daf7 100644 --- a/docs/_data/sidebars/pmd_sidebar.yml +++ b/docs/_data/sidebars/pmd_sidebar.yml @@ -524,7 +524,7 @@ entries: url: /pmd_devdocs_building.html output: web, pdf - title: Contributing - external_url: https://github.com/pmd/pmd/blob/master/CONTRIBUTING.md + external_url: https://github.com/pmd/pmd/blob/main/CONTRIBUTING.md output: web, pdf - title: Writing documentation url: /pmd_devdocs_writing_documentation.html diff --git a/docs/pages/pmd/about/release_policies.md b/docs/pages/pmd/about/release_policies.md index f7a8fc9aea..21e4d2c2e3 100644 --- a/docs/pages/pmd/about/release_policies.md +++ b/docs/pages/pmd/about/release_policies.md @@ -45,9 +45,9 @@ See also ## Git branches/tags policy -* Main development happens on the main branch (currently called `master`). +* Main development happens on the main branch (currently called `main`). * PR and enhancements are done on the main branch. -* Release are usually done directly from the main branch, we don't create release branches. +* Releases are usually done directly from the main branch, we don't create release branches. * Each release has its own tag named `pmd_releases/MAJOR.MINOR.PATCH`. * In case of a patch release, we either do it from the main branch (if there was no development ongoing) or create a separate branch off the last release tag. diff --git a/docs/pages/pmd/devdocs/development.md b/docs/pages/pmd/devdocs/development.md index ad4871fc73..46a850ef47 100644 --- a/docs/pages/pmd/devdocs/development.md +++ b/docs/pages/pmd/devdocs/development.md @@ -36,5 +36,5 @@ The latest release documentation is always available under [docs.pmd-code.org/la First off, thanks for taking the time to contribute! -Please have a look at [CONTRIBUTING.md](https://github.com/pmd/pmd/blob/master/CONTRIBUTING.md) and -[BUILDING.md](https://github.com/pmd/pmd/blob/master/BUILDING.md). +Please have a look at [CONTRIBUTING.md](https://github.com/pmd/pmd/blob/main/CONTRIBUTING.md) and +[BUILDING.md](https://github.com/pmd/pmd/blob/main/BUILDING.md). diff --git a/docs/pages/pmd/devdocs/major_contributions/adding_a_new_antlr_based_language.md b/docs/pages/pmd/devdocs/major_contributions/adding_a_new_antlr_based_language.md index 46ab65c523..e1427c93a3 100644 --- a/docs/pages/pmd/devdocs/major_contributions/adding_a_new_antlr_based_language.md +++ b/docs/pages/pmd/devdocs/major_contributions/adding_a_new_antlr_based_language.md @@ -64,7 +64,7 @@ definitely don't come for free. It is much effort and requires perseverance to i ### 2. Implement an AST parser for your language * ANTLR will generate the parser for you based on the grammar file. The grammar file needs to be placed in the folder `src/main/antlr4` in the appropriate sub package `ast` of the language. E.g. for swift, the grammar - file is [Swift.g4](https://github.com/pmd/pmd/blob/master/pmd-swift/src/main/antlr4/net/sourceforge/pmd/lang/swift/ast/Swift.g4) + file is [Swift.g4](https://github.com/pmd/pmd/blob/main/pmd-swift/src/main/antlr4/net/sourceforge/pmd/lang/swift/ast/Swift.g4) and is placed in the package `net.sourceforge.pmd.lang.swift.ast`. * Configure the options "superClass" and "contextSuperClass". These are the base classes for the generated classes. @@ -72,39 +72,39 @@ definitely don't come for free. It is much effort and requires perseverance to i ### 3. Create AST node classes * The individual AST nodes are generated, but you need to define the common interface for them. * You need to define the supertype interface for all nodes of the language. For that, we provide - [`AntlrNode`](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrNode.java). -* See [`SwiftNode`](https://github.com/pmd/pmd/blob/master/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftNode.java) + [`AntlrNode`](https://github.com/pmd/pmd/blob/main/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrNode.java). +* See [`SwiftNode`](https://github.com/pmd/pmd/blob/main/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftNode.java) as an example. * Additionally, you need several base classes: * a language specific inner node - these nodes represent the production rules from the grammar. In Antlr, they are called "ParserRuleContext". We call them "InnerNode". Use the base class from pmd-core - [`BaseAntlrInnerNode`](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/BaseAntlrInnerNode.java) - . And example is [`SwiftInnerNode`](https://github.com/pmd/pmd/blob/master/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftInnerNode.java). + [`BaseAntlrInnerNode`](https://github.com/pmd/pmd/blob/main/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/BaseAntlrInnerNode.java) + . And example is [`SwiftInnerNode`](https://github.com/pmd/pmd/blob/main/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftInnerNode.java). Note that this language specific inner node is package-private, as it is only the base class for the concrete nodes generated by ANLTR. * a language specific root node - this provides the root of the AST and our parser will return subtypes of this node. The root node itself is a "InnerNode". - See [`SwiftRootNode`](https://github.com/pmd/pmd/blob/master/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftRootNode.java). + See [`SwiftRootNode`](https://github.com/pmd/pmd/blob/main/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftRootNode.java). Note that this language specific root node is package-private, as it is only the base class for the concrete node generated by ANLTR. * a language specific terminal node. - See [`SwiftTerminalNode`](https://github.com/pmd/pmd/blob/master/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftTerminalNode.java). + See [`SwiftTerminalNode`](https://github.com/pmd/pmd/blob/main/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftTerminalNode.java). * a language specific error node. - See [`SwiftErrorNode`](https://github.com/pmd/pmd/blob/master/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftErrorNode.java). + See [`SwiftErrorNode`](https://github.com/pmd/pmd/blob/main/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftErrorNode.java). * a language name dictionary. This is used to convert ANTLR node names to useful XPath node names. - See [`SwiftNameDictionary'](https://github.com/pmd/pmd/blob/master/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftNameDictionary.java). + See [`SwiftNameDictionary'](https://github.com/pmd/pmd/blob/main/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftNameDictionary.java). * Once these base classes exist, you need to change the ANTLR grammar to add additional members via `@parser::members` * Define a package private field `DICO` which creates a new instance of your language name dictionary using the vocabulary from the generated parser (`VOCABULARY`). * Define two additional methods to help converting the ANTLR context objects into PMD AST nodes. - The methods are abstract in [`AntlrGeneratedParserBase`](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrGeneratedParserBase.java) + The methods are abstract in [`AntlrGeneratedParserBase`](https://github.com/pmd/pmd/blob/main/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrGeneratedParserBase.java) and need to be implemented here for the concrete language: `createPmdTerminal()` and `createPmdError()`. * In order for the generated code to match and use our custom classes, we have a common ant script, that fiddles with - the generated code. The ant script is [`antlr4-wrapper.xml`](https://github.com/pmd/pmd/blob/master/antlr4-wrapper.xml) + the generated code. The ant script is [`antlr4-wrapper.xml`](https://github.com/pmd/pmd/blob/main/antlr4-wrapper.xml) and does not need to be adjusted - it has plenty of parameters that can be configured. The ant script is added in the language module's `pom.xml` where the parameters are set (e.g. name of root name - class). Have a look at Swift's example: [`pmd-swift/pom.xml`](https://github.com/pmd/pmd/blob/master/pmd-swift/pom.xml). + class). Have a look at Swift's example: [`pmd-swift/pom.xml`](https://github.com/pmd/pmd/blob/main/pmd-swift/pom.xml). * You can add additional methods in your "InnerNode" (e.g. `SwiftInnerNode`) that are available on all nodes. But on most cases you won't need to do anything. @@ -115,31 +115,31 @@ definitely don't come for free. It is much effort and requires perseverance to i have the parser generated. * The generated code will be placed under `target/generated-sources/antlr4` and will not be committed to source control. -* You should review [`pmd-swift/pom.xml`](https://github.com/pmd/pmd/blob/master/pmd-swift/pom.xml). +* You should review [`pmd-swift/pom.xml`](https://github.com/pmd/pmd/blob/main/pmd-swift/pom.xml). ### 5. Create a TokenManager * This is needed to support CPD (copy paste detection) -* We provide a default implementation using [`AntlrTokenManager`](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrTokenManager.java). +* We provide a default implementation using [`AntlrTokenManager`](https://github.com/pmd/pmd/blob/main/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrTokenManager.java). * You must create your own "AntlrCpdLexer" such as we do with - [`SwiftCpdLexer`](https://github.com/pmd/pmd/blob/master/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/cpd/SwiftCpdLexer.java). + [`SwiftCpdLexer`](https://github.com/pmd/pmd/blob/main/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/cpd/SwiftCpdLexer.java). * If you wish to filter specific tokens (e.g. comments to support CPD suppression via "CPD-OFF" and "CPD-ON") you can create your own implementation of - [`AntlrTokenFilter`](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/cpd/impl/AntlrTokenFilter.java). + [`AntlrTokenFilter`](https://github.com/pmd/pmd/blob/main/pmd-core/src/main/java/net/sourceforge/pmd/cpd/impl/AntlrTokenFilter.java). You'll need to override then the protected method `getTokenFilter(AntlrTokenManager)` and return your custom filter. See the CpdLexer for C# as an exmaple: - [`CsCpdLexer`](https://github.com/pmd/pmd/blob/master/pmd-cs/src/main/java/net/sourceforge/pmd/lang/cs/cpd/CsCpdLexer.java). + [`CsCpdLexer`](https://github.com/pmd/pmd/blob/main/pmd-cs/src/main/java/net/sourceforge/pmd/lang/cs/cpd/CsCpdLexer.java). If you don't need a custom token filter, you don't need to override the method. It returns the default `AntlrTokenFilter` which doesn't filter anything. ### 6. Create a PMD parser “adapter” * Create your own parser, that adapts the ANLTR interface to PMD's parser interface. -* We provide a [`AntlrBaseParser`](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrBaseParser.java) +* We provide a [`AntlrBaseParser`](https://github.com/pmd/pmd/blob/main/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrBaseParser.java) implementation that you need to extend to create your own adapter as we do with - [`PmdSwiftParser`](https://github.com/pmd/pmd/blob/master/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/PmdSwiftParser.java). + [`PmdSwiftParser`](https://github.com/pmd/pmd/blob/main/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/PmdSwiftParser.java). ### 7. Create a language version handler -* Now you need to create your version handler, as we did with [`SwiftHandler`](https://github.com/pmd/pmd/blob/master/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftHandler.java). +* Now you need to create your version handler, as we did with [`SwiftHandler`](https://github.com/pmd/pmd/blob/main/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftHandler.java). * This class is sort of a gateway between PMD and all parsing logic specific to your language. * For a minimal implementation, it just needs to return a parser *(see step #6)*. * It can be used to provide other features for your language like @@ -154,15 +154,15 @@ definitely don't come for free. It is much effort and requires perseverance to i * A parser visitor adapter is not needed anymore with PMD 7. The visitor interface now provides a default implementation. * The visitor for ANTLR based AST is generated along the parser from the ANTLR grammar file. The - base interface for a visitor is [`AstVisitor`](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AstVisitor.java). + base interface for a visitor is [`AstVisitor`](https://github.com/pmd/pmd/blob/main/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AstVisitor.java). * The generated visitor class for Swift is called `SwiftVisitor`. * In order to help use this visitor later on, a base visitor class should be created. - See [`SwiftVisitorBase`](https://github.com/pmd/pmd/blob/master/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftVisitorBase.java) + See [`SwiftVisitorBase`](https://github.com/pmd/pmd/blob/main/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftVisitorBase.java) as an example. ### 9. Make PMD recognize your language * Create your own subclass of `net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase`, see Swift as an example: - [`SwiftLanguageModule`](https://github.com/pmd/pmd/blob/master/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftLanguageModule.java). + [`SwiftLanguageModule`](https://github.com/pmd/pmd/blob/main/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftLanguageModule.java). * Add for each version of your language a call to `addVersion` in your language module’s constructor. Use `addDefaultVersion` for defining the default version. * You’ll need to refer the language version handler created in step #7. @@ -172,9 +172,9 @@ definitely don't come for free. It is much effort and requires perseverance to i ### 10. Create an abstract rule class for the language * You need to create your own abstract rule class in order to interface your language with PMD's generic rule execution. -* See [`AbstractSwiftRule`](https://github.com/pmd/pmd/blob/master/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/rule/AbstractSwiftRule.java) as an example. +* See [`AbstractSwiftRule`](https://github.com/pmd/pmd/blob/main/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/rule/AbstractSwiftRule.java) as an example. * The rule basically just extends - [`AbstractVisitorRule`](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractVisitorRule.java) + [`AbstractVisitorRule`](https://github.com/pmd/pmd/blob/main/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractVisitorRule.java) and only redefines the abstract `buildVisitor()` method to return our own type of visitor. In this case our `SwiftVisitor` is used. While there is no real functionality added, every language should have its own base class for rules. @@ -192,7 +192,7 @@ definitely don't come for free. It is much effort and requires perseverance to i * PMD supports 2 types of rules, through visitors or XPath. * To add a visitor rule: * You need to extend the abstract rule you created on the previous step, you can use the swift - rule [UnavailableFunctionRule](https://github.com/pmd/pmd/blob/master/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/UnavailableFunctionRule.java) + rule [UnavailableFunctionRule](https://github.com/pmd/pmd/blob/main/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/UnavailableFunctionRule.java) as an example. Note, that all rule classes should be suffixed with `Rule` and should be placed in a package the corresponds to their category. * To add an XPath rule you can follow our guide [Writing XPath Rules](pmd_userdocs_extending_writing_xpath_rules.html). @@ -213,16 +213,16 @@ definitely don't come for free. It is much effort and requires perseverance to i * Testing rules is described in depth in [Testing your rules](pmd_userdocs_extending_testing.html). * Each rule has its own test class: Create a test class for your rule extending `PmdRuleTst` *(see - [`UnavailableFunctionTest`](https://github.com/pmd/pmd/blob/master/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/UnavailableFunctionTest.java) + [`UnavailableFunctionTest`](https://github.com/pmd/pmd/blob/main/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/UnavailableFunctionTest.java) for example)* * Create a category rule set for your language *(see - [`pmd-swift/src/main/resources/bestpractices.xml`](https://github.com/pmd/pmd/blob/master/pmd-swift/src/main/resources/category/swift/bestpractices.xml) + [`pmd-swift/src/main/resources/bestpractices.xml`](https://github.com/pmd/pmd/blob/main/pmd-swift/src/main/resources/category/swift/bestpractices.xml) for example)* * Place the test XML file with the test cases in the correct location * When executing the test class * this triggers the unit test to read the corresponding XML file with the rule test data *(see - [`UnavailableFunction.xml`](https://github.com/pmd/pmd/blob/master/pmd-swift/src/test/resources/net/sourceforge/pmd/lang/swift/rule/bestpractices/xml/UnavailableFunction.xml) + [`UnavailableFunction.xml`](https://github.com/pmd/pmd/blob/main/pmd-swift/src/test/resources/net/sourceforge/pmd/lang/swift/rule/bestpractices/xml/UnavailableFunction.xml) for example)* * This test XML file contains sample pieces of code which should trigger a specified number of violations of this rule. The unit test will execute the rule on this piece of code, and verify diff --git a/docs/pages/pmd/devdocs/major_contributions/adding_new_cpd_language.md b/docs/pages/pmd/devdocs/major_contributions/adding_new_cpd_language.md index 2cf623881e..5588cabbdf 100644 --- a/docs/pages/pmd/devdocs/major_contributions/adding_new_cpd_language.md +++ b/docs/pages/pmd/devdocs/major_contributions/adding_new_cpd_language.md @@ -20,7 +20,7 @@ easy to implement the Tokenizer interface. Use the following guide to set up a new language module that supports CPD. -1. Create a new Maven module for your language. You can take [the Golang module](https://github.com/pmd/pmd/tree/master/pmd-go/pom.xml) as an example. +1. Create a new Maven module for your language. You can take [the Golang module](https://github.com/pmd/pmd/tree/main/pmd-go/pom.xml) as an example. - Make sure to add your new module to the parent pom as `` entry, so that it is built alongside the other languages. - Also add your new module to the dependencies list in "pmd-languages-deps/pom.xml", so that the new language @@ -28,7 +28,7 @@ Use the following guide to set up a new language module that supports CPD. 2. Implement a {% jdoc core::cpd.CpdLexer %}. - For Antlr grammars you can take the grammar from [antlr/grammars-v4](https://github.com/antlr/grammars-v4) and place it in `src/main/antlr4` followed by the package name of the language. You then need to call the appropriate ant wrapper to generate - the lexer from the grammar. To do so, edit `pom.xml` (eg like [the Golang module](https://github.com/pmd/pmd/tree/master/pmd-go/pom.xml)). + the lexer from the grammar. To do so, edit `pom.xml` (eg like [the Golang module](https://github.com/pmd/pmd/tree/main/pmd-go/pom.xml)). Once that is done, `mvn generate-sources` should generate the lexer sources for you. You can now implement a CpdLexer, for instance by extending {% jdoc core::cpd.impl.AntlrCpdLexer %}. The following reproduces the Go implementation: @@ -49,7 +49,7 @@ Use the following guide to set up a new language module that supports CPD. change each token e.g. into uppercase, so that CPD sees the same strings and can find duplicates even when the casing differs. See {% jdoc tsql::lang.tsql.cpd.TSqlCpdLexer %} for an example. You will also need a "CaseChangingCharStream", so that antlr itself is case-insensitive. - - For JavaCC grammars, place your grammar in `etc/grammar` and edit the `pom.xml` like the [Python implementation](https://github.com/pmd/pmd/blob/master/pmd-python/pom.xml) does. + - For JavaCC grammars, place your grammar in `etc/grammar` and edit the `pom.xml` like the [Python implementation](https://github.com/pmd/pmd/blob/main/pmd-python/pom.xml) does. You can then subclass {% jdoc core::cpd.impl.JavaccCpdLexer %} instead of AntlrCpdLexer. - If your JavaCC based language is case-insensitive (option `IGNORE_CASE=true`), then you need to implement {%jdoc core::lang.ast.impl.javacc.JavaccTokenDocument.TokenDocumentBehavior %}, which can change each token @@ -82,7 +82,7 @@ If your language only supports CPD, then you can subclass {% jdoc core::lang.imp At this point the new language module should be available in {% jdoc core::lang.LanguageRegistry#CPD %} and usable by CPD like any other language. -4. Update the test that asserts the list of supported languages by updating the `SUPPORTED_LANGUAGES` constant in [BinaryDistributionIT](https://github.com/pmd/pmd/blob/master/pmd-dist/src/test/java/net/sourceforge/pmd/dist/BinaryDistributionIT.java). +4. Update the test that asserts the list of supported languages by updating the `SUPPORTED_LANGUAGES` constant in [BinaryDistributionIT](https://github.com/pmd/pmd/blob/main/pmd-dist/src/test/java/net/sourceforge/pmd/dist/BinaryDistributionIT.java). 5. Add some tests for your CpdLexer by following the [section below](#testing-your-implementation). @@ -119,7 +119,7 @@ of {% jdoc core::cpd.CpdCapableLanguage#createCpdTokenizer(core::lang.LanguagePr To implement simple token filtering, you can use {% jdoc core::cpd.impl.BaseTokenFilter %} as a base class, or another base class in {% jdoc_package core::cpd.impl %}. -Take a look at the [Kotlin token filter implementation](https://github.com/pmd/pmd/blob/master/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/cpd/KotlinCpdLexer.java), or the [Java one](https://github.com/pmd/pmd/blob/master/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/cpd/JavaCpdLexer.java). +Take a look at the [Kotlin token filter implementation](https://github.com/pmd/pmd/blob/main/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/cpd/KotlinCpdLexer.java), or the [Java one](https://github.com/pmd/pmd/blob/master/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/cpd/JavaCpdLexer.java). ### Testing your implementation diff --git a/docs/pages/pmd/devdocs/pmdtester.md b/docs/pages/pmd/devdocs/pmdtester.md index 208d11dd34..4c29da2a59 100644 --- a/docs/pages/pmd/devdocs/pmdtester.md +++ b/docs/pages/pmd/devdocs/pmdtester.md @@ -17,8 +17,8 @@ Regression difference reports are commented back to the PR for the reviewer's in **Verifying your local changes and generate a diff-report locally** -`pmdtester -r YOUR_LOCAL_PMD_GIT_REPO_ROOT_DIR -b master -p YOUR_DEVELOPMENT_BRANCH` +`pmdtester -r YOUR_LOCAL_PMD_GIT_REPO_ROOT_DIR -b main -p YOUR_DEVELOPMENT_BRANCH` The regression difference report is placed in the `YOUR_WORKING_DIR/target/reports/diff` directory. -For more documentation on pmdtester, see [README.rdoc](https://github.com/pmd/pmd-regression-tester/blob/master/README.rdoc) +For more documentation on pmdtester, see [README.rdoc](https://github.com/pmd/pmd-regression-tester/blob/main/README.rdoc) diff --git a/docs/pages/pmd/devdocs/writing_documentation.md b/docs/pages/pmd/devdocs/writing_documentation.md index 53c7be347f..5c27b940fa 100644 --- a/docs/pages/pmd/devdocs/writing_documentation.md +++ b/docs/pages/pmd/devdocs/writing_documentation.md @@ -33,7 +33,7 @@ This makes it easy to view the documentation also offline. The categories for a language `%lang%` are located in `pmd-%lang%/src/main/resources/category/%lang% `. So for Java the categories -can be found under [pmd-java/src/main/resources/category/java](https://github.com/pmd/pmd/tree/master/pmd-java/src/main/resources/category/java). +can be found under [pmd-java/src/main/resources/category/java](https://github.com/pmd/pmd/tree/main/pmd-java/src/main/resources/category/java). The XML category files in this directory are transformed during build into markdown pages describing the rules they contain. These pages are placed under `docs/` like the handwritten documentation, and are then rendered with Jekyll like the rest of them. The rule documentation @@ -83,7 +83,7 @@ Here's a short overview: For the javadoc tags, the standard PMD maven modules are already defined as namespaces, e.g. `core`, `java`, `apex`, .... -For the implementation of these tags, see the [_plugins](https://github.com/pmd/pmd/tree/master/docs/_plugins) folder. +For the implementation of these tags, see the [_plugins](https://github.com/pmd/pmd/tree/main/docs/_plugins) folder. ## Building diff --git a/docs/pages/pmd/languages/java.md b/docs/pages/pmd/languages/java.md index b69204caa7..e4a7fe05cd 100644 --- a/docs/pages/pmd/languages/java.md +++ b/docs/pages/pmd/languages/java.md @@ -199,4 +199,4 @@ You can access these via {% jdoc core::reporting.RuleViolation#getAdditionalInfo There is no API yet for dataflow analysis. However, some rules such as {% rule java/bestpractices/UnusedAssignment %} or {% rule java/design/ImmutableField %} are using an internal implementation of an additional AST pass that adds dataflow information. The implementation can be found in -[net.sourceforge.pmd.lang.java.rule.internal.DataflowPass](https://github.com/pmd/pmd/blob/master/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPass.java). +[net.sourceforge.pmd.lang.java.rule.internal.DataflowPass](https://github.com/pmd/pmd/blob/main/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPass.java). diff --git a/docs/pages/pmd/projectdocs/committers/main_landing_page.md b/docs/pages/pmd/projectdocs/committers/main_landing_page.md index 8ad63c686f..4c9e4ec0be 100644 --- a/docs/pages/pmd/projectdocs/committers/main_landing_page.md +++ b/docs/pages/pmd/projectdocs/committers/main_landing_page.md @@ -18,15 +18,15 @@ It usually takes 15 minutes. ## Contents * Main page - aka "Landing page": - * Layout: [_layouts/default.html](https://github.com/pmd/pmd.github.io/blob/master/_layouts/default.html). - It includes all the sub section, which can be found in the includes directory [_includes/](https://github.com/pmd/pmd.github.io/tree/master/_includes) + * Layout: [_layouts/default.html](https://github.com/pmd/pmd.github.io/blob/main/_layouts/default.html). + It includes all the sub section, which can be found in the includes directory [_includes/](https://github.com/pmd/pmd.github.io/tree/main/_includes) * The latest PMD version is configured in `_config.yml` and the variables `site.pmd.latestVersion` are used - e.g. in [_includes/home.html](https://github.com/pmd/pmd.github.io/blob/master/_includes/home.html). + e.g. in [_includes/home.html](https://github.com/pmd/pmd.github.io/blob/main/_includes/home.html). * Blog - aka "News": - * This is a section on main page. It shows the 5 latest news. See [_includes/news.html](https://github.com/pmd/pmd.github.io/blob/master/_includes/news.html). + * This is a section on main page. It shows the 5 latest news. See [_includes/news.html](https://github.com/pmd/pmd.github.io/blob/main/_includes/news.html). * There is also a sub page "news" which lists all news. - * Layout: [_layouts/news.html](https://github.com/pmd/pmd.github.io/blob/master/_layouts/news.html) - * Page (which is pretty empty): [news.html](https://github.com/pmd/pmd.github.io/blob/master/news.html) + * Layout: [_layouts/news.html](https://github.com/pmd/pmd.github.io/blob/main/_layouts/news.html) + * Page (which is pretty empty): [news.html](https://github.com/pmd/pmd.github.io/blob/main/news.html) ## Building the page locally diff --git a/docs/pages/pmd/projectdocs/committers/merging_pull_requests.md b/docs/pages/pmd/projectdocs/committers/merging_pull_requests.md index a450ff882d..ebd8779f36 100644 --- a/docs/pages/pmd/projectdocs/committers/merging_pull_requests.md +++ b/docs/pages/pmd/projectdocs/committers/merging_pull_requests.md @@ -5,7 +5,7 @@ last_updated: October 2021 author: Andreas Dangel --- -## Example 1: Merging PR #123 into master +## Example 1: Merging PR #123 into main 1. Review the pull request @@ -20,15 +20,15 @@ author: Andreas Dangel 2. The actual merge commands: - We assume, that the PR has been created from the master branch. If this is not the case, + We assume, that the PR has been created from the main branch. If this is not the case, then we'll either need to rebase or ask for rebasing before merging. ``` - git checkout master && git pull origin master # make sure, you have the latest code + git checkout main && git pull origin main # make sure, you have the latest code git fetch origin pull/123/head:pr-123 && git checkout pr-123 # creates a new temporary branch "pr-123" ``` -3. Update the [release notes](https://github.com/pmd/pmd/blob/master/docs/pages/release_notes.md): +3. Update the [release notes](https://github.com/pmd/pmd/blob/main/docs/pages/release_notes.md): * Are there any API changes, that need to be documented? (Section "API Changes") * Are there any significant changes to existing rules, that should be mentioned? @@ -61,13 +61,13 @@ author: Andreas Dangel And follow the instructions. This will create a new commit into to the current branch (pr-123) updating both the file `.all-contributorsrc` and `docs/pages/pmd/projectdocs/credits.md`. -5. Now merge the pull request into the master branch: +5. Now merge the pull request into the main branch: ``` - git checkout master - git merge --no-ff pr-123 -m "Merge pull request #123 from xyz:branch + git checkout main + git merge --no-ff pr-123 -m "Full-title-of-the-pr (#123) - Full-title-of-the-pr #123" --log + Merge pull request #123 from xyz:branch" --log ``` {%include note.html content="If there are merge conflicts, you'll need to deal with them here." %} @@ -75,7 +75,7 @@ author: Andreas Dangel 6. Run the complete build: `./mvnw clean verify -Pgenerate-rule-docs` {% include note.html content="This will execute all the unit tests and the checkstyle tests. It ensures, - that the complete project can be build and is functioning on top of the current master." %} + that the complete project can be build and is functioning on top of the current main." %} {% include note.html content="The profile `generate-rule-docs` will run the doc checks, that would otherwise only run on github actions and fail the build, if e.g. a jdoc or rule reference is wrong." %} @@ -83,7 +83,7 @@ author: Andreas Dangel 7. If the build was successful, you are ready to push: ``` - git push origin master + git push origin main ``` Since the temporary branch is now not needed anymore, you can delete it: @@ -92,7 +92,7 @@ author: Andreas Dangel ## Example 2: Merging PR #124 into a maintenance branch -We ask, to create every pull request against master, to make it easier to contribute. +We ask, to create every pull request against main, to make it easier to contribute. But if a pull request is intended to fix a bug in an older version of PMD, then we need to backport this pull request. ### Creating a maintenance branch @@ -124,7 +124,7 @@ PMD version 5.8.0, so that we can create a bugfix release 5.8.1. ``` git fetch origin pull/124/head:pr-124 && git checkout pr-124 # creates a new temporary branch - git rebase master --onto pmd/5.8.x + git rebase main --onto pmd/5.8.x ./mvnw clean verify # make sure, everything works after the rebase ``` @@ -154,7 +154,7 @@ PMD version 5.8.0, so that we can create a bugfix release 5.8.1. You need to manually close the pull request. Leave a comment, that it has been rebased onto the maintenance branch. -### Merging into master +### Merging into main Now the PR has been merged into the maintenance branch, but it is missing in any later version of PMD. Therefore, we merge first into the next minor version maintenance branch (if existing): @@ -162,17 +162,17 @@ Therefore, we merge first into the next minor version maintenance branch (if exi git checkout pmd/5.9.x git merge pmd/5.8.x -After that, we merge the changes into the master branch: +After that, we merge the changes into the main branch: - git checkout master + git checkout main git merge pmd/5.9.x {%include note.html content="This ensures, that every change on the maintenance branch eventually ends -up in the master branch and therefore in any future version of PMD.
+up in the main branch and therefore in any future version of PMD.
The downside is however, that there are inevitable merge conflicts for the maven `pom.xml` files, since every branch changed the version number differently.
We could avoid this by merging only the temporary branch \"pr-124\" into each maintenance branch and -eventually into master, with the risk of missing single commits in a maintenance branch, that have been +eventually into main, with the risk of missing single commits in a maintenance branch, that have been done outside the temporary branch." %} ### Merging vs. Cherry-Picking @@ -181,4 +181,4 @@ We are not using cherry-picking, so that each fix is represented by a single com Cherry-picking would duplicate the commit and you can't see in the log, on which branches the fix has been integrated (e.g. gitk and github show the branches, from which the specific commit is reachable). -The downside is a more complex history - the maintenance branches and master branch are "connected" and not separate. +The downside is a more complex history - the maintenance branches and main branch are "connected" and not separate. diff --git a/docs/pages/pmd/projectdocs/committers/releasing.md b/docs/pages/pmd/projectdocs/committers/releasing.md index 3bb05898df..11365d7333 100644 --- a/docs/pages/pmd/projectdocs/committers/releasing.md +++ b/docs/pages/pmd/projectdocs/committers/releasing.md @@ -140,7 +140,7 @@ echo "* Days since last release: $(( ( $(date +%s) - $(git log --max-count=1 --f Note: both shell snippets are also integrated into `do-release.sh`. -Check in all (version) changes to branch master or any other branch, from which the release takes place: +Check in all (version) changes to branch main or any other branch, from which the release takes place: $ git commit -a -m "Prepare pmd release " $ git push @@ -180,7 +180,7 @@ NEW_RELEASE_NOTES=$(bundle exec docs/render_release_notes.rb docs/pages/release_ cat > "../pmd.github.io/${RELEASE_NOTES_POST}" <" $ git push @@ -259,7 +259,7 @@ Here is, what happens: under . The release on GitHub Actions currently takes about 30-45 minutes. Once this is done, you -can proceed with releasing pmd designer, see . +can proceed with releasing pmd designer, see . Make sure to release the version, you have used earlier for the property `pmd-designer.version`. Once the pmd-designer release is done, you can proceed with part 2. This is simply triggering manually @@ -374,7 +374,7 @@ This is a {{ site.pmd.release_type }} release. Finally, commit and push the changes: $ git commit -m "Prepare next development version" - $ git push origin master + $ git push origin main ## Branches @@ -382,7 +382,7 @@ Finally, commit and push the changes: ### Merging If the release was done on a maintenance branch, such as `pmd/5.4.x`, then this branch should be -merged into the next "higher" branches, such as `pmd/5.5.x` and `master`. +merged into the next "higher" branches, such as `pmd/5.5.x` and `main`. This ensures, that all fixes done on the maintenance branch, finally end up in the other branches. In theory, the fixes should already be there, but you never now. @@ -392,7 +392,7 @@ In theory, the fixes should already be there, but you never now. If releases from multiple branches are being done, the order matters. You should start from the "oldest" branch, e.g. `pmd/5.4.x`, release from there. Then merge (see above) into the next branch, e.g. `pmd/5.5.x` and release -from there. Then merge into the `master` branch and release from there. This way, the last release done, becomes +from there. Then merge into the `main` branch and release from there. This way, the last release done, becomes automatically the latest release on and on sourceforge. diff --git a/docs/pages/pmd/userdocs/cpd/cpd_report_formats.md b/docs/pages/pmd/userdocs/cpd/cpd_report_formats.md index 02b760aeb9..cc366a59a1 100644 --- a/docs/pages/pmd/userdocs/cpd/cpd_report_formats.md +++ b/docs/pages/pmd/userdocs/cpd/cpd_report_formats.md @@ -267,7 +267,7 @@ e.g. `xalan` (see ). ### cpdhtml.xslt -This stylesheet is available in the sources or from GitHub at: . +This stylesheet is available in the sources or from GitHub at: . ```shell xalan -in cpd-report-sample.xml -xsl cpdhtml.xslt -out cpd-report-sample-cpdhtml.html @@ -284,7 +284,7 @@ xalan -in cpd-report-sample.xml -xsl cpdhtml.xslt -out cpd-report-sample-cpdhtml ### cpdhtml-v2.xslt -This stylesheet is available in the sources or from GitHub at: . +This stylesheet is available in the sources or from GitHub at: . ```shell xalan -in pmd-core-cpd-report.xml -xsl etc/xslt/cpdhtml-v2.xslt -out pmd-core-cpd-report-v2.html diff --git a/docs/pages/pmd/userdocs/extending/defining_properties.md b/docs/pages/pmd/userdocs/extending/defining_properties.md index dfda872abc..19c728aa19 100644 --- a/docs/pages/pmd/userdocs/extending/defining_properties.md +++ b/docs/pages/pmd/userdocs/extending/defining_properties.md @@ -97,7 +97,7 @@ 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/master/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningLoopVariablesRule.java#L40). +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: * The property descriptors are declared `static final`, which should generally be the case, as descriptors are immutable and can be shared between instances of the same rule; diff --git a/docs/pages/pmd/userdocs/extending/testing.md b/docs/pages/pmd/userdocs/extending/testing.md index d746464657..8167a8d20a 100644 --- a/docs/pages/pmd/userdocs/extending/testing.md +++ b/docs/pages/pmd/userdocs/extending/testing.md @@ -132,7 +132,7 @@ The root element is ``. It can contain one or more `` and Each `` element defines a single test case. `` elements are used to share code snippets between different test cases. -{%include note.html content="The XML schema is available at [rule-tests.xsd](https://github.com/pmd/pmd/blob/master/pmd-test-schema/src/main/resources/net/sourceforge/pmd/test/schema/rule-tests_1_0_0.xsd)." %} +{%include note.html content="The XML schema is available at [rule-tests.xsd](https://github.com/pmd/pmd/blob/main/pmd-test-schema/src/main/resources/net/sourceforge/pmd/test/schema/rule-tests_1_0_0.xsd)." %} ### `` attributes diff --git a/docs/pages/pmd/userdocs/pmd_report_formats.md b/docs/pages/pmd/userdocs/pmd_report_formats.md index 44c0512478..f3ab631d21 100644 --- a/docs/pages/pmd/userdocs/pmd_report_formats.md +++ b/docs/pages/pmd/userdocs/pmd_report_formats.md @@ -95,7 +95,7 @@ Example: HTML format. This renderer provides two properties to render a link to the source where the violations -have been found. The following example has been created with `-property linkPrefix=https://github.com/pmd/pmd/blob/master/ -property linePrefix=L -shortnames -d pmd`. +have been found. The following example has been created with `-property linkPrefix=https://github.com/pmd/pmd/blob/main/ -property linePrefix=L -shortnames -d pmd`. If "linkPrefix" is not set, then "linePrefix" has no effect anyway: just the filename will be rendered, with no html link. Otherwise if "linePrefix" is not set, then the link will not contain a line number. @@ -274,7 +274,7 @@ Vladimir Bossicard HTML format. XML format. -This format is a XML document, that can be validated by a XSD schema. The schema is [report_2_0_0.xsd](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/resources/report_2_0_0.xsd). +This format is a XML document, that can be validated by a XSD schema. The schema is [report_2_0_0.xsd](https://github.com/pmd/pmd/blob/main/pmd-core/src/main/resources/report_2_0_0.xsd). Example: @@ -342,10 +342,10 @@ XML with a XSL transformation applied. PMD provides one built-in stylesheet, that is used by default, if no other stylesheet with the property "xsltFilename" is specified. It is called -[pmd-nicerhtml.xsl](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/resources/pmd-nicerhtml.xsl) +[pmd-nicerhtml.xsl](https://github.com/pmd/pmd/blob/main/pmd-core/src/main/resources/pmd-nicerhtml.xsl) and can be used for customization. -There are many other stylesheets available online: . +There are many other stylesheets available online: . Examples: * [Example with pmd-nicerhtml.xsl](report-examples/pmd-report-pmd-nicerhtml.html) diff --git a/docs/pages/pmd/userdocs/tools/tools.md b/docs/pages/pmd/userdocs/tools/tools.md index ace5b4e816..ba455ff7e8 100644 --- a/docs/pages/pmd/userdocs/tools/tools.md +++ b/docs/pages/pmd/userdocs/tools/tools.md @@ -91,7 +91,7 @@ With TCA you have PMD analysis out-of-the-box, and it is open source under the M BlueJ - pmd-bluej + pmd-bluej Tom Copeland @@ -133,7 +133,7 @@ With TCA you have PMD analysis out-of-the-box, and it is open source under the M Gel - github: pmd/pmd-misc/pmd-gel + github: pmd/pmd-misc/pmd-gel Andrei Lumianski @@ -161,7 +161,7 @@ With TCA you have PMD analysis out-of-the-box, and it is open source under the M JBuilder - github: pmd/pmd-misc/pmd-jbuilder + github: pmd/pmd-misc/pmd-jbuilder Tom Copeland diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index a0bd73f9c6..0f7a541601 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -14,6 +14,30 @@ This is a {{ site.pmd.release_type }} release. ### 🚀 New and noteworthy +#### New Git default branch - "main" + +We are joining the Git community and updating "master" to "main". Using the term "master" for the main +development branch can be offensive to some people. Existing versions of Git have been always capable of +working with any branch name and since 2.28.0 (July 2020) the default initial branch is configurable +(`init.defaultBranch`). Since October 2020, the default branch for new repositories on GitHub +is "main". Finally, PMD will also use this new name for the main branch. + +Why "main"? PMD uses a very simple branching model - pull requests with feature branches and one main development +branch, from which releases are created. That's why "main" is currently the best fitting name. + +More information: +- +- + +What changes? +- We change the default branch on GitHub, so that pull requests are automatically created against `main` from + now on. +- If you have already a local clone of PMD's repository, you'll need to rename the old master branch locally: + `git branch --move master main && git branch --set-upstream-to=origin`. More info: + +- Some time after this release, we'll delete the old master branch on GitHub. Then only `main` can be used. +- This change is expanded to the other PMD repositories as well, e.g. pmd-designer and pmd-regression-tester. + ### 🐛 Fixed Issues * apex * [#5138](https://github.com/pmd/pmd/issues/5138): \[apex] Various false-negatives since 7.3.0 when using triggers diff --git a/docs/pages/release_notes_old.md b/docs/pages/release_notes_old.md index 575700bafa..1dbd44da28 100644 --- a/docs/pages/release_notes_old.md +++ b/docs/pages/release_notes_old.md @@ -7635,7 +7635,7 @@ conduct. Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. -You can find the code of conduct in the file [code_of_conduct.md](https://github.com/pmd/pmd/blob/master/code_of_conduct.md) +You can find the code of conduct in the file [code_of_conduct.md](https://github.com/pmd/pmd/blob/main/code_of_conduct.md) in our repository. #### Performance improvements for XPath 2.0 rules diff --git a/docs/report-examples/pmd-report-html.html b/docs/report-examples/pmd-report-html.html index 2c1c41342d..0d745e32b9 100644 --- a/docs/report-examples/pmd-report-html.html +++ b/docs/report-examples/pmd-report-html.html @@ -3,20 +3,20 @@ #FileLineProblem 1 -pmd-core/src/main/java/net/sourceforge/pmd/RuleContext.java +pmd-core/src/main/java/net/sourceforge/pmd/RuleContext.java 124 Logger calls should be surrounded by log level guards. 2 -pmd-core/src/main/java/net/sourceforge/pmd/benchmark/Benchmarker.java +pmd-core/src/main/java/net/sourceforge/pmd/benchmark/Benchmarker.java 58 This for loop can be replaced by a foreach loop

Processing errors

- +
FileProblem
pmd-core/src/test/resources/net/sourceforge/pmd/cpd/files/file_with_ISO-8859-1_encoding.javapmd-core/src/test/resources/net/sourceforge/pmd/cpd/files/file_with_ISO-8859-1_encoding.java
net.sourceforge.pmd.PMDException: Error while parsing pmd-core/src/test/resources/net/sourceforge/pmd/cpd/files/file_with_ISO-8859-1_encoding.java
     at net.sourceforge.pmd.SourceCodeProcessor.processSourceCodeWithoutCache(SourceCodeProcessor.java:110)
     at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:89)
@@ -52,7 +52,7 @@ Was expecting one of:
 

Suppressed warnings

- + @@ -64,4 +64,4 @@ Was expecting one of: -
FileLineRuleNOPMD or AnnotationReason
pmd-core/src/main/java/net/sourceforge/pmd/PMD.javapmd-core/src/main/java/net/sourceforge/pmd/PMD.java 505 CloseResource AnnotationLoosePackageCoupling No packages or classes specified
\ No newline at end of file + diff --git a/docs/report-examples/pmd-report-summaryhtml.html b/docs/report-examples/pmd-report-summaryhtml.html index 92dc3e1f72..cf6c056057 100644 --- a/docs/report-examples/pmd-report-summaryhtml.html +++ b/docs/report-examples/pmd-report-summaryhtml.html @@ -10,20 +10,20 @@ #FileLineProblem 1 -pmd-core/src/main/java/net/sourceforge/pmd/RuleContext.java +pmd-core/src/main/java/net/sourceforge/pmd/RuleContext.java 124 Logger calls should be surrounded by log level guards. 2 -pmd-core/src/main/java/net/sourceforge/pmd/benchmark/Benchmarker.java +pmd-core/src/main/java/net/sourceforge/pmd/benchmark/Benchmarker.java 58 This for loop can be replaced by a foreach loop

Processing errors

- +
FileProblem
pmd-core/src/test/resources/net/sourceforge/pmd/cpd/files/file_with_ISO-8859-1_encoding.javapmd-core/src/test/resources/net/sourceforge/pmd/cpd/files/file_with_ISO-8859-1_encoding.java
net.sourceforge.pmd.PMDException: Error while parsing pmd-core/src/test/resources/net/sourceforge/pmd/cpd/files/file_with_ISO-8859-1_encoding.java
     at net.sourceforge.pmd.SourceCodeProcessor.processSourceCodeWithoutCache(SourceCodeProcessor.java:110)
     at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:89)
@@ -59,7 +59,7 @@ Was expecting one of:
 

Suppressed warnings

- + @@ -71,4 +71,4 @@ Was expecting one of: -
FileLineRuleNOPMD or AnnotationReason
pmd-core/src/main/java/net/sourceforge/pmd/PMD.javapmd-core/src/main/java/net/sourceforge/pmd/PMD.java 505 CloseResource AnnotationLoosePackageCoupling No packages or classes specified
\ No newline at end of file + diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/internal/RuleSetReferenceId.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/internal/RuleSetReferenceId.java index 6d287fa0e0..b0ce233400 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/internal/RuleSetReferenceId.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/internal/RuleSetReferenceId.java @@ -70,8 +70,8 @@ import net.sourceforge.pmd.util.internal.ResourceLoader; * EmptyCatchBlock * * - * https://raw.githubusercontent.com/pmd/pmd/master/pmd-java/src/main/resources/rulesets/java/quickstart.xml/ConstantsInInterface - * https://raw.githubusercontent.com/pmd/pmd/master/pmd-java/src/main/resources/rulesets/java/quickstart.xml + * https://raw.githubusercontent.com/pmd/pmd/main/pmd-java/src/main/resources/rulesets/java/quickstart.xml/ConstantsInInterface + * https://raw.githubusercontent.com/pmd/pmd/main/pmd-java/src/main/resources/rulesets/java/quickstart.xml * ConstantsInInterface * * diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/internal/RuleSetReferenceIdTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/internal/RuleSetReferenceIdTest.java index ca3c0ea388..9022676839 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/internal/RuleSetReferenceIdTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/internal/RuleSetReferenceIdTest.java @@ -91,8 +91,8 @@ class RuleSetReferenceIdTest { new RuleSetReferenceId("rulesets/java/basic.xml/EmptyCatchBlock")); assertRuleSetReferenceId(false, null, false, "EmptyCatchBlock", "EmptyCatchBlock", new RuleSetReferenceId("EmptyCatchBlock")); - assertRuleSetReferenceId(true, "https://raw.githubusercontent.com/pmd/pmd/master/pmd-java/src/main/resources/rulesets/java/quickstart.xml", false, "ConstantsInInterface", "https://raw.githubusercontent.com/pmd/pmd/master/pmd-java/src/main/resources/rulesets/java/quickstart.xml/ConstantsInInterface", - new RuleSetReferenceId("https://raw.githubusercontent.com/pmd/pmd/master/pmd-java/src/main/resources/rulesets/java/quickstart.xml/ConstantsInInterface")); + assertRuleSetReferenceId(true, "https://raw.githubusercontent.com/pmd/pmd/main/pmd-java/src/main/resources/rulesets/java/quickstart.xml", false, "ConstantsInInterface", "https://raw.githubusercontent.com/pmd/pmd/master/pmd-java/src/main/resources/rulesets/java/quickstart.xml/ConstantsInInterface", + new RuleSetReferenceId("https://raw.githubusercontent.com/pmd/pmd/main/pmd-java/src/main/resources/rulesets/java/quickstart.xml/ConstantsInInterface")); assertRuleSetReferenceId(true, "https://example.org/ruleset/MyRule", true, null, "https://example.org/ruleset/MyRule", new RuleSetReferenceId("https://example.org/ruleset/MyRule")); assertRuleSetReferenceId(true, "https://example.org/ruleset.xml", false, "MyRule", "https://example.org/ruleset.xml/MyRule", diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/HTMLRendererTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/HTMLRendererTest.java index adc1f2cc7d..669faa1337 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/HTMLRendererTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/HTMLRendererTest.java @@ -93,7 +93,7 @@ class HTMLRendererTest extends AbstractRendererTest { @Test void testLinkPrefix() throws IOException { final HTMLRenderer renderer = new HTMLRenderer(); - final String linkPrefix = "https://github.com/pmd/pmd/blob/master/"; + final String linkPrefix = "https://github.com/pmd/pmd/blob/main/"; final String linePrefix = "L"; renderer.setProperty(HTMLRenderer.LINK_PREFIX, linkPrefix); renderer.setProperty(HTMLRenderer.LINE_PREFIX, Optional.of(linePrefix)); @@ -106,7 +106,7 @@ class HTMLRendererTest extends AbstractRendererTest { @Test void testLinePrefixNotSet() throws IOException { final HTMLRenderer renderer = new HTMLRenderer(); - final String linkPrefix = "https://github.com/pmd/pmd/blob/master/"; + final String linkPrefix = "https://github.com/pmd/pmd/blob/main/"; renderer.setProperty(HTMLRenderer.LINK_PREFIX, linkPrefix); // dont set line prefix renderer.setProperty(HTMLRenderer.LINE_PREFIX, linePrefix); renderer.setProperty(HTMLRenderer.HTML_EXTENSION, false); @@ -118,7 +118,7 @@ class HTMLRendererTest extends AbstractRendererTest { @Test void testEmptyLinePrefix() throws IOException { final HTMLRenderer renderer = new HTMLRenderer(); - final String linkPrefix = "https://github.com/pmd/pmd/blob/master/"; + final String linkPrefix = "https://github.com/pmd/pmd/blob/main/"; renderer.setProperty(HTMLRenderer.LINK_PREFIX, linkPrefix); renderer.setProperty(HTMLRenderer.LINE_PREFIX, Optional.of("")); renderer.setProperty(HTMLRenderer.HTML_EXTENSION, false); diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/DeadLinksChecker.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/DeadLinksChecker.java index 28b6ce4a39..eea45f8719 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/DeadLinksChecker.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/DeadLinksChecker.java @@ -67,7 +67,7 @@ public class DeadLinksChecker { ); // the link is actually pointing to a file in the pmd project - private static final String LOCAL_FILE_PREFIX = "https://github.com/pmd/pmd/blob/master/"; + private static final String LOCAL_FILE_PREFIX = "https://github.com/pmd/pmd/blob/main/"; // don't check links to PMD bugs/issues/pull-requests and some other sites (performance optimization) private static final List IGNORED_URL_PREFIXES = Collections.unmodifiableList(Arrays.asList( diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleDocGenerator.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleDocGenerator.java index 24eba979bb..aff45936e7 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleDocGenerator.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleDocGenerator.java @@ -58,7 +58,7 @@ public class RuleDocGenerator { private static final String DEPRECATION_LABEL = "Deprecated"; private static final String DEPRECATED_RULE_PROPERTY_MARKER = "deprecated!"; - private static final String GITHUB_SOURCE_LINK = "https://github.com/pmd/pmd/blob/master/"; + private static final String GITHUB_SOURCE_LINK = "https://github.com/pmd/pmd/blob/main/"; /** Maintains mapping from pmd terse language name to rouge highlighter language. */ private static final Map LANGUAGE_HIGHLIGHT_MAPPER = new HashMap<>(); diff --git a/pmd-doc/src/test/resources/expected/sample.md b/pmd-doc/src/test/resources/expected/sample.md index e8a7016e4d..63d079b7ba 100644 --- a/pmd-doc/src/test/resources/expected/sample.md +++ b/pmd-doc/src/test/resources/expected/sample.md @@ -167,7 +167,7 @@ Second paragraph. Third paragraph. -**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.java.rule.errorprone.OverrideBothEqualsAndHashcodeRule](https://github.com/pmd/pmd/blob/master/net/sourceforge/pmd/lang/java/rule/errorprone/OverrideBothEqualsAndHashcodeRule.java) +**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.java.rule.errorprone.OverrideBothEqualsAndHashcodeRule](https://github.com/pmd/pmd/blob/main/net/sourceforge/pmd/lang/java/rule/errorprone/OverrideBothEqualsAndHashcodeRule.java) **Example(s):** From 47f204cb199a571465af836377205b6382c81cff Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 13 Sep 2024 10:37:37 +0200 Subject: [PATCH 12/46] Fix unit test --- .../pmd/lang/rule/internal/RuleSetReferenceIdTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/internal/RuleSetReferenceIdTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/internal/RuleSetReferenceIdTest.java index 9022676839..3de2efd91d 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/internal/RuleSetReferenceIdTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/internal/RuleSetReferenceIdTest.java @@ -91,7 +91,7 @@ class RuleSetReferenceIdTest { new RuleSetReferenceId("rulesets/java/basic.xml/EmptyCatchBlock")); assertRuleSetReferenceId(false, null, false, "EmptyCatchBlock", "EmptyCatchBlock", new RuleSetReferenceId("EmptyCatchBlock")); - assertRuleSetReferenceId(true, "https://raw.githubusercontent.com/pmd/pmd/main/pmd-java/src/main/resources/rulesets/java/quickstart.xml", false, "ConstantsInInterface", "https://raw.githubusercontent.com/pmd/pmd/master/pmd-java/src/main/resources/rulesets/java/quickstart.xml/ConstantsInInterface", + assertRuleSetReferenceId(true, "https://raw.githubusercontent.com/pmd/pmd/main/pmd-java/src/main/resources/rulesets/java/quickstart.xml", false, "ConstantsInInterface", "https://raw.githubusercontent.com/pmd/pmd/main/pmd-java/src/main/resources/rulesets/java/quickstart.xml/ConstantsInInterface", new RuleSetReferenceId("https://raw.githubusercontent.com/pmd/pmd/main/pmd-java/src/main/resources/rulesets/java/quickstart.xml/ConstantsInInterface")); assertRuleSetReferenceId(true, "https://example.org/ruleset/MyRule", true, null, "https://example.org/ruleset/MyRule", new RuleSetReferenceId("https://example.org/ruleset/MyRule")); From 0889e3d9dc15aa9be70ba739d6e1bed4dd7f46ad Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 13 Sep 2024 10:37:51 +0200 Subject: [PATCH 13/46] Fix release notes --- docs/pages/release_notes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 0f7a541601..72527d5d68 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -20,7 +20,7 @@ We are joining the Git community and updating "master" to "main". Using the term development branch can be offensive to some people. Existing versions of Git have been always capable of working with any branch name and since 2.28.0 (July 2020) the default initial branch is configurable (`init.defaultBranch`). Since October 2020, the default branch for new repositories on GitHub -is "main". Finally, PMD will also use this new name for the main branch. +is "main". Finally, PMD will also use this new name for the main branch in all our own repositories. Why "main"? PMD uses a very simple branching model - pull requests with feature branches and one main development branch, from which releases are created. That's why "main" is currently the best fitting name. @@ -33,7 +33,7 @@ What changes? - We change the default branch on GitHub, so that pull requests are automatically created against `main` from now on. - If you have already a local clone of PMD's repository, you'll need to rename the old master branch locally: - `git branch --move master main && git branch --set-upstream-to=origin`. More info: + `git branch --move master main && git branch --set-upstream-to=origin/main`. More info: - Some time after this release, we'll delete the old master branch on GitHub. Then only `main` can be used. - This change is expanded to the other PMD repositories as well, e.g. pmd-designer and pmd-regression-tester. From 0253b9d3cd2cfab4df08eb36dd48dd8a335e2171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sat, 14 Sep 2024 01:33:20 -0300 Subject: [PATCH 14/46] Ignore generated-sources in coverage reports - We don't test it directly, nor is it our job - A bad grammar won't be processed, or fail in subtle ways only detectable in specific tests on the AST (which is included) --- pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pom.xml b/pom.xml index 3c410ebe80..f2cb4d826c 100644 --- a/pom.xml +++ b/pom.xml @@ -612,6 +612,11 @@ org.jacoco jacoco-maven-plugin 0.8.11 + + + **/target/generated-sources/** + + org.cyclonedx From 029130a478e1c4c585c965dca224961df18c7034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Tue, 17 Sep 2024 17:00:42 -0300 Subject: [PATCH 15/46] Use a custom annotation to ignore javacc generated code --- javacc-wrapper.xml | 21 ++++++++++++----- .../sourceforge/pmd/annotation/Generated.java | 23 +++++++++++++++++++ pom.xml | 7 +----- 3 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 pmd-core/src/main/java/net/sourceforge/pmd/annotation/Generated.java diff --git a/javacc-wrapper.xml b/javacc-wrapper.xml index 2c43e086d8..bbd50e21a4 100644 --- a/javacc-wrapper.xml +++ b/javacc-wrapper.xml @@ -224,6 +224,11 @@ + + ${parser-name} + + @@ -262,7 +267,8 @@ - + @@ -272,7 +278,8 @@ - + @@ -385,11 +392,12 @@ - +'/> @@ -534,8 +542,9 @@ public final class ${token-constants-name} \{${line.separator} - + diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/annotation/Generated.java b/pmd-core/src/main/java/net/sourceforge/pmd/annotation/Generated.java new file mode 100644 index 0000000000..ab9b46f465 --- /dev/null +++ b/pmd-core/src/main/java/net/sourceforge/pmd/annotation/Generated.java @@ -0,0 +1,23 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * Marks a class as generated code, and therefore to be ignored for code coverage purposes. + * + * @since 7.6.0 + */ +@Retention(RetentionPolicy.CLASS) +@Documented +public @interface Generated { + + /** The generator that produced this code */ + String value() default ""; + +} diff --git a/pom.xml b/pom.xml index f2cb4d826c..216fad4056 100644 --- a/pom.xml +++ b/pom.xml @@ -611,12 +611,7 @@ org.jacoco jacoco-maven-plugin - 0.8.11 - - - **/target/generated-sources/** - - + 0.8.12 org.cyclonedx From cae71e7a5e72bba07867a38072b9e580aebfa97e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Tue, 17 Sep 2024 17:09:29 -0300 Subject: [PATCH 16/46] Be consistent in how we replace tokens --- javacc-wrapper.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/javacc-wrapper.xml b/javacc-wrapper.xml index bbd50e21a4..05837e96ba 100644 --- a/javacc-wrapper.xml +++ b/javacc-wrapper.xml @@ -224,9 +224,7 @@ - - ${parser-name} + From dff06c9b4d6915dad31f40cac9c863ebafc6251c Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 19 Sep 2024 11:22:43 +0200 Subject: [PATCH 17/46] Update release notes --- docs/pages/release_notes.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 72527d5d68..ff08e0f538 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -33,8 +33,18 @@ What changes? - We change the default branch on GitHub, so that pull requests are automatically created against `main` from now on. - If you have already a local clone of PMD's repository, you'll need to rename the old master branch locally: - `git branch --move master main && git branch --set-upstream-to=origin/main`. More info: - + ``` + git branch --move master main + git fetch origin + git branch --set-upstream-to=origin/main main + git remote set-head origin --auto + ``` + + More info: + and + +- If you created a fork on GitHub, you'll need to change the default branch in your fork to `main` as + well (Settings > Default Branch). - Some time after this release, we'll delete the old master branch on GitHub. Then only `main` can be used. - This change is expanded to the other PMD repositories as well, e.g. pmd-designer and pmd-regression-tester. From 8ea3f32f5f1232b12043fc114607d589d14252a3 Mon Sep 17 00:00:00 2001 From: lukasgraef Date: Sat, 21 Sep 2024 14:12:12 +0200 Subject: [PATCH 18/46] [java] Fix #5068: Class incorrectly identified as non-instantiatable --- .../resources/category/java/errorprone.xml | 2 -- ...ngStaticMethodInNonInstantiatableClass.xml | 25 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/pmd-java/src/main/resources/category/java/errorprone.xml b/pmd-java/src/main/resources/category/java/errorprone.xml index 0898f3ba7a..1f9ed37765 100644 --- a/pmd-java/src/main/resources/category/java/errorprone.xml +++ b/pmd-java/src/main/resources/category/java/errorprone.xml @@ -2118,8 +2118,6 @@ $topLevelClass[ (: … no nested classes, that are non-private and static … :) not(ClassBody/ClassDeclaration [pmd-java:modifiers() = "static" and @Visibility != "private"] - (: … with a default or non-private constructor … :) - [not(ClassBody/ConstructorDeclaration) or ClassBody/ConstructorDeclaration[@Visibility != "private"]] (: … and a non-private method returning the outer class type … :) [(ClassBody/MethodDeclaration [@Visibility != "private"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/MissingStaticMethodInNonInstantiatableClass.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/MissingStaticMethodInNonInstantiatableClass.xml index b52d0be101..16e23ab0d4 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/MissingStaticMethodInNonInstantiatableClass.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/MissingStaticMethodInNonInstantiatableClass.xml @@ -614,6 +614,31 @@ import lombok.Builder; public class Foo { private Foo() {} } +]]>
+
+ + + #5068:[java] fp when using builder with private constructor + 0 + From 2bdeadb09410098a2e0b2697d15f4f80702262ea Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sun, 22 Sep 2024 14:51:07 +0200 Subject: [PATCH 19/46] Add @lukasgraef as a contributor --- .all-contributorsrc | 9 ++ docs/pages/pmd/projectdocs/credits.md | 143 +++++++++++++------------- 2 files changed, 81 insertions(+), 71 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 3ce273cee4..0838748b28 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -7782,6 +7782,15 @@ "contributions": [ "bug" ] + }, + { + "login": "lukasgraef", + "name": "Lukas Gräf", + "avatar_url": "https://avatars.githubusercontent.com/u/48957581?v=4", + "profile": "https://github.com/lukasgraef", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/docs/pages/pmd/projectdocs/credits.md b/docs/pages/pmd/projectdocs/credits.md index d12aa44801..a574b470ff 100644 --- a/docs/pages/pmd/projectdocs/credits.md +++ b/docs/pages/pmd/projectdocs/credits.md @@ -468,642 +468,643 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Lucas Silva
Lucas Silva

🐛 Lucas Soncini
Lucas Soncini

💻 🐛 Luis Alcantar
Luis Alcantar

💻 + Lukas Gräf
Lukas Gräf

💻 Lukasz Slonina
Lukasz Slonina

🐛 Lukebray
Lukebray

🐛 Lynn
Lynn

💻 🐛 - Lyor Goldstein
Lyor Goldstein

🐛 + Lyor Goldstein
Lyor Goldstein

🐛 MCMicS
MCMicS

🐛 Macarse
Macarse

🐛 Machine account for PMD
Machine account for PMD

💻 Maciek Siemczyk
Maciek Siemczyk

🐛 Maikel Steneker
Maikel Steneker

💻 🐛 Maksim Moiseikin
Maksim Moiseikin

🐛 - Manfred Koch
Manfred Koch

🐛 + Manfred Koch
Manfred Koch

🐛 Manuel Moya Ferrer
Manuel Moya Ferrer

💻 🐛 Manuel Ryan
Manuel Ryan

🐛 Marat Vyshegorodtsev
Marat Vyshegorodtsev

🐛 Marcel Härle
Marcel Härle

🐛 Marcello Fialho
Marcello Fialho

🐛 Marcin Dąbrowski
Marcin Dąbrowski

💻 - Marcin Rataj
Marcin Rataj

🐛 + Marcin Rataj
Marcin Rataj

🐛 Marcono1234
Marcono1234

🐛 Mark Adamcin
Mark Adamcin

🐛 Mark Hall
Mark Hall

💻 🐛 Mark Kolich
Mark Kolich

🐛 Mark Pritchard
Mark Pritchard

🐛 Markus Rathgeb
Markus Rathgeb

🐛 - Marquis Wang
Marquis Wang

🐛 + Marquis Wang
Marquis Wang

🐛 MartGit
MartGit

🐛 Martin Feldsztejn
Martin Feldsztejn

🐛 Martin Lehmann
Martin Lehmann

🐛 Martin Spamer
Martin Spamer

🐛 Martin Tarjányi
Martin Tarjányi

🐛 MatFl
MatFl

🐛 - Mateusz Stefanski
Mateusz Stefanski

🐛 + Mateusz Stefanski
Mateusz Stefanski

🐛 Mathieu Gouin
Mathieu Gouin

🐛 MatiasComercio
MatiasComercio

💻 🐛 Matt Benson
Matt Benson

🐛 Matt De Poorter
Matt De Poorter

🐛 Matt Hargett
Matt Hargett

💻 💵 Matt Harrah
Matt Harrah

🐛 - Matt Nelson
Matt Nelson

🐛 + Matt Nelson
Matt Nelson

🐛 Matthew Amos
Matthew Amos

🐛 Matthew Duggan
Matthew Duggan

🐛 Matthew Hall
Matthew Hall

🐛 Matías Fraga
Matías Fraga

💻 🐛 Maxime Robert
Maxime Robert

💻 🐛 MetaBF
MetaBF

🐛 - Metin Dagcilar
Metin Dagcilar

🐛 + Metin Dagcilar
Metin Dagcilar

🐛 Michael
Michael

🐛 Michael Bell
Michael Bell

🐛 Michael Bernstein
Michael Bernstein

🐛 Michael Clay
Michael Clay

🐛 Michael Dombrowski
Michael Dombrowski

🐛 Michael Hausegger
Michael Hausegger

🐛 - Michael Hoefer
Michael Hoefer

🐛 + Michael Hoefer
Michael Hoefer

🐛 Michael Kolesnikov
Michael Kolesnikov

🐛 Michael Möbius
Michael Möbius

🐛 Michael N. Lipp
Michael N. Lipp

🐛 Michael Pellegrini
Michael Pellegrini

🐛 Michal Kordas
Michal Kordas

🐛 Michał Borek
Michał Borek

🐛 - Michał Kuliński
Michał Kuliński

🐛 + Michał Kuliński
Michał Kuliński

🐛 Miguel Núñez Díaz-Montes
Miguel Núñez Díaz-Montes

🐛 Mihai Ionut
Mihai Ionut

🐛 Mikhail Kuchma
Mikhail Kuchma

🐛 Mirek Hankus
Mirek Hankus

🐛 Mitch Spano
Mitch Spano

🐛 Mladjan Gadzic
Mladjan Gadzic

🐛 - MrAngry52
MrAngry52

🐛 + MrAngry52
MrAngry52

🐛 Muminur Choudhury
Muminur Choudhury

🐛 Mykhailo Palahuta
Mykhailo Palahuta

💻 🐛 Nagendra Kumar Singh
Nagendra Kumar Singh

🐛 Nahuel Barrios
Nahuel Barrios

🐛 Nakul Sharma
Nakul Sharma

🐛 Nathan Braun
Nathan Braun

🐛 - Nathan Reynolds
Nathan Reynolds

🐛 + Nathan Reynolds
Nathan Reynolds

🐛 Nathan Reynolds
Nathan Reynolds

🐛 Nathanaël
Nathanaël

🐛 Naveen
Naveen

💻 Nazdravi
Nazdravi

🐛 Neha-Dhonde
Neha-Dhonde

🐛 Nicholas Doyle
Nicholas Doyle

🐛 - Nick Butcher
Nick Butcher

🐛 + Nick Butcher
Nick Butcher

🐛 Nico Gallinal
Nico Gallinal

🐛 Nicola Dal Maso
Nicola Dal Maso

🐛 Nicolas Filotto
Nicolas Filotto

💻 Nicolas Vervelle
Nicolas Vervelle

🐛 Nicolas Vuillamy
Nicolas Vuillamy

📖 Nikita Chursin
Nikita Chursin

🐛 - Niklas Baudy
Niklas Baudy

🐛 + Niklas Baudy
Niklas Baudy

🐛 Nikolas Havrikov
Nikolas Havrikov

🐛 Nilesh Virkar
Nilesh Virkar

🐛 Nimit Patel
Nimit Patel

🐛 Niranjan Harpale
Niranjan Harpale

🐛 Nirvik Patel
Nirvik Patel

💻 Noah Sussman
Noah Sussman

🐛 - Noah0120
Noah0120

🐛 + Noah0120
Noah0120

🐛 Noam Tamim
Noam Tamim

🐛 Noel Grandin
Noel Grandin

🐛 Olaf Haalstra
Olaf Haalstra

🐛 Oleg Andreych
Oleg Andreych

💻 🐛 Oleg Pavlenko
Oleg Pavlenko

🐛 Oleksii Dykov
Oleksii Dykov

💻 🐛 - Oliver Eikemeier
Oliver Eikemeier

🐛 + Oliver Eikemeier
Oliver Eikemeier

🐛 Oliver Siegmar
Oliver Siegmar

💵 Olivier Parent
Olivier Parent

💻 🐛 Ollie Abbey
Ollie Abbey

💻 🐛 OverDrone
OverDrone

🐛 Ozan Gulle
Ozan Gulle

💻 🐛 PUNEET JAIN
PUNEET JAIN

🐛 - Parbati Bose
Parbati Bose

🐛 + Parbati Bose
Parbati Bose

🐛 Paul Berg
Paul Berg

🐛 Paul Guyot
Paul Guyot

💻 Pavel Bludov
Pavel Bludov

🐛 Pavel Mička
Pavel Mička

🐛 Pedro Nuno Santos
Pedro Nuno Santos

🐛 Pedro Rijo
Pedro Rijo

🐛 - Pelisse Romain
Pelisse Romain

💻 📖 🐛 + Pelisse Romain
Pelisse Romain

💻 📖 🐛 Per Abich
Per Abich

💻 Pete Davids
Pete Davids

🐛 Peter Bruin
Peter Bruin

🐛 Peter Chittum
Peter Chittum

💻 🐛 Peter Cudmore
Peter Cudmore

🐛 Peter Kasson
Peter Kasson

🐛 - Peter Kofler
Peter Kofler

🐛 + Peter Kofler
Peter Kofler

🐛 Peter Paul Bakker
Peter Paul Bakker

💻 Peter Rader
Peter Rader

🐛 Pham Hai Trung
Pham Hai Trung

🐛 Philip Graf
Philip Graf

💻 🐛 Philip Hachey
Philip Hachey

🐛 Philippe Ozil
Philippe Ozil

🐛 - Phinehas Artemix
Phinehas Artemix

🐛 + Phinehas Artemix
Phinehas Artemix

🐛 Phokham Nonava
Phokham Nonava

🐛 Pim van der Loos
Pim van der Loos

💻 ⚠️ Piotr Szymański
Piotr Szymański

🐛 Piotrek Żygieło
Piotrek Żygieło

💻 🐛 📖 Pranay Jaiswal
Pranay Jaiswal

🐛 Prasad Kamath
Prasad Kamath

🐛 - Prasanna
Prasanna

🐛 + Prasanna
Prasanna

🐛 Presh-AR
Presh-AR

🐛 Puneet1726
Puneet1726

🐛 RBRi
RBRi

🐛 Rafael Cortês
Rafael Cortês

🐛 RaheemShaik999
RaheemShaik999

🐛 RajeshR
RajeshR

💻 🐛 - Ramachandra Mohan
Ramachandra Mohan

🐛 + Ramachandra Mohan
Ramachandra Mohan

🐛 Ramel0921
Ramel0921

🐛 Raquel Pau
Raquel Pau

🐛 Ravikiran Janardhana
Ravikiran Janardhana

🐛 Reda Benhemmouche
Reda Benhemmouche

🐛 Reinhard Schiedermeier
Reinhard Schiedermeier

🐛 Renato Oliveira
Renato Oliveira

💻 🐛 - Rich DiCroce
Rich DiCroce

🐛 + Rich DiCroce
Rich DiCroce

🐛 Richard Corfield
Richard Corfield

💻 Richard Corfield
Richard Corfield

🐛 💻 Riot R1cket
Riot R1cket

🐛 Rishabh Jain
Rishabh Jain

🐛 RishabhDeep Singh
RishabhDeep Singh

🐛 Rob Baillie
Rob Baillie

🐛 - Robbie Martinus
Robbie Martinus

💻 🐛 + Robbie Martinus
Robbie Martinus

💻 🐛 Robert Henry
Robert Henry

🐛 Robert Mihaly
Robert Mihaly

🐛 Robert Painsi
Robert Painsi

🐛 Robert Russell
Robert Russell

🐛 Robert Sösemann
Robert Sösemann

💻 📖 📢 🐛 Robert Whitebit
Robert Whitebit

🐛 - Robin Richtsfeld
Robin Richtsfeld

🐛 + Robin Richtsfeld
Robin Richtsfeld

🐛 Robin Stocker
Robin Stocker

💻 🐛 Robin Wils
Robin Wils

🐛 RochusOest
RochusOest

🐛 Rodolfo Noviski
Rodolfo Noviski

🐛 Rodrigo Casara
Rodrigo Casara

🐛 Rodrigo Fernandes
Rodrigo Fernandes

🐛 - Roman Salvador
Roman Salvador

💻 🐛 + Roman Salvador
Roman Salvador

💻 🐛 Ronald Blaschke
Ronald Blaschke

🐛 Róbert Papp
Róbert Papp

🐛 Saikat Sengupta
Saikat Sengupta

🐛 Saksham Handu
Saksham Handu

🐛 Saladoc
Saladoc

🐛 Salesforce Bob Lightning
Salesforce Bob Lightning

🐛 - Sam Carlberg
Sam Carlberg

🐛 + Sam Carlberg
Sam Carlberg

🐛 Sashko
Sashko

💻 Satoshi Kubo
Satoshi Kubo

🐛 Scott Kennedy
Scott Kennedy

🐛 Scott Wells
Scott Wells

🐛 💻 Scrates1
Scrates1

🐛 💻 Scrsloota
Scrsloota

💻 - Sebastian Bögl
Sebastian Bögl

🐛 + Sebastian Bögl
Sebastian Bögl

🐛 Sebastian Davids
Sebastian Davids

🐛 Sebastian Schuberth
Sebastian Schuberth

🐛 Sebastian Schwarz
Sebastian Schwarz

🐛 Seren
Seren

🐛 💻 Sergey Gorbaty
Sergey Gorbaty

🐛 Sergey Kozlov
Sergey Kozlov

🐛 - Sergey Yanzin
Sergey Yanzin

💻 🐛 + Sergey Yanzin
Sergey Yanzin

💻 🐛 Seth Wilcox
Seth Wilcox

💻 Shai Bennathan
Shai Bennathan

🐛 💻 Shubham
Shubham

💻 🐛 Simon Abykov
Simon Abykov

💻 🐛 Simon Xiao
Simon Xiao

🐛 Srinivasan Venkatachalam
Srinivasan Venkatachalam

🐛 - Stanislav Gromov
Stanislav Gromov

🐛 + Stanislav Gromov
Stanislav Gromov

🐛 Stanislav Myachenkov
Stanislav Myachenkov

💻 Stefan Birkner
Stefan Birkner

🐛 Stefan Bohn
Stefan Bohn

🐛 Stefan Endrullis
Stefan Endrullis

🐛 Stefan Klöss-Schuster
Stefan Klöss-Schuster

🐛 Stefan Wolf
Stefan Wolf

🐛 - Stephan H. Wissel
Stephan H. Wissel

🐛 + Stephan H. Wissel
Stephan H. Wissel

🐛 Stephen
Stephen

🐛 Stephen Carter
Stephen Carter

🐛 Stephen Friedrich
Stephen Friedrich

🐛 Steve Babula
Steve Babula

💻 Steven Stearns
Steven Stearns

🐛 💻 Stexxe
Stexxe

🐛 - Stian Lågstad
Stian Lågstad

🐛 + Stian Lågstad
Stian Lågstad

🐛 StuartClayton5
StuartClayton5

🐛 Supun Arunoda
Supun Arunoda

🐛 Suren Abrahamyan
Suren Abrahamyan

🐛 Suvashri
Suvashri

📖 SwatiBGupta1110
SwatiBGupta1110

🐛 SyedThoufich
SyedThoufich

🐛 - Szymon Sasin
Szymon Sasin

🐛 + Szymon Sasin
Szymon Sasin

🐛 T-chuangxin
T-chuangxin

🐛 TERAI Atsuhiro
TERAI Atsuhiro

🐛 TIOBE Software
TIOBE Software

💻 🐛 Tarush Singh
Tarush Singh

💻 Taylor Smock
Taylor Smock

🐛 Techeira Damián
Techeira Damián

💻 🐛 - Ted Husted
Ted Husted

🐛 + Ted Husted
Ted Husted

🐛 TehBakker
TehBakker

🐛 The Gitter Badger
The Gitter Badger

🐛 Theodoor
Theodoor

🐛 Thiago Henrique Hüpner
Thiago Henrique Hüpner

🐛 Thibault Meyer
Thibault Meyer

🐛 Thomas Güttler
Thomas Güttler

🐛 - Thomas Jones-Low
Thomas Jones-Low

🐛 + Thomas Jones-Low
Thomas Jones-Low

🐛 Thomas Smith
Thomas Smith

💻 🐛 ThrawnCA
ThrawnCA

🐛 Thu Vo
Thu Vo

🐛 Thunderforge
Thunderforge

💻 🐛 Tim van der Lippe
Tim van der Lippe

🐛 Tobias Weimer
Tobias Weimer

💻 🐛 - Tom Copeland
Tom Copeland

🐛 💻 📖 + Tom Copeland
Tom Copeland

🐛 💻 📖 Tom Daly
Tom Daly

🐛 Tomas
Tomas

🐛 Tomer Figenblat
Tomer Figenblat

🐛 Tomi De Lucca
Tomi De Lucca

💻 🐛 Tony
Tony

📖 Torsten Kleiber
Torsten Kleiber

🐛 - TrackerSB
TrackerSB

🐛 + TrackerSB
TrackerSB

🐛 Tyson Stewart
Tyson Stewart

🐛 Ullrich Hafner
Ullrich Hafner

🐛 Utku Cuhadaroglu
Utku Cuhadaroglu

💻 🐛 Valentin Brandl
Valentin Brandl

🐛 Valeria
Valeria

🐛 Valery Yatsynovich
Valery Yatsynovich

📖 - Vasily Anisimov
Vasily Anisimov

🐛 + Vasily Anisimov
Vasily Anisimov

🐛 Vedant Chokshi
Vedant Chokshi

🐛 Vibhor Goyal
Vibhor Goyal

🐛 Vickenty Fesunov
Vickenty Fesunov

🐛 Victor Noël
Victor Noël

🐛 Vincent Galloy
Vincent Galloy

💻 Vincent HUYNH
Vincent HUYNH

🐛 - Vincent Maurin
Vincent Maurin

🐛 + Vincent Maurin
Vincent Maurin

🐛 Vincent Privat
Vincent Privat

🐛 Vishhwas
Vishhwas

🐛 Vishv_Android
Vishv_Android

🐛 Vitaly
Vitaly

🐛 Vitaly Polonetsky
Vitaly Polonetsky

🐛 Vojtech Polivka
Vojtech Polivka

🐛 - Vsevolod Zholobov
Vsevolod Zholobov

🐛 + Vsevolod Zholobov
Vsevolod Zholobov

🐛 Vyom Yadav
Vyom Yadav

💻 Wang Shidong
Wang Shidong

🐛 Waqas Ahmed
Waqas Ahmed

🐛 Wayne J. Earl
Wayne J. Earl

🐛 Wchenghui
Wchenghui

🐛 Wener
Wener

💻 - Will Winder
Will Winder

🐛 + Will Winder
Will Winder

🐛 William Brockhus
William Brockhus

💻 🐛 Wilson Kurniawan
Wilson Kurniawan

🐛 Wim Deblauwe
Wim Deblauwe

🐛 Woongsik Choi
Woongsik Choi

🐛 XenoAmess
XenoAmess

💻 🐛 Yang
Yang

💻 - YaroslavTER
YaroslavTER

🐛 + YaroslavTER
YaroslavTER

🐛 Yasar Shaikh
Yasar Shaikh

💻 Young Chan
Young Chan

💻 🐛 YuJin Kim
YuJin Kim

🐛 Yuri Dolzhenko
Yuri Dolzhenko

🐛 Yurii Dubinka
Yurii Dubinka

🐛 Zoltan Farkas
Zoltan Farkas

🐛 - Zustin
Zustin

🐛 + Zustin
Zustin

🐛 aaronhurst-google
aaronhurst-google

🐛 💻 alexmodis
alexmodis

🐛 andreoss
andreoss

🐛 andrey81inmd
andrey81inmd

💻 🐛 anicoara
anicoara

🐛 arunprasathav
arunprasathav

🐛 - asiercamara
asiercamara

🐛 + asiercamara
asiercamara

🐛 astillich-igniti
astillich-igniti

💻 avesolovksyy
avesolovksyy

🐛 avishvat
avishvat

🐛 avivmu
avivmu

🐛 axelbarfod1
axelbarfod1

🐛 b-3-n
b-3-n

🐛 - balbhadra9
balbhadra9

🐛 + balbhadra9
balbhadra9

🐛 base23de
base23de

🐛 bergander
bergander

🐛 💻 berkam
berkam

💻 🐛 breizh31
breizh31

🐛 caesarkim
caesarkim

🐛 carolyujing
carolyujing

🐛 - cbfiddle
cbfiddle

🐛 + cbfiddle
cbfiddle

🐛 cesares-basilico
cesares-basilico

🐛 chrite
chrite

🐛 ciufudean
ciufudean

📖 cobratbq
cobratbq

🐛 coladict
coladict

🐛 cosmoJFH
cosmoJFH

🐛 - cristalp
cristalp

🐛 + cristalp
cristalp

🐛 crunsk
crunsk

🐛 cwholmes
cwholmes

🐛 cyberjj999
cyberjj999

🐛 cyw3
cyw3

🐛 📖 d1ss0nanz
d1ss0nanz

🐛 dague1
dague1

📖 - dalizi007
dalizi007

💻 + dalizi007
dalizi007

💻 danbrycefairsailcom
danbrycefairsailcom

🐛 dariansanity
dariansanity

🐛 darrenmiliband
darrenmiliband

🐛 davidburstrom
davidburstrom

🐛 dbirkman-paloalto
dbirkman-paloalto

🐛 deepak-patra
deepak-patra

🐛 - dependabot[bot]
dependabot[bot]

💻 🐛 + dependabot[bot]
dependabot[bot]

💻 🐛 dinesh150
dinesh150

🐛 diziaq
diziaq

🐛 dreaminpast123
dreaminpast123

🐛 duanyanan
duanyanan

🐛 dutt-sanjay
dutt-sanjay

🐛 duursma
duursma

💻 - dylanleung
dylanleung

🐛 + dylanleung
dylanleung

🐛 dzeigler
dzeigler

🐛 eant60
eant60

🐛 ekkirala
ekkirala

🐛 emersonmoura
emersonmoura

🐛 emouty
emouty

💻 eugenepugach
eugenepugach

🐛 - fairy
fairy

🐛 + fairy
fairy

🐛 filiprafalowicz
filiprafalowicz

💻 flxbl-io
flxbl-io

💵 foxmason
foxmason

🐛 frankegabor
frankegabor

🐛 frankl
frankl

🐛 freafrea
freafrea

🐛 - fsapatin
fsapatin

🐛 + fsapatin
fsapatin

🐛 gearsethenry
gearsethenry

🐛 gracia19
gracia19

🐛 guo fei
guo fei

🐛 gurmsc5
gurmsc5

🐛 gwilymatgearset
gwilymatgearset

💻 🐛 haigsn
haigsn

🐛 - hemanshu070
hemanshu070

🐛 + hemanshu070
hemanshu070

🐛 henrik242
henrik242

🐛 hongpuwu
hongpuwu

🐛 hvbtup
hvbtup

💻 🐛 igniti GmbH
igniti GmbH

🐛 ilovezfs
ilovezfs

🐛 imax-erik
imax-erik

🐛 - itaigilo
itaigilo

🐛 + itaigilo
itaigilo

🐛 jakivey32
jakivey32

🐛 jbennett2091
jbennett2091

🐛 jcamerin
jcamerin

🐛 jkeener1
jkeener1

🐛 jmetertea
jmetertea

🐛 johnra2
johnra2

💻 - johnzhao9
johnzhao9

🐛 + johnzhao9
johnzhao9

🐛 josemanuelrolon
josemanuelrolon

💻 🐛 kabroxiko
kabroxiko

💻 🐛 karthikaiyasamy
karthikaiyasamy

📖 karwer
karwer

🐛 kaulonline
kaulonline

🐛 kdaemonv
kdaemonv

🐛 - kdebski85
kdebski85

🐛 💻 + kdebski85
kdebski85

🐛 💻 kenji21
kenji21

💻 🐛 kfranic
kfranic

🐛 khalidkh
khalidkh

🐛 koalalam
koalalam

🐛 krzyk
krzyk

🐛 lasselindqvist
lasselindqvist

🐛 - lgemeinhardt
lgemeinhardt

🐛 + lgemeinhardt
lgemeinhardt

🐛 lihuaib
lihuaib

🐛 liqingjun123
liqingjun123

🐛 lonelyma1021
lonelyma1021

🐛 lpeddy
lpeddy

🐛 lujiefsi
lujiefsi

💻 lukelukes
lukelukes

💻 - lyriccoder
lyriccoder

🐛 + lyriccoder
lyriccoder

🐛 marcelmore
marcelmore

🐛 matchbox
matchbox

🐛 matthiaskraaz
matthiaskraaz

🐛 meandonlyme
meandonlyme

🐛 mikesive
mikesive

🐛 milossesic
milossesic

🐛 - mluckam
mluckam

💻 🐛 + mluckam
mluckam

💻 🐛 mohan-chinnappan-n
mohan-chinnappan-n

💻 mriddell95
mriddell95

🐛 mrlzh
mrlzh

🐛 msloan
msloan

🐛 mucharlaravalika
mucharlaravalika

🐛 mvenneman
mvenneman

🐛 - nareshl119
nareshl119

🐛 + nareshl119
nareshl119

🐛 nicolas-harraudeau-sonarsource
nicolas-harraudeau-sonarsource

🐛 noerremark
noerremark

🐛 novsirion
novsirion

🐛 nwcm
nwcm

📖 🐛 💻 oggboy
oggboy

🐛 oinume
oinume

🐛 - orimarko
orimarko

💻 🐛 + orimarko
orimarko

💻 🐛 pablogomez2197
pablogomez2197

🐛 pacvz
pacvz

💻 pallavi agarwal
pallavi agarwal

🐛 parksungrin
parksungrin

🐛 patpatpat123
patpatpat123

🐛 patriksevallius
patriksevallius

🐛 - pbrajesh1
pbrajesh1

🐛 + pbrajesh1
pbrajesh1

🐛 phoenix384
phoenix384

🐛 piotrszymanski-sc
piotrszymanski-sc

💻 plan3d
plan3d

🐛 poojasix
poojasix

🐛 prabhushrikant
prabhushrikant

🐛 pujitha8783
pujitha8783

🐛 - r-r-a-j
r-r-a-j

🐛 + r-r-a-j
r-r-a-j

🐛 raghujayjunk
raghujayjunk

🐛 rajeshveera
rajeshveera

🐛 rajeswarreddy88
rajeswarreddy88

🐛 recdevs
recdevs

🐛 reudismam
reudismam

💻 🐛 rijkt
rijkt

🐛 - rillig-tk
rillig-tk

🐛 + rillig-tk
rillig-tk

🐛 rmohan20
rmohan20

💻 🐛 rnveach
rnveach

🐛 rxmicro
rxmicro

🐛 ryan-gustafson
ryan-gustafson

💻 🐛 sabi0
sabi0

🐛 scais
scais

🐛 - schosin
schosin

🐛 + schosin
schosin

🐛 screamingfrog
screamingfrog

💵 sebbASF
sebbASF

🐛 sergeygorbaty
sergeygorbaty

💻 shilko2013
shilko2013

🐛 shiomiyan
shiomiyan

📖 simeonKondr
simeonKondr

🐛 - snajberk
snajberk

🐛 + snajberk
snajberk

🐛 sniperrifle2004
sniperrifle2004

🐛 snuyanzin
snuyanzin

🐛 💻 soloturn
soloturn

🐛 soyodream
soyodream

🐛 sratz
sratz

🐛 stonio
stonio

🐛 - sturton
sturton

💻 🐛 + sturton
sturton

💻 🐛 sudharmohan
sudharmohan

🐛 suruchidawar
suruchidawar

🐛 svenfinitiv
svenfinitiv

🐛 szymanp23
szymanp23

🐛 💻 tashiscool
tashiscool

🐛 test-git-hook
test-git-hook

🐛 - testation21
testation21

💻 🐛 + testation21
testation21

💻 🐛 thanosa
thanosa

🐛 tiandiyixian
tiandiyixian

🐛 tobwoerk
tobwoerk

🐛 tprouvot
tprouvot

🐛 💻 trentchilders
trentchilders

🐛 triandicAnt
triandicAnt

🐛 - trishul14
trishul14

🐛 + trishul14
trishul14

🐛 tsui
tsui

🐛 wangzitom12306
wangzitom12306

🐛 winhkey
winhkey

🐛 witherspore
witherspore

🐛 wjljack
wjljack

🐛 wuchiuwong
wuchiuwong

🐛 - xingsong
xingsong

🐛 + xingsong
xingsong

🐛 xioayuge
xioayuge

🐛 xnYi9wRezm
xnYi9wRezm

💻 🐛 xuanuy
xuanuy

🐛 xyf0921
xyf0921

🐛 yalechen-cyw3
yalechen-cyw3

🐛 yasuharu-sato
yasuharu-sato

🐛 - zenglian
zenglian

🐛 + zenglian
zenglian

🐛 zgrzyt93
zgrzyt93

💻 🐛 zh3ng
zh3ng

🐛 zt_soft
zt_soft

🐛 ztt79
ztt79

🐛 zzzzfeng
zzzzfeng

🐛 Árpád Magosányi
Árpád Magosányi

🐛 - 任贵杰
任贵杰

🐛 + 任贵杰
任贵杰

🐛 茅延安
茅延安

💻 From cd50d392d1fe2c2ec5879de3fd86c3e0f675a406 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sun, 22 Sep 2024 14:51:26 +0200 Subject: [PATCH 20/46] Add @SaschaRiemer as a contributor --- .all-contributorsrc | 9 +++ docs/pages/pmd/projectdocs/credits.md | 91 ++++++++++++++------------- 2 files changed, 55 insertions(+), 45 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 0838748b28..07507c2070 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -7791,6 +7791,15 @@ "contributions": [ "code" ] + }, + { + "login": "SaschaRiemer", + "name": "Sascha Riemer", + "avatar_url": "https://avatars.githubusercontent.com/u/108794941?v=4", + "profile": "https://github.com/SaschaRiemer", + "contributions": [ + "bug" + ] } ], "contributorsPerLine": 7, diff --git a/docs/pages/pmd/projectdocs/credits.md b/docs/pages/pmd/projectdocs/credits.md index a574b470ff..3a787ab38d 100644 --- a/docs/pages/pmd/projectdocs/credits.md +++ b/docs/pages/pmd/projectdocs/credits.md @@ -700,410 +700,411 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Sam Carlberg
Sam Carlberg

🐛 + Sascha Riemer
Sascha Riemer

🐛 Sashko
Sashko

💻 Satoshi Kubo
Satoshi Kubo

🐛 Scott Kennedy
Scott Kennedy

🐛 Scott Wells
Scott Wells

🐛 💻 Scrates1
Scrates1

🐛 💻 - Scrsloota
Scrsloota

💻 + Scrsloota
Scrsloota

💻 Sebastian Bögl
Sebastian Bögl

🐛 Sebastian Davids
Sebastian Davids

🐛 Sebastian Schuberth
Sebastian Schuberth

🐛 Sebastian Schwarz
Sebastian Schwarz

🐛 Seren
Seren

🐛 💻 Sergey Gorbaty
Sergey Gorbaty

🐛 - Sergey Kozlov
Sergey Kozlov

🐛 + Sergey Kozlov
Sergey Kozlov

🐛 Sergey Yanzin
Sergey Yanzin

💻 🐛 Seth Wilcox
Seth Wilcox

💻 Shai Bennathan
Shai Bennathan

🐛 💻 Shubham
Shubham

💻 🐛 Simon Abykov
Simon Abykov

💻 🐛 Simon Xiao
Simon Xiao

🐛 - Srinivasan Venkatachalam
Srinivasan Venkatachalam

🐛 + Srinivasan Venkatachalam
Srinivasan Venkatachalam

🐛 Stanislav Gromov
Stanislav Gromov

🐛 Stanislav Myachenkov
Stanislav Myachenkov

💻 Stefan Birkner
Stefan Birkner

🐛 Stefan Bohn
Stefan Bohn

🐛 Stefan Endrullis
Stefan Endrullis

🐛 Stefan Klöss-Schuster
Stefan Klöss-Schuster

🐛 - Stefan Wolf
Stefan Wolf

🐛 + Stefan Wolf
Stefan Wolf

🐛 Stephan H. Wissel
Stephan H. Wissel

🐛 Stephen
Stephen

🐛 Stephen Carter
Stephen Carter

🐛 Stephen Friedrich
Stephen Friedrich

🐛 Steve Babula
Steve Babula

💻 Steven Stearns
Steven Stearns

🐛 💻 - Stexxe
Stexxe

🐛 + Stexxe
Stexxe

🐛 Stian Lågstad
Stian Lågstad

🐛 StuartClayton5
StuartClayton5

🐛 Supun Arunoda
Supun Arunoda

🐛 Suren Abrahamyan
Suren Abrahamyan

🐛 Suvashri
Suvashri

📖 SwatiBGupta1110
SwatiBGupta1110

🐛 - SyedThoufich
SyedThoufich

🐛 + SyedThoufich
SyedThoufich

🐛 Szymon Sasin
Szymon Sasin

🐛 T-chuangxin
T-chuangxin

🐛 TERAI Atsuhiro
TERAI Atsuhiro

🐛 TIOBE Software
TIOBE Software

💻 🐛 Tarush Singh
Tarush Singh

💻 Taylor Smock
Taylor Smock

🐛 - Techeira Damián
Techeira Damián

💻 🐛 + Techeira Damián
Techeira Damián

💻 🐛 Ted Husted
Ted Husted

🐛 TehBakker
TehBakker

🐛 The Gitter Badger
The Gitter Badger

🐛 Theodoor
Theodoor

🐛 Thiago Henrique Hüpner
Thiago Henrique Hüpner

🐛 Thibault Meyer
Thibault Meyer

🐛 - Thomas Güttler
Thomas Güttler

🐛 + Thomas Güttler
Thomas Güttler

🐛 Thomas Jones-Low
Thomas Jones-Low

🐛 Thomas Smith
Thomas Smith

💻 🐛 ThrawnCA
ThrawnCA

🐛 Thu Vo
Thu Vo

🐛 Thunderforge
Thunderforge

💻 🐛 Tim van der Lippe
Tim van der Lippe

🐛 - Tobias Weimer
Tobias Weimer

💻 🐛 + Tobias Weimer
Tobias Weimer

💻 🐛 Tom Copeland
Tom Copeland

🐛 💻 📖 Tom Daly
Tom Daly

🐛 Tomas
Tomas

🐛 Tomer Figenblat
Tomer Figenblat

🐛 Tomi De Lucca
Tomi De Lucca

💻 🐛 Tony
Tony

📖 - Torsten Kleiber
Torsten Kleiber

🐛 + Torsten Kleiber
Torsten Kleiber

🐛 TrackerSB
TrackerSB

🐛 Tyson Stewart
Tyson Stewart

🐛 Ullrich Hafner
Ullrich Hafner

🐛 Utku Cuhadaroglu
Utku Cuhadaroglu

💻 🐛 Valentin Brandl
Valentin Brandl

🐛 Valeria
Valeria

🐛 - Valery Yatsynovich
Valery Yatsynovich

📖 + Valery Yatsynovich
Valery Yatsynovich

📖 Vasily Anisimov
Vasily Anisimov

🐛 Vedant Chokshi
Vedant Chokshi

🐛 Vibhor Goyal
Vibhor Goyal

🐛 Vickenty Fesunov
Vickenty Fesunov

🐛 Victor Noël
Victor Noël

🐛 Vincent Galloy
Vincent Galloy

💻 - Vincent HUYNH
Vincent HUYNH

🐛 + Vincent HUYNH
Vincent HUYNH

🐛 Vincent Maurin
Vincent Maurin

🐛 Vincent Privat
Vincent Privat

🐛 Vishhwas
Vishhwas

🐛 Vishv_Android
Vishv_Android

🐛 Vitaly
Vitaly

🐛 Vitaly Polonetsky
Vitaly Polonetsky

🐛 - Vojtech Polivka
Vojtech Polivka

🐛 + Vojtech Polivka
Vojtech Polivka

🐛 Vsevolod Zholobov
Vsevolod Zholobov

🐛 Vyom Yadav
Vyom Yadav

💻 Wang Shidong
Wang Shidong

🐛 Waqas Ahmed
Waqas Ahmed

🐛 Wayne J. Earl
Wayne J. Earl

🐛 Wchenghui
Wchenghui

🐛 - Wener
Wener

💻 + Wener
Wener

💻 Will Winder
Will Winder

🐛 William Brockhus
William Brockhus

💻 🐛 Wilson Kurniawan
Wilson Kurniawan

🐛 Wim Deblauwe
Wim Deblauwe

🐛 Woongsik Choi
Woongsik Choi

🐛 XenoAmess
XenoAmess

💻 🐛 - Yang
Yang

💻 + Yang
Yang

💻 YaroslavTER
YaroslavTER

🐛 Yasar Shaikh
Yasar Shaikh

💻 Young Chan
Young Chan

💻 🐛 YuJin Kim
YuJin Kim

🐛 Yuri Dolzhenko
Yuri Dolzhenko

🐛 Yurii Dubinka
Yurii Dubinka

🐛 - Zoltan Farkas
Zoltan Farkas

🐛 + Zoltan Farkas
Zoltan Farkas

🐛 Zustin
Zustin

🐛 aaronhurst-google
aaronhurst-google

🐛 💻 alexmodis
alexmodis

🐛 andreoss
andreoss

🐛 andrey81inmd
andrey81inmd

💻 🐛 anicoara
anicoara

🐛 - arunprasathav
arunprasathav

🐛 + arunprasathav
arunprasathav

🐛 asiercamara
asiercamara

🐛 astillich-igniti
astillich-igniti

💻 avesolovksyy
avesolovksyy

🐛 avishvat
avishvat

🐛 avivmu
avivmu

🐛 axelbarfod1
axelbarfod1

🐛 - b-3-n
b-3-n

🐛 + b-3-n
b-3-n

🐛 balbhadra9
balbhadra9

🐛 base23de
base23de

🐛 bergander
bergander

🐛 💻 berkam
berkam

💻 🐛 breizh31
breizh31

🐛 caesarkim
caesarkim

🐛 - carolyujing
carolyujing

🐛 + carolyujing
carolyujing

🐛 cbfiddle
cbfiddle

🐛 cesares-basilico
cesares-basilico

🐛 chrite
chrite

🐛 ciufudean
ciufudean

📖 cobratbq
cobratbq

🐛 coladict
coladict

🐛 - cosmoJFH
cosmoJFH

🐛 + cosmoJFH
cosmoJFH

🐛 cristalp
cristalp

🐛 crunsk
crunsk

🐛 cwholmes
cwholmes

🐛 cyberjj999
cyberjj999

🐛 cyw3
cyw3

🐛 📖 d1ss0nanz
d1ss0nanz

🐛 - dague1
dague1

📖 + dague1
dague1

📖 dalizi007
dalizi007

💻 danbrycefairsailcom
danbrycefairsailcom

🐛 dariansanity
dariansanity

🐛 darrenmiliband
darrenmiliband

🐛 davidburstrom
davidburstrom

🐛 dbirkman-paloalto
dbirkman-paloalto

🐛 - deepak-patra
deepak-patra

🐛 + deepak-patra
deepak-patra

🐛 dependabot[bot]
dependabot[bot]

💻 🐛 dinesh150
dinesh150

🐛 diziaq
diziaq

🐛 dreaminpast123
dreaminpast123

🐛 duanyanan
duanyanan

🐛 dutt-sanjay
dutt-sanjay

🐛 - duursma
duursma

💻 + duursma
duursma

💻 dylanleung
dylanleung

🐛 dzeigler
dzeigler

🐛 eant60
eant60

🐛 ekkirala
ekkirala

🐛 emersonmoura
emersonmoura

🐛 emouty
emouty

💻 - eugenepugach
eugenepugach

🐛 + eugenepugach
eugenepugach

🐛 fairy
fairy

🐛 filiprafalowicz
filiprafalowicz

💻 flxbl-io
flxbl-io

💵 foxmason
foxmason

🐛 frankegabor
frankegabor

🐛 frankl
frankl

🐛 - freafrea
freafrea

🐛 + freafrea
freafrea

🐛 fsapatin
fsapatin

🐛 gearsethenry
gearsethenry

🐛 gracia19
gracia19

🐛 guo fei
guo fei

🐛 gurmsc5
gurmsc5

🐛 gwilymatgearset
gwilymatgearset

💻 🐛 - haigsn
haigsn

🐛 + haigsn
haigsn

🐛 hemanshu070
hemanshu070

🐛 henrik242
henrik242

🐛 hongpuwu
hongpuwu

🐛 hvbtup
hvbtup

💻 🐛 igniti GmbH
igniti GmbH

🐛 ilovezfs
ilovezfs

🐛 - imax-erik
imax-erik

🐛 + imax-erik
imax-erik

🐛 itaigilo
itaigilo

🐛 jakivey32
jakivey32

🐛 jbennett2091
jbennett2091

🐛 jcamerin
jcamerin

🐛 jkeener1
jkeener1

🐛 jmetertea
jmetertea

🐛 - johnra2
johnra2

💻 + johnra2
johnra2

💻 johnzhao9
johnzhao9

🐛 josemanuelrolon
josemanuelrolon

💻 🐛 kabroxiko
kabroxiko

💻 🐛 karthikaiyasamy
karthikaiyasamy

📖 karwer
karwer

🐛 kaulonline
kaulonline

🐛 - kdaemonv
kdaemonv

🐛 + kdaemonv
kdaemonv

🐛 kdebski85
kdebski85

🐛 💻 kenji21
kenji21

💻 🐛 kfranic
kfranic

🐛 khalidkh
khalidkh

🐛 koalalam
koalalam

🐛 krzyk
krzyk

🐛 - lasselindqvist
lasselindqvist

🐛 + lasselindqvist
lasselindqvist

🐛 lgemeinhardt
lgemeinhardt

🐛 lihuaib
lihuaib

🐛 liqingjun123
liqingjun123

🐛 lonelyma1021
lonelyma1021

🐛 lpeddy
lpeddy

🐛 lujiefsi
lujiefsi

💻 - lukelukes
lukelukes

💻 + lukelukes
lukelukes

💻 lyriccoder
lyriccoder

🐛 marcelmore
marcelmore

🐛 matchbox
matchbox

🐛 matthiaskraaz
matthiaskraaz

🐛 meandonlyme
meandonlyme

🐛 mikesive
mikesive

🐛 - milossesic
milossesic

🐛 + milossesic
milossesic

🐛 mluckam
mluckam

💻 🐛 mohan-chinnappan-n
mohan-chinnappan-n

💻 mriddell95
mriddell95

🐛 mrlzh
mrlzh

🐛 msloan
msloan

🐛 mucharlaravalika
mucharlaravalika

🐛 - mvenneman
mvenneman

🐛 + mvenneman
mvenneman

🐛 nareshl119
nareshl119

🐛 nicolas-harraudeau-sonarsource
nicolas-harraudeau-sonarsource

🐛 noerremark
noerremark

🐛 novsirion
novsirion

🐛 nwcm
nwcm

📖 🐛 💻 oggboy
oggboy

🐛 - oinume
oinume

🐛 + oinume
oinume

🐛 orimarko
orimarko

💻 🐛 pablogomez2197
pablogomez2197

🐛 pacvz
pacvz

💻 pallavi agarwal
pallavi agarwal

🐛 parksungrin
parksungrin

🐛 patpatpat123
patpatpat123

🐛 - patriksevallius
patriksevallius

🐛 + patriksevallius
patriksevallius

🐛 pbrajesh1
pbrajesh1

🐛 phoenix384
phoenix384

🐛 piotrszymanski-sc
piotrszymanski-sc

💻 plan3d
plan3d

🐛 poojasix
poojasix

🐛 prabhushrikant
prabhushrikant

🐛 - pujitha8783
pujitha8783

🐛 + pujitha8783
pujitha8783

🐛 r-r-a-j
r-r-a-j

🐛 raghujayjunk
raghujayjunk

🐛 rajeshveera
rajeshveera

🐛 rajeswarreddy88
rajeswarreddy88

🐛 recdevs
recdevs

🐛 reudismam
reudismam

💻 🐛 - rijkt
rijkt

🐛 + rijkt
rijkt

🐛 rillig-tk
rillig-tk

🐛 rmohan20
rmohan20

💻 🐛 rnveach
rnveach

🐛 rxmicro
rxmicro

🐛 ryan-gustafson
ryan-gustafson

💻 🐛 sabi0
sabi0

🐛 - scais
scais

🐛 + scais
scais

🐛 schosin
schosin

🐛 screamingfrog
screamingfrog

💵 sebbASF
sebbASF

🐛 sergeygorbaty
sergeygorbaty

💻 shilko2013
shilko2013

🐛 shiomiyan
shiomiyan

📖 - simeonKondr
simeonKondr

🐛 + simeonKondr
simeonKondr

🐛 snajberk
snajberk

🐛 sniperrifle2004
sniperrifle2004

🐛 snuyanzin
snuyanzin

🐛 💻 soloturn
soloturn

🐛 soyodream
soyodream

🐛 sratz
sratz

🐛 - stonio
stonio

🐛 + stonio
stonio

🐛 sturton
sturton

💻 🐛 sudharmohan
sudharmohan

🐛 suruchidawar
suruchidawar

🐛 svenfinitiv
svenfinitiv

🐛 szymanp23
szymanp23

🐛 💻 tashiscool
tashiscool

🐛 - test-git-hook
test-git-hook

🐛 + test-git-hook
test-git-hook

🐛 testation21
testation21

💻 🐛 thanosa
thanosa

🐛 tiandiyixian
tiandiyixian

🐛 tobwoerk
tobwoerk

🐛 tprouvot
tprouvot

🐛 💻 trentchilders
trentchilders

🐛 - triandicAnt
triandicAnt

🐛 + triandicAnt
triandicAnt

🐛 trishul14
trishul14

🐛 tsui
tsui

🐛 wangzitom12306
wangzitom12306

🐛 winhkey
winhkey

🐛 witherspore
witherspore

🐛 wjljack
wjljack

🐛 - wuchiuwong
wuchiuwong

🐛 + wuchiuwong
wuchiuwong

🐛 xingsong
xingsong

🐛 xioayuge
xioayuge

🐛 xnYi9wRezm
xnYi9wRezm

💻 🐛 xuanuy
xuanuy

🐛 xyf0921
xyf0921

🐛 yalechen-cyw3
yalechen-cyw3

🐛 - yasuharu-sato
yasuharu-sato

🐛 + yasuharu-sato
yasuharu-sato

🐛 zenglian
zenglian

🐛 zgrzyt93
zgrzyt93

💻 🐛 zh3ng
zh3ng

🐛 zt_soft
zt_soft

🐛 ztt79
ztt79

🐛 zzzzfeng
zzzzfeng

🐛 - Árpád Magosányi
Árpád Magosányi

🐛 + Árpád Magosányi
Árpád Magosányi

🐛 任贵杰
任贵杰

🐛 茅延安
茅延安

💻 From 687f7f89e46959e122cb7a28eae6cc815e12d35c Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sun, 22 Sep 2024 14:53:00 +0200 Subject: [PATCH 21/46] [doc] Update release notes (#5068, #5224) --- docs/pages/release_notes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index b5856fd753..b626a0b762 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -28,6 +28,7 @@ This is a {{ site.pmd.release_type }} release. * java * [#5190](https://github.com/pmd/pmd/issues/5190): \[java] NPE in type inference * java-errorprone + * [#5068](https://github.com/pmd/pmd/issues/5068): \[java] MissingStaticMethodInNonInstantiatableClass: false positive with builder pattern * [#5207](https://github.com/pmd/pmd/issues/5207): \[java] CheckSkipResult: false positve for a private method `void skip(int)` in a subclass of FilterInputStream ### 🚨 API Changes @@ -35,6 +36,7 @@ This is a {{ site.pmd.release_type }} release. ### ✨ External Contributions * [#5202](https://github.com/pmd/pmd/pull/5202): \[core] Sarif format: refer to schemastore.org - [David Schach](https://github.com/dschach) (@dschach) * [#5208](https://github.com/pmd/pmd/pull/5208): \[doc] Added Codety to "Tools / Integrations" - [Tony](https://github.com/random1223) (@random1223) +* [#5224](https://github.com/pmd/pmd/pull/5224): \[java] Fix #5068: Class incorrectly identified as non-instantiatable - [Lukas Gräf](https://github.com/lukasgraef) (@lukasgraef) {% endtocmaker %} From b03a46fa8c84413f36943bb084c59a970c2cd4a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:08:39 +0200 Subject: [PATCH 22/46] Bump rouge from 4.3.0 to 4.4.0 in the all-gems group across 1 directory (#5226) Bumps the all-gems group with 1 update in the / directory: [rouge](https://github.com/rouge-ruby/rouge). Updates `rouge` from 4.3.0 to 4.4.0 - [Release notes](https://github.com/rouge-ruby/rouge/releases) - [Changelog](https://github.com/rouge-ruby/rouge/blob/master/CHANGELOG.md) - [Commits](https://github.com/rouge-ruby/rouge/compare/v4.3.0...v4.4.0) --- updated-dependencies: - dependency-name: rouge dependency-type: direct:development update-type: version-update:semver-minor dependency-group: all-gems ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9a7014556a..b8adad7272 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -70,7 +70,7 @@ GEM rchardet (1.8.0) rexml (3.3.6) strscan - rouge (4.3.0) + rouge (4.4.0) rufus-scheduler (3.9.1) fugit (~> 1.1, >= 1.1.6) safe_yaml (1.0.5) From 1acaedc158e733cdd10ca771be97417c55991e37 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:10:04 +0200 Subject: [PATCH 23/46] Bump com.google.code.gson:gson from 2.10.1 to 2.11.0 (#5227) Bumps [com.google.code.gson:gson](https://github.com/google/gson) from 2.10.1 to 2.11.0. - [Release notes](https://github.com/google/gson/releases) - [Changelog](https://github.com/google/gson/blob/main/CHANGELOG.md) - [Commits](https://github.com/google/gson/compare/gson-parent-2.10.1...gson-parent-2.11.0) --- updated-dependencies: - dependency-name: com.google.code.gson:gson dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aef0039d8b..791c6b58c5 100644 --- a/pom.xml +++ b/pom.xml @@ -886,7 +886,7 @@ com.google.code.gson gson - 2.10.1 + 2.11.0 org.yaml From 7b5ef1009386d0a983045dda7e27f1a935690710 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 26 Sep 2024 15:20:28 +0200 Subject: [PATCH 24/46] [doc] Update release notes (#5046, #5191) --- docs/pages/release_notes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 7fc215597c..777464c300 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -18,6 +18,8 @@ This is a {{ site.pmd.release_type }} release. * apex * [#5163](https://github.com/pmd/pmd/issues/5163): \[apex] Parser error when using toLabel in SOSL query * [#5182](https://github.com/pmd/pmd/issues/5182): \[apex] Parser error when using GROUPING in a SOQL query +* java-codestyle + * [#5046](https://github.com/pmd/pmd/issues/5046): \[java] LocalVariableCouldBeFinal false positive with try/catch ### 🚨 API Changes From 29ed91795b6e02cf61f70035b589add472aecdfe Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 26 Sep 2024 15:54:08 +0200 Subject: [PATCH 25/46] [doc] README: Fix build status badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0502c07ec1..0d2253b4e8 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ![PMD Logo](https://raw.githubusercontent.com/pmd/pmd/pmd/main/docs/images/logo/pmd-logo-300px.png) [![Join the chat](https://img.shields.io/gitter/room/pmd/pmd)](https://app.gitter.im/#/room/#pmd_pmd:gitter.im?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![Build Status](https://github.com/pmd/pmd/workflows/build/badge.svg?branch=main)](https://github.com/pmd/pmd/actions) +[![Build Status](https://github.com/pmd/pmd/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/pmd/pmd/actions) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.sourceforge.pmd/pmd/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.sourceforge.pmd/pmd) [![Reproducible Builds](https://img.shields.io/badge/Reproducible_Builds-ok-green?labelColor=blue)](https://github.com/jvm-repo-rebuild/reproducible-central/tree/master/content/net/sourceforge/pmd#readme) [![Coverage Status](https://coveralls.io/repos/github/pmd/pmd/badge.svg)](https://coveralls.io/github/pmd/pmd) From e4107ccaaa5928e79ca9adaf62a7bd7e26b2bfdb Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 26 Sep 2024 16:26:26 +0200 Subject: [PATCH 26/46] [doc] README: Fix PMD logo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d2253b4e8..7a4fde521c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PMD - source code analyzer -![PMD Logo](https://raw.githubusercontent.com/pmd/pmd/pmd/main/docs/images/logo/pmd-logo-300px.png) +![PMD Logo](https://raw.githubusercontent.com/pmd/pmd/main/docs/images/logo/pmd-logo-300px.png) [![Join the chat](https://img.shields.io/gitter/room/pmd/pmd)](https://app.gitter.im/#/room/#pmd_pmd:gitter.im?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://github.com/pmd/pmd/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/pmd/pmd/actions) From 083e296c1e98568d74b898a3d9d09fbdcb738fbd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 16:36:02 +0200 Subject: [PATCH 27/46] Bump com.google.protobuf:protobuf-java from 3.25.3 to 3.25.5 (#5232) Bumps [com.google.protobuf:protobuf-java](https://github.com/protocolbuffers/protobuf) from 3.25.3 to 3.25.5. - [Release notes](https://github.com/protocolbuffers/protobuf/releases) - [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl) - [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.25.3...v3.25.5) --- updated-dependencies: - dependency-name: com.google.protobuf:protobuf-java dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 791c6b58c5..1e0f667a4d 100644 --- a/pom.xml +++ b/pom.xml @@ -1089,7 +1089,7 @@ com.google.protobuf protobuf-java - 3.25.3 + 3.25.5 - 27-SNAPSHOT + 27 7.2.0 ${settings.localRepository}/net/java/dev/javacc/javacc/${javacc.version}/javacc-${javacc.version}.jar From 74f9d7589723252fceee658aa07a374b08c4dce2 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 26 Sep 2024 11:39:48 +0200 Subject: [PATCH 30/46] [apex] Support convertCurrency() in SOQL/SOSL Fixes #5228 --- docs/pages/release_notes.md | 1 + .../pmd/lang/apex/ast/ASTSoqlExpression.java | 1 + .../pmd/lang/apex/ast/ApexTreeDumpTest.java | 8 +++ .../apex/ast/ConvertCurrencyInSoqlAndSosl.cls | 43 ++++++++++++++ .../apex/ast/ConvertCurrencyInSoqlAndSosl.txt | 57 +++++++++++++++++++ 5 files changed, 110 insertions(+) create mode 100644 pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/ConvertCurrencyInSoqlAndSosl.cls create mode 100644 pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/ConvertCurrencyInSoqlAndSosl.txt diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 5cde4e3dcd..a704bd36b2 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -55,6 +55,7 @@ What changes? * [#5163](https://github.com/pmd/pmd/issues/5163): \[apex] Parser error when using toLabel in SOSL query * [#5182](https://github.com/pmd/pmd/issues/5182): \[apex] Parser error when using GROUPING in a SOQL query * [#5218](https://github.com/pmd/pmd/issues/5218): \[apex] Parser error when using nested subqueries in SOQL + * [#5228](https://github.com/pmd/pmd/issues/5228): \[apex] Parser error when using convertCurrency() in SOQL * core * [#5059](https://github.com/pmd/pmd/issues/5059): \[core] xml output doesn't escape CDATA inside its own CDATA * [#5201](https://github.com/pmd/pmd/issues/5201): \[core] PMD sarif schema file points to nonexistent location diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTSoqlExpression.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTSoqlExpression.java index 8ec31a42cd..3b08de7d9b 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTSoqlExpression.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTSoqlExpression.java @@ -77,6 +77,7 @@ public final class ASTSoqlExpression extends AbstractApexNode.Single myList; + + myList = [ + SELECT convertcurrency(Amount) + FROM Opportunity + ]; + + // with FORMAT() + myList = [ + SELECT Amount, FORMAT(amount) Amt, convertCurrency(amount) convertedAmount, + FORMAT(convertCurrency(amount)) convertedCurrency + FROM Opportunity where id = '006R00000024gDtIAI' + ]; + + // FORMAT() with aggregate function + myList = [ SELECT FORMAT(MIN(closedate)) Amt FROM opportunity ]; + } + + void soslQueries() { + List> searchResults; + + // label with alias + searchResults = [ + FIND :searchTerm + IN ALL FIELDS + RETURNING + Account(Id, toLabel(Name) AliasName) + LIMIT 10 + ]; + + // convertCurrency + searchResults = [ FIND 'test' RETURNING Opportunity(Name, convertCurrency(Amount), convertCurrency(Amount) AliasCurrency) ]; + + // with FORMAT() + searchResults = [ FIND 'Acme' RETURNING Account(AnnualRevenue, FORMAT(convertCurrency(AnnualRevenue)) convertedCurrency) ]; + + // FORMAT() with aggregate function + searchResults = [ FIND 'Acme' RETURNING Account(AnnualRevenue, FORMAT(MIN(CloseDate))) ]; + + } +} diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/ConvertCurrencyInSoqlAndSosl.txt b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/ConvertCurrencyInSoqlAndSosl.txt new file mode 100644 index 0000000000..f297ddecfc --- /dev/null +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/ConvertCurrencyInSoqlAndSosl.txt @@ -0,0 +1,57 @@ ++- ApexFile[@DefiningType = "PmdTest", @RealLoc = true] + +- UserClass[@DefiningType = "PmdTest", @Image = "PmdTest", @InterfaceNames = (), @Nested = false, @RealLoc = true, @SimpleName = "PmdTest", @SuperClassName = ""] + +- ModifierNode[@Abstract = false, @DefiningType = "PmdTest", @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 = "queryOpportunities", @Constructor = false, @DefiningType = "PmdTest", @Image = "queryOpportunities", @RealLoc = true, @ReturnType = "void", @StaticInitializer = false] + | +- ModifierNode[@Abstract = false, @DefiningType = "PmdTest", @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 = "PmdTest", @RealLoc = true] + | +- VariableDeclarationStatements[@DefiningType = "PmdTest", @RealLoc = true] + | | +- ModifierNode[@Abstract = false, @DefiningType = "PmdTest", @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] + | | +- VariableDeclaration[@DefiningType = "PmdTest", @Image = "myList", @RealLoc = true, @Type = "List"] + | | +- VariableExpression[@DefiningType = "PmdTest", @Image = "myList", @RealLoc = true] + | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] + | +- ExpressionStatement[@DefiningType = "PmdTest", @RealLoc = true] + | | +- AssignmentExpression[@DefiningType = "PmdTest", @Op = AssignmentOperator.EQUALS, @RealLoc = true] + | | +- VariableExpression[@DefiningType = "PmdTest", @Image = "myList", @RealLoc = true] + | | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] + | | +- SoqlExpression[@CanonicalQuery = "SELECT CONVERTCURRENCY(Amount)\n FROM Opportunity", @DefiningType = "PmdTest", @Query = "SELECT convertcurrency(Amount)\n FROM Opportunity", @RealLoc = true] + | +- ExpressionStatement[@DefiningType = "PmdTest", @RealLoc = true] + | | +- AssignmentExpression[@DefiningType = "PmdTest", @Op = AssignmentOperator.EQUALS, @RealLoc = true] + | | +- VariableExpression[@DefiningType = "PmdTest", @Image = "myList", @RealLoc = true] + | | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] + | | +- SoqlExpression[@CanonicalQuery = "SELECT Amount, FORMAT(amount) Amt, CONVERTCURRENCY(amount) convertedAmount,\n FORMAT(CONVERTCURRENCY(amount)) convertedCurrency\n FROM Opportunity WHERE id = \'006R00000024gDtIAI\'", @DefiningType = "PmdTest", @Query = "SELECT Amount, FORMAT(amount) Amt, convertCurrency(amount) convertedAmount,\n FORMAT(convertCurrency(amount)) convertedCurrency\n FROM Opportunity where id = \'006R00000024gDtIAI\'", @RealLoc = true] + | +- ExpressionStatement[@DefiningType = "PmdTest", @RealLoc = true] + | +- AssignmentExpression[@DefiningType = "PmdTest", @Op = AssignmentOperator.EQUALS, @RealLoc = true] + | +- VariableExpression[@DefiningType = "PmdTest", @Image = "myList", @RealLoc = true] + | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] + | +- SoqlExpression[@CanonicalQuery = "SELECT FORMAT(MIN(closedate)) Amt FROM opportunity", @DefiningType = "PmdTest", @Query = "SELECT FORMAT(MIN(closedate)) Amt FROM opportunity", @RealLoc = true] + +- Method[@Arity = 0, @CanonicalName = "soslQueries", @Constructor = false, @DefiningType = "PmdTest", @Image = "soslQueries", @RealLoc = true, @ReturnType = "void", @StaticInitializer = false] + +- ModifierNode[@Abstract = false, @DefiningType = "PmdTest", @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 = "PmdTest", @RealLoc = true] + +- VariableDeclarationStatements[@DefiningType = "PmdTest", @RealLoc = true] + | +- ModifierNode[@Abstract = false, @DefiningType = "PmdTest", @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] + | +- VariableDeclaration[@DefiningType = "PmdTest", @Image = "searchResults", @RealLoc = true, @Type = "List>"] + | +- VariableExpression[@DefiningType = "PmdTest", @Image = "searchResults", @RealLoc = true] + | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] + +- ExpressionStatement[@DefiningType = "PmdTest", @RealLoc = true] + | +- AssignmentExpression[@DefiningType = "PmdTest", @Op = AssignmentOperator.EQUALS, @RealLoc = true] + | +- VariableExpression[@DefiningType = "PmdTest", @Image = "searchResults", @RealLoc = true] + | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] + | +- SoslExpression[@CanonicalQuery = "FIND :tmpVar1\n IN ALL FIELDS\n RETURNING\n Account(Id, TOLABEL(Name) AliasName)\n LIMIT 10", @DefiningType = "PmdTest", @Query = "\n FIND :searchTerm\n IN ALL FIELDS\n RETURNING\n Account(Id, toLabel(Name) AliasName)\n LIMIT 10\n ", @RealLoc = true] + | +- BindExpressions[@DefiningType = "PmdTest", @RealLoc = true] + | +- VariableExpression[@DefiningType = "PmdTest", @Image = "searchTerm", @RealLoc = true] + | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] + +- ExpressionStatement[@DefiningType = "PmdTest", @RealLoc = true] + | +- AssignmentExpression[@DefiningType = "PmdTest", @Op = AssignmentOperator.EQUALS, @RealLoc = true] + | +- VariableExpression[@DefiningType = "PmdTest", @Image = "searchResults", @RealLoc = true] + | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] + | +- SoslExpression[@CanonicalQuery = "FIND \'test\' RETURNING Opportunity(Name, CONVERTCURRENCY(Amount), CONVERTCURRENCY(Amount) AliasCurrency)", @DefiningType = "PmdTest", @Query = " FIND \'test\' RETURNING Opportunity(Name, convertCurrency(Amount), convertCurrency(Amount) AliasCurrency) ", @RealLoc = true] + +- ExpressionStatement[@DefiningType = "PmdTest", @RealLoc = true] + | +- AssignmentExpression[@DefiningType = "PmdTest", @Op = AssignmentOperator.EQUALS, @RealLoc = true] + | +- VariableExpression[@DefiningType = "PmdTest", @Image = "searchResults", @RealLoc = true] + | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] + | +- SoslExpression[@CanonicalQuery = "FIND \'Acme\' RETURNING Account(AnnualRevenue, FORMAT(CONVERTCURRENCY(AnnualRevenue)) convertedCurrency)", @DefiningType = "PmdTest", @Query = " FIND \'Acme\' RETURNING Account(AnnualRevenue, FORMAT(convertCurrency(AnnualRevenue)) convertedCurrency) ", @RealLoc = true] + +- ExpressionStatement[@DefiningType = "PmdTest", @RealLoc = true] + +- AssignmentExpression[@DefiningType = "PmdTest", @Op = AssignmentOperator.EQUALS, @RealLoc = true] + +- VariableExpression[@DefiningType = "PmdTest", @Image = "searchResults", @RealLoc = true] + | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] + +- SoslExpression[@CanonicalQuery = "FIND \'Acme\' RETURNING Account(AnnualRevenue, FORMAT(MIN(CloseDate)))", @DefiningType = "PmdTest", @Query = " FIND \'Acme\' RETURNING Account(AnnualRevenue, FORMAT(MIN(CloseDate))) ", @RealLoc = true] From c84ffb8e0b0669cf3c265859e79d18a74165f54a Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 26 Sep 2024 18:50:00 +0200 Subject: [PATCH 31/46] [apex] Bump apex-parser from 4.2.0 to 4.3.0 --- pmd-apex/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmd-apex/pom.xml b/pmd-apex/pom.xml index c616dde033..b045cffa2d 100644 --- a/pmd-apex/pom.xml +++ b/pmd-apex/pom.xml @@ -96,7 +96,7 @@ io.github.apex-dev-tools apex-parser - 4.2.0 + 4.3.0 com.google.summit From 6f518c8304b283de0b38759f12d52a80ddd0f53c Mon Sep 17 00:00:00 2001 From: David Schach <636977+dschach@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:28:39 -0700 Subject: [PATCH 32/46] [doc] Improve doc for --show-suppressed - it's only supported for specific formats - currently: xml, html, summaryhtml Fixes #5229 --- docs/pages/pmd/userdocs/cli_reference.md | 2 +- docs/pages/pmd/userdocs/pmd_report_formats.md | 2 +- docs/pages/release_notes.md | 2 ++ .../net/sourceforge/pmd/cli/commands/internal/PmdCommand.java | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/pages/pmd/userdocs/cli_reference.md b/docs/pages/pmd/userdocs/cli_reference.md index a499b49cf8..535a5fa945 100644 --- a/docs/pages/pmd/userdocs/cli_reference.md +++ b/docs/pages/pmd/userdocs/cli_reference.md @@ -159,7 +159,7 @@ The tool comes with a rather extensive help text, simply running with `--help`! description="Path to a file to which report output is written. The file is created if it does not exist. If this option is not specified, the report is rendered to standard output." %} {% include custom/cli_option_row.html options="--show-suppressed" - description="Causes the suppressed rule violations to be added to the report." + description="Causes the suppressed rule violations to be added to the report if supported by the report format. See [PMD Report formats](pmd_userdocs_report_formats.html) for details." %} {% include custom/cli_option_row.html options="--suppress-marker" option_arg="marker" diff --git a/docs/pages/pmd/userdocs/pmd_report_formats.md b/docs/pages/pmd/userdocs/pmd_report_formats.md index c0e4760e54..0b32afb05e 100644 --- a/docs/pages/pmd/userdocs/pmd_report_formats.md +++ b/docs/pages/pmd/userdocs/pmd_report_formats.md @@ -18,7 +18,7 @@ The header of the sections below are used to select the format on the command li arguments to the `--format` option. When a format accepts *properties*, those can be specified with the `--property` / `-P` option on the command-line. -{% include note.html content="Suppressed violations are only reported, if the CLI parameter `--show-suppressed` is set." %} +{% include note.html content="Suppressed violations are only reported, if the CLI parameter `--show-suppressed` is set and if the format supports showing suppressed violations. Currently only html, summaryhtml and xml show suppressed violations." %} ## sarif diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 5cde4e3dcd..26ec1d0f89 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -59,6 +59,7 @@ What changes? * [#5059](https://github.com/pmd/pmd/issues/5059): \[core] xml output doesn't escape CDATA inside its own CDATA * [#5201](https://github.com/pmd/pmd/issues/5201): \[core] PMD sarif schema file points to nonexistent location * [#5222](https://github.com/pmd/pmd/issues/5222): \[core] RuleReference/RuleSetWriter don't handle changed default property values correctly + * [#5229](https://github.com/pmd/pmd/issues/5229): \[doc] CLI flag `--show-suppressed` needs to mention xml, html, summaryhtml * java * [#5190](https://github.com/pmd/pmd/issues/5190): \[java] NPE in type inference * java-codestyle @@ -73,6 +74,7 @@ What changes? * [#5202](https://github.com/pmd/pmd/pull/5202): \[core] Sarif format: refer to schemastore.org - [David Schach](https://github.com/dschach) (@dschach) * [#5208](https://github.com/pmd/pmd/pull/5208): \[doc] Added Codety to "Tools / Integrations" - [Tony](https://github.com/random1223) (@random1223) * [#5224](https://github.com/pmd/pmd/pull/5224): \[java] Fix #5068: Class incorrectly identified as non-instantiatable - [Lukas Gräf](https://github.com/lukasgraef) (@lukasgraef) +* [#5230](https://github.com/pmd/pmd/pull/5230): \[doc] Documentation update for --show-suppressed flag - [David Schach](https://github.com/dschach) (@dschach) {% endtocmaker %} diff --git a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdCommand.java b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdCommand.java index f60632ba63..de3fe49ec3 100644 --- a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdCommand.java +++ b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdCommand.java @@ -138,7 +138,7 @@ public class PmdCommand extends AbstractAnalysisPmdSubcommand this.benchmark = benchmark; } - @Option(names = "--show-suppressed", description = "Report should show suppressed rule violations.") + @Option(names = "--show-suppressed", description = "Report should show suppressed rule violations if supported by the report format.") public void setShowSuppressed(final boolean showSuppressed) { this.showSuppressed = showSuppressed; } From 03fba2443a071279ede3da764e95e7138b8f9508 Mon Sep 17 00:00:00 2001 From: David Schach <636977+dschach@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:32:54 -0700 Subject: [PATCH 33/46] [doc] Update @dschach as a contributor --- .all-contributorsrc | 3 ++- docs/pages/pmd/projectdocs/credits.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 07507c2070..c83958d2ac 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -7753,7 +7753,8 @@ "profile": "https://github.com/dschach", "contributions": [ "bug", - "code" + "code", + "doc" ] }, { diff --git a/docs/pages/pmd/projectdocs/credits.md b/docs/pages/pmd/projectdocs/credits.md index 3a787ab38d..b452f33c01 100644 --- a/docs/pages/pmd/projectdocs/credits.md +++ b/docs/pages/pmd/projectdocs/credits.md @@ -226,7 +226,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d David M. Karr (fullname at gmail.com)
David M. Karr (fullname at gmail.com)

🐛 David Renz
David Renz

💻 🐛 David Renz
David Renz

🐛 - David Schach
David Schach

🐛 💻 + David Schach
David Schach

🐛 💻 📖 Dawid Ciok
Dawid Ciok

🐛 💻 Debamoy Datta
Debamoy Datta

💻 From 5261a6d60e04d7677fa4fd4091a98e6c0f341e7b Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 27 Sep 2024 09:33:33 +0200 Subject: [PATCH 34/46] [doc] Update contributors - Add @kratoon as a contributor - Add @mattr9124 as a contributor --- .all-contributorsrc | 18 ++ docs/pages/pmd/projectdocs/credits.md | 244 +++++++++++++------------- 2 files changed, 141 insertions(+), 121 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index c83958d2ac..28d946f30a 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -7801,6 +7801,24 @@ "contributions": [ "bug" ] + }, + { + "login": "kratoon", + "name": "Ondrej Kratochvil", + "avatar_url": "https://avatars.githubusercontent.com/u/26163421?v=4", + "profile": "https://github.com/kratoon", + "contributions": [ + "bug" + ] + }, + { + "login": "mattr9124", + "name": "Matthew Rossner", + "avatar_url": "https://avatars.githubusercontent.com/u/8940608?v=4", + "profile": "https://github.com/mattr9124", + "contributions": [ + "bug" + ] } ], "contributorsPerLine": 7, diff --git a/docs/pages/pmd/projectdocs/credits.md b/docs/pages/pmd/projectdocs/credits.md index b452f33c01..4795947746 100644 --- a/docs/pages/pmd/projectdocs/credits.md +++ b/docs/pages/pmd/projectdocs/credits.md @@ -523,587 +523,589 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Matthew Amos
Matthew Amos

🐛 Matthew Duggan
Matthew Duggan

🐛 Matthew Hall
Matthew Hall

🐛 + Matthew Rossner
Matthew Rossner

🐛 Matías Fraga
Matías Fraga

💻 🐛 Maxime Robert
Maxime Robert

💻 🐛 - MetaBF
MetaBF

🐛 + MetaBF
MetaBF

🐛 Metin Dagcilar
Metin Dagcilar

🐛 Michael
Michael

🐛 Michael Bell
Michael Bell

🐛 Michael Bernstein
Michael Bernstein

🐛 Michael Clay
Michael Clay

🐛 Michael Dombrowski
Michael Dombrowski

🐛 - Michael Hausegger
Michael Hausegger

🐛 + Michael Hausegger
Michael Hausegger

🐛 Michael Hoefer
Michael Hoefer

🐛 Michael Kolesnikov
Michael Kolesnikov

🐛 Michael Möbius
Michael Möbius

🐛 Michael N. Lipp
Michael N. Lipp

🐛 Michael Pellegrini
Michael Pellegrini

🐛 Michal Kordas
Michal Kordas

🐛 - Michał Borek
Michał Borek

🐛 + Michał Borek
Michał Borek

🐛 Michał Kuliński
Michał Kuliński

🐛 Miguel Núñez Díaz-Montes
Miguel Núñez Díaz-Montes

🐛 Mihai Ionut
Mihai Ionut

🐛 Mikhail Kuchma
Mikhail Kuchma

🐛 Mirek Hankus
Mirek Hankus

🐛 Mitch Spano
Mitch Spano

🐛 - Mladjan Gadzic
Mladjan Gadzic

🐛 + Mladjan Gadzic
Mladjan Gadzic

🐛 MrAngry52
MrAngry52

🐛 Muminur Choudhury
Muminur Choudhury

🐛 Mykhailo Palahuta
Mykhailo Palahuta

💻 🐛 Nagendra Kumar Singh
Nagendra Kumar Singh

🐛 Nahuel Barrios
Nahuel Barrios

🐛 Nakul Sharma
Nakul Sharma

🐛 - Nathan Braun
Nathan Braun

🐛 + Nathan Braun
Nathan Braun

🐛 Nathan Reynolds
Nathan Reynolds

🐛 Nathan Reynolds
Nathan Reynolds

🐛 Nathanaël
Nathanaël

🐛 Naveen
Naveen

💻 Nazdravi
Nazdravi

🐛 Neha-Dhonde
Neha-Dhonde

🐛 - Nicholas Doyle
Nicholas Doyle

🐛 + Nicholas Doyle
Nicholas Doyle

🐛 Nick Butcher
Nick Butcher

🐛 Nico Gallinal
Nico Gallinal

🐛 Nicola Dal Maso
Nicola Dal Maso

🐛 Nicolas Filotto
Nicolas Filotto

💻 Nicolas Vervelle
Nicolas Vervelle

🐛 Nicolas Vuillamy
Nicolas Vuillamy

📖 - Nikita Chursin
Nikita Chursin

🐛 + Nikita Chursin
Nikita Chursin

🐛 Niklas Baudy
Niklas Baudy

🐛 Nikolas Havrikov
Nikolas Havrikov

🐛 Nilesh Virkar
Nilesh Virkar

🐛 Nimit Patel
Nimit Patel

🐛 Niranjan Harpale
Niranjan Harpale

🐛 Nirvik Patel
Nirvik Patel

💻 - Noah Sussman
Noah Sussman

🐛 + Noah Sussman
Noah Sussman

🐛 Noah0120
Noah0120

🐛 Noam Tamim
Noam Tamim

🐛 Noel Grandin
Noel Grandin

🐛 Olaf Haalstra
Olaf Haalstra

🐛 Oleg Andreych
Oleg Andreych

💻 🐛 Oleg Pavlenko
Oleg Pavlenko

🐛 - Oleksii Dykov
Oleksii Dykov

💻 🐛 + Oleksii Dykov
Oleksii Dykov

💻 🐛 Oliver Eikemeier
Oliver Eikemeier

🐛 Oliver Siegmar
Oliver Siegmar

💵 Olivier Parent
Olivier Parent

💻 🐛 Ollie Abbey
Ollie Abbey

💻 🐛 + Ondrej Kratochvil
Ondrej Kratochvil

🐛 OverDrone
OverDrone

🐛 - Ozan Gulle
Ozan Gulle

💻 🐛 - PUNEET JAIN
PUNEET JAIN

🐛 + Ozan Gulle
Ozan Gulle

💻 🐛 + PUNEET JAIN
PUNEET JAIN

🐛 Parbati Bose
Parbati Bose

🐛 Paul Berg
Paul Berg

🐛 Paul Guyot
Paul Guyot

💻 Pavel Bludov
Pavel Bludov

🐛 Pavel Mička
Pavel Mička

🐛 - Pedro Nuno Santos
Pedro Nuno Santos

🐛 - Pedro Rijo
Pedro Rijo

🐛 + Pedro Nuno Santos
Pedro Nuno Santos

🐛 + Pedro Rijo
Pedro Rijo

🐛 Pelisse Romain
Pelisse Romain

💻 📖 🐛 Per Abich
Per Abich

💻 Pete Davids
Pete Davids

🐛 Peter Bruin
Peter Bruin

🐛 Peter Chittum
Peter Chittum

💻 🐛 - Peter Cudmore
Peter Cudmore

🐛 - Peter Kasson
Peter Kasson

🐛 + Peter Cudmore
Peter Cudmore

🐛 + Peter Kasson
Peter Kasson

🐛 Peter Kofler
Peter Kofler

🐛 Peter Paul Bakker
Peter Paul Bakker

💻 Peter Rader
Peter Rader

🐛 Pham Hai Trung
Pham Hai Trung

🐛 Philip Graf
Philip Graf

💻 🐛 - Philip Hachey
Philip Hachey

🐛 - Philippe Ozil
Philippe Ozil

🐛 + Philip Hachey
Philip Hachey

🐛 + Philippe Ozil
Philippe Ozil

🐛 Phinehas Artemix
Phinehas Artemix

🐛 Phokham Nonava
Phokham Nonava

🐛 Pim van der Loos
Pim van der Loos

💻 ⚠️ Piotr Szymański
Piotr Szymański

🐛 Piotrek Żygieło
Piotrek Żygieło

💻 🐛 📖 - Pranay Jaiswal
Pranay Jaiswal

🐛 - Prasad Kamath
Prasad Kamath

🐛 + Pranay Jaiswal
Pranay Jaiswal

🐛 + Prasad Kamath
Prasad Kamath

🐛 Prasanna
Prasanna

🐛 Presh-AR
Presh-AR

🐛 Puneet1726
Puneet1726

🐛 RBRi
RBRi

🐛 Rafael Cortês
Rafael Cortês

🐛 - RaheemShaik999
RaheemShaik999

🐛 - RajeshR
RajeshR

💻 🐛 + RaheemShaik999
RaheemShaik999

🐛 + RajeshR
RajeshR

💻 🐛 Ramachandra Mohan
Ramachandra Mohan

🐛 Ramel0921
Ramel0921

🐛 Raquel Pau
Raquel Pau

🐛 Ravikiran Janardhana
Ravikiran Janardhana

🐛 Reda Benhemmouche
Reda Benhemmouche

🐛 - Reinhard Schiedermeier
Reinhard Schiedermeier

🐛 - Renato Oliveira
Renato Oliveira

💻 🐛 + Reinhard Schiedermeier
Reinhard Schiedermeier

🐛 + Renato Oliveira
Renato Oliveira

💻 🐛 Rich DiCroce
Rich DiCroce

🐛 Richard Corfield
Richard Corfield

💻 Richard Corfield
Richard Corfield

🐛 💻 Riot R1cket
Riot R1cket

🐛 Rishabh Jain
Rishabh Jain

🐛 - RishabhDeep Singh
RishabhDeep Singh

🐛 - Rob Baillie
Rob Baillie

🐛 + RishabhDeep Singh
RishabhDeep Singh

🐛 + Rob Baillie
Rob Baillie

🐛 Robbie Martinus
Robbie Martinus

💻 🐛 Robert Henry
Robert Henry

🐛 Robert Mihaly
Robert Mihaly

🐛 Robert Painsi
Robert Painsi

🐛 Robert Russell
Robert Russell

🐛 - Robert Sösemann
Robert Sösemann

💻 📖 📢 🐛 - Robert Whitebit
Robert Whitebit

🐛 + Robert Sösemann
Robert Sösemann

💻 📖 📢 🐛 + Robert Whitebit
Robert Whitebit

🐛 Robin Richtsfeld
Robin Richtsfeld

🐛 Robin Stocker
Robin Stocker

💻 🐛 Robin Wils
Robin Wils

🐛 RochusOest
RochusOest

🐛 Rodolfo Noviski
Rodolfo Noviski

🐛 - Rodrigo Casara
Rodrigo Casara

🐛 - Rodrigo Fernandes
Rodrigo Fernandes

🐛 + Rodrigo Casara
Rodrigo Casara

🐛 + Rodrigo Fernandes
Rodrigo Fernandes

🐛 Roman Salvador
Roman Salvador

💻 🐛 Ronald Blaschke
Ronald Blaschke

🐛 Róbert Papp
Róbert Papp

🐛 Saikat Sengupta
Saikat Sengupta

🐛 Saksham Handu
Saksham Handu

🐛 - Saladoc
Saladoc

🐛 - Salesforce Bob Lightning
Salesforce Bob Lightning

🐛 + Saladoc
Saladoc

🐛 + Salesforce Bob Lightning
Salesforce Bob Lightning

🐛 Sam Carlberg
Sam Carlberg

🐛 Sascha Riemer
Sascha Riemer

🐛 Sashko
Sashko

💻 Satoshi Kubo
Satoshi Kubo

🐛 Scott Kennedy
Scott Kennedy

🐛 - Scott Wells
Scott Wells

🐛 💻 - Scrates1
Scrates1

🐛 💻 + Scott Wells
Scott Wells

🐛 💻 + Scrates1
Scrates1

🐛 💻 Scrsloota
Scrsloota

💻 Sebastian Bögl
Sebastian Bögl

🐛 Sebastian Davids
Sebastian Davids

🐛 Sebastian Schuberth
Sebastian Schuberth

🐛 Sebastian Schwarz
Sebastian Schwarz

🐛 - Seren
Seren

🐛 💻 - Sergey Gorbaty
Sergey Gorbaty

🐛 + Seren
Seren

🐛 💻 + Sergey Gorbaty
Sergey Gorbaty

🐛 Sergey Kozlov
Sergey Kozlov

🐛 Sergey Yanzin
Sergey Yanzin

💻 🐛 Seth Wilcox
Seth Wilcox

💻 Shai Bennathan
Shai Bennathan

🐛 💻 Shubham
Shubham

💻 🐛 - Simon Abykov
Simon Abykov

💻 🐛 - Simon Xiao
Simon Xiao

🐛 + Simon Abykov
Simon Abykov

💻 🐛 + Simon Xiao
Simon Xiao

🐛 Srinivasan Venkatachalam
Srinivasan Venkatachalam

🐛 Stanislav Gromov
Stanislav Gromov

🐛 Stanislav Myachenkov
Stanislav Myachenkov

💻 Stefan Birkner
Stefan Birkner

🐛 Stefan Bohn
Stefan Bohn

🐛 - Stefan Endrullis
Stefan Endrullis

🐛 - Stefan Klöss-Schuster
Stefan Klöss-Schuster

🐛 + Stefan Endrullis
Stefan Endrullis

🐛 + Stefan Klöss-Schuster
Stefan Klöss-Schuster

🐛 Stefan Wolf
Stefan Wolf

🐛 Stephan H. Wissel
Stephan H. Wissel

🐛 Stephen
Stephen

🐛 Stephen Carter
Stephen Carter

🐛 Stephen Friedrich
Stephen Friedrich

🐛 - Steve Babula
Steve Babula

💻 - Steven Stearns
Steven Stearns

🐛 💻 + Steve Babula
Steve Babula

💻 + Steven Stearns
Steven Stearns

🐛 💻 Stexxe
Stexxe

🐛 Stian Lågstad
Stian Lågstad

🐛 StuartClayton5
StuartClayton5

🐛 Supun Arunoda
Supun Arunoda

🐛 Suren Abrahamyan
Suren Abrahamyan

🐛 - Suvashri
Suvashri

📖 - SwatiBGupta1110
SwatiBGupta1110

🐛 + Suvashri
Suvashri

📖 + SwatiBGupta1110
SwatiBGupta1110

🐛 SyedThoufich
SyedThoufich

🐛 Szymon Sasin
Szymon Sasin

🐛 T-chuangxin
T-chuangxin

🐛 TERAI Atsuhiro
TERAI Atsuhiro

🐛 TIOBE Software
TIOBE Software

💻 🐛 - Tarush Singh
Tarush Singh

💻 - Taylor Smock
Taylor Smock

🐛 + Tarush Singh
Tarush Singh

💻 + Taylor Smock
Taylor Smock

🐛 Techeira Damián
Techeira Damián

💻 🐛 Ted Husted
Ted Husted

🐛 TehBakker
TehBakker

🐛 The Gitter Badger
The Gitter Badger

🐛 Theodoor
Theodoor

🐛 - Thiago Henrique Hüpner
Thiago Henrique Hüpner

🐛 - Thibault Meyer
Thibault Meyer

🐛 + Thiago Henrique Hüpner
Thiago Henrique Hüpner

🐛 + Thibault Meyer
Thibault Meyer

🐛 Thomas Güttler
Thomas Güttler

🐛 Thomas Jones-Low
Thomas Jones-Low

🐛 Thomas Smith
Thomas Smith

💻 🐛 ThrawnCA
ThrawnCA

🐛 Thu Vo
Thu Vo

🐛 - Thunderforge
Thunderforge

💻 🐛 - Tim van der Lippe
Tim van der Lippe

🐛 + Thunderforge
Thunderforge

💻 🐛 + Tim van der Lippe
Tim van der Lippe

🐛 Tobias Weimer
Tobias Weimer

💻 🐛 Tom Copeland
Tom Copeland

🐛 💻 📖 Tom Daly
Tom Daly

🐛 Tomas
Tomas

🐛 Tomer Figenblat
Tomer Figenblat

🐛 - Tomi De Lucca
Tomi De Lucca

💻 🐛 - Tony
Tony

📖 + Tomi De Lucca
Tomi De Lucca

💻 🐛 + Tony
Tony

📖 Torsten Kleiber
Torsten Kleiber

🐛 TrackerSB
TrackerSB

🐛 Tyson Stewart
Tyson Stewart

🐛 Ullrich Hafner
Ullrich Hafner

🐛 Utku Cuhadaroglu
Utku Cuhadaroglu

💻 🐛 - Valentin Brandl
Valentin Brandl

🐛 - Valeria
Valeria

🐛 + Valentin Brandl
Valentin Brandl

🐛 + Valeria
Valeria

🐛 Valery Yatsynovich
Valery Yatsynovich

📖 Vasily Anisimov
Vasily Anisimov

🐛 Vedant Chokshi
Vedant Chokshi

🐛 Vibhor Goyal
Vibhor Goyal

🐛 Vickenty Fesunov
Vickenty Fesunov

🐛 - Victor Noël
Victor Noël

🐛 - Vincent Galloy
Vincent Galloy

💻 + Victor Noël
Victor Noël

🐛 + Vincent Galloy
Vincent Galloy

💻 Vincent HUYNH
Vincent HUYNH

🐛 Vincent Maurin
Vincent Maurin

🐛 Vincent Privat
Vincent Privat

🐛 Vishhwas
Vishhwas

🐛 Vishv_Android
Vishv_Android

🐛 - Vitaly
Vitaly

🐛 - Vitaly Polonetsky
Vitaly Polonetsky

🐛 + Vitaly
Vitaly

🐛 + Vitaly Polonetsky
Vitaly Polonetsky

🐛 Vojtech Polivka
Vojtech Polivka

🐛 Vsevolod Zholobov
Vsevolod Zholobov

🐛 Vyom Yadav
Vyom Yadav

💻 Wang Shidong
Wang Shidong

🐛 Waqas Ahmed
Waqas Ahmed

🐛 - Wayne J. Earl
Wayne J. Earl

🐛 - Wchenghui
Wchenghui

🐛 + Wayne J. Earl
Wayne J. Earl

🐛 + Wchenghui
Wchenghui

🐛 Wener
Wener

💻 Will Winder
Will Winder

🐛 William Brockhus
William Brockhus

💻 🐛 Wilson Kurniawan
Wilson Kurniawan

🐛 Wim Deblauwe
Wim Deblauwe

🐛 - Woongsik Choi
Woongsik Choi

🐛 - XenoAmess
XenoAmess

💻 🐛 + Woongsik Choi
Woongsik Choi

🐛 + XenoAmess
XenoAmess

💻 🐛 Yang
Yang

💻 YaroslavTER
YaroslavTER

🐛 Yasar Shaikh
Yasar Shaikh

💻 Young Chan
Young Chan

💻 🐛 YuJin Kim
YuJin Kim

🐛 - Yuri Dolzhenko
Yuri Dolzhenko

🐛 - Yurii Dubinka
Yurii Dubinka

🐛 + Yuri Dolzhenko
Yuri Dolzhenko

🐛 + Yurii Dubinka
Yurii Dubinka

🐛 Zoltan Farkas
Zoltan Farkas

🐛 Zustin
Zustin

🐛 aaronhurst-google
aaronhurst-google

🐛 💻 alexmodis
alexmodis

🐛 andreoss
andreoss

🐛 - andrey81inmd
andrey81inmd

💻 🐛 - anicoara
anicoara

🐛 + andrey81inmd
andrey81inmd

💻 🐛 + anicoara
anicoara

🐛 arunprasathav
arunprasathav

🐛 asiercamara
asiercamara

🐛 astillich-igniti
astillich-igniti

💻 avesolovksyy
avesolovksyy

🐛 avishvat
avishvat

🐛 - avivmu
avivmu

🐛 - axelbarfod1
axelbarfod1

🐛 + avivmu
avivmu

🐛 + axelbarfod1
axelbarfod1

🐛 b-3-n
b-3-n

🐛 balbhadra9
balbhadra9

🐛 base23de
base23de

🐛 bergander
bergander

🐛 💻 berkam
berkam

💻 🐛 - breizh31
breizh31

🐛 - caesarkim
caesarkim

🐛 + breizh31
breizh31

🐛 + caesarkim
caesarkim

🐛 carolyujing
carolyujing

🐛 cbfiddle
cbfiddle

🐛 cesares-basilico
cesares-basilico

🐛 chrite
chrite

🐛 ciufudean
ciufudean

📖 - cobratbq
cobratbq

🐛 - coladict
coladict

🐛 + cobratbq
cobratbq

🐛 + coladict
coladict

🐛 cosmoJFH
cosmoJFH

🐛 cristalp
cristalp

🐛 crunsk
crunsk

🐛 cwholmes
cwholmes

🐛 cyberjj999
cyberjj999

🐛 - cyw3
cyw3

🐛 📖 - d1ss0nanz
d1ss0nanz

🐛 + cyw3
cyw3

🐛 📖 + d1ss0nanz
d1ss0nanz

🐛 dague1
dague1

📖 dalizi007
dalizi007

💻 danbrycefairsailcom
danbrycefairsailcom

🐛 dariansanity
dariansanity

🐛 darrenmiliband
darrenmiliband

🐛 - davidburstrom
davidburstrom

🐛 - dbirkman-paloalto
dbirkman-paloalto

🐛 + davidburstrom
davidburstrom

🐛 + dbirkman-paloalto
dbirkman-paloalto

🐛 deepak-patra
deepak-patra

🐛 dependabot[bot]
dependabot[bot]

💻 🐛 dinesh150
dinesh150

🐛 diziaq
diziaq

🐛 dreaminpast123
dreaminpast123

🐛 - duanyanan
duanyanan

🐛 - dutt-sanjay
dutt-sanjay

🐛 + duanyanan
duanyanan

🐛 + dutt-sanjay
dutt-sanjay

🐛 duursma
duursma

💻 dylanleung
dylanleung

🐛 dzeigler
dzeigler

🐛 eant60
eant60

🐛 ekkirala
ekkirala

🐛 - emersonmoura
emersonmoura

🐛 - emouty
emouty

💻 + emersonmoura
emersonmoura

🐛 + emouty
emouty

💻 eugenepugach
eugenepugach

🐛 fairy
fairy

🐛 filiprafalowicz
filiprafalowicz

💻 flxbl-io
flxbl-io

💵 foxmason
foxmason

🐛 - frankegabor
frankegabor

🐛 - frankl
frankl

🐛 + frankegabor
frankegabor

🐛 + frankl
frankl

🐛 freafrea
freafrea

🐛 fsapatin
fsapatin

🐛 gearsethenry
gearsethenry

🐛 gracia19
gracia19

🐛 guo fei
guo fei

🐛 - gurmsc5
gurmsc5

🐛 - gwilymatgearset
gwilymatgearset

💻 🐛 + gurmsc5
gurmsc5

🐛 + gwilymatgearset
gwilymatgearset

💻 🐛 haigsn
haigsn

🐛 hemanshu070
hemanshu070

🐛 henrik242
henrik242

🐛 hongpuwu
hongpuwu

🐛 hvbtup
hvbtup

💻 🐛 - igniti GmbH
igniti GmbH

🐛 - ilovezfs
ilovezfs

🐛 + igniti GmbH
igniti GmbH

🐛 + ilovezfs
ilovezfs

🐛 imax-erik
imax-erik

🐛 itaigilo
itaigilo

🐛 jakivey32
jakivey32

🐛 jbennett2091
jbennett2091

🐛 jcamerin
jcamerin

🐛 - jkeener1
jkeener1

🐛 - jmetertea
jmetertea

🐛 + jkeener1
jkeener1

🐛 + jmetertea
jmetertea

🐛 johnra2
johnra2

💻 johnzhao9
johnzhao9

🐛 josemanuelrolon
josemanuelrolon

💻 🐛 kabroxiko
kabroxiko

💻 🐛 karthikaiyasamy
karthikaiyasamy

📖 - karwer
karwer

🐛 - kaulonline
kaulonline

🐛 + karwer
karwer

🐛 + kaulonline
kaulonline

🐛 kdaemonv
kdaemonv

🐛 kdebski85
kdebski85

🐛 💻 kenji21
kenji21

💻 🐛 kfranic
kfranic

🐛 khalidkh
khalidkh

🐛 - koalalam
koalalam

🐛 - krzyk
krzyk

🐛 + koalalam
koalalam

🐛 + krzyk
krzyk

🐛 lasselindqvist
lasselindqvist

🐛 lgemeinhardt
lgemeinhardt

🐛 lihuaib
lihuaib

🐛 liqingjun123
liqingjun123

🐛 lonelyma1021
lonelyma1021

🐛 - lpeddy
lpeddy

🐛 - lujiefsi
lujiefsi

💻 + lpeddy
lpeddy

🐛 + lujiefsi
lujiefsi

💻 lukelukes
lukelukes

💻 lyriccoder
lyriccoder

🐛 marcelmore
marcelmore

🐛 matchbox
matchbox

🐛 matthiaskraaz
matthiaskraaz

🐛 - meandonlyme
meandonlyme

🐛 - mikesive
mikesive

🐛 + meandonlyme
meandonlyme

🐛 + mikesive
mikesive

🐛 milossesic
milossesic

🐛 mluckam
mluckam

💻 🐛 mohan-chinnappan-n
mohan-chinnappan-n

💻 mriddell95
mriddell95

🐛 mrlzh
mrlzh

🐛 - msloan
msloan

🐛 - mucharlaravalika
mucharlaravalika

🐛 + msloan
msloan

🐛 + mucharlaravalika
mucharlaravalika

🐛 mvenneman
mvenneman

🐛 nareshl119
nareshl119

🐛 nicolas-harraudeau-sonarsource
nicolas-harraudeau-sonarsource

🐛 noerremark
noerremark

🐛 novsirion
novsirion

🐛 - nwcm
nwcm

📖 🐛 💻 - oggboy
oggboy

🐛 + nwcm
nwcm

📖 🐛 💻 + oggboy
oggboy

🐛 oinume
oinume

🐛 orimarko
orimarko

💻 🐛 pablogomez2197
pablogomez2197

🐛 pacvz
pacvz

💻 pallavi agarwal
pallavi agarwal

🐛 - parksungrin
parksungrin

🐛 - patpatpat123
patpatpat123

🐛 + parksungrin
parksungrin

🐛 + patpatpat123
patpatpat123

🐛 patriksevallius
patriksevallius

🐛 pbrajesh1
pbrajesh1

🐛 phoenix384
phoenix384

🐛 piotrszymanski-sc
piotrszymanski-sc

💻 plan3d
plan3d

🐛 - poojasix
poojasix

🐛 - prabhushrikant
prabhushrikant

🐛 + poojasix
poojasix

🐛 + prabhushrikant
prabhushrikant

🐛 pujitha8783
pujitha8783

🐛 r-r-a-j
r-r-a-j

🐛 raghujayjunk
raghujayjunk

🐛 rajeshveera
rajeshveera

🐛 rajeswarreddy88
rajeswarreddy88

🐛 - recdevs
recdevs

🐛 - reudismam
reudismam

💻 🐛 + recdevs
recdevs

🐛 + reudismam
reudismam

💻 🐛 rijkt
rijkt

🐛 rillig-tk
rillig-tk

🐛 rmohan20
rmohan20

💻 🐛 rnveach
rnveach

🐛 rxmicro
rxmicro

🐛 - ryan-gustafson
ryan-gustafson

💻 🐛 - sabi0
sabi0

🐛 + ryan-gustafson
ryan-gustafson

💻 🐛 + sabi0
sabi0

🐛 scais
scais

🐛 schosin
schosin

🐛 screamingfrog
screamingfrog

💵 sebbASF
sebbASF

🐛 sergeygorbaty
sergeygorbaty

💻 - shilko2013
shilko2013

🐛 - shiomiyan
shiomiyan

📖 + shilko2013
shilko2013

🐛 + shiomiyan
shiomiyan

📖 simeonKondr
simeonKondr

🐛 snajberk
snajberk

🐛 sniperrifle2004
sniperrifle2004

🐛 snuyanzin
snuyanzin

🐛 💻 soloturn
soloturn

🐛 - soyodream
soyodream

🐛 - sratz
sratz

🐛 + soyodream
soyodream

🐛 + sratz
sratz

🐛 stonio
stonio

🐛 sturton
sturton

💻 🐛 sudharmohan
sudharmohan

🐛 suruchidawar
suruchidawar

🐛 svenfinitiv
svenfinitiv

🐛 - szymanp23
szymanp23

🐛 💻 - tashiscool
tashiscool

🐛 + szymanp23
szymanp23

🐛 💻 + tashiscool
tashiscool

🐛 test-git-hook
test-git-hook

🐛 testation21
testation21

💻 🐛 thanosa
thanosa

🐛 tiandiyixian
tiandiyixian

🐛 tobwoerk
tobwoerk

🐛 - tprouvot
tprouvot

🐛 💻 - trentchilders
trentchilders

🐛 + tprouvot
tprouvot

🐛 💻 + trentchilders
trentchilders

🐛 triandicAnt
triandicAnt

🐛 trishul14
trishul14

🐛 tsui
tsui

🐛 wangzitom12306
wangzitom12306

🐛 winhkey
winhkey

🐛 - witherspore
witherspore

🐛 - wjljack
wjljack

🐛 + witherspore
witherspore

🐛 + wjljack
wjljack

🐛 wuchiuwong
wuchiuwong

🐛 xingsong
xingsong

🐛 xioayuge
xioayuge

🐛 xnYi9wRezm
xnYi9wRezm

💻 🐛 xuanuy
xuanuy

🐛 - xyf0921
xyf0921

🐛 - yalechen-cyw3
yalechen-cyw3

🐛 + xyf0921
xyf0921

🐛 + yalechen-cyw3
yalechen-cyw3

🐛 yasuharu-sato
yasuharu-sato

🐛 zenglian
zenglian

🐛 zgrzyt93
zgrzyt93

💻 🐛 zh3ng
zh3ng

🐛 zt_soft
zt_soft

🐛 - ztt79
ztt79

🐛 - zzzzfeng
zzzzfeng

🐛 + ztt79
ztt79

🐛 + zzzzfeng
zzzzfeng

🐛 Árpád Magosányi
Árpád Magosányi

🐛 任贵杰
任贵杰

🐛 茅延安
茅延安

💻 From 6d48907259e0cc096e1fc84819c09cd68794d30c Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 27 Sep 2024 10:49:57 +0200 Subject: [PATCH 35/46] Prepare pmd release 7.6.0 --- docs/_config.yml | 2 +- docs/pages/release_notes.md | 30 ++++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/docs/_config.yml b/docs/_config.yml index 4213ed8b41..de55fdfd10 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,7 +1,7 @@ repository: pmd/pmd pmd: - version: 7.6.0-SNAPSHOT + version: 7.6.0 previous_version: 7.5.0 date: 2024-09-27 # release types: major, minor, bugfix diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index b2516ccf4e..d76aafb7a9 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -71,11 +71,37 @@ What changes? ### 🚨 API Changes -### ✨ External Contributions +No changes. + +### ✨ Merged pull requests +* [#5186](https://github.com/pmd/pmd/pull/5186): \[java] Cleanup things about implicit classes - [Clément Fournier](https://github.com/oowekyala) (@oowekyala) +* [#5188](https://github.com/pmd/pmd/pull/5188): \[apex] Use new apex-parser 4.2.0 - [Andreas Dangel](https://github.com/adangel) (@adangel) +* [#5191](https://github.com/pmd/pmd/pull/5191): \[java] Fix #5046 - FPs in LocalVariableCouldBeFinal - [Clément Fournier](https://github.com/oowekyala) (@oowekyala) +* [#5192](https://github.com/pmd/pmd/pull/5192): \[java] Fix #5190 - NPE in type inference caused by null type - [Clément Fournier](https://github.com/oowekyala) (@oowekyala) +* [#5195](https://github.com/pmd/pmd/pull/5195): \[apex] Fix various FNs when using triggers - [Andreas Dangel](https://github.com/adangel) (@adangel) * [#5202](https://github.com/pmd/pmd/pull/5202): \[core] Sarif format: refer to schemastore.org - [David Schach](https://github.com/dschach) (@dschach) * [#5208](https://github.com/pmd/pmd/pull/5208): \[doc] Added Codety to "Tools / Integrations" - [Tony](https://github.com/random1223) (@random1223) +* [#5210](https://github.com/pmd/pmd/pull/5210): \[core] Fix PMD's XMLRenderer to escape CDATA - [Andreas Dangel](https://github.com/adangel) (@adangel) +* [#5211](https://github.com/pmd/pmd/pull/5211): Change branch master to main - [Andreas Dangel](https://github.com/adangel) (@adangel) +* [#5212](https://github.com/pmd/pmd/pull/5212): \[java] Adjust signature matching in CheckSkipResultRule - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod) +* [#5223](https://github.com/pmd/pmd/pull/5223): \[core] Fix RuleReference / RuleSetWriter handling of properties - [Andreas Dangel](https://github.com/adangel) (@adangel) * [#5224](https://github.com/pmd/pmd/pull/5224): \[java] Fix #5068: Class incorrectly identified as non-instantiatable - [Lukas Gräf](https://github.com/lukasgraef) (@lukasgraef) * [#5230](https://github.com/pmd/pmd/pull/5230): \[doc] Documentation update for --show-suppressed flag - [David Schach](https://github.com/dschach) (@dschach) +* [#5237](https://github.com/pmd/pmd/pull/5237): \[apex] Support convertCurrency() in SOQL/SOSL - [Andreas Dangel](https://github.com/adangel) (@adangel) + +### 📦 Dependency updates +* [#5185](https://github.com/pmd/pmd/issues/5185): Bump checkstyle from 10.14.0 to 10.18.1 +* [#5187](https://github.com/pmd/pmd/issues/5187): Bump org.apache.maven.plugins:maven-install-plugin from 3.1.1 to 3.1.3 +* [#5199](https://github.com/pmd/pmd/issues/5199): Bump org.apache.maven.plugins:maven-deploy-plugin from 3.1.1 to 3.1.3 +* [#5216](https://github.com/pmd/pmd/issues/5216): Bump com.github.siom79.japicmp:japicmp-maven-plugin from 0.20.0 to 0.23.0 +* [#5226](https://github.com/pmd/pmd/issues/5226): Bump rouge from 4.3.0 to 4.4.0 in the all-gems group across 1 directory +* [#5227](https://github.com/pmd/pmd/issues/5227): Bump com.google.code.gson:gson from 2.10.1 to 2.11.0 +* [#5232](https://github.com/pmd/pmd/issues/5232): Bump com.google.protobuf:protobuf-java from 3.25.3 to 3.25.5 +* [#5233](https://github.com/pmd/pmd/issues/5233): Bump webrick from 1.8.1 to 1.8.2 in /docs + +### 📈 Stats +* 60 commits +* 27 closed tickets & PRs +* Days since last release: 27 {% endtocmaker %} - From d8d4d3d061bdc292cb23f364057ffba2fd414605 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 27 Sep 2024 11:08:53 +0200 Subject: [PATCH 36/46] [release] prepare release pmd_releases/7.6.0 --- pmd-ant/pom.xml | 2 +- pmd-apex/pom.xml | 2 +- pmd-cli/pom.xml | 2 +- pmd-coco/pom.xml | 2 +- pmd-core/pom.xml | 2 +- pmd-cpp/pom.xml | 2 +- pmd-cs/pom.xml | 2 +- pmd-dart/pom.xml | 2 +- pmd-dist/pom.xml | 2 +- pmd-doc/pom.xml | 2 +- pmd-fortran/pom.xml | 2 +- pmd-gherkin/pom.xml | 2 +- pmd-go/pom.xml | 2 +- pmd-groovy/pom.xml | 2 +- pmd-html/pom.xml | 2 +- pmd-java/pom.xml | 2 +- pmd-javascript/pom.xml | 2 +- pmd-jsp/pom.xml | 2 +- pmd-julia/pom.xml | 2 +- pmd-kotlin/pom.xml | 2 +- pmd-lang-test/pom.xml | 2 +- pmd-languages-deps/pom.xml | 2 +- pmd-lua/pom.xml | 2 +- pmd-matlab/pom.xml | 2 +- pmd-modelica/pom.xml | 2 +- pmd-objectivec/pom.xml | 2 +- pmd-perl/pom.xml | 2 +- pmd-php/pom.xml | 2 +- pmd-plsql/pom.xml | 2 +- pmd-python/pom.xml | 2 +- pmd-ruby/pom.xml | 2 +- pmd-scala-modules/pmd-scala-common/pom.xml | 2 +- pmd-scala-modules/pmd-scala_2.12/pom.xml | 2 +- pmd-scala-modules/pmd-scala_2.13/pom.xml | 2 +- pmd-swift/pom.xml | 2 +- pmd-test-schema/pom.xml | 2 +- pmd-test/pom.xml | 2 +- pmd-tsql/pom.xml | 2 +- pmd-velocity/pom.xml | 2 +- pmd-visualforce/pom.xml | 2 +- pmd-xml/pom.xml | 2 +- pom.xml | 6 +++--- 42 files changed, 44 insertions(+), 44 deletions(-) diff --git a/pmd-ant/pom.xml b/pmd-ant/pom.xml index 35df92992a..bd0347fa6a 100644 --- a/pmd-ant/pom.xml +++ b/pmd-ant/pom.xml @@ -7,7 +7,7 @@ pmd net.sourceforge.pmd - 7.6.0-SNAPSHOT + 7.6.0 4.0.0 diff --git a/pmd-apex/pom.xml b/pmd-apex/pom.xml index b045cffa2d..49c2d25fba 100644 --- a/pmd-apex/pom.xml +++ b/pmd-apex/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-cli/pom.xml b/pmd-cli/pom.xml index 18203f263c..33d02f304b 100644 --- a/pmd-cli/pom.xml +++ b/pmd-cli/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-coco/pom.xml b/pmd-coco/pom.xml index 202e7f61a9..c039756ba6 100644 --- a/pmd-coco/pom.xml +++ b/pmd-coco/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-core/pom.xml b/pmd-core/pom.xml index 48d6799ffe..ff1668a764 100644 --- a/pmd-core/pom.xml +++ b/pmd-core/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-cpp/pom.xml b/pmd-cpp/pom.xml index 60461ac5a8..b8faafade0 100644 --- a/pmd-cpp/pom.xml +++ b/pmd-cpp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-cs/pom.xml b/pmd-cs/pom.xml index 5cb4092835..9d1edb4a6a 100644 --- a/pmd-cs/pom.xml +++ b/pmd-cs/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-dart/pom.xml b/pmd-dart/pom.xml index 823d71180c..b637ed0a45 100644 --- a/pmd-dart/pom.xml +++ b/pmd-dart/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-dist/pom.xml b/pmd-dist/pom.xml index 1b847abbb8..2b826ac25b 100644 --- a/pmd-dist/pom.xml +++ b/pmd-dist/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-doc/pom.xml b/pmd-doc/pom.xml index 69a470e505..445646f273 100644 --- a/pmd-doc/pom.xml +++ b/pmd-doc/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-fortran/pom.xml b/pmd-fortran/pom.xml index c95bc8df5f..7288b87387 100644 --- a/pmd-fortran/pom.xml +++ b/pmd-fortran/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-gherkin/pom.xml b/pmd-gherkin/pom.xml index fe3227d1aa..ab6667c6a0 100644 --- a/pmd-gherkin/pom.xml +++ b/pmd-gherkin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-go/pom.xml b/pmd-go/pom.xml index 7651123d36..1bf6a013e7 100644 --- a/pmd-go/pom.xml +++ b/pmd-go/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-groovy/pom.xml b/pmd-groovy/pom.xml index 6e3436a51c..fd70a77b47 100644 --- a/pmd-groovy/pom.xml +++ b/pmd-groovy/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-html/pom.xml b/pmd-html/pom.xml index 53f8a42a35..cd95f899a9 100644 --- a/pmd-html/pom.xml +++ b/pmd-html/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-java/pom.xml b/pmd-java/pom.xml index 2ff998e827..388da224fe 100644 --- a/pmd-java/pom.xml +++ b/pmd-java/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-javascript/pom.xml b/pmd-javascript/pom.xml index 03dc85a75e..bdbdd4e960 100644 --- a/pmd-javascript/pom.xml +++ b/pmd-javascript/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-jsp/pom.xml b/pmd-jsp/pom.xml index a6da55d891..c18a12730e 100644 --- a/pmd-jsp/pom.xml +++ b/pmd-jsp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-julia/pom.xml b/pmd-julia/pom.xml index bf53e57a24..cb677bb2e6 100644 --- a/pmd-julia/pom.xml +++ b/pmd-julia/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-kotlin/pom.xml b/pmd-kotlin/pom.xml index 797705d698..24361d2a1d 100644 --- a/pmd-kotlin/pom.xml +++ b/pmd-kotlin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-lang-test/pom.xml b/pmd-lang-test/pom.xml index b2e328dcb1..26f130e978 100644 --- a/pmd-lang-test/pom.xml +++ b/pmd-lang-test/pom.xml @@ -12,7 +12,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-languages-deps/pom.xml b/pmd-languages-deps/pom.xml index d10632ed97..1548dbd593 100644 --- a/pmd-languages-deps/pom.xml +++ b/pmd-languages-deps/pom.xml @@ -4,7 +4,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 pmd-languages-deps diff --git a/pmd-lua/pom.xml b/pmd-lua/pom.xml index 69e2f52f7f..f0c98321e0 100644 --- a/pmd-lua/pom.xml +++ b/pmd-lua/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-matlab/pom.xml b/pmd-matlab/pom.xml index 56a052c78d..d3e3428a1f 100644 --- a/pmd-matlab/pom.xml +++ b/pmd-matlab/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-modelica/pom.xml b/pmd-modelica/pom.xml index 148463da16..ce1faf879d 100644 --- a/pmd-modelica/pom.xml +++ b/pmd-modelica/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-objectivec/pom.xml b/pmd-objectivec/pom.xml index 6abcd2a7eb..14f408a840 100644 --- a/pmd-objectivec/pom.xml +++ b/pmd-objectivec/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-perl/pom.xml b/pmd-perl/pom.xml index 3b28d3cc61..289745c71a 100644 --- a/pmd-perl/pom.xml +++ b/pmd-perl/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-php/pom.xml b/pmd-php/pom.xml index aefd501fe4..eed7294d60 100644 --- a/pmd-php/pom.xml +++ b/pmd-php/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-plsql/pom.xml b/pmd-plsql/pom.xml index 81e20a53d7..8f2db584e8 100644 --- a/pmd-plsql/pom.xml +++ b/pmd-plsql/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-python/pom.xml b/pmd-python/pom.xml index ce43de76dd..43652c6bd5 100644 --- a/pmd-python/pom.xml +++ b/pmd-python/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-ruby/pom.xml b/pmd-ruby/pom.xml index ed664e81f8..5c44ee002f 100644 --- a/pmd-ruby/pom.xml +++ b/pmd-ruby/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-scala-modules/pmd-scala-common/pom.xml b/pmd-scala-modules/pmd-scala-common/pom.xml index e3f8af4612..b1e5813806 100644 --- a/pmd-scala-modules/pmd-scala-common/pom.xml +++ b/pmd-scala-modules/pmd-scala-common/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../../pom.xml diff --git a/pmd-scala-modules/pmd-scala_2.12/pom.xml b/pmd-scala-modules/pmd-scala_2.12/pom.xml index ba1409b1c9..9230660920 100644 --- a/pmd-scala-modules/pmd-scala_2.12/pom.xml +++ b/pmd-scala-modules/pmd-scala_2.12/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd-scala-common - 7.6.0-SNAPSHOT + 7.6.0 ../pmd-scala-common/pom.xml diff --git a/pmd-scala-modules/pmd-scala_2.13/pom.xml b/pmd-scala-modules/pmd-scala_2.13/pom.xml index 394545d1af..c58b97b2e5 100644 --- a/pmd-scala-modules/pmd-scala_2.13/pom.xml +++ b/pmd-scala-modules/pmd-scala_2.13/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd-scala-common - 7.6.0-SNAPSHOT + 7.6.0 ../pmd-scala-common/pom.xml diff --git a/pmd-swift/pom.xml b/pmd-swift/pom.xml index 9a9114fc76..8f430c4ca7 100644 --- a/pmd-swift/pom.xml +++ b/pmd-swift/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-test-schema/pom.xml b/pmd-test-schema/pom.xml index 0e523bc688..a75bf296e1 100644 --- a/pmd-test-schema/pom.xml +++ b/pmd-test-schema/pom.xml @@ -11,7 +11,7 @@ pmd net.sourceforge.pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-test/pom.xml b/pmd-test/pom.xml index dd5aa868f8..99d3ec5354 100644 --- a/pmd-test/pom.xml +++ b/pmd-test/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-tsql/pom.xml b/pmd-tsql/pom.xml index ee68fd8441..2dab9d1d53 100644 --- a/pmd-tsql/pom.xml +++ b/pmd-tsql/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-velocity/pom.xml b/pmd-velocity/pom.xml index dee695afc9..7a281697bb 100644 --- a/pmd-velocity/pom.xml +++ b/pmd-velocity/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-visualforce/pom.xml b/pmd-visualforce/pom.xml index a5616f85b0..5864669ea5 100644 --- a/pmd-visualforce/pom.xml +++ b/pmd-visualforce/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pmd-xml/pom.xml b/pmd-xml/pom.xml index e8f276a171..38de0901f6 100644 --- a/pmd-xml/pom.xml +++ b/pmd-xml/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 ../pom.xml diff --git a/pom.xml b/pom.xml index f188fe5d77..c01c3e2b98 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 net.sourceforge.pmd pmd - 7.6.0-SNAPSHOT + 7.6.0 pom PMD @@ -62,7 +62,7 @@ scm:git:git://github.com/pmd/pmd.git scm:git:ssh://git@github.com/pmd/pmd.git https://github.com/pmd/pmd - HEAD + pmd_releases/7.6.0 @@ -83,7 +83,7 @@ - 2024-08-30T08:11:07Z + 2024-09-27T08:50:09Z 8 From 5fe19b2096348b8f321b96a7c936cff056463fed Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 27 Sep 2024 11:43:22 +0200 Subject: [PATCH 37/46] [release] Prepare next development version [skip ci] --- docs/_config.yml | 6 +- docs/pages/release_notes.md | 87 +---------------- docs/pages/release_notes_old.md | 108 +++++++++++++++++++++ pmd-ant/pom.xml | 2 +- pmd-apex/pom.xml | 2 +- pmd-cli/pom.xml | 2 +- pmd-coco/pom.xml | 2 +- pmd-core/pom.xml | 2 +- pmd-cpp/pom.xml | 2 +- pmd-cs/pom.xml | 2 +- pmd-dart/pom.xml | 2 +- pmd-dist/pom.xml | 2 +- pmd-doc/pom.xml | 2 +- pmd-fortran/pom.xml | 2 +- pmd-gherkin/pom.xml | 2 +- pmd-go/pom.xml | 2 +- pmd-groovy/pom.xml | 2 +- pmd-html/pom.xml | 2 +- pmd-java/pom.xml | 2 +- pmd-javascript/pom.xml | 2 +- pmd-jsp/pom.xml | 2 +- pmd-julia/pom.xml | 2 +- pmd-kotlin/pom.xml | 2 +- pmd-lang-test/pom.xml | 2 +- pmd-languages-deps/pom.xml | 2 +- pmd-lua/pom.xml | 2 +- pmd-matlab/pom.xml | 2 +- pmd-modelica/pom.xml | 2 +- pmd-objectivec/pom.xml | 2 +- pmd-perl/pom.xml | 2 +- pmd-php/pom.xml | 2 +- pmd-plsql/pom.xml | 2 +- pmd-python/pom.xml | 2 +- pmd-ruby/pom.xml | 2 +- pmd-scala-modules/pmd-scala-common/pom.xml | 2 +- pmd-scala-modules/pmd-scala_2.12/pom.xml | 2 +- pmd-scala-modules/pmd-scala_2.13/pom.xml | 2 +- pmd-swift/pom.xml | 2 +- pmd-test-schema/pom.xml | 2 +- pmd-test/pom.xml | 2 +- pmd-tsql/pom.xml | 2 +- pmd-velocity/pom.xml | 2 +- pmd-visualforce/pom.xml | 2 +- pmd-xml/pom.xml | 2 +- pom.xml | 4 +- 45 files changed, 156 insertions(+), 131 deletions(-) diff --git a/docs/_config.yml b/docs/_config.yml index de55fdfd10..912d463cc1 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,9 +1,9 @@ repository: pmd/pmd pmd: - version: 7.6.0 - previous_version: 7.5.0 - date: 2024-09-27 + version: 7.7.0-SNAPSHOT + previous_version: 7.6.0 + date: 2024-10-25 # release types: major, minor, bugfix release_type: minor diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index d76aafb7a9..bc1a36ec7a 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -14,94 +14,11 @@ This is a {{ site.pmd.release_type }} release. ### 🚀 New and noteworthy -#### New Git default branch - "main" - -We are joining the Git community and updating "master" to "main". Using the term "master" for the main -development branch can be offensive to some people. Existing versions of Git have been always capable of -working with any branch name and since 2.28.0 (July 2020) the default initial branch is configurable -(`init.defaultBranch`). Since October 2020, the default branch for new repositories on GitHub -is "main". Finally, PMD will also use this new name for the main branch in all our own repositories. - -Why "main"? PMD uses a very simple branching model - pull requests with feature branches and one main development -branch, from which releases are created. That's why "main" is currently the best fitting name. - -More information: -- -- - -What changes? -- We change the default branch on GitHub, so that pull requests are automatically created against `main` from - now on. -- If you have already a local clone of PMD's repository, you'll need to rename the old master branch locally: - ``` - git branch --move master main - git fetch origin - git branch --set-upstream-to=origin/main main - git remote set-head origin --auto - ``` - - More info: - and - -- If you created a fork on GitHub, you'll need to change the default branch in your fork to `main` as - well (Settings > Default Branch). -- Some time after this release, we'll delete the old master branch on GitHub. Then only `main` can be used. -- This change is expanded to the other PMD repositories as well, e.g. pmd-designer and pmd-regression-tester. - ### 🐛 Fixed Issues -* apex - * [#5138](https://github.com/pmd/pmd/issues/5138): \[apex] Various false-negatives since 7.3.0 when using triggers - (ApexCRUDViolation, CognitiveComplexity, OperationWithLimitsInLoop) - * [#5163](https://github.com/pmd/pmd/issues/5163): \[apex] Parser error when using toLabel in SOSL query - * [#5182](https://github.com/pmd/pmd/issues/5182): \[apex] Parser error when using GROUPING in a SOQL query - * [#5218](https://github.com/pmd/pmd/issues/5218): \[apex] Parser error when using nested subqueries in SOQL - * [#5228](https://github.com/pmd/pmd/issues/5228): \[apex] Parser error when using convertCurrency() in SOQL -* core - * [#5059](https://github.com/pmd/pmd/issues/5059): \[core] xml output doesn't escape CDATA inside its own CDATA - * [#5201](https://github.com/pmd/pmd/issues/5201): \[core] PMD sarif schema file points to nonexistent location - * [#5222](https://github.com/pmd/pmd/issues/5222): \[core] RuleReference/RuleSetWriter don't handle changed default property values correctly - * [#5229](https://github.com/pmd/pmd/issues/5229): \[doc] CLI flag `--show-suppressed` needs to mention xml, html, summaryhtml -* java - * [#5190](https://github.com/pmd/pmd/issues/5190): \[java] NPE in type inference -* java-codestyle - * [#5046](https://github.com/pmd/pmd/issues/5046): \[java] LocalVariableCouldBeFinal false positive with try/catch -* java-errorprone - * [#5068](https://github.com/pmd/pmd/issues/5068): \[java] MissingStaticMethodInNonInstantiatableClass: false positive with builder pattern - * [#5207](https://github.com/pmd/pmd/issues/5207): \[java] CheckSkipResult: false positve for a private method `void skip(int)` in a subclass of FilterInputStream ### 🚨 API Changes -No changes. - -### ✨ Merged pull requests -* [#5186](https://github.com/pmd/pmd/pull/5186): \[java] Cleanup things about implicit classes - [Clément Fournier](https://github.com/oowekyala) (@oowekyala) -* [#5188](https://github.com/pmd/pmd/pull/5188): \[apex] Use new apex-parser 4.2.0 - [Andreas Dangel](https://github.com/adangel) (@adangel) -* [#5191](https://github.com/pmd/pmd/pull/5191): \[java] Fix #5046 - FPs in LocalVariableCouldBeFinal - [Clément Fournier](https://github.com/oowekyala) (@oowekyala) -* [#5192](https://github.com/pmd/pmd/pull/5192): \[java] Fix #5190 - NPE in type inference caused by null type - [Clément Fournier](https://github.com/oowekyala) (@oowekyala) -* [#5195](https://github.com/pmd/pmd/pull/5195): \[apex] Fix various FNs when using triggers - [Andreas Dangel](https://github.com/adangel) (@adangel) -* [#5202](https://github.com/pmd/pmd/pull/5202): \[core] Sarif format: refer to schemastore.org - [David Schach](https://github.com/dschach) (@dschach) -* [#5208](https://github.com/pmd/pmd/pull/5208): \[doc] Added Codety to "Tools / Integrations" - [Tony](https://github.com/random1223) (@random1223) -* [#5210](https://github.com/pmd/pmd/pull/5210): \[core] Fix PMD's XMLRenderer to escape CDATA - [Andreas Dangel](https://github.com/adangel) (@adangel) -* [#5211](https://github.com/pmd/pmd/pull/5211): Change branch master to main - [Andreas Dangel](https://github.com/adangel) (@adangel) -* [#5212](https://github.com/pmd/pmd/pull/5212): \[java] Adjust signature matching in CheckSkipResultRule - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod) -* [#5223](https://github.com/pmd/pmd/pull/5223): \[core] Fix RuleReference / RuleSetWriter handling of properties - [Andreas Dangel](https://github.com/adangel) (@adangel) -* [#5224](https://github.com/pmd/pmd/pull/5224): \[java] Fix #5068: Class incorrectly identified as non-instantiatable - [Lukas Gräf](https://github.com/lukasgraef) (@lukasgraef) -* [#5230](https://github.com/pmd/pmd/pull/5230): \[doc] Documentation update for --show-suppressed flag - [David Schach](https://github.com/dschach) (@dschach) -* [#5237](https://github.com/pmd/pmd/pull/5237): \[apex] Support convertCurrency() in SOQL/SOSL - [Andreas Dangel](https://github.com/adangel) (@adangel) - -### 📦 Dependency updates -* [#5185](https://github.com/pmd/pmd/issues/5185): Bump checkstyle from 10.14.0 to 10.18.1 -* [#5187](https://github.com/pmd/pmd/issues/5187): Bump org.apache.maven.plugins:maven-install-plugin from 3.1.1 to 3.1.3 -* [#5199](https://github.com/pmd/pmd/issues/5199): Bump org.apache.maven.plugins:maven-deploy-plugin from 3.1.1 to 3.1.3 -* [#5216](https://github.com/pmd/pmd/issues/5216): Bump com.github.siom79.japicmp:japicmp-maven-plugin from 0.20.0 to 0.23.0 -* [#5226](https://github.com/pmd/pmd/issues/5226): Bump rouge from 4.3.0 to 4.4.0 in the all-gems group across 1 directory -* [#5227](https://github.com/pmd/pmd/issues/5227): Bump com.google.code.gson:gson from 2.10.1 to 2.11.0 -* [#5232](https://github.com/pmd/pmd/issues/5232): Bump com.google.protobuf:protobuf-java from 3.25.3 to 3.25.5 -* [#5233](https://github.com/pmd/pmd/issues/5233): Bump webrick from 1.8.1 to 1.8.2 in /docs - -### 📈 Stats -* 60 commits -* 27 closed tickets & PRs -* Days since last release: 27 +### ✨ External Contributions {% endtocmaker %} + diff --git a/docs/pages/release_notes_old.md b/docs/pages/release_notes_old.md index 1dbd44da28..6a7983db8b 100644 --- a/docs/pages/release_notes_old.md +++ b/docs/pages/release_notes_old.md @@ -5,6 +5,114 @@ permalink: pmd_release_notes_old.html Previous versions of PMD can be downloaded here: [Releases - pmd/pmd (GitHub)](https://github.com/pmd/pmd/releases) +## 27-September-2024 - 7.6.0 + +The PMD team is pleased to announce PMD 7.6.0. + +This is a minor release. + +### Table Of Contents + +* [🚀 New and noteworthy](#new-and-noteworthy) + * [New Git default branch - "main"](#new-git-default-branch---main) +* [🐛 Fixed Issues](#fixed-issues) +* [🚨 API Changes](#api-changes) +* [✨ Merged pull requests](#merged-pull-requests) +* [📦 Dependency updates](#dependency-updates) +* [📈 Stats](#stats) + +### 🚀 New and noteworthy + +#### New Git default branch - "main" + +We are joining the Git community and updating "master" to "main". Using the term "master" for the main +development branch can be offensive to some people. Existing versions of Git have been always capable of +working with any branch name and since 2.28.0 (July 2020) the default initial branch is configurable +(`init.defaultBranch`). Since October 2020, the default branch for new repositories on GitHub +is "main". Finally, PMD will also use this new name for the main branch in all our own repositories. + +Why "main"? PMD uses a very simple branching model - pull requests with feature branches and one main development +branch, from which releases are created. That's why "main" is currently the best fitting name. + +More information: +- +- + +What changes? +- We change the default branch on GitHub, so that pull requests are automatically created against `main` from + now on. +- If you have already a local clone of PMD's repository, you'll need to rename the old master branch locally: + ``` + git branch --move master main + git fetch origin + git branch --set-upstream-to=origin/main main + git remote set-head origin --auto + ``` + + More info: + and + +- If you created a fork on GitHub, you'll need to change the default branch in your fork to `main` as + well (Settings > Default Branch). +- Some time after this release, we'll delete the old master branch on GitHub. Then only `main` can be used. +- This change is expanded to the other PMD repositories as well, e.g. pmd-designer and pmd-regression-tester. + +### 🐛 Fixed Issues +* apex + * [#5138](https://github.com/pmd/pmd/issues/5138): \[apex] Various false-negatives since 7.3.0 when using triggers + (ApexCRUDViolation, CognitiveComplexity, OperationWithLimitsInLoop) + * [#5163](https://github.com/pmd/pmd/issues/5163): \[apex] Parser error when using toLabel in SOSL query + * [#5182](https://github.com/pmd/pmd/issues/5182): \[apex] Parser error when using GROUPING in a SOQL query + * [#5218](https://github.com/pmd/pmd/issues/5218): \[apex] Parser error when using nested subqueries in SOQL + * [#5228](https://github.com/pmd/pmd/issues/5228): \[apex] Parser error when using convertCurrency() in SOQL +* core + * [#5059](https://github.com/pmd/pmd/issues/5059): \[core] xml output doesn't escape CDATA inside its own CDATA + * [#5201](https://github.com/pmd/pmd/issues/5201): \[core] PMD sarif schema file points to nonexistent location + * [#5222](https://github.com/pmd/pmd/issues/5222): \[core] RuleReference/RuleSetWriter don't handle changed default property values correctly + * [#5229](https://github.com/pmd/pmd/issues/5229): \[doc] CLI flag `--show-suppressed` needs to mention xml, html, summaryhtml +* java + * [#5190](https://github.com/pmd/pmd/issues/5190): \[java] NPE in type inference +* java-codestyle + * [#5046](https://github.com/pmd/pmd/issues/5046): \[java] LocalVariableCouldBeFinal false positive with try/catch +* java-errorprone + * [#5068](https://github.com/pmd/pmd/issues/5068): \[java] MissingStaticMethodInNonInstantiatableClass: false positive with builder pattern + * [#5207](https://github.com/pmd/pmd/issues/5207): \[java] CheckSkipResult: false positve for a private method `void skip(int)` in a subclass of FilterInputStream + +### 🚨 API Changes + +No changes. + +### ✨ Merged pull requests +* [#5186](https://github.com/pmd/pmd/pull/5186): \[java] Cleanup things about implicit classes - [Clément Fournier](https://github.com/oowekyala) (@oowekyala) +* [#5188](https://github.com/pmd/pmd/pull/5188): \[apex] Use new apex-parser 4.2.0 - [Andreas Dangel](https://github.com/adangel) (@adangel) +* [#5191](https://github.com/pmd/pmd/pull/5191): \[java] Fix #5046 - FPs in LocalVariableCouldBeFinal - [Clément Fournier](https://github.com/oowekyala) (@oowekyala) +* [#5192](https://github.com/pmd/pmd/pull/5192): \[java] Fix #5190 - NPE in type inference caused by null type - [Clément Fournier](https://github.com/oowekyala) (@oowekyala) +* [#5195](https://github.com/pmd/pmd/pull/5195): \[apex] Fix various FNs when using triggers - [Andreas Dangel](https://github.com/adangel) (@adangel) +* [#5202](https://github.com/pmd/pmd/pull/5202): \[core] Sarif format: refer to schemastore.org - [David Schach](https://github.com/dschach) (@dschach) +* [#5208](https://github.com/pmd/pmd/pull/5208): \[doc] Added Codety to "Tools / Integrations" - [Tony](https://github.com/random1223) (@random1223) +* [#5210](https://github.com/pmd/pmd/pull/5210): \[core] Fix PMD's XMLRenderer to escape CDATA - [Andreas Dangel](https://github.com/adangel) (@adangel) +* [#5211](https://github.com/pmd/pmd/pull/5211): Change branch master to main - [Andreas Dangel](https://github.com/adangel) (@adangel) +* [#5212](https://github.com/pmd/pmd/pull/5212): \[java] Adjust signature matching in CheckSkipResultRule - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod) +* [#5223](https://github.com/pmd/pmd/pull/5223): \[core] Fix RuleReference / RuleSetWriter handling of properties - [Andreas Dangel](https://github.com/adangel) (@adangel) +* [#5224](https://github.com/pmd/pmd/pull/5224): \[java] Fix #5068: Class incorrectly identified as non-instantiatable - [Lukas Gräf](https://github.com/lukasgraef) (@lukasgraef) +* [#5230](https://github.com/pmd/pmd/pull/5230): \[doc] Documentation update for --show-suppressed flag - [David Schach](https://github.com/dschach) (@dschach) +* [#5237](https://github.com/pmd/pmd/pull/5237): \[apex] Support convertCurrency() in SOQL/SOSL - [Andreas Dangel](https://github.com/adangel) (@adangel) + +### 📦 Dependency updates +* [#5185](https://github.com/pmd/pmd/issues/5185): Bump checkstyle from 10.14.0 to 10.18.1 +* [#5187](https://github.com/pmd/pmd/issues/5187): Bump org.apache.maven.plugins:maven-install-plugin from 3.1.1 to 3.1.3 +* [#5199](https://github.com/pmd/pmd/issues/5199): Bump org.apache.maven.plugins:maven-deploy-plugin from 3.1.1 to 3.1.3 +* [#5216](https://github.com/pmd/pmd/issues/5216): Bump com.github.siom79.japicmp:japicmp-maven-plugin from 0.20.0 to 0.23.0 +* [#5226](https://github.com/pmd/pmd/issues/5226): Bump rouge from 4.3.0 to 4.4.0 in the all-gems group across 1 directory +* [#5227](https://github.com/pmd/pmd/issues/5227): Bump com.google.code.gson:gson from 2.10.1 to 2.11.0 +* [#5232](https://github.com/pmd/pmd/issues/5232): Bump com.google.protobuf:protobuf-java from 3.25.3 to 3.25.5 +* [#5233](https://github.com/pmd/pmd/issues/5233): Bump webrick from 1.8.1 to 1.8.2 in /docs + +### 📈 Stats +* 60 commits +* 27 closed tickets & PRs +* Days since last release: 27 + ## 30-August-2024 - 7.5.0 The PMD team is pleased to announce PMD 7.5.0. diff --git a/pmd-ant/pom.xml b/pmd-ant/pom.xml index bd0347fa6a..bc57065dc2 100644 --- a/pmd-ant/pom.xml +++ b/pmd-ant/pom.xml @@ -7,7 +7,7 @@ pmd net.sourceforge.pmd - 7.6.0 + 7.7.0-SNAPSHOT 4.0.0 diff --git a/pmd-apex/pom.xml b/pmd-apex/pom.xml index 49c2d25fba..1c1c8045fe 100644 --- a/pmd-apex/pom.xml +++ b/pmd-apex/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-cli/pom.xml b/pmd-cli/pom.xml index 33d02f304b..adca9527ba 100644 --- a/pmd-cli/pom.xml +++ b/pmd-cli/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-coco/pom.xml b/pmd-coco/pom.xml index c039756ba6..147966f7b6 100644 --- a/pmd-coco/pom.xml +++ b/pmd-coco/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-core/pom.xml b/pmd-core/pom.xml index ff1668a764..531a06515f 100644 --- a/pmd-core/pom.xml +++ b/pmd-core/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-cpp/pom.xml b/pmd-cpp/pom.xml index b8faafade0..adbfbd8e3c 100644 --- a/pmd-cpp/pom.xml +++ b/pmd-cpp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-cs/pom.xml b/pmd-cs/pom.xml index 9d1edb4a6a..0eec39f809 100644 --- a/pmd-cs/pom.xml +++ b/pmd-cs/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-dart/pom.xml b/pmd-dart/pom.xml index b637ed0a45..496115127b 100644 --- a/pmd-dart/pom.xml +++ b/pmd-dart/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-dist/pom.xml b/pmd-dist/pom.xml index 2b826ac25b..9ad286e9a4 100644 --- a/pmd-dist/pom.xml +++ b/pmd-dist/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-doc/pom.xml b/pmd-doc/pom.xml index 445646f273..c0b7991017 100644 --- a/pmd-doc/pom.xml +++ b/pmd-doc/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-fortran/pom.xml b/pmd-fortran/pom.xml index 7288b87387..94bc7d94bd 100644 --- a/pmd-fortran/pom.xml +++ b/pmd-fortran/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-gherkin/pom.xml b/pmd-gherkin/pom.xml index ab6667c6a0..6aee2c1be5 100644 --- a/pmd-gherkin/pom.xml +++ b/pmd-gherkin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-go/pom.xml b/pmd-go/pom.xml index 1bf6a013e7..4df297ebc9 100644 --- a/pmd-go/pom.xml +++ b/pmd-go/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-groovy/pom.xml b/pmd-groovy/pom.xml index fd70a77b47..bf716ac77c 100644 --- a/pmd-groovy/pom.xml +++ b/pmd-groovy/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-html/pom.xml b/pmd-html/pom.xml index cd95f899a9..86f19c7c01 100644 --- a/pmd-html/pom.xml +++ b/pmd-html/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-java/pom.xml b/pmd-java/pom.xml index 388da224fe..d8131b8d65 100644 --- a/pmd-java/pom.xml +++ b/pmd-java/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-javascript/pom.xml b/pmd-javascript/pom.xml index bdbdd4e960..5e4506efd4 100644 --- a/pmd-javascript/pom.xml +++ b/pmd-javascript/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-jsp/pom.xml b/pmd-jsp/pom.xml index c18a12730e..9f1d3fb223 100644 --- a/pmd-jsp/pom.xml +++ b/pmd-jsp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-julia/pom.xml b/pmd-julia/pom.xml index cb677bb2e6..ac3ed6eed1 100644 --- a/pmd-julia/pom.xml +++ b/pmd-julia/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-kotlin/pom.xml b/pmd-kotlin/pom.xml index 24361d2a1d..40f19513de 100644 --- a/pmd-kotlin/pom.xml +++ b/pmd-kotlin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-lang-test/pom.xml b/pmd-lang-test/pom.xml index 26f130e978..49f8aade09 100644 --- a/pmd-lang-test/pom.xml +++ b/pmd-lang-test/pom.xml @@ -12,7 +12,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-languages-deps/pom.xml b/pmd-languages-deps/pom.xml index 1548dbd593..38f0d009e8 100644 --- a/pmd-languages-deps/pom.xml +++ b/pmd-languages-deps/pom.xml @@ -4,7 +4,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT pmd-languages-deps diff --git a/pmd-lua/pom.xml b/pmd-lua/pom.xml index f0c98321e0..f3a24be6d3 100644 --- a/pmd-lua/pom.xml +++ b/pmd-lua/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-matlab/pom.xml b/pmd-matlab/pom.xml index d3e3428a1f..373fa78a8d 100644 --- a/pmd-matlab/pom.xml +++ b/pmd-matlab/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-modelica/pom.xml b/pmd-modelica/pom.xml index ce1faf879d..639c224e2c 100644 --- a/pmd-modelica/pom.xml +++ b/pmd-modelica/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-objectivec/pom.xml b/pmd-objectivec/pom.xml index 14f408a840..66818f1a47 100644 --- a/pmd-objectivec/pom.xml +++ b/pmd-objectivec/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-perl/pom.xml b/pmd-perl/pom.xml index 289745c71a..3cb972b403 100644 --- a/pmd-perl/pom.xml +++ b/pmd-perl/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-php/pom.xml b/pmd-php/pom.xml index eed7294d60..88f09db7a4 100644 --- a/pmd-php/pom.xml +++ b/pmd-php/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-plsql/pom.xml b/pmd-plsql/pom.xml index 8f2db584e8..2e6ad097a4 100644 --- a/pmd-plsql/pom.xml +++ b/pmd-plsql/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-python/pom.xml b/pmd-python/pom.xml index 43652c6bd5..85b6643126 100644 --- a/pmd-python/pom.xml +++ b/pmd-python/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-ruby/pom.xml b/pmd-ruby/pom.xml index 5c44ee002f..9acaabbf96 100644 --- a/pmd-ruby/pom.xml +++ b/pmd-ruby/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-scala-modules/pmd-scala-common/pom.xml b/pmd-scala-modules/pmd-scala-common/pom.xml index b1e5813806..80ad4da7bd 100644 --- a/pmd-scala-modules/pmd-scala-common/pom.xml +++ b/pmd-scala-modules/pmd-scala-common/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../../pom.xml diff --git a/pmd-scala-modules/pmd-scala_2.12/pom.xml b/pmd-scala-modules/pmd-scala_2.12/pom.xml index 9230660920..3f73f1cbfb 100644 --- a/pmd-scala-modules/pmd-scala_2.12/pom.xml +++ b/pmd-scala-modules/pmd-scala_2.12/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd-scala-common - 7.6.0 + 7.7.0-SNAPSHOT ../pmd-scala-common/pom.xml diff --git a/pmd-scala-modules/pmd-scala_2.13/pom.xml b/pmd-scala-modules/pmd-scala_2.13/pom.xml index c58b97b2e5..ee66fca93a 100644 --- a/pmd-scala-modules/pmd-scala_2.13/pom.xml +++ b/pmd-scala-modules/pmd-scala_2.13/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd-scala-common - 7.6.0 + 7.7.0-SNAPSHOT ../pmd-scala-common/pom.xml diff --git a/pmd-swift/pom.xml b/pmd-swift/pom.xml index 8f430c4ca7..023fa8dd39 100644 --- a/pmd-swift/pom.xml +++ b/pmd-swift/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-test-schema/pom.xml b/pmd-test-schema/pom.xml index a75bf296e1..43a990e8dc 100644 --- a/pmd-test-schema/pom.xml +++ b/pmd-test-schema/pom.xml @@ -11,7 +11,7 @@ pmd net.sourceforge.pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-test/pom.xml b/pmd-test/pom.xml index 99d3ec5354..0fd57a4437 100644 --- a/pmd-test/pom.xml +++ b/pmd-test/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-tsql/pom.xml b/pmd-tsql/pom.xml index 2dab9d1d53..e3a2489eff 100644 --- a/pmd-tsql/pom.xml +++ b/pmd-tsql/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-velocity/pom.xml b/pmd-velocity/pom.xml index 7a281697bb..6cb54b0cd5 100644 --- a/pmd-velocity/pom.xml +++ b/pmd-velocity/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-visualforce/pom.xml b/pmd-visualforce/pom.xml index 5864669ea5..7ae874578d 100644 --- a/pmd-visualforce/pom.xml +++ b/pmd-visualforce/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pmd-xml/pom.xml b/pmd-xml/pom.xml index 38de0901f6..1d19200b86 100644 --- a/pmd-xml/pom.xml +++ b/pmd-xml/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index c01c3e2b98..9135446886 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 net.sourceforge.pmd pmd - 7.6.0 + 7.7.0-SNAPSHOT pom PMD @@ -62,7 +62,7 @@ scm:git:git://github.com/pmd/pmd.git scm:git:ssh://git@github.com/pmd/pmd.git https://github.com/pmd/pmd - pmd_releases/7.6.0 + HEAD From 4796da0fb22e9ec602e9f6576ad1e079273cd9ba Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 3 Oct 2024 19:48:54 +0200 Subject: [PATCH 38/46] Renamed JUnit4TestShouldUseBeforeAnnotation - call it UnitTest... to be agnostic to the testing framework --- docs/pages/release_notes.md | 2 +- .../resources/category/java/bestpractices.xml | 98 +++++++++---------- ...nitTestShouldUseBeforeAnnotationTest.java} | 2 +- .../xml/JUnitTestShouldUseAfterAnnotation.xml | 2 +- ... => UnitTestShouldUseBeforeAnnotation.xml} | 2 +- 5 files changed, 53 insertions(+), 53 deletions(-) rename pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/{JUnitTestShouldUseBeforeAnnotationTest.java => UnitTestShouldUseBeforeAnnotationTest.java} (88%) rename pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/{JUnitTestShouldUseBeforeAnnotation.xml => UnitTestShouldUseBeforeAnnotation.xml} (97%) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index a89a911d51..17ffdd2ccb 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -20,7 +20,7 @@ Several rules for unit testing have been renamed to better reflect their actual * `java/bestpractices/JUnit4TestShouldUseAfterAnnotation` has been renamed to {% rule java/bestpractices/JUnitTestShouldUseAfterAnnotation %} -* `java/bestpractices/JUnit4TestShouldUseBeforeAnnotation` has been renamed to {% rule java/bestpractices/JUnitTestShouldUseBeforeAnnotation %} +* `java/bestpractices/JUnit4TestShouldUseBeforeAnnotation` has been renamed to {% rule java/bestpractices/UnitTestShouldUseBeforeAnnotation %} * `java/bestpractices/JUnit4TestShouldUseTestAnnotation` has been renamed to {% rule java/bestpractices/UnitTestShouldUseTestAnnotation %} diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml index 8356c31e49..efa61aed91 100644 --- a/pmd-java/src/main/resources/category/java/bestpractices.xml +++ b/pmd-java/src/main/resources/category/java/bestpractices.xml @@ -715,55 +715,7 @@ public class MyTest2 {
- - - - -This rule detects methods called setUp() that are not properly annotated as a setup method. -This is primarily intended to assist in upgrading from JUnit 3, where setup methods were required to be called setUp(). -To a lesser extent, this may help detect omissions even under newer JUnit versions, as long as you are following this convention to name the methods. - -JUnit 4 will only execute methods annotated with @Before before all tests. -JUnit 5 introduced @BeforeEach and @BeforeAll annotations to execute methods before each test or before all tests in the class, respectively. - - 3 - - - - - - - - - - - + @@ -1462,6 +1414,54 @@ class Foo{ ]]> + + + + This rule detects methods called `setUp()` that are not properly annotated as a setup method. + This is primarily intended to assist in upgrading from JUnit 3, where setup methods were required to be called `setUp()`. + To a lesser extent, this may help detect omissions even under newer JUnit versions, as long as you are following this convention to name the methods. + + JUnit 4 will only execute methods annotated with `@Before` before all tests. + JUnit 5 introduced `@BeforeEach` and `@BeforeAll` annotations to execute methods before each test or before all tests in the class, respectively. + + 3 + + + + + + + + + + + + [java] JUnit4TestShouldUseBeforeAnnotation false positive when overriding setUp #1592 0 [java] JUnit4TestShouldUseBeforeAnnotation false positive when overriding setUp #1592 0 Date: Thu, 3 Oct 2024 19:52:56 +0200 Subject: [PATCH 39/46] Renamed JUnit4TestShouldUseAfterAnnotation - call it UnitTest... to be agnostic to the testing framework --- docs/pages/release_notes.md | 2 +- .../resources/category/java/bestpractices.xml | 96 +++++++++---------- ...UnitTestShouldUseAfterAnnotationTest.java} | 2 +- ...l => UnitTestShouldUseAfterAnnotation.xml} | 2 +- 4 files changed, 51 insertions(+), 51 deletions(-) rename pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/{JUnitTestShouldUseAfterAnnotationTest.java => UnitTestShouldUseAfterAnnotationTest.java} (88%) rename pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/{JUnitTestShouldUseAfterAnnotation.xml => UnitTestShouldUseAfterAnnotation.xml} (98%) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 17ffdd2ccb..023cc34cc5 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -18,7 +18,7 @@ This is a {{ site.pmd.release_type }} release. Several rules for unit testing have been renamed to better reflect their actual scope. Lots of them were called after JUnit / JUnit 4, even when they applied to JUnit 5 and / or TestNG. -* `java/bestpractices/JUnit4TestShouldUseAfterAnnotation` has been renamed to {% rule java/bestpractices/JUnitTestShouldUseAfterAnnotation %} +* `java/bestpractices/JUnit4TestShouldUseAfterAnnotation` has been renamed to {% rule java/bestpractices/UnitTestShouldUseAfterAnnotation %} * `java/bestpractices/JUnit4TestShouldUseBeforeAnnotation` has been renamed to {% rule java/bestpractices/UnitTestShouldUseBeforeAnnotation %} diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml index efa61aed91..684a2cf539 100644 --- a/pmd-java/src/main/resources/category/java/bestpractices.xml +++ b/pmd-java/src/main/resources/category/java/bestpractices.xml @@ -666,54 +666,7 @@ public class GoodTest { - - - - -This rule detects methods called tearDown() that are not properly annotated as a setup method. -This is primarily intended to assist in upgrading from JUnit 3, where tear down methods were required to be called tearDown(). -To a lesser extent, this may help detect omissions under newer JUnit versions, as long as you are following this convention to name the methods. - -JUnit 4 will only execute methods annotated with @After after running each test. -JUnit 5 introduced @AfterEach and @AfterAll annotations to execute methods after each test or after all tests in the class, respectively. - - 3 - - - - - - - - - - - + @@ -1415,6 +1368,53 @@ class Foo{ + + + This rule detects methods called `tearDown()` that are not properly annotated as a cleanup method. + This is primarily intended to assist in upgrading from JUnit 3, where tear down methods were required to be called `tearDown()`. + To a lesser extent, this may help detect omissions under newer JUnit versions, as long as you are following this convention to name the methods. + + JUnit 4 will only execute methods annotated with `@After` after running each test. + JUnit 5 introduced `@AfterEach` and `@AfterAll` annotations to execute methods after each test or after all tests in the class, respectively. + + 3 + + + + + + + + + + + + [java] JUnit4TestShouldUseBeforeAnnotation false positive when overriding setUp #1592 0 Date: Thu, 3 Oct 2024 19:59:29 +0200 Subject: [PATCH 40/46] [java] Keep bestpractices.xml sorted alphabetically --- .../resources/category/java/bestpractices.xml | 294 +++++++++--------- 1 file changed, 147 insertions(+), 147 deletions(-) diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml index 684a2cf539..6e53d21ba4 100644 --- a/pmd-java/src/main/resources/category/java/bestpractices.xml +++ b/pmd-java/src/main/resources/category/java/bestpractices.xml @@ -672,61 +672,6 @@ public class GoodTest { - - -The rule will detect any test method starting with "test" that is not properly annotated, and will therefore not be run. - -In JUnit 4, only methods annotated with the @Test annotation are executed. -In JUnit 5, one of the following annotations should be used for tests: @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest. -In TestNG, only methods annotated with the @Test annotation are executed. - - 3 - - - - - - - - - - - - - - - -Unit assertions should include an informative message - i.e., use the three-argument version of -assertEquals(), not the two-argument version. - -This rule supports tests using JUnit (3, 4 and 5) and TestNG. - - 3 - - - - - - - -Unit tests should not contain too many asserts. Many asserts are indicative of a complex test, for which -it is harder to verify correctness. Consider breaking the test scenario into multiple, shorter test scenarios. -Customize the maximum number of assertions used by this Rule to suit your needs. - -This rule checks for JUnit (3, 4 and 5) and TestNG Tests. - - 3 - - - - - - - -Unit tests should include at least one assertion. This makes the tests more robust, and using assert -with messages provide the developer a clearer idea of what the test does. - -This rule checks for JUnit (3, 4 and 5) and TestNG Tests. - - 3 - - - - - + + +Unit assertions should include an informative message - i.e., use the three-argument version of +`assertEquals()`, not the two-argument version. + +This rule supports tests using JUnit (3, 4 and 5) and TestNG. + + 3 + + + + + + + + Unit tests should not contain too many asserts. Many asserts are indicative of a complex test, for which + it is harder to verify correctness. Consider breaking the test scenario into multiple, shorter test scenarios. + Customize the maximum number of assertions used by this Rule to suit your needs. + + This rule checks for JUnit (3, 4 and 5) and TestNG Tests. + + 3 + + + + + + + + The rule will detect any test method starting with "test" that is not properly annotated, and will therefore not be run. + + In JUnit 4, only methods annotated with the `@Test` annotation are executed. + In JUnit 5, one of the following annotations should be used for tests: `@Test`, `@RepeatedTest`, `@TestFactory`, `@TestTemplate` or `@ParameterizedTest`. + In TestNG, only methods annotated with the `@Test` annotation are executed. + + 3 + + + + + + + + + + + + + + + + Unit tests should include at least one assertion. This makes the tests more robust, and using assert + with messages provide the developer a clearer idea of what the test does. + + This rule checks for JUnit (3, 4 and 5) and TestNG Tests. + + 3 + + + + + Date: Thu, 3 Oct 2024 20:03:13 +0200 Subject: [PATCH 41/46] [doc] Update release notes (#4532, #4965) --- docs/pages/release_notes.md | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 023cc34cc5..6d8d727990 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -16,29 +16,30 @@ This is a {{ site.pmd.release_type }} release. ### 🌟 Rule Changes -Several rules for unit testing have been renamed to better reflect their actual scope. Lots of them were called after JUnit / JUnit 4, even when they applied to JUnit 5 and / or TestNG. +#### Renamed Rules +Several rules for unit testing have been renamed to better reflect their actual scope. Lots of them were called +after JUnit / JUnit 4, even when they applied to JUnit 5 and / or TestNG. -* `java/bestpractices/JUnit4TestShouldUseAfterAnnotation` has been renamed to {% rule java/bestpractices/UnitTestShouldUseAfterAnnotation %} +* {% rule java/bestpractices/UnitTestShouldUseAfterAnnotation %} (Java Best Practices) has been renamed from `JUnit4TestShouldUseAfterAnnotation`. +* {% rule java/bestpractices/UnitTestShouldUseBeforeAnnotation %} (Java Best Practices) has been renamed from `JUnit4TestShouldUseBeforeAnnotation`. +* {% rule java/bestpractices/UnitTestShouldUseTestAnnotation %} (Java Best Practices) has been renamed from `JUnit4TestShouldUseTestAnnotation`. +* {% rule java/bestpractices/UnitTestAssertionsShouldIncludeMessage %} (Java Best Practices) has been renamed from `JUnitAssertionsShouldIncludeMessage`. +* {% rule java/bestpractices/UnitTestContainsTooManyAsserts %} (Java Best Practices) has been renamed from `JUnitTestContainsTooManyAsserts`. +* {% rule java/bestpractices/UnitTestsShouldIncludeAssert %} (Java Best Practices) has been renamed from `JUnitTestsShouldIncludeAssert`. -* `java/bestpractices/JUnit4TestShouldUseBeforeAnnotation` has been renamed to {% rule java/bestpractices/UnitTestShouldUseBeforeAnnotation %} - -* `java/bestpractices/JUnit4TestShouldUseTestAnnotation` has been renamed to {% rule java/bestpractices/UnitTestShouldUseTestAnnotation %} - -* `java/bestpractices/JUnitAssertionsShouldIncludeMessage` has been renamed to {% rule java/bestpractices/UnitTestAssertionsShouldIncludeMessage %} - -* `java/bestpractices/JUnitTestContainsTooManyAsserts` has been renamed to {% rule java/bestpractices/UnitTestContainsTooManyAsserts %} - -* `java/bestpractices/JUnitTestsShouldIncludeAssert` has been renamed to {% rule java/bestpractices/UnitTestsShouldIncludeAssert %} +The old rule names still work but are deprecated. ### 🐛 Fixed Issues - +* java + * [#4532](https://github.com/pmd/pmd/issues/4532): \[java] Rule misnomer for JUnit* rules * java-bestpractices * [#4278](https://github.com/pmd/pmd/issues/4278): \[java] UnusedPrivateMethod FP with Junit 5 @MethodSource and default factory method name * [#4975](https://github.com/pmd/pmd/issues/4975): \[java] UnusedPrivateMethod false positive when using @MethodSource on a @Nested test ### 🚨 API Changes -### ✨ External Contributions +### ✨ Merged pull requests +* [#4965](https://github.com/pmd/pmd/pull/4965): \[java] Rename JUnit rules with overly restrictive names - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod) {% endtocmaker %} From d77a63da952feebb53c01b8da45bca600b49f35e Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 3 Oct 2024 20:29:53 +0200 Subject: [PATCH 42/46] [doc] Update release notes (#5241) --- docs/pages/release_notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index a0bd73f9c6..978145ff2e 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -29,6 +29,7 @@ This is a {{ site.pmd.release_type }} release. ### ✨ External Contributions * [#5208](https://github.com/pmd/pmd/pull/5208): \[doc] Added Codety to "Tools / Integrations" - [Tony](https://github.com/random1223) (@random1223) +* [#5241](https://github.com/pmd/pmd/pull/5241): \Ignore javacc code in coverage report - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod) {% endtocmaker %} From 7d4961f3033d65476f8a0fdf42101edf540c0c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Thu, 3 Oct 2024 17:47:01 -0300 Subject: [PATCH 43/46] Update README.md Point coveralls to main branch --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a4fde521c..8d215b233a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Build Status](https://github.com/pmd/pmd/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/pmd/pmd/actions) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.sourceforge.pmd/pmd/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.sourceforge.pmd/pmd) [![Reproducible Builds](https://img.shields.io/badge/Reproducible_Builds-ok-green?labelColor=blue)](https://github.com/jvm-repo-rebuild/reproducible-central/tree/master/content/net/sourceforge/pmd#readme) -[![Coverage Status](https://coveralls.io/repos/github/pmd/pmd/badge.svg)](https://coveralls.io/github/pmd/pmd) +[![Coverage Status](https://coveralls.io/repos/github/pmd/pmd/badge.svg?branch=main)](https://coveralls.io/github/pmd/pmd?branch=main) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/ea550046a02344ec850553476c4aa2ca)](https://app.codacy.com/organizations/gh/pmd/dashboard) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](code_of_conduct.md) [![Documentation (latest)](https://img.shields.io/badge/docs-latest-green)](https://docs.pmd-code.org/latest/) From 9fbaa4fbfb7f3d3cf32e82cefc61697995d46c27 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 4 Oct 2024 09:25:21 +0200 Subject: [PATCH 44/46] [java] Update quickstart.xml with renamed UnitTest* rules --- .../src/main/resources/rulesets/java/quickstart.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pmd-java/src/main/resources/rulesets/java/quickstart.xml b/pmd-java/src/main/resources/rulesets/java/quickstart.xml index 97eb2742da..8c8af377ab 100644 --- a/pmd-java/src/main/resources/rulesets/java/quickstart.xml +++ b/pmd-java/src/main/resources/rulesets/java/quickstart.xml @@ -24,13 +24,7 @@ - - - - - - @@ -45,6 +39,12 @@ + + + + + + From c0023dd94209513ec02459250bcdc16806f1a08c Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 4 Oct 2024 09:32:55 +0200 Subject: [PATCH 45/46] [java] Rename UnitTestShouldIncludeAssert again to make it consistent and always use singular "UnitTest" Follow-up on #4532 and #4965 --- docs/pages/release_notes.md | 6 +- .../JUnitTestsShouldIncludeAssertRule.java | 4 +- ...a => UnitTestShouldIncludeAssertRule.java} | 4 +- .../resources/category/java/bestpractices.xml | 58 +++++++++---------- .../resources/rulesets/java/quickstart.xml | 2 +- ...a => UnitTestShouldIncludeAssertTest.java} | 2 +- ...rt.xml => UnitTestShouldIncludeAssert.xml} | 0 7 files changed, 38 insertions(+), 38 deletions(-) rename pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/{UnitTestsShouldIncludeAssertRule.java => UnitTestShouldIncludeAssertRule.java} (93%) rename pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/{UnitTestsShouldIncludeAssertTest.java => UnitTestShouldIncludeAssertTest.java} (79%) rename pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/{UnitTestsShouldIncludeAssert.xml => UnitTestShouldIncludeAssert.xml} (100%) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 0068c0480d..7c5ba5a430 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -20,12 +20,12 @@ This is a {{ site.pmd.release_type }} release. Several rules for unit testing have been renamed to better reflect their actual scope. Lots of them were called after JUnit / JUnit 4, even when they applied to JUnit 5 and / or TestNG. +* {% rule java/bestpractices/UnitTestAssertionsShouldIncludeMessage %} (Java Best Practices) has been renamed from `JUnitAssertionsShouldIncludeMessage`. +* {% rule java/bestpractices/UnitTestContainsTooManyAsserts %} (Java Best Practices) has been renamed from `JUnitTestContainsTooManyAsserts`. +* {% rule java/bestpractices/UnitTestShouldIncludeAssert %} (Java Best Practices) has been renamed from `JUnitTestsShouldIncludeAssert`. * {% rule java/bestpractices/UnitTestShouldUseAfterAnnotation %} (Java Best Practices) has been renamed from `JUnit4TestShouldUseAfterAnnotation`. * {% rule java/bestpractices/UnitTestShouldUseBeforeAnnotation %} (Java Best Practices) has been renamed from `JUnit4TestShouldUseBeforeAnnotation`. * {% rule java/bestpractices/UnitTestShouldUseTestAnnotation %} (Java Best Practices) has been renamed from `JUnit4TestShouldUseTestAnnotation`. -* {% rule java/bestpractices/UnitTestAssertionsShouldIncludeMessage %} (Java Best Practices) has been renamed from `JUnitAssertionsShouldIncludeMessage`. -* {% rule java/bestpractices/UnitTestContainsTooManyAsserts %} (Java Best Practices) has been renamed from `JUnitTestContainsTooManyAsserts`. -* {% rule java/bestpractices/UnitTestsShouldIncludeAssert %} (Java Best Practices) has been renamed from `JUnitTestsShouldIncludeAssert`. The old rule names still work but are deprecated. diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertRule.java index ad20f3cca5..452e67d033 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertRule.java @@ -5,9 +5,9 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; /** - * @deprecated The rule was renamed {@link UnitTestsShouldIncludeAssertRule} + * @deprecated The rule was renamed {@link UnitTestShouldIncludeAssertRule} */ @Deprecated -public class JUnitTestsShouldIncludeAssertRule extends UnitTestsShouldIncludeAssertRule { +public class JUnitTestsShouldIncludeAssertRule extends UnitTestShouldIncludeAssertRule { } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestsShouldIncludeAssertRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestShouldIncludeAssertRule.java similarity index 93% rename from pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestsShouldIncludeAssertRule.java rename to pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestShouldIncludeAssertRule.java index 867ae52504..dc21c4fb1a 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestsShouldIncludeAssertRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestShouldIncludeAssertRule.java @@ -15,7 +15,7 @@ import net.sourceforge.pmd.lang.java.rule.internal.TestFrameworksUtil; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; -public class UnitTestsShouldIncludeAssertRule extends AbstractJavaRulechainRule { +public class UnitTestShouldIncludeAssertRule extends AbstractJavaRulechainRule { private static final PropertyDescriptor> EXTRA_ASSERT_METHOD_NAMES = PropertyFactory.stringProperty("extraAssertMethodNames") @@ -24,7 +24,7 @@ public class UnitTestsShouldIncludeAssertRule extends AbstractJavaRulechainRule .emptyDefaultValue() .build(); - public UnitTestsShouldIncludeAssertRule() { + public UnitTestShouldIncludeAssertRule() { super(ASTMethodDeclaration.class); definePropertyDescriptor(EXTRA_ASSERT_METHOD_NAMES); } diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml index 2698fbab73..aa2f4e7255 100644 --- a/pmd-java/src/main/resources/category/java/bestpractices.xml +++ b/pmd-java/src/main/resources/category/java/bestpractices.xml @@ -748,7 +748,7 @@ class MyTest { // not public, that's fine - + + + + Unit tests should include at least one assertion. This makes the tests more robust, and using assert + with messages provide the developer a clearer idea of what the test does. + + This rule checks for JUnit (3, 4 and 5) and TestNG Tests. + + 3 + + + + + - - - Unit tests should include at least one assertion. This makes the tests more robust, and using assert - with messages provide the developer a clearer idea of what the test does. - - This rule checks for JUnit (3, 4 and 5) and TestNG Tests. - - 3 - - - - - --> + - diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestsShouldIncludeAssertTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestShouldIncludeAssertTest.java similarity index 79% rename from pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestsShouldIncludeAssertTest.java rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestShouldIncludeAssertTest.java index b76c92f615..bab5134261 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestsShouldIncludeAssertTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnitTestShouldIncludeAssertTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; import net.sourceforge.pmd.test.PmdRuleTst; -class UnitTestsShouldIncludeAssertTest extends PmdRuleTst { +class UnitTestShouldIncludeAssertTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnitTestsShouldIncludeAssert.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnitTestShouldIncludeAssert.xml similarity index 100% rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnitTestsShouldIncludeAssert.xml rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnitTestShouldIncludeAssert.xml From 07cd250a74f196ca97dc479d2bca9321df95814e Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 4 Oct 2024 10:00:53 +0200 Subject: [PATCH 46/46] Fix release_notes.md --- docs/pages/release_notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 7c5ba5a430..6f89cebd47 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -37,7 +37,7 @@ The old rule names still work but are deprecated. ### ✨ Merged pull requests * [#4965](https://github.com/pmd/pmd/pull/4965): \[java] Rename JUnit rules with overly restrictive names - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod) -* [#5241](https://github.com/pmd/pmd/pull/5241): \Ignore javacc code in coverage report - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod) +* [#5241](https://github.com/pmd/pmd/pull/5241): Ignore javacc code in coverage report - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod) {% endtocmaker %}