Remove GeneralizeCatchFix as more general alternative exists

This commit is contained in:
Roman.Ivanov
2019-04-03 12:37:11 +07:00
parent 6d37214f4d
commit 0f8d589a14
12 changed files with 0 additions and 250 deletions
@@ -1,16 +0,0 @@
// "Generalize catch for 'java.io.FileNotFoundException' to 'java.io.IOException'" "true"
import java.io.*;
public class c1 {
void f() {
FileInputStream fis = null;
try {
fis = new FileInputStream("");
DataInputStream dis = new DataInputStream(fis);
dis.<caret>readInt();
} catch (IOException e) {
e.printStackTrace();
}
}
}
@@ -1,17 +0,0 @@
// "Generalize catch for 'C.E1' to 'C.E'" "true"
class C {
static class E extends Exception { }
static class E1 extends E { }
static class MyResource implements AutoCloseable {
public MyResource() throws E1 { }
public void close() throws E { }
}
void f() {
try (MyResource r = new MyResource()) {
} catch (E e) {
e.printStackTrace();
}
}
}
@@ -1,16 +0,0 @@
// "Generalize catch for 'java.io.FileNotFoundException' to 'java.io.IOException'" "true"
import java.io.*;
public class c1 {
void f() {
FileInputStream fis = null;
try {
fis = new FileInputStream("");
DataInputStream dis = new DataInputStream(fis);
dis.<caret>readInt();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}
@@ -1,16 +0,0 @@
// "Generalize catch for 'java.io.FileNotFoundException' to 'java.lang.IllegalAccessException'" "false"
import java.io.*;
public class c1 {
void f() {
FileInputStream fis = null;
try {
fis = new FileInputStream("");
DataInputStream dis = new DataInputStream(fis);
<caret>throw new IllegalAccessException();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}
@@ -1,17 +0,0 @@
// "Generalize catch for 'C.E1' to 'C.E'" "true"
class C {
static class E extends Exception { }
static class E1 extends E { }
static class MyResource implements AutoCloseable {
public MyResource() throws E1 { }
public void close() throws E { }
}
void f() {
try (<caret>MyResource r = new MyResource()) {
} catch (E1 e) {
e.printStackTrace();
}
}
}
@@ -1,16 +0,0 @@
// "Generalize catch for 'java.lang.Exception' to 'java.lang.Exception'" "false"
import java.util.function.Supplier;
class C {
static Object get() throws Exception {
return null;
}
void method() {
try {
Supplier<Object> lambda1 = () -> C.ge<caret>t();
} catch( Exception e) {
throw new RuntimeException(e);
}
}
}
@@ -1,16 +0,0 @@
// "Generalize catch for 'java.lang.Exception' to 'java.lang.Exception'" "false"
import java.util.function.Supplier;
class C {
static Object get() throws Exception {
return null;
}
void method() {
try {
Supplier<Object> lambda1 = C::g<caret>et;
} catch( Exception e) {
throw new RuntimeException(e);
}
}
}