diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 5beef90203..a2d41e1558 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -58,6 +58,7 @@ The remaining section describes the complete release notes for 7.0.0. * java-codestyle * [#2847](https://github.com/pmd/pmd/issues/2847): \[java] New Rule: Use Explicit Types * [#4578](https://github.com/pmd/pmd/issues/4578): \[java] CommentDefaultAccessModifier comment needs to be before annotation if present + * [#4645](https://github.com/pmd/pmd/issues/4645): \[java] CommentDefaultAccessModifier - False Positive with JUnit5's ParameterizedTest * xml-bestpractices * [#4592](https://github.com/pmd/pmd/pull/4592): \[xml] Add MissingEncoding rule diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierRule.java index 5d5892bc43..23506062fe 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierRule.java @@ -52,16 +52,16 @@ public class CommentDefaultAccessModifierRule extends AbstractJavaRulechainRule "com.google.common.annotations.VisibleForTesting", "android.support.annotation.VisibleForTesting", "co.elastic.clients.util.VisibleForTesting", - "org.junit.jupiter.api.Test", - "org.junit.jupiter.api.extension.RegisterExtension", - "org.junit.jupiter.api.ParameterizedTest", + "org.junit.jupiter.api.AfterAll", + "org.junit.jupiter.api.AfterEach", + "org.junit.jupiter.api.BeforeAll", + "org.junit.jupiter.api.BeforeEach", "org.junit.jupiter.api.RepeatedTest", + "org.junit.jupiter.api.Test", "org.junit.jupiter.api.TestFactory", "org.junit.jupiter.api.TestTemplate", - "org.junit.jupiter.api.BeforeEach", - "org.junit.jupiter.api.BeforeAll", - "org.junit.jupiter.api.AfterEach", - "org.junit.jupiter.api.AfterAll", + "org.junit.jupiter.api.extension.RegisterExtension", + "org.junit.jupiter.params.ParameterizedTest", "org.testng.annotations.Test", "org.testng.annotations.AfterClass", "org.testng.annotations.AfterGroups", diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/CommentDefaultAccessModifier.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/CommentDefaultAccessModifier.xml index 8ce22f0ebe..6375c33a89 100755 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/CommentDefaultAccessModifier.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/CommentDefaultAccessModifier.xml @@ -454,16 +454,16 @@ public enum MyEnum { - #3859 #4273 [java] CommentDefaultAccessModifier is triggered in JUnit5 method and it was conflicting with rule JUnit5TestShouldBePackagePrivate + #3859 #4273 #4645 [java] CommentDefaultAccessModifier is triggered in JUnit5 method and it was conflicting with rule JUnit5TestShouldBePackagePrivate 0