langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java
changeset 7074 0183c3f9614e
parent 6594 d43f068fba19
child 7203 1153590927f7
equal deleted inserted replaced
7073:c27644ae5855 7074:0183c3f9614e
   369      */
   369      */
   370     void letInit(DiagnosticPosition pos, VarSymbol sym) {
   370     void letInit(DiagnosticPosition pos, VarSymbol sym) {
   371         if (sym.adr >= firstadr && trackable(sym)) {
   371         if (sym.adr >= firstadr && trackable(sym)) {
   372             if ((sym.flags() & FINAL) != 0) {
   372             if ((sym.flags() & FINAL) != 0) {
   373                 if ((sym.flags() & PARAMETER) != 0) {
   373                 if ((sym.flags() & PARAMETER) != 0) {
   374                     if ((sym.flags() & DISJOINT) != 0) { //multi-catch parameter
   374                     if ((sym.flags() & DISJUNCTION) != 0) { //multi-catch parameter
   375                         log.error(pos, "multicatch.parameter.may.not.be.assigned",
   375                         log.error(pos, "multicatch.parameter.may.not.be.assigned",
   376                                   sym);
   376                                   sym);
   377                     }
   377                     }
   378                     else {
   378                     else {
   379                         log.error(pos, "final.parameter.may.not.be.assigned",
   379                         log.error(pos, "final.parameter.may.not.be.assigned",
   981         List<Type> thrownPrev = thrown;
   981         List<Type> thrownPrev = thrown;
   982         Map<VarSymbol, JCVariableDecl> unrefdResourcesPrev = unrefdResources;
   982         Map<VarSymbol, JCVariableDecl> unrefdResourcesPrev = unrefdResources;
   983         thrown = List.nil();
   983         thrown = List.nil();
   984         for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
   984         for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
   985             List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ?
   985             List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ?
   986                     ((JCTypeDisjoint)l.head.param.vartype).components :
   986                     ((JCTypeDisjunction)l.head.param.vartype).alternatives :
   987                     List.of(l.head.param.vartype);
   987                     List.of(l.head.param.vartype);
   988             for (JCExpression ct : subClauses) {
   988             for (JCExpression ct : subClauses) {
   989                 caught = chk.incl(ct.type, caught);
   989                 caught = chk.incl(ct.type, caught);
   990             }
   990             }
   991         }
   991         }
  1047         List<Type> caughtInTry = List.nil();
  1047         List<Type> caughtInTry = List.nil();
  1048         for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
  1048         for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
  1049             alive = true;
  1049             alive = true;
  1050             JCVariableDecl param = l.head.param;
  1050             JCVariableDecl param = l.head.param;
  1051             List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ?
  1051             List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ?
  1052                     ((JCTypeDisjoint)l.head.param.vartype).components :
  1052                     ((JCTypeDisjunction)l.head.param.vartype).alternatives :
  1053                     List.of(l.head.param.vartype);
  1053                     List.of(l.head.param.vartype);
  1054             List<Type> ctypes = List.nil();
  1054             List<Type> ctypes = List.nil();
  1055             List<Type> rethrownTypes = chk.diff(thrownInTry, caughtInTry);
  1055             List<Type> rethrownTypes = chk.diff(thrownInTry, caughtInTry);
  1056             for (JCExpression ct : subClauses) {
  1056             for (JCExpression ct : subClauses) {
  1057                 Type exc = ct.type;
  1057                 Type exc = ct.type;