Program: 164658
Project: 164658
Buggy source:
@Nullable private Object getCascadedInstance(@Nonnull String methodNameAndDesc,@Nonnull String returnTypeInternalName,@Nullable Object mockInstance){
  MockedTypeCascade nextLevel=this;
  Type returnType=cascadedTypesAndMocks.get(returnTypeInternalName);
  Class<?> returnClass;
  if (returnType == null) {
    Class<?> cascadingClass=getClassWithCalledMethod();
    Type genericReturnType;
    try {
      genericReturnType=getGenericReturnType(cascadingClass,methodNameAndDesc);
    }
 catch (    NoSuchMethodException ignore) {
      return null;
    }
    Class<?> resolvedReturnType=getClassType(genericReturnType);
    if (resolvedReturnType.isAssignableFrom(cascadingClass)) {
      if (mockInstance != null) {
        return mockInstance;
      }
      returnType=mockedType;
      returnClass=cascadingClass;
    }
 else {
      Object defaultReturnValue=DefaultValues.computeForType(resolvedReturnType);
      if (defaultReturnValue != null) {
        return defaultReturnValue;
      }
      cascadedTypesAndMocks.put(returnTypeInternalName,genericReturnType);
      nextLevel=CASCADING_TYPES.add(returnTypeInternalName,false,genericReturnType);
      returnType=genericReturnType;
      returnClass=resolvedReturnType;
    }
  }
 else {
    nextLevel=CASCADING_TYPES.getCascade(returnType);
    returnClass=getClassType(returnType);
  }
  if (getReturnTypeIfCascadingSupportedForIt(returnClass) == null) {
    return null;
  }
  return nextLevel.createNewCascadedInstanceOrUseNonCascadedOneIfAvailable(methodNameAndDesc,returnType);
}

Fixed version (ground truth):
@Nullable private Object getCascadedInstance(@Nonnull String methodNameAndDesc,@Nonnull String returnTypeInternalName,@Nullable Object mockInstance){
  MockedTypeCascade nextLevel=this;
  Type returnType=cascadedTypesAndMocks.get(returnTypeInternalName);
  Class<?> returnClass;
  if (returnType == null) {
    Class<?> cascadingClass=getClassWithCalledMethod();
    Type genericReturnType;
    try {
      genericReturnType=getGenericReturnType(cascadingClass,methodNameAndDesc);
    }
 catch (    NoSuchMethodException ignore) {
      return null;
    }
    if (genericReturnType == Object.class) {
      return null;
    }
    Class<?> resolvedReturnType=getClassType(genericReturnType);
    if (resolvedReturnType.isAssignableFrom(cascadingClass)) {
      if (mockInstance != null) {
        return mockInstance;
      }
      returnType=mockedType;
      returnClass=cascadingClass;
    }
 else {
      Object defaultReturnValue=DefaultValues.computeForType(resolvedReturnType);
      if (defaultReturnValue != null) {
        return defaultReturnValue;
      }
      cascadedTypesAndMocks.put(returnTypeInternalName,genericReturnType);
      nextLevel=CASCADING_TYPES.add(returnTypeInternalName,false,genericReturnType);
      returnType=genericReturnType;
      returnClass=resolvedReturnType;
    }
  }
 else {
    nextLevel=CASCADING_TYPES.getCascade(returnType);
    returnClass=getClassType(returnType);
  }
  if (getReturnTypeIfCascadingSupportedForIt(returnClass) == null) {
    return null;
  }
  return nextLevel.createNewCascadedInstanceOrUseNonCascadedOneIfAvailable(methodNameAndDesc,returnType);
}