1.1 --- a/src/share/classes/com/sun/tools/javac/comp/Check.java Thu Mar 03 17:32:35 2011 +0000 1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java Thu Mar 03 17:34:58 2011 +0000 1.3 @@ -2114,7 +2114,7 @@ 1.4 if (s1 == s2 || !sym.overrides(s2, site.tsym, types, false)) continue; 1.5 //if (i) the signature of 'sym' is not a subsignature of m1 (seen as 1.6 //a member of 'site') and (ii) m1 has the same erasure as m2, issue an error 1.7 - if (!types.isSubSignature(sym.type, types.memberType(site, s1)) && 1.8 + if (!types.isSubSignature(sym.type, types.memberType(site, s1), false) && 1.9 types.hasSameArgs(s1.erasure(types), s2.erasure(types))) { 1.10 sym.flags_field |= CLASH; 1.11 String key = s2 == sym ? 1.12 @@ -2146,7 +2146,7 @@ 1.13 for (Symbol s : types.membersClosure(site).getElementsByName(sym.name, cf)) { 1.14 //if (i) the signature of 'sym' is not a subsignature of m1 (seen as 1.15 //a member of 'site') and (ii) 'sym' has the same erasure as m1, issue an error 1.16 - if (!types.isSubSignature(sym.type, types.memberType(site, s)) && 1.17 + if (!types.isSubSignature(sym.type, types.memberType(site, s), false) && 1.18 types.hasSameArgs(s.erasure(types), sym.erasure(types))) { 1.19 log.error(pos, 1.20 "name.clash.same.erasure.no.hide", 1.21 @@ -2667,7 +2667,7 @@ 1.22 if ((sym.flags() & VARARGS) != (e.sym.flags() & VARARGS)) { 1.23 varargsDuplicateError(pos, sym, e.sym); 1.24 return true; 1.25 - } else if (sym.kind == MTH && !hasSameSignature(sym.type, e.sym.type)) { 1.26 + } else if (sym.kind == MTH && !types.hasSameArgs(sym.type, e.sym.type, false)) { 1.27 duplicateErasureError(pos, sym, e.sym); 1.28 sym.flags_field |= CLASH; 1.29 return true; 1.30 @@ -2679,15 +2679,6 @@ 1.31 } 1.32 return true; 1.33 } 1.34 - //where 1.35 - boolean hasSameSignature(Type mt1, Type mt2) { 1.36 - if (mt1.tag == FORALL && mt2.tag == FORALL) { 1.37 - ForAll fa1 = (ForAll)mt1; 1.38 - ForAll fa2 = (ForAll)mt2; 1.39 - mt2 = types.subst(fa2, fa2.tvars, fa1.tvars); 1.40 - } 1.41 - return types.hasSameArgs(mt1.asMethodType(), mt2.asMethodType()); 1.42 - } 1.43 1.44 /** Report duplicate declaration error. 1.45 */