Program: 185561
Project: 185561
Buggy source:
private MethodNode getCovariantImplementation(final MethodNode oldMethod,final MethodNode overridingMethod,Map genericsSpec){
  if (!oldMethod.getName().equals(overridingMethod.getName()))   return null;
  if ((overridingMethod.getModifiers() & ACC_BRIDGE) != 0)   return null;
  boolean normalEqualParameters=equalParametersNormal(overridingMethod,oldMethod);
  boolean genericEqualParameters=equalParametersWithGenerics(overridingMethod,oldMethod,genericsSpec);
  if (!normalEqualParameters && !genericEqualParameters)   return null;
  ClassNode mr=overridingMethod.getReturnType();
  ClassNode omr=oldMethod.getReturnType();
  boolean equalReturnType=mr.equals(omr);
  if (equalReturnType && normalEqualParameters)   return null;
  ClassNode testmr=correctToGenericsSpec(genericsSpec,omr);
  if (!isAssignable(mr,testmr)) {
    throw new RuntimeParserException("String_Node_Str" + overridingMethod.getTypeDescriptor() + "String_Node_Str"+ overridingMethod.getDeclaringClass().getName()+ "String_Node_Str"+ oldMethod.getTypeDescriptor()+ "String_Node_Str"+ oldMethod.getDeclaringClass().getName(),overridingMethod);
  }
  if ((oldMethod.getModifiers() & ACC_FINAL) != 0) {
    throw new RuntimeParserException("String_Node_Str" + oldMethod.getTypeDescriptor() + "String_Node_Str"+ oldMethod.getDeclaringClass().getName(),overridingMethod);
  }
  if (oldMethod.isStatic() != overridingMethod.isStatic()) {
    throw new RuntimeParserException("String_Node_Str" + oldMethod.getTypeDescriptor() + "String_Node_Str"+ oldMethod.getDeclaringClass().getName()+ "String_Node_Str",overridingMethod);
  }
  if (!equalReturnType) {
    boolean oldM=ClassHelper.isPrimitiveType(oldMethod.getReturnType());
    boolean newM=ClassHelper.isPrimitiveType(overridingMethod.getReturnType());
    if (oldM || newM) {
      String message="String_Node_Str";
      if (oldM && newM) {
        message="String_Node_Str";
      }
 else       if (newM) {
        message="String_Node_Str";
      }
 else       if (oldM) {
        message="String_Node_Str";
      }
      throw new RuntimeParserException("String_Node_Str" + oldMethod.getTypeDescriptor() + "String_Node_Str"+ oldMethod.getDeclaringClass().getName()+ message,overridingMethod);
    }
  }
  MethodNode newMethod=new MethodNode(oldMethod.getName(),overridingMethod.getModifiers() | ACC_SYNTHETIC | ACC_BRIDGE,oldMethod.getReturnType().getPlainNodeReference(),cleanParameters(oldMethod.getParameters()),oldMethod.getExceptions(),null);
  List instructions=new ArrayList(1);
  instructions.add(new BytecodeInstruction(){
    public void visit(    MethodVisitor mv){
      mv.visitVarInsn(ALOAD,0);
      Parameter[] para=oldMethod.getParameters();
      Parameter[] goal=overridingMethod.getParameters();
      int doubleSlotOffset=0;
      for (int i=0; i < para.length; i++) {
        ClassNode type=para[i].getType();
        BytecodeHelper.load(mv,type,i + 1 + doubleSlotOffset);
        if (type.redirect() == ClassHelper.double_TYPE || type.redirect() == ClassHelper.long_TYPE) {
          doubleSlotOffset++;
        }
        if (!type.equals(goal[i].getType())) {
          BytecodeHelper.doCast(mv,goal[i].getType());
        }
      }
      mv.visitMethodInsn(INVOKEVIRTUAL,BytecodeHelper.getClassInternalName(classNode),overridingMethod.getName(),BytecodeHelper.getMethodDescriptor(overridingMethod.getReturnType(),overridingMethod.getParameters()));
      BytecodeHelper.doReturn(mv,oldMethod.getReturnType());
    }
  }
);
  newMethod.setCode(new BytecodeSequence(instructions));
  return newMethod;
}

Fixed version (ground truth):
private MethodNode getCovariantImplementation(final MethodNode oldMethod,final MethodNode overridingMethod,Map genericsSpec){
  if (!oldMethod.getName().equals(overridingMethod.getName()))   return null;
  if ((overridingMethod.getModifiers() & ACC_BRIDGE) != 0)   return null;
  boolean normalEqualParameters=equalParametersNormal(overridingMethod,oldMethod);
  boolean genericEqualParameters=equalParametersWithGenerics(overridingMethod,oldMethod,genericsSpec);
  if (!normalEqualParameters && !genericEqualParameters)   return null;
  ClassNode mr=overridingMethod.getReturnType();
  ClassNode omr=oldMethod.getReturnType();
  boolean equalReturnType=mr.equals(omr);
  if (equalReturnType && normalEqualParameters)   return null;
  ClassNode testmr=correctToGenericsSpec(genericsSpec,omr);
  if (!isAssignable(mr,testmr)) {
    throw new RuntimeParserException("String_Node_Str" + overridingMethod.getTypeDescriptor() + "String_Node_Str"+ overridingMethod.getDeclaringClass().getName()+ "String_Node_Str"+ oldMethod.getTypeDescriptor()+ "String_Node_Str"+ oldMethod.getDeclaringClass().getName(),overridingMethod);
  }
  if ((oldMethod.getModifiers() & ACC_FINAL) != 0) {
    throw new RuntimeParserException("String_Node_Str" + oldMethod.getTypeDescriptor() + "String_Node_Str"+ oldMethod.getDeclaringClass().getName(),overridingMethod);
  }
  if (oldMethod.isStatic() != overridingMethod.isStatic()) {
    throw new RuntimeParserException("String_Node_Str" + oldMethod.getTypeDescriptor() + "String_Node_Str"+ oldMethod.getDeclaringClass().getName()+ "String_Node_Str",overridingMethod);
  }
  if (!equalReturnType) {
    boolean oldM=ClassHelper.isPrimitiveType(oldMethod.getReturnType());
    boolean newM=ClassHelper.isPrimitiveType(overridingMethod.getReturnType());
    if (oldM || newM) {
      String message="String_Node_Str";
      if (oldM && newM) {
        message="String_Node_Str";
      }
 else       if (newM) {
        message="String_Node_Str";
      }
 else       if (oldM) {
        message="String_Node_Str";
      }
      throw new RuntimeParserException("String_Node_Str" + oldMethod.getTypeDescriptor() + "String_Node_Str"+ oldMethod.getDeclaringClass().getName()+ message,overridingMethod);
    }
  }
  MethodNode newMethod=new MethodNode(oldMethod.getName(),overridingMethod.getModifiers() | ACC_SYNTHETIC | ACC_BRIDGE,GenericsUtils.nonGeneric(oldMethod.getReturnType()),cleanParameters(oldMethod.getParameters()),oldMethod.getExceptions(),null);
  List instructions=new ArrayList(1);
  instructions.add(new BytecodeInstruction(){
    public void visit(    MethodVisitor mv){
      mv.visitVarInsn(ALOAD,0);
      Parameter[] para=oldMethod.getParameters();
      Parameter[] goal=overridingMethod.getParameters();
      int doubleSlotOffset=0;
      for (int i=0; i < para.length; i++) {
        ClassNode type=para[i].getType();
        BytecodeHelper.load(mv,type,i + 1 + doubleSlotOffset);
        if (type.redirect() == ClassHelper.double_TYPE || type.redirect() == ClassHelper.long_TYPE) {
          doubleSlotOffset++;
        }
        if (!type.equals(goal[i].getType())) {
          BytecodeHelper.doCast(mv,goal[i].getType());
        }
      }
      mv.visitMethodInsn(INVOKEVIRTUAL,BytecodeHelper.getClassInternalName(classNode),overridingMethod.getName(),BytecodeHelper.getMethodDescriptor(overridingMethod.getReturnType(),overridingMethod.getParameters()));
      BytecodeHelper.doReturn(mv,oldMethod.getReturnType());
    }
  }
);
  newMethod.setCode(new BytecodeSequence(instructions));
  return newMethod;
}