From a9c61cc49d13844174a9528ac65100099fe5a21b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Wed, 31 Mar 2021 15:27:28 +0200 Subject: [PATCH 1/2] Move TypeResTest rule out of security.xml Fix #4367 --- .../TypeResTestRule.java | 10 ++++---- .../main/resources/category/java/security.xml | 14 ----------- .../rulesets/java/internal/diagnostics.xml | 24 +++++++++++++++++++ 3 files changed, 28 insertions(+), 20 deletions(-) rename pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/{security => internal}/TypeResTestRule.java (93%) create mode 100644 pmd-java/src/main/resources/rulesets/java/internal/diagnostics.xml diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/security/TypeResTestRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/TypeResTestRule.java similarity index 93% rename from pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/security/TypeResTestRule.java rename to pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/TypeResTestRule.java index a3f2537c81..63ac824684 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/security/TypeResTestRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/TypeResTestRule.java @@ -1,8 +1,8 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.lang.java.rule.security; +package net.sourceforge.pmd.lang.java.rule.internal; import org.apache.commons.lang3.StringUtils; import org.checkerframework.checker.nullness.qual.NonNull; @@ -17,11 +17,9 @@ import net.sourceforge.pmd.lang.java.types.TypeSystem; import net.sourceforge.pmd.util.StringUtil; /** - * @deprecated This is just a toy rule that counts the proportion of resolved types in a codebase, - * not meant as a real rule + * This is just a toy rule that counts the proportion of resolved types + * in a codebase, not meant as a real rule. */ -// TODO Move this rule to a (internal) diagnostics category/ruleset -@Deprecated @SuppressWarnings("PMD") public class TypeResTestRule extends AbstractJavaRule { diff --git a/pmd-java/src/main/resources/category/java/security.xml b/pmd-java/src/main/resources/category/java/security.xml index d3a59092bf..e279d7b30f 100644 --- a/pmd-java/src/main/resources/category/java/security.xml +++ b/pmd-java/src/main/resources/category/java/security.xml @@ -63,18 +63,4 @@ public class Foo { ]]> - - - -This is just a toy rule that counts the proportion of resolved types in a codebase, not meant as a real rule. - -It is used to test the capability of PMD's own type resolution. - - 3 - diff --git a/pmd-java/src/main/resources/rulesets/java/internal/diagnostics.xml b/pmd-java/src/main/resources/rulesets/java/internal/diagnostics.xml new file mode 100644 index 0000000000..52a523fe02 --- /dev/null +++ b/pmd-java/src/main/resources/rulesets/java/internal/diagnostics.xml @@ -0,0 +1,24 @@ + + + + Contains rules for internal use. + + + + + This is just a toy rule that counts the proportion of resolved types in a codebase, not meant as a real rule. + + It is used to test the capability of PMD's own type resolution. + + 3 + + + From f9bd34ac21ca3cce15657a872c3d5cb7117a7c76 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Mon, 30 Jan 2023 12:32:51 +0100 Subject: [PATCH 2/2] [doc] Update release notes (#4367) --- docs/pages/7_0_0_release_notes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/pages/7_0_0_release_notes.md b/docs/pages/7_0_0_release_notes.md index bd9506cc4d..508282249e 100644 --- a/docs/pages/7_0_0_release_notes.md +++ b/docs/pages/7_0_0_release_notes.md @@ -255,6 +255,8 @@ The following previously deprecated rules have been finally removed: * [#4079](https://github.com/pmd/pmd/issues/4079): \[cli] Split off CLI implementation into a pmd-cli submodule * apex-design * [#2667](https://github.com/pmd/pmd/issues/2667): \[apex] Integrate nawforce/ApexLink to build robust Unused rule +* java + * [#4367](https://github.com/pmd/pmd/issues/4367): \[java] Move testrule TypeResTest into internal * java-bestpractices * [#342](https://github.com/pmd/pmd/issues/342): \[java] AccessorMethodGeneration: Name clash with another public field not properly handled * [#755](https://github.com/pmd/pmd/issues/755): \[java] AccessorClassGeneration false positive for private constructors