From 3ec38df9b0fdd8a7b4c03862d8f7515e4dac95e3 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Tue, 6 Feb 2024 20:18:03 +0100 Subject: [PATCH] [core] Remove deprecated XPathVersions --- docs/pages/release_notes.md | 10 +++++--- docs/pages/release_notes_pmd7.md | 2 +- .../resources/category/apex/bestpractices.xml | 1 - .../resources/category/apex/performance.xml | 2 -- .../pmd/lang/rule/xpath/XPathVersion.java | 23 ------------------- .../pmd/lang/rule/XPathRuleTest.java | 12 +++------- .../net/sourceforge/pmd/xml/j2ee.xml | 9 -------- .../test/resources/rulesets/dummy/basic.xml | 2 -- .../resources/rulesets/ruledoctest/sample.xml | 3 --- .../rulesets/ruledoctest/sample2.xml | 1 - .../resources/category/html/bestpractices.xml | 1 - .../resources/category/java/bestpractices.xml | 2 -- .../resources/category/java/codestyle.xml | 3 --- .../main/resources/category/java/design.xml | 1 - .../resources/category/java/errorprone.xml | 5 ---- .../resources/category/java/performance.xml | 1 - .../pmd/ant/classpathtest/ruleset.xml | 1 - .../category/kotlin/bestpractices.xml | 1 - .../pmd/lang/plsql/PLSQLXPathRuleTest.java | 23 ++----------------- .../main/resources/rulesets/dummy/basic.xml | 1 - .../resources/category/xml/bestpractices.xml | 1 - 21 files changed, 13 insertions(+), 92 deletions(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 2b1f2adba6..a52ae871f1 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -176,9 +176,7 @@ The following previously deprecated rules have been finally removed: #### API Changes -**Removed classes and methods (previously deprecated)** - -The following previously deprecated classes have been removed: +**Removed classes and members (previously deprecated)** * pmd-core * {%jdoc !!core::cpd.CpdLanguageProperties %}. The field `DEFAULT_SKIP_BLOCKS_PATTERN` has been removed. @@ -200,6 +198,12 @@ The following previously deprecated classes have been removed: Use {%jdoc core::lang.document.TextDocument#readOnlyString(java.lang.CharSequence,core::lang.document.FileId,core::lang.LanguageVersion) %} instead. * {%jdoc !!core::lang.document.TextFile %} - method `dataSourceCompat(DataSource,PMDConfiguration)` has been removed. Use {%jdoc core::lang.document.TextFile %} directly, e.g. {%jdoc core::lang.document.TextFile.forPath(java.nio.file.Path,java.nio.charset.Charset,core::lang.LanguageVersion) %} + * {%jdoc !!core::lang.rule.xpath.XPathVersion %} + * `XPATH_1_0` + * `XPATH_1_0_COMPATIBILITY` + * `XPATH_2_0` + * Only XPath version 3.1 is now supported. This version of the XPath language is mostly identical to + XPath 2.0. XPath rules by default use now {%jdoc core::lang.rule.xpath.XPathVersion#XPATH_3_1 %}. * pmd-apex * {%jdoc apex::lang.apex.ast.ApexNode %} and {% jdoc apex::lang.apex.ast.ASTApexFile %} * `#getApexVersion()`: In PMD 6, this method has been deprecated but was defined in the class `ApexRootNode`. diff --git a/docs/pages/release_notes_pmd7.md b/docs/pages/release_notes_pmd7.md index 2d5767bea1..f55e3578c5 100644 --- a/docs/pages/release_notes_pmd7.md +++ b/docs/pages/release_notes_pmd7.md @@ -599,7 +599,7 @@ See [ADR 3 - API evolution principles](pmd_projectdocs_decisions_adr_3.html) and ### XPath 3.1 support -Support for XPath versions 1.0, 1.0-compatibility was removed, support for XPath 2.0 is deprecated. The default +Support for XPath versions 1.0, 1.0-compatibility, 2.0 was removed. The default (and only) supported XPath version is now XPath 3.1. This version of the XPath language is mostly identical to XPath 2.0. diff --git a/pmd-apex/src/main/resources/category/apex/bestpractices.xml b/pmd-apex/src/main/resources/category/apex/bestpractices.xml index 178f94e82e..96e90f4139 100644 --- a/pmd-apex/src/main/resources/category/apex/bestpractices.xml +++ b/pmd-apex/src/main/resources/category/apex/bestpractices.xml @@ -116,7 +116,6 @@ annotation for test classes and methods. 3 - 3 - 3 - 3 - 4 - 4 - 4 - 4 - 4 - 3 - 3 - 3 - 3 - 3 - 3 - 3 - 3 - 3 - 3 - 3 - - 1 - 3 - - 3 - 3 - java.lang.Enum,java.lang.Class @@ -1089,7 +1088,6 @@ class Foo { ]]> 3 - 2 - 3 - 1 - 3 - 3 - 3 - 3 - 3 -