langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java
changeset 9300 c2de4dd9853b
parent 8849 4189ac38ddc9
child 9303 eae35c201e19
equal deleted inserted replaced
9085:7c9ef56ec288 9300:c2de4dd9853b
   379      */
   379      */
   380     void letInit(DiagnosticPosition pos, VarSymbol sym) {
   380     void letInit(DiagnosticPosition pos, VarSymbol sym) {
   381         if (sym.adr >= firstadr && trackable(sym)) {
   381         if (sym.adr >= firstadr && trackable(sym)) {
   382             if ((sym.flags() & FINAL) != 0) {
   382             if ((sym.flags() & FINAL) != 0) {
   383                 if ((sym.flags() & PARAMETER) != 0) {
   383                 if ((sym.flags() & PARAMETER) != 0) {
   384                     if ((sym.flags() & DISJUNCTION) != 0) { //multi-catch parameter
   384                     if ((sym.flags() & UNION) != 0) { //multi-catch parameter
   385                         log.error(pos, "multicatch.parameter.may.not.be.assigned",
   385                         log.error(pos, "multicatch.parameter.may.not.be.assigned",
   386                                   sym);
   386                                   sym);
   387                     }
   387                     }
   388                     else {
   388                     else {
   389                         log.error(pos, "final.parameter.may.not.be.assigned",
   389                         log.error(pos, "final.parameter.may.not.be.assigned",
  1001         List<Type> caughtPrev = caught;
  1001         List<Type> caughtPrev = caught;
  1002         List<Type> thrownPrev = thrown;
  1002         List<Type> thrownPrev = thrown;
  1003         thrown = List.nil();
  1003         thrown = List.nil();
  1004         for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
  1004         for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
  1005             List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ?
  1005             List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ?
  1006                     ((JCTypeDisjunction)l.head.param.vartype).alternatives :
  1006                     ((JCTypeUnion)l.head.param.vartype).alternatives :
  1007                     List.of(l.head.param.vartype);
  1007                     List.of(l.head.param.vartype);
  1008             for (JCExpression ct : subClauses) {
  1008             for (JCExpression ct : subClauses) {
  1009                 caught = chk.incl(ct.type, caught);
  1009                 caught = chk.incl(ct.type, caught);
  1010             }
  1010             }
  1011         }
  1011         }
  1073         List<Type> caughtInTry = List.nil();
  1073         List<Type> caughtInTry = List.nil();
  1074         for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
  1074         for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
  1075             alive = true;
  1075             alive = true;
  1076             JCVariableDecl param = l.head.param;
  1076             JCVariableDecl param = l.head.param;
  1077             List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ?
  1077             List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ?
  1078                     ((JCTypeDisjunction)l.head.param.vartype).alternatives :
  1078                     ((JCTypeUnion)l.head.param.vartype).alternatives :
  1079                     List.of(l.head.param.vartype);
  1079                     List.of(l.head.param.vartype);
  1080             List<Type> ctypes = List.nil();
  1080             List<Type> ctypes = List.nil();
  1081             List<Type> rethrownTypes = chk.diff(thrownInTry, caughtInTry);
  1081             List<Type> rethrownTypes = chk.diff(thrownInTry, caughtInTry);
  1082             for (JCExpression ct : subClauses) {
  1082             for (JCExpression ct : subClauses) {
  1083                 Type exc = ct.type;
  1083                 Type exc = ct.type;