<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();
}
}
}
<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();
}
}
}