View Javadoc
1   public class UselessControlFlow {
2
3       void harmless1(Object x, Object y) {
4           if (!x.equals(y)) {
5
6           } else {
7
8           }
9           System.out.println(x);
10          System.out.println(y);
11      }
12
13      void report0(Object x, Object y) {
14          if (!x.equals(y))
15              ;
16          System.out.println(x);
17          System.out.println(y);
18      }
19
20      void report1(Object x, Object y) {
21          if (!x.equals(y))
22              ;
23          System.out.println(x);
24          System.out.println(y);
25      }
26
27      void report2(Object x, Object y) {
28          if (!x.equals(y))
29              ;
30
31          System.out.println(x);
32          System.out.println(y);
33      }
34
35      void report3(Object x, Object y) {
36          if (!x.equals(y))
37              ;
38
39          System.out.println(x);
40          System.out.println(y);
41      }
42
43      void report4(Object[] x, Object y) {
44          for (Object o : x) {
45              if (o.equals(y)) {
46              }
47          }
48      }
49  }