Program: 181110
Project: 181110
Buggy source:
private CharSequence getEncodingSourceCode(String indentation,String valueName,String outputStreamVarName,Type parameterType,int recursionDepth){
  StringBuilder buffer=new StringBuilder();
  if (parameterType.getTypeKind() == TypeKind.Primitive) {
    PrimitiveType primitiveType=(PrimitiveType)parameterType;
    String primitiveName=primitiveType.getPrimitiveClass().getName();
    buffer.append(indentation + outputStreamVarName + "String_Node_Str"+ primitiveName.substring(0,1).toUpperCase()+ primitiveName.substring(1).toLowerCase()+ "String_Node_Str"+ valueName+ "String_Node_Str");
  }
 else   if (parameterType.getTypeKind() == TypeKind.PrimitiveWrapper) {
    PrimitiveWrapperType primitiveWrapperType=(PrimitiveWrapperType)parameterType;
    String primitiveName=primitiveWrapperType.getPrimitiveClass().getName();
    buffer.append(indentation + outputStreamVarName + "String_Node_Str"+ primitiveName.substring(0,1).toUpperCase()+ primitiveName.substring(1).toLowerCase()+ "String_Node_Str"+ valueName+ "String_Node_Str");
  }
 else   if (parameterType.getTypeKind() == TypeKind.Array) {
    ArrayType arrayType=(ArrayType)parameterType;
    CharSequence writeValueBlock=getEncodingSourceCode(indentation + "String_Node_Str","String_Node_Str" + recursionDepth,outputStreamVarName,arrayType.getComponentType(),recursionDepth + 1);
    buffer.append(String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",indentation,outputStreamVarName,valueName,arrayType.getComponentType(),recursionDepth,writeValueBlock));
  }
 else   if (parameterType.getTypeKind() == TypeKind.Enum) {
    EnumType enumType=(EnumType)parameterType;
    int nbEnumItems=enumType.getNbEnumItems();
    String enumWriteCommand=(nbEnumItems + 1 <= 256 ? "String_Node_Str" : (nbEnumItems + 1 <= 65536 ? "String_Node_Str" : "String_Node_Str"));
    buffer.append(indentation + "String_Node_Str" + valueName+ "String_Node_Str"+ outputStreamVarName+ enumWriteCommand+ "String_Node_Str"+ nbEnumItems+ "String_Node_Str");
    buffer.append(indentation + "String_Node_Str" + outputStreamVarName+ enumWriteCommand+ "String_Node_Str"+ valueName+ "String_Node_Str");
  }
 else   if (parameterType.getTypeKind() == TypeKind.Declared) {
    DeclaredType declaredType=(DeclaredType)parameterType;
    if (declaredType.getTypeClass() == String.class) {
      buffer.append(indentation + outputStreamVarName + "String_Node_Str"+ valueName+ "String_Node_Str");
    }
 else     if (declaredType.getTypeClass() == List.class || declaredType.getTypeClass() == Set.class || declaredType.getTypeClass() == Collection.class) {
      CharSequence writeValueBlock=getEncodingSourceCode(indentation + "String_Node_Str","String_Node_Str" + recursionDepth,outputStreamVarName,declaredType.getGenericArgumentTypeList().get(0),recursionDepth + 1);
      buffer.append(String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",indentation,outputStreamVarName,valueName,toString(declaredType.getGenericArgumentTypeList().get(0)),recursionDepth,writeValueBlock));
    }
 else     if (declaredType.getTypeClass() == Map.class) {
      CharSequence writeKeyBlock=getEncodingSourceCode(indentation + "String_Node_Str","String_Node_Str" + recursionDepth + "String_Node_Str",outputStreamVarName,declaredType.getGenericArgumentTypeList().get(0),recursionDepth + 1);
      CharSequence writeValueBlock=getEncodingSourceCode(indentation + "String_Node_Str","String_Node_Str" + recursionDepth + "String_Node_Str",outputStreamVarName,declaredType.getGenericArgumentTypeList().get(1),recursionDepth + 1);
      buffer.append(String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",indentation,outputStreamVarName,valueName,toString(declaredType.getGenericArgumentTypeList().get(0)),toString(declaredType.getGenericArgumentTypeList().get(1)),recursionDepth,writeKeyBlock,writeValueBlock));
    }
 else     if (modelData.getClassNameToVoClass().containsKey(parameterType.toString())) {
      buffer.append(indentation + "String_Node_Str" + valueName+ "String_Node_Str");
      buffer.append(indentation + "String_Node_Str" + outputStreamVarName+ "String_Node_Str");
      buffer.append(indentation + "String_Node_Str");
      buffer.append(indentation + "String_Node_Str" + outputStreamVarName+ "String_Node_Str");
      buffer.append(indentation + "String_Node_Str" + String.format("String_Node_Str",outputStreamVarName,valueName));
      buffer.append(indentation + "String_Node_Str");
    }
 else {
      config.getProcessingEnv().getMessager().printMessage(Diagnostic.Kind.ERROR,"String_Node_Str" + parameterType + "String_Node_Str");
      buffer.append(indentation + "String_Node_Str" + parameterType+ "String_Node_Str");
    }
  }
  return buffer;
}

Fixed version (ground truth):
private CharSequence getEncodingSourceCode(String indentation,String valueName,String outputStreamVarName,Type parameterType,int recursionDepth){
  StringBuilder buffer=new StringBuilder();
  if (parameterType.getTypeKind() == TypeKind.Primitive) {
    PrimitiveType primitiveType=(PrimitiveType)parameterType;
    String primitiveName=primitiveType.getPrimitiveClass().getName();
    buffer.append(indentation + outputStreamVarName + "String_Node_Str"+ primitiveName.substring(0,1).toUpperCase()+ primitiveName.substring(1).toLowerCase()+ "String_Node_Str"+ valueName+ "String_Node_Str");
  }
 else   if (parameterType.getTypeKind() == TypeKind.PrimitiveWrapper) {
    PrimitiveWrapperType primitiveWrapperType=(PrimitiveWrapperType)parameterType;
    String primitiveName=primitiveWrapperType.getPrimitiveClass().getName();
    buffer.append(indentation + outputStreamVarName + "String_Node_Str"+ primitiveName.substring(0,1).toUpperCase()+ primitiveName.substring(1).toLowerCase()+ "String_Node_Str"+ valueName+ "String_Node_Str");
  }
 else   if (parameterType.getTypeKind() == TypeKind.Array) {
    ArrayType arrayType=(ArrayType)parameterType;
    CharSequence writeValueBlock=getEncodingSourceCode(indentation + "String_Node_Str","String_Node_Str" + recursionDepth,outputStreamVarName,arrayType.getComponentType(),recursionDepth + 1);
    buffer.append(String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",indentation,outputStreamVarName,valueName,toString(arrayType.getComponentType()),recursionDepth,writeValueBlock));
  }
 else   if (parameterType.getTypeKind() == TypeKind.Enum) {
    EnumType enumType=(EnumType)parameterType;
    int nbEnumItems=enumType.getNbEnumItems();
    String enumWriteCommand=(nbEnumItems + 1 <= 256 ? "String_Node_Str" : (nbEnumItems + 1 <= 65536 ? "String_Node_Str" : "String_Node_Str"));
    buffer.append(indentation + "String_Node_Str" + valueName+ "String_Node_Str"+ outputStreamVarName+ enumWriteCommand+ "String_Node_Str"+ nbEnumItems+ "String_Node_Str");
    buffer.append(indentation + "String_Node_Str" + outputStreamVarName+ enumWriteCommand+ "String_Node_Str"+ valueName+ "String_Node_Str");
  }
 else   if (parameterType.getTypeKind() == TypeKind.Declared) {
    DeclaredType declaredType=(DeclaredType)parameterType;
    if (declaredType.getTypeClass() == String.class) {
      buffer.append(indentation + outputStreamVarName + "String_Node_Str"+ valueName+ "String_Node_Str");
    }
 else     if (declaredType.getTypeClass() == List.class || declaredType.getTypeClass() == Set.class || declaredType.getTypeClass() == Collection.class) {
      CharSequence writeValueBlock=getEncodingSourceCode(indentation + "String_Node_Str","String_Node_Str" + recursionDepth,outputStreamVarName,declaredType.getGenericArgumentTypeList().get(0),recursionDepth + 1);
      buffer.append(String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",indentation,outputStreamVarName,valueName,toString(declaredType.getGenericArgumentTypeList().get(0)),recursionDepth,writeValueBlock));
    }
 else     if (declaredType.getTypeClass() == Map.class) {
      CharSequence writeKeyBlock=getEncodingSourceCode(indentation + "String_Node_Str","String_Node_Str" + recursionDepth + "String_Node_Str",outputStreamVarName,declaredType.getGenericArgumentTypeList().get(0),recursionDepth + 1);
      CharSequence writeValueBlock=getEncodingSourceCode(indentation + "String_Node_Str","String_Node_Str" + recursionDepth + "String_Node_Str",outputStreamVarName,declaredType.getGenericArgumentTypeList().get(1),recursionDepth + 1);
      buffer.append(String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",indentation,outputStreamVarName,valueName,toString(declaredType.getGenericArgumentTypeList().get(0)),toString(declaredType.getGenericArgumentTypeList().get(1)),recursionDepth,writeKeyBlock,writeValueBlock));
    }
 else     if (modelData.getClassNameToVoClass().containsKey(parameterType.toString())) {
      buffer.append(indentation + "String_Node_Str" + valueName+ "String_Node_Str");
      buffer.append(indentation + "String_Node_Str" + outputStreamVarName+ "String_Node_Str");
      buffer.append(indentation + "String_Node_Str");
      buffer.append(indentation + "String_Node_Str" + outputStreamVarName+ "String_Node_Str");
      buffer.append(indentation + "String_Node_Str" + String.format("String_Node_Str",outputStreamVarName,valueName));
      buffer.append(indentation + "String_Node_Str");
    }
 else {
      config.getProcessingEnv().getMessager().printMessage(Diagnostic.Kind.ERROR,"String_Node_Str" + parameterType + "String_Node_Str");
      buffer.append(indentation + "String_Node_Str" + parameterType+ "String_Node_Str");
    }
  }
  return buffer;
}