langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java
Print this page
@@ -1507,21 +1507,21 @@
stats.add(outerTry);
return make.Block(0L, stats.toList());
}
private JCBlock makeArmFinallyClause(Symbol primaryException, JCExpression resource) {
- // primaryException.addSuppressedException(catchException);
+ // primaryException.addSuppressed(catchException);
VarSymbol catchException =
new VarSymbol(0, make.paramName(2),
syms.throwableType,
currentMethodSym);
JCStatement addSuppressionStatement =
make.Exec(makeCall(make.Ident(primaryException),
- names.fromString("addSuppressedException"),
+ names.fromString("addSuppressed"),
List.<JCExpression>of(make.Ident(catchException))));
- // try { resource.close(); } catch (e) { primaryException.addSuppressedException(e); }
+ // 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));