src/share/classes/com/sun/tools/javac/comp/Flow.java

changeset 1790
9f11c7676cd5
parent 1713
2ca9e7d50136
child 1802
8fb68f73d4b1
equal deleted inserted replaced
1786:d685b12b62a4 1790:9f11c7676cd5
806 /** Record that exception is potentially thrown and check that it 806 /** Record that exception is potentially thrown and check that it
807 * is caught. 807 * is caught.
808 */ 808 */
809 void markThrown(JCTree tree, Type exc) { 809 void markThrown(JCTree tree, Type exc) {
810 if (!chk.isUnchecked(tree.pos(), exc)) { 810 if (!chk.isUnchecked(tree.pos(), exc)) {
811 if (!chk.isHandled(exc, caught)) 811 if (!chk.isHandled(exc, caught)) {
812 pendingExits.append(new FlowPendingExit(tree, exc)); 812 pendingExits.append(new FlowPendingExit(tree, exc));
813 thrown = chk.incl(exc, thrown); 813 }
814 thrown = chk.incl(exc, thrown);
814 } 815 }
815 } 816 }
816 817
817 /************************************************************************* 818 /*************************************************************************
818 * Visitor methods for statements and definitions 819 * Visitor methods for statements and definitions
1064 attrEnv, 1065 attrEnv,
1065 sup, 1066 sup,
1066 names.close, 1067 names.close,
1067 List.<Type>nil(), 1068 List.<Type>nil(),
1068 List.<Type>nil()); 1069 List.<Type>nil());
1070 Type mt = types.memberType(resource.type, closeMethod);
1069 if (closeMethod.kind == MTH) { 1071 if (closeMethod.kind == MTH) {
1070 for (Type t : ((MethodSymbol)closeMethod).getThrownTypes()) { 1072 for (Type t : mt.getThrownTypes()) {
1071 markThrown(resource, t); 1073 markThrown(resource, t);
1072 } 1074 }
1073 } 1075 }
1074 } 1076 }
1075 } 1077 }

mercurial