Program: 53985
Project: 53985
Buggy source:
private void ensureProxyType(TreeLogger logger,GeneratorContext generatorContext,String packageName,JClassType publicProxyType) throws UnableToCompleteException {
  TypeOracle typeOracle=generatorContext.getTypeOracle();
  if (!publicProxyType.isAssignableTo(typeOracle.findType(EntityProxy.class.getName()))) {
    return;
  }
  if (generatedProxyTypes.contains(publicProxyType)) {
    return;
  }
  String proxyImplTypeName=publicProxyType.getName() + "String_Node_Str";
  PrintWriter pw=generatorContext.tryCreate(logger,packageName,proxyImplTypeName);
  Set<JClassType> transitiveDeps=new LinkedHashSet<JClassType>();
  if (pw != null) {
    logger=logger.branch(TreeLogger.DEBUG,"String_Node_Str" + publicProxyType.getName());
    ClassSourceFileComposerFactory f=new ClassSourceFileComposerFactory(packageName,proxyImplTypeName);
    f.addImport(AbstractJsonListRequest.class.getName());
    f.addImport(AbstractJsonObjectRequest.class.getName());
    f.addImport(RequestFactoryJsonImpl.class.getName());
    f.addImport(Property.class.getName());
    f.addImport(EnumProperty.class.getName());
    f.addImport(EntityProxy.class.getName());
    f.addImport(ProxyImpl.class.getName());
    f.addImport(ProxyJsoImpl.class.getName());
    f.addImport(ProxySchema.class.getName());
    f.addImport(WriteOperation.class.getName().replace("String_Node_Str","String_Node_Str"));
    f.addImport(Collections.class.getName());
    f.addImport(HashSet.class.getName());
    f.addImport(Set.class.getName());
    f.setSuperclass(ProxyImpl.class.getSimpleName());
    f.addImplementedInterface(publicProxyType.getName());
    List<EntityProperty> entityProperties=computeEntityPropertiesFromProxyType(publicProxyType);
    for (    EntityProperty entityProperty : entityProperties) {
      JType type=entityProperty.getType();
      if (type.isPrimitive() == null) {
        f.addImport(type.getErasedType().getQualifiedSourceName());
      }
    }
    SourceWriter sw=f.createSourceWriter(generatorContext,pw);
    sw.println();
    for (    EntityProperty entityProperty : entityProperties) {
      sw.println();
      String name=entityProperty.getName();
      if (entityProperty.getType().isEnum() != null) {
        sw.println(String.format("String_Node_Str",entityProperty.getType().getSimpleSourceName(),name));
      }
 else {
        sw.println(String.format("String_Node_Str",entityProperty.getType().getSimpleSourceName(),name,capitalize(name)));
      }
    }
    printSchema(typeOracle,publicProxyType,proxyImplTypeName,sw);
    sw.println();
    String simpleImplName=publicProxyType.getSimpleSourceName() + "String_Node_Str";
    printRequestImplClass(sw,publicProxyType,simpleImplName,true);
    printRequestImplClass(sw,publicProxyType,simpleImplName,false);
    sw.println();
    sw.println(String.format("String_Node_Str",proxyImplTypeName));
    sw.println();
    sw.println(String.format("String_Node_Str",proxyImplTypeName));
    sw.indent();
    sw.println("String_Node_Str");
    sw.outdent();
    sw.println("String_Node_Str");
    for (    EntityProperty entityProperty : entityProperties) {
      JClassType returnType=entityProperty.getType().isClassOrInterface();
      sw.println();
      sw.println(String.format("String_Node_Str",returnType.getQualifiedSourceName(),capitalize(entityProperty.getName())));
      sw.indent();
      sw.println(String.format("String_Node_Str",entityProperty.getName()));
      sw.outdent();
      sw.println("String_Node_Str");
      if (isProxyType(typeOracle,returnType)) {
        transitiveDeps.add(returnType);
      }
    }
    for (    EntityProperty entityProperty : entityProperties) {
      JClassType returnType=entityProperty.getType().isClassOrInterface();
      sw.println();
      String varName=entityProperty.getName();
      sw.println(String.format("String_Node_Str",capitalize(varName),returnType.getQualifiedSourceName(),varName));
      sw.indent();
      sw.println(String.format("String_Node_Str",varName,varName));
      sw.outdent();
      sw.println("String_Node_Str");
    }
    sw.outdent();
    sw.println("String_Node_Str");
    generatorContext.commit(logger,pw);
  }
  generatedProxyTypes.add(publicProxyType);
  for (  JClassType type : transitiveDeps) {
    ensureProxyType(logger,generatorContext,type.getPackage().getName(),type);
  }
}

Fixed version (ground truth):
private void ensureProxyType(TreeLogger logger,GeneratorContext generatorContext,String packageName,JClassType publicProxyType) throws UnableToCompleteException {
  TypeOracle typeOracle=generatorContext.getTypeOracle();
  JClassType entityProxyClass=typeOracle.findType(EntityProxy.class.getName());
  if (!publicProxyType.isAssignableTo(entityProxyClass)) {
    return;
  }
  if (publicProxyType.equals(entityProxyClass)) {
    return;
  }
  if (generatedProxyTypes.contains(publicProxyType)) {
    return;
  }
  String proxyImplTypeName=publicProxyType.getName() + "String_Node_Str";
  PrintWriter pw=generatorContext.tryCreate(logger,packageName,proxyImplTypeName);
  Set<JClassType> transitiveDeps=new LinkedHashSet<JClassType>();
  if (pw != null) {
    logger=logger.branch(TreeLogger.DEBUG,"String_Node_Str" + publicProxyType.getName());
    ClassSourceFileComposerFactory f=new ClassSourceFileComposerFactory(packageName,proxyImplTypeName);
    f.addImport(AbstractJsonListRequest.class.getName());
    f.addImport(AbstractJsonObjectRequest.class.getName());
    f.addImport(RequestFactoryJsonImpl.class.getName());
    f.addImport(Property.class.getName());
    f.addImport(EnumProperty.class.getName());
    f.addImport(EntityProxy.class.getName());
    f.addImport(ProxyImpl.class.getName());
    f.addImport(ProxyJsoImpl.class.getName());
    f.addImport(ProxySchema.class.getName());
    f.addImport(WriteOperation.class.getName().replace("String_Node_Str","String_Node_Str"));
    f.addImport(Collections.class.getName());
    f.addImport(HashSet.class.getName());
    f.addImport(Set.class.getName());
    f.setSuperclass(ProxyImpl.class.getSimpleName());
    f.addImplementedInterface(publicProxyType.getName());
    List<EntityProperty> entityProperties=computeEntityPropertiesFromProxyType(publicProxyType);
    for (    EntityProperty entityProperty : entityProperties) {
      JType type=entityProperty.getType();
      if (type.isPrimitive() == null) {
        f.addImport(type.getErasedType().getQualifiedSourceName());
      }
    }
    SourceWriter sw=f.createSourceWriter(generatorContext,pw);
    sw.println();
    for (    EntityProperty entityProperty : entityProperties) {
      sw.println();
      String name=entityProperty.getName();
      if (entityProperty.getType().isEnum() != null) {
        sw.println(String.format("String_Node_Str",entityProperty.getType().getSimpleSourceName(),name));
      }
 else {
        sw.println(String.format("String_Node_Str",entityProperty.getType().getSimpleSourceName(),name,capitalize(name)));
      }
    }
    printSchema(typeOracle,publicProxyType,proxyImplTypeName,sw);
    sw.println();
    String simpleImplName=publicProxyType.getSimpleSourceName() + "String_Node_Str";
    printRequestImplClass(sw,publicProxyType,simpleImplName,true);
    printRequestImplClass(sw,publicProxyType,simpleImplName,false);
    sw.println();
    sw.println(String.format("String_Node_Str",proxyImplTypeName));
    sw.println();
    sw.println(String.format("String_Node_Str",proxyImplTypeName));
    sw.indent();
    sw.println("String_Node_Str");
    sw.outdent();
    sw.println("String_Node_Str");
    for (    EntityProperty entityProperty : entityProperties) {
      JClassType returnType=entityProperty.getType().isClassOrInterface();
      sw.println();
      sw.println(String.format("String_Node_Str",returnType.getQualifiedSourceName(),capitalize(entityProperty.getName())));
      sw.indent();
      sw.println(String.format("String_Node_Str",entityProperty.getName()));
      sw.outdent();
      sw.println("String_Node_Str");
      if (isProxyType(typeOracle,returnType)) {
        transitiveDeps.add(returnType);
      }
    }
    for (    EntityProperty entityProperty : entityProperties) {
      JClassType returnType=entityProperty.getType().isClassOrInterface();
      sw.println();
      String varName=entityProperty.getName();
      sw.println(String.format("String_Node_Str",capitalize(varName),returnType.getQualifiedSourceName(),varName));
      sw.indent();
      sw.println(String.format("String_Node_Str",varName,varName));
      sw.outdent();
      sw.println("String_Node_Str");
    }
    sw.outdent();
    sw.println("String_Node_Str");
    generatorContext.commit(logger,pw);
  }
  generatedProxyTypes.add(publicProxyType);
  for (  JClassType type : transitiveDeps) {
    ensureProxyType(logger,generatorContext,type.getPackage().getName(),type);
  }
}