nus-yam/ex-repair huggingface dataset:
Program: 162228
Project: 162228
Buggy source:
private char nextChar(int i) throws EndOfPathException {
  SuffixNode node=selectNode();
  if (diff(node) >= active.activeLength) {
    return input[active.activeNode.child[input[active.activeEdge]].start + active.activeLength];
  }
  if (diff(node) + 1 == active.activeLength) {
    if (node.child[input[i]] != null) {
      return input[i];
    }
  }
 else {
    active.activeNode=node;
    active.activeLength=active.activeLength - diff(node) - 1;
    active.activeEdge=active.activeEdge + diff(node) + 1;
    return input[active.activeNode.child[input[active.activeEdge]].start + active.activeLength];
  }
  throw new EndOfPathException();
}

Fixed version (ground truth):
private char nextChar(int i) throws EndOfPathException {
  SuffixNode node=selectNode();
  if (diff(node) >= active.activeLength) {
    return input[active.activeNode.child[input[active.activeEdge]].start + active.activeLength];
  }
  if (diff(node) + 1 == active.activeLength) {
    if (node.child[input[i]] != null) {
      return input[i];
    }
  }
 else {
    active.activeNode=node;
    active.activeLength=active.activeLength - diff(node) - 1;
    active.activeEdge=active.activeEdge + diff(node) + 1;
    return nextChar(i);
  }
  throw new EndOfPathException();
}
Program: 162230
Project: 162230
Buggy source:
public boolean partition(int arr[]){
  int sum=0;
  for (int i=0; i < arr.length; i++) {
    sum+=arr[i];
  }
  if (sum % 2 != 0) {
    return false;
  }
  sum=sum / 2;
  boolean[][] T=new boolean[arr.length + 1][sum + 1];
  for (int i=0; i <= arr.length; i++) {
    T[i][0]=true;
  }
  for (int i=1; i <= arr.length; i++) {
    for (int j=1; j <= sum; j++) {
      if (j - arr[i - 1] >= 0) {
        T[i][j]=T[i - 1][j - arr[i - 1]] || T[i - 1][j];
      }
    }
  }
  return T[arr.length][sum];
}

Fixed version (ground truth):
public boolean partition(int arr[]){
  int sum=0;
  for (int i=0; i < arr.length; i++) {
    sum+=arr[i];
  }
  if (sum % 2 != 0) {
    return false;
  }
  sum=sum / 2;
  boolean[][] T=new boolean[arr.length + 1][sum + 1];
  for (int i=0; i <= arr.length; i++) {
    T[i][0]=true;
  }
  for (int i=1; i <= arr.length; i++) {
    for (int j=1; j <= sum; j++) {
      if (j - arr[i - 1] >= 0) {
        T[i][j]=T[i - 1][j - arr[i - 1]] || T[i - 1][j];
      }
 else {
        T[i][j]=T[i - 1][j];
      }
    }
  }
  return T[arr.length][sum];
}
Program: 162231
Project: 162231
Buggy source:
public static void main(String args[]){
  SubsetSum ss=new SubsetSum();
  int arr[]={1,3,5,5,2,1,1,6};
  boolean r=ss.partition(arr);
  System.out.print(r);
}

Fixed version (ground truth):
public static void main(String args[]){
  SubsetSum ss=new SubsetSum();
  int arr[]={1,3,5,5,2,1,1,6};
  System.out.println(ss.partition(arr));
  int arr1[]={2,3,7,8};
  System.out.print(ss.subsetSum(arr1,11));
}
Program: 162232
Project: 162232
Buggy source:
private KadaneResult kadane(int arr[]){
  int max=0;
  int maxStart=-1;
  int maxEnd=-1;
  int currentStart=0;
  int maxSoFar=0;
  for (int i=0; i < arr.length; i++) {
    maxSoFar+=arr[i];
    if (maxSoFar < 0) {
      maxSoFar=0;
      currentStart=i + 1;
    }
    if (max < maxSoFar) {
      maxStart=currentStart;
      maxEnd=i;
      max=maxSoFar;
    }
  }
  return new KadaneResult(maxSoFar,maxStart,maxEnd);
}

Fixed version (ground truth):
private KadaneResult kadane(int arr[]){
  int max=0;
  int maxStart=-1;
  int maxEnd=-1;
  int currentStart=0;
  int maxSoFar=0;
  for (int i=0; i < arr.length; i++) {
    maxSoFar+=arr[i];
    if (maxSoFar < 0) {
      maxSoFar=0;
      currentStart=i + 1;
    }
    if (max < maxSoFar) {
      maxStart=currentStart;
      maxEnd=i;
      max=maxSoFar;
    }
  }
  return new KadaneResult(max,maxStart,maxEnd);
}
Program: 162233
Project: 162233
Buggy source:
private int rangeMinimumQueryLazy(int segmentTree[],int lazy[],int qlow,int qhigh,int low,int high,int pos){
  if (qlow > high || qhigh < low) {
    return Integer.MAX_VALUE;
  }
  if (lazy[pos] != 0) {
    segmentTree[pos]+=lazy[pos];
    if (low != high) {
      segmentTree[2 * pos + 1]+=lazy[pos];
      segmentTree[2 * pos + 2]+=lazy[pos];
    }
    lazy[pos]=0;
  }
  if (qlow <= low && qhigh >= high) {
    return segmentTree[pos];
  }
  int mid=(low + high) / 2;
  return Math.min(rangeMinimumQuery(segmentTree,low,mid,qlow,qhigh,2 * pos + 1),rangeMinimumQuery(segmentTree,mid + 1,high,qlow,qhigh,2 * pos + 2));
}

Fixed version (ground truth):
private int rangeMinimumQueryLazy(int segmentTree[],int lazy[],int qlow,int qhigh,int low,int high,int pos){
  if (low > high) {
    return Integer.MAX_VALUE;
  }
  if (lazy[pos] != 0) {
    segmentTree[pos]+=lazy[pos];
    if (low != high) {
      lazy[2 * pos + 1]+=lazy[pos];
      lazy[2 * pos + 2]+=lazy[pos];
    }
    lazy[pos]=0;
  }
  if (qlow > high || qhigh < low) {
    return Integer.MAX_VALUE;
  }
  if (qlow <= low && qhigh >= high) {
    return segmentTree[pos];
  }
  int mid=(low + high) / 2;
  return Math.min(rangeMinimumQueryLazy(segmentTree,lazy,qlow,qhigh,low,mid,2 * pos + 1),rangeMinimumQueryLazy(segmentTree,lazy,qlow,qhigh,mid + 1,high,2 * pos + 2));
}
Program: 162234
Project: 162234
Buggy source:
/** 
 * Creates a new segment tree based off input array.
 */
public int[] createSegmentTree(int input[]){
  NextPowerOf2 np2=new NextPowerOf2();
  int nextPowOfTwo=np2.nextPowerOf2(input.length);
  int segmentTree[]=new int[nextPowOfTwo * 2 - 1];
  for (int i=0; i < segmentTree.length; i++) {
    segmentTree[i]=Integer.MAX_VALUE;
  }
  constructMinSegmentTreeTree(segmentTree,input,0,input.length - 1,0);
  return segmentTree;
}

Fixed version (ground truth):
/** 
 * Creates a new segment tree based off input array.
 */
public int[] createSegmentTree(int input[]){
  NextPowerOf2 np2=new NextPowerOf2();
  int nextPowOfTwo=np2.nextPowerOf2(input.length);
  int segmentTree[]=new int[nextPowOfTwo * 2 - 1];
  for (int i=0; i < segmentTree.length; i++) {
    segmentTree[i]=Integer.MAX_VALUE;
  }
  constructMinSegmentTree(segmentTree,input,0,input.length - 1,0);
  return segmentTree;
}
Program: 162235
Project: 162235
Buggy source:
/** 
 * Segment tree for given example -1 0                -1 0       2         1         -1 0    3   4   2     1   6    max   max 
 */
public static void main(String args[]){
}

Fixed version (ground truth):
public static void main(String args[]){
}
Program: 162236
Project: 162236
Buggy source:
private void updateSegmentTreeRangeLazy(int segmentTree[],int lazy[],int startRange,int endRange,int delta,int low,int high,int pos){
  if (low > high || startRange > high || endRange < low) {
    return;
  }
  if (lazy[pos] != 0) {
    if (low != high) {
      segmentTree[2 * pos + 1]+=lazy[pos];
      segmentTree[2 * pos + 2]+=lazy[pos];
    }
    lazy[pos]=0;
  }
  if (startRange <= low && endRange >= high) {
    segmentTree[pos]+=delta;
    if (low != high) {
      lazy[2 * pos + 1]+=delta;
      lazy[2 * pos + 2]+=delta;
    }
    return;
  }
  int mid=(low + high) / 2;
  updateSegmentTreeRangeLazy(segmentTree,lazy,startRange,endRange,delta,low,mid,2 * pos + 1);
  updateSegmentTreeRangeLazy(segmentTree,lazy,startRange,endRange,delta,mid + 1,high,2 * pos + 1);
  segmentTree[pos]=Math.min(segmentTree[2 * pos + 1],segmentTree[2 * pos + 2]);
}

Fixed version (ground truth):
private void updateSegmentTreeRangeLazy(int segmentTree[],int lazy[],int startRange,int endRange,int delta,int low,int high,int pos){
  if (low > high) {
    return;
  }
  if (lazy[pos] != 0) {
    segmentTree[pos]+=lazy[pos];
    if (low != high) {
      lazy[2 * pos + 1]+=lazy[pos];
      lazy[2 * pos + 2]+=lazy[pos];
    }
    lazy[pos]=0;
  }
  if (startRange > high || endRange < low) {
    return;
  }
  if (startRange <= low && endRange >= high) {
    segmentTree[pos]+=delta;
    if (low != high) {
      lazy[2 * pos + 1]+=delta;
      lazy[2 * pos + 2]+=delta;
    }
    return;
  }
  int mid=(low + high) / 2;
  updateSegmentTreeRangeLazy(segmentTree,lazy,startRange,endRange,delta,low,mid,2 * pos + 1);
  updateSegmentTreeRangeLazy(segmentTree,lazy,startRange,endRange,delta,mid + 1,high,2 * pos + 2);
  segmentTree[pos]=Math.min(segmentTree[2 * pos + 1],segmentTree[2 * pos + 2]);
}
Program: 162237
Project: 162237
Buggy source:
private void combinationUtil(int arr[],int k,int start,int sum,int total,int pos,List<Integer> result){
}

Fixed version (ground truth):
private void combinationUtil(int arr[],int k,int start,int sum,int total,int pos,List<Integer> result){
  if (pos == k) {
    if (Math.abs(sum - total / 2) < minFoundSoFar) {
      minFoundSoFar=Math.abs(sum - total / 2);
      System.out.println(result);
    }
    return;
  }
  for (int i=start; i < arr.length; i++) {
    sum+=arr[i];
    result.add(arr[i]);
    combinationUtil(arr,k,i + 1,sum,total,pos + 1,result);
    result.remove(result.size() - 1);
    sum-=arr[i];
  }
}
Program: 162238
Project: 162238
Buggy source:
public Deque<Interval> mergeInterval(Interval[] intervals){
  Deque<Interval> stack=new LinkedList<Interval>();
  stack.offerFirst(intervals[0]);
  for (int i=1; i < intervals.length; i++) {
    Interval curr=stack.peekFirst();
    if (curr.end <= intervals[i].start) {
      stack.offerFirst(intervals[i]);
    }
 else     if (curr.end > intervals[i].start) {
      Interval newInterval=mergeOverlap(curr,intervals[i]);
      if (newInterval != null) {
        stack.offerFirst(newInterval);
      }
    }
  }
  return stack;
}

Fixed version (ground truth):
public Deque<Interval> mergeInterval(Interval[] intervals){
  Deque<Interval> stack=new LinkedList<Interval>();
  stack.offerFirst(intervals[0]);
  for (int i=1; i < intervals.length; i++) {
    Interval curr=stack.peekFirst();
    if (curr.end < intervals[i].start) {
      stack.offerFirst(intervals[i]);
    }
 else     if (curr.end >= intervals[i].start) {
      Interval newInterval=mergeOverlap(curr,intervals[i]);
      if (newInterval != null) {
        stack.offerFirst(newInterval);
      }
    }
  }
  return stack;
}
Program: 162239
Project: 162239
Buggy source:
public static void main(String args[]){
  Interval intervals[]=new Interval[6];
  intervals[0]=new Interval(0,2,3);
  intervals[1]=new Interval(2,6,5);
  intervals[2]=new Interval(4,8,8);
  intervals[3]=new Interval(5,9,10);
  intervals[4]=new Interval(6,10,9);
  intervals[5]=new Interval(7,11,8);
  HorizonMapping hm=new HorizonMapping();
  Deque<Interval> ll=hm.mergeInterval(intervals);
  Iterator<Interval> itr=ll.iterator();
  while (itr.hasNext()) {
    System.out.println(itr.next());
  }
}

Fixed version (ground truth):
public static void main(String args[]){
  Interval intervals[]=new Interval[6];
  intervals[0]=new Interval(0,2,3);
  intervals[1]=new Interval(2,6,3);
  intervals[2]=new Interval(4,8,8);
  intervals[3]=new Interval(5,9,10);
  intervals[4]=new Interval(6,10,9);
  intervals[5]=new Interval(7,11,8);
  HorizonMapping hm=new HorizonMapping();
  Deque<Interval> ll=hm.mergeInterval(intervals);
  Iterator<Interval> itr=ll.iterator();
  while (itr.hasNext()) {
    System.out.println(itr.next());
  }
}
Program: 162240
Project: 162240
Buggy source:
public int allTimeProfit(int arr[]){
  int profit=0;
  int localMin=arr[0];
  for (int i=1; i < arr.length; i++) {
    if (arr[i - 1] < arr[i]) {
      continue;
    }
    profit+=arr[i - 1] - localMin;
    localMin=arr[i];
  }
  return profit;
}

Fixed version (ground truth):
public int allTimeProfit(int arr[]){
  int profit=0;
  int localMin=arr[0];
  for (int i=1; i < arr.length; i++) {
    if (arr[i - 1] >= arr[i]) {
      localMin=arr[i];
    }
 else {
      profit+=arr[i] - localMin;
      localMin=arr[i];
    }
  }
  return profit;
}
Program: 162241
Project: 162241
Buggy source:
public static void main(String args[]){
  int arr[]={7,10,15,5,11,2,7,9,3};
  BuySellStockProfit bss=new BuySellStockProfit();
  System.out.println(bss.oneProfit(arr));
  System.out.print(bss.allTimeProfit(arr));
}

Fixed version (ground truth):
public static void main(String args[]){
  int arr[]={7,10,15,5,11,2,7,9,3};
  int arr1[]={6,4,1,3,5,7,3,1,3,4};
  BuySellStockProfit bss=new BuySellStockProfit();
  System.out.println(bss.oneProfit(arr));
  System.out.print(bss.allTimeProfit(arr1));
}
Program: 162242
Project: 162242
Buggy source:
private Node findRightSibling(Node root){
  if (root == null) {
    return null;
  }
  if (root.left != null) {
    return root.left;
  }
 else   if (root.right != null) {
    return root.right;
  }
  return findRightSibling(root.right);
}

Fixed version (ground truth):
private Node findRightSibling(Node root){
  if (root == null) {
    return null;
  }
  if (root.left != null) {
    return root.left;
  }
 else   if (root.right != null) {
    return root.right;
  }
  return findRightSibling(root.next);
}
Program: 162243
Project: 162243
Buggy source:
@Override protected Mono<Void> doNotify(InstanceEvent event,Instance instance){
  HttpHeaders headers=new HttpHeaders();
  headers.setContentType(MediaType.APPLICATION_JSON);
  String auth=Base64Utils.encodeToString(String.format("String_Node_Str",token,username).getBytes());
  headers.add(HttpHeaders.AUTHORIZATION,String.format("String_Node_Str",auth));
  return Mono.fromRunnable(() -> restTemplate.exchange(createUrl(),HttpMethod.POST,new HttpEntity<>(createMessage(event,instance),headers),Void.class));
}

Fixed version (ground truth):
@Override protected Mono<Void> doNotify(InstanceEvent event,Instance instance){
  HttpHeaders headers=new HttpHeaders();
  headers.setContentType(MediaType.APPLICATION_JSON);
  String auth=Base64Utils.encodeToString(String.format("String_Node_Str",token,username).getBytes(StandardCharsets.UTF_8));
  headers.add(HttpHeaders.AUTHORIZATION,String.format("String_Node_Str",auth));
  return Mono.fromRunnable(() -> restTemplate.exchange(createUrl(),HttpMethod.POST,new HttpEntity<>(createMessage(event,instance),headers),Void.class));
}
Program: 162244
Project: 162244
Buggy source:
public Map<String,NotificationFilter> getNotificationFilters(){
synchronized (filters) {
    return Collections.unmodifiableMap(new HashMap<>(filters));
  }
}

Fixed version (ground truth):
public Map<String,NotificationFilter> getNotificationFilters(){
  return Collections.unmodifiableMap(new HashMap<>(filters));
}
Program: 162245
Project: 162245
Buggy source:
private HttpEntity<?> expectedMessage(String message){
  HttpHeaders httpHeaders=new HttpHeaders();
  httpHeaders.setContentType(MediaType.APPLICATION_JSON);
  String auth=Base64Utils.encodeToString(String.format("String_Node_Str",token,user).getBytes());
  httpHeaders.add(HttpHeaders.AUTHORIZATION,String.format("String_Node_Str",auth));
  Map<String,Object> messageJson=new HashMap<>();
  messageJson.put("String_Node_Str",message);
  return new HttpEntity<>(messageJson,httpHeaders);
}

Fixed version (ground truth):
private HttpEntity<?> expectedMessage(String message){
  HttpHeaders httpHeaders=new HttpHeaders();
  httpHeaders.setContentType(MediaType.APPLICATION_JSON);
  String auth=Base64Utils.encodeToString(String.format("String_Node_Str",token,user).getBytes(StandardCharsets.UTF_8));
  httpHeaders.add(HttpHeaders.AUTHORIZATION,String.format("String_Node_Str",auth));
  Map<String,Object> messageJson=new HashMap<>();
  messageJson.put("String_Node_Str",message);
  return new HttpEntity<>(messageJson,httpHeaders);
}
Program: 162246
Project: 162246
Buggy source:
@Override protected void doNotify(ClientApplicationEvent event) throws Exception {
  Message message;
  if (event instanceof ClientApplicationRegisteredEvent) {
    message=getRegisteredMessage(event.getApplication());
  }
 else   if (event instanceof ClientApplicationDeregisteredEvent) {
    message=getDeregisteredMessage(event.getApplication());
  }
 else   if (event instanceof ClientApplicationStatusChangedEvent) {
    ClientApplicationStatusChangedEvent statusChangedEvent=(ClientApplicationStatusChangedEvent)event;
    message=getStatusChangedMessage(statusChangedEvent.getApplication(),statusChangedEvent.getFrom(),statusChangedEvent.getTo());
  }
 else {
    return;
  }
  this.restTemplate.postForObject(webhookUrl,message,Void.class);
}

Fixed version (ground truth):
@Override protected void doNotify(ClientApplicationEvent event) throws Exception {
  Message message;
  if (event instanceof ClientApplicationRegisteredEvent) {
    message=getRegisteredMessage(event.getApplication());
  }
 else   if (event instanceof ClientApplicationDeregisteredEvent) {
    message=getDeregisteredMessage(event.getApplication());
  }
 else   if (event instanceof ClientApplicationStatusChangedEvent) {
    ClientApplicationStatusChangedEvent statusChangedEvent=(ClientApplicationStatusChangedEvent)event;
    message=getStatusChangedMessage(statusChangedEvent.getApplication(),statusChangedEvent.getFrom(),statusChangedEvent.getTo());
  }
 else {
    return;
  }
  this.restTemplate.postForEntity(webhookUrl,message,Void.class);
}
Program: 162247
Project: 162247
Buggy source:
@Test public void test_onClientApplicationDeRegisteredEvent_resolve() throws Exception {
  ClientApplicationDeregisteredEvent event=new ClientApplicationDeregisteredEvent(application);
  notifier.doNotify(event);
  verify(mockRestTemplate).postForObject(eq(URI.create("String_Node_Str")),any(Message.class),eq(Void.class));
}

Fixed version (ground truth):
@Test public void test_onClientApplicationDeRegisteredEvent_resolve() throws Exception {
  ClientApplicationDeregisteredEvent event=new ClientApplicationDeregisteredEvent(application);
  notifier.doNotify(event);
  verify(mockRestTemplate).postForEntity(eq(URI.create("String_Node_Str")),any(Message.class),eq(Void.class));
}
Program: 162248
Project: 162248
Buggy source:
@Test public void test_onApplicationStatusChangedEvent_resolve() throws Exception {
  ClientApplicationStatusChangedEvent event=new ClientApplicationStatusChangedEvent(application,StatusInfo.ofDown(),StatusInfo.ofUp());
  notifier.doNotify(event);
  verify(mockRestTemplate).postForObject(eq(URI.create("String_Node_Str")),any(Message.class),eq(Void.class));
}

Fixed version (ground truth):
@Test public void test_onApplicationStatusChangedEvent_resolve() throws Exception {
  ClientApplicationStatusChangedEvent event=new ClientApplicationStatusChangedEvent(application,StatusInfo.ofDown(),StatusInfo.ofUp());
  notifier.doNotify(event);
  verify(mockRestTemplate).postForEntity(eq(URI.create("String_Node_Str")),any(Message.class),eq(Void.class));
}
Program: 162249
Project: 162249
Buggy source:
@Test public void test_onApplicationRegisteredEvent_resolve() throws Exception {
  ClientApplicationRegisteredEvent event=new ClientApplicationRegisteredEvent(application);
  notifier.doNotify(event);
  verify(mockRestTemplate).postForObject(eq(URI.create("String_Node_Str")),any(Message.class),eq(Void.class));
}

Fixed version (ground truth):
@Test public void test_onApplicationRegisteredEvent_resolve() throws Exception {
  ClientApplicationRegisteredEvent event=new ClientApplicationRegisteredEvent(application);
  notifier.doNotify(event);
  verify(mockRestTemplate).postForEntity(eq(URI.create("String_Node_Str")),any(Message.class),eq(Void.class));
}
Program: 162250
Project: 162250
Buggy source:
@Test(expected=IllegalArgumentException.class) public void test_name_expected() throws JsonProcessingException, IOException {
  String json=new JSONObject().put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").toString();
  objectMapper.readValue(json,Application.class);
}

Fixed version (ground truth):
@Test(expected=IllegalArgumentException.class) public void test_name_expected() throws Exception {
  String json=new JSONObject().put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").toString();
  objectMapper.readValue(json,Application.class);
}
Program: 162251
Project: 162251
Buggy source:
@Test public void test_1_2_json_format() throws JsonProcessingException, IOException {
  String json=new JSONObject().put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").toString();
  Application value=objectMapper.readValue(json,Application.class);
  assertThat(value.getName(),is("String_Node_Str"));
  assertThat(value.getManagementUrl(),is("String_Node_Str"));
  assertThat(value.getHealthUrl(),is("String_Node_Str"));
  assertThat(value.getServiceUrl(),nullValue());
}

Fixed version (ground truth):
@Test public void test_1_2_json_format() throws Exception {
  String json=new JSONObject().put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").toString();
  Application value=objectMapper.readValue(json,Application.class);
  assertThat(value.getName(),is("String_Node_Str"));
  assertThat(value.getManagementUrl(),is("String_Node_Str"));
  assertThat(value.getHealthUrl(),is("String_Node_Str"));
  assertThat(value.getServiceUrl(),nullValue());
}
Program: 162252
Project: 162252
Buggy source:
@Test public void test_1_4_json_format() throws JsonProcessingException, IOException {
  String json=new JSONObject().put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str",new JSONObject().put("String_Node_Str","String_Node_Str")).toString();
  Application value=objectMapper.readValue(json,Application.class);
  assertThat(value.getName(),is("String_Node_Str"));
  assertThat(value.getManagementUrl(),is("String_Node_Str"));
  assertThat(value.getHealthUrl(),is("String_Node_Str"));
  assertThat(value.getServiceUrl(),is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void test_1_4_json_format() throws Exception {
  String json=new JSONObject().put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str",new JSONObject().put("String_Node_Str","String_Node_Str")).toString();
  Application value=objectMapper.readValue(json,Application.class);
  assertThat(value.getName(),is("String_Node_Str"));
  assertThat(value.getManagementUrl(),is("String_Node_Str"));
  assertThat(value.getHealthUrl(),is("String_Node_Str"));
  assertThat(value.getServiceUrl(),is("String_Node_Str"));
}
Program: 162253
Project: 162253
Buggy source:
@Test(expected=IllegalArgumentException.class) public void test_healthUrl_expected() throws JsonProcessingException, IOException {
  String json=new JSONObject().put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").toString();
  objectMapper.readValue(json,Application.class);
}

Fixed version (ground truth):
@Test(expected=IllegalArgumentException.class) public void test_healthUrl_expected() throws Exception {
  String json=new JSONObject().put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").toString();
  objectMapper.readValue(json,Application.class);
}
Program: 162254
Project: 162254
Buggy source:
@Test public void test_onlyHealthUrl() throws JsonProcessingException, IOException {
  String json=new JSONObject().put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").toString();
  Application value=objectMapper.readValue(json,Application.class);
  assertThat(value.getName(),is("String_Node_Str"));
  assertThat(value.getHealthUrl(),is("String_Node_Str"));
  assertThat(value.getManagementUrl(),nullValue());
  assertThat(value.getServiceUrl(),nullValue());
}

Fixed version (ground truth):
@Test public void test_onlyHealthUrl() throws Exception {
  String json=new JSONObject().put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").toString();
  Application value=objectMapper.readValue(json,Application.class);
  assertThat(value.getName(),is("String_Node_Str"));
  assertThat(value.getHealthUrl(),is("String_Node_Str"));
  assertThat(value.getManagementUrl(),nullValue());
  assertThat(value.getServiceUrl(),nullValue());
}
Program: 162255
Project: 162255
Buggy source:
@Test public void test_1_5_json_format() throws JsonProcessingException, IOException {
  String json=new JSONObject().put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str",new JSONObject().put("String_Node_Str","String_Node_Str")).toString();
  Application value=objectMapper.readValue(json,Application.class);
  assertThat(value.getName(),is("String_Node_Str"));
  assertThat(value.getManagementUrl(),is("String_Node_Str"));
  assertThat(value.getHealthUrl(),is("String_Node_Str"));
  assertThat(value.getServiceUrl(),is("String_Node_Str"));
  assertThat(value.getMetadata(),is(Collections.singletonMap("String_Node_Str","String_Node_Str")));
}

Fixed version (ground truth):
@Test public void test_1_5_json_format() throws Exception {
  String json=new JSONObject().put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str","String_Node_Str").put("String_Node_Str",new JSONObject().put("String_Node_Str","String_Node_Str")).toString();
  Application value=objectMapper.readValue(json,Application.class);
  assertThat(value.getName(),is("String_Node_Str"));
  assertThat(value.getManagementUrl(),is("String_Node_Str"));
  assertThat(value.getHealthUrl(),is("String_Node_Str"));
  assertThat(value.getServiceUrl(),is("String_Node_Str"));
  assertThat(value.getMetadata(),is(Collections.singletonMap("String_Node_Str","String_Node_Str")));
}
Program: 162256
Project: 162256
Buggy source:
/** 
 * Task that registers the application at the spring-boot-admin application.
 */
@Bean @ConditionalOnMissingBean public ApplicationRegistrator registrator(){
  builder.messageConverters(new MappingJackson2HttpMessageConverter());
  if (admin.getUsername() != null) {
    builder.basicAuthorization(admin.getUsername(),admin.getPassword());
  }
  return new ApplicationRegistrator(builder.build(),admin,client);
}

Fixed version (ground truth):
/** 
 * Task that registers the application at the spring-boot-admin application.
 */
@Bean @ConditionalOnMissingBean public ApplicationRegistrator registrator(){
  builder=builder.messageConverters(new MappingJackson2HttpMessageConverter());
  if (admin.getUsername() != null) {
    builder=builder.basicAuthorization(admin.getUsername(),admin.getPassword());
  }
  return new ApplicationRegistrator(builder.build(),admin,client);
}
Program: 162257
Project: 162257
Buggy source:
public void setCc(String[] cc){
  this.cc=cc;
}

Fixed version (ground truth):
public void setCc(String[] cc){
  this.cc=Arrays.copyOf(cc,cc.length);
}
Program: 162258
Project: 162258
Buggy source:
public void setTo(String[] to){
  this.to=to;
}

Fixed version (ground truth):
public void setTo(String[] to){
  this.to=Arrays.copyOf(to,to.length);
}
Program: 162259
Project: 162259
Buggy source:
@SuppressWarnings("String_Node_Str") @SuppressLint("String_Node_Str") private void setBackgroundCompat(Drawable drawable){
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
    setBackground(drawable);
  }
 else {
    setBackgroundDrawable(drawable);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @SuppressLint("String_Node_Str") private void setBackgroundCompat(Drawable drawable){
  if (Build.VERSION.SDK_INT >= 16) {
    setBackground(drawable);
  }
 else {
    setBackgroundDrawable(drawable);
  }
}
Program: 162260
Project: 162260
Buggy source:
@Override public void onItemClick(AdapterView<?> arg0,View view,int index,long id){
  int playbackRouteId=Common.PLAY_ALL_SONGS;
switch (mFragmentId) {
case Common.ARTISTS_FLIPPED_SONGS_FRAGMENT:
case Common.ALBUM_ARTISTS_FLIPPED_SONGS_FRAGMENT:
case Common.GENRES_FLIPPED_FRAGMENT:
    playbackRouteId=Common.PLAY_ALL_BY_ALBUM;
  break;
}
mApp.getPlaybackKickstarter().initPlayback(mContext,mQuerySelection,playbackRouteId,index,true,false);
}

Fixed version (ground truth):
@Override public void onItemClick(AdapterView<?> arg0,View view,int index,long id){
  int playbackRouteId=Common.PLAY_ALL_SONGS;
switch (mFragmentId) {
case Common.ARTISTS_FLIPPED_SONGS_FRAGMENT:
case Common.ALBUM_ARTISTS_FLIPPED_SONGS_FRAGMENT:
case Common.GENRES_FLIPPED_FRAGMENT:
case Common.ALBUMS_FLIPPED_FRAGMENT:
    playbackRouteId=Common.PLAY_ALL_BY_ALBUM;
  break;
}
mApp.getPlaybackKickstarter().initPlayback(mContext,mQuerySelection,playbackRouteId,index,true,false);
}
Program: 162261
Project: 162261
Buggy source:
/** 
 * Returns a selection cursor of all songs in the database.  This method can also be used to search all songs if a  valid selection parameter is passed.
 */
public Cursor getAllSongsSearchable(String selection){
  String selectQuery="String_Node_Str" + MUSIC_LIBRARY_TABLE + "String_Node_Str"+ BLACKLIST_STATUS+ "String_Node_Str"+ "String_Node_Str"+ selection+ "String_Node_Str"+ SONG_TITLE+ "String_Node_Str";
  return getDatabase().rawQuery(selectQuery,null);
}

Fixed version (ground truth):
/** 
 * Returns a selection cursor of all songs in the database.  This method can also be used to search all songs if a  valid selection parameter is passed.
 */
public Cursor getAllSongsSearchable(String selection){
  String selectQuery="String_Node_Str" + MUSIC_LIBRARY_TABLE + "String_Node_Str"+ BLACKLIST_STATUS+ "String_Node_Str"+ "String_Node_Str"+ selection;
  return getDatabase().rawQuery(selectQuery,null);
}
Program: 162262
Project: 162262
Buggy source:
/** 
 * Returns a selection cursor of all songs in the  specified library. The library should be specified in the  selection parameter.
 */
public Cursor getAllSongsInLibrarySearchable(String selection){
  String selectQuery="String_Node_Str" + MUSIC_LIBRARY_TABLE + "String_Node_Str"+ LIBRARY_NAME+ "String_Node_Str"+ MUSIC_LIBRARY_TABLE+ "String_Node_Str"+ _ID+ "String_Node_Str"+ LIBRARY_NAME+ "String_Node_Str"+ SONG_ID+ "String_Node_Str"+ MUSIC_LIBRARY_TABLE+ "String_Node_Str"+ BLACKLIST_STATUS+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ selection+ "String_Node_Str"+ MUSIC_LIBRARY_TABLE+ "String_Node_Str"+ SONG_TITLE+ "String_Node_Str";
  return getDatabase().rawQuery(selectQuery,null);
}

Fixed version (ground truth):
/** 
 * Returns a selection cursor of all songs in the  specified library. The library should be specified in the  selection parameter.
 */
public Cursor getAllSongsInLibrarySearchable(String selection){
  String selectQuery="String_Node_Str" + MUSIC_LIBRARY_TABLE + "String_Node_Str"+ LIBRARY_NAME+ "String_Node_Str"+ MUSIC_LIBRARY_TABLE+ "String_Node_Str"+ _ID+ "String_Node_Str"+ LIBRARY_NAME+ "String_Node_Str"+ SONG_ID+ "String_Node_Str"+ MUSIC_LIBRARY_TABLE+ "String_Node_Str"+ BLACKLIST_STATUS+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ selection;
  return getDatabase().rawQuery(selectQuery,null);
}
Program: 162263
Project: 162263
Buggy source:
/** 
 * Helper method for getPlaybackCursor(). Returns the correct cursor retrieval method for the specified playback/fragment route.
 */
private Cursor getPlaybackCursorHelper(String querySelection,int fragmentId){
switch (fragmentId) {
case Common.PLAY_ALL_BY_ARTIST:
case Common.PLAY_ALL_BY_ALBUM_ARTIST:
case Common.PLAY_ALL_BY_ALBUM:
case Common.PLAY_ALL_SONGS:
case Common.PLAY_ALL_IN_GENRE:
    return getAllSongsSearchable(querySelection);
case Common.PLAY_ALL_IN_PLAYLIST:
case Common.PLAY_ALL_IN_FOLDER:
default :
  return null;
}
}

Fixed version (ground truth):
/** 
 * Helper method for getPlaybackCursor(). Returns the correct cursor retrieval method for the specified playback/fragment route.
 */
private Cursor getPlaybackCursorHelper(String querySelection,int fragmentId){
switch (fragmentId) {
case Common.PLAY_ALL_BY_ARTIST:
case Common.PLAY_ALL_BY_ALBUM_ARTIST:
case Common.PLAY_ALL_BY_ALBUM:
case Common.PLAY_ALL_IN_GENRE:
case Common.PLAY_ALL_IN_FOLDER:
    querySelection+="String_Node_Str" + SONG_TRACK_NUMBER + "String_Node_Str";
  break;
case Common.PLAY_ALL_SONGS:
querySelection+="String_Node_Str" + SONG_TITLE + "String_Node_Str";
break;
case Common.PLAY_ALL_IN_PLAYLIST:
}
return getAllSongsSearchable(querySelection);
}
Program: 162264
Project: 162264
Buggy source:
/** 
 * Helper method for getPlaybackCursor(). Returns the correct cursor retrieval method for the specified playback/fragment route in the specified library.
 */
private Cursor getPlaybackCursorInLibraryHelper(String querySelection,int fragmentId){
switch (fragmentId) {
case Common.PLAY_ALL_BY_ARTIST:
case Common.PLAY_ALL_BY_ALBUM_ARTIST:
case Common.PLAY_ALL_BY_ALBUM:
case Common.PLAY_ALL_SONGS:
case Common.PLAY_ALL_IN_GENRE:
    return getAllSongsInLibrarySearchable(querySelection);
case Common.PLAY_ALL_IN_PLAYLIST:
case Common.PLAY_ALL_IN_FOLDER:
default :
  return null;
}
}

Fixed version (ground truth):
/** 
 * Helper method for getPlaybackCursor(). Returns the correct cursor retrieval method for the specified playback/fragment route in the specified library.
 */
private Cursor getPlaybackCursorInLibraryHelper(String querySelection,int fragmentId){
switch (fragmentId) {
case Common.PLAY_ALL_BY_ARTIST:
case Common.PLAY_ALL_BY_ALBUM_ARTIST:
case Common.PLAY_ALL_BY_ALBUM:
case Common.PLAY_ALL_IN_GENRE:
case Common.PLAY_ALL_IN_FOLDER:
    querySelection+="String_Node_Str" + MUSIC_LIBRARY_TABLE + "String_Node_Str"+ SONG_TRACK_NUMBER+ "String_Node_Str";
  break;
case Common.PLAY_ALL_SONGS:
querySelection+="String_Node_Str" + MUSIC_LIBRARY_TABLE + "String_Node_Str"+ SONG_TITLE+ "String_Node_Str";
break;
case Common.PLAY_ALL_IN_PLAYLIST:
}
return getAllSongsInLibrarySearchable(querySelection);
}
Program: 162265
Project: 162265
Buggy source:
/** 
 * Helper method for getFragmentCursor(). Returns the correct  cursor retrieval method for the specified fragment.
 */
private Cursor getFragmentCursorHelper(String querySelection,int fragmentId){
switch (fragmentId) {
case Common.ARTISTS_FRAGMENT:
    return getAllUniqueArtists(querySelection);
case Common.ALBUM_ARTISTS_FRAGMENT:
  return getAllUniqueAlbumArtists(querySelection);
case Common.ALBUMS_FRAGMENT:
return getAllUniqueAlbums(querySelection);
case Common.SONGS_FRAGMENT:
return getAllSongsSearchable(querySelection);
case Common.PLAYLISTS_FRAGMENT:
case Common.GENRES_FRAGMENT:
return getAllUniqueGenres(querySelection);
case Common.FOLDERS_FRAGMENT:
case Common.ARTISTS_FLIPPED_FRAGMENT:
return getAllUniqueAlbumsByArtist(querySelection);
case Common.ARTISTS_FLIPPED_SONGS_FRAGMENT:
return getAllSongsInAlbumByArtist(querySelection);
case Common.ALBUM_ARTISTS_FLIPPED_FRAGMENT:
return getAllUniqueAlbumsByAlbumArtist(querySelection);
case Common.ALBUM_ARTISTS_FLIPPED_SONGS_FRAGMENT:
return getAllSongsInAlbumByAlbumArtist(querySelection);
case Common.ALBUMS_FLIPPED_FRAGMENT:
return getAllSongsInAlbumByArtist(querySelection);
case Common.GENRES_FLIPPED_FRAGMENT:
return getAllUniqueAlbumsInGenre(querySelection);
case Common.GENRES_FLIPPED_SONGS_FRAGMENT:
return getAllSongsInAlbumInGenre(querySelection);
default :
return null;
}
}

Fixed version (ground truth):
/** 
 * Helper method for getFragmentCursor(). Returns the correct  cursor retrieval method for the specified fragment.
 */
private Cursor getFragmentCursorHelper(String querySelection,int fragmentId){
switch (fragmentId) {
case Common.ARTISTS_FRAGMENT:
    return getAllUniqueArtists(querySelection);
case Common.ALBUM_ARTISTS_FRAGMENT:
  return getAllUniqueAlbumArtists(querySelection);
case Common.ALBUMS_FRAGMENT:
return getAllUniqueAlbums(querySelection);
case Common.SONGS_FRAGMENT:
querySelection+="String_Node_Str" + SONG_TITLE + "String_Node_Str";
return getAllSongsSearchable(querySelection);
case Common.PLAYLISTS_FRAGMENT:
case Common.GENRES_FRAGMENT:
return getAllUniqueGenres(querySelection);
case Common.FOLDERS_FRAGMENT:
case Common.ARTISTS_FLIPPED_FRAGMENT:
return getAllUniqueAlbumsByArtist(querySelection);
case Common.ARTISTS_FLIPPED_SONGS_FRAGMENT:
return getAllSongsInAlbumByArtist(querySelection);
case Common.ALBUM_ARTISTS_FLIPPED_FRAGMENT:
return getAllUniqueAlbumsByAlbumArtist(querySelection);
case Common.ALBUM_ARTISTS_FLIPPED_SONGS_FRAGMENT:
return getAllSongsInAlbumByAlbumArtist(querySelection);
case Common.ALBUMS_FLIPPED_FRAGMENT:
return getAllSongsInAlbumByArtist(querySelection);
case Common.GENRES_FLIPPED_FRAGMENT:
return getAllUniqueAlbumsInGenre(querySelection);
case Common.GENRES_FLIPPED_SONGS_FRAGMENT:
return getAllSongsInAlbumInGenre(querySelection);
default :
return null;
}
}
Program: 162266
Project: 162266
Buggy source:
/** 
 * Helper method for getFragmentCursor(). Returns the correct  cursor retrieval method for the specified fragment in the  specified library.
 */
private Cursor getFragmentCursorInLibraryHelper(String querySelection,int fragmentId){
switch (fragmentId) {
case Common.ARTISTS_FRAGMENT:
    return getAllUniqueArtistsInLibrary(querySelection);
case Common.ALBUM_ARTISTS_FRAGMENT:
  return getAllUniqueAlbumArtistsInLibrary(querySelection);
case Common.ALBUMS_FRAGMENT:
return getAllUniqueAlbumsInLibrary(querySelection);
case Common.SONGS_FRAGMENT:
return getAllSongsInLibrarySearchable(querySelection);
case Common.PLAYLISTS_FRAGMENT:
case Common.GENRES_FRAGMENT:
return getAllUniqueGenresInLibrary(querySelection);
case Common.FOLDERS_FRAGMENT:
case Common.ARTISTS_FLIPPED_FRAGMENT:
return getAllUniqueAlbumsByArtistInLibrary(querySelection);
case Common.ARTISTS_FLIPPED_SONGS_FRAGMENT:
return getAllSongsInAlbumByArtistInLibrary(querySelection);
case Common.ALBUM_ARTISTS_FLIPPED_FRAGMENT:
return getAllUniqueAlbumsByAlbumArtistInLibrary(querySelection);
case Common.ALBUM_ARTISTS_FLIPPED_SONGS_FRAGMENT:
return getAllSongsInAlbumByAlbumArtistInLibrary(querySelection);
case Common.ALBUMS_FLIPPED_FRAGMENT:
return getAllSongsInAlbumByArtistInLibrary(querySelection);
case Common.GENRES_FLIPPED_FRAGMENT:
return getAllUniqueAlbumsInGenreInLibrary(querySelection);
case Common.GENRES_FLIPPED_SONGS_FRAGMENT:
return getAllSongsByInAlbumInGenreInLibrary(querySelection);
default :
return null;
}
}

Fixed version (ground truth):
/** 
 * Helper method for getFragmentCursor(). Returns the correct  cursor retrieval method for the specified fragment in the  specified library.
 */
private Cursor getFragmentCursorInLibraryHelper(String querySelection,int fragmentId){
switch (fragmentId) {
case Common.ARTISTS_FRAGMENT:
    return getAllUniqueArtistsInLibrary(querySelection);
case Common.ALBUM_ARTISTS_FRAGMENT:
  return getAllUniqueAlbumArtistsInLibrary(querySelection);
case Common.ALBUMS_FRAGMENT:
return getAllUniqueAlbumsInLibrary(querySelection);
case Common.SONGS_FRAGMENT:
querySelection+="String_Node_Str" + SONG_TITLE + "String_Node_Str";
return getAllSongsInLibrarySearchable(querySelection);
case Common.PLAYLISTS_FRAGMENT:
case Common.GENRES_FRAGMENT:
return getAllUniqueGenresInLibrary(querySelection);
case Common.FOLDERS_FRAGMENT:
case Common.ARTISTS_FLIPPED_FRAGMENT:
return getAllUniqueAlbumsByArtistInLibrary(querySelection);
case Common.ARTISTS_FLIPPED_SONGS_FRAGMENT:
return getAllSongsInAlbumByArtistInLibrary(querySelection);
case Common.ALBUM_ARTISTS_FLIPPED_FRAGMENT:
return getAllUniqueAlbumsByAlbumArtistInLibrary(querySelection);
case Common.ALBUM_ARTISTS_FLIPPED_SONGS_FRAGMENT:
return getAllSongsInAlbumByAlbumArtistInLibrary(querySelection);
case Common.ALBUMS_FLIPPED_FRAGMENT:
return getAllSongsInAlbumByArtistInLibrary(querySelection);
case Common.GENRES_FLIPPED_FRAGMENT:
return getAllUniqueAlbumsInGenreInLibrary(querySelection);
case Common.GENRES_FLIPPED_SONGS_FRAGMENT:
return getAllSongsByInAlbumInGenreInLibrary(querySelection);
default :
return null;
}
}
Program: 162267
Project: 162267
Buggy source:
@Override protected Void doInBackground(String... params){
  int which=Integer.parseInt(params[0]);
  final Cursor cursor=mApp.getDBAccessHelper().getAllUniqueGenres("String_Node_Str");
  cursor.moveToPosition(which);
  String selectedGenre=cursor.getString(cursor.getColumnIndex(DBAccessHelper.SONG_GENRE));
  cursor.close();
  final Cursor songsCursor=mApp.getDBAccessHelper().getAllSongsInGenre(selectedGenre);
  if (songsCursor != null && songsCursor.getCount() > 0) {
    for (int j=0; j < songsCursor.getCount(); j++) {
      songsCursor.moveToPosition(j);
      String songId=songsCursor.getString(songsCursor.getColumnIndex(DBAccessHelper.SONG_ID));
      saveSettingsToDB(songId);
    }
  }
  songsCursor.close();
  return null;
}

Fixed version (ground truth):
@Override protected Void doInBackground(String... params){
  int which=Integer.parseInt(params[0]);
  final Cursor cursor=mApp.getDBAccessHelper().getAllUniqueGenres("String_Node_Str");
  cursor.moveToPosition(which);
  String selectedGenre=cursor.getString(cursor.getColumnIndex(DBAccessHelper.SONG_GENRE));
  cursor.close();
  String genreQuery="String_Node_Str" + DBAccessHelper.SONG_GENRE + "String_Node_Str"+ "String_Node_Str"+ selectedGenre+ "String_Node_Str";
  final Cursor songsCursor=mApp.getDBAccessHelper().getAllSongsInGenre(genreQuery);
  if (songsCursor != null && songsCursor.getCount() > 0) {
    for (int j=0; j < songsCursor.getCount(); j++) {
      songsCursor.moveToPosition(j);
      String songId=songsCursor.getString(songsCursor.getColumnIndex(DBAccessHelper.SONG_ID));
      saveSettingsToDB(songId);
    }
  }
  songsCursor.close();
  return null;
}
Program: 162268
Project: 162268
Buggy source:
private CloseableHttpResponse forward(CloseableHttpClient httpclient,String verb,String uri,HttpServletRequest request,MultiValueMap<String,String> headers,MultiValueMap<String,String> params,InputStream requestEntity) throws Exception {
  Map<String,Object> info=this.helper.debug(verb,uri,headers,params,requestEntity);
  URL host=RequestContext.getCurrentContext().getRouteHost();
  HttpHost httpHost=getHttpHost(host);
  uri=StringUtils.cleanPath((host.getPath() + uri).replaceAll("String_Node_Str","String_Node_Str"));
  int contentLength=request.getContentLength();
  ContentType contentType=null;
  if (request.getContentType() != null) {
    contentType=ContentType.parse(request.getContentType());
  }
  InputStreamEntity entity=new InputStreamEntity(requestEntity,contentLength,contentType);
  HttpRequest httpRequest=buildHttpRequest(verb,uri,entity,headers,params,request);
  try {
    log.debug(httpHost.getHostName() + "String_Node_Str" + httpHost.getPort()+ "String_Node_Str"+ httpHost.getSchemeName());
    CloseableHttpResponse zuulResponse=forwardRequest(httpclient,httpHost,httpRequest);
    this.helper.appendDebug(info,zuulResponse.getStatusLine().getStatusCode(),revertHeaders(zuulResponse.getAllHeaders()));
    return zuulResponse;
  }
  finally {
  }
}

Fixed version (ground truth):
private CloseableHttpResponse forward(CloseableHttpClient httpclient,String verb,String uri,HttpServletRequest request,MultiValueMap<String,String> headers,MultiValueMap<String,String> params,InputStream requestEntity) throws Exception {
  Map<String,Object> info=this.helper.debug(verb,uri,headers,params,requestEntity);
  URL host=RequestContext.getCurrentContext().getRouteHost();
  HttpHost httpHost=getHttpHost(host);
  uri=StringUtils.cleanPath((host.getPath() + uri).replaceAll("String_Node_Str","String_Node_Str"));
  long contentLength=getContentLength(request);
  ContentType contentType=null;
  if (request.getContentType() != null) {
    contentType=ContentType.parse(request.getContentType());
  }
  InputStreamEntity entity=new InputStreamEntity(requestEntity,contentLength,contentType);
  HttpRequest httpRequest=buildHttpRequest(verb,uri,entity,headers,params,request);
  try {
    log.debug(httpHost.getHostName() + "String_Node_Str" + httpHost.getPort()+ "String_Node_Str"+ httpHost.getSchemeName());
    CloseableHttpResponse zuulResponse=forwardRequest(httpclient,httpHost,httpRequest);
    this.helper.appendDebug(info,zuulResponse.getStatusLine().getStatusCode(),revertHeaders(zuulResponse.getAllHeaders()));
    return zuulResponse;
  }
  finally {
  }
}
Program: 162269
Project: 162269
Buggy source:
@Override public Object run(){
  RequestContext context=RequestContext.getCurrentContext();
  HttpServletRequest request=context.getRequest();
  MultiValueMap<String,String> headers=this.helper.buildZuulRequestHeaders(request);
  MultiValueMap<String,String> params=this.helper.buildZuulRequestQueryParams(request);
  String verb=getVerb(request);
  InputStream requestEntity=getRequestBody(request);
  if (request.getContentLength() < 0) {
    context.setChunkedRequestBody();
  }
  String uri=this.helper.buildZuulRequestURI(request);
  this.helper.addIgnoredHeaders();
  try {
    CloseableHttpResponse response=forward(this.httpClient,verb,uri,request,headers,params,requestEntity);
    setResponse(response);
  }
 catch (  Exception ex) {
    throw new ZuulRuntimeException(ex);
  }
  return null;
}

Fixed version (ground truth):
@Override public Object run(){
  RequestContext context=RequestContext.getCurrentContext();
  HttpServletRequest request=context.getRequest();
  MultiValueMap<String,String> headers=this.helper.buildZuulRequestHeaders(request);
  MultiValueMap<String,String> params=this.helper.buildZuulRequestQueryParams(request);
  String verb=getVerb(request);
  InputStream requestEntity=getRequestBody(request);
  if (getContentLength(request) < 0) {
    context.setChunkedRequestBody();
  }
  String uri=this.helper.buildZuulRequestURI(request);
  this.helper.addIgnoredHeaders();
  try {
    CloseableHttpResponse response=forward(this.httpClient,verb,uri,request,headers,params,requestEntity);
    setResponse(response);
  }
 catch (  Exception ex) {
    throw new ZuulRuntimeException(ex);
  }
  return null;
}
Program: 162270
Project: 162270
Buggy source:
public SimpleHostRoutingFilter(ProxyRequestHelper helper,ZuulProperties properties,CloseableHttpClient httpClient){
  this.helper=helper;
  this.hostProperties=properties.getHost();
  this.sslHostnameValidationEnabled=properties.isSslHostnameValidationEnabled();
  this.forceOriginalQueryStringEncoding=properties.isForceOriginalQueryStringEncoding();
  this.httpClient=httpClient;
  this.customHttpClient=true;
}

Fixed version (ground truth):
public SimpleHostRoutingFilter(ProxyRequestHelper helper,ZuulProperties properties,CloseableHttpClient httpClient){
  this.helper=helper;
  this.hostProperties=properties.getHost();
  this.sslHostnameValidationEnabled=properties.isSslHostnameValidationEnabled();
  this.forceOriginalQueryStringEncoding=properties.isForceOriginalQueryStringEncoding();
  this.httpClient=httpClient;
  this.customHttpClient=true;
  checkServletVersion();
}
Program: 162271
Project: 162271
Buggy source:
@GetMapping(produces=MediaType.TEXT_EVENT_STREAM_VALUE) public Flux<Map<String,Object>> stream(){
  return this.flux;
}

Fixed version (ground truth):
@GetMapping(produces=MediaType.TEXT_EVENT_STREAM_VALUE) public Flux<String> stream(){
  return this.flux;
}
Program: 162272
Project: 162272
Buggy source:
public TurbineController(PublishSubject<Map<String,Object>> hystrixSubject){
  Observable<Map<String,Object>> stream=StreamAggregator.aggregateGroupedStreams(hystrixSubject.groupBy(data -> InstanceKey.create((String)data.get("String_Node_Str")))).doOnUnsubscribe(() -> log.info("String_Node_Str")).doOnSubscribe(() -> log.info("String_Node_Str")).flatMap(o -> o);
  Flux<Map<String,Object>> ping=Flux.interval(Duration.ofSeconds(5),Duration.ofSeconds(10)).map(l -> Collections.singletonMap("String_Node_Str",(Object)"String_Node_Str")).share();
  flux=Flux.merge(RxReactiveStreams.toPublisher(stream),ping).share();
}

Fixed version (ground truth):
public TurbineController(PublishSubject<Map<String,Object>> hystrixSubject){
  Observable<Map<String,Object>> stream=StreamAggregator.aggregateGroupedStreams(hystrixSubject.groupBy(data -> InstanceKey.create((String)data.get("String_Node_Str")))).doOnUnsubscribe(() -> log.info("String_Node_Str")).doOnSubscribe(() -> log.info("String_Node_Str")).flatMap(o -> o);
  Flux<Map<String,Object>> ping=Flux.interval(Duration.ofSeconds(5),Duration.ofSeconds(10)).map(l -> Collections.singletonMap("String_Node_Str",(Object)"String_Node_Str")).share();
  flux=Flux.merge(RxReactiveStreams.toPublisher(stream),ping).share().map(map -> JsonUtility.mapToJson(map));
}