nus-yam/ex-repair huggingface dataset:
Program: 130684
Project: 130684
Buggy source:
public void addNetherOreSpawn(Block block,World world,Random random,int blockXPos,int blockZPos,int maxX,int maxZ,int chancesToSpawn,int maxVeinSize,int minY,int maxY){
}

Fixed version (ground truth):
public void addNetherOreSpawn(Block block,World world,Random random,int blockXPos,int blockZPos,int maxX,int maxZ,int chancesToSpawn,int maxVeinSize,int minY,int maxY){
  int diffBtwnMinMaxY=maxY - minY;
  for (int x=0; x < chancesToSpawn; x++) {
    int posX=blockXPos + random.nextInt(maxX);
    int posY=minY + random.nextInt(diffBtwnMinMaxY);
    int posZ=blockZPos + random.nextInt(maxZ);
    (new WorldGenMinable(block,maxVeinSize,Blocks.netherrack)).generate(world,random,posX,posY,posZ);
  }
}
Program: 130685
Project: 130685
Buggy source:
public void addEndOreSpawn(Block block,World world,Random random,int blockXPos,int blockZPos,int maxX,int maxZ,int chancesToSpawn,int maxVeinSize,int minY,int maxY){
}

Fixed version (ground truth):
public void addEndOreSpawn(Block block,World world,Random random,int blockXPos,int blockZPos,int maxX,int maxZ,int chancesToSpawn,int maxVeinSize,int minY,int maxY){
  int diffBtwnMinMaxY=maxY - minY;
  for (int x=0; x < chancesToSpawn; x++) {
    int posX=blockXPos + random.nextInt(maxX);
    int posY=minY + random.nextInt(diffBtwnMinMaxY);
    int posZ=blockZPos + random.nextInt(maxZ);
    (new WorldGenMinable(block,maxVeinSize,Blocks.end_stone)).generate(world,random,posX,posY,posZ);
  }
}
Program: 130686
Project: 130686
Buggy source:
/** 
 * Adds an Ore Spawn to Minecraft. Simply register all Ores to spawn with this method in your Generation method in your IWorldGeneration extending Class
 * @param The Block to spawn
 * @param The World to spawn in
 * @param A Random object for retrieving random positions within the world to spawn the Block
 * @param An int for passing the X-Coordinate for the Generation method
 * @param An int for passing the Z-Coordinate for the Generation method
 * @param An int for setting the maximum X-Coordinate values for spawning on the X-Axis on a Per-Chunk basis
 * @param An int for setting the maximum Z-Coordinate values for spawning on the Z-Axis on a Per-Chunk basis
 * @param An int for the Number of chances available for the vein to spawn per-chunk
 * @param An int for setting the max size of a vein
 * @param An int for the minimum Y-Coordinate height at which this block may spawn
 * @param An int for the maximum Y-Coordinate height at which this block may spawn
 */
public void addOreSpawn(Block block,World world,Random random,int blockXPos,int blockZPos,int maxX,int maxZ,int chancesToSpawn,int maxVeinSize,int minY,int maxY){
}

Fixed version (ground truth):
public void addOreSpawn(Block block,World world,Random random,int blockXPos,int blockZPos,int maxX,int maxZ,int chancesToSpawn,int maxVeinSize,int minY,int maxY){
  int diffBtwnMinMaxY=maxY - minY;
  for (int x=0; x < chancesToSpawn; x++) {
    int posX=blockXPos + random.nextInt(maxX);
    int posY=minY + random.nextInt(diffBtwnMinMaxY);
    int posZ=blockZPos + random.nextInt(maxZ);
    (new WorldGenMinable(block,maxVeinSize)).generate(world,random,posX,posY,posZ);
  }
}
Program: 130689
Project: 130689
Buggy source:
public ItemTwilightPhaser(int dam,String name){
  super(name,DivineRPGTabs.ranged);
  this.damage=dam;
  this.firemax=0;
  this.firetick=this.firemax;
  this.firesound=Sounds.phaser.getPrefixedName();
  this.setMaxStackSize(1);
  this.setMaxDamage(3000);
}

Fixed version (ground truth):
public ItemTwilightPhaser(int dam,String name){
  super(name,DivineRPGTabs.ranged);
  this.damage=dam;
  this.firesound=Sounds.phaser.getPrefixedName();
  this.setMaxStackSize(1);
  this.setMaxDamage(3000);
}
Program: 130690
Project: 130690
Buggy source:
@Override public ItemStack onItemRightClick(ItemStack var1,World var2,EntityPlayer var3){
  if (!var3.capabilities.isCreativeMode)   --var1.stackSize;
  if (!var2.isRemote) {
    var2.playSoundAtEntity(var3,"String_Node_Str",0.5F,0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
    if (var1.getItem() == VanillaItemsWeapons.shuriken) {
      var2.spawnEntityInWorld(new EntityShuriken(var2,var3));
    }
    if (var1.getItem() == VanillaItemsWeapons.vileStorm) {
      var2.spawnEntityInWorld(new EntityVileStorm(var2,var3));
    }
    if (var1.getItem() == TwilightItemsWeapons.edenSlicer) {
      var2.spawnEntityInWorld(new EntitySlicerEden(var2,var3));
    }
    if (var1.getItem() == TwilightItemsWeapons.wildwoodSlicer) {
      var2.spawnEntityInWorld(new EntitySlicerWildWoods(var2,var3));
    }
    if (var1.getItem() == TwilightItemsWeapons.apalachiaSlicer) {
      var2.spawnEntityInWorld(new EntitySlicerApalachia(var2,var3));
    }
    if (var1.getItem() == TwilightItemsWeapons.skythernSlicer) {
      var2.spawnEntityInWorld(new EntitySlicerSkythern(var2,var3));
    }
    if (var1.getItem() == TwilightItemsWeapons.mortumSlicer) {
      var2.spawnEntityInWorld(new EntitySlicerMortum(var2,var3));
    }
    if (var1.getItem() == TwilightItemsWeapons.haliteSlicer) {
      var2.spawnEntityInWorld(new EntitySlicerHalite(var2,var3));
    }
    if (var1.getItem() == ArcanaItems.lamona) {
      var2.spawnEntityInWorld(new EntityLamona(var2,var3));
    }
  }
  return var1;
}

Fixed version (ground truth):
@Override public ItemStack onItemRightClick(ItemStack var1,World var2,EntityPlayer var3){
  if (!var3.capabilities.isCreativeMode)   --var1.stackSize;
  if (!var2.isRemote) {
    var2.playSoundAtEntity(var3,"String_Node_Str",0.5F,0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
    if (var1.getItem() == VanillaItemsWeapons.shuriken) {
      var2.spawnEntityInWorld(new EntityShuriken(var2,var3));
    }
    if (var1.getItem() == IceikaItems.snowflakeShuriken) {
      var2.spawnEntityInWorld(new EntitySnowflakeShuriken(var2,var3));
    }
    if (var1.getItem() == VanillaItemsWeapons.vileStorm) {
      var2.spawnEntityInWorld(new EntityVileStorm(var2,var3));
    }
    if (var1.getItem() == TwilightItemsWeapons.edenSlicer) {
      var2.spawnEntityInWorld(new EntitySlicerEden(var2,var3));
    }
    if (var1.getItem() == TwilightItemsWeapons.wildwoodSlicer) {
      var2.spawnEntityInWorld(new EntitySlicerWildWoods(var2,var3));
    }
    if (var1.getItem() == TwilightItemsWeapons.apalachiaSlicer) {
      var2.spawnEntityInWorld(new EntitySlicerApalachia(var2,var3));
    }
    if (var1.getItem() == TwilightItemsWeapons.skythernSlicer) {
      var2.spawnEntityInWorld(new EntitySlicerSkythern(var2,var3));
    }
    if (var1.getItem() == TwilightItemsWeapons.mortumSlicer) {
      var2.spawnEntityInWorld(new EntitySlicerMortum(var2,var3));
    }
    if (var1.getItem() == TwilightItemsWeapons.haliteSlicer) {
      var2.spawnEntityInWorld(new EntitySlicerHalite(var2,var3));
    }
    if (var1.getItem() == ArcanaItems.lamona) {
      var2.spawnEntityInWorld(new EntityLamona(var2,var3));
    }
  }
  return var1;
}
Program: 130691
Project: 130691
Buggy source:
public static void registerDivineRPGMob(Class entityClass,String entityName,int ID){
  LangRegistry.addMob(entityName);
  int entityID=EntityRegistry.findGlobalUniqueEntityId();
  EntityRegistry.registerGlobalEntityID(entityClass,entityName,entityID,0x000000,0xFFFFFF);
  EntityRegistry.registerModEntity(entityClass,entityName,ID,DivineRPG.instance,120,5,true);
}

Fixed version (ground truth):
public static void registerDivineRPGMob(Class entityClass,String entityName){
  LangRegistry.addMob(entityName);
  EntityRegistry.registerModEntity(entityClass,entityName,mobID,DivineRPG.instance,120,5,true);
  mobID++;
}
Program: 130692
Project: 130692
Buggy source:
public static void registerProjectile(Class entityClass,String entityName){
  int ID=EntityRegistry.findGlobalUniqueEntityId();
  EntityRegistry.registerGlobalEntityID(entityClass,entityName + "String_Node_Str",ID);
  EntityRegistry.registerModEntity(entityClass,entityName + "String_Node_Str",ID,DivineRPG.instance,250,5,true);
}

Fixed version (ground truth):
public static void registerProjectile(Class entityClass,String entityName){
  EntityRegistry.registerModEntity(entityClass,entityName + "String_Node_Str",projectileID,DivineRPG.instance,250,5,true);
  projectileID++;
}
Program: 130694
Project: 130694
Buggy source:
public static void init(){
  Util.registerProjectile(EntityCarol.class,"String_Node_Str");
  Util.registerProjectile(EntityMusic.class,"String_Node_Str");
  Util.registerProjectile(EntityFrostclaw.class,"String_Node_Str");
  Util.registerDivineRPGMob(EntityAlicanto.class,"String_Node_Str",Util.mobID++);
  Util.registerDivineRPGMob(EntityFractite.class,"String_Node_Str",Util.mobID++);
  Util.registerDivineRPGMob(EntityGlacide.class,"String_Node_Str",Util.mobID++);
  Util.registerDivineRPGMob(EntityHastreus.class,"String_Node_Str",Util.mobID++);
  Util.registerDivineRPGMob(EntityFrostArcher.class,"String_Node_Str",Util.mobID++);
  Util.registerDivineRPGMob(EntityRollum.class,"String_Node_Str",Util.mobID++);
  Util.registerDivineRPGMob(EntityWorkshopTinkerer.class,"String_Node_Str",Util.mobID++);
  Util.registerDivineRPGMob(EntityWorkshopMerchant.class,"String_Node_Str",Util.mobID++);
}

Fixed version (ground truth):
public static void init(){
  Util.registerProjectile(EntityCarol.class,"String_Node_Str");
  Util.registerProjectile(EntityMusic.class,"String_Node_Str");
  Util.registerProjectile(EntityFrostclaw.class,"String_Node_Str");
  Util.registerProjectile(EntitySnowflakeShuriken.class,"String_Node_Str");
  Util.registerDivineRPGMob(EntityAlicanto.class,"String_Node_Str");
  Util.registerDivineRPGMob(EntityFractite.class,"String_Node_Str");
  Util.registerDivineRPGMob(EntityGlacide.class,"String_Node_Str");
  Util.registerDivineRPGMob(EntityHastreus.class,"String_Node_Str");
  Util.registerDivineRPGMob(EntityFrostArcher.class,"String_Node_Str");
  Util.registerDivineRPGMob(EntityRollum.class,"String_Node_Str");
  Util.registerDivineRPGMob(EntityWorkshopTinkerer.class,"String_Node_Str");
  Util.registerDivineRPGMob(EntityWorkshopMerchant.class,"String_Node_Str");
}
Program: 130696
Project: 130696
Buggy source:
@Override protected Item getDropItem(){
  return TwilightItemsOther.wildWoodSoul;
}

Fixed version (ground truth):
@Override protected Item getDropItem(){
  return TwilightItemsOther.wildwoodSoul;
}
Program: 130697
Project: 130697
Buggy source:
@Override protected void dropFewItems(boolean var1,int var2){
  int var3=this.rand.nextInt(2 + var2);
  for (int var4=0; var4 < var3; ++var4) {
    this.dropItem(TwilightItemsOther.wildWoodSoul,2);
  }
}

Fixed version (ground truth):
@Override protected void dropFewItems(boolean var1,int var2){
  int var3=this.rand.nextInt(2 + var2);
  for (int var4=0; var4 < var3; ++var4) {
    this.dropItem(TwilightItemsOther.wildwoodSoul,2);
  }
}
Program: 130698
Project: 130698
Buggy source:
@Override protected Item getDropItem(){
  return TwilightItemsOther.wildWoodSoul;
}

Fixed version (ground truth):
@Override protected Item getDropItem(){
  return TwilightItemsOther.wildwoodSoul;
}
Program: 130699
Project: 130699
Buggy source:
@Override protected void dropRareDrop(int var1){
  this.dropItem(TwilightItemsOther.wildWoodSoul,2);
}

Fixed version (ground truth):
@Override protected void dropRareDrop(int var1){
  this.dropItem(TwilightItemsOther.wildwoodSoul,2);
}
Program: 130700
Project: 130700
Buggy source:
@Override protected void dropFewItems(boolean var1,int var2){
  int var3=this.rand.nextInt(2 + var2);
  for (int var4=0; var4 < var3; ++var4) {
    this.dropItem(TwilightItemsOther.wildWoodSoul,1);
  }
}

Fixed version (ground truth):
@Override protected void dropFewItems(boolean var1,int var2){
  int var3=this.rand.nextInt(2 + var2);
  for (int var4=0; var4 < var3; ++var4) {
    this.dropItem(TwilightItemsOther.wildwoodSoul,1);
  }
}
Program: 130701
Project: 130701
Buggy source:
@Override protected Item getDropItem(){
  return TwilightItemsOther.wildWoodSoul;
}

Fixed version (ground truth):
@Override protected Item getDropItem(){
  return TwilightItemsOther.wildwoodSoul;
}
Program: 130702
Project: 130702
Buggy source:
@Override protected Item getDropItem(){
  return TwilightItemsOther.wildWoodSoul;
}

Fixed version (ground truth):
@Override protected Item getDropItem(){
  return TwilightItemsOther.wildwoodSoul;
}
Program: 130703
Project: 130703
Buggy source:
@Override protected void dropRareDrop(int var1){
  this.dropItem(TwilightItemsOther.wildWoodSoul,1);
}

Fixed version (ground truth):
@Override protected void dropRareDrop(int var1){
  this.dropItem(TwilightItemsOther.wildwoodSoul,1);
}
Program: 130706
Project: 130706
Buggy source:
/** 
 * *
 */
@Override public void onPreExecute(View rootView){
  this.rootView=rootView;
  mArticleTextView=(TextView)rootView.findViewById(R.id.article_body);
  mArticlePubDateView=(TextView)rootView.findViewById(R.id.pubDateView);
  mSubtitleLayout=(RelativeLayout)rootView.findViewById(R.id.subtitleLayout);
  mScrollToReadLayout=(LinearLayout)rootView.findViewById(R.id.scrollToReadLayout);
  detailViewProgress=(ProgressBar)rootView.findViewById(R.id.detailViewProgressBar);
  detailViewProgress.setVisibility(View.VISIBLE);
}

Fixed version (ground truth):
/** 
 * *
 */
@Override public void onPreExecute(View rootView){
  this.rootView=rootView;
  mArticleTextView=(TextView)rootView.findViewById(R.id.article_body);
  mArticlePubDateView=(TextView)rootView.findViewById(R.id.pubDateView);
  mSubtitleLayout=(RelativeLayout)rootView.findViewById(R.id.subtitleLayout);
  mScrollToReadLayout=(LinearLayout)rootView.findViewById(R.id.scrollToReadLayout);
  detailViewProgress=(SmoothProgressBar)rootView.findViewById(R.id.detailViewProgressBar);
  detailViewProgress.setVisibility(View.VISIBLE);
  detailViewProgress.progressiveStart();
}
Program: 130709
Project: 130709
Buggy source:
public String[] getFirstPostArticle(){
  Document doc;
  String[] result=new String[4];
  String url=mArticleURL;
  try {
    doc=Jsoup.connect(url).userAgent("String_Node_Str").timeout(10 * 1000).get();
    Element bodyElement=doc.body();
    String FirstPostTitleXPath=ConfigService.getFirstPostHead();
    Elements titleElements=bodyElement.select(FirstPostTitleXPath);
    titleText=titleElements.first().text();
    mImageURL=getImageURL(bodyElement);
    String FirstPostArticleXPath=ConfigService.getFirstPostBody();
    Elements articleElements=doc.select(FirstPostArticleXPath);
    for (    Element el : articleElements) {
      String temp=el.text();
      if (temp.length() > 0) {
        articleText=articleText + temp + "String_Node_Str";
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  result[0]=titleText;
  result[1]=mImageURL;
  result[2]=articleText;
  result[3]=mArticlePubDate;
  return result;
}

Fixed version (ground truth):
public String[] getFirstPostArticle(){
  Document doc;
  String[] result=new String[4];
  String url=mArticleURL;
  try {
    doc=Jsoup.connect(url).userAgent("String_Node_Str").timeout(10 * 1000).get();
    Element bodyElement=doc.body();
    String FirstPostTitleXPath=ConfigService.getFirstPostHead();
    Elements titleElements=bodyElement.select(FirstPostTitleXPath);
    titleText=titleElements.first().text();
    mImageURL=getImageURL(bodyElement);
    String FirstPostArticleXPath=ConfigService.getFirstPostBody();
    Elements articleElements=doc.select(FirstPostArticleXPath);
    for (    Element el : articleElements) {
      String temp=el.text();
      if (temp.length() > 0) {
        articleText=articleText + temp + "String_Node_Str";
      }
    }
    result[0]=titleText;
    result[1]=mImageURL;
    result[2]=articleText;
    result[3]=mArticlePubDate;
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  NullPointerException npe) {
    npe.printStackTrace();
    articleText=null;
  }
catch (  Exception e) {
    e.printStackTrace();
  }
  return result;
}
Program: 130710
Project: 130710
Buggy source:
public ConfigService(){
  if (isConfigAvailable()) {
    ParseConfig config=ParseConfig.getCurrentConfig();
    setConfigVersion(config.getNumber("String_Node_Str"));
    setTheHinduElementsFromConfig(config);
    setTOIElementsFromConfig(config);
    setIndianExpressElementsFromConfig(config);
  }
 else {
    setTheHinduElementsFromConstants();
    setTOIElementsFromConstants();
    setIndianExpressElementsFromConstants();
  }
}

Fixed version (ground truth):
public ConfigService(){
  if (isConfigAvailable()) {
    ParseConfig config=ParseConfig.getCurrentConfig();
    setConfigVersion(config.getNumber("String_Node_Str"));
    setTheHinduElementsFromConfig(config);
    setTOIElementsFromConfig(config);
    setIndianExpressElementsFromConfig(config);
    setFirstPostElementsFromConfig(config);
  }
 else {
    setTheHinduElementsFromConstants();
    setTOIElementsFromConstants();
    setIndianExpressElementsFromConstants();
    setFirstPostElementsFromConstants();
  }
}
Program: 130711
Project: 130711
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  ViewGroup rootView=(ViewGroup)inflater.inflate(R.layout.fragment_welcome_screen_feed,container,false);
  ExpandableListView expListView=(ExpandableListView)rootView.findViewById(R.id.welcome_feed_select_expandable_list);
  prepareListData();
  expListAdapter=new WelcomeScreenExpListAdapter(getActivity(),listDataHeader,listDataChild);
  expListAdapter.setExpList(expListView);
  expListView.setAdapter(expListAdapter);
  System.out.println("String_Node_Str" + (null == expListAdapter));
  System.out.println("String_Node_Str" + (null == expListView));
  System.out.println("String_Node_Str" + (listDataHeader.size()));
  System.out.println("String_Node_Str" + (listDataHeader.size()));
  Button done_button=(Button)rootView.findViewById(R.id.welcome_feed_select_explist_done_button);
  done_button.setOnClickListener(new OnClickListener(){
    public void onClick(    View next){
      HashMap<Integer,boolean[]> mChildCheckStates=expListAdapter.getClickedStates();
      callback.fsFragDoneButton(mChildCheckStates);
    }
  }
);
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  ViewGroup rootView=(ViewGroup)inflater.inflate(R.layout.fragment_welcome_screen_feed,container,false);
  ExpandableListView expListView=(ExpandableListView)rootView.findViewById(R.id.welcome_feed_select_expandable_list);
  prepareListData();
  expListAdapter=new WelcomeScreenExpListAdapter(getActivity(),listDataHeader,listDataChild);
  expListAdapter.setExpList(expListView);
  expListView.setAdapter(expListAdapter);
  Button done_button=(Button)rootView.findViewById(R.id.welcome_feed_select_explist_done_button);
  done_button.setOnClickListener(new OnClickListener(){
    public void onClick(    View next){
      HashMap<Integer,boolean[]> mChildCheckStates=expListAdapter.getClickedStates();
      callback.fsFragDoneButton(mChildCheckStates);
    }
  }
);
  return rootView;
}
Program: 130712
Project: 130712
Buggy source:
Zxid onAck(MessageTuple tuple) throws IOException {
  String source=tuple.getServerId();
  Message msg=tuple.getMessage();
  ZabMessage.Ack ack=msg.getAck();
  Zxid ackZxid=MessageBuilder.fromProtoZxid(ack.getZxid());
  PeerHandler peer=pendingPeers.get(source);
  if (peer != null) {
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str",TextFormat.shortDebugString(msg),source);
    }
    peer.setLastAckedZxid(ackZxid);
    if (lastCommittedZxid.compareTo(ackZxid) >= 0) {
      LOG.debug("String_Node_Str");
      Message commit=MessageBuilder.buildCommit(ackZxid);
      sendMessage(peer.getServerId(),commit);
      peer.setLastCommittedZxid(ackZxid);
      peer.startBroadcastingTask();
      pendingPeers.remove(source);
    }
  }
  if (source.equals(this.serverId)) {
    this.lastAckedZxid=ackZxid;
    if (!pendingPeers.isEmpty()) {
      for (      PeerHandler ph : pendingPeers.values()) {
        if (!ph.isSyncStarted() && ackZxid.compareTo(ph.getLastSyncedZxid()) >= 0) {
          ph.setSyncTask(new SyncPeerTask(ph.getServerId(),ph.getLastZxid(),ph.getLastSyncedZxid(),persistence.getLastSeenConfig()),establishedEpoch);
          ph.startSynchronizingTask();
        }
      }
    }
  }
  ackProcessor.processRequest(tuple);
  return ackZxid;
}

Fixed version (ground truth):
Zxid onAck(MessageTuple tuple) throws IOException {
  String source=tuple.getServerId();
  Message msg=tuple.getMessage();
  ZabMessage.Ack ack=msg.getAck();
  Zxid ackZxid=MessageBuilder.fromProtoZxid(ack.getZxid());
  PeerHandler peer=pendingPeers.get(source);
  if (peer != null) {
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str",TextFormat.shortDebugString(msg),source);
    }
    peer.setLastAckedZxid(ackZxid);
    if (lastCommittedZxid.compareTo(ackZxid) >= 0) {
      LOG.debug("String_Node_Str");
      Message commit=MessageBuilder.buildCommit(ackZxid);
      sendMessage(peer.getServerId(),commit);
      peer.setLastCommittedZxid(ackZxid);
      peer.startBroadcastingTask();
      pendingPeers.remove(source);
    }
  }
  if (source.equals(this.serverId)) {
    this.lastAckedZxid=ackZxid;
    if (!pendingPeers.isEmpty()) {
      for (      PeerHandler ph : pendingPeers.values()) {
        if (!ph.isSyncStarted() && ackZxid.compareTo(ph.getLastSyncedZxid()) >= 0) {
          ClusterConfiguration cnf=persistence.getLastConfigWithin(ph.getLastSyncedZxid());
          ph.setSyncTask(new SyncPeerTask(ph.getServerId(),ph.getLastZxid(),ph.getLastSyncedZxid(),cnf),establishedEpoch);
          ph.startSynchronizingTask();
        }
      }
    }
  }
  ackProcessor.processRequest(tuple);
  return ackZxid;
}
Program: 130713
Project: 130713
Buggy source:
void onSyncHistory(MessageTuple tuple) throws IOException {
  String source=tuple.getServerId();
  PeerHandler ph=new PeerHandler(source,transport,config.getTimeoutMs() / 3);
  Zxid lastZxid=MessageBuilder.fromProtoZxid(tuple.getMessage().getSyncHistory().getLastZxid());
  ph.setLastZxid(lastZxid);
  ph.setLastSyncedZxid(this.lastAckedZxid);
  ph.setSyncTask(new SyncPeerTask(ph.getServerId(),ph.getLastZxid(),ph.getLastSyncedZxid(),persistence.getLastSeenConfig()),establishedEpoch);
  Message reply=MessageBuilder.buildSyncHistoryReply(getSyncTimeoutMs());
  sendMessage(source,reply);
  ph.startSynchronizingTask();
  this.quorumMap.put(source,ph);
}

Fixed version (ground truth):
void onSyncHistory(MessageTuple tuple) throws IOException {
  String source=tuple.getServerId();
  PeerHandler ph=new PeerHandler(source,transport,config.getTimeoutMs() / 3);
  Zxid lastZxid=MessageBuilder.fromProtoZxid(tuple.getMessage().getSyncHistory().getLastZxid());
  ph.setLastZxid(lastZxid);
  ph.setLastSyncedZxid(this.lastAckedZxid);
  ClusterConfiguration cnf=persistence.getLastConfigWithin(ph.getLastSyncedZxid());
  ph.setSyncTask(new SyncPeerTask(ph.getServerId(),ph.getLastZxid(),ph.getLastSyncedZxid(),cnf),establishedEpoch);
  Message reply=MessageBuilder.buildSyncHistoryReply(getSyncTimeoutMs());
  sendMessage(source,reply);
  ph.startSynchronizingTask();
  this.quorumMap.put(source,ph);
}
Program: 130714
Project: 130714
Buggy source:
void onAckEpoch(MessageTuple tuple) throws IOException {
  String source=tuple.getServerId();
  Message msg=tuple.getMessage();
  Zxid zxid=tuple.getZxid();
  ZabMessage.AckEpoch ackEpoch=msg.getAckEpoch();
  Zxid lastPeerZxid=MessageBuilder.fromProtoZxid(ackEpoch.getLastZxid());
  PeerHandler ph=new PeerHandler(source,transport,config.getTimeoutMs() / 3);
  ph.setLastZxid(lastPeerZxid);
  ph.setLastSyncedZxid(zxid);
  quorumMap.put(source,ph);
  this.pendingPeers.put(source,ph);
  preProcessor.processRequest(tuple);
  ackProcessor.processRequest(tuple);
  commitProcessor.processRequest(tuple);
  if (lastAckedZxid.compareTo(zxid) >= 0) {
    ph.setSyncTask(new SyncPeerTask(ph.getServerId(),ph.getLastZxid(),ph.getLastSyncedZxid(),persistence.getLastSeenConfig()),this.establishedEpoch);
    ph.startSynchronizingTask();
  }
}

Fixed version (ground truth):
void onAckEpoch(MessageTuple tuple) throws IOException {
  String source=tuple.getServerId();
  Message msg=tuple.getMessage();
  Zxid zxid=tuple.getZxid();
  ZabMessage.AckEpoch ackEpoch=msg.getAckEpoch();
  Zxid lastPeerZxid=MessageBuilder.fromProtoZxid(ackEpoch.getLastZxid());
  PeerHandler ph=new PeerHandler(source,transport,config.getTimeoutMs() / 3);
  ph.setLastZxid(lastPeerZxid);
  ph.setLastSyncedZxid(zxid);
  quorumMap.put(source,ph);
  this.pendingPeers.put(source,ph);
  preProcessor.processRequest(tuple);
  ackProcessor.processRequest(tuple);
  commitProcessor.processRequest(tuple);
  if (lastAckedZxid.compareTo(zxid) >= 0) {
    ClusterConfiguration cnf=persistence.getLastConfigWithin(ph.getLastSyncedZxid());
    ph.setSyncTask(new SyncPeerTask(ph.getServerId(),ph.getLastZxid(),ph.getLastSyncedZxid(),cnf),this.establishedEpoch);
    ph.startSynchronizingTask();
  }
}
Program: 130715
Project: 130715
Buggy source:
/** 
 * Creates or restores the transaction log from a given directory.
 * @param dir the log directory.
 */
Log createLog(File dir) throws IOException {
  File logFile=new File(dir,"String_Node_Str");
  return new SimpleLog(logFile);
}

Fixed version (ground truth):
/** 
 * Creates or restores the transaction log from a given directory.
 * @param dir the log directory.
 */
Log createLog(File dir) throws IOException {
  return new RollingLog(dir,ZabConfig.ROLLING_SIZE);
}
Program: 130716
Project: 130716
Buggy source:
/** 
 * Syncs all the appended transactions to the physical media.
 * @throws IOException in case of IO failure
 */
@Override public void sync() throws IOException {
  this.currentLog.sync();
}

Fixed version (ground truth):
/** 
 * Syncs all the appended transactions to the physical media.
 * @throws IOException in case of IO failure
 */
@Override public void sync() throws IOException {
  if (this.currentLog != null) {
    this.currentLog.sync();
  }
}
Program: 130720
Project: 130720
Buggy source:
@Override public void clear(String destination){
  LOG.debug("String_Node_Str",destination);
  Sender sender=senders.remove(destination);
  if (sender != null) {
    sender.shutdown();
    if (sender.handshakeFail) {
      try {
        Thread.sleep((int)(new Random().nextFloat() * 500));
      }
 catch (      InterruptedException ex) {
        Thread.currentThread().interrupt();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void clear(String destination){
  LOG.debug("String_Node_Str",destination);
  Sender sender=senders.remove(destination);
  if (sender != null) {
    sender.shutdown();
    if (sender.handshakeFail) {
      try {
        Thread.sleep((int)(new Random().nextFloat() * 200));
      }
 catch (      InterruptedException ex) {
        Thread.currentThread().interrupt();
      }
    }
  }
}
Program: 130727
Project: 130727
Buggy source:
@Override public void clear(String destination){
  LOG.debug("String_Node_Str",destination);
  Sender sender=senders.remove(destination);
  if (sender != null) {
    sender.shutdown();
    if (sender.handshakeFail) {
      try {
        Thread.sleep((int)(new Random().nextFloat() * 500));
      }
 catch (      InterruptedException ex) {
        Thread.currentThread().interrupt();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void clear(String destination){
  LOG.debug("String_Node_Str",destination);
  Sender sender=senders.remove(destination);
  if (sender != null) {
    sender.shutdown();
    if (sender.handshakeFail) {
      try {
        Thread.sleep((int)(new Random().nextFloat() * 200));
      }
 catch (      InterruptedException ex) {
        Thread.currentThread().interrupt();
      }
    }
  }
}
Program: 130729
Project: 130729
Buggy source:
@Test public void testSnapshotSynchronization() throws Exception {
  final int nTxns=50;
  QuorumTestCallback cb1=new QuorumTestCallback();
  SnapshotStateMachine st1=new SnapshotStateMachine(nTxns);
  QuorumTestCallback cb2=new QuorumTestCallback();
  SnapshotStateMachine st2=new SnapshotStateMachine(nTxns);
  String server1=getUniqueHostPort();
  String server2=getUniqueHostPort();
  Properties prop1=new Properties();
  prop1.setProperty("String_Node_Str","String_Node_Str");
  prop1.setProperty("String_Node_Str",server1);
  prop1.setProperty("String_Node_Str",getDirectory().getPath() + File.separator + server1);
  Properties prop2=new Properties();
  prop2.setProperty("String_Node_Str",server2);
  prop2.setProperty("String_Node_Str",getDirectory().getPath() + File.separator + server2);
  Zab zab1=new Zab(st1,prop1,server1);
  st1.waitMemberChanged();
  for (int i=0; i < nTxns; ++i) {
    zab1.send(ByteBuffer.wrap(("String_Node_Str" + i).getBytes()));
    Thread.sleep(20);
  }
  st1.txnsCount.await();
  Zab zab2=new Zab(st2,prop2,server1);
  st2.waitMemberChanged();
  Assert.assertEquals(st1.state,st2.state);
  zab1.shutdown();
  zab2.shutdown();
}

Fixed version (ground truth):
@Test(timeout=30000) public void testSnapshotSynchronization() throws Exception {
  final int nTxns=50;
  QuorumTestCallback cb1=new QuorumTestCallback();
  SnapshotStateMachine st1=new SnapshotStateMachine(nTxns);
  QuorumTestCallback cb2=new QuorumTestCallback();
  SnapshotStateMachine st2=new SnapshotStateMachine(nTxns);
  String server1=getUniqueHostPort();
  String server2=getUniqueHostPort();
  Properties prop1=new Properties();
  prop1.setProperty("String_Node_Str","String_Node_Str");
  prop1.setProperty("String_Node_Str",server1);
  prop1.setProperty("String_Node_Str",getDirectory().getPath() + File.separator + server1);
  Properties prop2=new Properties();
  prop2.setProperty("String_Node_Str",server2);
  prop2.setProperty("String_Node_Str",getDirectory().getPath() + File.separator + server2);
  Zab zab1=new Zab(st1,prop1,server1);
  st1.waitMemberChanged();
  for (int i=0; i < nTxns; ++i) {
    zab1.send(ByteBuffer.wrap(("String_Node_Str" + i).getBytes()));
    Thread.sleep(5);
  }
  st1.txnsCount.await();
  Zab zab2=new Zab(st2,prop2,server1);
  st2.waitMemberChanged();
  Assert.assertEquals(st1.state,st2.state);
  zab1.shutdown();
  zab2.shutdown();
}
Program: 130731
Project: 130731
Buggy source:
@Test public void testSnapshotSingleServer() throws Exception {
  final int nTxns=20;
  QuorumTestCallback cb1=new QuorumTestCallback();
  SnapshotStateMachine st1=new SnapshotStateMachine(nTxns);
  String server=getUniqueHostPort();
  Properties prop=new Properties();
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str",server);
  prop.setProperty("String_Node_Str",getDirectory().getPath());
  Zab zab=new Zab(st1,prop,server);
  for (int i=0; i < nTxns; ++i) {
    zab.send(ByteBuffer.wrap(("String_Node_Str" + i).getBytes()));
    Thread.sleep(50);
  }
  st1.txnsCount.await();
  zab.shutdown();
  SnapshotStateMachine stNew=new SnapshotStateMachine(nTxns);
  prop=new Properties();
  prop.setProperty("String_Node_Str",getDirectory().getPath());
  zab=new Zab(stNew,prop);
  stNew.waitMemberChanged();
  Assert.assertEquals(st1.state,stNew.state);
  zab.shutdown();
}

Fixed version (ground truth):
@Test(timeout=30000) public void testSnapshotSingleServer() throws Exception {
  final int nTxns=20;
  QuorumTestCallback cb1=new QuorumTestCallback();
  SnapshotStateMachine st1=new SnapshotStateMachine(nTxns);
  String server=getUniqueHostPort();
  Properties prop=new Properties();
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str",server);
  prop.setProperty("String_Node_Str",getDirectory().getPath());
  Zab zab=new Zab(st1,prop,server);
  for (int i=0; i < nTxns; ++i) {
    zab.send(ByteBuffer.wrap(("String_Node_Str" + i).getBytes()));
    Thread.sleep(50);
  }
  st1.txnsCount.await();
  zab.shutdown();
  SnapshotStateMachine stNew=new SnapshotStateMachine(nTxns);
  prop=new Properties();
  prop.setProperty("String_Node_Str",getDirectory().getPath());
  zab=new Zab(stNew,prop);
  stNew.waitMemberChanged();
  Assert.assertEquals(st1.state,stNew.state);
  zab.shutdown();
}
Program: 130732
Project: 130732
Buggy source:
/** 
 * Reads a long integer from a file that was created by the  {@link #writeLongToFile(long,File) writeIntToFile} method.
 * @param file file to read the integer value from.
 * @return the long integer value in the file
 * @throws IOException if an I/O error occurs.
 */
public static long readLongFromFile(File file) throws IOException {
  try (FileInputStream fis=new FileInputStream(file);BufferedReader br=new BufferedReader(new InputStreamReader(fis))){
    long value=Long.parseLong(br.readLine());
    return value;
  }
 }

Fixed version (ground truth):
/** 
 * Reads a long integer from a file that was created by the  {@link #writeLongToFile(long,File) writeIntToFile} method.
 * @param file file to read the integer value from.
 * @return the long integer value in the file
 * @throws IOException if an I/O error occurs.
 */
public static long readLongFromFile(File file) throws IOException {
  try (FileInputStream fis=new FileInputStream(file);BufferedReader br=new BufferedReader(new InputStreamReader(fis,Charset.forName("String_Node_Str")))){
    long value=Long.parseLong(br.readLine());
    return value;
  }
 }
Program: 130733
Project: 130733
Buggy source:
/** 
 * Atomically writes a long integer to a file. This method writes a long integer to a file by first writing the long integer to a temporary file and then atomically moving it to the destination, overwriting the destination file if it already exists.
 * @param value a long integer value to write.
 * @param file file to write the value to.
 * @throws IOException if an I/O error occurs.
 */
public static void writeLongToFile(long value,File file) throws IOException {
  File temp=File.createTempFile(file.getName(),null,file.getAbsoluteFile().getParentFile());
  try (FileOutputStream fos=new FileOutputStream(temp);PrintWriter pw=new PrintWriter(fos)){
    pw.print(Long.toString(value));
    fos.getChannel().force(true);
  }
   atomicMove(temp,file);
  LOG.debug("String_Node_Str",temp,file);
}

Fixed version (ground truth):
/** 
 * Atomically writes a long integer to a file. This method writes a long integer to a file by first writing the long integer to a temporary file and then atomically moving it to the destination, overwriting the destination file if it already exists.
 * @param value a long integer value to write.
 * @param file file to write the value to.
 * @throws IOException if an I/O error occurs.
 */
public static void writeLongToFile(long value,File file) throws IOException {
  File temp=File.createTempFile(file.getName(),null,file.getAbsoluteFile().getParentFile());
  try (FileOutputStream fos=new FileOutputStream(temp);OutputStreamWriter os=new OutputStreamWriter(fos,Charset.forName("String_Node_Str"));PrintWriter pw=new PrintWriter(os)){
    pw.print(Long.toString(value));
    fos.getChannel().force(true);
  }
   atomicMove(temp,file);
  LOG.debug("String_Node_Str",temp,file);
}
Program: 130735
Project: 130735
Buggy source:
/** 
 * Truncates this transaction log at the given zxid. This method deletes all the transactions with zxids higher than the given zxid.
 * @param zxid the transaction id.
 * @throws IOException in case of IO failure
 */
@Override public void truncate(Zxid zxid) throws IOException {
  int lastKeepIdx=getFileIdx(zxid);
  for (int i=lastKeepIdx + 1; i < logFiles.size(); ++i) {
    File file=logFiles.get(i);
    file.delete();
  }
  if (lastKeepIdx != -1) {
    File file=this.logFiles.get(lastKeepIdx);
    try (SimpleLog log=new SimpleLog(file)){
      log.truncate(zxid);
    }
   }
  logFiles.subList(lastKeepIdx + 1,logFiles.size()).clear();
  this.currentLog=getLastLog();
  this.lastSeenZxid=getLatestZxid();
}

Fixed version (ground truth):
/** 
 * Truncates this transaction log at the given zxid. This method deletes all the transactions with zxids higher than the given zxid.
 * @param zxid the transaction id.
 * @throws IOException in case of IO failure
 */
@Override public void truncate(Zxid zxid) throws IOException {
  int lastKeepIdx=getFileIdx(zxid);
  for (int i=lastKeepIdx + 1; i < logFiles.size(); ++i) {
    File file=logFiles.get(i);
    boolean result=file.delete();
    if (!result) {
      LOG.warn("String_Node_Str",file.getName());
    }
  }
  if (lastKeepIdx != -1) {
    File file=this.logFiles.get(lastKeepIdx);
    try (SimpleLog log=new SimpleLog(file)){
      log.truncate(zxid);
    }
   }
  logFiles.subList(lastKeepIdx + 1,logFiles.size()).clear();
  this.currentLog=getLastLog();
  this.lastSeenZxid=getLatestZxid();
}
Program: 130736
Project: 130736
Buggy source:
/** 
 * Reads a long integer from a file that was created by the  {@link #writeLongToFile(long,File) writeIntToFile} method.
 * @param file file to read the integer value from.
 * @return the long integer value in the file
 * @throws IOException if an I/O error occurs.
 */
public static long readLongFromFile(File file) throws IOException {
  try (FileInputStream fis=new FileInputStream(file);BufferedReader br=new BufferedReader(new InputStreamReader(fis))){
    long value=Long.parseLong(br.readLine());
    return value;
  }
 }

Fixed version (ground truth):
/** 
 * Reads a long integer from a file that was created by the  {@link #writeLongToFile(long,File) writeIntToFile} method.
 * @param file file to read the integer value from.
 * @return the long integer value in the file
 * @throws IOException if an I/O error occurs.
 */
public static long readLongFromFile(File file) throws IOException {
  try (FileInputStream fis=new FileInputStream(file);BufferedReader br=new BufferedReader(new InputStreamReader(fis,Charset.forName("String_Node_Str")))){
    long value=Long.parseLong(br.readLine());
    return value;
  }
 }
Program: 130737
Project: 130737
Buggy source:
/** 
 * Atomically writes a long integer to a file. This method writes a long integer to a file by first writing the long integer to a temporary file and then atomically moving it to the destination, overwriting the destination file if it already exists.
 * @param value a long integer value to write.
 * @param file file to write the value to.
 * @throws IOException if an I/O error occurs.
 */
public static void writeLongToFile(long value,File file) throws IOException {
  File temp=File.createTempFile(file.getName(),null,file.getAbsoluteFile().getParentFile());
  try (FileOutputStream fos=new FileOutputStream(temp);PrintWriter pw=new PrintWriter(fos)){
    pw.print(Long.toString(value));
    fos.getChannel().force(true);
  }
   atomicMove(temp,file);
  LOG.debug("String_Node_Str",temp,file);
}

Fixed version (ground truth):
/** 
 * Atomically writes a long integer to a file. This method writes a long integer to a file by first writing the long integer to a temporary file and then atomically moving it to the destination, overwriting the destination file if it already exists.
 * @param value a long integer value to write.
 * @param file file to write the value to.
 * @throws IOException if an I/O error occurs.
 */
public static void writeLongToFile(long value,File file) throws IOException {
  File temp=File.createTempFile(file.getName(),null,file.getAbsoluteFile().getParentFile());
  try (FileOutputStream fos=new FileOutputStream(temp);OutputStreamWriter os=new OutputStreamWriter(fos,Charset.forName("String_Node_Str"));PrintWriter pw=new PrintWriter(os)){
    pw.print(Long.toString(value));
    fos.getChannel().force(true);
  }
   atomicMove(temp,file);
  LOG.debug("String_Node_Str",temp,file);
}
Program: 130739
Project: 130739
Buggy source:
/** 
 * Truncates this transaction log at the given zxid. This method deletes all the transactions with zxids higher than the given zxid.
 * @param zxid the transaction id.
 * @throws IOException in case of IO failure
 */
@Override public void truncate(Zxid zxid) throws IOException {
  int lastKeepIdx=getFileIdx(zxid);
  for (int i=lastKeepIdx + 1; i < logFiles.size(); ++i) {
    File file=logFiles.get(i);
    file.delete();
  }
  if (lastKeepIdx != -1) {
    File file=this.logFiles.get(lastKeepIdx);
    try (SimpleLog log=new SimpleLog(file)){
      log.truncate(zxid);
    }
   }
  logFiles.subList(lastKeepIdx + 1,logFiles.size()).clear();
  this.currentLog=getLastLog();
  this.lastSeenZxid=getLatestZxid();
}

Fixed version (ground truth):
/** 
 * Truncates this transaction log at the given zxid. This method deletes all the transactions with zxids higher than the given zxid.
 * @param zxid the transaction id.
 * @throws IOException in case of IO failure
 */
@Override public void truncate(Zxid zxid) throws IOException {
  int lastKeepIdx=getFileIdx(zxid);
  for (int i=lastKeepIdx + 1; i < logFiles.size(); ++i) {
    File file=logFiles.get(i);
    boolean result=file.delete();
    if (!result) {
      LOG.warn("String_Node_Str",file.getName());
    }
  }
  if (lastKeepIdx != -1) {
    File file=this.logFiles.get(lastKeepIdx);
    try (SimpleLog log=new SimpleLog(file)){
      log.truncate(zxid);
    }
   }
  logFiles.subList(lastKeepIdx + 1,logFiles.size()).clear();
  this.currentLog=getLastLog();
  this.lastSeenZxid=getLatestZxid();
}
Program: 130740
Project: 130740
Buggy source:
/** 
 * Truncates this transaction log at the given zxid. This method deletes all the transactions with zxids higher than the given zxid.
 * @param zxid the transaction id.
 * @throws IOException in case of IO failure
 */
@Override public void truncate(Zxid zxid) throws IOException {
  try (SimpleLogIterator iter=new SimpleLogIterator(this.logFile)){
    while (iter.hasNext()) {
      Transaction txn=iter.next();
      if (txn.getZxid().compareTo(zxid) == 0) {
        this.lastSeenZxid=txn.getZxid();
        break;
      }
      if (txn.getZxid().compareTo(zxid) > 0) {
        iter.backward();
        break;
      }
      this.lastSeenZxid=txn.getZxid();
    }
    if (iter.hasNext()) {
      try (RandomAccessFile ra=new RandomAccessFile(this.logFile,"String_Node_Str")){
        ra.setLength(iter.getPosition());
      }
     }
  }
 }

Fixed version (ground truth):
/** 
 * Truncates this transaction log at the given zxid. This method deletes all the transactions with zxids higher than the given zxid.
 * @param zxid the transaction id.
 * @throws IOException in case of IO failure
 */
@Override public void truncate(Zxid zxid) throws IOException {
  try (SimpleLogIterator iter=new SimpleLogIterator(this.logFile)){
    this.lastSeenZxid=Zxid.ZXID_NOT_EXIST;
    while (iter.hasNext()) {
      Transaction txn=iter.next();
      if (txn.getZxid().compareTo(zxid) == 0) {
        this.lastSeenZxid=txn.getZxid();
        break;
      }
      if (txn.getZxid().compareTo(zxid) > 0) {
        iter.backward();
        break;
      }
      this.lastSeenZxid=txn.getZxid();
    }
    if (iter.hasNext()) {
      try (RandomAccessFile ra=new RandomAccessFile(this.logFile,"String_Node_Str")){
        ra.setLength(iter.getPosition());
      }
     }
  }
 }
Program: 130743
Project: 130743
Buggy source:
void sendFile(File file) throws Exception {
  long length=file.length();
  LOG.debug("String_Node_Str",file,length);
  Message handshake=MessageBuilder.buildFileHeader(length);
  byte[] bytes=handshake.toByteArray();
  channel.writeAndFlush(Unpooled.wrappedBuffer(bytes)).sync();
  ChannelHandler prepender=channel.pipeline().get("String_Node_Str");
  channel.pipeline().remove(prepender);
  ChannelHandler cwh=new ChunkedWriteHandler();
  channel.pipeline().addLast(cwh);
  RandomAccessFile raf=new RandomAccessFile(file,"String_Node_Str");
  if (channel.pipeline().get(SslHandler.class) != null) {
    channel.writeAndFlush(new ChunkedFile(raf,0,length,8912));
  }
 else {
    FileRegion region=new DefaultFileRegion(raf.getChannel(),0,length);
    channel.writeAndFlush(region);
  }
  channel.pipeline().remove(cwh);
  channel.pipeline().addLast(prepender);
}

Fixed version (ground truth):
void sendFile(File file) throws Exception {
  long length=file.length();
  LOG.debug("String_Node_Str",file,length);
  Message handshake=MessageBuilder.buildFileHeader(length);
  byte[] bytes=handshake.toByteArray();
  channel.writeAndFlush(Unpooled.wrappedBuffer(bytes)).sync();
  ChannelHandler prepender=channel.pipeline().get("String_Node_Str");
  channel.pipeline().remove(prepender);
  ChannelHandler cwh=new ChunkedWriteHandler();
  channel.pipeline().addLast(cwh);
  RandomAccessFile raf=new RandomAccessFile(file,"String_Node_Str");
  if (channel.pipeline().get(SslHandler.class) != null) {
    channel.writeAndFlush(new ChunkedFile(raf,0,length,8912));
  }
 else {
    FileRegion region=new DefaultFileRegion(raf.getChannel(),0,length);
    channel.writeAndFlush(region);
  }
  channel.pipeline().remove(cwh);
  channel.pipeline().addLast("String_Node_Str",prepender);
}
Program: 130744
Project: 130744
Buggy source:
@Override protected void changePhase(Phase phase) throws IOException {
  this.currentPhase=phase;
  if (phase == Phase.DISCOVERING) {
    MDC.put("String_Node_Str","String_Node_Str");
    if (stateChangeCallback != null) {
      stateChangeCallback.followerDiscovering(this.electedLeader);
    }
    if (failCallback != null) {
      failCallback.followerDiscovering();
    }
  }
 else   if (phase == Phase.SYNCHRONIZING) {
    MDC.put("String_Node_Str","String_Node_Str");
    if (stateChangeCallback != null) {
      stateChangeCallback.followerSynchronizing(persistence.getProposedEpoch());
    }
    if (failCallback != null) {
      failCallback.followerSynchronizing();
    }
  }
 else   if (phase == Phase.BROADCASTING) {
    MDC.put("String_Node_Str","String_Node_Str");
    this.isBroadcasting=true;
    if (stateChangeCallback != null) {
      stateChangeCallback.followerBroadcasting(persistence.getAckEpoch(),getAllTxns(),persistence.getLastSeenConfig());
    }
    if (failCallback != null) {
      failCallback.followerBroadcasting();
    }
  }
 else   if (phase == Phase.FINALIZING) {
    MDC.put("String_Node_Str","String_Node_Str");
    this.stateMachine.recovering();
    if (this.electedLeader != null) {
      this.transport.clear(this.electedLeader);
    }
    this.semPendingReqs.release(ZabConfig.MAX_PENDING_REQS);
  }
}

Fixed version (ground truth):
@Override protected void changePhase(Phase phase) throws IOException {
  this.currentPhase=phase;
  if (phase == Phase.DISCOVERING) {
    MDC.put("String_Node_Str","String_Node_Str");
    if (stateChangeCallback != null) {
      stateChangeCallback.followerDiscovering(this.electedLeader);
    }
    if (failCallback != null) {
      failCallback.followerDiscovering();
    }
  }
 else   if (phase == Phase.SYNCHRONIZING) {
    MDC.put("String_Node_Str","String_Node_Str");
    if (stateChangeCallback != null) {
      stateChangeCallback.followerSynchronizing(persistence.getProposedEpoch());
    }
    if (failCallback != null) {
      failCallback.followerSynchronizing();
    }
  }
 else   if (phase == Phase.BROADCASTING) {
    MDC.put("String_Node_Str","String_Node_Str");
    if (stateChangeCallback != null) {
      stateChangeCallback.followerBroadcasting(persistence.getAckEpoch(),getAllTxns(),persistence.getLastSeenConfig());
    }
    if (failCallback != null) {
      failCallback.followerBroadcasting();
    }
  }
 else   if (phase == Phase.FINALIZING) {
    MDC.put("String_Node_Str","String_Node_Str");
    this.stateMachine.recovering();
    if (this.electedLeader != null) {
      this.transport.clear(this.electedLeader);
    }
    this.semPendingReqs.release(ZabConfig.MAX_PENDING_REQS);
  }
}