forked from typetools/checker-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTryCatch.java
More file actions
40 lines (36 loc) · 829 Bytes
/
Copy pathTryCatch.java
File metadata and controls
40 lines (36 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import org.checkerframework.checker.nullness.qual.*;
class EntryReader {
public EntryReader() throws IOException {}
}
public class TryCatch {
void constructorException() throws IOException {
List<Exception> file_errors = new ArrayList<>();
try {
new EntryReader();
} catch (FileNotFoundException e) {
file_errors.add(e);
}
}
void unreachableCatch(String[] xs) {
String t = "";
t.toString();
try {
} catch (Throwable e) {
// Note that this code is dead.
t.toString();
}
}
void noClassDefFoundError(@Nullable Object x) {
try {
Class cls = EntryReader.class;
} catch (NoClassDefFoundError e) {
if (x != null) {
// OK
x.toString();
}
}
}
}