nus-yam/ex-repair huggingface dataset:
Program: 6605
Project: 6605
Buggy source:
public void onWaveEvent(String filePath,int event){
  if (PLAYBACK_STOPPED == event) {
    waveEventHandler.sendEmptyMessage(event);
  }
 else   if (RECORDING_STOPPED == event) {
    waveEventHandler.sendEmptyMessage(event);
  }
}

Fixed version (ground truth):
public void onWaveEvent(int event,String filePath,float position){
  if (PLAYBACK_STOPPED == event) {
    waveEventHandler.sendEmptyMessage(event);
  }
 else   if (RECORDING_STOPPED == event) {
    waveEventHandler.sendEmptyMessage(event);
  }
}
Program: 6606
Project: 6606
Buggy source:
@Override public void onEnable(){
  log.info("String_Node_Str");
  getServer().getPluginManager().registerEvent(Type.REDSTONE_CHANGE,blockListener,Priority.Highest,this);
}

Fixed version (ground truth):
@Override public void onEnable(){
  log.info("String_Node_Str" + getDescription().getName() + "String_Node_Str"+ getDescription().getFullName());
  getServer().getPluginManager().registerEvent(Type.REDSTONE_CHANGE,blockListener,Priority.Highest,this);
}
Program: 6607
Project: 6607
Buggy source:
@Override public void onDisable(){
  log.info("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onDisable(){
  log.info("String_Node_Str" + getDescription().getName() + "String_Node_Str");
}
Program: 6608
Project: 6608
Buggy source:
public boolean tryActivate(Block startBlock,BlockFace forward){
  boolean didSomething=false;
  for (  Block block : matchingBlocksInLine(startBlock,forward,signMaterials)) {
    if (!tryPowerSign(block))     break;
    didSomething=true;
  }
  return didSomething;
}

Fixed version (ground truth):
public boolean tryActivate(Block startBlock,BlockFace forward,boolean all){
  boolean didSomething=false;
  for (  Block block : matchingBlocksInLine(startBlock,forward,signMaterials)) {
    if (!tryPowerSign(block) && !all)     break;
    didSomething=true;
  }
  return didSomething;
}
Program: 6611
Project: 6611
Buggy source:
public static boolean hasItems(ItemStack[] reqItems,Inventory inventory){
  int[] itemCounts=new int[reqItems.length];
  for (  ItemStack item : inventory.getContents()) {
    for (int i=0; i < reqItems.length; i++)     if (reqItems[i].getType().equals(item.getType()))     itemCounts[i]+=item.getAmount();
  }
  for (int i=0; i < reqItems.length; i++)   if (reqItems[i].getAmount() > itemCounts[i])   return false;
  return true;
}

Fixed version (ground truth):
public static boolean hasItems(ItemStack[] reqItems,Inventory inventory){
  int[] itemCounts=new int[reqItems.length];
  for (  ItemStack item : inventory.getContents()) {
    if (item == null)     continue;
    for (int i=0; i < reqItems.length; i++)     if (reqItems[i].getType().equals(item.getType()))     itemCounts[i]+=item.getAmount();
  }
  for (int i=0; i < reqItems.length; i++)   if (reqItems[i].getAmount() > itemCounts[i])   return false;
  return true;
}
Program: 6612
Project: 6612
Buggy source:
public QuickBelt(){
  log=Logger.getLogger("String_Node_Str");
  playerListener=new QuickBeltPlayerListener(this);
  status=new HashMap<String,Boolean>();
  force=false;
  silent=false;
}

Fixed version (ground truth):
public QuickBelt(){
  log=Logger.getLogger("String_Node_Str");
  playerListener=new QuickBeltPlayerListener(this);
  status=new HashMap<String,Boolean>();
  inventories=new HashMap<String,List<ItemStack>>();
  force=false;
  silent=false;
}
Program: 6613
Project: 6613
Buggy source:
public void invCheck(Player player){
  if (!parent.force) {
    Boolean playerCheck=parent.status.get(player.getName());
    if (playerCheck == null || playerCheck == false) {
      return;
    }
  }
  ItemStack[] inventory=player.getInventory().getContents();
  if (inventory.length != 36) {
    parent.log.warning("String_Node_Str");
    return;
  }
  for (Integer i=0; i < 27; i++) {
    if (inventory[i].getType() == Material.AIR) {
      inventory[i].setType(inventory[i + 9].getType());
      inventory[i].setAmount(inventory[i + 9].getAmount());
      inventory[i].setData(inventory[i + 9].getData());
      inventory[i].setDurability(inventory[i + 9].getDurability());
      inventory[i + 9].setType(Material.AIR);
      if (i < 9 && inventory[i].getType() != Material.AIR && !parent.silent) {
        player.sendMessage(ChatColor.AQUA.toString() + "String_Node_Str" + (i + 1)+ ChatColor.WHITE.toString());
      }
    }
  }
  player.getInventory().setContents(inventory);
}

Fixed version (ground truth):
public void invCheck(Player player){
  if (!parent.force) {
    Boolean playerCheck=parent.status.get(player.getName());
    if (playerCheck == null || playerCheck == false) {
      return;
    }
  }
  List<ItemStack> inv=Arrays.asList(player.getInventory().getContents());
  if (null == parent.inventories.get(player.getName())) {
    parent.inventories.put(player.getName(),inv);
  }
 else   if (parent.inventories.get(player.getName()).equals(inv)) {
    return;
  }
 else {
    parent.inventories.put(player.getName(),inv);
  }
  if (inv.size() != 36) {
    parent.log.warning("String_Node_Str");
    return;
  }
  dropColumns(inv);
  Boolean didDrop=false;
  for (Integer i=0; i <= 8; i++) {
    if (inv.get(i).getType() == Material.AIR && inv.get(i + 27).getType() != Material.AIR) {
      didDrop=true;
      ItemStack swap=inv.get(i + 27);
      inv.set(i + 27,inv.get(i));
      inv.set(i,swap);
      player.sendMessage(ChatColor.AQUA.toString() + "String_Node_Str" + (i + 1)+ ChatColor.WHITE.toString());
    }
  }
  while (didDrop == false) {
    didDrop=dropColumns(inv);
  }
  parent.inventories.put(player.getName(),inv);
  player.getInventory().setContents((ItemStack[])inv.toArray());
}
Program: 6615
Project: 6615
Buggy source:
public void invCheck(Player player){
  if (!parent.force) {
    Boolean playerCheck=parent.status.get(player.getName());
    if (playerCheck == null || playerCheck == false) {
      return;
    }
  }
  List<ItemStack> inv=Arrays.asList(player.getInventory().getContents());
  if (null == parent.inventories.get(player.getName())) {
    parent.inventories.put(player.getName(),inv);
  }
 else   if (parent.inventories.get(player.getName()).equals(inv)) {
    return;
  }
 else {
    parent.inventories.put(player.getName(),inv);
  }
  if (inv.size() != 36) {
    parent.log.warning("String_Node_Str");
    return;
  }
  dropColumns(inv);
  Boolean didDrop=false;
  for (Integer i=0; i <= 8; i++) {
    if (inv.get(i).getType() == Material.AIR && inv.get(i + 27).getType() != Material.AIR) {
      didDrop=true;
      ItemStack swap=inv.get(i + 27);
      inv.set(i + 27,inv.get(i));
      inv.set(i,swap);
      player.sendMessage(ChatColor.AQUA.toString() + "String_Node_Str" + (i + 1)+ ChatColor.WHITE.toString());
    }
  }
  while (didDrop == false) {
    didDrop=dropColumns(inv);
  }
  parent.inventories.put(player.getName(),inv);
  player.getInventory().setContents((ItemStack[])inv.toArray());
}

Fixed version (ground truth):
public void invCheck(PlayerEvent pev){
  Player player=pev.getPlayer();
  if (!parent.force) {
    Boolean playerCheck=parent.status.get(player.getName());
    if (playerCheck == null || playerCheck == false) {
      return;
    }
  }
  List<ItemStack> inv=Arrays.asList(player.getInventory().getContents());
  if (null == parent.inventories.get(player.getName())) {
    parent.inventories.put(player.getName(),inv);
  }
 else   if (parent.inventories.get(player.getName()).equals(inv)) {
    return;
  }
 else {
    parent.inventories.put(player.getName(),inv);
  }
  if (inv.size() != 36) {
    parent.log.warning("String_Node_Str");
    return;
  }
  dropColumns(inv);
  Boolean didDrop=false;
  for (Integer i=0; i <= 8; i++) {
    if (inv.get(i).getType() == Material.AIR && inv.get(i + 27).getType() != Material.AIR) {
      didDrop=true;
      ItemStack swap=inv.get(i + 27);
      inv.set(i + 27,inv.get(i));
      inv.set(i,swap);
      player.sendMessage(ChatColor.AQUA.toString() + "String_Node_Str" + (i + 1)+ ChatColor.WHITE.toString());
    }
  }
  while (didDrop == true) {
    didDrop=dropColumns(inv);
  }
  parent.inventories.put(player.getName(),inv);
  player.getInventory().setContents((ItemStack[])inv.toArray());
}
Program: 6616
Project: 6616
Buggy source:
public void onPlayerMove(PlayerMoveEvent event){
  invCheck(event.getPlayer());
}

Fixed version (ground truth):
public void onPlayerMove(PlayerMoveEvent event){
  invCheck(event);
}
Program: 6617
Project: 6617
Buggy source:
public void onPlayerDropItem(PlayerDropItemEvent event){
  invCheck(event.getPlayer());
}

Fixed version (ground truth):
public void onPlayerDropItem(PlayerDropItemEvent event){
  invCheck(event);
}
Program: 6618
Project: 6618
Buggy source:
public void onPlayerAnimation(PlayerAnimationEvent event){
  invCheck(event.getPlayer());
}

Fixed version (ground truth):
public void onPlayerAnimation(PlayerAnimationEvent event){
  invCheck(event);
}
Program: 6619
Project: 6619
Buggy source:
private List<Location> getRadialLocations3D(Location location,Compartment compartment){
  int doubleDeltaY=((int)location.getIndices()[0].value) * 2 - compartment.dimensions[0] + 1;
  int doubleDeltaX=((int)location.getIndices()[1].value) * 2 - compartment.dimensions[1] + 1;
  int doubleDeltaZ=((int)location.getIndices()[2].value) * 2 - compartment.dimensions[2] + 1;
  List<Location> result=new ArrayList<Location>();
  int doubleDeltaMax=Math.max(Math.abs(doubleDeltaX),Math.max(Math.abs(doubleDeltaY),Math.abs(doubleDeltaZ)));
  if (doubleDeltaMax == 0) {
    return result;
  }
  CellIndexExpression newIndexX=location.getIndices()[1];
  CellIndexExpression newIndexY=location.getIndices()[0];
  CellIndexExpression newIndexZ=location.getIndices()[2];
  if (Math.abs(doubleDeltaX) == doubleDeltaMax) {
    newIndexX=location.getIndices()[1].getDeltaIndex((doubleDeltaX > 0) ? -1 : 1);
  }
  if (Math.abs(doubleDeltaY) == doubleDeltaMax) {
    newIndexY=location.getIndices()[0].getDeltaIndex((doubleDeltaY > 0) ? -1 : 1);
  }
  if (Math.abs(doubleDeltaZ) == doubleDeltaMax) {
    newIndexZ=location.getIndices()[2].getDeltaIndex((doubleDeltaY > 0) ? -1 : 1);
  }
  result.add(new Location(location.getName(),newIndexY,newIndexX,newIndexZ));
  return result;
}

Fixed version (ground truth):
private List<Location> getRadialLocations3D(Location location,Compartment compartment){
  int doubleDeltaY=((int)location.getIndices()[0].value) * 2 - compartment.dimensions[0] + 1;
  int doubleDeltaX=((int)location.getIndices()[1].value) * 2 - compartment.dimensions[1] + 1;
  int doubleDeltaZ=((int)location.getIndices()[2].value) * 2 - compartment.dimensions[2] + 1;
  List<Location> result=new ArrayList<Location>();
  result.add(location);
  int doubleDeltaMax=Math.max(Math.abs(doubleDeltaX),Math.max(Math.abs(doubleDeltaY),Math.abs(doubleDeltaZ)));
  if (doubleDeltaMax == 0) {
    return result;
  }
  CellIndexExpression newIndexX=location.getIndices()[1];
  CellIndexExpression newIndexY=location.getIndices()[0];
  CellIndexExpression newIndexZ=location.getIndices()[2];
  if (Math.abs(doubleDeltaX) == doubleDeltaMax) {
    newIndexX=location.getIndices()[1].getDeltaIndex((doubleDeltaX > 0) ? -1 : 1);
  }
  if (Math.abs(doubleDeltaY) == doubleDeltaMax) {
    newIndexY=location.getIndices()[0].getDeltaIndex((doubleDeltaY > 0) ? -1 : 1);
  }
  if (Math.abs(doubleDeltaZ) == doubleDeltaMax) {
    newIndexZ=location.getIndices()[2].getDeltaIndex((doubleDeltaY > 0) ? -1 : 1);
  }
  result.add(new Location(location.getName(),newIndexY,newIndexX,newIndexZ));
  return result;
}
Program: 6620
Project: 6620
Buggy source:
private List<Location> getLateralLocations3D(Location location,Compartment compartment){
  float distanceToCentre=getDistanceToCentre(location,compartment);
  CellIndexExpression[] xIndices=new CellIndexExpression[]{location.getIndices()[1].getDeltaIndex(-1),location.getIndices()[1],location.getIndices()[1].getDeltaIndex(1)};
  CellIndexExpression[] yIndices=new CellIndexExpression[]{location.getIndices()[0].getDeltaIndex(-1),location.getIndices()[0],location.getIndices()[0].getDeltaIndex(1)};
  CellIndexExpression[] zIndices=new CellIndexExpression[]{location.getIndices()[2].getDeltaIndex(-1),location.getIndices()[2],location.getIndices()[2].getDeltaIndex(1)};
  List<Location> result=new ArrayList<Location>();
  for (  CellIndexExpression yIndex : yIndices) {
    for (    CellIndexExpression xIndex : xIndices) {
      for (      CellIndexExpression zIndex : zIndices) {
        if (xIndex != location.getIndices()[1] || yIndex != location.getIndices()[0] || zIndex != location.getIndices()[2]) {
          Location current=new Location(location.getName(),yIndex,xIndex,zIndex);
          if (Math.abs(distanceToCentre - getDistanceToCentre(current,compartment)) < 0.5f) {
            result.add(current);
          }
        }
      }
    }
  }
  return result;
}

Fixed version (ground truth):
private List<Location> getLateralLocations3D(Location location,Compartment compartment){
  float distanceToCentre=getDistanceToCentre(location,compartment);
  CellIndexExpression[] xIndices=new CellIndexExpression[]{location.getIndices()[1].getDeltaIndex(-1),location.getIndices()[1],location.getIndices()[1].getDeltaIndex(1)};
  CellIndexExpression[] yIndices=new CellIndexExpression[]{location.getIndices()[0].getDeltaIndex(-1),location.getIndices()[0],location.getIndices()[0].getDeltaIndex(1)};
  CellIndexExpression[] zIndices=new CellIndexExpression[]{location.getIndices()[2].getDeltaIndex(-1),location.getIndices()[2],location.getIndices()[2].getDeltaIndex(1)};
  List<Location> result=new ArrayList<Location>();
  result.add(location);
  for (  CellIndexExpression yIndex : yIndices) {
    for (    CellIndexExpression xIndex : xIndices) {
      for (      CellIndexExpression zIndex : zIndices) {
        if (xIndex != location.getIndices()[1] || yIndex != location.getIndices()[0] || zIndex != location.getIndices()[2]) {
          Location current=new Location(location.getName(),yIndex,xIndex,zIndex);
          if (Math.abs(distanceToCentre - getDistanceToCentre(current,compartment)) < 0.5f) {
            result.add(current);
          }
        }
      }
    }
  }
  return result;
}
Program: 6621
Project: 6621
Buggy source:
private List<Location> getRadialLocations2D(Location location,Compartment compartment){
  int doubleDeltaY=((int)location.getIndices()[0].value) * 2 - compartment.dimensions[0] + 1;
  int doubleDeltaX=((int)location.getIndices()[1].value) * 2 - compartment.dimensions[1] + 1;
  CellIndexExpression newIndexX=null;
  CellIndexExpression newIndexY=null;
  List<Location> result=new ArrayList<Location>();
  if (Math.abs(doubleDeltaX) > Math.abs(doubleDeltaY)) {
    newIndexY=location.getIndices()[0];
    newIndexX=location.getIndices()[1].getDeltaIndex((doubleDeltaX > 0) ? -1 : 1);
    result.add(new Location(location.getName(),newIndexY,newIndexX));
  }
 else   if (Math.abs(doubleDeltaX) < Math.abs(doubleDeltaY)) {
    newIndexX=location.getIndices()[1];
    newIndexY=location.getIndices()[0].getDeltaIndex((doubleDeltaY > 0) ? -1 : 1);
    result.add(new Location(location.getName(),newIndexY,newIndexX));
  }
 else   if (doubleDeltaX != 0) {
    newIndexX=location.getIndices()[1].getDeltaIndex((doubleDeltaX > 0) ? -1 : 1);
    newIndexY=location.getIndices()[0].getDeltaIndex((doubleDeltaY > 0) ? -1 : 1);
    result.add(new Location(location.getName(),newIndexY,newIndexX));
  }
  return result;
}

Fixed version (ground truth):
private List<Location> getRadialLocations2D(Location location,Compartment compartment){
  int doubleDeltaY=((int)location.getIndices()[0].value) * 2 - compartment.dimensions[0] + 1;
  int doubleDeltaX=((int)location.getIndices()[1].value) * 2 - compartment.dimensions[1] + 1;
  CellIndexExpression newIndexX=null;
  CellIndexExpression newIndexY=null;
  List<Location> result=new ArrayList<Location>();
  result.add(location);
  if (Math.abs(doubleDeltaX) > Math.abs(doubleDeltaY)) {
    newIndexY=location.getIndices()[0];
    newIndexX=location.getIndices()[1].getDeltaIndex((doubleDeltaX > 0) ? -1 : 1);
    result.add(new Location(location.getName(),newIndexY,newIndexX));
  }
 else   if (Math.abs(doubleDeltaX) < Math.abs(doubleDeltaY)) {
    newIndexX=location.getIndices()[1];
    newIndexY=location.getIndices()[0].getDeltaIndex((doubleDeltaY > 0) ? -1 : 1);
    result.add(new Location(location.getName(),newIndexY,newIndexX));
  }
 else   if (doubleDeltaX != 0) {
    newIndexX=location.getIndices()[1].getDeltaIndex((doubleDeltaX > 0) ? -1 : 1);
    newIndexY=location.getIndices()[0].getDeltaIndex((doubleDeltaY > 0) ? -1 : 1);
    result.add(new Location(location.getName(),newIndexY,newIndexX));
  }
  return result;
}
Program: 6625
Project: 6625
Buggy source:
public void verify(){
  Map<String,AgentSite[]> links=new HashMap<String,AgentSite[]>();
  for (  Agent agent : agents) {
    for (    AgentSite site : agent.getSites()) {
      if (site.isNamedLink()) {
        AgentSite[] link=links.get(site.getLinkName());
        if (link == null) {
          links.put(site.getLinkName(),new AgentSite[]{site,null});
        }
 else {
          if (link[1] != null) {
            throw new IllegalStateException("String_Node_Str" + toString());
          }
          link[1]=site;
        }
      }
    }
  }
  for (  AgentSite[] link : links.values()) {
    if (link[1] == null) {
      throw new IllegalStateException("String_Node_Str" + toString());
    }
  }
}

Fixed version (ground truth):
public void verify(){
  Map<String,AgentSite[]> links=new HashMap<String,AgentSite[]>();
  for (  Agent agent : agents) {
    for (    AgentSite site : agent.getSites()) {
      if (site.isNamedLink()) {
        AgentSite[] link=links.get(site.getLinkName());
        if (link == null) {
          links.put(site.getLinkName(),new AgentSite[]{site,null});
        }
 else {
          if (link[1] != null) {
            throw new IllegalStateException("String_Node_Str" + toString());
          }
          link[1]=site;
        }
      }
    }
  }
  for (  AgentSite[] link : links.values()) {
    if (link[1] == null) {
      throw new IllegalStateException("String_Node_Str" + toString());
    }
  }
  for (  Agent current : agents) {
    if (this != current.getComplex()) {
      throw new IllegalStateException("String_Node_Str" + this);
    }
  }
}
Program: 6626
Project: 6626
Buggy source:
public static Map<Agent,Agent> createCloneAgentMap(Map<Agent,Agent> originalMap){
  Map<Agent,Agent> result=new HashMap<Agent,Agent>();
  List<Agent> templateAgents=new ArrayList<Agent>(originalMap.keySet());
  while (!templateAgents.isEmpty()) {
    Agent agent=templateAgents.get(0);
    Map<Agent,Agent> linkedMapEntries=getLinkedMapEntries(originalMap,agent);
    Complex complex=originalMap.get(agent).getComplex();
    Complex cloneComplex=complex.clone();
    for (    Map.Entry<Agent,Agent> entry : linkedMapEntries.entrySet()) {
      int agentIndex=complex.agents.indexOf(entry.getValue());
      if (agentIndex >= 0) {
        result.put(entry.getKey(),cloneComplex.agents.get(agentIndex));
      }
    }
    templateAgents.removeAll(linkedMapEntries.keySet());
  }
  return result;
}

Fixed version (ground truth):
public static Map<Agent,Agent> createCloneAgentMap(Map<Agent,Agent> originalMap){
  for (  Map.Entry<Agent,Agent> entry : originalMap.entrySet()) {
    Complex expected=entry.getValue().getComplex();
    for (    Agent current : expected.agents) {
      if (expected != current.getComplex()) {
        throw new IllegalStateException("String_Node_Str" + originalMap);
      }
    }
  }
  Map<Agent,Agent> result=new HashMap<Agent,Agent>();
  List<Agent> templateAgents=new ArrayList<Agent>(originalMap.keySet());
  while (!templateAgents.isEmpty()) {
    Agent agent=templateAgents.get(0);
    Map<Agent,Agent> linkedMapEntries=getLinkedMapEntries(originalMap,agent);
    Complex complex=originalMap.get(agent).getComplex();
    Complex cloneComplex=complex.clone();
    for (    Map.Entry<Agent,Agent> entry : linkedMapEntries.entrySet()) {
      int agentIndex=complex.agents.indexOf(entry.getValue());
      if (agentIndex >= 0) {
        result.put(entry.getKey(),cloneComplex.agents.get(agentIndex));
      }
    }
    templateAgents.removeAll(linkedMapEntries.keySet());
  }
  return result;
}
Program: 6627
Project: 6627
Buggy source:
@Test public void testTest3_6_1_lateralDiffusionOfTransmembraneProteins() throws Exception {
  checkEventSimulation("String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},2000,50,new float[][]{{1000,0},{230,770},{200,800}});
}

Fixed version (ground truth):
@Test public void testTest3_6_1_lateralDiffusionOfTransmembraneProteins() throws Exception {
  checkEventSimulation("String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},2000,50,new float[][]{{1000,0},{340,660},{200,800}});
}
Program: 6628
Project: 6628
Buggy source:
public void testTest3_6_2_lateralDiffusionOfTransmembraneProteins_allowMotionlessAgents() throws Exception {
  checkEventSimulation("String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},2000,50,new float[][]{{1000,0},{230,770},{200,800}});
}

Fixed version (ground truth):
@Test public void testTest3_6_2_lateralDiffusionOfTransmembraneProteins_allowMotionlessAgents() throws Exception {
  checkEventSimulation("String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},2000,50,new float[][]{{1000,0},{230,770},{150,850}});
}
Program: 6629
Project: 6629
Buggy source:
@Test public void testGetChannelSubcomponents_edgeNeighbour(){
  List<Compartment> compartments=getList(new Compartment("String_Node_Str",4,4));
  Location location=new Location("String_Node_Str");
  EdgeNeighbourComponent component=new EdgeNeighbourComponent(getList(location),getList(location));
  List<ChannelComponent> expected=getList(new ChannelComponent(ChannelComponent.SUBCOMPONENT,getList(new Location("String_Node_Str",INDEX_X,INDEX_Y)),getList(new Location("String_Node_Str",INDEX_X_MINUS_1,INDEX_Y))),new ChannelComponent(ChannelComponent.SUBCOMPONENT,getList(new Location("String_Node_Str",INDEX_X,INDEX_Y)),getList(new Location("String_Node_Str",INDEX_X_PLUS_1,INDEX_Y))),new ChannelComponent(ChannelComponent.SUBCOMPONENT,getList(new Location("String_Node_Str",INDEX_X,INDEX_Y)),getList(new Location("String_Node_Str",INDEX_X,INDEX_Y_MINUS_1))),new ChannelComponent(ChannelComponent.SUBCOMPONENT,getList(new Location("String_Node_Str",INDEX_X,INDEX_Y)),getList(new Location("String_Node_Str",INDEX_X,INDEX_Y_PLUS_1))));
  assertEquals(expected,component.getChannelSubcomponents(compartments));
}

Fixed version (ground truth):
@Test public void testGetChannelSubcomponents_edgeNeighbour(){
  List<Compartment> compartments=getList(new Compartment("String_Node_Str",4,4));
  Location location=new Location("String_Node_Str");
  EdgeNeighbourComponent component=new EdgeNeighbourComponent(getList(location),getList(location));
  List<ChannelComponent> expected=getList(new ChannelComponent(ChannelComponent.SUBCOMPONENT,getList(new Location("String_Node_Str",INDEX_X,INDEX_Y)),getList(new Location("String_Node_Str",INDEX_X,INDEX_Y))),new ChannelComponent(ChannelComponent.SUBCOMPONENT,getList(new Location("String_Node_Str",INDEX_X,INDEX_Y)),getList(new Location("String_Node_Str",INDEX_X_MINUS_1,INDEX_Y))),new ChannelComponent(ChannelComponent.SUBCOMPONENT,getList(new Location("String_Node_Str",INDEX_X,INDEX_Y)),getList(new Location("String_Node_Str",INDEX_X_PLUS_1,INDEX_Y))),new ChannelComponent(ChannelComponent.SUBCOMPONENT,getList(new Location("String_Node_Str",INDEX_X,INDEX_Y)),getList(new Location("String_Node_Str",INDEX_X,INDEX_Y_MINUS_1))),new ChannelComponent(ChannelComponent.SUBCOMPONENT,getList(new Location("String_Node_Str",INDEX_X,INDEX_Y)),getList(new Location("String_Node_Str",INDEX_X,INDEX_Y_PLUS_1))));
  assertEquals(expected,component.getChannelSubcomponents(compartments));
}
Program: 6630
Project: 6630
Buggy source:
/** 
 * Connects the client to the HGD daemon.
 * @param host The host name or address of the daemon.
 * @param port The port listened by the daemon.
 * @return The daemon welcome message.
 * @throws IllegalStateException If the client is already connected.
 * @throws IOException If an I/O exception occurs.
 * @throws JHGDException If the connection can not be established.
 */
public void connect(String host,int port) throws IllegalStateException, IOException, JHGDException {
  if (connected) {
    throw new IllegalStateException("String_Node_Str" + host + "String_Node_Str"+ port);
  }
  openSocket(host,port);
  String returnMessage=(String)input.readLine();
  if (checkServerResponse(returnMessage) != HGDConsts.SUCCESS) {
    throw new JHGDException(returnMessage.substring(returnMessage.indexOf('|') + 1));
  }
  String protocolVersion=requestProto();
  if (!protocolVersion.equalsIgnoreCase(HGDConsts.PROTOCOLVERSION)) {
    throw new JHGDException("String_Node_Str" + HGDConsts.PROTOCOLVERSION + "String_Node_Str"+ protocolVersion);
  }
  this.connected=true;
  this.authenticated=false;
  this.host=host;
  this.port=port;
  this.username=null;
  this.password=null;
}

Fixed version (ground truth):
/** 
 * Connects the client to the HGD daemon.
 * @param host The host name or address of the daemon.
 * @param port The port listened by the daemon.
 * @throws IllegalStateException If the client is already connected.
 * @throws IOException If an I/O exception occurs.
 * @throws JHGDException If the connection can not be established.
 */
public void connect(String host,int port) throws IllegalStateException, IOException, JHGDException {
  if (connected) {
    throw new IllegalStateException("String_Node_Str" + host + "String_Node_Str"+ port);
  }
  openSocket(host,port);
  String returnMessage=(String)input.readLine();
  if (checkServerResponse(returnMessage) != HGDConsts.SUCCESS) {
    throw new JHGDException(returnMessage.substring(returnMessage.indexOf('|') + 1));
  }
  String protocolVersion=requestProto();
  if (!protocolVersion.equalsIgnoreCase(HGDConsts.PROTOCOLVERSION)) {
    throw new JHGDException("String_Node_Str" + HGDConsts.PROTOCOLVERSION + "String_Node_Str"+ protocolVersion);
  }
  this.connected=true;
  this.authenticated=false;
  this.host=host;
  this.port=port;
  this.username=null;
  this.password=null;
}
Program: 6631
Project: 6631
Buggy source:
public static int parseDouble(final String arg){
  int newInt=0;
  try {
    newInt=Integer.parseInt(arg);
  }
 catch (  NumberFormatException e) {
  }
  return newInt > 0 ? newInt : 0;
}

Fixed version (ground truth):
public static double parseDouble(final String arg){
  double newDouble=0;
  try {
    newDouble=Double.parseDouble(arg);
  }
 catch (  NumberFormatException e) {
  }
  return newDouble > 0 ? newDouble : 0;
}
Program: 6632
Project: 6632
Buggy source:
public String formatCustomMessageLive(final String message,final Object... args) throws Exception {
  String outMessage=message.replaceAll("String_Node_Str",timeUntil(true));
  outMessage=outMessage.replaceAll("String_Node_Str",timeUntil(false));
  outMessage=outMessage.replaceAll("String_Node_Str",Etc.formatCost(lConfig.getCost(),lConfig));
  outMessage=outMessage.replaceAll("String_Node_Str",Etc.formatCost(winningAmount(),lConfig));
  outMessage=outMessage.replaceAll("String_Node_Str",lConfig.getMessage("String_Node_Str").get(0));
  for (int i=0; i < args.length; i++) {
    outMessage=outMessage.replaceAll("String_Node_Str" + i + "String_Node_Str",Matcher.quoteReplacement(args[i].toString()));
  }
  outMessage=outMessage.replaceAll("String_Node_Str","String_Node_Str");
  return outMessage;
}

Fixed version (ground truth):
public String formatCustomMessageLive(final String message,final Object... args) throws Exception {
  String outMessage=message.replaceAll("String_Node_Str",Matcher.quoteReplacement(timeUntil(true)));
  outMessage=outMessage.replaceAll("String_Node_Str",Matcher.quoteReplacement(timeUntil(false)));
  outMessage=outMessage.replaceAll("String_Node_Str",Matcher.quoteReplacement(Etc.formatCost(lConfig.getCost(),lConfig)));
  outMessage=outMessage.replaceAll("String_Node_Str",Matcher.quoteReplacement(Etc.formatCost(winningAmount(),lConfig)));
  outMessage=outMessage.replaceAll("String_Node_Str",Matcher.quoteReplacement(lConfig.getMessage("String_Node_Str").get(0)));
  for (int i=0; i < args.length; i++) {
    outMessage=outMessage.replaceAll("String_Node_Str" + i + "String_Node_Str",Matcher.quoteReplacement(args[i].toString()));
  }
  outMessage=outMessage.replaceAll("String_Node_Str","String_Node_Str");
  return outMessage;
}
Program: 6633
Project: 6633
Buggy source:
public void sendMessage(final CommandSender player,final String topic,final Object... args){
  try {
    for (    String message : lConfig.getMessage(topic)) {
      String outMessage=formatCustomMessageLive(message,args);
      if (player instanceof Player) {
        outMessage=outMessage.replaceAll("String_Node_Str",((Player)player).getDisplayName());
      }
      player.sendMessage(outMessage);
    }
  }
 catch (  Exception e) {
    plugin.getLogger().log(Level.WARNING,"String_Node_Str" + topic,e);
  }
}

Fixed version (ground truth):
public void sendMessage(final CommandSender player,final String topic,final Object... args){
  try {
    for (    String message : lConfig.getMessage(topic)) {
      String outMessage=formatCustomMessageLive(message,args);
      if (player instanceof Player) {
        outMessage=outMessage.replaceAll("String_Node_Str",Matcher.quoteReplacement(((Player)player).getDisplayName()));
      }
      player.sendMessage(outMessage);
    }
  }
 catch (  Exception e) {
    plugin.getLogger().log(Level.WARNING,"String_Node_Str" + topic,e);
  }
}
Program: 6634
Project: 6634
Buggy source:
public void commandNull(final CommandSender sender,final String[] args){
  if (!(sender instanceof Player)) {
    sender.sendMessage("String_Node_Str");
    lGame.sendMessage(sender,"String_Node_Str",lGame.timeUntil(false));
    return;
  }
  final Player player=(Player)sender;
  final double amount=lGame.winningAmount();
  lConfig.debugMsg("String_Node_Str" + amount);
  lGame.sendMessage(sender,"String_Node_Str",lGame.timeUntil(false));
  lGame.sendMessage(sender,"String_Node_Str");
  lGame.sendMessage(sender,"String_Node_Str");
  if (lConfig.getMaxTicketsEachUser() > 1) {
    lGame.sendMessage(player,"String_Node_Str",lGame.timeUntil(false),lGame.playerInList(player),Etc.pluralWording("String_Node_Str",lGame.playerInList(player)));
  }
  if (lConfig.getTicketsAvailable() > 0) {
    lGame.sendMessage(sender,"String_Node_Str",(lConfig.getTicketsAvailable() - lGame.ticketsSold()),Etc.pluralWording("String_Node_Str",lConfig.getTicketsAvailable() - lGame.ticketsSold()));
  }
  lGame.sendMessage(sender,"String_Node_Str");
  if (lConfig.getLastwinner() != null) {
    lGame.sendMessage(sender,"String_Node_Str",lConfig.getLastwinner(),Etc.formatCost(lConfig.getLastwinneramount(),lConfig));
  }
  if (!lConfig.useiConomy()) {
    lGame.sendMessage(sender,"String_Node_Str");
  }
}

Fixed version (ground truth):
public void commandNull(final CommandSender sender,final String[] args){
  if (!(sender instanceof Player)) {
    sender.sendMessage("String_Node_Str");
    lGame.sendMessage(sender,"String_Node_Str",lGame.timeUntil(false));
    return;
  }
  final Player player=(Player)sender;
  final double amount=lGame.winningAmount();
  lConfig.debugMsg("String_Node_Str" + amount);
  lGame.sendMessage(sender,"String_Node_Str",lGame.timeUntil(false));
  lGame.sendMessage(sender,"String_Node_Str");
  lGame.sendMessage(sender,"String_Node_Str");
  if (lConfig.getMaxTicketsEachUser() > 1) {
    lGame.sendMessage(player,"String_Node_Str",lGame.playerInList(player),Etc.pluralWording("String_Node_Str",lGame.playerInList(player)));
  }
  if (lConfig.getTicketsAvailable() > 0) {
    lGame.sendMessage(sender,"String_Node_Str",(lConfig.getTicketsAvailable() - lGame.ticketsSold()),Etc.pluralWording("String_Node_Str",lConfig.getTicketsAvailable() - lGame.ticketsSold()));
  }
  lGame.sendMessage(sender,"String_Node_Str");
  if (lConfig.getLastwinner() != null) {
    lGame.sendMessage(sender,"String_Node_Str",lConfig.getLastwinner(),Etc.formatCost(lConfig.getLastwinneramount(),lConfig));
  }
  if (!lConfig.useiConomy()) {
    lGame.sendMessage(sender,"String_Node_Str");
  }
}
Program: 6636
Project: 6636
Buggy source:
public boolean addPlayer(Player player,Integer maxAmountOfTickets,Integer numberOfTickets){
  if (playerInList(player) + numberOfTickets > maxAmountOfTickets) {
    return false;
  }
  if (Lottery.useiConomy == false) {
    if (player.getInventory().contains(Lottery.material,Lottery.cost * numberOfTickets)) {
      player.getInventory().removeItem(new ItemStack(Lottery.material,Lottery.cost * numberOfTickets));
    }
 else {
      return false;
    }
  }
 else {
    Method.hasAccount(player.getName());
    MethodAccount account=Method.getAccount(player.getName());
    if (account.hasOver(Lottery.cost * numberOfTickets - 1)) {
      account.subtract(Lottery.cost * numberOfTickets);
    }
 else {
      return false;
    }
  }
  try {
    BufferedWriter out=new BufferedWriter(new FileWriter(getDataFolder() + File.separator + "String_Node_Str",true));
    for (Integer i=0; i < numberOfTickets; i++) {
      out.write(player.getName());
      out.newLine();
    }
    out.close();
  }
 catch (  IOException e) {
  }
  return true;
}

Fixed version (ground truth):
public boolean addPlayer(Player player,Integer maxAmountOfTickets,Integer numberOfTickets){
  if (playerInList(player) + numberOfTickets > maxAmountOfTickets) {
    return false;
  }
  if (Lottery.useiConomy == false) {
    if (player.getInventory().contains(Lottery.material,Lottery.cost * numberOfTickets)) {
      player.getInventory().removeItem(new ItemStack(Lottery.material,Lottery.cost * numberOfTickets));
    }
 else {
      return false;
    }
  }
 else {
    Method.hasAccount(player.getName());
    Method.MethodAccount account=Method.getAccount(player.getName());
    if (account.hasOver(Lottery.cost * numberOfTickets - 1)) {
      account.subtract(Lottery.cost * numberOfTickets);
    }
 else {
      return false;
    }
  }
  try {
    BufferedWriter out=new BufferedWriter(new FileWriter(getDataFolder() + File.separator + "String_Node_Str",true));
    for (Integer i=0; i < numberOfTickets; i++) {
      out.write(player.getName());
      out.newLine();
    }
    out.close();
  }
 catch (  IOException e) {
  }
  return true;
}
Program: 6638
Project: 6638
Buggy source:
public int searchRoot(Board board,int depth,int alpha,int beta){
  int eval=0;
  int bestEval=-Value.INFINITY;
  int evalType=HASH_ALPHA;
  int bestMove=Move.MOVE_NONE;
  MoveSelector selector=selectors[0];
  selector.initialize(board,Move.MOVE_NONE,board.isCheck(),false);
  int move;
  while ((move=selector.getNextMove()) != Move.MOVE_NONE) {
    if (shouldWeStop)     break;
    board.make(move);
    if (evalType == HASH_EXACT) {
      eval=-alphaBeta(board,depth - 1,1,-alpha - 1,-alpha,true);
      if (eval > alpha && eval < beta) {
        eval=-alphaBeta(board,depth - 1,1,-beta,-alpha,true);
      }
    }
 else {
      eval=-alphaBeta(board,depth - 1,1,-beta,-alpha,true);
    }
    board.retract(move);
    if (eval > bestEval) {
      if (eval >= beta) {
        if (!shouldWeStop) {
          transTable.put(board.key,HASH_BETA,depth,eval,move);
        }
        return beta;
      }
      bestEval=eval;
      bestMove=move;
      if (eval > alpha) {
        evalType=HASH_EXACT;
        alpha=eval;
      }
    }
  }
  if (bestMove == Move.MOVE_NONE) {
  }
 else {
    transTable.put(board.key,evalType,depth,eval,bestMove);
  }
  return alpha;
}

Fixed version (ground truth):
public int searchRoot(Board board,int depth,int alpha,int beta,int pvMove){
  int eval=0;
  int bestEval=-Value.INFINITY;
  int evalType=HASH_ALPHA;
  int bestMove=Move.MOVE_NONE;
  MoveSelector selector=selectors[0];
  selector.initialize(board,pvMove,board.isCheck(),false);
  int move;
  while ((move=selector.getNextMove()) != Move.MOVE_NONE) {
    if (shouldWeStop)     break;
    board.make(move);
    if (evalType == HASH_EXACT) {
      eval=-alphaBeta(board,depth - 1,1,-alpha - 1,-alpha,true);
      if (eval > alpha && eval < beta) {
        eval=-alphaBeta(board,depth - 1,1,-beta,-alpha,true);
      }
    }
 else {
      eval=-alphaBeta(board,depth - 1,1,-beta,-alpha,true);
    }
    board.retract(move);
    if (eval > bestEval) {
      if (eval >= beta) {
        if (!shouldWeStop) {
          transTable.put(board.key,HASH_BETA,depth,eval,move);
        }
        return beta;
      }
      bestEval=eval;
      bestMove=move;
      if (eval > alpha) {
        evalType=HASH_EXACT;
        alpha=eval;
      }
    }
  }
  if (bestMove == Move.MOVE_NONE) {
  }
 else {
    transTable.put(board.key,evalType,depth,eval,bestMove);
  }
  return alpha;
}
Program: 6639
Project: 6639
Buggy source:
public static int evaluate(Board board,boolean debug){
  int whiteMaterial=board.info.material[WHITE] + board.info.pawnMaterial[WHITE];
  int blackMaterial=board.info.material[BLACK] + board.info.pawnMaterial[BLACK];
  int material=whiteMaterial - blackMaterial;
  int whitePosOpenMid=board.info.openMidPositioning[WHITE];
  int blackPosOpenMid=board.info.openMidPositioning[BLACK];
  int posOpenMid=whitePosOpenMid - blackPosOpenMid;
  int whitePosEnd=board.info.endPositioning[WHITE];
  int blackPosEnd=board.info.endPositioning[BLACK];
  int posEnd=whitePosEnd - blackPosEnd;
  int evaluation=material + posOpenMid + posEnd;
  if (board.sideToMove == BLACK) {
    evaluation*=-1;
  }
  if (debug) {
    System.out.printf("String_Node_Str");
    System.out.printf("String_Node_Str");
    System.out.printf("String_Node_Str");
    System.out.printf("String_Node_Str",whiteMaterial,blackMaterial,material);
    System.out.printf("String_Node_Str",whitePosOpenMid,blackPosOpenMid,posOpenMid);
    System.out.printf("String_Node_Str",whitePosEnd,blackPosEnd,posEnd);
    System.out.printf("String_Node_Str",evaluation);
  }
  return evaluation;
}

Fixed version (ground truth):
public static int evaluate(Board board,boolean debug){
  int whiteMaterial=board.info.material[WHITE] + board.info.pawnMaterial[WHITE];
  int blackMaterial=board.info.material[BLACK] + board.info.pawnMaterial[BLACK];
  int material=whiteMaterial - blackMaterial;
  int whitePosOpenMid=board.info.openMidPositioning[WHITE];
  int blackPosOpenMid=board.info.openMidPositioning[BLACK];
  int posOpenMid=whitePosOpenMid - blackPosOpenMid;
  int whitePosEnd=board.info.endPositioning[WHITE];
  int blackPosEnd=board.info.endPositioning[BLACK];
  int posEnd=whitePosEnd - blackPosEnd;
  int evaluation=material + posOpenMid + posEnd;
  if (board.sideToMove == BLACK)   evaluation*=-1;
  if (debug) {
    System.out.printf("String_Node_Str");
    System.out.printf("String_Node_Str");
    System.out.printf("String_Node_Str");
    System.out.printf("String_Node_Str",whiteMaterial,blackMaterial,material);
    System.out.printf("String_Node_Str",whitePosOpenMid,blackPosOpenMid,posOpenMid);
    System.out.printf("String_Node_Str",whitePosEnd,blackPosEnd,posEnd);
    System.out.printf("String_Node_Str",evaluation);
  }
  return evaluation;
}
Program: 6641
Project: 6641
Buggy source:
private void depthTesting(int depth){
  long sum=0, qsum=0;
  long before=System.currentTimeMillis();
  for (int i=0; i < positions.size(); i++) {
    String line=positions.get(i);
    System.out.printf("String_Node_Str",(i + 1),positions.size(),line);
    Board board=new Board();
    board.initialize(line);
    search.think(board,depth,0);
    sum+=search.nodesSearched;
    qsum+=search.qsearched;
    search.transTable.clear();
  }
  printInfo(search,sum,qsum,before,new String[]{});
}

Fixed version (ground truth):
private void depthTesting(int depth){
  long sum=0, qsum=0;
  long before=System.currentTimeMillis();
  for (int i=0; i < positions.size(); i++) {
    String line=positions.get(i);
    System.out.printf("String_Node_Str",(i + 1),positions.size(),line);
    Board board=new Board();
    board.initialize(line);
    search.think(board,depth);
    sum+=search.nodesSearched;
    qsum+=search.qsearched;
    search.transTable.clear();
  }
  printInfo(search,sum,qsum,before,new String[]{});
}
Program: 6642
Project: 6642
Buggy source:
public int think(Board board,int depth,int nodes){
}

Fixed version (ground truth):
public int think(Board board,int depth){
}
Program: 6644
Project: 6644
Buggy source:
public UCIHandler(){
  search=new Search(this);
  System.out.printf("String_Node_Str",search.getConfiguration());
  useBook=Options.getInstance().getOptionBoolean("String_Node_Str");
  if (useBook) {
    bookFile=Options.getInstance().getOptionString("String_Node_Str");
    opening="String_Node_Str";
    try {
      openingBook=Book.getInstance();
      openingBook.parseBook(bookFile);
    }
 catch (    IOException ioex) {
      System.out.println("String_Node_Str");
      ioex.printStackTrace(System.out);
    }
  }
}

Fixed version (ground truth):
public UCIHandler(){
  search=new Search(this);
  useBook=Options.getInstance().getOptionBoolean("String_Node_Str");
  if (useBook) {
    bookFile=Options.getInstance().getOptionString("String_Node_Str");
    opening="String_Node_Str";
    try {
      openingBook=Book.getInstance();
      openingBook.parseBook(bookFile);
    }
 catch (    IOException ioex) {
      System.out.println("String_Node_Str");
      ioex.printStackTrace(System.out);
    }
  }
}
Program: 6645
Project: 6645
Buggy source:
@Override protected Class<?> findClass(String name) throws ClassNotFoundException {
  for (  ClassLoader classloader : classLoaders) {
    try {
      return callFindClass(classloader,name);
    }
 catch (    ClassNotFoundException e) {
    }
  }
  throw new ClassNotFoundException(name);
}

Fixed version (ground truth):
@Override protected Class<?> findClass(String name) throws ClassNotFoundException {
  for (  ClassLoader classloader : classLoaders) {
    try {
      Class<?> classInstance=callFindClass(classloader,name);
      if (classInstance != null)       return classInstance;
    }
 catch (    ClassNotFoundException e) {
    }
  }
  throw new ClassNotFoundException(name);
}
Program: 6646
Project: 6646
Buggy source:
public ChainingClassLoader(ClassLoader... classLoaders){
  Validate.noNullElements(classLoaders,"String_Node_Str");
  this.classLoaders=Arrays.asList(classLoaders);
}

Fixed version (ground truth):
public ChainingClassLoader(ClassLoader... classLoaders){
  Validate.noNullElements(classLoaders,"String_Node_Str");
  this.classLoaders=Arrays.asList(new LinkedHashSet<ClassLoader>(Arrays.asList(classLoaders)).toArray(new ClassLoader[0]));
}
Program: 6647
Project: 6647
Buggy source:
@Override public Class loadClass(String name) throws ClassNotFoundException {
  for (  ClassLoader classloader : classLoaders) {
    try {
      return classloader.loadClass(name);
    }
 catch (    ClassNotFoundException e) {
    }
  }
  throw new ClassNotFoundException(name);
}

Fixed version (ground truth):
@Override public Class<?> loadClass(String name) throws ClassNotFoundException {
  for (  ClassLoader classloader : classLoaders) {
    try {
      return classloader.loadClass(name);
    }
 catch (    ClassNotFoundException e) {
    }
  }
  throw new ClassNotFoundException(name);
}
Program: 6648
Project: 6648
Buggy source:
private Class<?> callFindClass(ClassLoader classloader,String name) throws ClassNotFoundException {
  try {
    Class<?> classInstance=(Class<?>)MethodsHolder.findClassMethod.invoke(classloader,name);
    if (classInstance != null) {
      return classInstance;
    }
  }
 catch (  IllegalAccessException e) {
    throw new AssertionError(e);
  }
catch (  InvocationTargetException e) {
    throw new AssertionError(e);
  }
}

Fixed version (ground truth):
private Class<?> callFindClass(ClassLoader classloader,String name) throws ClassNotFoundException {
  try {
    return (Class<?>)MethodsHolder.findClassMethod.invoke(classloader,name);
  }
 catch (  IllegalAccessException e) {
    throw new AssertionError(e);
  }
catch (  InvocationTargetException e) {
    if (e.getTargetException() instanceof ClassNotFoundException) {
      throw (ClassNotFoundException)e.getTargetException();
    }
    throw new AssertionError(e);
  }
}
Program: 6649
Project: 6649
Buggy source:
private GroovyClassLoader getGcl(){
  return GCL.INSTANCE;
}

Fixed version (ground truth):
private GroovyClassLoader getGcl(){
  return new GroovyClassLoader(new ChainingClassLoader(GCL.class.getClassLoader(),Script.class.getClassLoader(),ComponentManager.class.getClassLoader(),ClassLoader.getSystemClassLoader()));
}
Program: 6650
Project: 6650
Buggy source:
private Class<?> callFindClass(ClassLoader classloader,String name) throws ClassNotFoundException {
  try {
    return (Class<?>)MethodsHolder.findClassMethod.invoke(classloader,name);
  }
 catch (  IllegalAccessException e) {
    throw new AssertionError(e);
  }
catch (  InvocationTargetException e) {
    throw new AssertionError(e);
  }
}

Fixed version (ground truth):
private Class<?> callFindClass(ClassLoader classloader,String name) throws ClassNotFoundException {
  try {
    Class<?> classInstance=(Class<?>)MethodsHolder.findClassMethod.invoke(classloader,name);
    if (classInstance != null) {
      return classInstance;
    }
  }
 catch (  IllegalAccessException e) {
    throw new AssertionError(e);
  }
catch (  InvocationTargetException e) {
    throw new AssertionError(e);
  }
}
Program: 6651
Project: 6651
Buggy source:
public GroovyRegistrarImpl(ScriptService scriptService){
  this.scriptService=scriptService;
  this.scriptEngineFactory=new GroovyScriptEngineFactory();
}

Fixed version (ground truth):
public GroovyRegistrarImpl(ScriptService scriptService){
  this.scriptService=scriptService;
  this.scriptEngineFactory=new GroovyScriptEngineFactory(){
    @Override public ScriptEngine getScriptEngine(){
      GroovyScriptEngineImpl engine=new GroovyScriptEngineImpl();
      engine.setClassLoader(getGcl());
      return engine;
    }
  }
;
}
Program: 6652
Project: 6652
Buggy source:
public JRubyRegistrarImpl(ScriptService scriptService){
  this.scriptService=scriptService;
  engineFactory=new JRubyEngineFactory();
}

Fixed version (ground truth):
public JRubyRegistrarImpl(ScriptService scriptService){
  System.setProperty("String_Node_Str","String_Node_Str");
  this.scriptService=scriptService;
  engineFactory=new JRubyEngineFactory();
}
Program: 6653
Project: 6653
Buggy source:
public JRubyRegistrarImpl(ScriptService scriptService){
  this.scriptService=scriptService;
  engineFactory=new JRubyEngineFactory();
}

Fixed version (ground truth):
public JRubyRegistrarImpl(ScriptService scriptService){
  System.setProperty("String_Node_Str","String_Node_Str");
  this.scriptService=scriptService;
  engineFactory=new JRubyEngineFactory();
}
Program: 6654
Project: 6654
Buggy source:
public static Index create(InputSplit genericSplit,TaskAttemptContext context){
  Configuration conf=context.getConfiguration();
  Class<?> indexClass=conf.getClass("String_Node_Str",null);
  try {
    return (Index)indexClass.getConstructor().newInstance();
  }
 catch (  Exception e) {
    return null;
  }
}

Fixed version (ground truth):
public static Index create(InputSplit genericSplit,TaskAttemptContext context){
  LOG.setLevel(Level.DEBUG);
  Configuration conf=context.getConfiguration();
  Class<?> indexClass=conf.getClass("String_Node_Str",null);
  Class<?> guiceModule=conf.getClass("String_Node_Str",null);
  String hdfsFile=inputToFileSplit(genericSplit).getPath().toString();
  try {
    LOG.debug("String_Node_Str" + indexClass.toString() + "String_Node_Str"+ guiceModule.toString());
    RunModule module=(RunModule)guiceModule.getConstructor().newInstance();
    module.setHdfsFile(hdfsFile);
    LOG.debug("String_Node_Str" + module.getClass().getName().toString());
    Injector injector=Guice.createInjector(module);
    LOG.debug("String_Node_Str");
    return (Index)injector.getInstance(indexClass);
  }
 catch (  Exception e) {
    LOG.debug(e);
    return null;
  }
}