Java源码示例:com.sun.tools.javac.util.Log.DeferredDiagnosticHandler

示例1
<Z> JCTree attribSpeculative(JCTree tree, Env<AttrContext> env, ResultInfo resultInfo, TreeCopier<Z> deferredCopier,
                             Function<JCTree, DeferredDiagnosticHandler> diagHandlerCreator,
                             LocalCacheContext localCache) {
    final JCTree newTree = deferredCopier.copy(tree);
    Env<AttrContext> speculativeEnv = env.dup(newTree, env.info.dup(env.info.scope.dupUnshared(env.info.scope.owner)));
    speculativeEnv.info.isSpeculative = true;
    Log.DeferredDiagnosticHandler deferredDiagnosticHandler = diagHandlerCreator.apply(newTree);
    try {
        attr.attribTree(newTree, speculativeEnv, resultInfo);
        return newTree;
    } finally {
        new UnenterScanner(env.toplevel.modle).scan(newTree);
        log.popDiagnosticHandler(deferredDiagnosticHandler);
        if (localCache != null) {
            localCache.leave();
        }
    }
}
 
示例2
<Z> JCTree attribSpeculative(JCTree tree, Env<AttrContext> env, ResultInfo resultInfo, TreeCopier<Z> deferredCopier,
                             Function<JCTree, DeferredDiagnosticHandler> diagHandlerCreator,
                             LocalCacheContext localCache) {
    final JCTree newTree = deferredCopier.copy(tree);
    Env<AttrContext> speculativeEnv = env.dup(newTree, env.info.dup(env.info.scope.dupUnshared(env.info.scope.owner)));
    speculativeEnv.info.isSpeculative = true;
    Log.DeferredDiagnosticHandler deferredDiagnosticHandler = diagHandlerCreator.apply(newTree);
    try {
        attr.attribTree(newTree, speculativeEnv, resultInfo);
        return newTree;
    } finally {
        new UnenterScanner(env.toplevel.modle).scan(newTree);
        log.popDiagnosticHandler(deferredDiagnosticHandler);
        if (localCache != null) {
            localCache.leave();
        }
    }
}