MCPcopy Create free account
hub / github.com/spotbugs/spotbugs / finallyTest

Method finallyTest

spotbugsTestCases/src/java/FinallyTest.java:7–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5public class FinallyTest {
6
7 public void finallyTest() {
8
9 InputStream in = null;
10
11 try {
12 in = new FileInputStream("foo.txt");
13 byte head[] = new byte[8];
14 if (in.read(head) == 8) {
15 System.out.println(head);
16 }
17 } catch (IOException e) {
18 e.printStackTrace();
19 }
20 // although bad form it is legal
21 finally {
22 try {
23 if (in != null) {
24 in.close();
25 }
26 } catch (IOException e2) {
27 e2.printStackTrace();
28 }
29 }
30 }
31
32}

Callers

nothing calls this directly

Calls 3

closeMethod · 0.65
readMethod · 0.45
printlnMethod · 0.45

Tested by

no test coverage detected