MCPcopy Create free account
hub / github.com/LFYSec/MScan / Switch

Class Switch

src/test/resources/world/Switch.java:1–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1public class Switch {
2
3 public static void main(String[] args) {
4 new Switch().switchStmt(0);
5 }
6
7 int switchStmt(int x) {
8 switch (x) {
9 case 1:
10 int y = 5 + x;
11 return y;
12 case 10:
13 foo(10);
14 return 500;
15 case 100:
16 foo(x);
17 return 1000;
18 default:
19 bar(1, null);
20 }
21 x = x * 2;
22 switch (x) {
23 case 1:
24 int y = 5 + x;
25 return y;
26 case 2:
27 foo(10);
28 return 500;
29 case 5:
30 foo(x);
31 return 1000;
32 default:
33 bar(1, null);
34 }
35 return 0;
36 }
37
38 static void bar(int x, Object o) {
39 }
40
41 int foo(int x) {
42 return 20;
43 }
44
45 int foo(int x, int y, int z) {
46 return 30;
47 }
48}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected