I have a coworker who spent some time tracking down a problem to finally realize the code had an empty if. Here is what I mean:
Clearly the semicolon after the if was a mistake. At least, it's clear to you and me. Might it also be clear to IDEA?
I'm thinking it would be nice if IDEA would highlight if and while statments that have no body in yellow (a warning). The downside is that some code does this intentionally:
Our thoughts where that you could ignore the yellow marker if you desired this code. Or, IDEA could skip the warning if curly braces were used. So that
would not cause a warning message.
Does anyone else think this check would be useful, or have a better heuristic for finding just the problem cases?