Skip to content
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

Merged
merged 29 commits into from May 7, 2024

Conversation

jsotuyod
Copy link
Member

@jsotuyod jsotuyod commented Apr 19, 2024

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?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

@jsotuyod jsotuyod marked this pull request as ready for review April 19, 2024 05:15
@thvd
Copy link

thvd commented Apr 19, 2024

@jsotuyod I am very happy with this, this seems exactly to solve my problem as described in #4950 👍

@pmd-test
Copy link

pmd-test commented Apr 19, 2024

1 Message
📖 Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Download full report as build artifact
Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Download full report as build artifact
Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Download full report as build artifact
Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Download full report as build artifact
Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Download full report as build artifact

Generated by 🚫 Danger

@jsotuyod
Copy link
Member Author

Once this is merged, we will need to update the PMD Designer to properly handle these attribute types in the UI.

@adangel adangel modified the milestones: 7.1.0, 7.2.0 Apr 25, 2024
Copy link
Member

@adangel adangel left a 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.

@adangel adangel added the in:xpath Relating to xpath support at large, eg Jaxen / Saxon, custom functions, attribute resolution label Apr 26, 2024
docs/pages/release_notes.md Outdated Show resolved Hide resolved
docs/pages/release_notes.md Outdated Show resolved Hide resolved
@jsotuyod
Copy link
Member Author

jsotuyod commented May 7, 2024

Is there anything missing on this? I'd love to get started on the designer changes needed for this…

Copy link
Member

@oowekyala oowekyala left a 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

oowekyala added a commit to oowekyala/pmd that referenced this pull request May 7, 2024
@oowekyala oowekyala merged commit e433127 into pmd:master May 7, 2024
3 checks passed
@jsotuyod jsotuyod deleted the xpath-seq-attributes branch May 7, 2024 18:36
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[core] Expose collections from getters as XPath sequence attributes
5 participants