New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core] Expose collections from getters as XPath sequence attributes #4969
Conversation
- When Saxon determines that it needs to atomize an attribute rather than getStringValue() we were not producing deprecation warnings.
- no longer need to manually add the attributes… - …but the format is slightly different
Generated by 🚫 Danger |
Once this is merged, we will need to update the PMD Designer to properly handle these attribute types in the UI. |
pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/InnerClassLocations.txt
Outdated
Show resolved
Hide resolved
pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonXPathRuleQuery.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should address first the comments. That means, this enhancement has to wait unfortunately for 7.2.0.
But then we might be able to
- provide an updated PMD Designer which can properly handle these attribute types
- have updated documentation, maybe with examples
- have a better evaluation of the impact of this enhancement, because now by default lists are exposed which weren't before and not all might make sense.
pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java
Outdated
Show resolved
Hide resolved
pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug208.txt
Show resolved
Hide resolved
pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/InnerClassLocations.txt
Outdated
Show resolved
Hide resolved
Co-authored-by: Clément Fournier <[email protected]>
…ernal/SaxonXPathRuleQuery.java Co-authored-by: Clément Fournier <[email protected]>
Co-authored-by: Andreas Dangel <[email protected]>
Co-authored-by: Andreas Dangel <[email protected]>
Is there anything missing on this? I'd love to get started on the designer changes needed for this… |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me Juan. Will merge soon
Describe the PR
In the past PMD has only exposed as attributes getters that retrieve a primitive (boxed or unboxed), a String or an enum. This change expands upon that also allowing to expose any
java.util.Collection
as a sequence, as long as the values are theselves one of those types.Related issues
Ready?
./mvnw clean verify
passes (checked automatically by github actions)