diff -r d685b12b62a4 -r 9f11c7676cd5 src/share/classes/com/sun/tools/javac/comp/Flow.java --- a/src/share/classes/com/sun/tools/javac/comp/Flow.java Wed May 29 15:34:56 2013 -0700 +++ b/src/share/classes/com/sun/tools/javac/comp/Flow.java Fri May 31 10:04:59 2013 +0100 @@ -808,9 +808,10 @@ */ void markThrown(JCTree tree, Type exc) { if (!chk.isUnchecked(tree.pos(), exc)) { - if (!chk.isHandled(exc, caught)) + if (!chk.isHandled(exc, caught)) { pendingExits.append(new FlowPendingExit(tree, exc)); - thrown = chk.incl(exc, thrown); + } + thrown = chk.incl(exc, thrown); } } @@ -1066,8 +1067,9 @@ names.close, List.nil(), List.nil()); + Type mt = types.memberType(resource.type, closeMethod); if (closeMethod.kind == MTH) { - for (Type t : ((MethodSymbol)closeMethod).getThrownTypes()) { + for (Type t : mt.getThrownTypes()) { markThrown(resource, t); } }