Program: 53986
Project: 53986
Buggy source:
private void generateOnce(JClassType requestFactoryType,TreeLogger logger,GeneratorContext generatorContext,PrintWriter out,JClassType interfaceType,String packageName,String implName) throws UnableToCompleteException {
  logger=logger.branch(TreeLogger.DEBUG,String.format("String_Node_Str",interfaceType.getName()));
  ClassSourceFileComposerFactory f=new ClassSourceFileComposerFactory(packageName,implName);
  f.addImport(HandlerManager.class.getName());
  f.addImport(RequestFactoryJsonImpl.class.getName());
  f.addImport(interfaceType.getQualifiedSourceName());
  f.addImport(ProxyToTypeMap.class.getName());
  f.addImport(EntityProxy.class.getName());
  f.addImport(ProxySchema.class.getName());
  f.addImplementedInterface(interfaceType.getName());
  f.setSuperclass(RequestFactoryJsonImpl.class.getSimpleName());
  SourceWriter sw=f.createSourceWriter(generatorContext,out);
  sw.println();
  Set<JMethod> requestSelectors=new LinkedHashSet<JMethod>();
  for (  JMethod method : interfaceType.getOverridableMethods()) {
    if (method.getEnclosingType().equals(requestFactoryType)) {
      continue;
    }
    JType returnType=method.getReturnType();
    if (null == returnType) {
      logger.log(TreeLogger.ERROR,String.format("String_Node_Str",method.getName(),interfaceType.getName()));
      throw new UnableToCompleteException();
    }
    JClassType asInterface=returnType.isInterface();
    if (null == asInterface) {
      logger.log(TreeLogger.ERROR,String.format("String_Node_Str",method.getName(),interfaceType.getName()));
      throw new UnableToCompleteException();
    }
    requestSelectors.add(method);
  }
  JClassType proxyToTypeInterface=generatorContext.getTypeOracle().findType(ProxyToTypeMap.class.getName());
  String proxyToTypeMapName=proxyToTypeInterface.getName() + "String_Node_Str";
  sw.println("String_Node_Str" + EntityProxy.class.getName() + "String_Node_Str");
  sw.indent();
  sw.println("String_Node_Str" + proxyToTypeMapName + "String_Node_Str");
  sw.outdent();
  sw.println("String_Node_Str");
  sw.println();
  sw.println("String_Node_Str" + EntityProxy.class.getName() + "String_Node_Str");
  sw.indent();
  sw.println("String_Node_Str" + proxyToTypeMapName + "String_Node_Str");
  sw.outdent();
  sw.println("String_Node_Str");
  sw.println();
  sw.println("String_Node_Str" + EntityProxy.class.getName() + "String_Node_Str");
  sw.indent();
  sw.println("String_Node_Str" + proxyToTypeMapName + "String_Node_Str");
  sw.outdent();
  sw.println("String_Node_Str");
  sw.println();
  sw.println("String_Node_Str" + EntityProxyId.class.getName() + "String_Node_Str");
  sw.indent();
  sw.println("String_Node_Str" + proxyToTypeMapName + "String_Node_Str");
  sw.outdent();
  sw.println("String_Node_Str");
  sw.println();
  sw.println("String_Node_Str");
  sw.indent();
  sw.println("String_Node_Str" + proxyToTypeMapName + "String_Node_Str");
  sw.outdent();
  sw.println("String_Node_Str");
  sw.println();
  sw.println("String_Node_Str");
  sw.indent();
  sw.println("String_Node_Str" + proxyToTypeMapName + "String_Node_Str");
  sw.outdent();
  sw.println("String_Node_Str");
  sw.println();
  sw.println("String_Node_Str");
  sw.indent();
  sw.println("String_Node_Str" + proxyToTypeMapName + "String_Node_Str");
  sw.outdent();
  sw.println("String_Node_Str");
  for (  JMethod requestSelector : requestSelectors) {
    String returnTypeName=requestSelector.getReturnType().getQualifiedSourceName();
    String nestedImplName=capitalize(requestSelector.getName().replace('.','_')) + "String_Node_Str";
    String nestedImplPackage=generatorContext.getTypeOracle().findType(returnTypeName).getPackage().getName();
    sw.println("String_Node_Str" + returnTypeName + "String_Node_Str"+ requestSelector.getName()+ "String_Node_Str");
    sw.indent();
    sw.println("String_Node_Str" + nestedImplPackage + "String_Node_Str"+ nestedImplName+ "String_Node_Str");
    sw.outdent();
    sw.println("String_Node_Str");
    sw.println();
    PrintWriter pw=generatorContext.tryCreate(logger,nestedImplPackage,nestedImplName);
    if (pw != null) {
      generateRequestSelectorImplementation(logger,generatorContext,pw,requestSelector,interfaceType,nestedImplPackage,nestedImplName);
    }
  }
  sw.outdent();
  sw.println("String_Node_Str");
  PrintWriter pw=generatorContext.tryCreate(logger,packageName,proxyToTypeMapName);
  if (pw != null) {
    generateProxyToTypeMap(logger,generatorContext,pw,proxyToTypeInterface,packageName,proxyToTypeMapName);
  }
  generatorContext.commit(logger,out);
}

Fixed version (ground truth):
private void generateOnce(JClassType requestFactoryType,TreeLogger logger,GeneratorContext generatorContext,PrintWriter out,JClassType interfaceType,String packageName,String implName) throws UnableToCompleteException {
  logger=logger.branch(TreeLogger.DEBUG,String.format("String_Node_Str",interfaceType.getName()));
  ClassSourceFileComposerFactory f=new ClassSourceFileComposerFactory(packageName,implName);
  f.addImport(HandlerManager.class.getName());
  f.addImport(RequestFactoryJsonImpl.class.getName());
  f.addImport(interfaceType.getQualifiedSourceName());
  f.addImport(ProxyToTypeMap.class.getName());
  f.addImport(EntityProxy.class.getName());
  f.addImport(ProxySchema.class.getName());
  f.addImplementedInterface(interfaceType.getName());
  f.setSuperclass(RequestFactoryJsonImpl.class.getSimpleName());
  SourceWriter sw=f.createSourceWriter(generatorContext,out);
  sw.println();
  Set<JMethod> requestSelectors=new LinkedHashSet<JMethod>();
  for (  JMethod method : interfaceType.getOverridableMethods()) {
    if (method.getEnclosingType().equals(requestFactoryType)) {
      continue;
    }
    JType returnType=method.getReturnType();
    if (null == returnType) {
      logger.log(TreeLogger.ERROR,String.format("String_Node_Str",method.getName(),interfaceType.getName()));
      throw new UnableToCompleteException();
    }
    JClassType asInterface=returnType.isInterface();
    if (null == asInterface) {
      logger.log(TreeLogger.ERROR,String.format("String_Node_Str",method.getName(),interfaceType.getName()));
      throw new UnableToCompleteException();
    }
    requestSelectors.add(method);
  }
  JClassType t=generatorContext.getTypeOracle().findType(RequestFactoryJsonImpl.class.getName());
  try {
    requestSelectors.add(t.getMethod("String_Node_Str",new JType[0]));
  }
 catch (  NotFoundException e) {
    e.printStackTrace();
  }
  JClassType proxyToTypeInterface=generatorContext.getTypeOracle().findType(ProxyToTypeMap.class.getName());
  String proxyToTypeMapName=proxyToTypeInterface.getName() + "String_Node_Str";
  sw.println("String_Node_Str" + EntityProxy.class.getName() + "String_Node_Str");
  sw.indent();
  sw.println("String_Node_Str" + proxyToTypeMapName + "String_Node_Str");
  sw.outdent();
  sw.println("String_Node_Str");
  sw.println();
  sw.println("String_Node_Str" + EntityProxy.class.getName() + "String_Node_Str");
  sw.indent();
  sw.println("String_Node_Str" + proxyToTypeMapName + "String_Node_Str");
  sw.outdent();
  sw.println("String_Node_Str");
  sw.println();
  sw.println("String_Node_Str" + EntityProxy.class.getName() + "String_Node_Str");
  sw.indent();
  sw.println("String_Node_Str" + proxyToTypeMapName + "String_Node_Str");
  sw.outdent();
  sw.println("String_Node_Str");
  sw.println();
  sw.println("String_Node_Str" + EntityProxyId.class.getName() + "String_Node_Str");
  sw.indent();
  sw.println("String_Node_Str" + proxyToTypeMapName + "String_Node_Str");
  sw.outdent();
  sw.println("String_Node_Str");
  sw.println();
  sw.println("String_Node_Str");
  sw.indent();
  sw.println("String_Node_Str" + proxyToTypeMapName + "String_Node_Str");
  sw.outdent();
  sw.println("String_Node_Str");
  sw.println();
  sw.println("String_Node_Str");
  sw.indent();
  sw.println("String_Node_Str" + proxyToTypeMapName + "String_Node_Str");
  sw.outdent();
  sw.println("String_Node_Str");
  sw.println();
  sw.println("String_Node_Str");
  sw.indent();
  sw.println("String_Node_Str" + proxyToTypeMapName + "String_Node_Str");
  sw.outdent();
  sw.println("String_Node_Str");
  for (  JMethod requestSelector : requestSelectors) {
    String returnTypeName=requestSelector.getReturnType().getQualifiedSourceName();
    String nestedImplName=capitalize(requestSelector.getName().replace('.','_')) + "String_Node_Str";
    String nestedImplPackage=generatorContext.getTypeOracle().findType(returnTypeName).getPackage().getName();
    sw.println("String_Node_Str" + returnTypeName + "String_Node_Str"+ requestSelector.getName()+ "String_Node_Str");
    sw.indent();
    sw.println("String_Node_Str" + nestedImplPackage + "String_Node_Str"+ nestedImplName+ "String_Node_Str");
    sw.outdent();
    sw.println("String_Node_Str");
    sw.println();
    PrintWriter pw=generatorContext.tryCreate(logger,nestedImplPackage,nestedImplName);
    if (pw != null) {
      generateRequestSelectorImplementation(logger,generatorContext,pw,requestSelector,interfaceType,nestedImplPackage,nestedImplName);
    }
  }
  sw.outdent();
  sw.println("String_Node_Str");
  PrintWriter pw=generatorContext.tryCreate(logger,packageName,proxyToTypeMapName);
  if (pw != null) {
    generateProxyToTypeMap(logger,generatorContext,pw,proxyToTypeInterface,packageName,proxyToTypeMapName);
  }
  generatorContext.commit(logger,out);
}