test/langtools/tools/javac/api/ast/ASTBuilder.java
branchjlahoda-tree-builder
changeset 57297 ad0be596956b
parent 57296 464cc8d22d94
child 57298 72d5f7163f12
equal deleted inserted replaced
57296:464cc8d22d94 57297:ad0be596956b
    68                 "}",
    68                 "}",
    69                 U -> U._class("Test", C -> C.field("x", Type::_int)));
    69                 U -> U._class("Test", C -> C.field("x", Type::_int)));
    70         runTest("class Test extends Exception implements java.util.List<Map<String, String>>, CharSequence {" +
    70         runTest("class Test extends Exception implements java.util.List<Map<String, String>>, CharSequence {" +
    71                 "    int x1 = 2;" +
    71                 "    int x1 = 2;" +
    72                 "    int x2 = 2 + x1;" +
    72                 "    int x2 = 2 + x1;" +
       
    73                 "    int test(int param) {" +
       
    74                 "        if (param == 0) return 0;" +
       
    75                 "        else return 1;" +
       
    76                 "    }" +
       
    77                 "    int test2(int param) {" +
       
    78                 "        if (param == 0) return 0;" +
       
    79                 "        return 1;" +
       
    80                 "    }" +
    73                 "}");
    81                 "}");
    74     }
    82     }
    75 
    83 
    76     private static void runTest(String expectedCode, Consumer<CompilationUnit> actualBuilder) throws Exception {
    84     private static void runTest(String expectedCode, Consumer<CompilationUnit> actualBuilder) throws Exception {
    77         final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
    85         final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();