nus-yam/ex-repair huggingface dataset:
Program: 81424
Project: 81424
Buggy source:
public void onPlayerBucketEmpty(PlayerBucketEmptyEvent event){
  if (plugin.isInsideJail(event.getBlockClicked().getLocation()) || plugin.isInsideJail(event.getBlockClicked().getFace(event.getBlockFace()).getLocation())) {
    if (Settings.BucketPenalty > 0 && Jail.prisoners.containsKey(event.getPlayer().getName().toLowerCase()) && Jail.prisoners.get(event.getPlayer().getName().toLowerCase()).getRemainingTime() > 0) {
      JailPrisoner prisoner=Jail.prisoners.get(event.getPlayer().getName().toLowerCase());
      Util.Message(Settings.MessageBucketPenalty,event.getPlayer());
      prisoner.setRemainingTime(prisoner.getRemainingTime() + Settings.BucketPenalty * 6);
      InputOutput.UpdatePrisoner(prisoner);
    }
 else {
      Util.Message(Settings.MessageBucketNoPenalty,event.getPlayer());
    }
    event.setCancelled(true);
  }
}

Fixed version (ground truth):
public void onPlayerBucketEmpty(PlayerBucketEmptyEvent event){
  if (JailZoneManager.isInsideJail(event.getBlockClicked().getLocation()) || JailZoneManager.isInsideJail(event.getBlockClicked().getFace(event.getBlockFace()).getLocation())) {
    if (Settings.BucketPenalty > 0 && Jail.prisoners.containsKey(event.getPlayer().getName().toLowerCase()) && Jail.prisoners.get(event.getPlayer().getName().toLowerCase()).getRemainingTime() > 0) {
      JailPrisoner prisoner=Jail.prisoners.get(event.getPlayer().getName().toLowerCase());
      Util.Message(Settings.MessageBucketPenalty,event.getPlayer());
      prisoner.setRemainingTime(prisoner.getRemainingTime() + Settings.BucketPenalty * 6);
      InputOutput.UpdatePrisoner(prisoner);
    }
 else {
      Util.Message(Settings.MessageBucketNoPenalty,event.getPlayer());
    }
    event.setCancelled(true);
  }
}
Program: 81425
Project: 81425
Buggy source:
/** 
 * Delete this cell from database
 */
public void delete(){
  InputOutput.DeleteCell(this);
  getJail().getCellList().remove(this);
}

Fixed version (ground truth):
/** 
 * Delete this cell from database
 */
public void delete(){
  InputOutput.DeleteCell(this);
  if (getJail() != null)   getJail().getCellList().remove(this);
}
Program: 81426
Project: 81426
Buggy source:
/** 
 * @return First empty cell in this jail zone.
 */
public JailCell getEmptyCell(){
  for (  JailCell c : cells) {
    if (c.getPlayerName() == null || c.getPlayerName().trim().equals("String_Node_Str")) {
      return c;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @return First empty cell in this jail zone.
 */
public JailCell getEmptyCell(){
  for (  JailCell c : cells) {
    if (c.getPlayerName() == null || c.getPlayerName().trim().equals("String_Node_Str") || !Jail.prisoners.containsKey(c.getPlayerName())) {
      return c;
    }
  }
  return null;
}
Program: 81429
Project: 81429
Buggy source:
public PropertiesFile(File file){
  this.file=file;
  map=new HashMap<String,PropertiesEntry>();
  Scanner scan;
  try {
    if (!file.exists())     file.createNewFile();
    scan=new Scanner(file);
    while (scan.hasNextLine()) {
      String line=scan.nextLine();
      if (!line.contains("String_Node_Str"))       continue;
      int equals=line.indexOf("String_Node_Str");
      int commentIndex=line.length();
      if (line.contains("String_Node_Str")) {
        commentIndex=line.indexOf("String_Node_Str");
      }
      String key=line.substring(0,equals).trim();
      if (key.equals("String_Node_Str"))       continue;
      String value=line.substring(equals + 1,commentIndex).trim();
      String comment="String_Node_Str";
      if (commentIndex < line.length() - 1) {
        comment=line.substring(commentIndex + 1,line.length()).trim();
      }
      map.put(key,new PropertiesEntry(value));
    }
  }
 catch (  FileNotFoundException e) {
    Jail.log.log(Level.SEVERE,"String_Node_Str" + file.getName());
  }
catch (  IOException e) {
    Jail.log.log(Level.SEVERE,"String_Node_Str" + file.getName());
  }
}

Fixed version (ground truth):
public PropertiesFile(File file){
  this.file=file;
  map=new HashMap<String,PropertiesEntry>();
  Scanner scan;
  try {
    if (!file.exists())     file.createNewFile();
    scan=new Scanner(file);
    while (scan.hasNextLine()) {
      String line=scan.nextLine();
      if (!line.contains("String_Node_Str"))       continue;
      int equals=line.indexOf("String_Node_Str");
      int commentIndex=line.length();
      if (line.contains("String_Node_Str")) {
        commentIndex=line.indexOf("String_Node_Str");
      }
      String key=line.substring(0,equals).trim();
      if (key.equals("String_Node_Str"))       continue;
      String value=line.substring(equals + 1,commentIndex).trim();
      map.put(key,new PropertiesEntry(value));
    }
  }
 catch (  FileNotFoundException e) {
    Jail.log.log(Level.SEVERE,"String_Node_Str" + file.getName());
  }
catch (  IOException e) {
    Jail.log.log(Level.SEVERE,"String_Node_Str" + file.getName());
  }
}
Program: 81430
Project: 81430
Buggy source:
public void onPlayerRespawn(PlayerRespawnEvent event){
  if (Jail.prisoners.containsKey(event.getPlayer().getName().toLowerCase()) && !Jail.prisoners.get(event.getPlayer().getName().toLowerCase()).isBeingReleased()) {
    JailPrisoner prisoner=Jail.prisoners.get(event.getPlayer().getName().toLowerCase());
    JailZone jail=prisoner.getJail();
    if (!jail.isInside(event.getRespawnLocation())) {
      if (Settings.PlayerMovePenalty > 0 && prisoner.getRemainingTime() > 0) {
        Util.Message(Settings.MessageMovePenalty,event.getPlayer());
        prisoner.setRemainingTime(prisoner.getRemainingTime() + Settings.PlayerMovePenalty * 6);
        InputOutput.UpdatePrisoner(prisoner);
      }
 else {
        Util.Message(Settings.MessageMoveNoPenalty,event.getPlayer());
      }
      event.setRespawnLocation(prisoner.getTeleportLocation());
    }
  }
}

Fixed version (ground truth):
public void onPlayerRespawn(PlayerRespawnEvent event){
  if (Jail.prisoners.containsKey(event.getPlayer().getName().toLowerCase()) && !Jail.prisoners.get(event.getPlayer().getName().toLowerCase()).isBeingReleased()) {
    JailPrisoner prisoner=Jail.prisoners.get(event.getPlayer().getName().toLowerCase());
    JailZone jail=prisoner.getJail();
    if (!jail.isInside(event.getRespawnLocation())) {
      if (Settings.PlayerMovePenalty > 0 && prisoner.getRemainingTime() > 0) {
        Util.Message(Settings.MessageMovePenalty,event.getPlayer());
        prisoner.setRemainingTime(prisoner.getRemainingTime() + Settings.PlayerMovePenalty * 6);
        InputOutput.UpdatePrisoner(prisoner);
      }
 else {
        Util.Message(Settings.MessageMoveNoPenalty,event.getPlayer());
      }
      final Location teleloc=prisoner.getTeleportLocation();
      final Player player=event.getPlayer();
      Jail.instance.getServer().getScheduler().scheduleSyncDelayedTask(Jail.instance,new Runnable(){
        public void run(){
          if (player != null)           player.teleport(teleloc);
        }
      }
,1);
    }
  }
}
Program: 81436
Project: 81436
Buggy source:
@Override public void windowClosed(WindowEvent e){
  proxy.removeListener(boardFrame);
  boardFrame.dispose();
}

Fixed version (ground truth):
@Override public void windowClosed(WindowEvent e){
  proxy.removeListener(boardFrame);
}
Program: 81437
Project: 81437
Buggy source:
public void attachView(String playerName){
  if (boardFrame != null)   throw new RuntimeException("String_Node_Str");
  boardFrame=new BoardFrame();
  if (!StringUtils.isEmpty(playerName)) {
    boardFrame.getGamePanel().trackPlayer(playerName);
  }
  proxy.addListener(boardFrame);
  boardFrame.addWindowListener(new WindowAdapter(){
    @Override public void windowClosed(    WindowEvent e){
      proxy.removeListener(boardFrame);
      boardFrame.dispose();
    }
  }
);
}

Fixed version (ground truth):
public void attachView(String playerName){
  if (boardFrame != null)   throw new RuntimeException("String_Node_Str");
  boardFrame=new BoardFrame();
  if (!StringUtils.isEmpty(playerName)) {
    boardFrame.getGamePanel().trackPlayer(playerName);
  }
  proxy.addListener(boardFrame);
  boardFrame.addWindowListener(new WindowAdapter(){
    @Override public void windowClosed(    WindowEvent e){
      proxy.removeListener(boardFrame);
    }
  }
);
}
Program: 81438
Project: 81438
Buggy source:
/** 
 * Starts the game, does not return until the game ends. The game can be interrupted by setting the running thread's interrupted flag.
 */
public GameResult run(Mode mode){
  this.mode=mode;
  lastBonusFrame=bonusPeriod;
  int frame=0;
  GameResult result=null;
  events.add(new GameStartEvent(boardData));
  do {
    if (Thread.currentThread().isInterrupted() || (result == null && frameLimit > 0 && frame > frameLimit)) {
      interrupted=true;
      break;
    }
    try {
      timer.waitForFrame();
    }
 catch (    InterruptedException e) {
      interrupted=true;
      break;
    }
    firePreFrameEvent(frame);
synchronized (this) {
      this.currentFrame=frame;
      processBoardCells();
      processPlayers(frame);
      processBonuses(frame);
      events.add(new GameStateEvent(board.cells,playerInfos));
      if (dispatchPlayerStatuses || (frame % 50) == 0) {
        events.add(new GameStatusEvent(getPlayerStats(),getTeamStats()));
      }
      fireFrameEvent(frame);
      frame++;
      if (result == null) {
        result=checkGameOver();
      }
      events.clear();
      this.dispatchPlayerStatuses=false;
    }
    firePostFrameEvent(frame);
  }
 while (result == null || lingerFrames-- > 0);
  if (interrupted || Thread.interrupted()) {
    if (result == null)     result=new GameResult(mode,getPlayerStats());
    result.gameInterrupted=true;
  }
  events.add(new GameOverEvent());
  fireFrameEvent(frame);
  return result;
}

Fixed version (ground truth):
/** 
 * Starts the game, does not return until the game ends. The game can be interrupted by setting the running thread's interrupted flag.
 */
public GameResult run(Mode mode){
  this.mode=mode;
  lastBonusFrame=bonusPeriod;
  int frame=0;
  GameResult result=null;
  events.add(new GameStartEvent(boardData));
  do {
    if (interrupted || Thread.currentThread().isInterrupted() || (result == null && frameLimit > 0 && frame > frameLimit)) {
      interrupted=true;
      break;
    }
    try {
      timer.waitForFrame();
    }
 catch (    InterruptedException e) {
      interrupted=true;
      break;
    }
    firePreFrameEvent(frame);
synchronized (this) {
      this.currentFrame=frame;
      processBoardCells();
      processPlayers(frame);
      processBonuses(frame);
      events.add(new GameStateEvent(board.cells,playerInfos));
      if (dispatchPlayerStatuses || (frame % 50) == 0) {
        events.add(new GameStatusEvent(getPlayerStats(),getTeamStats()));
      }
      fireFrameEvent(frame);
      frame++;
      if (result == null) {
        result=checkGameOver();
      }
      events.clear();
      this.dispatchPlayerStatuses=false;
    }
    firePostFrameEvent(frame);
  }
 while (result == null || lingerFrames-- > 0);
  if (interrupted || Thread.interrupted()) {
    if (result == null)     result=new GameResult(mode,getPlayerStats());
    result.gameInterrupted=true;
  }
  events.add(new GameOverEvent());
  fireFrameEvent(frame);
  return result;
}
Program: 81440
Project: 81440
Buggy source:
public BufferedImage getSpriteImage(SpriteType type,int state,int frameCounter){
  final SpriteData data=sprites.get(type);
  if (data == null)   return null;
  if (state >= data.frames.length || data.frames[state].length == 0)   return null;
  final int frame;
  if (frameCounter == 0) {
    frame=0;
  }
 else {
    frame=1 + (frameCounter - 1) / data.frameAdvanceRate;
  }
  final int frames=data.frames[state].length;
  return data.frames[state][frame % frames];
}

Fixed version (ground truth):
public BufferedImage getSpriteImage(SpriteType type,int state,int frame){
  final SpriteData data=sprites.get(type);
  if (data == null)   return null;
  if (state >= data.frames.length || data.frames[state].length == 0)   return null;
  final int frames=data.frames[state].length;
  return data.frames[state][frame % frames];
}
Program: 81442
Project: 81442
Buggy source:
public List<URLTriggerRequestHeader> getRequestHeaders(){
  return requestHeaders;
}

Fixed version (ground truth):
public List<URLTriggerRequestHeader> getRequestHeaders(){
  if (requestHeaders == null) {
    return new ArrayList<URLTriggerRequestHeader>();
  }
 else {
    return requestHeaders;
  }
}
Program: 81443
Project: 81443
Buggy source:
private double getMax(double[] a,int o,int l){
  double r=0;
  for (int i=o; i < o + l; i++) {
    if (Math.abs(a[i]) > r)     r=a[i];
  }
  return r;
}

Fixed version (ground truth):
private double getMax(double[] a,int o,int l){
  double r=0;
  for (int i=o; i < o + l; i+=2) {
    if (Math.abs(a[i]) > r)     r=a[i];
  }
  return r;
}
Program: 81444
Project: 81444
Buggy source:
public boolean reservationExists(CacheKey key){
  boolean found=false;
  for (  SeatBlock block : reserved) {
    if (block.getKey().getShowId() == key.getShowId()) {
      if (showDao.getSectionIdByRowId(block.getKey().getRowId()) == showDao.getSectionIdByRowId(key.getRowId())) {
        found=true;
      }
    }
  }
  return found;
}

Fixed version (ground truth):
public boolean reservationExists(CacheKey key){
  for (  SeatBlock block : reserved) {
    if (block.getKey().getShowId() == key.getShowId()) {
      if (showDao.getSectionIdByRowId(block.getKey().getRowId()) == showDao.getSectionIdByRowId(key.getRowId())) {
        return true;
      }
    }
  }
  return false;
}
Program: 81445
Project: 81445
Buggy source:
public boolean updateSeatReservation(Long showId,Long sectionId,int quantity){
  boolean found=false, success=false;
  Section section=showDao.findSection(sectionId);
  List<SectionRow> rows=showDao.getRowsBySection(section,quantity);
  if (quantity < 0) {
    return success;
  }
  for (  SectionRow row : rows) {
    CacheKey key=new CacheKey(showId,row.getId());
    found=bookingState.reservationExists(key);
    if (found == true) {
      if (quantity == 0) {
        this.removeSeatReservation(showId,row.getId());
        return true;
      }
      SeatBlock block=this.update(showId,row.getId(),quantity);
      if (block != null) {
        success=true;
      }
 else {
        success=false;
      }
    }
  }
  if (found == false) {
    success=this.findContiguousSeats(showId,sectionId,quantity);
  }
  return success;
}

Fixed version (ground truth):
public boolean updateSeatReservation(Long showId,Long sectionId,int quantity){
  boolean found=false, success=false;
  Section section=showDao.findSection(sectionId);
  List<SectionRow> rows=showDao.getRowsBySection(section,quantity);
  if (quantity < 0) {
    return false;
  }
  for (  SectionRow row : rows) {
    CacheKey key=new CacheKey(showId,row.getId());
    found=bookingState.reservationExists(key);
    if (found == true) {
      if (quantity == 0) {
        this.removeSeatReservation(showId,row.getId());
        return true;
      }
      SeatBlock block=this.update(showId,row.getId(),quantity);
      if (block != null) {
        return true;
      }
 else {
        return false;
      }
    }
  }
  if (found == false) {
    success=this.findContiguousSeats(showId,sectionId,quantity);
  }
  return success;
}
Program: 81446
Project: 81446
Buggy source:
@Ignore public void testUpdateSeatAllocation(){
  boolean success=reservationManager.findContiguousSeats((long)3,(long)100,10);
  Assert.assertEquals(true,success);
  Assert.assertEquals(1,reservationManager.getBookingState().getReserved().get(0).getStartSeat());
  Assert.assertEquals(10,reservationManager.getBookingState().getReserved().get(0).getEndSeat());
  Assert.assertEquals(1,reservationManager.getBookingState().getReserved().size());
  success=reservationManager.updateSeatReservation((long)3,(long)100,15);
  Assert.assertEquals(1,reservationManager.getBookingState().getReserved().size());
  Assert.assertEquals(1,reservationManager.getBookingState().getReserved().get(0).getStartSeat());
  Assert.assertEquals(15,reservationManager.getBookingState().getReserved().get(0).getEndSeat());
  Assert.assertEquals((long)1,reservationManager.getBookingState().getReserved().get(0).getKey().getRowId(),0);
  success=reservationManager.findContiguousSeats((long)3,(long)100,50);
  Assert.assertEquals((long)2,reservationManager.getBookingState().getReserved().get(1).getKey().getRowId(),0);
  Assert.assertEquals(1,reservationManager.getBookingState().getReserved().get(1).getStartSeat());
  Assert.assertEquals(50,reservationManager.getBookingState().getReserved().get(1).getEndSeat());
}

Fixed version (ground truth):
@Test public void testUpdateSeatAllocation(){
  Assert.assertEquals(2,reservationManager.getBookingState().getReserved().size());
  Assert.assertEquals(1,reservationManager.getBookingState().getReserved().get(0).getStartSeat());
  Assert.assertEquals(10,reservationManager.getBookingState().getReserved().get(0).getEndSeat());
  Assert.assertEquals(11,reservationManager.getBookingState().getReserved().get(1).getStartSeat());
  Assert.assertEquals(15,reservationManager.getBookingState().getReserved().get(1).getEndSeat());
  Assert.assertEquals(true,reservationManager.getBookingState().getReserved().get(0).getKey().equals(reservationManager.getBookingState().getReserved().get(1).getKey()));
  boolean success=reservationManager.findContiguousSeats((long)3,(long)101,10);
  Assert.assertEquals(true,success);
  Assert.assertEquals(3,reservationManager.getBookingState().getReserved().size());
  Assert.assertEquals(1,reservationManager.getBookingState().getReserved().get(2).getStartSeat());
  Assert.assertEquals(10,reservationManager.getBookingState().getReserved().get(2).getEndSeat());
  success=reservationManager.updateSeatReservation((long)3,(long)101,15);
  Assert.assertEquals(true,success);
  Assert.assertEquals(3,reservationManager.getBookingState().getReserved().size());
  Assert.assertEquals(1,reservationManager.getBookingState().getReserved().get(2).getStartSeat());
  Assert.assertEquals(15,reservationManager.getBookingState().getReserved().get(2).getEndSeat());
  Assert.assertEquals((long)51,reservationManager.getBookingState().getReserved().get(2).getKey().getRowId(),0);
}
Program: 81447
Project: 81447
Buggy source:
@RequestMapping(method=RequestMethod.POST) public String onSubmit(BookingRequest command,Model model){
  for (  PriceCategoryRequest categoryRequest : command.getCategoryRequests()) {
    int quantity=categoryRequest.getQuantity();
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.POST) public String onSubmit(BookingRequest command,Model model){
  return "String_Node_Str";
}
Program: 81448
Project: 81448
Buggy source:
public static void performDirectEditing(GraphicalEditPart editPart,SmartLabelFigure textFigure){
  OPPNamedElementDirectEditManager manager;
  manager=new OPPNamedElementDirectEditManager(editPart,TextCellEditor.class,new OPPNamedElementCellEditorLocator(textFigure),textFigure);
  manager.show();
}

Fixed version (ground truth):
public static void performDirectEditing(GraphicalEditPart editPart,SmartLabelFigure textFigure){
  OPPNamedElementDirectEditManager manager;
  manager=new OPPNamedElementDirectEditManager(editPart,MultiLineTextCellEditor.class,new OPPNamedElementCellEditorLocator(textFigure),textFigure);
  manager.show();
}
Program: 81449
Project: 81449
Buggy source:
public Command getCommandToMoveBendpointsAfterTargetHasMoved(OPPStructuralLinkPart link,Rectangle rect,IFigure translator){
  if (link.getTarget() instanceof OPPStructuralLinkAggregator)   return getCommandToMoveBendpointsAfterTargetAggregatorHasMoved(link,rect);
 else   return getCommandToMoveBendpointsAfterTargetThingHasMoved(link,rect,translator);
}

Fixed version (ground truth):
public Command getCommandToMoveBendpointsAfterTargetHasMoved(OPPStructuralLinkPart link,Rectangle rect,IFigure translator){
  if (link.getTarget() instanceof OPPStructuralLinkAggregator)   return getCommandToMoveBendpointsAfterTargetAggregatorHasMoved(link,rect,translator);
 else   return getCommandToMoveBendpointsAfterTargetThingHasMoved(link,rect,translator);
}
Program: 81450
Project: 81450
Buggy source:
private Command getCommandToMoveBendpointsAfterTargetAggregatorHasMoved(OPPStructuralLinkPart link,Rectangle rect){
  CompoundCommand cc=new CompoundCommand();
  Point prevPoint=pointFromOPPPoint(link.getBendpoints().get(link.getBendpoints().size() - 2));
  cc.add(newMoveBendpointCommand(link,link.getBendpoints().size() - 1,new Point(rect.x + rect.width / 2,rect.y)));
  cc.add(newMoveBendpointCommand(link,link.getBendpoints().size() - 2,prevPoint.setX(rect.x + rect.width / 2)));
  if (link.getBendpoints().size() == 2) {
    if (!isBetween(middle(rect.x,rect.x + rect.width),left(link.getSource()),right(link.getSource()))) {
      cc.add(newCreateBendpointCommand(link,0,getStructuralLinkEndpoint(link.getSource(),prevPoint)));
    }
  }
  return cc;
}

Fixed version (ground truth):
private Command getCommandToMoveBendpointsAfterTargetAggregatorHasMoved(OPPStructuralLinkPart link,Rectangle rect,IFigure translator){
  CompoundCommand cc=new CompoundCommand();
  rect=rect.getCopy();
  Point prevPoint=pointFromOPPPoint(link.getBendpoints().get(link.getBendpoints().size() - 2));
  cc.add(newMoveBendpointCommand(link,link.getBendpoints().size() - 1,new Point(rect.x + rect.width / 2,rect.y)));
  cc.add(newMoveBendpointCommand(link,link.getBendpoints().size() - 2,prevPoint.setX(rect.x + rect.width / 2)));
  if (link.getBendpoints().size() == 2) {
    Rectangle linkSource=rectangleFromOPPNode(link.getSource());
    translator.translateToAbsolute(linkSource);
    if (!isBetween(middle(rect.x,rect.x + rect.width),left(linkSource),right(linkSource))) {
      cc.add(newCreateBendpointCommand(link,0,getStructuralLinkEndpoint(linkSource,prevPoint)));
    }
  }
  return cc;
}
Program: 81451
Project: 81451
Buggy source:
@Override public OPPObjectInstance getArgument(String name){
  if (name == null)   name="String_Node_Str";
 else {
    if (!getAllParameterNames().contains(name)) {
      logSevere("String_Node_Str",getName(),name);
      throw new OPPRuntimeException("String_Node_Str" + getName() + "String_Node_Str"+ name+ "String_Node_Str");
    }
  }
  return getHeap().getArgument(name.toLowerCase());
}

Fixed version (ground truth):
@Override public OPPObjectInstance getArgument(String name){
  if (name == null)   name="String_Node_Str";
 else {
  }
  return getHeap().getArgument(name.toLowerCase());
}
Program: 81452
Project: 81452
Buggy source:
@Override public void setArgument(String name,OPPObjectInstance value){
  if (name == null)   name="String_Node_Str";
 else {
    if (!getAllParameterNames().contains(name)) {
      logSevere("String_Node_Str",getName(),name);
      throw new OPPRuntimeException("String_Node_Str" + getName() + "String_Node_Str"+ name+ "String_Node_Str");
    }
  }
  getHeap().setArgument(name.toLowerCase(),value);
}

Fixed version (ground truth):
@Override public void setArgument(String name,OPPObjectInstance value){
  if (name == null)   name="String_Node_Str";
 else {
  }
  getHeap().setArgument(name.toLowerCase(),value);
}
Program: 81455
Project: 81455
Buggy source:
@Override protected void postExecution(){
  super.postExecution();
  getHeap().exportVariableValuesToArguments(getOpd());
}

Fixed version (ground truth):
@Override protected void postExecution(){
  getHeap().exportVariableValuesToArguments(getOpd());
  super.postExecution();
}
Program: 81456
Project: 81456
Buggy source:
/** 
 * Set the text of the figure's tooltip. If the text is null or empty, no tooltip will be shown.
 * @param tooltipText the text to show as the figure's tooltip.
 */
public void setTooltipText(String tooltipText){
  if (tooltipText != null && tooltipText != "String_Node_Str") {
    tooltipFigure.setMessage(tooltipText);
    setToolTip(tooltipFigure);
  }
 else {
    setToolTip(null);
  }
}

Fixed version (ground truth):
/** 
 * Set the text of the figure's tooltip. If the text is null or empty, no tooltip will be shown.
 * @param tooltipText the text to show as the figure's tooltip.
 */
public void setTooltipText(String tooltipText){
  if (tooltipText != null && "String_Node_Str".equals(tooltipText)) {
    tooltipFigure.setMessage(tooltipText);
    setToolTip(tooltipFigure);
  }
 else {
    setToolTip(null);
  }
}
Program: 81457
Project: 81457
Buggy source:
@Override protected void executing(){
  loadMethod();
  for (  String parameter : parameters) {
    OPPObject object=OPPFactory.eINSTANCE.createOPPObject();
    object.setName(parameter);
  }
  arguments=new Object[parameters.length];
  for (int i=0; i < parameters.length; i++) {
    arguments[i]=getArgument("String_Node_Str" + i);
  }
  OPPObjectInstance instance=null;
  if (!method.getReturnType().equals(Void.TYPE)) {
    setArgument("String_Node_Str",instance);
  }
}

Fixed version (ground truth):
@Override protected void executing(){
  loadMethod();
  for (  String parameter : parameters) {
    OPPObject object=OPPFactory.eINSTANCE.createOPPObject();
    object.setName(parameter);
  }
  arguments=new Object[parameters.length];
  for (int i=0; i < parameters.length; i++) {
    arguments[i]=getArgument("String_Node_Str" + i);
  }
}
Program: 81458
Project: 81458
Buggy source:
@Override public void executing(){
  BigDecimal a=getArgument("String_Node_Str").getNumericalValue();
  BigDecimal b=getArgument("String_Node_Str").getNumericalValue();
  BigDecimal c=null;
switch (opType) {
case ADD:
    c=a.add(b);
  break;
case SUBS:
c=a.subtract(b);
break;
case MULT:
c=a.multiply(b);
break;
case DIV:
c=a.divide(b);
break;
case POW:
c=a.pow(b.intValueExact());
break;
}
OPPObjectInstance instance=OPPObjectInstance.createFromValue(c);
setArgument("String_Node_Str",instance);
}

Fixed version (ground truth):
@Override public void executing(){
  BigDecimal a=getArgument("String_Node_Str").getNumericalValue();
  BigDecimal b=getArgument("String_Node_Str").getNumericalValue();
  BigDecimal c=new BigDecimal(0);
switch (opType) {
case ADD:
    c=a.add(b);
  break;
case SUBS:
c=a.subtract(b);
break;
case MULT:
c=a.multiply(b);
break;
case DIV:
c=a.divide(b);
break;
case POW:
c=a.pow(b.intValueExact());
break;
}
OPPObjectInstance instance=OPPObjectInstance.createFromValue(c);
setArgument("String_Node_Str",instance);
}
Program: 81459
Project: 81459
Buggy source:
@Override protected void executing(){
  OPPObjectInstance prompt=getArgument(PROMPT_PARAM_NAME);
  if (prompt != null)   System.out.println(prompt);
  BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
  String input="String_Node_Str";
  try {
    input=br.readLine();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  OPPObjectInstance instance=valueAnalyzer.calculateOPMObjectValue(input);
  setArgument(INPUT_PARAM_NAME,instance);
}

Fixed version (ground truth):
@Override protected void executing(){
  OPPObjectInstance prompt=getArgument(PROMPT_PARAM_NAME);
  if (prompt != null)   System.out.println(prompt);
  BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
  String input="String_Node_Str";
  try {
    input=br.readLine();
    if (input != null) {
      OPPObjectInstance instance=valueAnalyzer.calculateOPMObjectValue(input);
      setArgument(INPUT_PARAM_NAME,instance);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 81460
Project: 81460
Buggy source:
public void extractResultsToVariables(OPPProcess process,OPPProcessInstance instance){
  Map<String,OPPArgument> namedResults=Maps.newHashMap();
  List<OPPArgument> anonymousResults=Lists.newArrayList();
  catalogueArguments(analyzer.findOutgoingDataLinks(process),namedResults,anonymousResults);
  logFiner("String_Node_Str",anonymousResults.size(),namedResults.size());
  List<String> outgoingParametersNames=instance.getOutgoingParameters().stream().map(p -> p.getName()).collect(Collectors.toList());
  for (  String namedResult : namedResults.keySet()) {
    copyArgumentValueToHeap(namedResults.get(namedResult),instance.getArgument(namedResult));
    outgoingParametersNames.remove(namedResult);
  }
  Iterator<OPPArgument> anonymousResultsIterator=anonymousResults.iterator();
  while (anonymousResultsIterator.hasNext()) {
    OPPArgument argument=anonymousResultsIterator.next();
    if (instance.getOutgoingParameters().contains(argument.getObject().getName())) {
      if (instance.getArgument(argument.getObject().getName()) != null) {
        copyArgumentValueToHeap(argument,instance.getArgument(argument.getObject().getName()));
        anonymousResultsIterator.remove();
      }
    }
  }
  for (int i=0; i < anonymousResults.size(); i++) {
    copyArgumentValueToHeap(anonymousResults.get(i),instance.getArgument(outgoingParametersNames.get(i)));
  }
}

Fixed version (ground truth):
public void extractResultsToVariables(OPPProcess process,OPPProcessInstance instance){
  Map<String,OPPArgument> namedResults=Maps.newHashMap();
  List<OPPArgument> anonymousResults=Lists.newArrayList();
  catalogueArguments(analyzer.findOutgoingDataLinks(process),namedResults,anonymousResults);
  logFiner("String_Node_Str",anonymousResults.size(),namedResults.size());
  List<String> outgoingParametersNames=instance.getOutgoingParameters().stream().map(p -> p.getName()).collect(Collectors.toList());
  for (  String namedResult : namedResults.keySet()) {
    copyArgumentValueToHeap(namedResults.get(namedResult),instance.getArgument(namedResult));
    outgoingParametersNames.remove(namedResult);
  }
  Iterator<OPPArgument> anonymousResultsIterator=anonymousResults.iterator();
  while (anonymousResultsIterator.hasNext()) {
    OPPArgument argument=anonymousResultsIterator.next();
    if (instance.getOutgoingParameters().stream().map(p -> p.getName()).collect(Collectors.toList()).contains(argument.getObject().getName())) {
      if (instance.getArgument(argument.getObject().getName()) != null) {
        copyArgumentValueToHeap(argument,instance.getArgument(argument.getObject().getName()));
        anonymousResultsIterator.remove();
      }
    }
  }
  for (int i=0; i < anonymousResults.size(); i++) {
    copyArgumentValueToHeap(anonymousResults.get(i),instance.getArgument(outgoingParametersNames.get(i)));
  }
}
Program: 81461
Project: 81461
Buggy source:
public OPMObjectInstance getCollectionFirstElement(){
  checkTypeForCollectionOnlyOperations();
  return collectionValues.get(0);
}

Fixed version (ground truth):
public OPMObjectInstance getCollectionFirstElement(){
  checkTypeForCollectionOnlyOperations();
  return collectionValues.get(collectionValues.firstKey());
}
Program: 81462
Project: 81462
Buggy source:
public void appendCollectionElement(OPMObjectInstance element){
  checkTypeForCollectionOnlyOperations();
  checkNotNull(element,"String_Node_Str");
  collectionValues.add(element);
  collectionNameToIndexMapping.put(UUID.randomUUID().toString(),collectionValues.size());
}

Fixed version (ground truth):
public void appendCollectionElement(OPMObjectInstance element){
  checkTypeForCollectionOnlyOperations();
  checkNotNull(element,"String_Node_Str");
  collectionValues.add(element);
  collectionNameToIndexMapping.put(UUID.randomUUID().toString(),collectionValues.size() - 1);
}
Program: 81463
Project: 81463
Buggy source:
public synchronized long getNextId(){
  long idToReturn=_id;
  _id++;
  return idToReturn;
}

Fixed version (ground truth):
public synchronized long getNextId(){
  long idToReturn=_id;
  _id++;
  logger.info("String_Node_Str" + _id);
  return idToReturn;
}
Program: 81464
Project: 81464
Buggy source:
@Before public void setup(){
  heap=OPMInterpreterInjector.INSTANCE.getInstance(OPMInZoomedProcessInstanceHeap.class);
  observer=new MyObserver();
  obj1=OPMFactory.eINSTANCE.createOPMObject();
  obj2=OPMFactory.eINSTANCE.createOPMObject();
  obj3=OPMFactory.eINSTANCE.createOPMObject();
  objPart1=OPMFactory.eINSTANCE.createOPMObject();
  objPart1.setName("String_Node_Str");
  objPart2=OPMFactory.eINSTANCE.createOPMObject();
  objPart2.setName("String_Node_Str");
  objPart11=OPMFactory.eINSTANCE.createOPMObject();
  objPart11.setName("String_Node_Str");
  objPart12=OPMFactory.eINSTANCE.createOPMObject();
  objPart12.setName("String_Node_Str");
  inst1=OPMObjectInstance.createFromValue(new BigDecimal(1));
  inst2=OPMObjectInstance.createFromValue(new BigDecimal(2));
  inst3=OPMObjectInstance.createFromValue(new BigDecimal(3));
}

Fixed version (ground truth):
@Before public void setup(){
  heap=OPMInterpreterInjector.INSTANCE.getInstance(OPMInZoomedProcessInstanceHeap.class);
  observer=new MyObserver();
  obj1=OPMFactory.eINSTANCE.createOPMObject();
  obj1.setName("String_Node_Str");
  obj2=OPMFactory.eINSTANCE.createOPMObject();
  obj2.setName("String_Node_Str");
  obj3=OPMFactory.eINSTANCE.createOPMObject();
  obj3.setName("String_Node_Str");
  objPart1=OPMFactory.eINSTANCE.createOPMObject();
  objPart1.setName("String_Node_Str");
  objPart2=OPMFactory.eINSTANCE.createOPMObject();
  objPart2.setName("String_Node_Str");
  objPart11=OPMFactory.eINSTANCE.createOPMObject();
  objPart11.setName("String_Node_Str");
  objPart12=OPMFactory.eINSTANCE.createOPMObject();
  objPart12.setName("String_Node_Str");
  inst1=OPMObjectInstance.createFromValue(new BigDecimal(1));
  inst2=OPMObjectInstance.createFromValue(new BigDecimal(2));
  inst3=OPMObjectInstance.createFromValue(new BigDecimal(3));
}
Program: 81465
Project: 81465
Buggy source:
public OPMObjectInstance getPart(String name){
  checkState(isComposite());
  return parts.get(name);
}

Fixed version (ground truth):
public OPMObjectInstance getPart(String name){
  checkNotNull(name,"String_Node_Str");
  checkArgument(!"String_Node_Str".equals(name),"String_Node_Str");
  checkState(isComposite());
  return parts.get(name);
}
Program: 81466
Project: 81466
Buggy source:
/** 
 * <p> Set the value in an   {@link OPMObject}. </p> <p> If the   {@link OPMObject} is a part of another {@link OPMObject}, the parent  {@link OPMObject} is updated. If the {@link OPMObject} is part of another{@link OPMObject}, but the parent doesn't exist yet, it is created. </p> <p> If the   {@link OPMObject} has outgoing data links to other {@link OPMObject}s, these   {@link OPMObject}s are updated (recursively if necessary).
 * @param object where a value can be stored
 * @param value the value to store
 */
public void setVariable(OPMObject object,OPMObjectInstance value){
  Preconditions.checkArgument(value != null,"String_Node_Str");
  if (analyzer.isObjectPartOfAnotherObject(object)) {
    OPMObject parentObject=analyzer.findParent(object);
    OPMObjectInstance parentInstance=getVariable(parentObject);
    if (parentInstance == null) {
      parentInstance=OPMObjectInstance.createCompositeInstance();
      setVariable(parentObject,parentInstance);
    }
    parentInstance.addPart(object.getName(),OPMObjectInstance.createFromExistingInstance(value));
  }
 else {
    if (value != null) {
      OPMObjectInstance objectValue=OPMObjectInstance.createFromExistingInstance(value);
      variables.put(object,objectValue);
      observable.notifyObservers(new HeapChange(object,objectValue));
    }
  }
  transferDataFromObject(object);
}

Fixed version (ground truth):
/** 
 * <p> Set the value in an   {@link OPMObject}. </p> <p> If the   {@link OPMObject} is a part of another {@link OPMObject}, the parent  {@link OPMObject} is updated. If the {@link OPMObject} is part of another{@link OPMObject}, but the parent doesn't exist yet, it is created. </p> <p> If the   {@link OPMObject} has outgoing data links to other {@link OPMObject}s, these   {@link OPMObject}s are updated (recursively if necessary).
 * @param object where a value can be stored
 * @param value the value to store
 */
public void setVariable(OPMObject object,OPMObjectInstance value){
  Preconditions.checkArgument(value != null,"String_Node_Str");
  if (analyzer.isObjectPartOfAnotherObject(object)) {
    OPMObject parentObject=analyzer.findParent(object);
    OPMObjectInstance parentInstance=getVariable(parentObject);
    if (parentInstance == null) {
      setVariable(parentObject,OPMObjectInstance.createCompositeInstance());
      parentInstance=getVariable(parentObject);
    }
    parentInstance.addPart(object.getName(),OPMObjectInstance.createFromExistingInstance(value));
  }
 else {
    if (value != null) {
      OPMObjectInstance objectValue=OPMObjectInstance.createFromExistingInstance(value);
      variables.put(object,objectValue);
      observable.notifyObservers(new HeapChange(object,objectValue));
    }
  }
  transferDataFromObject(object);
}
Program: 81467
Project: 81467
Buggy source:
/** 
 * Extend the connection creted by   {@link OPMLinkEditPart#createFigure()} byadding decorations depending on the link kind. An agent link is decorated at the target with black filled  {@link CircleDecoration}. An instrument link is decorated at the target with a white filled  {@link CircleDecoration}. A consumption or result link is decorated at the target with a   {@link PolylineDecoration} (which is an arrow). Aneffect link link is decorated at the source and target with a {@link PolylineDecoration}.
 * @return a decorated {@link PolylineConnection} figure.
 */
@Override protected PolylineConnection createFigure(){
  PolylineConnection connection=super.createFigure();
  OPMProceduralLink model=(OPMProceduralLink)getModel();
  decorateConnection(connection,model.getKind());
  sourceDecorationLabel=new Label();
  centerDecorationLabel=new Label();
  targetDecorationLabel=new Label();
  ConnectionLocator locator=new ConnectionLocator(connection,ConnectionLocator.SOURCE);
  connection.add(sourceDecorationLabel,locator);
  locator=new ConnectionLocator(connection,ConnectionLocator.MIDDLE);
  connection.add(centerDecorationLabel,locator);
  locator=new ConnectionLocator(connection,ConnectionLocator.TARGET);
  connection.add(targetDecorationLabel,locator);
  connection.add(centerDecorationLabel,locator);
  return connection;
}

Fixed version (ground truth):
/** 
 * Extend the connection created by   {@link OPMLinkEditPart#createFigure()}by adding decorations depending on the link kind. An agent link is decorated at the target with black filled   {@link CircleDecoration}. An instrument link is decorated at the target with a white filled  {@link CircleDecoration}. A consumption or result link is decorated at the target with a   {@link PolylineDecoration} (which is an arrow). Aneffect link link is decorated at the source and target with a {@link PolylineDecoration}.
 * @return a decorated {@link PolylineConnection} figure.
 */
@Override protected PolylineConnection createFigure(){
  PolylineConnection connection=super.createFigure();
  OPMProceduralLink model=(OPMProceduralLink)getModel();
  decorateConnection(connection,model.getKind());
  sourceDecorationLabel=new Label();
  centerDecorationLabel=new Label();
  targetDecorationLabel=new Label();
  ConnectionLocator locator=new ConnectionLocator(connection,ConnectionLocator.SOURCE);
  connection.add(sourceDecorationLabel,locator);
  locator=new ConnectionLocator(connection,ConnectionLocator.MIDDLE);
  connection.add(centerDecorationLabel,locator);
  locator=new ConnectionLocator(connection,ConnectionLocator.TARGET);
  connection.add(targetDecorationLabel,locator);
  return connection;
}
Program: 81468
Project: 81468
Buggy source:
/** 
 * {@inheritDoc}<p> The action is enabled if all the selected entities on the editor are  {@link OPMNodeEditPart} instances</p>
 */
@Override protected boolean calculateEnabled(){
  if (getSelectedObjects().isEmpty()) {
    return false;
  }
  for (  Object selectedObject : getSelectedObjects()) {
    if (selectedObject instanceof OPMNodeEditPart) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}<p> The action is enabled if all the selected entities on the editor are  {@link OPMNodeEditPart} instances</p>
 */
@Override protected boolean calculateEnabled(){
  if (getSelectedObjects().isEmpty()) {
    return false;
  }
  for (  Object selectedObject : getSelectedObjects()) {
    if (!(selectedObject instanceof OPMNodeEditPart)) {
      return false;
    }
  }
  return true;
}
Program: 81469
Project: 81469
Buggy source:
@Override protected void createEditPolicies(){
  super.createEditPolicies();
  installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE,new OPMStateDirectEditPolicy());
  installEditPolicy("String_Node_Str",new SnapFeedbackPolicy());
}

Fixed version (ground truth):
@Override protected void createEditPolicies(){
  super.createEditPolicies();
  installEditPolicy("String_Node_Str",new SnapFeedbackPolicy());
}
Program: 81470
Project: 81470
Buggy source:
/** 
 * This functions is ignored. Use   {@link IsoscelesTriangle#setDirection(int)}instead.
 */
@Override @Deprecated public void setOrientation(final int orientation){
}

Fixed version (ground truth):
/** 
 * This functions is ignored. Use  {@link IsoscelesTriangle#setDirection(int)} instead.
 */
@Override @Deprecated public void setOrientation(final int orientation){
}
Program: 81471
Project: 81471
Buggy source:
/** 
 * Validates the figure, drawing a vertical isosceles triangle filling the  figure's bounds.
 */
@Override public void validate(){
  super.validate();
  Rectangle r=getBounds().getCopy();
  r.shrink(getInsets());
  r.resize(-1,-1);
  Point p1=null, p2=null, p3=null;
switch (direction) {
case NORTH:
    p1=new Point(r.x + r.width / 2,r.y);
  p2=new Point(r.x,r.y + r.height);
p3=new Point(r.x + r.width,r.y + r.height);
break;
case SOUTH:
p1=new Point(r.x + r.width / 2,r.y + r.height);
p2=new Point(r.x,r.y);
p3=new Point(r.x + r.width,r.y);
break;
case EAST:
p1=new Point(r.x,r.y);
p2=new Point(r.x + r.width,r.y + r.height / 2);
p3=new Point(r.x,r.y + r.height);
break;
case WEST:
p1=new Point(r.x + r.width,r.y);
p2=new Point(r.x + r.width,r.y + r.height);
p3=new Point(r.x,r.y + r.height / 2);
}
triangle.removeAllPoints();
triangle.addPoint(p1);
triangle.addPoint(p2);
triangle.addPoint(p3);
}

Fixed version (ground truth):
/** 
 * Validates the figure, drawing a vertical isosceles triangle filling the figure's bounds.
 */
@Override public void validate(){
  super.validate();
  Rectangle r=getBounds().getCopy();
  r.shrink(getInsets());
  r.resize(-1,-1);
  Point p1=null, p2=null, p3=null;
switch (direction) {
case NORTH:
    p1=new Point(r.x + r.width / 2,r.y);
  p2=new Point(r.x,r.y + r.height);
p3=new Point(r.x + r.width,r.y + r.height);
break;
case SOUTH:
p1=new Point(r.x + r.width / 2,r.y + r.height);
p2=new Point(r.x,r.y);
p3=new Point(r.x + r.width,r.y);
break;
case EAST:
p1=new Point(r.x,r.y);
p2=new Point(r.x + r.width,r.y + r.height / 2);
p3=new Point(r.x,r.y + r.height);
break;
case WEST:
p1=new Point(r.x + r.width,r.y);
p2=new Point(r.x + r.width,r.y + r.height);
p3=new Point(r.x,r.y + r.height / 2);
}
triangle.removeAllPoints();
triangle.addPoint(p1);
triangle.addPoint(p2);
triangle.addPoint(p3);
}
Program: 81472
Project: 81472
Buggy source:
/** 
 * Find.
 * @param key the key
 * @return the t
 */
public T find(KeyType key){
  SliceQuery<Object,String,byte[]> query=HFactory.createSliceQuery(keySpace,SerializerTypeInferer.getSerializer(keyTypeClass),StringSerializer.get(),BytesArraySerializer.get());
  QueryResult<ColumnSlice<String,byte[]>> result=query.setColumnFamily(columnFamilyName).setKey(key).setRange("String_Node_Str","String_Node_Str",false,10).execute();
  try {
    if (result.get().getColumns().isEmpty()) {
      return null;
    }
  }
 catch (  Exception e) {
    return null;
  }
  try {
    Constructor<?>[] constructorsT=persistentClass.getConstructors();
    T t=null;
    if (constructorsT.length > 1) {
      if (constructorsT[0].getParameterTypes().length == 1 && constructorsT[0].getParameterTypes()[0].isAssignableFrom(keyTypeClass)) {
        t=(T)constructorsT[0].newInstance(keyTypeClass);
      }
 else {
        t=(T)constructorsT[0].newInstance();
      }
    }
 else {
      if (constructorsT[0].getParameterTypes().length == 1 && (constructorsT[0].getParameterTypes()[0].isAssignableFrom(keyTypeClass) || Object.class.equals(constructorsT[0].getParameterTypes()[0]))) {
        t=(T)constructorsT[0].newInstance(keyTypeClass);
      }
 else {
        t=(T)constructorsT[0].newInstance();
      }
    }
    HectorHelper.populateEntity(t,key,result);
    return t;
  }
 catch (  Exception e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Find.
 * @param key the key
 * @return the t
 */
public T find(KeyType key){
  SliceQuery<Object,String,byte[]> query=HFactory.createSliceQuery(keySpace,SerializerTypeInferer.getSerializer(keyTypeClass),StringSerializer.get(),BytesArraySerializer.get());
  int columnQuerySize=100;
  QueryResult<ColumnSlice<String,byte[]>> result=query.setColumnFamily(columnFamilyName).setKey(key).setRange("String_Node_Str","String_Node_Str",false,columnQuerySize).execute();
  try {
    if (result.get().getColumns().isEmpty()) {
      return null;
    }
  }
 catch (  Exception e) {
    return null;
  }
  try {
    Constructor<?>[] constructorsT=persistentClass.getConstructors();
    T t=null;
    if (constructorsT.length > 1) {
      if (constructorsT[0].getParameterTypes().length == 1 && constructorsT[0].getParameterTypes()[0].isAssignableFrom(keyTypeClass)) {
        t=(T)constructorsT[0].newInstance(keyTypeClass);
      }
 else {
        t=(T)constructorsT[0].newInstance();
      }
    }
 else {
      if (constructorsT[0].getParameterTypes().length == 1 && (constructorsT[0].getParameterTypes()[0].isAssignableFrom(keyTypeClass) || Object.class.equals(constructorsT[0].getParameterTypes()[0]))) {
        t=(T)constructorsT[0].newInstance(keyTypeClass);
      }
 else {
        t=(T)constructorsT[0].newInstance();
      }
    }
    HectorHelper.populateEntity(t,key,result);
    return t;
  }
 catch (  Exception e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 81473
Project: 81473
Buggy source:
@Override public HConsistencyLevel get(OperationType op,String cfName){
switch (op) {
case READ:
    return HConsistencyLevel.QUORUM;
case WRITE:
  return HConsistencyLevel.ONE;
}
return HConsistencyLevel.ONE;
}

Fixed version (ground truth):
@Override public HConsistencyLevel get(OperationType op,String cfName){
switch (op) {
case READ:
    return HConsistencyLevel.QUORUM;
case WRITE:
  return HConsistencyLevel.QUORUM;
}
return HConsistencyLevel.QUORUM;
}
Program: 81475
Project: 81475
Buggy source:
public void add(byte[] bytesToAdd){
synchronized (bytes) {
    bytes.addLast(bytesToAdd);
    available+=bytesToAdd.length;
    bytes.notify();
  }
}

Fixed version (ground truth):
public void add(byte[] bytesToAdd){
  if (bytesToAdd.length == 0) {
    return;
  }
synchronized (bytes) {
    bytes.addLast(bytesToAdd);
    available+=bytesToAdd.length;
    bytes.notify();
  }
}
Program: 81476
Project: 81476
Buggy source:
@Override public ChannelPipeline getPipeline() throws Exception {
  ChannelPipeline pipeline=new DefaultChannelPipeline();
  pipeline.addLast("String_Node_Str",new HttpClientCodec());
  pipeline.addLast("String_Node_Str",new HttpContentDecompressor());
  return pipeline;
}

Fixed version (ground truth):
@Override public ChannelPipeline getPipeline() throws Exception {
  ChannelPipeline pipeline=new DefaultChannelPipeline();
  pipeline.addLast("String_Node_Str",new HttpClientCodec());
  pipeline.addLast("String_Node_Str",new HttpContentDecompressor(){
    @Override public void exceptionCaught(    ChannelHandlerContext context,    ExceptionEvent event) throws Exception {
      log.error("String_Node_Str" + event.getCause());
      event.getCause().printStackTrace();
    }
  }
);
  return pipeline;
}
Program: 81477
Project: 81477
Buggy source:
public MineProxyHandler(MineProxy proxy,Socket conn) throws IOException {
  this.setName("String_Node_Str");
  this.proxy=proxy;
  this.connection=conn;
  this.fromClient=new BufferedReader(new InputStreamReader(conn.getInputStream()));
  this.toClient=new DataOutputStream(conn.getOutputStream());
}

Fixed version (ground truth):
public MineProxyHandler(MineProxy proxy,Socket conn) throws IOException {
  setName("String_Node_Str");
  this.proxy=proxy;
  connection=conn;
  fromClient=new BufferedInputStream(conn.getInputStream());
  toClient=new DataOutputStream(conn.getOutputStream());
}