Use bitwise inversion to invert boolean values - it's the fastest way to do this. See http://www.javaspecialists.co.za/archive/newsletter.do?issue=042&locale=en_US for specific detailspublic class Foo { public void main(bar) { boolean b = true; b = !b; // slow b ^= true; // fast } }Additional info can be found at this http://pmd.sourceforge.net/rules/controversial.html#BooleanInversion site.
| 1 | org.jcoderz.commons.logging.StackTraceInfo |
| Use bitwise inversion to invert boolean values [134:33] | |
| 1 | org.jcoderz.phoenix.report.JCoverageInputStream |
| Use bitwise inversion to invert boolean values [63:24] | |
| 1 | org.jcoderz.phoenix.report.samples.SimplePmdFindings |
| Use bitwise inversion to invert boolean values (sample) [108:11] | |