Repository navigation
Conversation
fb854d3 to
0aeecfd
Compare
|
Compared to main: (comment created at 2026-10-22 14:34:40+00:00 for 2dd4db6) |
…of-getImage # Conflicts: # pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldNamingConventionsRule.java
adangel
left a comment
There was a problem hiding this comment.
Thanks for the PR!
I'd prefer, if we directly prepare the deprecation of getImage here. That means
- we don't use the parsers setLastTokenImage anymore (which would call setImage on the node)
- we have for all these cases in the node a proper alternative attribute and getImage returns that attribute. The parser will call the set_name_of_the_attribute setter instead of setLastTokenImage
I've tested this approach with ASTBreakStatement - there are no test failures, so I assume, we don't use break statements with labels in any sample file we have a treedump test... which means, in that case, we can directly deprecated it (note: release notes).
…of-getImage # Conflicts: # pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousOctalEscapeRule.java
|
When I wrote this PR, I didn't want to touch the parser. That's why we wouldn't be able to deprecate As for making sure that |
|
Hmmm, maybe jjtClose is too early. |
This reverts commit 1b41220.
I've continued and finished this PR. I've decided to not use assert in jjtClose and just have unit tests, to verify image attribute. Note: This is only a first step towards #4787 . I've outlined there the next steps for java:
If the build looks fine, I'm going to merge this for 7.29.0. |
Part of #4787
Describe the PR
This PR removes the remaining uses of @Image/Node.getImage() from pmd-java.
Related issues
Ready?
./mvnw clean verifypasses (checked automatically by github actions)