Hard to find

Hi,

Is there an inspection method in IntelliJ that detects hard to find
mistakes like this?

...
if (conditionIsTrue);
{
doOnlyIfConditionIsTrue();
}
...

Pay attention to the ";" at the end of the "if" line.

Thanks,

Franklin.

2 comments

Franklin wrote:

Hi,

Is there an inspection method in IntelliJ that detects hard to find
mistakes like this?

...
if (conditionIsTrue);
{
doOnlyIfConditionIsTrue();
}
...

Pay attention to the ";" at the end of the "if" line.

Thanks,

Franklin.


I thought that "Statement with empty body" under "Probable Bugs" was
supposed to catch that. But it isn't catching it right now.

0

Yes, it should be. I'll give it a look.

--Dave Griffith

0

Please sign in to leave a comment.