1134 |
1134 |
1135 public void visitNewClass(JCNewClass tree) { |
1135 public void visitNewClass(JCNewClass tree) { |
1136 scanExpr(tree.encl); |
1136 scanExpr(tree.encl); |
1137 scanExprs(tree.args); |
1137 scanExprs(tree.args); |
1138 // scan(tree.def); |
1138 // scan(tree.def); |
1139 for (List<Type> l = tree.constructor.type.getThrownTypes(); |
1139 for (List<Type> l = tree.constructorType.getThrownTypes(); |
1140 l.nonEmpty(); |
1140 l.nonEmpty(); |
1141 l = l.tail) |
1141 l = l.tail) { |
1142 markThrown(tree, l.head); |
1142 markThrown(tree, l.head); |
1143 scan(tree.def); |
1143 } |
|
1144 List<Type> caughtPrev = caught; |
|
1145 try { |
|
1146 // If the new class expression defines an anonymous class, |
|
1147 // analysis of the anonymous constructor may encounter thrown |
|
1148 // types which are unsubstituted type variables. |
|
1149 // However, since the constructor's actual thrown types have |
|
1150 // already been marked as thrown, it is safe to simply include |
|
1151 // each of the constructor's formal thrown types in the set of |
|
1152 // 'caught/declared to be thrown' types, for the duration of |
|
1153 // the class def analysis. |
|
1154 if (tree.def != null) |
|
1155 for (List<Type> l = tree.constructor.type.getThrownTypes(); |
|
1156 l.nonEmpty(); |
|
1157 l = l.tail) { |
|
1158 caught = chk.incl(l.head, caught); |
|
1159 } |
|
1160 scan(tree.def); |
|
1161 } |
|
1162 finally { |
|
1163 caught = caughtPrev; |
|
1164 } |
1144 } |
1165 } |
1145 |
1166 |
1146 public void visitNewArray(JCNewArray tree) { |
1167 public void visitNewArray(JCNewArray tree) { |
1147 scanExprs(tree.dims); |
1168 scanExprs(tree.dims); |
1148 scanExprs(tree.elems); |
1169 scanExprs(tree.elems); |