IDEA-215325 Provide "surround with instanceof" fix for possible class cast warning

Also 'assert x instanceof Type' fix is provided

GitOrigin-RevId: 56603a5cb9ce2040525b4147cc8fcabd6f6d7d5d
This commit is contained in:
Tagir Valeev
2019-06-03 12:32:26 +07:00
committed by intellij-monorepo-bot
parent f0dcbe74ae
commit a67207d6c8
8 changed files with 66 additions and 10 deletions

View File

@@ -0,0 +1,9 @@
// "Surround with 'if (obj instanceof String)'" "true"
class X {
void test(Object obj) {
if (obj instanceof Integer) System.out.println();
if (obj instanceof String) {
String string = (String)obj;
}
}
}