Menu

#1396 PrematureDeclaration lambda false positive

PMD-5.3.4
closed
None
PMD
3-Major
Bug
5.3.3
optimizations / PrematureDeclaration
2015-09-07
2015-08-29
Ben Manes
No

The rule attempts to detect variables that are allocated but may not be used due to an early return statement. This appears to have not been updated to reflect Java 8 where a lambda may have a return statement, which is not scoped to exit the method. The rule incorreclty flags the method while in actuality the order of statements does not matter.

Discussion

  • Andreas Dangel

    Andreas Dangel - 2015-09-07
    • status: open --> closed
    • assigned_to: Andreas Dangel
    • Milestone: New Tickets --> PMD-5.3.4
     

Log in to post a comment.