Program: 82068
Project: 82068
Buggy source:
private void generateRequestSelectorImplementation(TreeLogger logger,GeneratorContext generatorContext,PrintWriter out,JMethod selectorMethod,JClassType mainType,String packageName,String implName) throws UnableToCompleteException {
  JClassType selectorInterface=selectorMethod.getReturnType().isInterface();
  logger=logger.branch(TreeLogger.DEBUG,String.format("String_Node_Str",selectorInterface.getName()));
  ClassSourceFileComposerFactory f=new ClassSourceFileComposerFactory(packageName,implName);
  f.addImport(RequestData.class.getName());
  f.addImport(mainType.getQualifiedSourceName() + "String_Node_Str");
  f.addImplementedInterface(selectorInterface.getQualifiedSourceName());
  SourceWriter sw=f.createSourceWriter(generatorContext,out);
  sw.println();
  sw.println("String_Node_Str" + mainType.getName() + "String_Node_Str");
  sw.println();
  sw.println("String_Node_Str" + implName + "String_Node_Str"+ mainType.getName()+ "String_Node_Str");
  sw.indent();
  sw.println("String_Node_Str");
  sw.outdent();
  sw.println("String_Node_Str");
  sw.println();
  for (  JMethod method : selectorInterface.getOverridableMethods()) {
    JClassType returnType=method.getReturnType().isParameterized().getTypeArgs()[0];
    ensureProxyType(logger,generatorContext,returnType.getPackage().getName(),returnType);
    String operationName=selectorInterface.getQualifiedBinaryName() + ReflectionBasedOperationRegistry.SCOPE_SEPARATOR + method.getName();
    JClassType requestType=method.getReturnType().isClassOrInterface();
    String requestClassName=null;
    TypeOracle typeOracle=generatorContext.getTypeOracle();
    String enumArgument="String_Node_Str";
    if (isProxyListRequest(typeOracle,requestType)) {
      requestClassName=asInnerImplClass("String_Node_Str",returnType);
    }
 else     if (isProxyRequest(typeOracle,requestType)) {
      requestClassName=asInnerImplClass("String_Node_Str",returnType);
    }
 else     if (isStringRequest(typeOracle,requestType)) {
      requestClassName=AbstractStringRequest.class.getName();
    }
 else     if (isLongRequest(typeOracle,requestType)) {
      requestClassName=AbstractLongRequest.class.getName();
    }
 else     if (isIntegerRequest(typeOracle,requestType)) {
      requestClassName=AbstractIntegerRequest.class.getName();
    }
 else     if (isDoubleRequest(typeOracle,requestType)) {
      requestClassName=AbstractDoubleRequest.class.getName();
    }
 else     if (isByteRequest(typeOracle,requestType)) {
      requestClassName=AbstractByteRequest.class.getName();
    }
 else     if (isBooleanRequest(typeOracle,requestType)) {
      requestClassName=AbstractBooleanRequest.class.getName();
    }
 else     if (isShortRequest(typeOracle,requestType)) {
      requestClassName=AbstractShortRequest.class.getName();
    }
 else     if (isFloatRequest(typeOracle,requestType)) {
      requestClassName=AbstractFloatRequest.class.getName();
    }
 else     if (isCharacterRequest(typeOracle,requestType)) {
      requestClassName=AbstractCharacterRequest.class.getName();
    }
 else     if (isDateRequest(typeOracle,requestType)) {
      requestClassName=AbstractDateRequest.class.getName();
    }
 else     if (isBigDecimalRequest(typeOracle,requestType)) {
      requestClassName=AbstractBigDecimalRequest.class.getName();
    }
 else     if (isBigIntegerRequest(typeOracle,requestType)) {
      requestClassName=AbstractBigIntegerRequest.class.getName();
    }
 else     if (isEnumRequest(typeOracle,requestType)) {
      requestClassName=AbstractEnumRequest.class.getName();
      enumArgument="String_Node_Str" + requestType.isParameterized().getTypeArgs()[0] + "String_Node_Str";
    }
 else     if (isVoidRequest(typeOracle,requestType)) {
      requestClassName=AbstractVoidRequest.class.getName();
    }
 else {
      logger.log(TreeLogger.ERROR,"String_Node_Str" + requestType + "String_Node_Str");
      throw new UnableToCompleteException();
    }
    sw.println(getMethodDeclaration(method) + "String_Node_Str");
    sw.indent();
    sw.println("String_Node_Str" + requestClassName + "String_Node_Str"+ enumArgument+ "String_Node_Str");
    sw.indent();
    String requestDataName=RequestData.class.getSimpleName();
    sw.println("String_Node_Str" + requestDataName + "String_Node_Str");
    sw.indent();
    sw.println("String_Node_Str" + requestDataName + "String_Node_Str"+ operationName+ "String_Node_Str"+ getParametersAsString(method,typeOracle)+ "String_Node_Str"+ "String_Node_Str");
    sw.outdent();
    sw.println("String_Node_Str");
    sw.outdent();
    sw.println("String_Node_Str");
    sw.outdent();
    sw.println("String_Node_Str");
  }
  sw.outdent();
  sw.println("String_Node_Str");
  generatorContext.commit(logger,out);
}

Fixed version (ground truth):
private void generateRequestSelectorImplementation(TreeLogger logger,GeneratorContext generatorContext,PrintWriter out,JMethod selectorMethod,JClassType mainType,String packageName,String implName) throws UnableToCompleteException {
  JClassType selectorInterface=selectorMethod.getReturnType().isInterface();
  logger=logger.branch(TreeLogger.DEBUG,String.format("String_Node_Str",selectorInterface.getName()));
  ClassSourceFileComposerFactory f=new ClassSourceFileComposerFactory(packageName,implName);
  f.addImport(RequestData.class.getName());
  f.addImport(mainType.getQualifiedSourceName() + "String_Node_Str");
  f.addImplementedInterface(selectorInterface.getQualifiedSourceName());
  SourceWriter sw=f.createSourceWriter(generatorContext,out);
  sw.println();
  sw.println("String_Node_Str" + mainType.getName() + "String_Node_Str");
  sw.println();
  sw.println("String_Node_Str" + implName + "String_Node_Str"+ mainType.getName()+ "String_Node_Str");
  sw.indent();
  sw.println("String_Node_Str");
  sw.outdent();
  sw.println("String_Node_Str");
  sw.println();
  for (  JMethod method : selectorInterface.getOverridableMethods()) {
    JClassType returnType=method.getReturnType().isParameterized().getTypeArgs()[0];
    ensureProxyType(logger,generatorContext,returnType.getPackage().getName(),returnType);
    String operationName=selectorInterface.getQualifiedBinaryName() + ReflectionBasedOperationRegistry.SCOPE_SEPARATOR + method.getName();
    JClassType requestType=method.getReturnType().isClassOrInterface();
    String requestClassName=null;
    TypeOracle typeOracle=generatorContext.getTypeOracle();
    String enumOrFindArgument="String_Node_Str";
    if (isProxyListRequest(typeOracle,requestType)) {
      requestClassName=asInnerImplClass("String_Node_Str",returnType);
    }
 else     if (isProxyRequest(typeOracle,requestType)) {
      if (selectorInterface.isAssignableTo(typeOracle.findType(FindRequest.class.getName()))) {
        enumOrFindArgument="String_Node_Str";
        requestClassName=FindRequestObjectImpl.class.getName();
      }
 else {
        requestClassName=asInnerImplClass("String_Node_Str",returnType);
      }
    }
 else     if (isStringRequest(typeOracle,requestType)) {
      requestClassName=AbstractStringRequest.class.getName();
    }
 else     if (isLongRequest(typeOracle,requestType)) {
      requestClassName=AbstractLongRequest.class.getName();
    }
 else     if (isIntegerRequest(typeOracle,requestType)) {
      requestClassName=AbstractIntegerRequest.class.getName();
    }
 else     if (isDoubleRequest(typeOracle,requestType)) {
      requestClassName=AbstractDoubleRequest.class.getName();
    }
 else     if (isByteRequest(typeOracle,requestType)) {
      requestClassName=AbstractByteRequest.class.getName();
    }
 else     if (isBooleanRequest(typeOracle,requestType)) {
      requestClassName=AbstractBooleanRequest.class.getName();
    }
 else     if (isShortRequest(typeOracle,requestType)) {
      requestClassName=AbstractShortRequest.class.getName();
    }
 else     if (isFloatRequest(typeOracle,requestType)) {
      requestClassName=AbstractFloatRequest.class.getName();
    }
 else     if (isCharacterRequest(typeOracle,requestType)) {
      requestClassName=AbstractCharacterRequest.class.getName();
    }
 else     if (isDateRequest(typeOracle,requestType)) {
      requestClassName=AbstractDateRequest.class.getName();
    }
 else     if (isBigDecimalRequest(typeOracle,requestType)) {
      requestClassName=AbstractBigDecimalRequest.class.getName();
    }
 else     if (isBigIntegerRequest(typeOracle,requestType)) {
      requestClassName=AbstractBigIntegerRequest.class.getName();
    }
 else     if (isEnumRequest(typeOracle,requestType)) {
      requestClassName=AbstractEnumRequest.class.getName();
      enumOrFindArgument="String_Node_Str" + requestType.isParameterized().getTypeArgs()[0] + "String_Node_Str";
    }
 else     if (isVoidRequest(typeOracle,requestType)) {
      requestClassName=AbstractVoidRequest.class.getName();
    }
 else {
      logger.log(TreeLogger.ERROR,"String_Node_Str" + requestType + "String_Node_Str");
      throw new UnableToCompleteException();
    }
    sw.println(getMethodDeclaration(method) + "String_Node_Str");
    sw.indent();
    sw.println("String_Node_Str" + requestClassName + "String_Node_Str"+ enumOrFindArgument+ "String_Node_Str");
    sw.indent();
    String requestDataName=RequestData.class.getSimpleName();
    sw.println("String_Node_Str" + requestDataName + "String_Node_Str");
    sw.indent();
    sw.println("String_Node_Str" + requestDataName + "String_Node_Str"+ operationName+ "String_Node_Str"+ getParametersAsString(method,typeOracle)+ "String_Node_Str"+ "String_Node_Str");
    sw.outdent();
    sw.println("String_Node_Str");
    sw.outdent();
    sw.println("String_Node_Str");
    sw.outdent();
    sw.println("String_Node_Str");
  }
  sw.outdent();
  sw.println("String_Node_Str");
  generatorContext.commit(logger,out);
}