src/share/classes/com/sun/tools/javac/comp/Flow.java
Print this page
*** 379,389 ****
*/
void letInit(DiagnosticPosition pos, VarSymbol sym) {
if (sym.adr >= firstadr && trackable(sym)) {
if ((sym.flags() & FINAL) != 0) {
if ((sym.flags() & PARAMETER) != 0) {
! if ((sym.flags() & DISJUNCTION) != 0) { //multi-catch parameter
log.error(pos, "multicatch.parameter.may.not.be.assigned",
sym);
}
else {
log.error(pos, "final.parameter.may.not.be.assigned",
--- 379,389 ----
*/
void letInit(DiagnosticPosition pos, VarSymbol sym) {
if (sym.adr >= firstadr && trackable(sym)) {
if ((sym.flags() & FINAL) != 0) {
if ((sym.flags() & PARAMETER) != 0) {
! if ((sym.flags() & UNION) != 0) { //multi-catch parameter
log.error(pos, "multicatch.parameter.may.not.be.assigned",
sym);
}
else {
log.error(pos, "final.parameter.may.not.be.assigned",
*** 1001,1011 ****
List<Type> caughtPrev = caught;
List<Type> thrownPrev = thrown;
thrown = List.nil();
for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ?
! ((JCTypeDisjunction)l.head.param.vartype).alternatives :
List.of(l.head.param.vartype);
for (JCExpression ct : subClauses) {
caught = chk.incl(ct.type, caught);
}
}
--- 1001,1011 ----
List<Type> caughtPrev = caught;
List<Type> thrownPrev = thrown;
thrown = List.nil();
for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ?
! ((JCTypeUnion)l.head.param.vartype).alternatives :
List.of(l.head.param.vartype);
for (JCExpression ct : subClauses) {
caught = chk.incl(ct.type, caught);
}
}
*** 1073,1083 ****
List<Type> caughtInTry = List.nil();
for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
alive = true;
JCVariableDecl param = l.head.param;
List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ?
! ((JCTypeDisjunction)l.head.param.vartype).alternatives :
List.of(l.head.param.vartype);
List<Type> ctypes = List.nil();
List<Type> rethrownTypes = chk.diff(thrownInTry, caughtInTry);
for (JCExpression ct : subClauses) {
Type exc = ct.type;
--- 1073,1083 ----
List<Type> caughtInTry = List.nil();
for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
alive = true;
JCVariableDecl param = l.head.param;
List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ?
! ((JCTypeUnion)l.head.param.vartype).alternatives :
List.of(l.head.param.vartype);
List<Type> ctypes = List.nil();
List<Type> rethrownTypes = chk.diff(thrownInTry, caughtInTry);
for (JCExpression ct : subClauses) {
Type exc = ct.type;