Menu

#1277 Delete BooleanInversion as it makes no sense

PMD-5.3.0
closed
None
PMD
3-Major
Bug
5.2.1
2015-04-01
2014-11-05
No

As validated by JMH benchmark (see BooleanNegate Test Case), all the variants of boolean negation result in exactly the same machine code.
Thus it makes little sense to suggest one or the other way of expressing the code.

The issue is "reported" in https://twitter.com/shipilev/status/529975950411587584

1 Attachments

Discussion

  • Andreas Dangel

    Andreas Dangel - 2015-03-15
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,4 @@
    -As validated by JMH benchmark (see [1]), all the variants of boolean negation result in exactly the same machine code.
    +As validated by JMH benchmark (see [BooleanNegate Test Case][1]), all the variants of boolean negation result in exactly the same machine code.
     Thus it makes little sense to suggest one or the other way of expressing the code.
    
     The issue is "reported" in https://twitter.com/shipilev/status/529975950411587584
    
    • status: open --> in-progress
    • assigned_to: Andreas Dangel
    • Milestone: New Tickets --> PMD-Next
     
  • Andreas Dangel

    Andreas Dangel - 2015-03-15

    Thanks for pointing this out :)

    The rule is deprecated now and will be removed with the release after 5.3.0.

    The bytecode that is generated by the compiler is indeed different - but the JIT compiler seems to optimize it always to the "fastest way". So, there is no need anymore for this rule.

     
  • Andreas Dangel

    Andreas Dangel - 2015-03-15
    • status: in-progress --> closed
     

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.