Program: 164653
Project: 164653
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;
    }
    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);
}

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=getGenericReturnType(cascadingClass,methodNameAndDesc);
    if (genericReturnType == null) {
      return null;
    }
    Class<?> resolvedReturnType=getClassType(genericReturnType);
    if (resolvedReturnType.isAssignableFrom(cascadingClass)) {
      if (mockInstance != null) {
        return mockInstance;
      }
      returnType=mockedType;
      returnClass=cascadingClass;
    }
 else     if (nonPublicTypeReturnedFromPublicInterface(cascadingClass,resolvedReturnType)) {
      return null;
    }
 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);
}