Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/surroundWithIf/afterCast.java
Tagir Valeev a67207d6c8 IDEA-215325 Provide "surround with instanceof" fix for possible class cast warning
Also 'assert x instanceof Type' fix is provided

GitOrigin-RevId: 56603a5cb9ce2040525b4147cc8fcabd6f6d7d5d
2019-06-03 09:06:15 +03:00

9 lines
232 B
Java

// "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;
}
}
}