Program: 17076
Project: 17076
Buggy source:
public static void fixMethodTypeRef(final JstExpressionBindingResolver resolver,final JstMethod method,final IJstType currentType,GroupInfo groupInfo){
  IJstType rtnType=method.getRtnType();
  IJstType rtnCorrectType=rtnType;
  if (rtnType instanceof JstType && !((JstType)rtnType).getStatus().isValid()) {
    final IJstType potentialOtypeMemberType=rtnType;
    IJstOType resolvedOtype=getOtype(potentialOtypeMemberType.getName());
    if (resolvedOtype == null) {
      resolvedOtype=getOtype(getFullNameIfShortName4InnerType(currentType,potentialOtypeMemberType));
    }
    if (resolvedOtype != null) {
      rtnCorrectType=resolvedOtype;
    }
  }
  rtnCorrectType=getCorrectType(resolver,rtnType,groupInfo);
  if (rtnType instanceof JstAttributedType) {
    final IJstNode rtnBinding=look4ActualBinding(resolver,rtnType,groupInfo);
    if (rtnBinding instanceof IJstOType && rtnBinding != rtnType) {
      rtnCorrectType=(IJstOType)rtnBinding;
    }
  }
  if (rtnCorrectType != rtnType) {
    method.setRtnType(rtnCorrectType);
  }
  List<JstArg> args=method.getArgs();
  if (args != null) {
    for (    JstArg arg : args) {
      for (      IJstType parameterType : arg.getTypes()) {
        IJstType parameterCorrectType=parameterType;
        if (parameterType instanceof JstType && !((JstType)parameterType).getStatus().isValid()) {
          final IJstType potentialOtypeMemberType=parameterType;
          IJstOType resolvedOtype=getOtype(potentialOtypeMemberType.getName());
          if (resolvedOtype == null) {
            resolvedOtype=getOtype(getFullNameIfShortName4InnerType(currentType,potentialOtypeMemberType));
          }
          if (resolvedOtype != null) {
            parameterCorrectType=resolvedOtype;
          }
        }
 else         if (parameterType instanceof JstAttributedType) {
          final IJstNode parameterBinding=look4ActualBinding(resolver,parameterType,groupInfo);
          if (parameterBinding instanceof IJstOType && parameterType != parameterBinding) {
            parameterCorrectType=(IJstOType)parameterBinding;
          }
        }
        parameterCorrectType=getCorrectType(resolver,parameterCorrectType,groupInfo);
        if (parameterCorrectType != parameterType) {
          arg.updateType(parameterType.getName(),parameterCorrectType);
        }
      }
    }
  }
  final List<IJstMethod> overloaded=method.getOverloaded();
  if (overloaded != null && !overloaded.isEmpty()) {
    for (    IJstMethod mtd : overloaded) {
      if (mtd instanceof JstMethod) {
        fixMethodTypeRef(resolver,(JstMethod)mtd,currentType,groupInfo);
      }
    }
  }
  updateMethodSignature(method);
}

Fixed version (ground truth):
public static void fixMethodTypeRef(final JstExpressionBindingResolver resolver,final JstMethod method,final IJstType currentType,GroupInfo groupInfo){
  IJstType rtnType=method.getRtnType();
  IJstType rtnCorrectType=rtnType;
  if (rtnType instanceof JstType && !((JstType)rtnType).getStatus().isValid()) {
    final IJstType potentialOtypeMemberType=rtnType;
    IJstOType resolvedOtype=getOtype(potentialOtypeMemberType.getName());
    if (resolvedOtype == null) {
      resolvedOtype=getOtype(getFullNameIfShortName4InnerType(currentType,potentialOtypeMemberType));
    }
    if (resolvedOtype != null) {
      rtnCorrectType=resolvedOtype;
    }
  }
  rtnCorrectType=getCorrectType(resolver,rtnType,groupInfo);
  if (rtnCorrectType != rtnType) {
    method.setRtnType(rtnCorrectType);
  }
  List<JstArg> args=method.getArgs();
  if (args != null) {
    for (    JstArg arg : args) {
      for (      IJstType parameterType : arg.getTypes()) {
        IJstType parameterCorrectType=parameterType;
        if (parameterType instanceof JstType && !((JstType)parameterType).getStatus().isValid()) {
          final IJstType potentialOtypeMemberType=parameterType;
          IJstOType resolvedOtype=getOtype(potentialOtypeMemberType.getName());
          if (resolvedOtype == null) {
            resolvedOtype=getOtype(getFullNameIfShortName4InnerType(currentType,potentialOtypeMemberType));
          }
          if (resolvedOtype != null) {
            parameterCorrectType=resolvedOtype;
          }
        }
        parameterCorrectType=getCorrectType(resolver,parameterCorrectType,groupInfo);
        if (parameterCorrectType != parameterType) {
          arg.updateType(parameterType.getName(),parameterCorrectType);
        }
      }
    }
  }
  final List<IJstMethod> overloaded=method.getOverloaded();
  if (overloaded != null && !overloaded.isEmpty()) {
    for (    IJstMethod mtd : overloaded) {
      if (mtd instanceof JstMethod) {
        fixMethodTypeRef(resolver,(JstMethod)mtd,currentType,groupInfo);
      }
    }
  }
  updateMethodSignature(method);
}