Skip to content

[java] Remove usages of getImage in java module#4352

Closed
oowekyala wants to merge 21 commits into
pmd:masterfrom
oowekyala:pmd7.getImage
Closed

[java] Remove usages of getImage in java module#4352
oowekyala wants to merge 21 commits into
pmd:masterfrom
oowekyala:pmd7.getImage

Conversation

@oowekyala

Copy link
Copy Markdown
Member

Describe the PR

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)

- parse value only once
- dont create garbage strings when parsing
- cache boxed value properly
@oowekyala oowekyala added this to the 7.0.0 milestone Jan 23, 2023

@adangel adangel left a comment

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.

There are a couple of test failures:

[ERROR] Tests run: 6410, Failures: 38, Errors: 0, Skipped: 4

Can you have a look at this? Thanks!

Comment thread pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTResource.java Outdated
Comment on lines 36 to 37
@Deprecated
public String getImage() {

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.

Would that be something, we keep deprecated in PMD 7? Or do we remove it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm not sure... If we remove it then the image will not be available in XPath rules (although there is @ConstValue which is slightly different). OTOH I want to avoid java rules using the image instead of the text if possible...

@oowekyala oowekyala marked this pull request as draft February 1, 2023 23:16
@oowekyala oowekyala changed the base branch from pmd/7.0.x to master March 4, 2023 14:09
@adangel adangel mentioned this pull request Dec 13, 2023
16 tasks
adangel added a commit to adangel/pmd that referenced this pull request Dec 14, 2023
- This improves ASTLiteral implementation
- Adds ASTLiteral#getLiteralText() - not yet exposed as XPath attribute

Co-authored-by: Clément Fournier <clement.fournier76@gmail.com>
adangel added a commit to adangel/pmd that referenced this pull request Dec 14, 2023
- taken from pmd#4352 (avoid getImage())
- Exposes @LiteralText for ASTLiteral

Co-authored-by: Clément Fournier <clement.fournier76@gmail.com>
@adangel adangel removed this from the 7.0.0 milestone Feb 10, 2024
@adangel adangel added this to the 7.x milestone Feb 10, 2024
@oowekyala oowekyala closed this Apr 16, 2024
@adangel adangel removed this from the 7.x milestone Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants