double negation and code inspection

IntelliJ IDEA 5.1.2

During some refactorization I changed my code
if (! complicated logical expression) {
into
if (!!functionCall()) {
I noticed my mistake only after running the the program. Of course it
took some time to find it.

It would be nice if code inspection could catch double negation.
I haven't tried ver. 6, so maybe this inspection is already in place.

Tom

2 comments

I can't believe I missed that one.

--Dave Griffith

0

I had a free half hour in the train today, so look for the "double negation" inspection in the next EAP build.

Bas

0

Please sign in to leave a comment.