com.sun.tools.javac.util.Log.DiscardDiagnosticHandler Java Examples

The following examples show how to use com.sun.tools.javac.util.Log.DiscardDiagnosticHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JavaCompiler.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private Name parseAndGetName(JavaFileObject fo,
                             Function<JCTree.JCCompilationUnit, Name> tree2Name) {
    DiagnosticHandler dh = new DiscardDiagnosticHandler(log);
    try {
        JCTree.JCCompilationUnit t = parse(fo, fo.getCharContent(false));
        return tree2Name.apply(t);
    } catch (IOException e) {
        return null;
    } finally {
        log.popDiagnosticHandler(dh);
    }
}
 
Example #2
Source File: JavaCompiler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private Name parseAndGetName(JavaFileObject fo,
                             Function<JCTree.JCCompilationUnit, Name> tree2Name) {
    DiagnosticHandler dh = new DiscardDiagnosticHandler(log);
    try {
        JCTree.JCCompilationUnit t = parse(fo, fo.getCharContent(false));
        return tree2Name.apply(t);
    } catch (IOException e) {
        return null;
    } finally {
        log.popDiagnosticHandler(dh);
    }
}