Skip to content

[core] Deprecate Jaxen and XPath internal API #2407

Merged
adangel merged 8 commits into
pmd:masterfrom
oowekyala:deprecate-jaxen
Apr 13, 2020
Merged

[core] Deprecate Jaxen and XPath internal API #2407
adangel merged 8 commits into
pmd:masterfrom
oowekyala:deprecate-jaxen

Conversation

@oowekyala

@oowekyala oowekyala commented Apr 8, 2020

Copy link
Copy Markdown
Member

Part of #1687

  • Deprecate XPathRuleQuery as internal API. On the 7.0 branch this will probably be removed as there is no need for several implementations without Jaxen
  • Make an enum to represent XPath versions. This will be useful to manage migration for users I think, by issuing deprecation warnings. This replaces the string constants of XPathRuleQuery
  • Deprecate the property descriptors for xpath version and xpath expression (note, that the properties are not deprecated!, so they don't produce a warning in the XML, it's just their programmatic usage that is deprecated). Implementing these as properties was an easy solution, but they should not be overridden by users, as they're part of the implementation of the rule. Since we'll be giving a special XML syntax to XPath rules in 7.0, we won't need to implement these with properties anymore anyway
  • Also deprecate MockRule and ImmutableLanguage, which are useless

@oowekyala oowekyala added in:xpath Relating to xpath support at large, eg Jaxen / Saxon, custom functions, attribute resolution is:deprecation The main focus is deprecating public APIs or rules, eg to make them internal, or removing them labels Apr 8, 2020
@oowekyala oowekyala added this to the 6.23.0 milestone Apr 8, 2020
Defines properties
@ghost

ghost commented Apr 9, 2020

Copy link
Copy Markdown
1 Message
📖 This changeset introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Full report

Generated by 🚫 Danger

@oowekyala oowekyala marked this pull request as ready for review April 9, 2020 16:44
adangel added a commit that referenced this pull request Apr 13, 2020
[core] Deprecate Jaxen and XPath internal API #2407
@adangel adangel merged commit 60d4439 into pmd:master Apr 13, 2020
}

@Override
public void initialize(IndependentContext context) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw. this API must definitely change with PMD 7 - we are exposing here a implementation detail (that we use Saxon). And it happens, that the way, how custom functions are registered, changed with Saxon 9.5... which makes the need for a implementation agnostic API relevant...

Comment thread pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/XPathRule.java
@oowekyala oowekyala deleted the deprecate-jaxen branch April 13, 2020 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in:xpath Relating to xpath support at large, eg Jaxen / Saxon, custom functions, attribute resolution is:deprecation The main focus is deprecating public APIs or rules, eg to make them internal, or removing them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants