< prev index next >

test/langtools/tools/javap/4870651/T4870651.java

Print this page

29  * @modules jdk.jdeps/com.sun.tools.javap
30  * @build T4870651 Test
31  * @run main T4870651
32  */
33 
34 import java.io.*;
35 
36 public class T4870651 {
37     public static void main(String[] args) throws Exception {
38         new T4870651().run();
39     }
40 
41     public void run() throws IOException {
42         verify("Test",
43                "class Test<T extends java.lang.Object, " +
44                    "E extends java.lang.Exception & java.lang.Comparable<T>, " +
45                    "U extends java.lang.Comparable>",
46                "v1(java.lang.String...)");
47 
48         verify("Test$Enum",
49                "flags: (0x4030) ACC_FINAL, ACC_SUPER, ACC_ENUM",
50                "flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM");
51 
52         if (errors > 0)
53             throw new Error(errors + " found.");
54     }
55 
56     String javap(String className) {
57         String testClasses = System.getProperty("test.classes", ".");
58         StringWriter sw = new StringWriter();
59         PrintWriter out = new PrintWriter(sw);
60         String[] args = { "-classpath", testClasses, "-v", className };
61         int rc = com.sun.tools.javap.Main.run(args, out);
62         if (rc != 0)
63             throw new Error("javap failed. rc=" + rc);
64         out.close();
65         String output = sw.toString();
66         System.out.println("class " + className);
67         System.out.println(output);
68         return output;
69     }

29  * @modules jdk.jdeps/com.sun.tools.javap
30  * @build T4870651 Test
31  * @run main T4870651
32  */
33 
34 import java.io.*;
35 
36 public class T4870651 {
37     public static void main(String[] args) throws Exception {
38         new T4870651().run();
39     }
40 
41     public void run() throws IOException {
42         verify("Test",
43                "class Test<T extends java.lang.Object, " +
44                    "E extends java.lang.Exception & java.lang.Comparable<T>, " +
45                    "U extends java.lang.Comparable>",
46                "v1(java.lang.String...)");
47 
48         verify("Test$Enum",
49                "flags: (0x4030) ACC_FINAL, ACC_IDENTITY, ACC_ENUM",
50                "flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM");
51 
52         if (errors > 0)
53             throw new Error(errors + " found.");
54     }
55 
56     String javap(String className) {
57         String testClasses = System.getProperty("test.classes", ".");
58         StringWriter sw = new StringWriter();
59         PrintWriter out = new PrintWriter(sw);
60         String[] args = { "-classpath", testClasses, "-v", className };
61         int rc = com.sun.tools.javap.Main.run(args, out);
62         if (rc != 0)
63             throw new Error("javap failed. rc=" + rc);
64         out.close();
65         String output = sw.toString();
66         System.out.println("class " + className);
67         System.out.println(output);
68         return output;
69     }
< prev index next >