Skip to content

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

@Miuler

Description

@Miuler

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:false-positivePMD flags a piece of code that is not problematic

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions