1 public class Simple {
 2     public static void main(String args[]) throws Exception {
 3         if (args[0].equals("a")) {
 4             foo("222");
 5             System.out.print("OUTPUT = ");
 6             System.out.println(x); // Avoid using + in diagnostic output.
 7         } else if (args[0].equals("b")) {
 8             bar("aaa", "222");
 9             System.out.print("OUTPUT = ");
10             System.out.println(x); // Avoid using + in diagnostic output.
11         } else if (args[0].equals("c")) {
12             baz("aaa", 333);
13             System.out.print("OUTPUT = ");
14             System.out.println(x); // Avoid using + in diagnostic output.
15         } else if (args[0].equals("loopa")) {
16             loopa();
17             loopa();
18             System.out.print("OUTPUT = ");
19             System.out.println(x); // Avoid using + in diagnostic output.
20         }
21 
22         if (args.length > 1 && args[1].equals("load-extra-class")) {
23             // Work around "There is no class to be included in the dynamic archive." problem, where the
24             // dynamic archive is not generated.
25             DummyClass.doit();
26         }
27     }
28 
29     static void loopa() {
30         for (int i = 0; i < 100000; i++) {
31             foo("L");
32         }
33     }
34 
35     static String x;
36     static void foo(String b) {
37         x = "LIT" + b;
38     }
39     static void bar(String a, String b) {
40         x = a + b;
41     }
42     static void baz(String a, int b) {
43         x = a + b;
44     }
45 
46     static class DummyClass {
47         static void doit() {}
48     }
49 }