Fix dataflow for unchecked exceptions in multi-catch

This commit is contained in:
Roman Shevchenko
2012-11-21 15:47:25 +01:00
parent fd09e4393d
commit f25a27d043
2 changed files with 51 additions and 23 deletions
@@ -3,8 +3,8 @@ import org.jetbrains.annotations.NotNull;
public class BrokenAlignment {
@NotNull
Object test(){
try{
Object test1() {
try {
bar(<warning descr="Passing 'null' argument to parameter annotated as @NotNull">null</warning>);
return <warning descr="'null' is returned by the method declared as @NotNull">null</warning>;
}
@@ -13,6 +13,28 @@ public class BrokenAlignment {
}
}
@NotNull
Object test2() {
try {
bar(<warning descr="Passing 'null' argument to parameter annotated as @NotNull">null</warning>);
return <warning descr="'null' is returned by the method declared as @NotNull">null</warning>;
}
catch (IllegalArgumentException | IllegalStateException e) {
return <warning descr="'null' is returned by the method declared as @NotNull">null</warning>;
}
}
@NotNull
Object test3() {
try {
bar(<warning descr="Passing 'null' argument to parameter annotated as @NotNull">null</warning>);
return <warning descr="'null' is returned by the method declared as @NotNull">null</warning>;
}
catch (AssertionError | IllegalStateException e) {
return <warning descr="'null' is returned by the method declared as @NotNull">null</warning>;
}
}
public void bar(@NotNull Object foo) {
assert <warning descr="Condition 'foo != null' is always 'true'">foo != null</warning>;
}