nus-yam/ex-repair huggingface dataset:
Program: 33209
Project: 33209
Buggy source:
protected void writePrimitiveValue(final EdmPrimitiveType type,final Object primitiveValue,final Boolean isNullable,final Integer maxLength,final Integer precision,final Integer scale,final Boolean isUnicode,final XMLStreamWriter writer) throws EdmPrimitiveTypeException, XMLStreamException {
  final String value=type.valueToString(primitiveValue,isNullable,maxLength,precision,scale,isUnicode);
  if (value == null) {
    writer.writeAttribute(DATA,NS_DATA,"String_Node_Str","String_Node_Str");
  }
 else   if (type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Boolean)) {
    writer.writeCharacters(value);
  }
 else   if (type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Byte) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Decimal) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Double) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Int16) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Int32) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Int64) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.SByte) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Single)) {
    writer.writeCharacters(value);
  }
 else {
    writer.writeCharacters(value);
  }
}

Fixed version (ground truth):
protected void writePrimitiveValue(final EdmPrimitiveType type,final Object primitiveValue,final Boolean isNullable,final Integer maxLength,final Integer precision,final Integer scale,final Boolean isUnicode,final XMLStreamWriter writer) throws EdmPrimitiveTypeException, XMLStreamException {
  final String value=type.valueToString(primitiveValue,isNullable,maxLength,precision,scale,isUnicode);
  if (value == null) {
    writer.writeAttribute(DATA,NS_DATA,"String_Node_Str","String_Node_Str");
  }
 else   if (type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Byte) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Boolean) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Decimal) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Double) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Int16) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Int32) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Int64) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.SByte) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Single)) {
    writer.writeCharacters(value);
  }
 else {
    writer.writeCharacters(value);
  }
}
Program: 33210
Project: 33210
Buggy source:
protected void writeExpandedNavigationProperty(final ServiceMetadata metadata,final EdmNavigationProperty property,final Link navigationLink,final ExpandOption innerExpand,final SelectOption innerSelect,final XMLStreamWriter writer) throws XMLStreamException, SerializerException {
  if (property.isCollection()) {
    if (navigationLink == null || navigationLink.getInlineEntitySet() == null) {
    }
 else {
      writer.writeStartElement(ATOM,"String_Node_Str",NS_ATOM);
      writeEntitySet(metadata,property.getType(),navigationLink.getInlineEntitySet(),innerExpand,innerSelect,writer);
      writer.writeEndElement();
    }
  }
 else {
    if (navigationLink == null || navigationLink.getInlineEntity() == null) {
    }
 else {
      writeEntity(metadata,property.getType(),navigationLink.getInlineEntity(),null,innerExpand,innerSelect,writer,false);
    }
  }
}

Fixed version (ground truth):
protected void writeExpandedNavigationProperty(final ServiceMetadata metadata,final EdmNavigationProperty property,final Link navigationLink,final ExpandOption innerExpand,final SelectOption innerSelect,final XMLStreamWriter writer) throws XMLStreamException, SerializerException {
  if (property.isCollection()) {
    if (navigationLink != null && navigationLink.getInlineEntitySet() != null) {
      writer.writeStartElement(ATOM,"String_Node_Str",NS_ATOM);
      writeEntitySet(metadata,property.getType(),navigationLink.getInlineEntitySet(),innerExpand,innerSelect,writer);
      writer.writeEndElement();
    }
  }
 else {
    if (navigationLink != null && navigationLink.getInlineEntity() != null) {
      writeEntity(metadata,property.getType(),navigationLink.getInlineEntity(),null,innerExpand,innerSelect,writer,false);
    }
  }
}
Program: 33211
Project: 33211
Buggy source:
public Writer(final byte[] src,final OutputStream os){
  this.os=os;
  this.src=src;
}

Fixed version (ground truth):
public Writer(final byte[] src,final OutputStream os){
  this.os=os;
  this.src=Arrays.copyOf(src,src.length);
}
Program: 33212
Project: 33212
Buggy source:
public static HttpEntity buildInputStreamEntity(final ODataClient client,final InputStream input){
  AbstractHttpEntity entity;
  boolean useChunked=client.getConfiguration().isUseChuncked();
  if (shouldUseRepeatableHttpBodyEntry(client) || !useChunked) {
    byte[] bytes=new byte[0];
    try {
      bytes=IOUtils.toByteArray(input);
      IOUtils.closeQuietly(input);
    }
 catch (    IOException e) {
      LOG.error("String_Node_Str",e);
    }
    entity=new ByteArrayEntity(bytes);
  }
 else {
    entity=new InputStreamEntity(input,-1);
  }
  if (!useChunked && entity.getContentLength() < 0) {
    LOG.error("String_Node_Str");
    useChunked=true;
  }
  entity.setChunked(useChunked);
  return entity;
}

Fixed version (ground truth):
public static HttpEntity buildInputStreamEntity(final ODataClient client,final InputStream input){
  AbstractHttpEntity entity;
  boolean useChunked=client.getConfiguration().isUseChuncked();
  if (shouldUseRepeatableHttpBodyEntry(client) || !useChunked) {
    byte[] bytes=new byte[0];
    try {
      bytes=IOUtils.toByteArray(input);
      IOUtils.closeQuietly(input);
    }
 catch (    IOException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
    entity=new ByteArrayEntity(bytes);
  }
 else {
    entity=new InputStreamEntity(input,-1);
  }
  if (!useChunked && entity.getContentLength() < 0) {
    useChunked=true;
  }
  entity.setChunked(useChunked);
  return entity;
}
Program: 33214
Project: 33214
Buggy source:
private void readParameter(StartElement element,CsdlOperation operation){
  CsdlParameter parameter=new CsdlParameter();
  parameter.setName(attr(element,"String_Node_Str"));
  parameter.setType(readType(element));
  parameter.setCollection(isCollectionType(element));
  parameter.setNullable(Boolean.parseBoolean(attr(element,"String_Node_Str")));
  String maxLength=attr(element,"String_Node_Str");
  if (maxLength != null) {
    parameter.setMaxLength(Integer.parseInt(maxLength));
  }
  String precision=attr(element,"String_Node_Str");
  if (precision != null) {
    parameter.setPrecision(Integer.parseInt(precision));
  }
  String scale=attr(element,"String_Node_Str");
  if (scale != null) {
    parameter.setScale(Integer.parseInt(scale));
  }
  String srid=attr(element,"String_Node_Str");
  if (srid != null) {
  }
  operation.getParameters().add(parameter);
}

Fixed version (ground truth):
private void readParameter(StartElement element,CsdlOperation operation){
  CsdlParameter parameter=new CsdlParameter();
  parameter.setName(attr(element,"String_Node_Str"));
  parameter.setType(readType(element));
  parameter.setCollection(isCollectionType(element));
  parameter.setNullable(Boolean.parseBoolean(attr(element,"String_Node_Str")));
  String maxLength=attr(element,"String_Node_Str");
  if (maxLength != null) {
    parameter.setMaxLength(Integer.parseInt(maxLength));
  }
  String precision=attr(element,"String_Node_Str");
  if (precision != null) {
    parameter.setPrecision(Integer.parseInt(precision));
  }
  String scale=attr(element,"String_Node_Str");
  if (scale != null) {
    parameter.setScale(Integer.parseInt(scale));
  }
  String srid=attr(element,"String_Node_Str");
  if (srid != null) {
    parameter.setSrid(SRID.valueOf(srid));
  }
  operation.getParameters().add(parameter);
}
Program: 33215
Project: 33215
Buggy source:
public CsdlEdmProvider buildEdmProvider(Reader csdl) throws XMLStreamException {
  XMLInputFactory xmlInputFactory=XMLInputFactory.newInstance();
  XMLEventReader reader=xmlInputFactory.createXMLEventReader(csdl);
  SchemaBasedEdmProvider provider=new SchemaBasedEdmProvider();
  new ElementReader<SchemaBasedEdmProvider>(){
    @Override void build(    XMLEventReader reader,    StartElement element,    SchemaBasedEdmProvider provider,    String name) throws XMLStreamException {
      String version=attr(element,"String_Node_Str");
      if (version.equals("String_Node_Str")) {
        readDataServicesAndReference(reader,element,provider);
      }
    }
  }
.read(reader,null,provider,"String_Node_Str");
  return provider;
}

Fixed version (ground truth):
public CsdlEdmProvider buildEdmProvider(Reader csdl) throws XMLStreamException {
  XMLInputFactory xmlInputFactory=XMLInputFactory.newInstance();
  XMLEventReader reader=xmlInputFactory.createXMLEventReader(csdl);
  SchemaBasedEdmProvider provider=new SchemaBasedEdmProvider();
  new ElementReader<SchemaBasedEdmProvider>(){
    @Override void build(    XMLEventReader reader,    StartElement element,    SchemaBasedEdmProvider provider,    String name) throws XMLStreamException {
      String version=attr(element,"String_Node_Str");
      if ("String_Node_Str".equals(version)) {
        readDataServicesAndReference(reader,element,provider);
      }
    }
  }
.read(reader,null,provider,"String_Node_Str");
  return provider;
}
Program: 33216
Project: 33216
Buggy source:
private CsdlProperty readProperty(StartElement element){
  CsdlProperty property=new CsdlProperty();
  property.setName(attr(element,"String_Node_Str"));
  property.setType(readType(element));
  property.setCollection(isCollectionType(element));
  property.setNullable(Boolean.parseBoolean(attr(element,"String_Node_Str") == null ? "String_Node_Str" : attr(element,"String_Node_Str")));
  property.setUnicode(Boolean.parseBoolean(attr(element,"String_Node_Str")));
  String maxLength=attr(element,"String_Node_Str");
  if (maxLength != null) {
    property.setMaxLength(Integer.parseInt(maxLength));
  }
  String precision=attr(element,"String_Node_Str");
  if (precision != null) {
    property.setPrecision(Integer.parseInt(precision));
  }
  String scale=attr(element,"String_Node_Str");
  if (scale != null) {
    property.setScale(Integer.parseInt(scale));
  }
  String srid=attr(element,"String_Node_Str");
  if (srid != null) {
  }
  String defaultValue=attr(element,"String_Node_Str");
  if (defaultValue != null) {
    property.setDefaultValue(defaultValue);
  }
  return property;
}

Fixed version (ground truth):
private CsdlProperty readProperty(StartElement element){
  CsdlProperty property=new CsdlProperty();
  property.setName(attr(element,"String_Node_Str"));
  property.setType(readType(element));
  property.setCollection(isCollectionType(element));
  property.setNullable(Boolean.parseBoolean(attr(element,"String_Node_Str") == null ? "String_Node_Str" : attr(element,"String_Node_Str")));
  property.setUnicode(Boolean.parseBoolean(attr(element,"String_Node_Str")));
  String maxLength=attr(element,"String_Node_Str");
  if (maxLength != null) {
    property.setMaxLength(Integer.parseInt(maxLength));
  }
  String precision=attr(element,"String_Node_Str");
  if (precision != null) {
    property.setPrecision(Integer.parseInt(precision));
  }
  String scale=attr(element,"String_Node_Str");
  if (scale != null) {
    property.setScale(Integer.parseInt(scale));
  }
  String srid=attr(element,"String_Node_Str");
  if (srid != null) {
    property.setSrid(SRID.valueOf(srid));
  }
  String defaultValue=attr(element,"String_Node_Str");
  if (defaultValue != null) {
    property.setDefaultValue(defaultValue);
  }
  return property;
}
Program: 33218
Project: 33218
Buggy source:
private CsdlTypeDefinition readTypeDefinition(StartElement element){
  CsdlTypeDefinition td=new CsdlTypeDefinition();
  td.setName(attr(element,"String_Node_Str"));
  td.setUnderlyingType(new FullQualifiedName(attr(element,"String_Node_Str")));
  td.setUnicode(Boolean.parseBoolean(attr(element,"String_Node_Str")));
  String maxLength=attr(element,"String_Node_Str");
  if (maxLength != null) {
    td.setMaxLength(Integer.parseInt(maxLength));
  }
  String precision=attr(element,"String_Node_Str");
  if (precision != null) {
    td.setPrecision(Integer.parseInt(precision));
  }
  String scale=attr(element,"String_Node_Str");
  if (scale != null) {
    td.setScale(Integer.parseInt(scale));
  }
  String srid=attr(element,"String_Node_Str");
  if (srid != null) {
  }
  return td;
}

Fixed version (ground truth):
private CsdlTypeDefinition readTypeDefinition(StartElement element){
  CsdlTypeDefinition td=new CsdlTypeDefinition();
  td.setName(attr(element,"String_Node_Str"));
  td.setUnderlyingType(new FullQualifiedName(attr(element,"String_Node_Str")));
  td.setUnicode(Boolean.parseBoolean(attr(element,"String_Node_Str")));
  String maxLength=attr(element,"String_Node_Str");
  if (maxLength != null) {
    td.setMaxLength(Integer.parseInt(maxLength));
  }
  String precision=attr(element,"String_Node_Str");
  if (precision != null) {
    td.setPrecision(Integer.parseInt(precision));
  }
  String scale=attr(element,"String_Node_Str");
  if (scale != null) {
    td.setScale(Integer.parseInt(scale));
  }
  String srid=attr(element,"String_Node_Str");
  if (srid != null) {
    td.setSrid(SRID.valueOf(srid));
  }
  return td;
}
Program: 33219
Project: 33219
Buggy source:
private void readReturnType(StartElement element,CsdlOperation operation){
  CsdlReturnType returnType=new CsdlReturnType();
  returnType.setType(readType(element));
  returnType.setCollection(isCollectionType(element));
  returnType.setNullable(Boolean.parseBoolean(attr(element,"String_Node_Str")));
  String maxLength=attr(element,"String_Node_Str");
  if (maxLength != null) {
    returnType.setMaxLength(Integer.parseInt(maxLength));
  }
  String precision=attr(element,"String_Node_Str");
  if (precision != null) {
    returnType.setPrecision(Integer.parseInt(precision));
  }
  String scale=attr(element,"String_Node_Str");
  if (scale != null) {
    returnType.setScale(Integer.parseInt(scale));
  }
  String srid=attr(element,"String_Node_Str");
  if (srid != null) {
  }
  operation.setReturnType(returnType);
}

Fixed version (ground truth):
private void readReturnType(StartElement element,CsdlOperation operation){
  CsdlReturnType returnType=new CsdlReturnType();
  returnType.setType(readType(element));
  returnType.setCollection(isCollectionType(element));
  returnType.setNullable(Boolean.parseBoolean(attr(element,"String_Node_Str")));
  String maxLength=attr(element,"String_Node_Str");
  if (maxLength != null) {
    returnType.setMaxLength(Integer.parseInt(maxLength));
  }
  String precision=attr(element,"String_Node_Str");
  if (precision != null) {
    returnType.setPrecision(Integer.parseInt(precision));
  }
  String scale=attr(element,"String_Node_Str");
  if (scale != null) {
    returnType.setScale(Integer.parseInt(scale));
  }
  String srid=attr(element,"String_Node_Str");
  if (srid != null) {
    returnType.setSrid(SRID.valueOf(srid));
  }
  operation.setReturnType(returnType);
}
Program: 33220
Project: 33220
Buggy source:
private void readNavigationPropertyBindings(XMLEventReader reader,StartElement element,List<CsdlNavigationPropertyBinding> bindings) throws XMLStreamException {
  new ElementReader<List<CsdlNavigationPropertyBinding>>(){
    @Override void build(    XMLEventReader reader,    StartElement element,    List<CsdlNavigationPropertyBinding> bindings,    String name) throws XMLStreamException {
      CsdlNavigationPropertyBinding binding=new CsdlNavigationPropertyBinding();
      binding.setPath(attr(element,"String_Node_Str"));
      binding.setTarget(attr(element,"String_Node_Str"));
      bindings.add(binding);
    }
  }
.read(reader,element,bindings,"String_Node_Str");
  ;
}

Fixed version (ground truth):
private void readNavigationPropertyBindings(XMLEventReader reader,StartElement element,List<CsdlNavigationPropertyBinding> bindings) throws XMLStreamException {
  new ElementReader<List<CsdlNavigationPropertyBinding>>(){
    @Override void build(    XMLEventReader reader,    StartElement element,    List<CsdlNavigationPropertyBinding> bindings,    String name) throws XMLStreamException {
      CsdlNavigationPropertyBinding binding=new CsdlNavigationPropertyBinding();
      binding.setPath(attr(element,"String_Node_Str"));
      binding.setTarget(attr(element,"String_Node_Str"));
      bindings.add(binding);
    }
  }
.read(reader,element,bindings,"String_Node_Str");
}
Program: 33221
Project: 33221
Buggy source:
void read(XMLEventReader reader,StartElement element,T t,String... names) throws XMLStreamException {
  while (reader.hasNext()) {
    XMLEvent event=reader.peek();
    event=skipAnnotations(reader,event);
    if (!event.isStartElement() && !event.isEndElement()) {
      reader.nextEvent();
      continue;
    }
    boolean hit=false;
    for (int i=0; i < names.length; i++) {
      if (event.isStartElement()) {
        element=event.asStartElement();
        if (element.getName().getLocalPart().equals(names[i])) {
          reader.nextEvent();
          build(reader,element,t,names[i]);
          hit=true;
        }
      }
      if (event.isEndElement()) {
        EndElement e=event.asEndElement();
        if (e.getName().getLocalPart().equals(names[i])) {
          reader.nextEvent();
          hit=true;
        }
      }
    }
    if (!hit) {
      break;
    }
  }
}

Fixed version (ground truth):
void read(XMLEventReader reader,StartElement element,T t,String... names) throws XMLStreamException {
  while (reader.hasNext()) {
    XMLEvent event=reader.peek();
    event=skipAnnotations(reader,event);
    if (!event.isStartElement() && !event.isEndElement()) {
      reader.nextEvent();
      continue;
    }
    boolean hit=false;
    for (    String name : names) {
      if (event.isStartElement()) {
        element=event.asStartElement();
        if (element.getName().getLocalPart().equals(name)) {
          reader.nextEvent();
          build(reader,element,t,name);
          hit=true;
        }
      }
      if (event.isEndElement()) {
        EndElement e=event.asEndElement();
        if (e.getName().getLocalPart().equals(name)) {
          reader.nextEvent();
          hit=true;
        }
      }
    }
    if (!hit) {
      break;
    }
  }
}
Program: 33222
Project: 33222
Buggy source:
private CsdlTerm readTerm(StartElement element){
  CsdlTerm term=new CsdlTerm();
  term.setName(attr(element,"String_Node_Str"));
  term.setType(attr(element,"String_Node_Str"));
  if (attr(element,"String_Node_Str") != null) {
    term.setBaseTerm(attr(element,"String_Node_Str"));
  }
  if (attr(element,"String_Node_Str") != null) {
    term.setDefaultValue(attr(element,"String_Node_Str"));
  }
  if (attr(element,"String_Node_Str") != null) {
    term.setAppliesTo(Arrays.asList(attr(element,"String_Node_Str")));
  }
  term.setNullable(Boolean.parseBoolean(attr(element,"String_Node_Str")));
  String maxLength=attr(element,"String_Node_Str");
  if (maxLength != null) {
    term.setMaxLength(Integer.parseInt(maxLength));
  }
  String precision=attr(element,"String_Node_Str");
  if (precision != null) {
    term.setPrecision(Integer.parseInt(precision));
  }
  String scale=attr(element,"String_Node_Str");
  if (scale != null) {
    term.setScale(Integer.parseInt(scale));
  }
  String srid=attr(element,"String_Node_Str");
  if (srid != null) {
  }
  return term;
}

Fixed version (ground truth):
private CsdlTerm readTerm(StartElement element){
  CsdlTerm term=new CsdlTerm();
  term.setName(attr(element,"String_Node_Str"));
  term.setType(attr(element,"String_Node_Str"));
  if (attr(element,"String_Node_Str") != null) {
    term.setBaseTerm(attr(element,"String_Node_Str"));
  }
  if (attr(element,"String_Node_Str") != null) {
    term.setDefaultValue(attr(element,"String_Node_Str"));
  }
  if (attr(element,"String_Node_Str") != null) {
    term.setAppliesTo(Collections.singletonList(attr(element,"String_Node_Str")));
  }
  term.setNullable(Boolean.parseBoolean(attr(element,"String_Node_Str")));
  String maxLength=attr(element,"String_Node_Str");
  if (maxLength != null) {
    term.setMaxLength(Integer.parseInt(maxLength));
  }
  String precision=attr(element,"String_Node_Str");
  if (precision != null) {
    term.setPrecision(Integer.parseInt(precision));
  }
  String scale=attr(element,"String_Node_Str");
  if (scale != null) {
    term.setScale(Integer.parseInt(scale));
  }
  String srid=attr(element,"String_Node_Str");
  if (srid != null) {
    term.setSrid(SRID.valueOf(srid));
  }
  return term;
}
Program: 33223
Project: 33223
Buggy source:
private boolean isCollectionType(StartElement element){
  String type=attr(element,"String_Node_Str");
  if (type.startsWith("String_Node_Str") && type.endsWith("String_Node_Str")) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean isCollectionType(StartElement element){
  String type=attr(element,"String_Node_Str");
  if (type != null && type.startsWith("String_Node_Str") && type.endsWith("String_Node_Str")) {
    return true;
  }
  return false;
}
Program: 33224
Project: 33224
Buggy source:
private FullQualifiedName readType(StartElement element){
  String type=attr(element,"String_Node_Str");
  if (type.startsWith("String_Node_Str") && type.endsWith("String_Node_Str")) {
    return new FullQualifiedName(type.substring(11,type.length() - 1));
  }
  return new FullQualifiedName(type);
}

Fixed version (ground truth):
private FullQualifiedName readType(StartElement element){
  String type=attr(element,"String_Node_Str");
  if (type != null && type.startsWith("String_Node_Str") && type.endsWith("String_Node_Str")) {
    return new FullQualifiedName(type.substring(11,type.length() - 1));
  }
  return new FullQualifiedName(type);
}
Program: 33225
Project: 33225
Buggy source:
private void readSchemaContents(XMLEventReader reader,CsdlSchema schema) throws XMLStreamException {
  new ElementReader<CsdlSchema>(){
    @Override void build(    XMLEventReader reader,    StartElement element,    CsdlSchema schema,    String name) throws XMLStreamException {
      if (name.equals("String_Node_Str")) {
        readAction(reader,element,schema);
      }
 else       if (name.equals("String_Node_Str")) {
      }
 else       if (name.equals("String_Node_Str")) {
      }
 else       if (name.equals("String_Node_Str")) {
        readComplexType(reader,element,schema);
      }
 else       if (name.equals("String_Node_Str")) {
        readEntityContainer(reader,element,schema);
      }
 else       if (name.equals("String_Node_Str")) {
        readEntityType(reader,element,schema);
      }
 else       if (name.equals("String_Node_Str")) {
        readEnumType(reader,element,schema);
      }
 else       if (name.equals("String_Node_Str")) {
        readFunction(reader,element,schema);
      }
 else       if (name.equals("String_Node_Str")) {
        schema.getTerms().add(readTerm(element));
      }
 else       if (name.equals("String_Node_Str")) {
        schema.getTypeDefinitions().add(readTypeDefinition(element));
      }
    }
  }
.read(reader,null,schema,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
private void readSchemaContents(XMLEventReader reader,CsdlSchema schema) throws XMLStreamException {
  new ElementReader<CsdlSchema>(){
    @Override void build(    XMLEventReader reader,    StartElement element,    CsdlSchema schema,    String name) throws XMLStreamException {
      if (name.equals("String_Node_Str")) {
        readAction(reader,element,schema);
      }
 else       if (name.equals("String_Node_Str")) {
        readComplexType(reader,element,schema);
      }
 else       if (name.equals("String_Node_Str")) {
        readEntityContainer(reader,element,schema);
      }
 else       if (name.equals("String_Node_Str")) {
        readEntityType(reader,element,schema);
      }
 else       if (name.equals("String_Node_Str")) {
        readEnumType(reader,element,schema);
      }
 else       if (name.equals("String_Node_Str")) {
        readFunction(reader,element,schema);
      }
 else       if (name.equals("String_Node_Str")) {
        schema.getTerms().add(readTerm(element));
      }
 else       if (name.equals("String_Node_Str")) {
        schema.getTypeDefinitions().add(readTypeDefinition(element));
      }
    }
  }
.read(reader,null,schema,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 33226
Project: 33226
Buggy source:
protected void writePrimitiveValue(final EdmPrimitiveType type,final Object primitiveValue,final Boolean isNullable,final Integer maxLength,final Integer precision,final Integer scale,final Boolean isUnicode,final XMLStreamWriter writer) throws EdmPrimitiveTypeException, XMLStreamException {
  final String value=type.valueToString(primitiveValue,isNullable,maxLength,precision,scale,isUnicode);
  if (value == null) {
    writer.writeAttribute(DATA,NS_DATA,"String_Node_Str","String_Node_Str");
  }
 else   if (type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Byte) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Boolean) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Decimal) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Double) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Int16) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Int32) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Int64) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.SByte) || type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Single)) {
    writer.writeCharacters(value);
  }
 else {
    writer.writeCharacters(value);
  }
}

Fixed version (ground truth):
protected void writePrimitiveValue(final EdmPrimitiveType type,final Object primitiveValue,final Boolean isNullable,final Integer maxLength,final Integer precision,final Integer scale,final Boolean isUnicode,final XMLStreamWriter writer) throws EdmPrimitiveTypeException, XMLStreamException {
  final String value=type.valueToString(primitiveValue,isNullable,maxLength,precision,scale,isUnicode);
  if (value == null) {
    writer.writeAttribute(DATA,NS_DATA,"String_Node_Str","String_Node_Str");
  }
 else {
    writer.writeCharacters(value);
  }
}
Program: 33227
Project: 33227
Buggy source:
@Override public Object invoke(Object o,Method method,Object[] objects) throws Throwable {
  if (Processor.class.isAssignableFrom(method.getDeclaringClass())) {
    invokeMethod=method;
    invokeParameters=objects;
  }
 else {
    throw new ODataRuntimeException("String_Node_Str" + method.getDeclaringClass() + "String_Node_Str");
  }
  return null;
}

Fixed version (ground truth):
@Override public Object invoke(Object o,Method method,Object[] objects) throws Throwable {
  if (Processor.class.isAssignableFrom(method.getDeclaringClass())) {
    invokeMethod=method;
    invokeParameters=Arrays.copyOf(objects,objects.length);
  }
 else {
    throw new ODataRuntimeException("String_Node_Str" + method.getDeclaringClass() + "String_Node_Str");
  }
  return null;
}
Program: 33228
Project: 33228
Buggy source:
/** 
 * parameters: primitive-type name, value 
 */
@Override public String getKey(){
  return name();
}

Fixed version (ground truth):
/** 
 * parameter: encoding-name 
 */
@Override public String getKey(){
  return name();
}
Program: 33229
Project: 33229
Buggy source:
private void handleResourceDispatching(final ODataRequest request,final ODataResponse response) throws ODataApplicationException, ODataLibraryException {
  final int lastPathSegmentIndex=uriInfo.getUriResourceParts().size() - 1;
  final UriResource lastPathSegment=uriInfo.getUriResourceParts().get(lastPathSegmentIndex);
switch (lastPathSegment.getKind()) {
case action:
    checkMethod(request.getMethod(),HttpMethod.POST);
  handleActionDispatching(request,response,(UriResourceAction)lastPathSegment);
break;
case function:
checkMethod(request.getMethod(),HttpMethod.GET);
handleFunctionDispatching(request,response,(UriResourceFunction)lastPathSegment);
break;
case entitySet:
case navigationProperty:
handleEntityDispatching(request,response,((UriResourcePartTyped)lastPathSegment).isCollection(),isMedia(lastPathSegment));
break;
case count:
checkMethod(request.getMethod(),HttpMethod.GET);
handleCountDispatching(request,response,lastPathSegmentIndex);
break;
case primitiveProperty:
handlePrimitiveDispatching(request,response,((UriResourceProperty)lastPathSegment).isCollection());
break;
case complexProperty:
handleComplexDispatching(request,response,((UriResourceProperty)lastPathSegment).isCollection());
break;
case value:
handleValueDispatching(request,response,lastPathSegmentIndex);
break;
case ref:
handleReferenceDispatching(request,response,lastPathSegmentIndex);
break;
default :
throw new ODataHandlerException("String_Node_Str",ODataHandlerException.MessageKeys.FUNCTIONALITY_NOT_IMPLEMENTED);
}
}

Fixed version (ground truth):
private void handleResourceDispatching(final ODataRequest request,final ODataResponse response) throws ODataApplicationException, ODataLibraryException {
  final int lastPathSegmentIndex=uriInfo.getUriResourceParts().size() - 1;
  final UriResource lastPathSegment=uriInfo.getUriResourceParts().get(lastPathSegmentIndex);
switch (lastPathSegment.getKind()) {
case action:
    checkMethod(request.getMethod(),HttpMethod.POST);
  handleActionDispatching(request,response,(UriResourceAction)lastPathSegment);
break;
case function:
checkMethod(request.getMethod(),HttpMethod.GET);
handleFunctionDispatching(request,response,(UriResourceFunction)lastPathSegment);
break;
case entitySet:
case navigationProperty:
handleEntityDispatching(request,response,((UriResourcePartTyped)lastPathSegment).isCollection(),isMedia(lastPathSegment));
break;
case count:
checkMethod(request.getMethod(),HttpMethod.GET);
handleCountDispatching(request,response,lastPathSegmentIndex);
break;
case primitiveProperty:
handlePrimitiveDispatching(request,response,((UriResourceProperty)lastPathSegment).isCollection());
break;
case complexProperty:
handleComplexDispatching(request,response,((UriResourceProperty)lastPathSegment).isCollection());
break;
case value:
handleValueDispatching(request,response,lastPathSegmentIndex);
break;
case ref:
handleReferenceDispatching(request,response,lastPathSegmentIndex);
break;
default :
throw new ODataHandlerException(NOT_IMPLEMENTED_MESSAGE,ODataHandlerException.MessageKeys.FUNCTIONALITY_NOT_IMPLEMENTED);
}
}
Program: 33230
Project: 33230
Buggy source:
private void handleFunctionDispatching(final ODataRequest request,final ODataResponse response,final UriResourceFunction uriResourceFunction) throws ODataApplicationException, ODataLibraryException {
  EdmFunction function=uriResourceFunction.getFunction();
  if (function == null) {
    function=uriResourceFunction.getFunctionImport().getUnboundFunctions().get(0);
  }
  final EdmReturnType returnType=function.getReturnType();
switch (returnType.getType().getKind()) {
case ENTITY:
    handleEntityDispatching(request,response,returnType.isCollection() && uriResourceFunction.getKeyPredicates().isEmpty(),false);
  break;
case PRIMITIVE:
handlePrimitiveDispatching(request,response,returnType.isCollection());
break;
case COMPLEX:
handleComplexDispatching(request,response,returnType.isCollection());
break;
default :
throw new ODataHandlerException("String_Node_Str",ODataHandlerException.MessageKeys.FUNCTIONALITY_NOT_IMPLEMENTED);
}
}

Fixed version (ground truth):
private void handleFunctionDispatching(final ODataRequest request,final ODataResponse response,final UriResourceFunction uriResourceFunction) throws ODataApplicationException, ODataLibraryException {
  EdmFunction function=uriResourceFunction.getFunction();
  if (function == null) {
    function=uriResourceFunction.getFunctionImport().getUnboundFunctions().get(0);
  }
  final EdmReturnType returnType=function.getReturnType();
switch (returnType.getType().getKind()) {
case ENTITY:
    handleEntityDispatching(request,response,returnType.isCollection() && uriResourceFunction.getKeyPredicates().isEmpty(),false);
  break;
case PRIMITIVE:
handlePrimitiveDispatching(request,response,returnType.isCollection());
break;
case COMPLEX:
handleComplexDispatching(request,response,returnType.isCollection());
break;
default :
throw new ODataHandlerException(NOT_IMPLEMENTED_MESSAGE,ODataHandlerException.MessageKeys.FUNCTIONALITY_NOT_IMPLEMENTED);
}
}
Program: 33231
Project: 33231
Buggy source:
public void dispatch(ODataRequest request,ODataResponse response) throws ODataApplicationException, ODataLibraryException {
switch (uriInfo.getKind()) {
case metadata:
    checkMethod(method,HttpMethod.GET);
  final ContentType requestedContentType=ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),request,handler.getCustomContentTypeSupport(),RepresentationType.METADATA);
handler.selectProcessor(MetadataProcessor.class).readMetadata(request,response,uriInfo,requestedContentType);
break;
case service:
checkMethod(method,HttpMethod.GET);
if ("String_Node_Str".equals(request.getRawODataPath())) {
handler.selectProcessor(RedirectProcessor.class).redirect(request,response);
}
 else {
final ContentType serviceContentType=ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),request,handler.getCustomContentTypeSupport(),RepresentationType.SERVICE);
handler.selectProcessor(ServiceDocumentProcessor.class).readServiceDocument(request,response,uriInfo,serviceContentType);
}
break;
case resource:
handleResourceDispatching(request,response);
break;
case batch:
checkMethod(method,HttpMethod.POST);
new BatchHandler(handler,handler.selectProcessor(BatchProcessor.class)).process(request,response,true);
break;
default :
throw new ODataHandlerException("String_Node_Str",ODataHandlerException.MessageKeys.FUNCTIONALITY_NOT_IMPLEMENTED);
}
}

Fixed version (ground truth):
public void dispatch(ODataRequest request,ODataResponse response) throws ODataApplicationException, ODataLibraryException {
switch (uriInfo.getKind()) {
case metadata:
    checkMethod(request.getMethod(),HttpMethod.GET);
  final ContentType requestedContentType=ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),request,handler.getCustomContentTypeSupport(),RepresentationType.METADATA);
handler.selectProcessor(MetadataProcessor.class).readMetadata(request,response,uriInfo,requestedContentType);
break;
case service:
checkMethod(request.getMethod(),HttpMethod.GET);
if ("String_Node_Str".equals(request.getRawODataPath())) {
handler.selectProcessor(RedirectProcessor.class).redirect(request,response);
}
 else {
final ContentType serviceContentType=ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),request,handler.getCustomContentTypeSupport(),RepresentationType.SERVICE);
handler.selectProcessor(ServiceDocumentProcessor.class).readServiceDocument(request,response,uriInfo,serviceContentType);
}
break;
case resource:
handleResourceDispatching(request,response);
break;
case batch:
checkMethod(request.getMethod(),HttpMethod.POST);
new BatchHandler(handler,handler.selectProcessor(BatchProcessor.class)).process(request,response,true);
break;
default :
throw new ODataHandlerException(NOT_IMPLEMENTED_MESSAGE,ODataHandlerException.MessageKeys.FUNCTIONALITY_NOT_IMPLEMENTED);
}
}
Program: 33234
Project: 33234
Buggy source:
private void checkMethod(final HttpMethod requestMethod,final HttpMethod allowedMethod) throws ODataHandlerException {
  if (requestMethod != allowedMethod) {
    throw new ODataHandlerException("String_Node_Str" + requestMethod + "String_Node_Str",ODataHandlerException.MessageKeys.HTTP_METHOD_NOT_ALLOWED,requestMethod.toString());
  }
}

Fixed version (ground truth):
private void checkMethod(final HttpMethod requestMethod,final HttpMethod allowedMethod) throws ODataHandlerException {
  if (requestMethod != allowedMethod) {
    throw new ODataHandlerException(getMethodNotAllowedStringMessage(requestMethod),ODataHandlerException.MessageKeys.HTTP_METHOD_NOT_ALLOWED,requestMethod.toString());
  }
}
Program: 33239
Project: 33239
Buggy source:
public ODataDispatcher(HttpMethod method,UriInfo uriInfo,ODataHandler handler){
  this.method=method;
  this.uriInfo=uriInfo;
  this.handler=handler;
}

Fixed version (ground truth):
public ODataDispatcher(UriInfo uriInfo,ODataHandler handler){
  this.uriInfo=uriInfo;
  this.handler=handler;
}
Program: 33240
Project: 33240
Buggy source:
private void validateODataVersion(final ODataRequest request) throws ODataHandlerException {
  final String maxVersion=request.getHeader(HttpHeader.ODATA_MAX_VERSION);
  if (maxVersion != null) {
    if (ODataServiceVersion.isBiggerThan(ODataServiceVersion.V40.toString(),maxVersion)) {
      throw new ODataHandlerException("String_Node_Str" + maxVersion,ODataHandlerException.MessageKeys.ODATA_VERSION_NOT_SUPPORTED,maxVersion);
    }
  }
}

Fixed version (ground truth):
private void validateODataVersion(final ODataRequest request) throws ODataHandlerException {
  final String maxVersion=request.getHeader(HttpHeader.ODATA_MAX_VERSION);
  if (maxVersion != null && ODataServiceVersion.isBiggerThan(ODataServiceVersion.V40.toString(),maxVersion)) {
    throw new ODataHandlerException("String_Node_Str" + maxVersion,ODataHandlerException.MessageKeys.ODATA_VERSION_NOT_SUPPORTED,maxVersion);
  }
}
Program: 33241
Project: 33241
Buggy source:
private void processInternal(final ODataRequest request,final ODataResponse response) throws ODataApplicationException, ODataLibraryException {
  response.setHeader(HttpHeader.ODATA_VERSION,ODataServiceVersion.V40.toString());
  validateODataVersion(request);
  int measurementUriParser=debugger.startRuntimeMeasurement("String_Node_Str","String_Node_Str");
  uriInfo=new Parser().parseUri(request.getRawODataPath(),request.getRawQueryPath(),null,serviceMetadata.getEdm());
  debugger.stopRuntimeMeasurement(measurementUriParser);
  int measurementUriValidator=debugger.startRuntimeMeasurement("String_Node_Str","String_Node_Str");
  final HttpMethod method=request.getMethod();
  new UriValidator().validate(uriInfo,method);
  debugger.stopRuntimeMeasurement(measurementUriValidator);
  int measurementDispatcher=debugger.startRuntimeMeasurement("String_Node_Str","String_Node_Str");
  new ODataDispatcher(method,uriInfo,this).dispatch(request,response);
  debugger.stopRuntimeMeasurement(measurementDispatcher);
}

Fixed version (ground truth):
private void processInternal(final ODataRequest request,final ODataResponse response) throws ODataApplicationException, ODataLibraryException {
  response.setHeader(HttpHeader.ODATA_VERSION,ODataServiceVersion.V40.toString());
  validateODataVersion(request);
  int measurementUriParser=debugger.startRuntimeMeasurement("String_Node_Str","String_Node_Str");
  uriInfo=new Parser().parseUri(request.getRawODataPath(),request.getRawQueryPath(),null,serviceMetadata.getEdm());
  debugger.stopRuntimeMeasurement(measurementUriParser);
  int measurementUriValidator=debugger.startRuntimeMeasurement("String_Node_Str","String_Node_Str");
  final HttpMethod method=request.getMethod();
  new UriValidator().validate(uriInfo,method);
  debugger.stopRuntimeMeasurement(measurementUriValidator);
  int measurementDispatcher=debugger.startRuntimeMeasurement("String_Node_Str","String_Node_Str");
  new ODataDispatcher(uriInfo,this).dispatch(request,response);
  debugger.stopRuntimeMeasurement(measurementDispatcher);
}
Program: 33242
Project: 33242
Buggy source:
public ODataHandlerException(final String developmentMessage,final MessageKey messageKey,final String... parameters){
  super(developmentMessage,messageKey,parameters);
}

Fixed version (ground truth):
public ODataHandlerException(final String developmentMessage,final Throwable cause,final MessageKey messageKey,final String... parameters){
  super(developmentMessage,cause,messageKey,parameters);
}
Program: 33243
Project: 33243
Buggy source:
static HttpMethod extractMethod(final HttpServletRequest httpRequest) throws ODataLibraryException {
  try {
    HttpMethod httpRequestMethod=HttpMethod.valueOf(httpRequest.getMethod());
    if (httpRequestMethod == HttpMethod.POST) {
      String xHttpMethod=httpRequest.getHeader(HttpHeader.X_HTTP_METHOD);
      String xHttpMethodOverride=httpRequest.getHeader(HttpHeader.X_HTTP_METHOD_OVERRIDE);
      if (xHttpMethod == null && xHttpMethodOverride == null) {
        return httpRequestMethod;
      }
 else       if (xHttpMethod == null) {
        return HttpMethod.valueOf(xHttpMethodOverride);
      }
 else       if (xHttpMethodOverride == null) {
        return HttpMethod.valueOf(xHttpMethod);
      }
 else {
        if (!xHttpMethod.equalsIgnoreCase(xHttpMethodOverride)) {
          throw new ODataHandlerException("String_Node_Str",ODataHandlerException.MessageKeys.AMBIGUOUS_XHTTP_METHOD,xHttpMethod,xHttpMethodOverride);
        }
        return HttpMethod.valueOf(xHttpMethod);
      }
    }
 else {
      return httpRequestMethod;
    }
  }
 catch (  IllegalArgumentException e) {
    throw new ODataHandlerException("String_Node_Str" + httpRequest.getMethod(),ODataHandlerException.MessageKeys.INVALID_HTTP_METHOD,httpRequest.getMethod());
  }
}

Fixed version (ground truth):
static HttpMethod extractMethod(final HttpServletRequest httpRequest) throws ODataLibraryException {
  try {
    HttpMethod httpRequestMethod=HttpMethod.valueOf(httpRequest.getMethod());
    if (httpRequestMethod == HttpMethod.POST) {
      String xHttpMethod=httpRequest.getHeader(HttpHeader.X_HTTP_METHOD);
      String xHttpMethodOverride=httpRequest.getHeader(HttpHeader.X_HTTP_METHOD_OVERRIDE);
      if (xHttpMethod == null && xHttpMethodOverride == null) {
        return httpRequestMethod;
      }
 else       if (xHttpMethod == null) {
        return HttpMethod.valueOf(xHttpMethodOverride);
      }
 else       if (xHttpMethodOverride == null) {
        return HttpMethod.valueOf(xHttpMethod);
      }
 else {
        if (!xHttpMethod.equalsIgnoreCase(xHttpMethodOverride)) {
          throw new ODataHandlerException("String_Node_Str",ODataHandlerException.MessageKeys.AMBIGUOUS_XHTTP_METHOD,xHttpMethod,xHttpMethodOverride);
        }
        return HttpMethod.valueOf(xHttpMethod);
      }
    }
 else {
      return httpRequestMethod;
    }
  }
 catch (  IllegalArgumentException e) {
    throw new ODataHandlerException("String_Node_Str" + httpRequest.getMethod(),e,ODataHandlerException.MessageKeys.INVALID_HTTP_METHOD,httpRequest.getMethod());
  }
}
Program: 33244
Project: 33244
Buggy source:
protected static void appendHtmlTable(final Writer writer,final Map<String,String> entries) throws IOException {
  writer.append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
  for (  final String name : entries.keySet()) {
    final String value=entries.get(name);
    writer.append("String_Node_Str").append(name).append("String_Node_Str").append("String_Node_Str");
    if (value != null) {
      writer.append(escapeHtml(value));
    }
 else {
      writer.append("String_Node_Str");
    }
    writer.append("String_Node_Str");
  }
  writer.append("String_Node_Str");
}

Fixed version (ground truth):
protected static void appendHtmlTable(final Writer writer,final Map<String,String> entries) throws IOException {
  writer.append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
  for (  final Entry<String,String> entry : entries.entrySet()) {
    writer.append("String_Node_Str").append(entry.getKey()).append("String_Node_Str").append("String_Node_Str");
    if (entry.getValue() != null) {
      writer.append(escapeHtml(entry.getValue()));
    }
 else {
      writer.append("String_Node_Str");
    }
    writer.append("String_Node_Str");
  }
  writer.append("String_Node_Str");
}
Program: 33245
Project: 33245
Buggy source:
private InputStream wrapInJson(final List<DebugTab> parts) throws IOException {
  IOException cachedException=null;
  OutputStream outputStream=null;
  try {
    CircleStreamBuffer csb=new CircleStreamBuffer();
    outputStream=csb.getOutputStream();
    JsonGenerator gen=new JsonFactory().createGenerator(outputStream,JsonEncoding.UTF8);
    gen.writeStartObject();
    DebugTab requestInfo=parts.get(0);
    gen.writeFieldName(requestInfo.getName().toLowerCase(Locale.ROOT));
    requestInfo.appendJson(gen);
    DebugTab responseInfo=parts.get(1);
    gen.writeFieldName(responseInfo.getName().toLowerCase(Locale.ROOT));
    responseInfo.appendJson(gen);
    gen.writeFieldName("String_Node_Str");
    gen.writeStartObject();
    gen.writeStringField("String_Node_Str",getVersion());
    for (    DebugTab part : parts.subList(2,parts.size())) {
      gen.writeFieldName(part.getName().toLowerCase(Locale.ROOT));
      part.appendJson(gen);
    }
    gen.writeEndObject();
    gen.writeEndObject();
    gen.close();
    outputStream.close();
    return csb.getInputStream();
  }
 catch (  IOException e) {
    throw e;
  }
 finally {
    if (outputStream != null) {
      try {
        outputStream.close();
      }
 catch (      IOException e) {
        if (cachedException != null) {
          throw cachedException;
        }
 else {
          throw e;
        }
      }
    }
  }
}

Fixed version (ground truth):
private InputStream wrapInJson(final List<DebugTab> parts) throws IOException {
  IOException cachedException=null;
  OutputStream outputStream=null;
  try {
    CircleStreamBuffer csb=new CircleStreamBuffer();
    outputStream=csb.getOutputStream();
    JsonGenerator gen=new JsonFactory().createGenerator(outputStream,JsonEncoding.UTF8);
    gen.writeStartObject();
    DebugTab requestInfo=parts.get(0);
    gen.writeFieldName(requestInfo.getName().toLowerCase(Locale.ROOT));
    requestInfo.appendJson(gen);
    DebugTab responseInfo=parts.get(1);
    gen.writeFieldName(responseInfo.getName().toLowerCase(Locale.ROOT));
    responseInfo.appendJson(gen);
    gen.writeFieldName("String_Node_Str");
    gen.writeStartObject();
    gen.writeStringField("String_Node_Str",getVersion());
    for (    DebugTab part : parts.subList(2,parts.size())) {
      gen.writeFieldName(part.getName().toLowerCase(Locale.ROOT));
      part.appendJson(gen);
    }
    gen.writeEndObject();
    gen.writeEndObject();
    gen.close();
    outputStream.close();
    return csb.getInputStream();
  }
  finally {
    if (outputStream != null) {
      try {
        outputStream.close();
      }
 catch (      IOException e) {
        if (cachedException != null) {
          throw cachedException;
        }
 else {
          throw e;
        }
      }
    }
  }
}