RedundantCastUtil: fix isCastRedundant (avoid checking another cast)

This commit is contained in:
Tagir Valeev
2019-03-11 17:51:28 +07:00
parent 4d844c7a4e
commit 7906dd0dcd
3 changed files with 25 additions and 21 deletions

View File

@@ -0,0 +1,9 @@
// "Simplify" "true"
class Test {
public static void main(String[] args) {
foo((String) null, (int) 0);
}
static void foo(String s, int i) {}
static void foo(Number n, int i) {}
}

View File

@@ -0,0 +1,9 @@
// "Simplify" "true"
class Test {
public static void main(String[] args) {
foo(false ? <caret>"" : null, (int) 0);
}
static void foo(String s, int i) {}
static void foo(Number n, int i) {}
}