Auto-boxing inspection glitch?

Hi gang I have the Auto-boxing and Auto-unboxing inspection turned on but when I have code such as

Long benbid = Long.valueOf(1); // For example

if (benbid == null || benbid < 0) { // <== why isn't this highligted as a warning or error???
     response.setStatus(PlanQueryMsg.INVALID_BENB_ID);
}


The inspection doesn't appear to catch the unboxing that occurs on the  if line.

I've tried turning off the unecessary boxing/unboxing inspection with no luck

This is causing me problems as we have a company policy that we will not use auto-boxing/unboxing in our code.

ideabug1.png

2 comments
Comment actions Permalink

Hello Martin,

It seems that in this case unboxing long values is not properly detected.
Could you please submit an issue at http://youtrack.jetbrains.net ?

Bas

0

Please sign in to leave a comment.