mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-95437 (separate rethrow types/data flow analysis)
This commit is contained in:
+39
-2
@@ -1,9 +1,8 @@
|
||||
import java.lang.Exception;
|
||||
|
||||
class C {
|
||||
static class E extends Exception { }
|
||||
static class E1 extends E { }
|
||||
static class E2 extends E { }
|
||||
static class Err extends Error { }
|
||||
|
||||
void m1() {
|
||||
try {
|
||||
@@ -113,4 +112,42 @@ class C {
|
||||
<error descr="Unhandled exception: C.E">throw x;</error>
|
||||
}
|
||||
}
|
||||
|
||||
void m9_1() {
|
||||
try {
|
||||
System.out.println();
|
||||
}
|
||||
catch (Throwable t) {
|
||||
// throws Throwable before JDK7
|
||||
<error descr="Unhandled exception: java.lang.Throwable">throw t;</error>
|
||||
}
|
||||
}
|
||||
|
||||
void m9_2() {
|
||||
try {
|
||||
System.out.println();
|
||||
}
|
||||
catch (Error e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
void m9_3() {
|
||||
try {
|
||||
System.out.println();
|
||||
}
|
||||
catch (Err e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
void m9_4() {
|
||||
try {
|
||||
if (false) throw new RuntimeException();
|
||||
}
|
||||
catch (Exception e) {
|
||||
// throws Exception before JDK7
|
||||
<error descr="Unhandled exception: java.lang.Exception">throw e;</error>
|
||||
}
|
||||
}
|
||||
}
|
||||
+48
-3
@@ -2,6 +2,7 @@ class C {
|
||||
static class E extends Exception { }
|
||||
static class E1 extends E { }
|
||||
static class E2 extends E { }
|
||||
static class Err extends Error { }
|
||||
|
||||
void m0() {
|
||||
try {
|
||||
@@ -156,15 +157,59 @@ class C {
|
||||
}
|
||||
}
|
||||
|
||||
void m11_1() {
|
||||
try {
|
||||
System.out.println();
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
void m11_2() {
|
||||
try {
|
||||
System.out.println();
|
||||
}
|
||||
catch (Error e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
void m11_3() {
|
||||
try {
|
||||
System.out.println();
|
||||
}
|
||||
catch (Err e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
void m11_4() {
|
||||
try {
|
||||
if (false) throw new RuntimeException();
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/*void m11() {
|
||||
try {
|
||||
System.out.println();
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
void m11() {
|
||||
try {
|
||||
System.out.println();
|
||||
}
|
||||
catch (Exception e) {
|
||||
// test for precise types calculation fix
|
||||
<error descr="Unhandled exception: java.lang.Exception">throw e;</error>
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
static class MyResource implements AutoCloseable {
|
||||
public void close() throws E1 { }
|
||||
|
||||
Reference in New Issue
Block a user