nus-yam/ex-repair huggingface dataset:
Program: 33118
Project: 33118
Buggy source:
/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
  setContentView(R.layout.main);
  _openCvCameraView=(JavaCameraView)findViewById(R.id.aav_activity_surface_view);
  _openCvCameraView.setCvCameraViewListener(this);
  _openCvCameraView.setMaxFrameSize(176,144);
  _mainController=new ActuatorController();
  _countOutOfFrame=0;
  PreferenceManager.setDefaultValues(this,R.xml.settings,false);
  sharedPreferences=PreferenceManager.getDefaultSharedPreferences(this);
  trackingColor=Integer.parseInt(sharedPreferences.getString(getString(R.string.color_key),"String_Node_Str"));
  if (trackingColor == 0) {
    _lowerThreshold=new Scalar(60,100,30);
    _upperThreshold=new Scalar(130,255,255);
  }
 else   if (trackingColor == 1) {
    _lowerThreshold=new Scalar(150,100,90);
    _upperThreshold=new Scalar(255,255,290);
  }
 else   if (trackingColor == 1) {
    _lowerThreshold=new Scalar(1,100,100);
    _upperThreshold=new Scalar(30,255,255);
  }
  SensorManager sensorManager=(SensorManager)getSystemService(SENSOR_SERVICE);
  _sensorFusion=new SensorFusion(sensorManager);
  gestureDetector=new GestureDetector(this,new GestureDetector.SimpleOnGestureListener(){
    @Override public void onLongPress(    MotionEvent e){
      startActivityForResult(new Intent(getApplicationContext(),SettingsActivity.class),0);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
  setContentView(R.layout.main);
  PreferenceManager.setDefaultValues(this,R.xml.settings,false);
  sharedPreferences=PreferenceManager.getDefaultSharedPreferences(this);
  trackingColor=Integer.parseInt(sharedPreferences.getString(getString(R.string.color_key),"String_Node_Str"));
  if (trackingColor == 0) {
    _lowerThreshold=new Scalar(60,100,30);
    _upperThreshold=new Scalar(130,255,255);
  }
 else   if (trackingColor == 1) {
    _lowerThreshold=new Scalar(160,90,90);
    _upperThreshold=new Scalar(255,255,255);
  }
 else   if (trackingColor == 2) {
    _lowerThreshold=new Scalar(0,90,90);
    _upperThreshold=new Scalar(100,255,255);
  }
  _openCvCameraView=(JavaCameraView)findViewById(R.id.aav_activity_surface_view);
  _openCvCameraView.setCvCameraViewListener(this);
  _openCvCameraView.setMaxFrameSize(176,144);
  _mainController=new ActuatorController();
  _countOutOfFrame=0;
  SensorManager sensorManager=(SensorManager)getSystemService(SENSOR_SERVICE);
  _sensorFusion=new SensorFusion(sensorManager);
  gestureDetector=new GestureDetector(this,new GestureDetector.SimpleOnGestureListener(){
    @Override public void onLongPress(    MotionEvent e){
      startActivityForResult(new Intent(getApplicationContext(),SettingsActivity.class),0);
    }
  }
);
}
Program: 33119
Project: 33119
Buggy source:
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
  trackingColor=Integer.parseInt(sharedPreferences.getString(getString(R.string.color_key),"String_Node_Str"));
switch (trackingColor) {
case 0:
    _lowerThreshold.set(new double[]{60,100,30,0});
  _upperThreshold.set(new double[]{130,255,255,0});
break;
case 1:
_lowerThreshold.set(new double[]{180,90,90,0});
_upperThreshold.set(new double[]{255,255,255,0});
break;
case 2:
_lowerThreshold.set(new double[]{1,100,100,0});
_upperThreshold.set(new double[]{30,255,255,0});
break;
default :
_lowerThreshold.set(new double[]{60,100,30,0});
_upperThreshold.set(new double[]{130,255,255,0});
break;
}
}

Fixed version (ground truth):
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
  trackingColor=Integer.parseInt(sharedPreferences.getString(getString(R.string.color_key),"String_Node_Str"));
switch (trackingColor) {
case 0:
    _lowerThreshold.set(new double[]{60,100,30,0});
  _upperThreshold.set(new double[]{130,255,255,0});
break;
case 1:
_lowerThreshold.set(new double[]{160,90,90});
_upperThreshold.set(new double[]{255,255,255,0});
break;
case 2:
_lowerThreshold.set(new double[]{0,90,90,0});
_upperThreshold.set(new double[]{100,255,255,0});
break;
default :
_lowerThreshold.set(new double[]{60,100,30,0});
_upperThreshold.set(new double[]{130,255,255,0});
break;
}
}
Program: 33120
Project: 33120
Buggy source:
protected void writeComplexValue(final ServiceMetadata metadata,Property complexProperty,final EdmComplexType type,final List<Property> properties,final Set<List<String>> selectedPaths,final String xml10InvalidCharReplacement,final XMLStreamWriter writer) throws XMLStreamException, SerializerException {
  final EdmComplexType resolvedType=resolveComplexType(metadata,type,complexProperty.getType());
  for (  final String propertyName : resolvedType.getPropertyNames()) {
    final Property property=findProperty(propertyName,properties);
    if (selectedPaths == null || ExpandSelectHelper.isSelected(selectedPaths,propertyName)) {
      writeProperty(metadata,(EdmProperty)resolvedType.getProperty(propertyName),property,selectedPaths == null ? null : ExpandSelectHelper.getReducedSelectedPaths(selectedPaths,propertyName),xml10InvalidCharReplacement,writer);
    }
  }
}

Fixed version (ground truth):
protected void writeComplexValue(final ServiceMetadata metadata,final EdmComplexType type,final List<Property> properties,final Set<List<String>> selectedPaths,final String xml10InvalidCharReplacement,final XMLStreamWriter writer) throws XMLStreamException, SerializerException {
  for (  final String propertyName : type.getPropertyNames()) {
    final Property property=findProperty(propertyName,properties);
    if (selectedPaths == null || ExpandSelectHelper.isSelected(selectedPaths,propertyName)) {
      writeProperty(metadata,(EdmProperty)type.getProperty(propertyName),property,selectedPaths == null ? null : ExpandSelectHelper.getReducedSelectedPaths(selectedPaths,propertyName),xml10InvalidCharReplacement,writer);
    }
  }
}
Program: 33121
Project: 33121
Buggy source:
private void writeComplexCollection(final ServiceMetadata metadata,final EdmComplexType type,final Property property,final Set<List<String>> selectedPaths,final String xml10InvalidCharReplacement,final XMLStreamWriter writer) throws XMLStreamException, SerializerException {
  for (  Object value : property.asCollection()) {
    writer.writeStartElement(METADATA,Constants.ELEM_ELEMENT,NS_METADATA);
    if (derivedComplexType(type,property.getType()) != null) {
      writer.writeAttribute(METADATA,NS_METADATA,Constants.ATTR_TYPE,property.getType());
    }
switch (property.getValueType()) {
case COLLECTION_COMPLEX:
      writeComplexValue(metadata,property,type,((ComplexValue)value).getValue(),selectedPaths,xml10InvalidCharReplacement,writer);
    break;
default :
  throw new SerializerException("String_Node_Str",SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE,property.getName());
}
writer.writeEndElement();
}
}

Fixed version (ground truth):
private void writeComplexCollection(final ServiceMetadata metadata,final EdmComplexType type,final Property property,final Set<List<String>> selectedPaths,final String xml10InvalidCharReplacement,final XMLStreamWriter writer) throws XMLStreamException, SerializerException {
  for (  Object value : property.asCollection()) {
    writer.writeStartElement(METADATA,Constants.ELEM_ELEMENT,NS_METADATA);
    if (derivedComplexType(type,property.getType()) != null) {
      writer.writeAttribute(METADATA,NS_METADATA,Constants.ATTR_TYPE,property.getType());
    }
switch (property.getValueType()) {
case COLLECTION_COMPLEX:
      writeComplexValue(metadata,type,((ComplexValue)value).getValue(),selectedPaths,xml10InvalidCharReplacement,writer);
    break;
default :
  throw new SerializerException("String_Node_Str",SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE,property.getName());
}
writer.writeEndElement();
}
}
Program: 33124
Project: 33124
Buggy source:
private ODataResponse createFailResponse(){
  ODataResponse odResponse=new ODataResponse();
  odResponse.setStatusCode(HttpStatusCode.INTERNAL_SERVER_ERROR.getStatusCode());
  odResponse.setHeader(HttpHeader.CONTENT_TYPE,ContentType.TEXT_PLAIN.toContentTypeString());
  InputStream content=new ByteArrayInputStream("String_Node_Str".getBytes());
  odResponse.setContent(content);
  return odResponse;
}

Fixed version (ground truth):
private ODataResponse createFailResponse(){
  ODataResponse odResponse=new ODataResponse();
  odResponse.setStatusCode(HttpStatusCode.INTERNAL_SERVER_ERROR.getStatusCode());
  odResponse.setHeader(HttpHeader.CONTENT_TYPE,ContentType.TEXT_PLAIN.toContentTypeString());
  InputStream content=new ByteArrayInputStream("String_Node_Str".getBytes(DEFAULT_ENCODING));
  odResponse.setContent(content);
  return odResponse;
}
Program: 33125
Project: 33125
Buggy source:
private List<BatchRequestPart> parse(final InputStream in,final String boundary,final BatchRequestTransformator transformator) throws BatchDeserializerException {
  try {
    return parseBatch(in,boundary,transformator);
  }
 catch (  IOException e) {
    throw new ODataRuntimeException(e);
  }
 finally {
    try {
      in.close();
    }
 catch (    IOException e) {
      throw new ODataRuntimeException(e);
    }
  }
}

Fixed version (ground truth):
private List<BatchRequestPart> parse(final InputStream in,final String boundary,final BatchRequestTransformator transformator) throws BatchDeserializerException {
  try {
    return parseBatch(in,boundary,transformator);
  }
 catch (  IOException e) {
    throw new ODataRuntimeException(e);
  }
}
Program: 33126
Project: 33126
Buggy source:
@Override public Header clone(){
  final Header newInstance=new Header(lineNumber);
  for (  final Map.Entry<String,HeaderField> entries : headers.entrySet()) {
    newInstance.headers.put(entries.getKey(),entries.getValue().clone());
  }
  return newInstance;
}

Fixed version (ground truth):
@Override public Header clone() throws CloneNotSupportedException {
  Header clone=(Header)super.clone();
  clone.lineNumber=lineNumber;
  clone.headers=new HashMap<String,HeaderField>();
  for (  final Map.Entry<String,HeaderField> entries : headers.entrySet()) {
    clone.headers.put(entries.getKey(),entries.getValue().clone());
  }
  return clone;
}
Program: 33127
Project: 33127
Buggy source:
@Override public HeaderField clone(){
  List<String> newValues=new ArrayList<String>(values.size());
  newValues.addAll(values);
  return new HeaderField(fieldName,newValues,lineNumber);
}

Fixed version (ground truth):
@Override public HeaderField clone() throws CloneNotSupportedException {
  HeaderField clone=(HeaderField)super.clone();
  clone.values=new ArrayList<String>(values.size());
  clone.values.addAll(values);
  return clone;
}
Program: 33128
Project: 33128
Buggy source:
public byte[] getContent(){
  return content;
}

Fixed version (ground truth):
private byte[] getContent(){
  return content;
}
Program: 33129
Project: 33129
Buggy source:
public int getLength(){
  return content.length;
}

Fixed version (ground truth):
private int getLength(){
  return content.length;
}
Program: 33130
Project: 33130
Buggy source:
@Test public void deepCopy(){
  Header header=new Header(1);
  header.addHeader(HttpHeader.CONTENT_TYPE,ContentType.MULTIPART_MIXED + "String_Node_Str",1);
  Header copy=header.clone();
  assertEquals(header.getHeaders(HttpHeader.CONTENT_TYPE),copy.getHeaders(HttpHeader.CONTENT_TYPE));
  assertEquals(header.getHeader(HttpHeader.CONTENT_TYPE),copy.getHeader(HttpHeader.CONTENT_TYPE));
  assertEquals(header.getHeaderField(HttpHeader.CONTENT_TYPE),copy.getHeaderField(HttpHeader.CONTENT_TYPE));
  assertTrue(header.getHeaders(HttpHeader.CONTENT_TYPE) != copy.getHeaders(HttpHeader.CONTENT_TYPE));
  assertTrue(header.getHeaderField(HttpHeader.CONTENT_TYPE) != copy.getHeaderField(HttpHeader.CONTENT_TYPE));
}

Fixed version (ground truth):
@Test public void deepCopy() throws Exception {
  Header header=new Header(1);
  header.addHeader(HttpHeader.CONTENT_TYPE,ContentType.MULTIPART_MIXED + "String_Node_Str",1);
  Header copy=header.clone();
  assertEquals(header.getHeaders(HttpHeader.CONTENT_TYPE),copy.getHeaders(HttpHeader.CONTENT_TYPE));
  assertEquals(header.getHeader(HttpHeader.CONTENT_TYPE),copy.getHeader(HttpHeader.CONTENT_TYPE));
  assertEquals(header.getHeaderField(HttpHeader.CONTENT_TYPE),copy.getHeaderField(HttpHeader.CONTENT_TYPE));
  assertTrue(header.getHeaders(HttpHeader.CONTENT_TYPE) != copy.getHeaders(HttpHeader.CONTENT_TYPE));
  assertTrue(header.getHeaderField(HttpHeader.CONTENT_TYPE) != copy.getHeaderField(HttpHeader.CONTENT_TYPE));
}
Program: 33131
Project: 33131
Buggy source:
@Test public void applicationExceptionInProcessorMessage() throws Exception {
  final String ODATA_ERRORCODE="String_Node_Str";
  final String ORIGINAL_MESSAGE="String_Node_Str";
  final String LOCALIZED_MESSAGE="String_Node_Str";
  MetadataProcessor processor=mock(MetadataProcessor.class);
  ODataApplicationException oDataApplicationException=new ODataApplicationException(ORIGINAL_MESSAGE,425,Locale.ENGLISH,ODATA_ERRORCODE){
    @Override public String getLocalizedMessage(){
      return LOCALIZED_MESSAGE;
    }
  }
;
  doThrow(oDataApplicationException).when(processor).readMetadata(any(ODataRequest.class),any(ODataResponse.class),any(UriInfo.class),any(ContentType.class));
  final ODataResponse response=dispatch(HttpMethod.GET,"String_Node_Str",processor);
  InputStream contentStream=response.getContent();
  String responseContent=IOUtils.toString(contentStream,Charset.forName("String_Node_Str"));
  boolean isMessage=responseContent.contains(LOCALIZED_MESSAGE) && responseContent.contains(ODATA_ERRORCODE);
  assertEquals(true,isMessage);
  assertEquals(ORIGINAL_MESSAGE,oDataApplicationException.getMessage());
}

Fixed version (ground truth):
@Test public void applicationExceptionInProcessorMessage() throws Exception {
  final String ODATA_ERRORCODE="String_Node_Str";
  final String ORIGINAL_MESSAGE="String_Node_Str";
  final String LOCALIZED_MESSAGE="String_Node_Str";
  MetadataProcessor processor=mock(MetadataProcessor.class);
  ODataApplicationException oDataApplicationException=new ODataApplicationException(ORIGINAL_MESSAGE,425,Locale.ENGLISH,ODATA_ERRORCODE){
    private static final long serialVersionUID=1L;
    @Override public String getLocalizedMessage(){
      return LOCALIZED_MESSAGE;
    }
  }
;
  doThrow(oDataApplicationException).when(processor).readMetadata(any(ODataRequest.class),any(ODataResponse.class),any(UriInfo.class),any(ContentType.class));
  final ODataResponse response=dispatch(HttpMethod.GET,"String_Node_Str",processor);
  InputStream contentStream=response.getContent();
  String responseContent=IOUtils.toString(contentStream,Charset.forName("String_Node_Str"));
  boolean isMessage=responseContent.contains(LOCALIZED_MESSAGE) && responseContent.contains(ODATA_ERRORCODE);
  assertEquals(true,isMessage);
  assertEquals(ORIGINAL_MESSAGE,oDataApplicationException.getMessage());
}
Program: 33132
Project: 33132
Buggy source:
public StreamContentForJson(EntityIterator iterator,EdmEntityType entityType,ODataJsonSerializer jsonSerializer,ServiceMetadata metadata,EntityCollectionSerializerOptions options){
  super(iterator,entityType,jsonSerializer,metadata,options);
  this.jsonSerializer=jsonSerializer;
}

Fixed version (ground truth):
public StreamContentForJson(EntityIterator iterator,EdmEntityType entityType,ODataJsonSerializer jsonSerializer,ServiceMetadata metadata,EntityCollectionSerializerOptions options){
  super(iterator,entityType,metadata,options);
  this.jsonSerializer=jsonSerializer;
}
Program: 33133
Project: 33133
Buggy source:
public StreamContent(EntityIterator iterator,EdmEntityType entityType,ODataSerializer serializer,ServiceMetadata metadata,EntityCollectionSerializerOptions options){
  this.iterator=iterator;
  this.entityType=entityType;
  this.serializer=serializer;
  this.metadata=metadata;
  this.options=options;
}

Fixed version (ground truth):
public StreamContent(EntityIterator iterator,EdmEntityType entityType,ServiceMetadata metadata,EntityCollectionSerializerOptions options){
  this.iterator=iterator;
  this.entityType=entityType;
  this.metadata=metadata;
  this.options=options;
}
Program: 33134
Project: 33134
Buggy source:
public StreamContentForXml(EntityIterator iterator,EdmEntityType entityType,ODataXmlSerializer xmlSerializer,ServiceMetadata metadata,EntityCollectionSerializerOptions options){
  super(iterator,entityType,xmlSerializer,metadata,options);
  this.xmlSerializer=xmlSerializer;
}

Fixed version (ground truth):
public StreamContentForXml(EntityIterator iterator,EdmEntityType entityType,ODataXmlSerializer xmlSerializer,ServiceMetadata metadata,EntityCollectionSerializerOptions options){
  super(iterator,entityType,metadata,options);
  this.xmlSerializer=xmlSerializer;
}
Program: 33135
Project: 33135
Buggy source:
protected void writeEntity(EntityIterator entity,OutputStream outputStream) throws SerializerException {
  try {
    xmlSerializer.entityCollectionIntoStream(metadata,entityType,entity,options,outputStream);
    outputStream.flush();
  }
 catch (  final IOException e) {
    throw new ODataRuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
protected void writeEntity(EntityIterator entity,OutputStream outputStream) throws SerializerException {
  try {
    xmlSerializer.entityCollectionIntoStream(metadata,entityType,entity,options,outputStream);
    outputStream.flush();
  }
 catch (  final IOException e) {
    throw new ODataRuntimeException("String_Node_Str",e);
  }
}
Program: 33136
Project: 33136
Buggy source:
private InputStream wrapInJson(final List<DebugTab> parts) throws IOException {
  OutputStream outputStream=null;
  try {
    CircleStreamBuffer csb=new CircleStreamBuffer();
    outputStream=csb.getOutputStream();
    JsonGenerator gen=new ObjectMapper().getFactory().createGenerator(outputStream);
    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) {
        throw e;
      }
    }
  }
}

Fixed version (ground truth):
private InputStream wrapInJson(final List<DebugTab> parts) throws IOException {
  OutputStream outputStream=null;
  try {
    CircleStreamBuffer csb=new CircleStreamBuffer();
    outputStream=csb.getOutputStream();
    JsonGenerator gen=new ObjectMapper().getFactory().createGenerator(outputStream);
    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) {
      outputStream.close();
    }
  }
}
Program: 33137
Project: 33137
Buggy source:
private void appendRuntimeNode(final RuntimeNode node,final String draw,final boolean isLast,final Writer writer) throws IOException {
  if (node.className != null) {
    writer.append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(draw).append(isLast ? "String_Node_Str" : "String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(node.className).append("String_Node_Str").append("String_Node_Str").append(node.methodName).append("String_Node_Str").append("String_Node_Str");
    long time=node.timeStopped == 0 ? 0 : (node.timeStopped - node.timeStarted) / 1000;
    writer.append("String_Node_Str").append(time == 0 ? "String_Node_Str" : "String_Node_Str").append("String_Node_Str").append(time == 0 ? "String_Node_Str" : "String_Node_Str").append("String_Node_Str").append(time == 0 ? "String_Node_Str" : Long.toString(time) + "String_Node_Str").append("String_Node_Str");
  }
  if (!node.children.isEmpty()) {
    writer.append("String_Node_Str");
    for (    final RuntimeNode childNode : node.children) {
      appendRuntimeNode(childNode,node.className == null ? draw : draw + (isLast ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str",node.children.indexOf(childNode) == node.children.size() - 1,writer);
    }
    writer.append("String_Node_Str");
  }
  if (node.className != null) {
    writer.append("String_Node_Str");
  }
}

Fixed version (ground truth):
private void appendRuntimeNode(final RuntimeNode node,final String draw,final boolean isLast,final Writer writer) throws IOException {
  if (node.className != null) {
    writer.append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(draw).append(isLast ? "String_Node_Str" : "String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(node.className).append("String_Node_Str").append("String_Node_Str").append(node.methodName).append("String_Node_Str").append("String_Node_Str");
    long time=node.timeStopped == 0 ? 0 : (node.timeStopped - node.timeStarted) / TO_MILLIS_DIVISOR;
    writer.append("String_Node_Str").append(time == 0 ? "String_Node_Str" : "String_Node_Str").append("String_Node_Str").append(time == 0 ? "String_Node_Str" : "String_Node_Str").append("String_Node_Str").append(time == 0 ? "String_Node_Str" : Long.toString(time) + "String_Node_Str").append("String_Node_Str");
  }
  if (!node.children.isEmpty()) {
    writer.append("String_Node_Str");
    for (    final RuntimeNode childNode : node.children) {
      appendRuntimeNode(childNode,node.className == null ? draw : draw + (isLast ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str",node.children.indexOf(childNode) == node.children.size() - 1,writer);
    }
    writer.append("String_Node_Str");
  }
  if (node.className != null) {
    writer.append("String_Node_Str");
  }
}
Program: 33138
Project: 33138
Buggy source:
private void appendJsonNode(final JsonGenerator gen,final RuntimeNode node) throws IOException {
  gen.writeStartObject();
  gen.writeStringField("String_Node_Str",node.className);
  gen.writeStringField("String_Node_Str",node.methodName);
  if (node.timeStopped == 0) {
    gen.writeNullField("String_Node_Str");
  }
 else {
    gen.writeStringField("String_Node_Str",Long.toString((node.timeStopped - node.timeStarted) / 1000));
    gen.writeStringField("String_Node_Str","String_Node_Str");
  }
  if (!node.children.isEmpty()) {
    gen.writeFieldName("String_Node_Str");
    appendJsonChildren(gen,node);
  }
  gen.writeEndObject();
}

Fixed version (ground truth):
private void appendJsonNode(final JsonGenerator gen,final RuntimeNode node) throws IOException {
  gen.writeStartObject();
  gen.writeStringField("String_Node_Str",node.className);
  gen.writeStringField("String_Node_Str",node.methodName);
  if (node.timeStopped == 0) {
    gen.writeNullField("String_Node_Str");
  }
 else {
    gen.writeStringField("String_Node_Str",Long.toString((node.timeStopped - node.timeStarted) / TO_MILLIS_DIVISOR));
    gen.writeStringField("String_Node_Str","String_Node_Str");
  }
  if (!node.children.isEmpty()) {
    gen.writeFieldName("String_Node_Str");
    appendJsonChildren(gen,node);
  }
  gen.writeEndObject();
}
Program: 33139
Project: 33139
Buggy source:
@Override public byte[] binary(final InputStream content) throws DeserializerException {
  ByteArrayOutputStream result=new ByteArrayOutputStream();
  byte[] buffer=new byte[128];
  int count;
  try {
    while ((count=content.read(buffer)) > -1) {
      result.write(buffer,0,count);
    }
    result.flush();
  }
 catch (  final IOException e) {
    throw new DeserializerException("String_Node_Str",e,DeserializerException.MessageKeys.IO_EXCEPTION);
  }
  return result.toByteArray();
}

Fixed version (ground truth):
@Override public byte[] binary(final InputStream content) throws DeserializerException {
  ByteArrayOutputStream result=new ByteArrayOutputStream();
  byte[] buffer=new byte[DEFAULT_BUFFER_SIZE];
  int count;
  try {
    while ((count=content.read(buffer)) > -1) {
      result.write(buffer,0,count);
    }
    result.flush();
  }
 catch (  final IOException e) {
    throw new DeserializerException("String_Node_Str",e,DeserializerException.MessageKeys.IO_EXCEPTION);
  }
  return result.toByteArray();
}
Program: 33140
Project: 33140
Buggy source:
String readLine() throws IOException {
  if (limit == EOF) {
    return null;
  }
  ByteBuffer innerBuffer=ByteBuffer.allocate(BUFFER_SIZE);
  boolean foundLineEnd=false;
  while (!foundLineEnd) {
    if (limit == offset) {
      if (fillBuffer() == EOF) {
        foundLineEnd=true;
      }
    }
    if (!foundLineEnd) {
      byte currentChar=buffer[offset++];
      if (!innerBuffer.hasRemaining()) {
        innerBuffer.flip();
        ByteBuffer tmp=ByteBuffer.allocate(innerBuffer.limit() * 2);
        tmp.put(innerBuffer);
        innerBuffer=tmp;
      }
      innerBuffer.put(currentChar);
      if (currentChar == LF) {
        foundLineEnd=true;
      }
 else       if (currentChar == CR) {
        foundLineEnd=true;
        if (limit == offset) {
          fillBuffer();
        }
        if (limit != EOF && buffer[offset] == LF) {
          innerBuffer.put(LF);
          offset++;
        }
      }
    }
  }
  if (innerBuffer.position() == 0) {
    return null;
  }
 else {
    String currentLine;
    if (readState.isReadBody()) {
      currentLine=new String(innerBuffer.array(),0,innerBuffer.position(),getCurrentCharset());
    }
 else {
      currentLine=new String(innerBuffer.array(),0,innerBuffer.position(),CS_ISO_8859_1);
    }
    updateCurrentCharset(currentLine);
    return currentLine;
  }
}

Fixed version (ground truth):
String readLine() throws IOException {
  if (limit == EOF) {
    return null;
  }
  ByteBuffer innerBuffer=ByteBuffer.allocate(BUFFER_SIZE);
  boolean foundLineEnd=false;
  while (!foundLineEnd) {
    if (limit == offset && fillBuffer() == EOF) {
      foundLineEnd=true;
    }
    if (!foundLineEnd) {
      byte currentChar=buffer[offset++];
      if (!innerBuffer.hasRemaining()) {
        innerBuffer.flip();
        ByteBuffer tmp=ByteBuffer.allocate(innerBuffer.limit() * 2);
        tmp.put(innerBuffer);
        innerBuffer=tmp;
      }
      innerBuffer.put(currentChar);
      if (currentChar == LF) {
        foundLineEnd=true;
      }
 else       if (currentChar == CR) {
        foundLineEnd=true;
        if (limit == offset) {
          fillBuffer();
        }
        if (limit != EOF && buffer[offset] == LF) {
          innerBuffer.put(LF);
          offset++;
        }
      }
    }
  }
  if (innerBuffer.position() == 0) {
    return null;
  }
 else {
    String currentLine;
    if (readState.isReadBody()) {
      currentLine=new String(innerBuffer.array(),0,innerBuffer.position(),getCurrentCharset());
    }
 else {
      currentLine=new String(innerBuffer.array(),0,innerBuffer.position(),CS_ISO_8859_1);
    }
    updateCurrentCharset(currentLine);
    return currentLine;
  }
}
Program: 33141
Project: 33141
Buggy source:
protected Object invokeSelfMethod(final Method method,final Object[] args) throws Throwable {
  try {
    return getClass().getMethod(method.getName(),method.getParameterTypes()).invoke(this,args);
  }
 catch (  UndeclaredThrowableException e) {
    throw e.getCause();
  }
}

Fixed version (ground truth):
protected Object invokeSelfMethod(final Method method,final Object[] args) throws Throwable {
  try {
    return getClass().getMethod(method.getName(),method.getParameterTypes()).invoke(this,args);
  }
 catch (  UndeclaredThrowableException e) {
    throw e.getCause();
  }
catch (  InvocationTargetException e) {
    throw e.getTargetException();
  }
}
Program: 33143
Project: 33143
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public static Object getEntityCollectionProxy(final AbstractService<?> service,final Class<?> typeRef,final Class<?> typeCollectionRef,final URI targetEntitySetURI,final ClientEntitySet entitySet,final URI uri,final boolean checkInTheContext){
  final List<Object> items=new ArrayList<Object>();
  if (entitySet != null) {
    for (    ClientEntity entityFromSet : entitySet.getEntities()) {
      items.add(getEntityProxy(service,entityFromSet,uri,typeRef,null,checkInTheContext));
    }
  }
  return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),new Class<?>[]{typeCollectionRef},new EntityCollectionInvocationHandler(service,items,typeCollectionRef,targetEntitySetURI,uri == null ? null : service.getClient().newURIBuilder(uri.toASCIIString())));
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public static Object getEntityCollectionProxy(final AbstractService<?> service,final Class<?> typeRef,final Class<?> typeCollectionRef,final URI targetEntitySetURI,final ClientEntitySet entitySet,final URI uri,final boolean checkInTheContext){
  final List<Object> items=extractItems(service,typeRef,entitySet,uri,checkInTheContext);
  return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),new Class<?>[]{typeCollectionRef},new EntityCollectionInvocationHandler(service,items,typeCollectionRef,targetEntitySetURI,uri == null ? null : service.getClient().newURIBuilder(uri.toASCIIString())));
}
Program: 33144
Project: 33144
Buggy source:
@Test public void readMetadataWithAnnotations(){
  EdmMetadataRequest request=getClient().getRetrieveRequestFactory().getMetadataRequest(SERVICE_URI);
  assertNotNull(request);
  setCookieHeader(request);
  ODataRetrieveResponse<Edm> response=request.execute();
  saveCookieHeader(response);
  assertEquals(HttpStatusCode.OK.getStatusCode(),response.getStatusCode());
  Edm edm=response.getBody();
  assertNotNull(edm);
  EdmEntitySet entitySet=edm.getEntityContainer().getEntitySet("String_Node_Str");
  List<EdmAnnotation> annotations=entitySet.getAnnotations();
  assertNotNull(annotations);
  assertTrue(annotations.size() > 1);
  EdmAnnotation annotation=entitySet.getAnnotation(edm.getTerm(new FullQualifiedName("String_Node_Str","String_Node_Str")),null);
  assertNotNull(annotation);
}

Fixed version (ground truth):
@Test public void readMetadataWithAnnotations(){
  EdmMetadataRequest request=getClient().getRetrieveRequestFactory().getMetadataRequest(SERVICE_URI);
  assertNotNull(request);
  setCookieHeader(request);
  ODataRetrieveResponse<Edm> response=request.execute();
  saveCookieHeader(response);
  assertEquals(HttpStatusCode.OK.getStatusCode(),response.getStatusCode());
  Edm edm=response.getBody();
  assertNotNull(edm);
  EdmEntitySet entitySet=edm.getEntityContainer().getEntitySet("String_Node_Str");
  List<EdmAnnotation> annotations=entitySet.getAnnotations();
  assertNotNull(annotations);
  assertTrue(annotations.size() > 1);
  EdmAnnotation annotation=entitySet.getAnnotation(edm.getTerm(new FullQualifiedName("String_Node_Str","String_Node_Str")),null);
  assertNotNull(annotation);
  EdmActionImport actionImport=edm.getEntityContainer().getActionImport("String_Node_Str");
  annotations=actionImport.getAnnotations();
  assertNotNull(annotations);
  assertTrue(annotations.size() > 1);
  annotation=entitySet.getAnnotation(edm.getTerm(new FullQualifiedName("String_Node_Str","String_Node_Str")),null);
  assertNotNull(annotation);
}
Program: 33145
Project: 33145
Buggy source:
private void appendActionImports(final XMLStreamWriter writer,final List<EdmActionImport> actionImports) throws XMLStreamException {
  for (  EdmActionImport actionImport : actionImports) {
    writer.writeStartElement(XML_ACTION_IMPORT);
    writer.writeAttribute(XML_NAME,actionImport.getName());
    writer.writeAttribute(XML_ACTION,getAliasedFullQualifiedName(actionImport.getUnboundAction(),false));
    writer.writeEndElement();
    appendAnnotations(writer,actionImport);
  }
}

Fixed version (ground truth):
private void appendActionImports(final XMLStreamWriter writer,final List<EdmActionImport> actionImports) throws XMLStreamException {
  for (  EdmActionImport actionImport : actionImports) {
    writer.writeStartElement(XML_ACTION_IMPORT);
    writer.writeAttribute(XML_NAME,actionImport.getName());
    writer.writeAttribute(XML_ACTION,getAliasedFullQualifiedName(actionImport.getUnboundAction(),false));
    appendAnnotations(writer,actionImport);
    writer.writeEndElement();
  }
}
Program: 33147
Project: 33147
Buggy source:
private void initSchemas(){
  loadAliasToNamespaceInfo();
  Map<String,EdmSchema> localSchemas=createSchemas();
  schemas=Collections.synchronizedMap(localSchemas);
  if (schemas == null) {
    schemas=Collections.emptyMap();
  }
  schemaList=Collections.unmodifiableList(new ArrayList<EdmSchema>(schemas.values()));
}

Fixed version (ground truth):
private void initSchemas(){
  loadAliasToNamespaceInfo();
  Map<String,EdmSchema> localSchemas=createSchemas();
  schemas=Collections.synchronizedMap(localSchemas);
  schemaList=Collections.unmodifiableList(new ArrayList<EdmSchema>(schemas.values()));
}
Program: 33148
Project: 33148
Buggy source:
/** 
 * Set the callback which is used in case of an exception during write of the content.
 * @param ODataContentWriteErrorCallback the callback
 * @return the builder
 */
public Builder writeContentErrorCallback(ODataContentWriteErrorCallback ODataContentWriteErrorCallback){
  options.ODataContentWriteErrorCallback=ODataContentWriteErrorCallback;
  return this;
}

Fixed version (ground truth):
/** 
 * Set the callback which is used in case of an exception during write of the content.
 * @param ODataContentWriteErrorCallback the callback
 * @return the builder
 */
public Builder writeContentErrorCallback(ODataContentWriteErrorCallback ODataContentWriteErrorCallback){
  options.odataContentWriteErrorCallback=ODataContentWriteErrorCallback;
  return this;
}
Program: 33149
Project: 33149
Buggy source:
/** 
 * Gets the callback which is used in case of an exception during write of the content (in case the content will be written/streamed in the future)
 * @return callback which is used in case of an exception duringwrite of the content
 */
public ODataContentWriteErrorCallback getODataContentWriteErrorCallback(){
  return ODataContentWriteErrorCallback;
}

Fixed version (ground truth):
/** 
 * Gets the callback which is used in case of an exception during write of the content (in case the content will be written/streamed in the future)
 * @return callback which is used in case of an exception duringwrite of the content
 */
public ODataContentWriteErrorCallback getODataContentWriteErrorCallback(){
  return odataContentWriteErrorCallback;
}
Program: 33150
Project: 33150
Buggy source:
private ContentType getSupportedContentType(final String contentTypeHeader,final RepresentationType representationType,final boolean mustNotBeNull) throws ODataHandlerException, ContentNegotiatorException {
  if (contentTypeHeader == null) {
    if (mustNotBeNull) {
      throw new ODataHandlerException(contentTypeHeader,ODataHandlerException.MessageKeys.MISSING_CONTENT_TYPE);
    }
    return null;
  }
  ContentType contentType;
  try {
    contentType=ContentType.create(contentTypeHeader);
  }
 catch (  final IllegalArgumentException e) {
    throw new ODataHandlerException("String_Node_Str",e,ODataHandlerException.MessageKeys.INVALID_CONTENT_TYPE,contentTypeHeader);
  }
  ContentNegotiator.checkSupport(contentType,handler.getCustomContentTypeSupport(),representationType);
  return contentType;
}

Fixed version (ground truth):
private ContentType getSupportedContentType(final String contentTypeHeader,final RepresentationType representationType,final boolean mustNotBeNull) throws ODataHandlerException, ContentNegotiatorException {
  if (contentTypeHeader == null) {
    if (mustNotBeNull) {
      throw new ODataHandlerException("String_Node_Str",ODataHandlerException.MessageKeys.MISSING_CONTENT_TYPE);
    }
    return null;
  }
  ContentType contentType;
  try {
    contentType=ContentType.create(contentTypeHeader);
  }
 catch (  final IllegalArgumentException e) {
    throw new ODataHandlerException("String_Node_Str",e,ODataHandlerException.MessageKeys.INVALID_CONTENT_TYPE,contentTypeHeader);
  }
  ContentNegotiator.checkSupport(contentType,handler.getCustomContentTypeSupport(),representationType);
  return contentType;
}
Program: 33151
Project: 33151
Buggy source:
/** 
 * Extract format option from either <code>uriInfo</code> (if not <code>NULL</code>) or query from <code>request</code> (if not <code>NULL</code>). If both options are <code>NULL</code>, <code>NULL</code> is returned.
 * @param request request which is checked
 * @param uriInfo uriInfo which is checked
 * @return the evaluated format option or <code>NULL</code>.
 */
private FormatOption getFormatOption(final ODataRequest request,final UriInfo uriInfo){
  if (uriInfo == null) {
    String query=request.getRawQueryPath();
    if (query == null) {
      return null;
    }
    final String formatOption=SystemQueryOptionKind.FORMAT.toString();
    int index=query.indexOf(formatOption);
    int endIndex=query.indexOf("String_Node_Str",index);
    if (endIndex == -1) {
      endIndex=query.length();
    }
    final String format=query.substring(index + formatOption.length(),endIndex);
    return new FormatOptionImpl().setFormat(format);
  }
  return uriInfo.getFormatOption();
}

Fixed version (ground truth):
/** 
 * Extract format option from either <code>uriInfo</code> (if not <code>NULL</code>) or query from <code>request</code> (if not <code>NULL</code>). If both options are <code>NULL</code>, <code>NULL</code> is returned.
 * @param request request which is checked
 * @param uriInfo uriInfo which is checked
 * @return the evaluated format option or <code>NULL</code>.
 */
private FormatOption getFormatOption(final ODataRequest request,final UriInfo uriInfo){
  if (uriInfo == null) {
    String query=request.getRawQueryPath();
    if (query == null) {
      return null;
    }
    final String formatOption=SystemQueryOptionKind.FORMAT.toString();
    int index=query.indexOf(formatOption);
    int endIndex=query.indexOf('&',index);
    if (endIndex == -1) {
      endIndex=query.length();
    }
    final String format=query.substring(index + formatOption.length(),endIndex);
    return new FormatOptionImpl().setFormat(format);
  }
  return uriInfo.getFormatOption();
}
Program: 33152
Project: 33152
Buggy source:
protected static void appendJsonTable(final JsonGenerator gen,final Map<String,String> entries) throws IOException {
  if (entries == null || entries.isEmpty()) {
    gen.writeNull();
  }
 else {
    gen.writeStartObject();
    for (    final String name : entries.keySet()) {
      gen.writeFieldName(name);
      if (entries.get(name) == null) {
        gen.writeNull();
      }
 else {
        gen.writeString(entries.get(name));
      }
    }
    gen.writeEndObject();
  }
}

Fixed version (ground truth):
protected static void appendJsonTable(final JsonGenerator gen,final Map<String,String> entries) throws IOException {
  if (entries == null || entries.isEmpty()) {
    gen.writeNull();
  }
 else {
    gen.writeStartObject();
    for (    final Map.Entry<String,String> entry : entries.entrySet()) {
      gen.writeFieldName(entry.getKey());
      if (entry.getValue() == null) {
        gen.writeNull();
      }
 else {
        gen.writeString(entry.getValue());
      }
    }
    gen.writeEndObject();
  }
}
Program: 33153
Project: 33153
Buggy source:
@Override public ODataResponse createDebugResponse(final DebugInformation debugInfo){
  try {
    final List<DebugTab> parts=createParts(debugInfo);
    ODataResponse response=new ODataResponse();
    String contentTypeString;
    InputStream body;
switch (requestedFormat) {
case DOWNLOAD:
      response.setHeader("String_Node_Str","String_Node_Str" + new Date().toString().replace(' ','_').replace(':','.') + "String_Node_Str");
case HTML:
    String title=debugInfo.getRequest() == null ? "String_Node_Str" : "String_Node_Str" + debugInfo.getRequest().getRawODataPath();
  body=wrapInHtml(parts,title);
contentTypeString=ContentType.TEXT_HTML.toContentTypeString();
break;
case JSON:
default :
body=wrapInJson(parts);
contentTypeString=ContentType.APPLICATION_JSON.toContentTypeString();
break;
}
response.setStatusCode(HttpStatusCode.OK.getStatusCode());
response.setHeader(HttpHeader.CONTENT_TYPE,contentTypeString);
response.setContent(body);
return response;
}
 catch (IOException e) {
throw new ODataRuntimeException(e);
}
}

Fixed version (ground truth):
@Override public ODataResponse createDebugResponse(final DebugInformation debugInfo){
  try {
    final List<DebugTab> parts=createParts(debugInfo);
    ODataResponse response=new ODataResponse();
    final String contentTypeString;
    final InputStream body;
    if (requestedFormat == DebugFormat.DOWNLOAD || requestedFormat == DebugFormat.HTML) {
      String title=debugInfo.getRequest() == null ? "String_Node_Str" : "String_Node_Str" + debugInfo.getRequest().getRawODataPath();
      body=wrapInHtml(parts,title);
      contentTypeString=ContentType.TEXT_HTML.toContentTypeString();
    }
 else {
      body=wrapInJson(parts);
      contentTypeString=ContentType.APPLICATION_JSON.toContentTypeString();
    }
    if (requestedFormat == DebugFormat.DOWNLOAD) {
      response.setHeader("String_Node_Str","String_Node_Str" + new Date().toString().replace(' ','_').replace(':','.') + "String_Node_Str");
    }
    response.setStatusCode(HttpStatusCode.OK.getStatusCode());
    response.setHeader(HttpHeader.CONTENT_TYPE,contentTypeString);
    response.setContent(body);
    return response;
  }
 catch (  IOException e) {
    throw new ODataRuntimeException(e);
  }
}
Program: 33154
Project: 33154
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");
  if (entries != null && !entries.isEmpty()) {
    for (    final String name : entries.keySet()) {
      writer.append("String_Node_Str").append(name).append("String_Node_Str").append("String_Node_Str").append(escapeHtml(entries.get(name))).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");
  if (entries != null && !entries.isEmpty()) {
    for (    final Map.Entry<String,String> entry : entries.entrySet()) {
      writer.append("String_Node_Str").append(entry.getKey()).append("String_Node_Str").append("String_Node_Str").append(escapeHtml(entry.getValue())).append("String_Node_Str");
    }
  }
  writer.append("String_Node_Str");
}
Program: 33155
Project: 33155
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 ObjectMapper().getFactory().createGenerator(outputStream);
    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;
        }
      }
    }
  }
}

Fixed version (ground truth):
private InputStream wrapInJson(final List<DebugTab> parts) throws IOException {
  OutputStream outputStream=null;
  try {
    CircleStreamBuffer csb=new CircleStreamBuffer();
    outputStream=csb.getOutputStream();
    JsonGenerator gen=new ObjectMapper().getFactory().createGenerator(outputStream);
    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) {
        throw e;
      }
    }
  }
}
Program: 33156
Project: 33156
Buggy source:
private String getSelectString(final SelectItem selectItem){
  String selectedProperty="String_Node_Str";
  if (selectItem.isStar()) {
    if (selectItem.getAllOperationsInSchemaNameSpace() == null) {
      selectedProperty="String_Node_Str";
    }
 else {
      selectedProperty=selectItem.getAllOperationsInSchemaNameSpace().getFullQualifiedNameAsString() + "String_Node_Str";
    }
  }
 else {
    boolean first=true;
    for (    UriResource resourcePart : selectItem.getResourcePath().getUriResourceParts()) {
      if (!first) {
        selectedProperty+='/';
      }
      selectedProperty+=resourcePart.toString();
      first=false;
    }
  }
  return selectedProperty;
}

Fixed version (ground truth):
private String getSelectString(final SelectItem selectItem){
  if (selectItem.isStar()) {
    if (selectItem.getAllOperationsInSchemaNameSpace() == null) {
      return "String_Node_Str";
    }
 else {
      return selectItem.getAllOperationsInSchemaNameSpace().getFullQualifiedNameAsString() + "String_Node_Str";
    }
  }
 else {
    final StringBuilder tmp=new StringBuilder();
    for (    UriResource resourcePart : selectItem.getResourcePath().getUriResourceParts()) {
      if (tmp.length() > 0) {
        tmp.append('/');
      }
      tmp.append(resourcePart.toString());
    }
    return tmp.toString();
  }
}
Program: 33157
Project: 33157
Buggy source:
public Body(final ODataResponse response){
  content=getBody(response);
}

Fixed version (ground truth):
Body(final ODataResponse response){
  content=getBody(response);
}