nus-yam/ex-repair huggingface dataset:
Program: 17808
Project: 17808
Buggy source:
private Session _createSession(){
  Session session;
  if (Session.getActiveSession() != null) {
    session=Session.getActiveSession();
  }
 else {
    session=new Session.Builder(GameActivity.getInstance()).setApplicationId(_sAppID).build();
  }
  return session;
}

Fixed version (ground truth):
private Session _createSession(){
  Session session;
  if (Session.getActiveSession() != null) {
    session=Session.getActiveSession();
  }
 else {
    session=new Session.Builder(GameActivity.getInstance()).setApplicationId(_sAppID).build();
    Session.setActiveSession(session);
  }
  return session;
}
Program: 17809
Project: 17809
Buggy source:
/** 
 * @public
 * @return	void
 */
public void graph_request(String sGraphRequest,String sKeys,String sVals,String sMethod){
  trace("String_Node_Str" + sMethod);
  Bundle params=stringTo_bundle(sKeys,sVals);
  final Request req=new Request(Session.getActiveSession(),sGraphRequest,params,HttpMethod.valueOf(sMethod),listener_request);
  GameActivity.getInstance().runOnUiThread(new Runnable(){
    public void run(){
      RequestAsyncTask task=new RequestAsyncTask(req);
      task.execute();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @public
 * @return	void
 */
public void graph_request(String sGraphRequest,String sKeys,String sVals,String sMethod){
  trace("String_Node_Str" + sMethod);
  Bundle params=stringTo_bundle(sKeys,sVals);
  final Request req=new Request(Session.getActiveSession(),sGraphRequest,params,HttpMethod.valueOf(sMethod),listener_request);
  _mSurface.queueEvent(new Runnable(){
    @Override public void run(){
      trace("String_Node_Str");
      req.executeAndWait();
    }
  }
);
}
Program: 17810
Project: 17810
Buggy source:
public static void handleKeyboardInput(GuiScreen gui){
  if (Keyboard.getEventKeyState()) {
    do {
      int k=Keyboard.getEventKey();
      char c=Keyboard.getEventCharacter();
      if (k == 87) {
        gui.mc.toggleFullscreen();
        return;
      }
      if (gui.isMacOs && k == 28 && c == 0) {
        k=29;
      }
      if ((byte)c < 0 && Keyboard.next()) {
        int k2=Keyboard.getEventKey();
        char c2=Keyboard.getEventCharacter();
        try {
          c2=new String(new byte[]{(byte)c,(byte)c2},encoding).charAt(0);
          gui.keyTyped(c2,k);
        }
 catch (        Throwable t) {
          gui.keyTyped(c,k);
          gui.keyTyped(c2,k2);
        }
      }
 else {
        gui.keyTyped(c,k);
      }
    }
 while (Keyboard.next());
  }
}

Fixed version (ground truth):
public static void handleKeyboardInput(GuiScreen gui){
  if (Keyboard.getEventKeyState()) {
    do {
      int k=Keyboard.getEventKey();
      char c=Keyboard.getEventCharacter();
      if (k == 87) {
        gui.mc.toggleFullscreen();
        return;
      }
      if (gui.isMacOs && k == 28 && c == 0) {
        k=29;
      }
      if (!Config.leastfix && c > 0x7F && Keyboard.next()) {
        int k2=Keyboard.getEventKey();
        char c2=Keyboard.getEventCharacter();
        try {
          c2=new String(new byte[]{(byte)c,(byte)c2},Config.encoding).charAt(0);
          gui.keyTyped(c2,k);
        }
 catch (        Throwable t) {
          gui.keyTyped(c,k);
          gui.keyTyped(c2,k2);
        }
      }
 else {
        gui.keyTyped(c,k);
      }
    }
 while (Keyboard.next());
  }
}
Program: 17811
Project: 17811
Buggy source:
private long increaseCounter(String counterName){
  Query query=new Query(Criteria.where("String_Node_Str").is(counterName));
  Update update=new Update().inc("String_Node_Str",1);
  Counter counter=mongoTemplate.findAndModify(query,update,Counter.class);
  if (counter == null) {
    counter=new Counter();
    counter.setName(counterName);
    counter.setSequence(1);
    mongoTemplate.save(counter);
  }
  return counter.getSequence();
}

Fixed version (ground truth):
private long increaseCounter(String counterName){
  Query query=new Query(Criteria.where("String_Node_Str").is(counterName));
  Update update=new Update().inc("String_Node_Str",1);
  Counter counter=mongoTemplate.findAndModify(query,update,Counter.class);
  if (counter == null) {
    counter=new Counter();
    counter.setName(counterName);
    counter.setSequence(2);
    mongoTemplate.save(counter);
    return 1;
  }
  return counter.getSequence();
}
Program: 17813
Project: 17813
Buggy source:
@Test public void testErrorBatch() throws Exception {
  List<BatchPart> batch=new ArrayList<BatchPart>();
  BatchPart request=BatchQueryPart.method(GET).uri("String_Node_Str").build();
  batch.add(request);
  InputStream body=EntityProvider.writeBatchRequestBody(batch,BOUNDARY);
  String bodyAsString=StringHelper.inputStreamToString(body,true);
  checkMimeHeaders(bodyAsString);
  checkBoundaryDelimiters(bodyAsString);
  assertTrue(bodyAsString.contains("String_Node_Str"));
  HttpResponse batchResponse=execute(bodyAsString);
  InputStream responseBody=batchResponse.getEntity().getContent();
  String contentType=batchResponse.getFirstHeader(HttpHeaders.CONTENT_TYPE).getValue();
  List<BatchSingleResponse> responses=EntityProvider.parseBatchResponse(responseBody,contentType);
  for (  BatchSingleResponse response : responses) {
    assertEquals("String_Node_Str",response.getStatusCode());
    assertEquals("String_Node_Str",response.getStatusInfo());
  }
}

Fixed version (ground truth):
@Test public void testErrorBatch() throws Exception {
  List<BatchPart> batch=new ArrayList<BatchPart>();
  BatchPart request=BatchQueryPart.method(GET).uri("String_Node_Str").build();
  batch.add(request);
  InputStream body=EntityProvider.writeBatchRequest(batch,BOUNDARY);
  String bodyAsString=StringHelper.inputStreamToString(body,true);
  checkMimeHeaders(bodyAsString);
  checkBoundaryDelimiters(bodyAsString);
  assertTrue(bodyAsString.contains("String_Node_Str"));
  HttpResponse batchResponse=execute(bodyAsString);
  InputStream responseBody=batchResponse.getEntity().getContent();
  String contentType=batchResponse.getFirstHeader(HttpHeaders.CONTENT_TYPE).getValue();
  List<BatchSingleResponse> responses=EntityProvider.parseBatchResponse(responseBody,contentType);
  for (  BatchSingleResponse response : responses) {
    assertEquals("String_Node_Str",response.getStatusCode());
    assertEquals("String_Node_Str",response.getStatusInfo());
  }
}
Program: 17815
Project: 17815
Buggy source:
@Test public void testSimpleBatch() throws Exception {
  List<BatchPart> batch=new ArrayList<BatchPart>();
  BatchPart request=BatchQueryPart.method(GET).uri("String_Node_Str").build();
  batch.add(request);
  InputStream body=EntityProvider.writeBatchRequestBody(batch,BOUNDARY);
  String batchRequestBody=StringHelper.inputStreamToString(body,true);
  checkMimeHeaders(batchRequestBody);
  checkBoundaryDelimiters(batchRequestBody);
  assertTrue(batchRequestBody.contains("String_Node_Str"));
  HttpResponse batchResponse=execute(batchRequestBody);
  InputStream responseBody=batchResponse.getEntity().getContent();
  String contentType=batchResponse.getFirstHeader(HttpHeaders.CONTENT_TYPE).getValue();
  List<BatchSingleResponse> responses=EntityProvider.parseBatchResponse(responseBody,contentType);
  for (  BatchSingleResponse response : responses) {
    assertEquals("String_Node_Str",response.getStatusCode());
    assertEquals("String_Node_Str",response.getStatusInfo());
    assertTrue(response.getBody().contains("String_Node_Str"));
    assertEquals("String_Node_Str",response.getHeader(HttpHeaders.CONTENT_TYPE));
    assertNotNull(response.getHeader(HttpHeaders.CONTENT_LENGTH));
  }
}

Fixed version (ground truth):
@Test public void testSimpleBatch() throws Exception {
  List<BatchPart> batch=new ArrayList<BatchPart>();
  BatchPart request=BatchQueryPart.method(GET).uri("String_Node_Str").build();
  batch.add(request);
  InputStream body=EntityProvider.writeBatchRequest(batch,BOUNDARY);
  String batchRequestBody=StringHelper.inputStreamToString(body,true);
  checkMimeHeaders(batchRequestBody);
  checkBoundaryDelimiters(batchRequestBody);
  assertTrue(batchRequestBody.contains("String_Node_Str"));
  HttpResponse batchResponse=execute(batchRequestBody);
  InputStream responseBody=batchResponse.getEntity().getContent();
  String contentType=batchResponse.getFirstHeader(HttpHeaders.CONTENT_TYPE).getValue();
  List<BatchSingleResponse> responses=EntityProvider.parseBatchResponse(responseBody,contentType);
  for (  BatchSingleResponse response : responses) {
    assertEquals("String_Node_Str",response.getStatusCode());
    assertEquals("String_Node_Str",response.getStatusInfo());
    assertTrue(response.getBody().contains("String_Node_Str"));
    assertEquals("String_Node_Str",response.getHeader(HttpHeaders.CONTENT_TYPE));
    assertNotNull(response.getHeader(HttpHeaders.CONTENT_LENGTH));
  }
}
Program: 17818
Project: 17818
Buggy source:
@Override public ODataResponse handleRequest(final ODataRequest suppliedRequest) throws ODataException {
  ODataRequest request;
  String mimeHeaderContentId=suppliedRequest.getRequestHeaderValue(BatchConstants.MIME_HEADER_CONTENT_ID.toLowerCase());
  String requestHeaderContentId=suppliedRequest.getRequestHeaderValue(BatchConstants.REQUEST_HEADER_CONTENT_ID.toLowerCase());
  List<PathSegment> odataSegments=suppliedRequest.getPathInfo().getODataSegments();
  if (!odataSegments.isEmpty() && odataSegments.get(0).getPath().matches("String_Node_Str")) {
    request=modifyRequest(suppliedRequest,odataSegments);
  }
 else {
    request=suppliedRequest;
  }
  ODataRequestHandler handler=createHandler(request);
  ODataResponse response=handler.handle(request);
  if (response.getStatus().getStatusCode() < BAD_REQUEST) {
    response=setContentIdHeader(response,mimeHeaderContentId,requestHeaderContentId);
  }
  if (request.getMethod().equals(ODataHttpMethod.POST)) {
    String baseUri=getBaseUri(request);
    if (mimeHeaderContentId != null) {
      fillContentIdMap(response,mimeHeaderContentId,baseUri);
    }
 else     if (requestHeaderContentId != null) {
      fillContentIdMap(response,requestHeaderContentId,baseUri);
    }
  }
  return response;
}

Fixed version (ground truth):
@Override public ODataResponse handleRequest(final ODataRequest suppliedRequest) throws ODataException {
  ODataRequest request;
  String mimeHeaderContentId=suppliedRequest.getRequestHeaderValue(BatchConstants.MIME_HEADER_CONTENT_ID.toLowerCase(Locale.ENGLISH));
  String requestHeaderContentId=suppliedRequest.getRequestHeaderValue(BatchConstants.REQUEST_HEADER_CONTENT_ID.toLowerCase(Locale.ENGLISH));
  List<PathSegment> odataSegments=suppliedRequest.getPathInfo().getODataSegments();
  if (!odataSegments.isEmpty() && odataSegments.get(0).getPath().matches("String_Node_Str")) {
    request=modifyRequest(suppliedRequest,odataSegments);
  }
 else {
    request=suppliedRequest;
  }
  ODataRequestHandler handler=createHandler(request);
  ODataResponse response=handler.handle(request);
  if (response.getStatus().getStatusCode() < BAD_REQUEST) {
    response=setContentIdHeader(response,mimeHeaderContentId,requestHeaderContentId);
  }
  if (request.getMethod().equals(ODataHttpMethod.POST)) {
    String baseUri=getBaseUri(request);
    if (mimeHeaderContentId != null) {
      fillContentIdMap(response,mimeHeaderContentId,baseUri);
    }
 else     if (requestHeaderContentId != null) {
      fillContentIdMap(response,requestHeaderContentId,baseUri);
    }
  }
  return response;
}
Program: 17819
Project: 17819
Buggy source:
@Override public BatchResponsePart handleBatchPart(final BatchPart batchPart) throws ODataException {
  if (batchPart.isChangeSet()) {
    List<ODataRequest> changeSetRequests=batchPart.getRequests();
    contentIdMap=new HashMap<String,String>();
    return service.getBatchProcessor().executeChangeSet(this,changeSetRequests);
  }
 else {
    if (batchPart.getRequests().size() != 1) {
      throw new ODataException("String_Node_Str");
    }
    ODataRequest request=batchPart.getRequests().get(0);
    ODataRequestHandler handler=createHandler(request);
    String mimeHeaderContentId=request.getRequestHeaderValue(BatchConstants.MIME_HEADER_CONTENT_ID.toLowerCase());
    String requestHeaderContentId=request.getRequestHeaderValue(BatchConstants.REQUEST_HEADER_CONTENT_ID.toLowerCase());
    ODataResponse response=setContentIdHeader(handler.handle(request),mimeHeaderContentId,requestHeaderContentId);
    List<ODataResponse> responses=new ArrayList<ODataResponse>(1);
    responses.add(response);
    return BatchResponsePart.responses(responses).changeSet(false).build();
  }
}

Fixed version (ground truth):
@Override public BatchResponsePart handleBatchPart(final BatchPart batchPart) throws ODataException {
  if (batchPart.isChangeSet()) {
    List<ODataRequest> changeSetRequests=batchPart.getRequests();
    contentIdMap=new HashMap<String,String>();
    return service.getBatchProcessor().executeChangeSet(this,changeSetRequests);
  }
 else {
    if (batchPart.getRequests().size() != 1) {
      throw new ODataException("String_Node_Str");
    }
    ODataRequest request=batchPart.getRequests().get(0);
    ODataRequestHandler handler=createHandler(request);
    String mimeHeaderContentId=request.getRequestHeaderValue(BatchConstants.MIME_HEADER_CONTENT_ID.toLowerCase(Locale.ENGLISH));
    String requestHeaderContentId=request.getRequestHeaderValue(BatchConstants.REQUEST_HEADER_CONTENT_ID.toLowerCase(Locale.ENGLISH));
    ODataResponse response=setContentIdHeader(handler.handle(request),mimeHeaderContentId,requestHeaderContentId);
    List<ODataResponse> responses=new ArrayList<ODataResponse>(1);
    responses.add(response);
    return BatchResponsePart.responses(responses).changeSet(false).build();
  }
}
Program: 17820
Project: 17820
Buggy source:
private List<String> getAcceptHeader(final Map<String,List<String>> headers){
  List<String> acceptHeaders=new ArrayList<String>();
  List<String> requestAcceptHeaderList=headers.get(HttpHeaders.ACCEPT.toLowerCase());
  if (requestAcceptHeaderList != null) {
    acceptHeaders=requestAcceptHeaderList;
  }
  return acceptHeaders;
}

Fixed version (ground truth):
private List<String> getAcceptHeader(final Map<String,List<String>> headers){
  List<String> acceptHeaders=new ArrayList<String>();
  List<String> requestAcceptHeaderList=headers.get(HttpHeaders.ACCEPT.toLowerCase(Locale.ENGLISH));
  if (requestAcceptHeaderList != null) {
    acceptHeaders=requestAcceptHeaderList;
  }
  return acceptHeaders;
}
Program: 17821
Project: 17821
Buggy source:
private List<Locale> getAcceptLanguageHeader(final Map<String,List<String>> headers){
  List<String> requestAcceptLanguageList=headers.get(HttpHeaders.ACCEPT_LANGUAGE.toLowerCase());
  List<Locale> acceptLanguages=new ArrayList<Locale>();
  if (requestAcceptLanguageList != null) {
    for (    String acceptLanguage : requestAcceptLanguageList) {
      String[] part=acceptLanguage.split("String_Node_Str");
      String language=part[0];
      String country="String_Node_Str";
      if (part.length == 2) {
        country=part[part.length - 1];
      }
      Locale locale=new Locale(language,country);
      acceptLanguages.add(locale);
    }
  }
  return acceptLanguages;
}

Fixed version (ground truth):
private List<Locale> getAcceptLanguageHeader(final Map<String,List<String>> headers){
  List<String> requestAcceptLanguageList=headers.get(HttpHeaders.ACCEPT_LANGUAGE.toLowerCase(Locale.ENGLISH));
  List<Locale> acceptLanguages=new ArrayList<Locale>();
  if (requestAcceptLanguageList != null) {
    for (    String acceptLanguage : requestAcceptLanguageList) {
      String[] part=acceptLanguage.split("String_Node_Str");
      String language=part[0];
      String country="String_Node_Str";
      if (part.length == 2) {
        country=part[part.length - 1];
      }
      Locale locale=new Locale(language,country);
      acceptLanguages.add(locale);
    }
  }
  return acceptLanguages;
}
Program: 17823
Project: 17823
Buggy source:
private String getContentTypeHeader(final Map<String,List<String>> headers){
  List<String> requestContentTypeList=headers.get(HttpHeaders.CONTENT_TYPE.toLowerCase());
  String contentType=null;
  if (requestContentTypeList != null) {
    for (    String requestContentType : requestContentTypeList) {
      contentType=contentType != null ? contentType + "String_Node_Str" + requestContentType : requestContentType;
    }
  }
  return contentType;
}

Fixed version (ground truth):
private String getContentTypeHeader(final Map<String,List<String>> headers){
  List<String> requestContentTypeList=headers.get(HttpHeaders.CONTENT_TYPE.toLowerCase(Locale.ENGLISH));
  String contentType=null;
  if (requestContentTypeList != null) {
    for (    String requestContentType : requestContentTypeList) {
      contentType=contentType != null ? contentType + "String_Node_Str" + requestContentType : requestContentType;
    }
  }
  return contentType;
}
Program: 17824
Project: 17824
Buggy source:
private String readBody(final InputStream in) throws BatchException {
  byte[] tmp=new byte[2048];
  int count;
  BatchException cachedException=null;
  StringBuffer b=new StringBuffer();
  try {
    count=in.read(tmp);
    while (count >= 0) {
      b.append(new String(tmp,0,count));
      count=in.read(tmp);
    }
  }
 catch (  IOException e) {
    cachedException=new BatchException(ODataMessageException.COMMON,e);
    throw cachedException;
  }
 finally {
    try {
      in.close();
    }
 catch (    IOException e) {
      if (cachedException != null) {
        throw cachedException;
      }
    }
  }
  return b.toString();
}

Fixed version (ground truth):
private String readBody(final InputStream in) throws BatchException {
  byte[] tmp=new byte[2048];
  int count;
  BatchException cachedException=null;
  StringBuffer b=new StringBuffer();
  try {
    count=in.read(tmp);
    while (count >= 0) {
      b.append(new String(tmp,0,count,"String_Node_Str"));
      count=in.read(tmp);
    }
  }
 catch (  IOException e) {
    cachedException=new BatchException(ODataMessageException.COMMON,e);
    throw cachedException;
  }
 finally {
    try {
      in.close();
    }
 catch (    IOException e) {
      if (cachedException != null) {
        throw cachedException;
      }
    }
  }
  return b.toString();
}
Program: 17827
Project: 17827
Buggy source:
private Map<String,String> parseHeaders(final Scanner scanner) throws BatchException {
  Map<String,String> headers=new HashMap<String,String>();
  while (scanner.hasNext() && !(scanner.hasNext(REG_EX_BLANK_LINE))) {
    if (scanner.hasNext(REG_EX_HEADER)) {
      scanner.next(REG_EX_HEADER);
      currentLineNumber++;
      MatchResult result=scanner.match();
      if (result.groupCount() == 2) {
        String headerName=result.group(1).trim().toLowerCase();
        String headerValue=result.group(2).trim();
        headers.put(headerName,headerValue);
      }
    }
 else {
      throw new BatchException(BatchException.INVALID_HEADER.addContent(scanner.next()));
    }
  }
  return headers;
}

Fixed version (ground truth):
private Map<String,String> parseHeaders(final Scanner scanner) throws BatchException {
  Map<String,String> headers=new HashMap<String,String>();
  while (scanner.hasNext() && !(scanner.hasNext(REG_EX_BLANK_LINE))) {
    if (scanner.hasNext(REG_EX_HEADER)) {
      scanner.next(REG_EX_HEADER);
      currentLineNumber++;
      MatchResult result=scanner.match();
      if (result.groupCount() == 2) {
        String headerName=result.group(1).trim().toLowerCase(Locale.ENGLISH);
        String headerValue=result.group(2).trim();
        headers.put(headerName,headerValue);
      }
    }
 else {
      throw new BatchException(BatchException.INVALID_HEADER.addContent(scanner.next()));
    }
  }
  return headers;
}
Program: 17828
Project: 17828
Buggy source:
private InputStream parseBody(final Scanner scanner){
  String body=null;
  InputStream requestBody;
  while (scanner.hasNext() && !scanner.hasNext(REG_EX_ANY_BOUNDARY_STRING)) {
    if (!scanner.hasNext(REG_EX_ZERO_OR_MORE_WHITESPACES)) {
      if (body == null) {
        body=scanner.next();
      }
 else {
        body=body + LF + scanner.next();
      }
    }
 else {
      scanner.next();
    }
    currentLineNumber++;
  }
  if (body != null) {
    requestBody=new ByteArrayInputStream(body.getBytes());
  }
 else {
    requestBody=new ByteArrayInputStream("String_Node_Str".getBytes());
  }
  return requestBody;
}

Fixed version (ground truth):
private InputStream parseBody(final Scanner scanner){
  try {
    String body=null;
    InputStream requestBody;
    while (scanner.hasNext() && !scanner.hasNext(REG_EX_ANY_BOUNDARY_STRING)) {
      if (!scanner.hasNext(REG_EX_ZERO_OR_MORE_WHITESPACES)) {
        if (body == null) {
          body=scanner.next();
        }
 else {
          body=body + LF + scanner.next();
        }
      }
 else {
        scanner.next();
      }
      currentLineNumber++;
    }
    if (body != null) {
      requestBody=new ByteArrayInputStream(body.getBytes("String_Node_Str"));
    }
 else {
      requestBody=new ByteArrayInputStream("String_Node_Str".getBytes("String_Node_Str"));
    }
    return requestBody;
  }
 catch (  UnsupportedEncodingException e) {
    throw new ODataRuntimeException(e);
  }
}
Program: 17829
Project: 17829
Buggy source:
public List<BatchPart> parse(final InputStream in) throws BatchException {
  Scanner scanner=new Scanner(in).useDelimiter(LF);
  baseUri=getBaseUri();
  List<BatchPart> requestList;
  try {
    requestList=parseBatchRequest(scanner);
  }
  finally {
    scanner.close();
    try {
      in.close();
    }
 catch (    IOException e) {
      throw new ODataRuntimeException(e);
    }
  }
  return requestList;
}

Fixed version (ground truth):
public List<BatchPart> parse(final InputStream in) throws BatchException {
  Scanner scanner=new Scanner(in,"String_Node_Str").useDelimiter(LF);
  baseUri=getBaseUri();
  List<BatchPart> requestList;
  try {
    requestList=parseBatchRequest(scanner);
  }
  finally {
    scanner.close();
    try {
      in.close();
    }
 catch (    IOException e) {
      throw new ODataRuntimeException(e);
    }
  }
  return requestList;
}
Program: 17833
Project: 17833
Buggy source:
@Override public WriteFeedCallbackResult retrieveFeedResult(final WriteFeedCallbackContext context) throws ODataApplicationException {
  Map<String,Object> roomData=new HashMap<String,Object>();
  roomData.put("String_Node_Str","String_Node_Str");
  roomData.put("String_Node_Str",1);
  List<Map<String,Object>> roomsData=new ArrayList<Map<String,Object>>();
  roomsData.add(roomData);
  WriteFeedCallbackResult result=new WriteFeedCallbackResult();
  result.setFeedData(roomsData);
  result.setInlineProperties(DEFAULT_PROPERTIES);
  return result;
}

Fixed version (ground truth):
@Override public WriteFeedCallbackResult retrieveFeedResult(final WriteFeedCallbackContext context) throws ODataApplicationException {
  WriteFeedCallbackResult result=new WriteFeedCallbackResult();
  result.setFeedData(new ArrayList<Map<String,Object>>());
  result.setInlineProperties(DEFAULT_PROPERTIES);
  return result;
}
Program: 17837
Project: 17837
Buggy source:
public TestUtilRuntimeException(final String msg){
  super(msg);
}

Fixed version (ground truth):
public TestUtilRuntimeException(final String msg,final Throwable e){
  super(msg,e);
}
Program: 17838
Project: 17838
Buggy source:
public InputStream getContentAsStream(){
  try {
    return new ByteArrayInputStream(content.getBytes(charset));
  }
 catch (  UnsupportedEncodingException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public InputStream getContentAsStream(){
  try {
    return new ByteArrayInputStream(content.getBytes(charset));
  }
 catch (  UnsupportedEncodingException e) {
    throw new TestUtilRuntimeException("String_Node_Str",e);
  }
}
Program: 17839
Project: 17839
Buggy source:
/** 
 * Write responses of single change requests in Change Set Response   {@link ODataResponse}
 * @param changeSetResponses a list of {@link ODataResponses}
 * @return Change Set Response as {@link ODataResponse}
 */
public static ODataResponse writeChangeSetResponse(final List<ODataResponse> changeSetResponses){
  return createEntityProvider().writeChangeSetResponse(changeSetResponses);
}

Fixed version (ground truth):
/** 
 * Write responses of single change requests in Change Set Response   {@link ODataResponse}
 * @param changeSetResponses a list of {@link ODataResponses}
 * @return Change Set Response as {@link ODataResponse}
 * @throws EntityProviderException 
 */
public static ODataResponse writeChangeSetResponse(final List<ODataResponse> changeSetResponses) throws EntityProviderException {
  return createEntityProvider().writeChangeSetResponse(changeSetResponses);
}
Program: 17840
Project: 17840
Buggy source:
/** 
 * Write responses of change sets and/or query operations in Batch Response as   {@link ODataResponse}. Batch Response body matches one-to-one with the corresponding Batch Request body
 * @param responses a list of {@link ODataResponses}
 * @return Batch Response as {@link ODataResponse}
 */
public static ODataResponse writeBatchResponse(final List<ODataResponse> responses){
  return createEntityProvider().writeBatchResponse(responses);
}

Fixed version (ground truth):
/** 
 * Write responses of change sets and/or query operations in Batch Response as   {@link ODataResponse}. Batch Response body matches one-to-one with the corresponding Batch Request body
 * @param responses a list of {@link ODataResponses}
 * @return Batch Response as {@link ODataResponse}
 * @throws EntityProviderException 
 */
public static ODataResponse writeBatchResponse(final List<ODataResponse> responses) throws EntityProviderException {
  return createEntityProvider().writeBatchResponse(responses);
}
Program: 17841
Project: 17841
Buggy source:
private void writeResponseBody(final List<ODataResponse> responses,final String boundary,final StringBuilder writer){
  for (  ODataResponse response : responses) {
    writer.append("String_Node_Str").append(boundary).append(LF);
    writeResponseBodyPart(response,writer);
  }
  writer.append("String_Node_Str").append(boundary).append("String_Node_Str");
}

Fixed version (ground truth):
private void writeResponseBody(final List<ODataResponse> responses,final String boundary,final StringBuilder writer) throws EntityProviderException {
  for (  ODataResponse response : responses) {
    writer.append("String_Node_Str").append(boundary).append(LF);
    writeResponseBodyPart(response,writer);
  }
  writer.append("String_Node_Str").append(boundary).append("String_Node_Str");
}
Program: 17842
Project: 17842
Buggy source:
public ODataResponse writeChangeSet(final List<ODataResponse> responses){
  String boundary=generateBoundary("String_Node_Str");
  StringBuilder writer=new StringBuilder();
  writeResponseBody(responses,boundary,writer);
  return ODataResponse.entity(writer.toString()).header(BatchConstants.HTTP_CONTENT_TYPE,BatchConstants.MULTIPART_MIXED + "String_Node_Str" + boundary+ "String_Node_Str").build();
}

Fixed version (ground truth):
public ODataResponse writeChangeSet(final List<ODataResponse> responses) throws EntityProviderException {
  String boundary=generateBoundary("String_Node_Str");
  StringBuilder writer=new StringBuilder();
  writeResponseBody(responses,boundary,writer);
  return ODataResponse.entity(writer.toString()).header(BatchConstants.HTTP_CONTENT_TYPE,BatchConstants.MULTIPART_MIXED + "String_Node_Str" + boundary+ "String_Node_Str").build();
}
Program: 17843
Project: 17843
Buggy source:
private void writeResponseBodyPart(final ODataResponse response,final StringBuilder writer){
  if (response.getContentHeader() != null && response.getContentHeader().matches(BatchConstants.MULTIPART_MIXED + "String_Node_Str")) {
    writeHeader(response,writer);
    writer.append(LF);
    writer.append(response.getEntity().toString()).append(LF);
  }
 else {
    writer.append(BatchConstants.HTTP_CONTENT_TYPE).append(COLON).append(SP).append(BatchConstants.HTTP_APPLICATION_HTTP).append(LF);
    writer.append(BatchConstants.HTTP_CONTENT_TRANSFER_ENCODING).append(COLON).append(SP).append("String_Node_Str").append(LF).append(LF);
    writer.append(response.getStatus().getStatusCode()).append(SP).append(response.getStatus().getInfo()).append(LF);
    writeHeader(response,writer);
    if (!HttpStatusCodes.NO_CONTENT.equals(response.getStatus())) {
      writer.append(BatchConstants.HTTP_CONTENT_LENGTH).append(COLON).append(SP).append(response.getEntity().toString().length()).append(LF).append(LF);
      writer.append(response.getEntity().toString()).append(LF);
    }
 else {
      writer.append(LF);
    }
  }
  writer.append(LF);
}

Fixed version (ground truth):
private void writeResponseBodyPart(final ODataResponse response,final StringBuilder writer) throws EntityProviderException {
  if (response.getContentHeader() != null && response.getContentHeader().matches(BatchConstants.MULTIPART_MIXED + "String_Node_Str")) {
    writeHeader(response,writer);
    writer.append(LF);
    writer.append(response.getEntity().toString()).append(LF);
  }
 else {
    writer.append(BatchConstants.HTTP_CONTENT_TYPE).append(COLON).append(SP).append(BatchConstants.HTTP_APPLICATION_HTTP).append(LF);
    writer.append(BatchConstants.HTTP_CONTENT_TRANSFER_ENCODING).append(COLON).append(SP).append("String_Node_Str").append(LF).append(LF);
    writer.append(response.getStatus().getStatusCode()).append(SP).append(response.getStatus().getInfo()).append(LF);
    writeHeader(response,writer);
    if (!HttpStatusCodes.NO_CONTENT.equals(response.getStatus())) {
      String body;
      if (response.getEntity() instanceof InputStream) {
        InputStream in=(InputStream)response.getEntity();
        body=readBody(in);
      }
 else {
        body=response.getEntity().toString();
      }
      writer.append(BatchConstants.HTTP_CONTENT_LENGTH).append(COLON).append(SP).append(body.length()).append(LF).append(LF);
      writer.append(body);
    }
    writer.append(LF);
  }
  writer.append(LF);
}
Program: 17844
Project: 17844
Buggy source:
public ODataResponse write(final List<ODataResponse> responses){
  String boundary=generateBoundary("String_Node_Str");
  StringBuilder writer=new StringBuilder();
  writeResponseBody(responses,boundary,writer);
  String batchResponseBody=writer.toString();
  return ODataResponse.entity(batchResponseBody).status(HttpStatusCodes.ACCEPTED).header(BatchConstants.HTTP_CONTENT_TYPE,BatchConstants.MULTIPART_MIXED + "String_Node_Str" + boundary+ "String_Node_Str").header(BatchConstants.HTTP_CONTENT_LENGTH,"String_Node_Str" + batchResponseBody.length()).build();
}

Fixed version (ground truth):
public ODataResponse write(final List<ODataResponse> responses) throws EntityProviderException {
  String boundary=generateBoundary("String_Node_Str");
  StringBuilder writer=new StringBuilder();
  writeResponseBody(responses,boundary,writer);
  String batchResponseBody=writer.toString();
  return ODataResponse.entity(batchResponseBody).status(HttpStatusCodes.ACCEPTED).header(BatchConstants.HTTP_CONTENT_TYPE,BatchConstants.MULTIPART_MIXED + "String_Node_Str" + boundary+ "String_Node_Str").header(BatchConstants.HTTP_CONTENT_LENGTH,"String_Node_Str" + batchResponseBody.length()).build();
}
Program: 17845
Project: 17845
Buggy source:
@Override public ODataResponse writeChangeSetResponse(final List<ODataResponse> responses){
  BatchResponseWriter batchWriter=new BatchResponseWriter();
  return batchWriter.writeChangeSet(responses);
}

Fixed version (ground truth):
@Override public ODataResponse writeChangeSetResponse(final List<ODataResponse> responses) throws EntityProviderException {
  BatchResponseWriter batchWriter=new BatchResponseWriter();
  return batchWriter.writeChangeSet(responses);
}
Program: 17846
Project: 17846
Buggy source:
@Override public ODataResponse writeBatchResponse(final List<ODataResponse> responses){
  BatchResponseWriter batchWriter=new BatchResponseWriter();
  return batchWriter.write(responses);
}

Fixed version (ground truth):
@Override public ODataResponse writeBatchResponse(final List<ODataResponse> responses) throws EntityProviderException {
  BatchResponseWriter batchWriter=new BatchResponseWriter();
  return batchWriter.write(responses);
}
Program: 17847
Project: 17847
Buggy source:
@Override public ODataResponse readEntitySimpleProperty(final GetSimplePropertyUriInfo uriInfo,final String contentType) throws ODataException {
  ODataResponse oDataResponse=ODataResponse.entity("String_Node_Str").status(HttpStatusCodes.OK).contentHeader("String_Node_Str").build();
  return oDataResponse;
}

Fixed version (ground truth):
@Override public ODataResponse readEntitySimpleProperty(final GetSimplePropertyUriInfo uriInfo,final String contentType) throws ODataException {
  CircleStreamBuffer buffer=new CircleStreamBuffer();
  BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(buffer.getOutputStream()));
  JsonStreamWriter jsonStreamWriter=new JsonStreamWriter(writer);
  try {
    jsonStreamWriter.beginObject();
    jsonStreamWriter.name(FormatJson.D);
    jsonStreamWriter.beginObject();
    jsonStreamWriter.namedStringValue("String_Node_Str","String_Node_Str");
    jsonStreamWriter.endObject();
    jsonStreamWriter.endObject();
    writer.flush();
    buffer.closeWrite();
  }
 catch (  IOException e) {
    buffer.close();
    throw new RuntimeException(e);
  }
  ODataResponse oDataResponse=ODataResponse.entity(buffer.getInputStream()).status(HttpStatusCodes.OK).contentHeader("String_Node_Str").build();
  return oDataResponse;
}
Program: 17848
Project: 17848
Buggy source:
public InputStream getContentAsStream(){
  try {
    return new ByteArrayInputStream(content.getBytes(charset));
  }
 catch (  UnsupportedEncodingException e) {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public InputStream getContentAsStream(){
  try {
    return new ByteArrayInputStream(content.getBytes(charset));
  }
 catch (  UnsupportedEncodingException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 17849
Project: 17849
Buggy source:
public InputStream getContentAsStream(){
  try {
    return new ByteArrayInputStream(content.getBytes(charset));
  }
 catch (  UnsupportedEncodingException e) {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public InputStream getContentAsStream(){
  try {
    return new ByteArrayInputStream(content.getBytes(charset));
  }
 catch (  UnsupportedEncodingException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 17852
Project: 17852
Buggy source:
public ODataResponse wrapResponse(){
  try {
    return ODataResponse.status(HttpStatusCodes.OK).entity(isJson ? wrapInJson(createParts()) : null).contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null).build();
  }
 catch (  final ODataException e) {
    throw new ODataRuntimeException("String_Node_Str");
  }
catch (  final IOException e) {
    throw new ODataRuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public ODataResponse wrapResponse(){
  try {
    return ODataResponse.status(HttpStatusCodes.OK).entity(isJson ? wrapInJson(createParts()) : null).contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null).build();
  }
 catch (  final ODataException e) {
    throw new ODataRuntimeException("String_Node_Str",e);
  }
catch (  final IOException e) {
    throw new ODataRuntimeException("String_Node_Str",e);
  }
}
Program: 17853
Project: 17853
Buggy source:
private void handleName(final JsonReader reader,final Map<String,Object> typeMappings,final EntityPropertyInfo entityPropertyInfo,final Map<String,Object> result,final String nextName) throws EntityProviderException {
  Object mapping=null;
  if (typeMappings != null) {
    mapping=typeMappings.get(nextName);
  }
  Object propertyValue=readPropertyValue(reader,entityPropertyInfo,mapping);
  result.put(nextName,propertyValue);
}

Fixed version (ground truth):
private void handleName(final JsonReader reader,final Map<String,Object> typeMappings,final EntityPropertyInfo entityPropertyInfo,final Map<String,Object> result,final String nextName) throws EntityProviderException {
  if (!entityPropertyInfo.getName().equals(nextName)) {
    throw new EntityProviderException(EntityProviderException.ILLEGAL_ARGUMENT.addContent(nextName));
  }
  Object mapping=null;
  if (typeMappings != null) {
    mapping=typeMappings.get(nextName);
  }
  Object propertyValue=readPropertyValue(reader,entityPropertyInfo,mapping);
  result.put(nextName,propertyValue);
}
Program: 17856
Project: 17856
Buggy source:
/** 
 * Valid input are <code>;</code> separated <code>key = value</code> pairs.
 * @param parameters
 * @return Map with keys mapped to values
 */
private static Map<String,String> parseParameters(final String parameters){
  Map<String,String> parameterMap=new HashMap<String,String>();
  if (parameters != null) {
    String[] splittedParameters=parameters.split(PARAMETER_SEPARATOR);
    for (    String parameter : splittedParameters) {
      String[] keyValue=parameter.split("String_Node_Str");
      String key=keyValue[0].trim().toLowerCase(Locale.ENGLISH);
      if (isParameterAllowed(key)) {
        String value=keyValue.length > 1 ? keyValue[1].trim() : null;
        parameterMap.put(key,value);
      }
    }
  }
  return parameterMap;
}

Fixed version (ground truth):
/** 
 * Valid input are <code>;</code> separated <code>key=value</code> pairs  without spaces between key and value. <p> See RFC 2616: The type, subtype, and parameter attribute names are case-insensitive.  Parameter values might or might not be case-sensitive, depending on the  semantics of the parameter name. <b>Linear white space (LWS) MUST NOT be used  between the type and subtype, nor between an attribute and its value</b>.  </p>
 * @param parameters
 * @return Map with keys mapped to values
 */
private static Map<String,String> parseParameters(final String parameters){
  Map<String,String> parameterMap=new HashMap<String,String>();
  if (parameters != null) {
    String[] splittedParameters=parameters.split(PARAMETER_SEPARATOR);
    for (    String parameter : splittedParameters) {
      String[] keyValue=parameter.split("String_Node_Str");
      String key=keyValue[0].trim().toLowerCase(Locale.ENGLISH);
      if (isParameterAllowed(key)) {
        String value=keyValue.length > 1 ? keyValue[1] : null;
        if (value != null && isLws(value.charAt(0))) {
          throw new IllegalArgumentException("String_Node_Str" + key + "String_Node_Str"+ parameters+ "String_Node_Str");
        }
        parameterMap.put(key,value);
      }
    }
  }
  return parameterMap;
}
Program: 17857
Project: 17857
Buggy source:
public static ContentType extractRequestContentType(final SubLocatorParameter param) throws ODataUnsupportedMediaTypeException {
  final MediaType requestMediaType=param.getHttpHeaders().getMediaType();
  if (requestMediaType == null) {
    return ContentType.APPLICATION_OCTET_STREAM;
  }
 else   if (requestMediaType == MediaType.WILDCARD_TYPE || requestMediaType == MediaType.TEXT_PLAIN_TYPE || requestMediaType == MediaType.APPLICATION_XML_TYPE) {
    throw new ODataUnsupportedMediaTypeException(ODataUnsupportedMediaTypeException.NOT_SUPPORTED.addContent(param.getHttpHeaders().getRequestHeader(HttpHeaders.CONTENT_TYPE).get(0)));
  }
 else {
    try {
      return ContentType.create(requestMediaType.toString());
    }
 catch (    IllegalArgumentException e) {
      throw new ODataUnsupportedMediaTypeException(ODataUnsupportedMediaTypeException.NOT_SUPPORTED.addContent(requestMediaType.toString()),e);
    }
  }
}

Fixed version (ground truth):
public static ContentType extractRequestContentType(final SubLocatorParameter param) throws ODataUnsupportedMediaTypeException, ODataBadRequestException {
  final MediaType requestMediaType=param.getHttpHeaders().getMediaType();
  if (requestMediaType == null) {
    return ContentType.APPLICATION_OCTET_STREAM;
  }
 else   if (requestMediaType == MediaType.WILDCARD_TYPE || requestMediaType == MediaType.TEXT_PLAIN_TYPE || requestMediaType == MediaType.APPLICATION_XML_TYPE) {
    throw new ODataUnsupportedMediaTypeException(ODataUnsupportedMediaTypeException.NOT_SUPPORTED.addContent(param.getHttpHeaders().getRequestHeader(HttpHeaders.CONTENT_TYPE).get(0)));
  }
 else {
    try {
      final String contentType=param.getHttpHeaders().getHeaderString(HttpHeaders.CONTENT_TYPE);
      if (ContentType.isParseable(contentType)) {
        return ContentType.create(contentType);
      }
      throw new ODataBadRequestException(ODataBadRequestException.INVALID_HEADER.addContent(HttpHeaders.CONTENT_TYPE,contentType));
    }
 catch (    IllegalArgumentException e) {
      throw new ODataUnsupportedMediaTypeException(ODataUnsupportedMediaTypeException.NOT_SUPPORTED.addContent(requestMediaType.toString()),e);
    }
  }
}
Program: 17858
Project: 17858
Buggy source:
public static List<String> extractAcceptHeaders(final SubLocatorParameter param) throws ODataBadRequestException {
  final List<MediaType> acceptableMediaTypes=param.getHttpHeaders().getAcceptableMediaTypes();
  final List<String> mediaTypes=new ArrayList<String>();
  for (  final MediaType mediaType : acceptableMediaTypes) {
    mediaTypes.add(mediaType.toString());
  }
  return mediaTypes;
}

Fixed version (ground truth):
public static List<String> extractAcceptHeaders(final SubLocatorParameter param) throws ODataBadRequestException {
  List<String> acceptHeaders=param.getHttpHeaders().getRequestHeader(HttpHeaders.ACCEPT);
  for (  String acceptHeader : acceptHeaders) {
    String[] contentTypes=acceptHeader.split("String_Node_Str");
    for (    String contentType : contentTypes) {
      if (!ContentType.isParseable(contentType.trim())) {
        throw new ODataBadRequestException(ODataBadRequestException.INVALID_HEADER.addContent(HttpHeaders.ACCEPT,acceptHeader));
      }
    }
  }
  final List<String> mediaTypes=new ArrayList<String>();
  final List<MediaType> acceptableMediaTypes=param.getHttpHeaders().getAcceptableMediaTypes();
  for (  final MediaType mediaType : acceptableMediaTypes) {
    mediaTypes.add(mediaType.toString());
  }
  return mediaTypes;
}
Program: 17859
Project: 17859
Buggy source:
public ODataExceptionWrapper(final UriInfo uriInfo,final HttpHeaders httpHeaders,final ServletConfig servletConfig){
  contentType=getContentType(uriInfo,httpHeaders).toContentTypeString();
  messageLocale=MessageService.getSupportedLocale(getLanguages(httpHeaders),DEFAULT_RESPONSE_LOCALE);
  httpRequestHeaders=httpHeaders.getRequestHeaders();
  requestUri=uriInfo.getRequestUri();
  try {
    callback=getErrorHandlerCallbackFromServletConfig(servletConfig);
  }
 catch (  Exception e) {
    throw new ODataRuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public ODataExceptionWrapper(final UriInfo uriInfo,final HttpHeaders httpHeaders,final ServletConfig servletConfig,final HttpServletRequest servletRequest){
  contentType=getContentType(uriInfo,httpHeaders).toContentTypeString();
  messageLocale=MessageService.getSupportedLocale(getLanguages(httpHeaders),DEFAULT_RESPONSE_LOCALE);
  httpRequestHeaders=httpHeaders.getRequestHeaders();
  requestUri=uriInfo.getRequestUri();
  try {
    callback=getErrorHandlerCallbackFromServletConfig(servletConfig,servletRequest);
  }
 catch (  Exception e) {
    throw new ODataRuntimeException("String_Node_Str",e);
  }
}
Program: 17860
Project: 17860
Buggy source:
private ODataErrorCallback getErrorHandlerCallbackFromServletConfig(final ServletConfig servletConfig) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
  ODataErrorCallback callback=null;
  final String factoryClassName=servletConfig.getInitParameter(ODataServiceFactory.FACTORY_LABEL);
  if (factoryClassName != null) {
    Class<?> factoryClass=Class.forName(factoryClassName);
    final ODataServiceFactory serviceFactory=(ODataServiceFactory)factoryClass.newInstance();
    callback=serviceFactory.getCallback(ODataErrorCallback.class);
  }
  return callback;
}

Fixed version (ground truth):
private ODataErrorCallback getErrorHandlerCallbackFromServletConfig(final ServletConfig servletConfig,HttpServletRequest servletRequest) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
  ODataErrorCallback callback=null;
  final String factoryClassName=servletConfig.getInitParameter(ODataServiceFactory.FACTORY_LABEL);
  if (factoryClassName != null) {
    ClassLoader cl=(ClassLoader)servletRequest.getAttribute(ODataServiceFactory.FACTORY_CLASSLOADER_LABEL);
    Class<?> factoryClass;
    if (cl == null) {
      factoryClass=Class.forName(factoryClassName);
    }
 else {
      factoryClass=Class.forName(factoryClassName,true,cl);
    }
    final ODataServiceFactory serviceFactory=(ODataServiceFactory)factoryClass.newInstance();
    callback=serviceFactory.getCallback(ODataErrorCallback.class);
  }
  return callback;
}
Program: 17861
Project: 17861
Buggy source:
private ODataErrorCallback getErrorHandlerCallback() throws ClassNotFoundException, InstantiationException, IllegalAccessException {
  ODataErrorCallback callback=null;
  final String factoryClassName=servletConfig.getInitParameter(ODataServiceFactory.FACTORY_LABEL);
  if (factoryClassName != null) {
    Class<?> factoryClass=Class.forName(factoryClassName);
    final ODataServiceFactory serviceFactory=(ODataServiceFactory)factoryClass.newInstance();
    callback=serviceFactory.getCallback(ODataErrorCallback.class);
  }
  return callback;
}

Fixed version (ground truth):
private ODataErrorCallback getErrorHandlerCallback() throws ClassNotFoundException, InstantiationException, IllegalAccessException {
  ODataErrorCallback callback=null;
  final String factoryClassName=servletConfig.getInitParameter(ODataServiceFactory.FACTORY_LABEL);
  if (factoryClassName != null) {
    ClassLoader cl=(ClassLoader)servletRequest.getAttribute(ODataServiceFactory.FACTORY_CLASSLOADER_LABEL);
    Class<?> factoryClass;
    if (cl == null) {
      factoryClass=Class.forName(factoryClassName);
    }
 else {
      factoryClass=Class.forName(factoryClassName,true,cl);
    }
    final ODataServiceFactory serviceFactory=(ODataServiceFactory)factoryClass.newInstance();
    callback=serviceFactory.getCallback(ODataErrorCallback.class);
  }
  return callback;
}
Program: 17862
Project: 17862
Buggy source:
private ODataResponse handleException(final Exception exception){
  ODataExceptionWrapper exceptionWrapper=new ODataExceptionWrapper(uriInfo,httpHeaders,servletConfig);
  ODataResponse oDataResponse=exceptionWrapper.wrapInExceptionResponse(exception);
  return oDataResponse;
}

Fixed version (ground truth):
private ODataResponse handleException(final Exception exception){
  ODataExceptionWrapper exceptionWrapper=new ODataExceptionWrapper(uriInfo,httpHeaders,servletConfig,servletRequest);
  ODataResponse oDataResponse=exceptionWrapper.wrapInExceptionResponse(exception);
  return oDataResponse;
}
Program: 17863
Project: 17863
Buggy source:
@Before public void before() throws URISyntaxException {
  exceptionMapper=new ODataExceptionMapperImpl();
  exceptionMapper.httpHeaders=mock(HttpHeaders.class);
  exceptionMapper.uriInfo=mock(UriInfo.class);
  exceptionMapper.servletConfig=mock(ServletConfig.class);
  MultivaluedHashMap<String,String> map=new MultivaluedHashMap<String,String>();
  when(exceptionMapper.uriInfo.getQueryParameters()).thenReturn(map);
  uri=new URI("String_Node_Str");
  when(exceptionMapper.uriInfo.getRequestUri()).thenReturn(uri);
  MultivaluedHashMap<String,String> httpHeaders=new MultivaluedHashMap<String,String>();
  when(exceptionMapper.httpHeaders.getRequestHeaders()).thenReturn(httpHeaders);
  disableLogging();
}

Fixed version (ground truth):
@Before public void before() throws URISyntaxException {
  exceptionMapper=new ODataExceptionMapperImpl();
  exceptionMapper.httpHeaders=mock(HttpHeaders.class);
  exceptionMapper.uriInfo=mock(UriInfo.class);
  exceptionMapper.servletConfig=mock(ServletConfig.class);
  exceptionMapper.servletRequest=mock(HttpServletRequest.class);
  MultivaluedHashMap<String,String> map=new MultivaluedHashMap<String,String>();
  when(exceptionMapper.uriInfo.getQueryParameters()).thenReturn(map);
  uri=new URI("String_Node_Str");
  when(exceptionMapper.uriInfo.getRequestUri()).thenReturn(uri);
  MultivaluedHashMap<String,String> httpHeaders=new MultivaluedHashMap<String,String>();
  when(exceptionMapper.httpHeaders.getRequestHeaders()).thenReturn(httpHeaders);
  disableLogging();
}