Where is this quickfix?

String foo = ...
if (foo instanceof String) {
...
}


should be converted to


String foo = ...
if (foo != null) {
...
}


I could swear it is there, but I cannot find it.

Tom

3 comments
Comment actions Permalink

I'm pretty sure it's part of "Constant conditions & exceptions", mostly for obscure implementation reasons.

--Dave Griffith

0
Comment actions Permalink

It's a QuickFix for the Constant Conditions inspection: "Simplify ... to true" - if IDEA succeeds to
finish its analysis, which can fail if the containing method is overly complex. See also
http://www.jetbrains.net/jira/browse/IDEADEV-14126

Sascha

0
Comment actions Permalink

Thanks, Sascha and Dave, I was searching by "instanceof" and could not find it.

Tom

0

Please sign in to leave a comment.