Menu

#1418 RedundantFieldInitializer false positive with large long value

PMD-5.3.5
closed
None
PMD
3-Major
Bug
5.3.4
RedundantFieldInitializer
2015-10-03
2015-10-01
No

public class SomeClass {
private long someNumber = 0x100000000000L.
}

This gets flagged as a violation for RedundantFieldInitializer. This is because the rule creates a BigInteger in parseInteger() but then does value.intValue(), which truncates the value to 0.

Discovered with PMD 5.3.4 and Java 1.8.0_51.

Discussion

  • Andreas Dangel

    Andreas Dangel - 2015-10-03
    • status: open --> closed
    • assigned_to: Andreas Dangel
    • Milestone: New Tickets --> PMD-5.3.5
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.