private JCBlock makeTwrFinallyClause(Symbol primaryException, JCExpression resource) {
        // primaryException.addSuppressed(catchException);
        VarSymbol catchException =
            new VarSymbol(0, make.paramName(2),
                          syms.throwableType,
                          currentMethodSym);
        JCStatement addSuppressionStatement =
            make.Exec(makeCall(make.Ident(primaryException),
                               names.addSuppressed,
                               List.<JCExpression>of(make.Ident(catchException))));

        // try { resource.close(); } catch (e) { primaryException.addSuppressed(e); }
        JCBlock tryBlock =
            make.Block(0L, List.<JCStatement>of(makeResourceCloseInvocation(resource)));
        JCVariableDecl catchExceptionDecl = make.VarDef(catchException, null);
        JCBlock catchBlock = make.Block(0L, List.<JCStatement>of(addSuppressionStatement));
        List<JCCatch> catchClauses = List.<JCCatch>of(make.Catch(catchExceptionDecl, catchBlock));
        JCTry tryTree = make.Try(tryBlock, catchClauses, null);

        // if (primaryException != null) {try...} else resourceClose;
        JCIf closeIfStatement = make.If(makeNonNullCheck(make.Ident(primaryException)),
                                        tryTree,
                                        makeResourceCloseInvocation(resource));

        // if (#resource != null) { if (primaryException ...  }
        return make.Block(0L,
                          List.<JCStatement>of(make.If(makeNonNullCheck(resource),
                                                       closeIfStatement,
                                                       null)));
    }