nus-yam/ex-repair huggingface dataset:
Program: 88850
Project: 88850
Buggy source:
@Override public Object getValueAt(int row,int col){
  Track track=tracks.get(row);
switch (col) {
case 0:
    return track.getStartTime();
case 1:
  return track.getTotalDistance();
case 2:
return track.getAverageSpeed();
}
return track;
}

Fixed version (ground truth):
@Override public Object getValueAt(int row,int col){
  Track track=tracks.get(row);
switch (col) {
case 0:
    return track.getStartTime();
case 1:
  return track.getTotalDistance();
case 2:
return track.getTotalTime();
case 3:
return track.getAverageSpeed();
}
return track;
}
Program: 88851
Project: 88851
Buggy source:
/** 
 * @return the total distance of the track
 */
public double getTotalDistance(){
  if (points.isEmpty())   return 0;
  return points.get(points.size() - 1).getDistance();
}

Fixed version (ground truth):
/** 
 * @return the total distance of the track in meters
 */
public double getTotalDistance(){
  if (points.isEmpty())   return 0;
  return points.get(points.size() - 1).getDistance();
}
Program: 88852
Project: 88852
Buggy source:
/** 
 * Constructs a new instance
 */
public MainFrame(){
  super("String_Node_Str");
  File folder=new File(System.getProperty("String_Node_Str") + File.separator + "String_Node_Str");
  List<Track> tracks=readTracks(folder);
  viewer=new MapViewer();
  table=createTable(tracks);
  JScrollPane tablePane=new JScrollPane(table);
  table.setFillsViewportHeight(true);
  trackChart=new TrackChart();
  trackChart.addSelectionListener(new SelectionListener(){
    @Override public void selected(    int index){
      viewer.setMarker(index);
    }
  }
);
  JSplitPane chartSplitPane=new JSplitPane(JSplitPane.VERTICAL_SPLIT,viewer,trackChart);
  chartSplitPane.setDividerLocation(550);
  JSplitPane mainSplitPane=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,tablePane,chartSplitPane);
  mainSplitPane.setDividerLocation(230);
  Dimension minimumSize=new Dimension(100,50);
  tablePane.setMinimumSize(minimumSize);
  chartSplitPane.setMinimumSize(minimumSize);
  add(createMenu(),BorderLayout.NORTH);
  add(mainSplitPane);
  table.getSelectionModel().setSelectionInterval(0,0);
}

Fixed version (ground truth):
/** 
 * Constructs a new instance
 */
public MainFrame(){
  super("String_Node_Str");
  File folder=new File(System.getProperty("String_Node_Str") + File.separator + "String_Node_Str");
  List<Track> tracks=readTracks(folder);
  viewer=new MapViewer();
  table=createTable(tracks);
  JScrollPane tablePane=new JScrollPane(table);
  table.setFillsViewportHeight(true);
  trackChart=new TrackChart();
  trackChart.addSelectionListener(new SelectionListener(){
    @Override public void selected(    int series,    int index){
      viewer.setMarker(series,index);
    }
  }
);
  JSplitPane chartSplitPane=new JSplitPane(JSplitPane.VERTICAL_SPLIT,viewer,trackChart);
  chartSplitPane.setDividerLocation(550);
  JSplitPane mainSplitPane=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,tablePane,chartSplitPane);
  mainSplitPane.setDividerLocation(230);
  Dimension minimumSize=new Dimension(100,50);
  tablePane.setMinimumSize(minimumSize);
  chartSplitPane.setMinimumSize(minimumSize);
  add(createMenu(),BorderLayout.NORTH);
  add(mainSplitPane);
  table.getSelectionModel().setSelectionInterval(0,0);
}
Program: 88853
Project: 88853
Buggy source:
@Override public void selected(int index){
  viewer.setMarker(index);
}

Fixed version (ground truth):
@Override public void selected(int series,int index){
  viewer.setMarker(series,index);
}
Program: 88854
Project: 88854
Buggy source:
/** 
 * @param index
 */
public void setMarker(int index){
  for (  Painter<?> p : painter.getPainters()) {
    if (p instanceof MarkerPainter) {
      MarkerPainter mp=(MarkerPainter)p;
      mp.setMarker(index);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param track the track index
 * @param index the index of the track point
 */
public void setMarker(int track,int index){
  MarkerPainter mp=markerPainters.get(track);
  mp.setMarker(index);
}
Program: 88855
Project: 88855
Buggy source:
/** 
 * Displays one or more track routes
 * @param tracks the list of track
 */
public void showRoute(List<Track> tracks){
  List<Painter<JXMapViewer>> painters=new ArrayList<Painter<JXMapViewer>>();
  int i=0;
  for (  Track track : tracks) {
    List<GeoPosition> route=track.getRoute();
    Color color=getRouteColor(i++);
    MarkerPainter markerPainter=new MarkerPainter(route,color);
    RoutePainter routePainter=new RoutePainter(route,color);
    painters.add(routePainter);
    painters.add(markerPainter);
  }
  painter.setPainters(painters);
}

Fixed version (ground truth):
/** 
 * Displays one or more track routes
 * @param tracks the list of track
 */
public void showRoute(List<Track> tracks){
  markerPainters.clear();
  routePainters.clear();
  List<Painter<JXMapViewer>> painters=new ArrayList<Painter<JXMapViewer>>();
  int i=0;
  for (  Track track : tracks) {
    List<GeoPosition> route=track.getRoute();
    Color color=getRouteColor(i++);
    MarkerPainter markerPainter=new MarkerPainter(route,color);
    RoutePainter routePainter=new RoutePainter(route,color);
    markerPainters.add(markerPainter);
    routePainters.add(routePainter);
    painters.add(routePainter);
    painters.add(markerPainter);
  }
  painter.setPainters(painters);
}
Program: 88856
Project: 88856
Buggy source:
public void setMarker(int index){
  if (index < 0 || index > track.size())   throw new IllegalArgumentException("String_Node_Str" + index + "String_Node_Str");
  markers.add(index);
  setDirty(true);
}

Fixed version (ground truth):
public void setMarker(int index){
  if (index < 0 || index > track.size())   throw new IllegalArgumentException("String_Node_Str" + index + "String_Node_Str");
  markers.clear();
  markers.add(index);
  setDirty(true);
}
Program: 88857
Project: 88857
Buggy source:
public void selected(int index);

Fixed version (ground truth):
public void selected(int series,int index);
Program: 88859
Project: 88859
Buggy source:
@Override public void mouseClicked(MouseEvent e){
  int idx=chart.getIndexAt(e.getX(),e.getY());
  for (  SelectionListener sl : selectionListeners) {
    sl.selected(idx);
  }
}

Fixed version (ground truth):
@Override public void mouseClicked(MouseEvent e){
  for (int i=0; i < chart.getData().size(); i++) {
    int idx=chart.getIndexAt(i,e.getX(),e.getY());
    for (    SelectionListener sl : selectionListeners) {
      sl.selected(i,idx);
    }
  }
}
Program: 88860
Project: 88860
Buggy source:
/** 
 * @param x the x-value in local screen coords
 * @param y the y-value in local screen coords
 * @return the index or -1 if not found
 */
public int getIndexAt(int x,int y){
  double vx=screenXToValueX(x);
  for (int i=0; i < series.size(); i++) {
    int idx=FindIndexOfValueX(vx,i);
    if (idx != -1)     return idx;
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * @param serie the index of the series
 * @param x the x-value in local screen coords
 * @param y the y-value in local screen coords
 * @return the index or -1 if not found
 */
public int getIndexAt(int serie,int x,int y){
  double vx=screenXToValueX(x);
  return FindIndexOfValueX(vx,serie);
}
Program: 88861
Project: 88861
Buggy source:
public void removeSelectionListener(SelectionListener sl){
  selectionListeners.remove(sl);
}

Fixed version (ground truth):
/** 
 * @param sl the selection listener
 */
public void removeSelectionListener(SelectionListener sl){
  selectionListeners.remove(sl);
}
Program: 88862
Project: 88862
Buggy source:
public void addSelectionListener(SelectionListener sl){
  selectionListeners.add(sl);
}

Fixed version (ground truth):
/** 
 * @param sl the selection listener
 */
public void addSelectionListener(SelectionListener sl){
  selectionListeners.add(sl);
}
Program: 88864
Project: 88864
Buggy source:
@Override public void mouseClicked(MouseEvent e){
  for (int i=0; i < chart.getData().size(); i++) {
    int idx=chart.getIndexAt(i,e.getX(),e.getY());
    for (    SelectionListener sl : selectionListeners) {
      sl.selected(i,idx);
    }
  }
}

Fixed version (ground truth):
@Override public void mouseClicked(MouseEvent e){
  chart.setMarker(e.getX());
  for (int i=0; i < chart.getData().size(); i++) {
    int idx=chart.getIndexAt(i,e.getX(),e.getY());
    for (    SelectionListener sl : selectionListeners) {
      sl.selected(i,idx);
    }
  }
}
Program: 88865
Project: 88865
Buggy source:
/** 
 * @param pos the x position in screen pixel coordinates
 */
private void setMarker(int pos){
  markerPos=pos;
  repaint();
}

Fixed version (ground truth):
/** 
 * @param pos the x position in screen pixel coordinates
 */
public void setMarker(int pos){
  markerPos=null;
  if (pos < chartRect.x)   return;
  if (pos > chartRect.x + chartRect.width)   return;
  markerPos=Double.valueOf(screenXToValueX(pos));
  repaint();
}
Program: 88866
Project: 88866
Buggy source:
private void drawMarker(Graphics g){
  if (markerPos < chartRect.x)   return;
  if (markerPos > chartRect.x + chartRect.width)   return;
  int overlap=6;
  int yTop=(int)chartRect.getMinY() - overlap;
  int yBot=(int)chartRect.getMaxY() + overlap;
  g.setColor(Color.BLACK);
  g.drawLine(markerPos,yTop,markerPos,yBot);
}

Fixed version (ground truth):
private void drawMarker(Graphics g){
  if (markerPos == null)   return;
  int overlap=6;
  int yTop=(int)chartRect.getMinY() - overlap;
  int yBot=(int)chartRect.getMaxY() + overlap;
  g.setColor(Color.BLACK);
  int x=(int)ValueXToScreenX(markerPos);
  g.drawLine(x,yTop,x,yBot);
}
Program: 88867
Project: 88867
Buggy source:
/** 
 */
public JChart(){
  super();
  addMouseListener(new MouseAdapter(){
    @Override public void mouseClicked(    MouseEvent e){
      setMarker(e.getX());
    }
  }
);
}

Fixed version (ground truth):
/** 
 */
public JChart(){
  super();
}
Program: 88868
Project: 88868
Buggy source:
private String serveSelectRPC(Properties parms){
  if (parms.getProperty("String_Node_Str") != null && parms.getProperty("String_Node_Str") != null && parms.getProperty("String_Node_Str") != null && parms.getProperty("String_Node_Str") != null && parms.getProperty("String_Node_Str") != null && parms.getProperty("String_Node_Str") != null && parms.getProperty("String_Node_Str") != null) {
    try {
      int pool=Integer.parseInt(parms.getProperty("String_Node_Str"));
      int tmo=Integer.parseInt(parms.getProperty("String_Node_Str"));
      int server=BTCMiner.rpcCount;
      if (pool >= 0 && pool < server) {
        RPC rpc=BTCMiner.rpc[pool];
        rpc.name=parms.getProperty("String_Node_Str");
        rpc.url=parms.getProperty("String_Node_Str");
        rpc.host=parms.getProperty("String_Node_Str");
        rpc.usr=parms.getProperty("String_Node_Str");
        rpc.pwd=parms.getProperty("String_Node_Str");
        rpc.ioDisableMonitorTime=tmo;
        if (BTCMiner.newBlockMonitor != null) {
synchronized (BTCMiner.newBlockMonitor) {
            BTCMiner.disableLPTime=new Date().getTime() + 20000;
            BTCMiner.longPollURL=null;
            BTCMiner.longPollUser="String_Node_Str";
            BTCMiner.longPollPassw="String_Node_Str";
          }
        }
      }
    }
 catch (    NumberFormatException e) {
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
private String serveSelectRPC(Properties parms){
  if (parms.getProperty("String_Node_Str") != null && parms.getProperty("String_Node_Str") != null && parms.getProperty("String_Node_Str") != null && parms.getProperty("String_Node_Str") != null && parms.getProperty("String_Node_Str") != null && parms.getProperty("String_Node_Str") != null && parms.getProperty("String_Node_Str") != null) {
    try {
      int pool=Integer.parseInt(parms.getProperty("String_Node_Str"));
      int iomon=Integer.parseInt(parms.getProperty("String_Node_Str"));
      int server=BTCMiner.rpcCount;
      if (pool >= 0 && pool < server) {
        RPC rpc=BTCMiner.rpc[pool];
        rpc.name=parms.getProperty("String_Node_Str");
        rpc.url=parms.getProperty("String_Node_Str");
        rpc.host=parms.getProperty("String_Node_Str");
        rpc.usr=parms.getProperty("String_Node_Str");
        rpc.pwd=parms.getProperty("String_Node_Str");
        rpc.ioDisableMonitorTime=iomon;
        if (BTCMiner.newBlockMonitor != null) {
synchronized (BTCMiner.newBlockMonitor) {
            BTCMiner.disableLPTime=new Date().getTime() + 20000;
            BTCMiner.longPollURL=null;
            BTCMiner.longPollUser="String_Node_Str";
            BTCMiner.longPollPassw="String_Node_Str";
          }
        }
      }
    }
 catch (    NumberFormatException e) {
    }
  }
  return "String_Node_Str";
}
Program: 88870
Project: 88870
Buggy source:
public boolean getNonces() throws UsbException, MalformedURLException, IOException {
  if (!isRunning || disableTime[prevRpcNum] > new Date().getTime()) {
    return false;
  }
  rpcNum=prevRpcNum;
  getNoncesInt();
  if (ignoreErrorTime < new Date().getTime()) {
    errorCount[freqM]*=0.995;
    errorWeight[freqM]=errorWeight[freqM] * 0.995 + 1.0;
    for (int i=0; i < numNonces; i++) {
      if (!checkNonce(nonce[i],hash7[i])) {
        errorCount[freqM]+=1.0 / numNonces;
      }
    }
    errorRate[freqM]=errorCount[freqM] / errorWeight[freqM] * Math.min(1.0,errorWeight[freqM] * 0.01);
    if (errorRate[freqM] > maxErrorRate[freqM]) {
      maxErrorRate[freqM]=errorRate[freqM];
    }
    if (errorWeight[freqM] > 100) {
      maxHashRate=Math.max(maxHashRate,(freqM + 1.0) * (1 - errorRate[freqM]));
    }
  }
  boolean submitted=false;
  for (int i=0; i < numNonces * (1 + extraSolutions); i++) {
    int n=goldenNonce[i];
    if (n != -offsNonces) {
      if (getHash(n) == 0) {
        int j=0;
        while (j < lastGoldenNonces.length && lastGoldenNonces[j] != n) {
          j++;
        }
        if (j >= lastGoldenNonces.length) {
          if (!targetCheck || compareWithTarget(n,false)) {
            submitWork(n);
            submittedCount+=1;
            totalSubmittedCount+=difficulty;
            submitted=true;
          }
        }
      }
    }
  }
  return submitted;
}

Fixed version (ground truth):
public boolean getNonces() throws UsbException, MalformedURLException, IOException {
  if (!isRunning || disableTime[prevRpcNum] > new Date().getTime()) {
    return false;
  }
  rpcNum=prevRpcNum;
  getNoncesInt();
  if (ignoreErrorTime < new Date().getTime()) {
    errorCount[freqM]*=0.995;
    errorWeight[freqM]=errorWeight[freqM] * 0.995 + 1.0;
    for (int i=0; i < numNonces; i++) {
      if (!checkNonce(nonce[i],hash7[i])) {
        errorCount[freqM]+=1.0 / numNonces;
      }
    }
    errorRate[freqM]=errorCount[freqM] / errorWeight[freqM] * Math.min(1.0,errorWeight[freqM] * 0.01);
    if (errorRate[freqM] > maxErrorRate[freqM]) {
      maxErrorRate[freqM]=errorRate[freqM];
    }
    if (errorWeight[freqM] > 120) {
      maxHashRate=Math.max(maxHashRate,(freqM + 1.0) * (1 - errorRate[freqM]));
    }
  }
  boolean submitted=false;
  for (int i=0; i < numNonces * (1 + extraSolutions); i++) {
    int n=goldenNonce[i];
    if (n != -offsNonces) {
      if (getHash(n) == 0) {
        int j=0;
        while (j < lastGoldenNonces.length && lastGoldenNonces[j] != n) {
          j++;
        }
        if (j >= lastGoldenNonces.length) {
          if (!targetCheck || compareWithTarget(n,false)) {
            submitWork(n);
            submittedCount+=1;
            totalSubmittedCount+=difficulty;
            submitted=true;
          }
        }
      }
    }
  }
  return submitted;
}
Program: 88871
Project: 88871
Buggy source:
public boolean compareWithTarget(int n,boolean dolog) throws NumberFormatException {
  for (int i=31; i >= 0; i--) {
    if ((hashBuf[i] & 255) < (targetBuf[i] & 255)) {
      if (dolog) {
        dmsg("String_Node_Str" + intToHexStr(n) + "String_Node_Str"+ dataToHexStr(dataBuf));
        dmsg("String_Node_Str" + intToHexStr(n) + "String_Node_Str"+ dataToHexStr(targetBuf));
        dmsg("String_Node_Str" + intToHexStr(n) + "String_Node_Str"+ dataToHexStr(hashBuf).substring(0,64)+ "String_Node_Str");
      }
      return true;
    }
    if ((hashBuf[i] & 255) > (targetBuf[i] & 255)) {
      if (dolog) {
        dmsg("String_Node_Str" + intToHexStr(n) + "String_Node_Str"+ dataToHexStr(targetBuf));
        dmsg("String_Node_Str" + intToHexStr(n) + "String_Node_Str"+ dataToHexStr(hashBuf).substring(0,64)+ "String_Node_Str");
      }
      return false;
    }
  }
  if (dolog) {
    dmsg("String_Node_Str" + intToHexStr(n) + "String_Node_Str"+ dataToHexStr(targetBuf));
    dmsg("String_Node_Str" + intToHexStr(n) + "String_Node_Str"+ dataToHexStr(hashBuf).substring(0,64)+ "String_Node_Str");
  }
  return true;
}

Fixed version (ground truth):
public boolean compareWithTarget(int n,boolean dolog) throws NumberFormatException {
  for (int i=0; i < 32; i++) {
    int j=i + 3 - 2 * (i % 4);
    if ((hashBuf[31 - j] & 255) < (targetBuf[31 - i] & 255)) {
      if (dolog) {
        dmsg("String_Node_Str" + intToHexStr(n) + "String_Node_Str"+ dataToHexStr(dataBuf));
        dmsg("String_Node_Str" + intToHexStr(n) + "String_Node_Str"+ dataToHexStr(targetBuf));
        dmsg("String_Node_Str" + intToHexStr(n) + "String_Node_Str"+ dataToHexStr(hashBuf).substring(0,64)+ "String_Node_Str");
      }
      return true;
    }
    if ((hashBuf[31 - j] & 255) > (targetBuf[31 - i] & 255)) {
      if (dolog) {
        dmsg("String_Node_Str" + intToHexStr(n) + "String_Node_Str"+ dataToHexStr(targetBuf));
        dmsg("String_Node_Str" + intToHexStr(n) + "String_Node_Str"+ dataToHexStr(hashBuf).substring(0,64)+ "String_Node_Str");
      }
      return false;
    }
  }
  if (dolog) {
    dmsg("String_Node_Str" + intToHexStr(n) + "String_Node_Str"+ dataToHexStr(targetBuf));
    dmsg("String_Node_Str" + intToHexStr(n) + "String_Node_Str"+ dataToHexStr(hashBuf).substring(0,64)+ "String_Node_Str");
  }
  return true;
}
Program: 88872
Project: 88872
Buggy source:
private String serveSelectPool(Properties parms){
  if (parms.getProperty("String_Node_Str") != null) {
    boolean force=false;
    if (parms.getProperty("String_Node_Str") != null) {
      force=true;
    }
    if (hopping || force) {
      int newpool=Integer.parseInt(parms.getProperty("String_Node_Str"));
      int server=BTCMiner.rpcCount;
      int backup1=BTCMiner.rpcFirstBackup;
      int backup=0;
      if (backup1 > 0) {
        backup=server - backup1;
      }
      if (newpool >= 0 && newpool < (server - backup)) {
        for (int i=0; i < (server - backup); i++) {
          if (i == newpool) {
            BTCMiner.rpc[i].state=true;
          }
        }
        for (int i=0; i < (server - backup); i++) {
          if (i != newpool) {
            BTCMiner.rpc[i].state=false;
          }
        }
        if (BTCMiner.newBlockMonitor != null) {
synchronized (BTCMiner.newBlockMonitor) {
            BTCMiner.disableLPTime=new Date().getTime() + 20000;
            BTCMiner.longPollURL=null;
            BTCMiner.longPollUser="String_Node_Str";
            BTCMiner.longPollPassw="String_Node_Str";
          }
        }
      }
    }
  }
  String msg;
  if (parms.getProperty("String_Node_Str") != null) {
    msg="String_Node_Str" + parms.getProperty("String_Node_Str") + "String_Node_Str";
  }
 else {
    msg="String_Node_Str";
  }
  return msg;
}

Fixed version (ground truth):
private String serveSelectPool(Properties parms){
  if (parms.getProperty("String_Node_Str") != null) {
    boolean force=false;
    if (parms.getProperty("String_Node_Str") != null) {
      force=true;
    }
    if (remoteSwitching || force) {
      int newpool=Integer.parseInt(parms.getProperty("String_Node_Str"));
      int server=BTCMiner.rpcCount;
      int backup1=BTCMiner.rpcFirstBackup;
      int backup=0;
      if (backup1 > 0) {
        backup=server - backup1;
      }
      if (newpool >= 0 && newpool < (server - backup)) {
        for (int i=0; i < (server - backup); i++) {
          if (i == newpool) {
            BTCMiner.rpc[i].state=true;
          }
        }
        for (int i=0; i < (server - backup); i++) {
          if (i != newpool) {
            BTCMiner.rpc[i].state=false;
          }
        }
        if (BTCMiner.newBlockMonitor != null) {
synchronized (BTCMiner.newBlockMonitor) {
            BTCMiner.disableLPTime=new Date().getTime() + 20000;
            BTCMiner.longPollURL=null;
            BTCMiner.longPollUser="String_Node_Str";
            BTCMiner.longPollPassw="String_Node_Str";
          }
        }
      }
    }
  }
  String msg;
  if (parms.getProperty("String_Node_Str") != null) {
    msg="String_Node_Str" + parms.getProperty("String_Node_Str") + "String_Node_Str";
  }
 else {
    msg="String_Node_Str";
  }
  return msg;
}
Program: 88874
Project: 88874
Buggy source:
public Response serve(String uri,String method,Properties header,Properties parms,Properties files){
  if (uri.equalsIgnoreCase("String_Node_Str")) {
    return new NanoHTTPD.Response(HTTP_OK,MIME_HTML,serveJson(uri,header));
  }
 else   if (uri.equalsIgnoreCase("String_Node_Str")) {
    return new NanoHTTPD.Response(HTTP_OK,MIME_HTML,serveSelectPool(parms));
  }
 else   if (uri.equalsIgnoreCase("String_Node_Str")) {
    return new NanoHTTPD.Response(HTTP_OK,MIME_HTML,serveSelectRefresh(parms));
  }
 else   if (uri.equalsIgnoreCase("String_Node_Str")) {
    return new NanoHTTPD.Response(HTTP_OK,MIME_HTML,serveSelectRPC(parms));
  }
 else   if (uri.equalsIgnoreCase("String_Node_Str")) {
    return new NanoHTTPD.Response(HTTP_OK,MIME_HTML,serveToggleHopping(parms));
  }
 else {
    return serveFile(uri,header,myRootDir,true);
  }
}

Fixed version (ground truth):
public Response serve(String uri,String method,Properties header,Properties parms,Properties files){
  Response rsp;
  if (uri.equalsIgnoreCase("String_Node_Str")) {
    rsp=new NanoHTTPD.Response(HTTP_OK,MIME_JSON,serveJson(uri,header));
    return rsp;
  }
 else   if (uri.equalsIgnoreCase("String_Node_Str")) {
    rsp=new NanoHTTPD.Response(HTTP_OK,MIME_HTML,serveSelectPool(parms));
    return rsp;
  }
 else   if (uri.equalsIgnoreCase("String_Node_Str")) {
    rsp=new NanoHTTPD.Response(HTTP_OK,MIME_HTML,serveSelectRefresh(parms));
    return rsp;
  }
 else   if (uri.equalsIgnoreCase("String_Node_Str")) {
    rsp=new NanoHTTPD.Response(HTTP_OK,MIME_HTML,serveSelectRPC(parms));
    return rsp;
  }
 else   if (uri.equalsIgnoreCase("String_Node_Str")) {
    rsp=new NanoHTTPD.Response(HTTP_OK,MIME_HTML,serveSetFlag(parms));
    return rsp;
  }
 else {
    rsp=serveFile(uri,header,myRootDir,true);
  }
  rsp.addHeader("String_Node_Str","String_Node_Str");
  rsp.addHeader("String_Node_Str","String_Node_Str");
  return rsp;
}
Program: 88876
Project: 88876
Buggy source:
public void setCoupon(Coupon coupon){
  this.couponKeyString=coupon.getIdString();
}

Fixed version (ground truth):
public void setCoupon(Coupon coupon){
  if (coupon != null) {
    this.couponKeyString=coupon.getIdString();
  }
}
Program: 88877
Project: 88877
Buggy source:
private void addDefaultSticker(Order order){
  String imageUrl=getHostUrl() + "String_Node_Str";
  byte[] bytes=null;
  try {
    bytes=URLFetchServiceFactory.getURLFetchService().fetch(new URL(imageUrl)).getContent();
  }
 catch (  Exception e) {
    EmailSender.INSTANCE.sendToAdmin(e.getMessage(),"String_Node_Str");
    e.printStackTrace();
  }
  if (bytes != null) {
    ByteArrayInputStream imageStream=new ByteArrayInputStream(bytes);
    order.addSticker("String_Node_Str",imageStream);
  }
 else {
    EmailSender.INSTANCE.sendToAdmin("String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
private void addDefaultSticker(Order order){
  String imageUrl=ServerUtils.getAppspotHostUrl() + "String_Node_Str";
  byte[] bytes=null;
  try {
    bytes=URLFetchServiceFactory.getURLFetchService().fetch(new URL(imageUrl)).getContent();
  }
 catch (  Exception e) {
    EmailSender.INSTANCE.sendToAdmin(e.getMessage(),"String_Node_Str");
    e.printStackTrace();
  }
  if (bytes != null) {
    ByteArrayInputStream imageStream=new ByteArrayInputStream(bytes);
    order.addSticker("String_Node_Str",imageStream);
  }
 else {
    EmailSender.INSTANCE.sendToAdmin("String_Node_Str","String_Node_Str");
  }
}
Program: 88878
Project: 88878
Buggy source:
private URL getUrlWithPath(String path){
  String hostUrl;
  String environment=System.getProperty("String_Node_Str");
  if ("String_Node_Str".equals(environment)) {
    hostUrl="String_Node_Str";
  }
 else {
    hostUrl="String_Node_Str";
  }
  try {
    return new URL(hostUrl + path + getSecret()+ "String_Node_Str"+ KeyFactory.keyToString(id));
  }
 catch (  MalformedURLException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private URL getUrlWithPath(String path){
  try {
    return new URL(ServerUtils.getCleanHostUrl() + path + getSecret()+ "String_Node_Str"+ KeyFactory.keyToString(id));
  }
 catch (  MalformedURLException e) {
    throw new RuntimeException(e);
  }
}
Program: 88879
Project: 88879
Buggy source:
private URL getImageUrl(ImageSize size){
  String hostUrl;
  String environment=System.getProperty("String_Node_Str");
  if ("String_Node_Str".equals(environment)) {
    String applicationId=System.getProperty("String_Node_Str");
    String version=System.getProperty("String_Node_Str");
    hostUrl="String_Node_Str" + version + "String_Node_Str"+ applicationId+ "String_Node_Str";
  }
 else {
    hostUrl="String_Node_Str";
  }
  try {
    return new URL(hostUrl + "String_Node_Str" + (size == ImageSize.thumb ? "String_Node_Str" : "String_Node_Str")+ getSecret()+ "String_Node_Str"+ KeyFactory.keyToString(id));
  }
 catch (  MalformedURLException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private URL getImageUrl(ImageSize size){
  String hostUrl=ServerUtils.getAppspotHostUrl();
  try {
    return new URL(hostUrl + "String_Node_Str" + (size == ImageSize.thumb ? "String_Node_Str" : "String_Node_Str")+ getSecret()+ "String_Node_Str"+ KeyFactory.keyToString(id));
  }
 catch (  MalformedURLException e) {
    throw new RuntimeException(e);
  }
}
Program: 88880
Project: 88880
Buggy source:
@Override public IController getController(ICakePHPFile file){
switch (file.getCakePHPFileType()) {
case MODEL:
{
      return getController(file);
    }
case CONTROLLER:
{
    break;
  }
case VIEW:
{
  break;
}
case JSFILE:
{
break;
}
case ELEMENT:
{
break;
}
}
}

Fixed version (ground truth):
@Override public IController getController(ICakePHPFile file){
switch (file.getCakePHPFileType()) {
case MODEL:
{
      return getController(file);
    }
case CONTROLLER:
{
    break;
  }
case VIEW:
{
  break;
}
case JSFILE:
{
break;
}
case ELEMENT:
{
break;
}
}
return null;
}
Program: 88881
Project: 88881
Buggy source:
private HashMap<String,Object> parseToken(String jsonResponse){
  HashMap<String,Object> result=new HashMap<String,Object>();
  result=HttpConnection.parse(jsonResponse,"String_Node_Str","String_Node_Str","String_Node_Str");
  if (result.get("String_Node_Str").equals("String_Node_Str")) {
    JSONArray friendsJson=(JSONArray)result.get("String_Node_Str");
    ArrayList<User> friends=new ArrayList<User>();
    for (int i=0; i < friendsJson.length(); i++) {
      JSONObject friend;
      try {
        friend=friendsJson.getJSONObject(i);
        String login=friend.getString("String_Node_Str");
        String firstName=friend.getString("String_Node_Str");
        String lastName=friend.getString("String_Node_Str");
        User u=new User(firstName,lastName,login);
        friends.add(u);
      }
 catch (      JSONException e) {
        e.printStackTrace();
      }
    }
    result.put("String_Node_Str",friends);
  }
  Log.i("String_Node_Str",result.toString());
  return result;
}

Fixed version (ground truth):
private HashMap<String,Object> parseToken(String jsonResponse){
  HashMap<String,Object> result=new HashMap<String,Object>();
  result=HttpConnection.parse(jsonResponse,"String_Node_Str","String_Node_Str","String_Node_Str");
  if (result.get("String_Node_Str").equals("String_Node_Str")) {
    Log.i("String_Node_Str",result.toString());
    JSONArray friendsJson=(JSONArray)result.get("String_Node_Str");
    ArrayList<User> friends=new ArrayList<User>();
    for (int i=0; i < friendsJson.length(); i++) {
      JSONObject friend;
      try {
        friend=friendsJson.getJSONObject(i);
        String login=friend.getString("String_Node_Str");
        String firstName=friend.getString("String_Node_Str");
        String lastName=friend.getString("String_Node_Str");
        User u=new User(firstName,lastName,login);
        friends.add(u);
      }
 catch (      JSONException e) {
        e.printStackTrace();
      }
    }
    result.put("String_Node_Str",friends);
  }
  return result;
}
Program: 88882
Project: 88882
Buggy source:
private HashMap<String,Object> parseResponse(String responseBody){
  HashMap<String,Object> results=new HashMap<String,Object>();
  results=HttpConnection.parse(responseBody,"String_Node_Str","String_Node_Str");
  ArrayList<User> users=null;
  if (results.get("String_Node_Str").equals("String_Node_Str")) {
    JSONArray usersJson=(JSONArray)results.get("String_Node_Str");
    users=new ArrayList<User>();
    for (int i=0; i < usersJson.length(); i++) {
      JSONObject friend;
      try {
        friend=usersJson.getJSONObject(i);
        String login=friend.getString("String_Node_Str");
        String firstName=friend.getString("String_Node_Str");
        String lastName=friend.getString("String_Node_Str");
        User u=new User(firstName,lastName,login);
        users.add(u);
      }
 catch (      JSONException e) {
        e.printStackTrace();
      }
    }
    results.put("String_Node_Str",users);
  }
  Log.i("String_Node_Str",responseBody.toString());
  return results;
}

Fixed version (ground truth):
private HashMap<String,Object> parseResponse(String responseBody){
  HashMap<String,Object> results=new HashMap<String,Object>();
  results=HttpConnection.parse(responseBody,"String_Node_Str","String_Node_Str");
  ArrayList<User> users=null;
  if (results.get("String_Node_Str").equals("String_Node_Str")) {
    Log.i("String_Node_Str",responseBody.toString());
    JSONArray usersJson=(JSONArray)results.get("String_Node_Str");
    users=new ArrayList<User>();
    for (int i=0; i < usersJson.length(); i++) {
      JSONObject friend;
      try {
        friend=usersJson.getJSONObject(i);
        String login=friend.getString("String_Node_Str");
        String firstName=friend.getString("String_Node_Str");
        String lastName=friend.getString("String_Node_Str");
        User u=new User(firstName,lastName,login);
        users.add(u);
      }
 catch (      JSONException e) {
        e.printStackTrace();
      }
    }
    results.put("String_Node_Str",users);
  }
  return results;
}
Program: 88883
Project: 88883
Buggy source:
@Override protected String doInBackground(String... arg0){
  String auth_token=arg0[0];
  String receiver_login=arg0[1];
  String content=arg0[2];
  Integer priority=Integer.parseInt(arg0[3]);
  HashMap<String,Object> params=new HashMap<String,Object>();
  params.put("String_Node_Str",auth_token);
  params.put("String_Node_Str",receiver_login);
  params.put("String_Node_Str",content);
  params.put("String_Node_Str",priority);
  String response=HttpConnection.makeRequest(URL,params);
  HashMap<String,Object> results=HttpConnection.parse(response,"String_Node_Str","String_Node_Str");
  Log.i("String_Node_Str",response.toString());
  return (String)results.get("String_Node_Str");
}

Fixed version (ground truth):
@Override protected String doInBackground(String... arg0){
  String auth_token=arg0[0];
  String receiver_login=arg0[1];
  String content=arg0[2];
  Integer priority=Integer.parseInt(arg0[3]);
  HashMap<String,Object> params=new HashMap<String,Object>();
  params.put("String_Node_Str",auth_token);
  params.put("String_Node_Str",receiver_login);
  params.put("String_Node_Str",content);
  params.put("String_Node_Str",priority);
  String response=HttpConnection.makeRequest(URL,params);
  HashMap<String,Object> results=HttpConnection.parse(response,"String_Node_Str","String_Node_Str");
  return (String)results.get("String_Node_Str");
}
Program: 88884
Project: 88884
Buggy source:
public static HashMap<String,Object> parse(String json,String basic,String... keys){
  Log.i("String_Node_Str",json);
  HashMap<String,Object> results=new HashMap<String,Object>();
  if (json != null) {
    try {
      JSONObject main=new JSONObject(json).getJSONObject(basic);
      String error=main.getString("String_Node_Str");
      results.put("String_Node_Str",error);
      if (error.equals("String_Node_Str")) {
        for (int i=0; i < keys.length; i++) {
          if (main.has(keys[i]))           results.put(keys[i],main.get(keys[i]));
        }
      }
    }
 catch (    JSONException e) {
      Log.e(TAG,"String_Node_Str");
      e.printStackTrace();
    }
  }
 else {
    results.put("String_Node_Str","String_Node_Str");
    Log.e(TAG,"String_Node_Str");
  }
  return results;
}

Fixed version (ground truth):
public static HashMap<String,Object> parse(String json,String basic,String... keys){
  HashMap<String,Object> results=new HashMap<String,Object>();
  if (json != null && !json.equals("String_Node_Str")) {
    Log.i("String_Node_Str",json);
    try {
      JSONObject main=new JSONObject(json).getJSONObject(basic);
      String error=main.getString("String_Node_Str");
      results.put("String_Node_Str",error);
      if (error.equals("String_Node_Str")) {
        for (int i=0; i < keys.length; i++) {
          if (main.has(keys[i]))           results.put(keys[i],main.get(keys[i]));
        }
      }
    }
 catch (    JSONException e) {
      Log.e(TAG,"String_Node_Str");
      e.printStackTrace();
    }
  }
 else {
    results.put("String_Node_Str","String_Node_Str");
    Log.e(TAG,"String_Node_Str");
  }
  return results;
}
Program: 88885
Project: 88885
Buggy source:
public void Update(boolean refresh){
  if (_isVisible) {
    _textHandler.Update();
    _textHandler.Clear();
    if (refresh) {
      StringSquisher.Clear();
      StringSquisher.Squish(title);
      HashMap<Integer,GenericItem> items=_equipment.GetItems();
      for (      Integer item : items.keySet()) {
        StringSquisher.Squish(ItemSlot.Names[item].substring(0,1),sep,items.get(item).Name,newline);
      }
      display=StringSquisher.Flush();
    }
    _textHandler.WriteDefault(display,320,30,GetHudOrigin());
  }
}

Fixed version (ground truth):
public void Update(boolean refresh){
  if (_isVisible) {
    _textHandler.Update();
    _textHandler.Clear();
    if (refresh) {
      StringSquisher.Clear();
      StringSquisher.Squish(title);
      HashMap<Integer,GenericItem> items=_equipment.GetItems();
      for (      Integer item : items.keySet()) {
        StringSquisher.Squish(ItemSlot.Names[item].substring(0,1),sep,items.get(item).Name,newline);
      }
      display=StringSquisher.Flush();
    }
    _textHandler.WriteDefault(display,20,60,GetHudOrigin());
  }
}
Program: 88886
Project: 88886
Buggy source:
protected IHud(ICreature owner,int width,int height){
  _parent=owner;
  if (_menuBase == null) {
    _menuBase=XnaManager.GetMenuBaseAsset();
  }
  _dimensions=new Point2(width,height);
  playerHudPositions.add(new Point2(GameManager.SpriteWidth / 2,XnaManager.WindowHeight - _dimensions.Y / 2));
  playerHudPositions.add(new Point2(XnaManager.WindowWidth - _dimensions.X / 2,XnaManager.WindowHeight + _dimensions.Y / 2));
  playerHudPositions.add(new Point2(0,0));
  playerHudPositions.add(new Point2(XnaManager.WindowWidth - _dimensions.X / 2,0));
}

Fixed version (ground truth):
protected IHud(ICreature owner,int width,int height){
  _parent=owner;
  if (_menuBase == null) {
    _menuBase=XnaManager.GetMenuBaseAsset();
  }
  _dimensions=new Point2(width,height);
  playerHudPositions.add(new Point2(0,XnaManager.WindowHeight - _dimensions.Y));
  playerHudPositions.add(new Point2(XnaManager.WindowWidth - _dimensions.X,XnaManager.WindowHeight + _dimensions.Y));
  playerHudPositions.add(new Point2(0,0));
  playerHudPositions.add(new Point2(XnaManager.WindowWidth - _dimensions.X,0));
}
Program: 88887
Project: 88887
Buggy source:
public void Draw(){
  if (_isVisible) {
    XnaManager.Renderer.Draw(_menuBase,GetHudOrigin(),Depth.HudBG,Color.WHITE,(int)XnaManager.GetCenter().X,(int)XnaManager.GetCenter().Y);
    _textHandler.Draw();
    _deltas.Draw();
    _equipHud.Draw();
  }
}

Fixed version (ground truth):
public void Draw(){
  if (_isVisible) {
    XnaManager.Renderer.Draw(_menuBase,GetHudOrigin(),Depth.HudBG,Color.BLACK,(int)XnaManager.GetCenter().X,(int)XnaManager.GetCenter().Y);
    _textHandler.Draw();
    _deltas.Draw();
    _equipHud.Draw();
  }
}
Program: 88888
Project: 88888
Buggy source:
public void Draw(){
  if (!_isVisible) {
    return;
  }
  XnaManager.Renderer.Draw(_menuBase,GetHudOrigin(),Depth.HudBG,Color.GREEN,GameManager.SpriteWidth,CalculateHeight(StatType.HEALTH));
  XnaManager.Renderer.Draw(_menuBase,_manaPosition,Depth.HudBG,Color.BLUE,GameManager.SpriteWidth,CalculateHeight(StatType.MANA));
  XnaManager.Renderer.Draw(_menuBase,_costPosition,Depth.HudBG,Color.YELLOW,GameManager.SpriteWidth / 2,CostOfCurrentSkill());
  _textHandler.Draw();
}

Fixed version (ground truth):
public void Draw(){
  if (!_isVisible) {
    return;
  }
  XnaManager.Renderer.Draw(_menuBase,GetHudOrigin(),Depth.HudBG,Color.GREEN,GameManager.SpriteWidth,CalculateHeight(StatType.HEALTH));
  XnaManager.Renderer.Draw(_menuBase,_manaPosition,Depth.HudBG,Color.BLUE,GameManager.SpriteWidth,CalculateHeight(StatType.MANA));
  XnaManager.Renderer.Draw(_menuBase,_manaPosition,Depth.HudBG,Color.YELLOW,GameManager.SpriteWidth / 2,CostOfCurrentSkill());
  _textHandler.Draw();
}
Program: 88889
Project: 88889
Buggy source:
public SkillHud(ICreature owner){
  super(owner,GameManager.SpriteWidth,XnaManager.WindowHeight / 4);
  _manaPosition=new Point2(GetHudOrigin().X,GetHudOrigin().Y - XnaManager.WindowHeight / 4);
  _costPosition=new Point2(GetHudOrigin().X - GameManager.SpriteWidth / 4,GetHudOrigin().Y - XnaManager.WindowHeight / 4 + _dimensions.Y / 2 - GameManager.SpriteHeight / 4);
}

Fixed version (ground truth):
public SkillHud(ICreature owner){
  super(owner,GameManager.SpriteWidth,XnaManager.WindowHeight / 4);
  _manaPosition=new Point2(GetHudOrigin().X,GetHudOrigin().Y - XnaManager.WindowHeight / 4);
}
Program: 88890
Project: 88890
Buggy source:
public void Update(){
  if (_isVisible) {
    _textHandler.Update();
    _textHandler.Clear();
    _textHandler.WriteDefault(GetSkillStrings(),GameManager.SpriteWidth,0,GetHudOrigin());
  }
}

Fixed version (ground truth):
public void Update(){
  if (_isVisible) {
    _textHandler.Update();
    _textHandler.Clear();
    _textHandler.WriteDefault(GetSkillStrings(),(int)GetHudOrigin().X + GameManager.SpriteWidth,GameManager.SpriteHeight,null);
  }
}
Program: 88891
Project: 88891
Buggy source:
public void Draw(){
  if (!_isVisible) {
    return;
  }
  XnaManager.Renderer.Draw(_menuBase.getScaledCopy((int)CalculateHeight(StatType.HEALTH).PosX,(int)CalculateHeight(StatType.HEALTH).PosY),GetHudOrigin(),Depth.HudBG,Color.green);
  XnaManager.Renderer.Draw(_menuBase.getScaledCopy((int)CostOfCurrentSkill().PosX,(int)CostOfCurrentSkill().PosY),_manaPosition,Depth.HudBG,Color.yellow);
  XnaManager.Renderer.Draw(_menuBase.getScaledCopy((int)CalculateHeight(StatType.MANA).PosX,(int)CalculateHeight(StatType.MANA).PosY),_manaPosition,Depth.HudBG,Color.blue);
  _textHandler.Draw();
}

Fixed version (ground truth):
public void Draw(){
  if (!_isVisible) {
    return;
  }
  XnaManager.Renderer.Draw(_menuBase.getScaledCopy((int)_dimensions.X,CalculateHeight(StatType.HEALTH)),GetHudOrigin(),Depth.HudBG,Color.green);
  XnaManager.Renderer.Draw(_menuBase.getScaledCopy((int)_dimensions.X,CalculateHeight(StatType.MANA)),_manaPosition,Depth.HudBG,Color.blue);
  XnaManager.Renderer.Draw(_menuBase.getScaledCopy((int)(_dimensions.X * .5f),CostOfCurrentSkill()),_manaPosition,Depth.HudBG,Color.yellow);
  _textHandler.Draw();
}
Program: 88892
Project: 88892
Buggy source:
private Point2 CostOfCurrentSkill(){
  return new Point2(_dimensions.X * .5f,_parent.GetCurrentSkillCost() / _parent.GetMax(StatType.MANA) * _dimensions.Y);
}

Fixed version (ground truth):
private int CostOfCurrentSkill(){
  return (int)(_parent.GetCurrentSkillCost() / _parent.GetMax(StatType.MANA) * _dimensions.Y);
}
Program: 88893
Project: 88893
Buggy source:
private Point2 CalculateHeight(String statType){
  return new Point2(_dimensions.X,(_parent.Get(statType) / _parent.GetMax(statType)) * _dimensions.Y);
}

Fixed version (ground truth):
private int CalculateHeight(String statType){
  return (int)((_parent.Get(statType) / _parent.GetMax(statType)) * _dimensions.Y);
}
Program: 88894
Project: 88894
Buggy source:
private static AbstractCreature GenerateCreature(int actorType){
switch (actorType) {
case AigilasActorType.PEON:
    return new Peon();
case AigilasActorType.ZORB:
  return new Zorb();
case AigilasActorType.WRATH:
return new Wrath();
case AigilasActorType.HAND:
return new Hand();
case AigilasActorType.PRIDE:
return new Pride();
case AigilasActorType.ENVY:
return new Envy();
case AigilasActorType.GLUTTONY:
return new Gluttony();
case AigilasActorType.LUST:
return new Lust();
case AigilasActorType.SLOTH:
return new Sloth();
case AigilasActorType.GREED:
return new Greed();
case AigilasActorType.SERPENT:
return new Serpent();
case AigilasActorType.BREAKING_WHEEL:
return new BreakingWheel();
default :
try {
throw new Exception("String_Node_Str" + actorType);
}
 catch (Exception e) {
e.printStackTrace();
}
}
}

Fixed version (ground truth):
private static AbstractCreature GenerateCreature(int actorType){
switch (actorType) {
case AigilasActorType.PEON:
    return new Peon();
case AigilasActorType.ZORB:
  return new Zorb();
case AigilasActorType.WRATH:
return new Wrath();
case AigilasActorType.HAND:
return new Hand();
case AigilasActorType.PRIDE:
return new Pride();
case AigilasActorType.ENVY:
return new Envy();
case AigilasActorType.GLUTTONY:
return new Gluttony();
case AigilasActorType.LUST:
return new Lust();
case AigilasActorType.SLOTH:
return new Sloth();
case AigilasActorType.GREED:
return new Greed();
case AigilasActorType.SERPENT:
return new Serpent();
case AigilasActorType.BREAKING_WHEEL:
return new BreakingWheel();
default :
try {
throw new Exception("String_Node_Str" + actorType);
}
 catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
Program: 88895
Project: 88895
Buggy source:
public void React(String skillId){
}

Fixed version (ground truth):
public void React(String skillId){
  if (_actorType == AigilasActorType.PLAYER && skillId != SkillId.FORGET_SKILL && _god.NameText == GodId.Names[GodId.GLUTTONY]) {
    if (_skills.Count() < _currentLevel) {
      _skills.Add(skillId);
    }
  }
}
Program: 88896
Project: 88896
Buggy source:
public ComboMarker(ICreature source,int elementId,int index){
}

Fixed version (ground truth):
public ComboMarker(ICreature source,int elementId,int index){
  Initialize(source.GetLocation(),SpriteType.COMBO_MARKER,com.aigilas.EntityType.COMBO_MARKER,com.aigilas.Depth.ComboMarker);
  _graphic.SetColor(Elements.Colors[elementId]);
  _graphic.SetAlpha(0);
  ParticleEngine.Emit(com.spx.particles.behaviors.RotateBehavior.GetInstance(),this,_graphic.GetColor());
  _parent=source;
  _index=index;
}
Program: 88897
Project: 88897
Buggy source:
private List<Class> resolveParameters(boolean required,Method method,List<Class> types){
  Type[] parameters=method.getGenericParameterTypes();
  for (  Type parameter : parameters) {
    CastUtil.ParamType resolvedType=CastUtil.resolveParamType(parameter);
    Class type=resolvedType.getType();
    if (!resolvedType.isOptional() && required) {
      types.add(type);
    }
 else     if (resolvedType.isOptional() && !required) {
      types.add(type);
    }
  }
  return types;
}

Fixed version (ground truth):
private void resolveParameters(boolean required,Method method,List<Class> types){
  Type[] parameters=method.getGenericParameterTypes();
  for (  Type parameter : parameters) {
    CastUtil.ParamType resolvedType=CastUtil.resolveParamType(parameter);
    Class type=resolvedType.getType();
    if (!resolvedType.isOptional() && required) {
      types.add(type);
    }
 else     if (resolvedType.isOptional() && !required) {
      types.add(type);
    }
  }
}
Program: 88898
Project: 88898
Buggy source:
@Override public void write(Collection<? extends Annotation> annotations){
  try {
    Map<Class,Annotation> bag=constructAnnotationBag(annotations);
    callWriteMethod(bag,this.writeMethod);
  }
 catch (  InvocationTargetException e) {
    e.printStackTrace();
  }
catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void write(Collection<? extends Annotation> annotations){
  try {
    Map<Class,Annotation> bag=constructAnnotationBag(annotations);
    callWriteMethod(bag,this.writeMethod);
  }
 catch (  InvocationTargetException e) {
    throw new RuntimeException(e);
  }
catch (  IllegalAccessException e) {
    throw new RuntimeException(e);
  }
}
Program: 88899
Project: 88899
Buggy source:
@Override public void setValidator(ValidatorWriter<? super C,? super W>... validatorWriters){
  for (  ValidatorWriter<? super C,? super W> validatorWriter : validatorWriters) {
    writers.add(validatorWriter);
  }
}

Fixed version (ground truth):
@Override public void setValidator(ValidatorWriter<? super C,? super W>... validatorWriters){
  Collections.addAll(writers,validatorWriters);
}
Program: 88900
Project: 88900
Buggy source:
@Override public void processModel(final Model model,ItemStatus status){
  LOG.trace("String_Node_Str",model.toString());
  String modelName=model.getName();
  if (getContext().getOutputMode() == OutputMode.JAVASCRIPT) {
    getWriter().write(modelName).writeKey("String_Node_Str").startFunctionCallBlock(BACKBONE_MODEL_EXTEND);
  }
 else {
    getWriter().writeKey(modelName).startBlock();
  }
  ItemProcessor.process(getModelProcessors()).with(new ItemHandler<ModelProcessor<JavaScriptContext,JavaScriptWriter>>(){
    @Override public void process(    ModelProcessor<JavaScriptContext,JavaScriptWriter> item,    ItemStatus status){
      writeSection(item.getName(),model,item,status);
    }
  }
);
  getWriter().indentBack();
  if (getContext().getOutputMode() == OutputMode.JAVASCRIPT) {
    getWriter().endFunctionCallBlock(status);
  }
 else {
    getWriter().endBlock(status);
  }
}

Fixed version (ground truth):
@Override public void processModel(final Model model,ItemStatus status){
  LOG.trace("String_Node_Str",model.toString());
  String modelName=model.getName();
  if (getContext().getOutputMode() == OutputMode.JAVASCRIPT) {
    getWriter().write(modelName).writeKey("String_Node_Str").startFunctionCallBlock(BACKBONE_MODEL_EXTEND);
  }
 else {
    getWriter().writeKey(modelName).startBlock();
  }
  ItemProcessor.process(getModelProcessors()).with(new ItemHandler<ModelProcessor<JavaScriptContext,JavaScriptWriter>>(){
    @Override public void process(    ModelProcessor<JavaScriptContext,JavaScriptWriter> item,    ItemStatus status){
      writeSection(item.getName(),model,item,status);
    }
  }
);
  if (getContext().getOutputMode() == OutputMode.JAVASCRIPT) {
    getWriter().endFunctionCallBlock(status);
  }
 else {
    getWriter().endBlock(status);
  }
}
Program: 88901
Project: 88901
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public void endProcessing(ItemStatus status) throws IOException {
  getWriter().indentBack();
  if (getContext().getOutputMode() == OutputMode.JAVASCRIPT) {
    getWriter().endBlockStatement();
  }
 else {
    getWriter().endBlock(ItemStatuses.last());
  }
  LOG.trace("String_Node_Str");
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public void endProcessing(ItemStatus status) throws IOException {
  if (getContext().getOutputMode() == OutputMode.JAVASCRIPT) {
    getWriter().endBlockStatement();
  }
 else {
    getWriter().endBlock(ItemStatuses.last());
  }
  LOG.trace("String_Node_Str");
}