Program: 72091
Project: 72091
Buggy source:
Symbol mostSpecific(List<Type> argtypes,Symbol m1,Symbol m2,Env<AttrContext> env,final Type site,boolean allowBoxing,boolean useVarargs){
switch (m2.kind) {
case MTH:
    if (m1 == m2)     return m1;
  boolean m1SignatureMoreSpecific=signatureMoreSpecific(argtypes,env,site,m1,m2,allowBoxing,useVarargs);
boolean m2SignatureMoreSpecific=signatureMoreSpecific(argtypes,env,site,m2,m1,allowBoxing,useVarargs);
if (m1SignatureMoreSpecific && m2SignatureMoreSpecific) {
Type mt1=types.memberType(site,m1);
Type mt2=types.memberType(site,m2);
if (!types.overrideEquivalent(mt1,mt2)) return ambiguityError(m1,m2);
if ((m1.flags() & BRIDGE) != (m2.flags() & BRIDGE)) return ((m1.flags() & BRIDGE) != 0) ? m2 : m1;
TypeSymbol m1Owner=(TypeSymbol)m1.owner;
TypeSymbol m2Owner=(TypeSymbol)m2.owner;
if (types.asSuper(m1Owner.type,m2Owner) != null && ((m1.owner.flags_field & INTERFACE) == 0 || (m2.owner.flags_field & INTERFACE) != 0) && m1.overrides(m2,m1Owner,types,false)) return m1;
if (types.asSuper(m2Owner.type,m1Owner) != null && ((m2.owner.flags_field & INTERFACE) == 0 || (m1.owner.flags_field & INTERFACE) != 0) && m2.overrides(m1,m2Owner,types,false)) return m2;
boolean m1Abstract=(m1.flags() & ABSTRACT) != 0;
boolean m2Abstract=(m2.flags() & ABSTRACT) != 0;
if (m1Abstract && !m2Abstract) return m2;
if (m2Abstract && !m1Abstract) return m1;
if (!m1Abstract && !m2Abstract) return ambiguityError(m1,m2);
if (!types.isSameTypes(m1.erasure(types).getParameterTypes(),m2.erasure(types).getParameterTypes())) return ambiguityError(m1,m2);
Type mst=mostSpecificReturnType(mt1,mt2);
if (mst == null) {
  return ambiguityError(m1,m2);
}
Symbol mostSpecific=mst == mt1 ? m1 : m2;
List<Type> allThrown=chk.intersect(mt1.getThrownTypes(),mt2.getThrownTypes());
Type newSig=types.createMethodTypeWithThrown(mostSpecific.type,allThrown);
MethodSymbol result=new MethodSymbol(mostSpecific.flags(),mostSpecific.name,newSig,mostSpecific.owner){
  @Override public MethodSymbol implementation(  TypeSymbol origin,  Types types,  boolean checkResult){
    if (origin == site.tsym)     return this;
 else     return super.implementation(origin,types,checkResult);
  }
}
;
return result;
}
if (m1SignatureMoreSpecific) return m1;
if (m2SignatureMoreSpecific) return m2;
return ambiguityError(m1,m2);
case AMBIGUOUS:
AmbiguityError e=(AmbiguityError)m2;
Symbol err1=mostSpecific(argtypes,m1,e.sym,env,site,allowBoxing,useVarargs);
Symbol err2=mostSpecific(argtypes,m1,e.sym2,env,site,allowBoxing,useVarargs);
if (err1 == err2) return err1;
if (err1 == e.sym && err2 == e.sym2) return m2;
if (err1 instanceof AmbiguityError && err2 instanceof AmbiguityError && ((AmbiguityError)err1).sym == ((AmbiguityError)err2).sym) return ambiguityError(m1,m2);
 else return ambiguityError(err1,err2);
default :
throw new AssertionError();
}
}

Fixed version (ground truth):
Symbol mostSpecific(List<Type> argtypes,Symbol m1,Symbol m2,Env<AttrContext> env,final Type site,boolean allowBoxing,boolean useVarargs){
switch (m2.kind) {
case MTH:
    if (m1 == m2)     return m1;
  boolean m1SignatureMoreSpecific=signatureMoreSpecific(argtypes,env,site,m1,m2,allowBoxing,useVarargs);
boolean m2SignatureMoreSpecific=signatureMoreSpecific(argtypes,env,site,m2,m1,allowBoxing,useVarargs);
if (m1SignatureMoreSpecific && m2SignatureMoreSpecific) {
Type mt1=types.memberType(site,m1);
Type mt2=types.memberType(site,m2);
if (!types.overrideEquivalent(mt1,mt2)) return ambiguityError(m1,m2);
if ((m1.flags() & BRIDGE) != (m2.flags() & BRIDGE)) return ((m1.flags() & BRIDGE) != 0) ? m2 : m1;
TypeSymbol m1Owner=(TypeSymbol)m1.owner;
TypeSymbol m2Owner=(TypeSymbol)m2.owner;
if (types.asSuper(m1Owner.type,m2Owner) != null && ((m1.owner.flags_field & INTERFACE) == 0 || (m2.owner.flags_field & INTERFACE) != 0) && m1.overrides(m2,m1Owner,types,false)) return m1;
if (types.asSuper(m2Owner.type,m1Owner) != null && ((m2.owner.flags_field & INTERFACE) == 0 || (m1.owner.flags_field & INTERFACE) != 0) && m2.overrides(m1,m2Owner,types,false)) return m2;
boolean m1Abstract=(m1.flags() & ABSTRACT) != 0;
boolean m2Abstract=(m2.flags() & ABSTRACT) != 0;
if (m1Abstract && !m2Abstract) return m2;
if (m2Abstract && !m1Abstract) return m1;
return ambiguityError(m1,m2);
}
if (m1SignatureMoreSpecific) return m1;
if (m2SignatureMoreSpecific) return m2;
return ambiguityError(m1,m2);
case AMBIGUOUS:
AmbiguityError e=(AmbiguityError)m2;
for (Symbol s : e.ambiguousSyms) {
if (mostSpecific(argtypes,m1,s,env,site,allowBoxing,useVarargs) != m1) {
return e.addAmbiguousSymbol(m1);
}
}
return m1;
default :
throw new AssertionError();
}
}