langtools/test/tools/javac/T8024437/ExceptionInferenceFromClassFileTest.java
changeset 36778 e04318f39f92
parent 36526 3b41f1c69604
equal deleted inserted replaced
36777:28d33fb9097f 36778:e04318f39f92
     1 /*
     1 /*
     2  * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    25  * @test
    25  * @test
    26  * @bug 8024437
    26  * @bug 8024437
    27  * @summary Inferring the exception thrown by a lambda: sometimes fails to compile
    27  * @summary Inferring the exception thrown by a lambda: sometimes fails to compile
    28  * @library /tools/lib
    28  * @library /tools/lib
    29  * @modules jdk.compiler/com.sun.tools.javac.api
    29  * @modules jdk.compiler/com.sun.tools.javac.api
    30  *          jdk.compiler/com.sun.tools.javac.file
       
    31  *          jdk.compiler/com.sun.tools.javac.main
    30  *          jdk.compiler/com.sun.tools.javac.main
    32  *          jdk.jdeps/com.sun.tools.javap
    31  *          jdk.jdeps/com.sun.tools.javap
    33  * @build ToolBox
    32  * @build toolbox.ToolBox toolbox.JavacTask
    34  * @run main ExceptionInferenceFromClassFileTest
    33  * @run main ExceptionInferenceFromClassFileTest
    35  */
    34  */
    36 
    35 
    37 import java.nio.file.Files;
    36 import java.nio.file.Files;
    38 import java.nio.file.Paths;
    37 import java.nio.file.Paths;
       
    38 
       
    39 import toolbox.JavacTask;
       
    40 import toolbox.ToolBox;
    39 
    41 
    40 public class ExceptionInferenceFromClassFileTest {
    42 public class ExceptionInferenceFromClassFileTest {
    41 
    43 
    42     static final String ABSrc =
    44     static final String ABSrc =
    43             "class B {\n" +
    45             "class B {\n" +
    59 
    61 
    60     public static void main(String[] args) throws Exception {
    62     public static void main(String[] args) throws Exception {
    61         ToolBox tb = new ToolBox();
    63         ToolBox tb = new ToolBox();
    62         tb.createDirectories("out");
    64         tb.createDirectories("out");
    63 
    65 
    64         tb.new JavacTask()
    66         new JavacTask(tb)
    65                 .outdir("out")
    67                 .outdir("out")
    66                 .sources(ABSrc)
    68                 .sources(ABSrc)
    67                 .run();
    69                 .run();
    68 
    70 
    69         tb.new JavacTask()
    71         new JavacTask(tb)
    70                 .outdir("out")
    72                 .outdir("out")
    71                 .classpath("out")
    73                 .classpath("out")
    72                 .sources(CSrc)
    74                 .sources(CSrc)
    73                 .run();
    75                 .run();
    74     }
    76     }