Skip to content

[java] LocalVariableCouldBeFinal false-positive with lombok.val #5079

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

Closed
Miuler opened this issue Jun 21, 2024 · 0 comments · Fixed by #5600
Closed

[java] LocalVariableCouldBeFinal false-positive with lombok.val #5079

Miuler opened this issue Jun 21, 2024 · 0 comments · Fixed by #5600
Labels
a:false-positive PMD flags a piece of code that is not problematic
Milestone

Comments

@Miuler
Copy link

Miuler commented Jun 21, 2024

Rule:LocalVariableCouldBeFinal

Please provide the rule name and a link to the rule documentation:
https://pmd.github.io/pmd/pmd_rules_java_codestyle.html#methodargumentcouldbefinal

Description: lombok.val is equivalet to final class

Code Sample demonstrating the issue:

import lombok.val;

val test04 = logicTestService.test();
// This is equivalent to:
// final String test04 = logicTestService.test();

Error:

LocalVariableCouldBeFinal: Local variable 'test04' could be declared final

@Miuler Miuler added the a:false-positive PMD flags a piece of code that is not problematic label Jun 21, 2024
@adangel adangel changed the title [java] false-positive Rule:LocalVariableCouldBeFinal with val from lombok [java] LocalVariableCouldBeFinal false-positive with lombok.val Feb 21, 2025
@adangel adangel added this to the 7.12.0 milestone Mar 27, 2025
adangel added a commit to adangel/pmd that referenced this issue Mar 27, 2025
adangel added a commit to adangel/pmd that referenced this issue Mar 27, 2025
…mbok.val (pmd#5600)

Merge pull request pmd#5600 from oowekyala:issue5079-lombok-val-final
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:false-positive PMD flags a piece of code that is not problematic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants