langtools/test/tools/javac/T8013394/CompileErrorWithIteratorTest.java
changeset 36778 e04318f39f92
parent 36526 3b41f1c69604
equal deleted inserted replaced
36777:28d33fb9097f 36778:e04318f39f92
    25  * @test
    25  * @test
    26  * @bug 8013394
    26  * @bug 8013394
    27  * @summary compile of iterator use fails with error "defined in an inaccessible class or interface"
    27  * @summary compile of iterator use fails with error "defined in an inaccessible class or interface"
    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  * @build toolbox.ToolBox toolbox.JavacTask
    33  * @build ToolBox
       
    34  * @run main CompileErrorWithIteratorTest
    32  * @run main CompileErrorWithIteratorTest
    35  */
    33  */
       
    34 
       
    35 import toolbox.JavacTask;
       
    36 import toolbox.ToolBox;
    36 
    37 
    37 public class CompileErrorWithIteratorTest {
    38 public class CompileErrorWithIteratorTest {
    38 
    39 
    39     private static final String TestCollectionSrc =
    40     private static final String TestCollectionSrc =
    40         "package pkg;\n" +
    41         "package pkg;\n" +
    78     void run() throws Exception {
    79     void run() throws Exception {
    79         compile();
    80         compile();
    80     }
    81     }
    81 
    82 
    82     void compile() throws Exception {
    83     void compile() throws Exception {
    83         tb.new JavacTask()
    84         new JavacTask(tb)
    84                 .sources(TestCollectionSrc, TestSrc)
    85                 .sources(TestCollectionSrc, TestSrc)
    85                 .run();
    86                 .run();
    86     }
    87     }
    87 
    88 
    88 }
    89 }