public void visitTry(JCTry tree) {
        // Create a new local environment with a local
        Env<AttrContext> localEnv = env.dup(tree, env.info.dup(env.info.scope.dup()));
        boolean isTryWithResource = tree.resources.nonEmpty();
        // Create a nested environment for attributing the try block if needed
        Env<AttrContext> tryEnv = isTryWithResource ?
            env.dup(tree, localEnv.info.dup(localEnv.info.scope.dup())) :
            localEnv;
        // Attribute resource declarations
        for (JCTree resource : tree.resources) {
            if (resource.getTag() == JCTree.VARDEF) {
                attribStat(resource, tryEnv);
                chk.checkType(resource, resource.type, syms.autoCloseableType, "try.not.applicable.to.type");

                //check that resource type cannot throw InterruptedException
                checkAutoCloseable(resource.pos(), localEnv, resource.type);

                VarSymbol var = (VarSymbol)TreeInfo.symbolFor(resource);
                var.setData(ElementKind.RESOURCE_VARIABLE);
            } else {
                attribExpr(resource, tryEnv, syms.autoCloseableType, "try.not.applicable.to.type");
            }
        }
        // Attribute body
        attribStat(tree.body, tryEnv);
        if (isTryWithResource)
            tryEnv.info.scope.leave();

        // Attribute catch clauses
        for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
            JCCatch c = l.head;
            Env<AttrContext> catchEnv =
                localEnv.dup(c, localEnv.info.dup(localEnv.info.scope.dup()));
            Type ctype = attribStat(c.param, catchEnv);
            if (TreeInfo.isMultiCatch(c)) {
                //multi-catch parameter is implicitly marked as final
                c.param.sym.flags_field |= FINAL | UNION;
            }
            if (c.param.sym.kind == Kinds.VAR) {
                c.param.sym.setData(ElementKind.EXCEPTION_PARAMETER);
            }
            chk.checkType(c.param.vartype.pos(),
                          chk.checkClassType(c.param.vartype.pos(), ctype),
                          syms.throwableType);
            attribStat(c.body, catchEnv);
            catchEnv.info.scope.leave();
        }

        // Attribute finalizer
        if (tree.finalizer != null) attribStat(tree.finalizer, localEnv);

        localEnv.info.scope.leave();
        result = null;
    }