Fix #5770: [java] UnnecessaryLocalBeforeBranchRule#5835
Fix #5770: [java] UnnecessaryLocalBeforeBranchRule#5835
Conversation
|
need to fix imports... [ERROR] src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryLocalBeforeThrowRule.java:[15,1] (imports) ImportOrder: Wrong order for 'net.sourceforge.pmd.properties.PropertyFactory.booleanProperty' import. |
ec64999 to
07e2497
Compare
|
Compared to main: (comment created at 2025-06-22 21:12:49+00:00 for 5bbfebd) |
07e2497 to
9663264
Compare
|
item: pmd-java: Versions of archives indicate a minor change but binary incompatible changes found. how to fix this please? assuming its related to new version since="7.15.0". |
|
should we give rewrite migration script for this, or does the license impose issues here as well? im sure @iddeepak can grasp this very fast, like always, provide PoC. |
Thanks @Pankraz76! I believe it depends on the implementation, since Rewrite is under the Moderne license. |
adangel
left a comment
There was a problem hiding this comment.
Thanks for the PR! See my comments.
Also note: I think, your PR is fixing #5770. If so, please add this in the PR description with "* Fix #...", so that github can link the PR to the issue.
I think, #5776 can be considered totally independent of this PR - it is not a prerequisite. It is maybe something you stumbled upon while working on it, but it is a different topic.
Also in general: The description of the PR is empty... by looking at the changed code, I can re-engineer what you have done, but it would be nice, if you summarize and describe what you do.
6f63604 to
c3f4b15
Compare
c3f4b15 to
5cb8567
Compare
yes sorry, reverted already. Had troubled fixing imports, so used proper config. Thanks. |
5cb8567 to
90a3eeb
Compare
Pankraz76
left a comment
There was a problem hiding this comment.
flaws to be fixed by spot.
90a3eeb to
eaa109c
Compare
|
item: Error: src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryLocalBeforeThrowRule.java:[1] (header) RegexpHeader: Line does not match expected header line of '^/**?[ ]*$'. header will be fixed by spot too. This PR shows it will help everyone in the project to save time. |
eaa109c to
5bbfebd
Compare
|
should be close this or push to here the deprecated version as well? Deprecating new code makes not sense, therefore should migrate, as not breaking anymore. Having it generic by simply Removing the relation to thats its before, or adding the name instead Branch or Exit needs to be sorted out. How you want to name the new consolidated rule?
This could fit as well, as its about declaration of a redundant local field. |
|
continue here: as this one is missing adjustment of : quickstart.xml |
Fix #5770: [java] UnnecessaryLocalBeforeBranchRule
Add derivate of
UnnecessaryLocalBeforeReturnRuleto coverthrowstatement as well, consideringUnnecessaryLocalBeforeThrowRule.Related issues
Ready?
./mvnw clean verifypasses (checked automatically by github actions)