langtools/test/tools/javac/api/7086261/T7086261.java
changeset 27319 030080f03e4f
parent 13631 dc1212c348f9
child 30730 d3ce7619db2c
equal deleted inserted replaced
27318:4660a5da7d90 27319:030080f03e4f
     1 /*
     1 /*
     2  * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2011, 2014, 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.
    64         }
    64         }
    65     };
    65     };
    66 
    66 
    67     void test() throws Throwable {
    67     void test() throws Throwable {
    68         JavaCompiler javac = ToolProvider.getSystemJavaCompiler();
    68         JavaCompiler javac = ToolProvider.getSystemJavaCompiler();
    69         JavaFileManager jfm = javac.getStandardFileManager(null, null, null);
    69         try (JavaFileManager jfm = javac.getStandardFileManager(null, null, null)) {
    70         JavaCompiler.CompilationTask task =
    70             JavaCompiler.CompilationTask task =
    71                 javac.getTask(null, jfm, new DiagnosticChecker(), null, null, Arrays.asList(new ErroneousSource()));
    71                     javac.getTask(null, jfm, new DiagnosticChecker(), null, null, Arrays.asList(new ErroneousSource()));
    72         task.call();
    72             task.call();
       
    73         }
    73     }
    74     }
    74 
    75 
    75     public static void main(String[] args) throws Throwable {
    76     public static void main(String[] args) throws Throwable {
    76         new T7086261().test();
    77         new T7086261().test();
    77     }
    78     }