nus-yam/ex-repair huggingface dataset:
Program: 166188
Project: 166188
Buggy source:
private void loadConfiguration(FMLPreInitializationEvent e){
  Configuration cfg=new Configuration(e.getSuggestedConfigurationFile());
  try {
    cfg.load();
    cfg.addCustomCategoryComment(CATEGORY_CRAFTER,"String_Node_Str");
    cfg.addCustomCategoryComment(CATEGORY_STORAGE_MONITOR,"String_Node_Str");
    cfg.addCustomCategoryComment(CATEGORY_NETWORK_MONITOR,"String_Node_Str");
    CrafterBlockTileEntity3.rfPerOperation=cfg.get(CATEGORY_CRAFTER,"String_Node_Str",CrafterBlockTileEntity3.rfPerOperation,"String_Node_Str").getInt();
    CrafterBlockTileEntity3.speedOperations=cfg.get(CATEGORY_CRAFTER,"String_Node_Str",CrafterBlockTileEntity3.speedOperations,"String_Node_Str").getInt();
    StorageScannerTileEntity.rfPerOperation=cfg.get(CATEGORY_STORAGE_MONITOR,"String_Node_Str",StorageScannerTileEntity.rfPerOperation,"String_Node_Str").getInt();
    StorageScannerTileEntity.scansPerOperation=cfg.get(CATEGORY_STORAGE_MONITOR,"String_Node_Str",StorageScannerTileEntity.scansPerOperation,"String_Node_Str").getInt();
    GuiStorageScanner.hilightTime=cfg.get(CATEGORY_STORAGE_MONITOR,"String_Node_Str",GuiStorageScanner.hilightTime,"String_Node_Str").getInt();
    GuiNetworkMonitor.hilightTime=cfg.get(CATEGORY_NETWORK_MONITOR,"String_Node_Str",GuiNetworkMonitor.hilightTime,"String_Node_Str").getInt();
  }
 catch (  Exception e1) {
    FMLLog.log(Level.ERROR,e1,"String_Node_Str");
  }
 finally {
    if (cfg.hasChanged()) {
      cfg.save();
    }
  }
}

Fixed version (ground truth):
private void loadConfiguration(FMLPreInitializationEvent e){
  Configuration cfg=new Configuration(e.getSuggestedConfigurationFile());
  try {
    cfg.load();
    cfg.addCustomCategoryComment(CATEGORY_CRAFTER,"String_Node_Str");
    cfg.addCustomCategoryComment(CATEGORY_STORAGE_MONITOR,"String_Node_Str");
    cfg.addCustomCategoryComment(CATEGORY_NETWORK_MONITOR,"String_Node_Str");
    CrafterBlockTileEntity3.rfPerOperation=cfg.get(CATEGORY_CRAFTER,"String_Node_Str",CrafterBlockTileEntity3.rfPerOperation,"String_Node_Str").getInt();
    CrafterBlockTileEntity3.speedOperations=cfg.get(CATEGORY_CRAFTER,"String_Node_Str",CrafterBlockTileEntity3.speedOperations,"String_Node_Str").getInt();
    StorageScannerTileEntity.rfPerOperation=cfg.get(CATEGORY_STORAGE_MONITOR,"String_Node_Str",StorageScannerTileEntity.rfPerOperation,"String_Node_Str").getInt();
    StorageScannerTileEntity.scansPerOperation=cfg.get(CATEGORY_STORAGE_MONITOR,"String_Node_Str",StorageScannerTileEntity.scansPerOperation,"String_Node_Str").getInt();
    StorageScannerTileEntity.hilightTime=cfg.get(CATEGORY_STORAGE_MONITOR,"String_Node_Str",StorageScannerTileEntity.hilightTime,"String_Node_Str").getInt();
    NetworkMonitorItem.hilightTime=cfg.get(CATEGORY_NETWORK_MONITOR,"String_Node_Str",NetworkMonitorItem.hilightTime,"String_Node_Str").getInt();
  }
 catch (  Exception e1) {
    FMLLog.log(Level.ERROR,e1,"String_Node_Str");
  }
 finally {
    if (cfg.hasChanged()) {
      cfg.save();
    }
  }
}
Program: 166189
Project: 166189
Buggy source:
private void hilightSelectedContainer(int index){
  if (index == -1) {
    return;
  }
  SyncedValueList<InvBlockInfo> inventories=storageScannerTileEntity.getInventories();
  Coordinate c=inventories.get(index).getCoordinate();
  RFTools.instance.hilightBlock(c,mc.theWorld.getTotalWorldTime() + 20 * hilightTime);
  mc.getMinecraft().thePlayer.closeScreen();
}

Fixed version (ground truth):
private void hilightSelectedContainer(int index){
  if (index == -1) {
    return;
  }
  SyncedValueList<InvBlockInfo> inventories=storageScannerTileEntity.getInventories();
  Coordinate c=inventories.get(index).getCoordinate();
  RFTools.instance.hilightBlock(c,mc.theWorld.getTotalWorldTime() + 20 * StorageScannerTileEntity.hilightTime);
  mc.getMinecraft().thePlayer.closeScreen();
}
Program: 166190
Project: 166190
Buggy source:
private void hilightBlock(int index){
  if (index == -1) {
    return;
  }
  Coordinate c=indexToCoordinate.get(index);
  RFTools.instance.hilightBlock(c,mc.theWorld.getTotalWorldTime() + 20 * hilightTime);
  mc.getMinecraft().thePlayer.closeScreen();
}

Fixed version (ground truth):
private void hilightBlock(int index){
  if (index == -1) {
    return;
  }
  Coordinate c=indexToCoordinate.get(index);
  RFTools.instance.hilightBlock(c,mc.theWorld.getTotalWorldTime() + 20 * NetworkMonitorItem.hilightTime);
  mc.getMinecraft().thePlayer.closeScreen();
}
Program: 166191
Project: 166191
Buggy source:
@Override public void breakBlock(World world,int x,int y,int z,Block block,int meta){
  CrafterBlockTileEntity crafterBlockTileEntity=(CrafterBlockTileEntity)world.getTileEntity(x,y,z);
  if (crafterBlockTileEntity != null) {
    BlockTools.emptyInventoryInWorld(world,x,y,z,block,crafterBlockTileEntity);
  }
  super.breakBlock(world,x,y,z,block,meta);
}

Fixed version (ground truth):
@Override public void breakBlock(World world,int x,int y,int z,Block block,int meta){
  CrafterBlockTileEntity crafterBlockTileEntity=(CrafterBlockTileEntity)world.getTileEntity(x,y,z);
  if (crafterBlockTileEntity != null) {
    for (int i=CrafterContainerFactory.SLOT_CRAFTINPUT; i <= CrafterContainerFactory.SLOT_CRAFTOUTPUT; i++) {
      crafterBlockTileEntity.setInventorySlotContents(i,null);
    }
    BlockTools.emptyInventoryInWorld(world,x,y,z,block,crafterBlockTileEntity);
  }
  super.breakBlock(world,x,y,z,block,meta);
}
Program: 166192
Project: 166192
Buggy source:
@Override public Widget mouseClick(int x,int y,int button){
  int newSelected=-1;
  int top=0;
  for (int i=first; i < first + getCountSelected() && i < children.size(); i++) {
    Rectangle r=new Rectangle(0,top,bounds.width,rowheight);
    if (r.contains(x,y)) {
      newSelected=i;
      break;
    }
    top+=rowheight;
  }
  if (newSelected != selected) {
    selected=newSelected;
    fireSelectionEvents(selected);
  }
  return null;
}

Fixed version (ground truth):
@Override public Widget mouseClick(int x,int y,int button){
  int newSelected=-1;
  int top=bounds.y;
  for (int i=first; i < first + getCountSelected() && i < children.size(); i++) {
    Rectangle r=new Rectangle(bounds.x,top,bounds.width,rowheight);
    if (r.contains(x,y)) {
      newSelected=i;
      break;
    }
    top+=rowheight;
  }
  if (newSelected != selected) {
    selected=newSelected;
    fireSelectionEvents(selected);
  }
  return null;
}
Program: 166193
Project: 166193
Buggy source:
private void layoutBuffer(){
  int leftCol=12;
  int topRow=89;
  addSlotBox(SlotType.SLOT_INPUT,CONTAINER_INVENTORY,SLOT_BUFFER,leftCol,topRow,12,18,2,18);
  for (int py=0; py < 2; py++) {
    addSlot(SlotType.SLOT_OUTPUT,CONTAINER_INVENTORY,SLOT_BUFFEROUT + py,leftCol + 13 * 18,topRow + py * 18);
  }
}

Fixed version (ground truth):
private void layoutBuffer(){
  int leftCol=12;
  int topRow=89;
  addSlotBox(SlotType.SLOT_INPUT,CONTAINER_INVENTORY,SLOT_BUFFER,leftCol,topRow,12,18,2,18);
  for (int py=0; py < 2; py++) {
    addSlot(SlotType.SLOT_OUTPUT,CONTAINER_INVENTORY,SLOT_BUFFEROUT + py,leftCol + 12 * 18,topRow + py * 18);
  }
}
Program: 166194
Project: 166194
Buggy source:
@Override public ItemStack transferStackInSlot(EntityPlayer player,int index){
  ItemStack itemstack=null;
  Slot slot=(Slot)this.inventorySlots.get(index);
  if (slot != null && slot.getHasStack()) {
    ItemStack itemstack1=slot.getStack();
    itemstack=itemstack1.copy();
    if (factory.isOutputSlot(index) || factory.isInputSlot(index)) {
      if (!mergeItemStacks(itemstack1,SlotType.SLOT_PLAYERINV,true)) {
        return null;
      }
      slot.onSlotChange(itemstack1,itemstack);
    }
 else     if (factory.isGhostSlot(index)) {
      return null;
    }
 else     if (factory.isPlayerInventorySlot(index)) {
      if (!mergeItemStacks(itemstack1,SlotType.SLOT_INPUT,false)) {
        if (!mergeItemStacks(itemstack1,SlotType.SLOT_PLAYERHOTBAR,false)) {
          return null;
        }
      }
    }
 else     if (factory.isPlayerHotbarSlot(index)) {
      if (!mergeItemStacks(itemstack1,SlotType.SLOT_INPUT,false)) {
        if (!mergeItemStacks(itemstack1,SlotType.SLOT_PLAYERINV,false)) {
          return null;
        }
      }
    }
 else {
      System.out.println("String_Node_Str");
    }
    if (itemstack1.stackSize == 0) {
      slot.putStack(null);
    }
 else {
      slot.onSlotChanged();
    }
    if (itemstack1.stackSize == itemstack.stackSize) {
      return null;
    }
    slot.onPickupFromSlot(player,itemstack1);
  }
  return itemstack;
}

Fixed version (ground truth):
@Override public ItemStack transferStackInSlot(EntityPlayer player,int index){
  ItemStack itemstack=null;
  Slot slot=(Slot)this.inventorySlots.get(index);
  if (slot != null && slot.getHasStack()) {
    ItemStack itemstack1=slot.getStack();
    itemstack=itemstack1.copy();
    if (factory.isOutputSlot(index) || factory.isInputSlot(index)) {
      if (!mergeItemStacks(itemstack1,SlotType.SLOT_PLAYERINV,true)) {
        return null;
      }
      slot.onSlotChange(itemstack1,itemstack);
    }
 else     if (factory.isGhostSlot(index) || factory.isGhostOutputSlot(index)) {
      return null;
    }
 else     if (factory.isPlayerInventorySlot(index)) {
      if (!mergeItemStacks(itemstack1,SlotType.SLOT_INPUT,false)) {
        if (!mergeItemStacks(itemstack1,SlotType.SLOT_PLAYERHOTBAR,false)) {
          return null;
        }
      }
    }
 else     if (factory.isPlayerHotbarSlot(index)) {
      if (!mergeItemStacks(itemstack1,SlotType.SLOT_INPUT,false)) {
        if (!mergeItemStacks(itemstack1,SlotType.SLOT_PLAYERINV,false)) {
          return null;
        }
      }
    }
 else {
      System.out.println("String_Node_Str");
    }
    if (itemstack1.stackSize == 0) {
      slot.putStack(null);
    }
 else {
      slot.onSlotChanged();
    }
    if (itemstack1.stackSize == itemstack.stackSize) {
      return null;
    }
    slot.onPickupFromSlot(player,itemstack1);
  }
  return itemstack;
}
Program: 166195
Project: 166195
Buggy source:
public void generateSlots(){
  for (  SlotFactory slotFactory : factory.getSlots()) {
    Slot slot;
    if (slotFactory.getSlotType() == SlotType.SLOT_GHOST) {
      slot=new GhostSlot(inventories.get(slotFactory.getInventoryName()),slotFactory.getIndex(),slotFactory.getX(),slotFactory.getY());
    }
 else {
      slot=new Slot(inventories.get(slotFactory.getInventoryName()),slotFactory.getIndex(),slotFactory.getX(),slotFactory.getY());
    }
    addSlotToContainer(slot);
  }
}

Fixed version (ground truth):
public void generateSlots(){
  for (  SlotFactory slotFactory : factory.getSlots()) {
    Slot slot;
    if (slotFactory.getSlotType() == SlotType.SLOT_GHOST) {
      slot=new GhostSlot(inventories.get(slotFactory.getInventoryName()),slotFactory.getIndex(),slotFactory.getX(),slotFactory.getY());
    }
 else     if (slotFactory.getSlotType() == SlotType.SLOT_GHOSTOUT) {
      slot=new GhostOutputSlot(inventories.get(slotFactory.getInventoryName()),slotFactory.getIndex(),slotFactory.getX(),slotFactory.getY());
    }
 else {
      slot=new Slot(inventories.get(slotFactory.getInventoryName()),slotFactory.getIndex(),slotFactory.getX(),slotFactory.getY());
    }
    addSlotToContainer(slot);
  }
}
Program: 166196
Project: 166196
Buggy source:
@Override public ItemStack decrStackSize(int index,int amount){
  if (CrafterContainerFactory.getInstance().isGhostSlot(index)) {
    ItemStack old=stacks[index];
    stacks[index]=null;
    if (old == null) {
      return null;
    }
    old.stackSize=0;
    return old;
  }
 else {
    if (stacks[index] != null) {
      if (stacks[index].stackSize <= amount) {
        ItemStack old=stacks[index];
        stacks[index]=null;
        markDirty();
        return old;
      }
      ItemStack its=stacks[index].splitStack(amount);
      if (stacks[index].stackSize == 0) {
        stacks[index]=null;
      }
      markDirty();
      return its;
    }
    return null;
  }
}

Fixed version (ground truth):
@Override public ItemStack decrStackSize(int index,int amount){
  if (CrafterContainerFactory.getInstance().isGhostSlot(index) || CrafterContainerFactory.getInstance().isGhostOutputSlot(index)) {
    ItemStack old=stacks[index];
    stacks[index]=null;
    if (old == null) {
      return null;
    }
    old.stackSize=0;
    return old;
  }
 else {
    if (stacks[index] != null) {
      if (stacks[index].stackSize <= amount) {
        ItemStack old=stacks[index];
        stacks[index]=null;
        markDirty();
        return old;
      }
      ItemStack its=stacks[index].splitStack(amount);
      if (stacks[index].stackSize == 0) {
        stacks[index]=null;
      }
      markDirty();
      return its;
    }
    return null;
  }
}
Program: 166197
Project: 166197
Buggy source:
@Override public void setInventorySlotContents(int index,ItemStack stack){
  if (CrafterContainerFactory.getInstance().isGhostSlot(index)) {
    if (stack != null) {
      stacks[index]=stack.copy();
      if (index < 9) {
        stacks[index].stackSize=1;
      }
    }
 else {
      stacks[index]=null;
    }
  }
 else {
    stacks[index]=stack;
    if (stack != null && stack.stackSize > getInventoryStackLimit()) {
      stack.stackSize=getInventoryStackLimit();
    }
    markDirty();
  }
}

Fixed version (ground truth):
@Override public void setInventorySlotContents(int index,ItemStack stack){
  if (CrafterContainerFactory.getInstance().isGhostSlot(index)) {
    if (stack != null) {
      stacks[index]=stack.copy();
      if (index < 9) {
        stacks[index].stackSize=1;
      }
    }
 else {
      stacks[index]=null;
    }
  }
 else   if (CrafterContainerFactory.getInstance().isGhostOutputSlot(index)) {
    if (stack != null) {
      stacks[index]=stack.copy();
    }
 else {
      stacks[index]=null;
    }
  }
 else {
    stacks[index]=stack;
    if (stack != null && stack.stackSize > getInventoryStackLimit()) {
      stack.stackSize=getInventoryStackLimit();
    }
    markDirty();
  }
}
Program: 166198
Project: 166198
Buggy source:
private void layoutCraftingGrid(){
  int leftCol=193;
  int topRow=7;
  addSlotBox(SlotType.SLOT_GHOST,CONTAINER_INVENTORY,SLOT_CRAFTINPUT,leftCol,topRow,3,18,3,18);
  addSlot(SlotType.SLOT_GHOST,CONTAINER_INVENTORY,SLOT_CRAFTOUTPUT,leftCol,65);
}

Fixed version (ground truth):
private void layoutCraftingGrid(){
  int leftCol=193;
  int topRow=7;
  addSlotBox(SlotType.SLOT_GHOST,CONTAINER_INVENTORY,SLOT_CRAFTINPUT,leftCol,topRow,3,18,3,18);
  addSlot(SlotType.SLOT_GHOSTOUT,CONTAINER_INVENTORY,SLOT_CRAFTOUTPUT,leftCol,65);
}
Program: 166199
Project: 166199
Buggy source:
@Override public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer player,int side,float sidex,float sidey,float sidez){
  adjacentBlocks.clear();
  if (world.isRemote) {
    player.openGui(RFTools.instance,RFTools.GUI_RF_MONITOR,player.worldObj,x,y,z);
    return true;
  }
 else {
    findAdjacentBlocks(adjacentBlocks,world,x,y,z);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer player,int side,float sidex,float sidey,float sidez){
  adjacentBlocks.clear();
  if (world.isRemote) {
    player.openGui(RFTools.instance,RFTools.GUI_RF_MONITOR,player.worldObj,x,y,z);
    return true;
  }
 else {
    findAdjacentBlocks(adjacentBlocks,world,x,y,z);
  }
  return true;
}
Program: 166200
Project: 166200
Buggy source:
private void findConnectedBlocks(HashMap<Coordinate,BlockInfo> connectedBlocks,World world,int x,int y,int z,boolean first){
  if (y < 0 || y >= world.getActualHeight()) {
    return;
  }
  Coordinate c=new Coordinate(x,y,z);
  if (connectedBlocks.containsKey(c)) {
    return;
  }
  TileEntity tileEntity=world.getTileEntity(x,y,z);
  if (tileEntity != null) {
    Block block=world.getBlock(x,y,z);
    connectedBlocks.put(c,new BlockInfo(tileEntity,block,first));
    findConnectedBlocks(connectedBlocks,world,x + 1,y,z,false);
    findConnectedBlocks(connectedBlocks,world,x - 1,y,z,false);
    findConnectedBlocks(connectedBlocks,world,x,y - 1,z,false);
    findConnectedBlocks(connectedBlocks,world,x,y + 1,z,false);
    findConnectedBlocks(connectedBlocks,world,x,y,z - 1,false);
    findConnectedBlocks(connectedBlocks,world,x,y,z + 1,false);
  }
}

Fixed version (ground truth):
private void findConnectedBlocks(HashMap<Coordinate,BlockInfo> connectedBlocks,World world,int x,int y,int z,boolean first){
  if (y < 0 || y >= world.getActualHeight()) {
    return;
  }
  Coordinate c=new Coordinate(x,y,z);
  if (connectedBlocks.containsKey(c)) {
    return;
  }
  TileEntity tileEntity=world.getTileEntity(x,y,z);
  if (tileEntity != null) {
    if (tileEntity instanceof IEnergyHandler) {
      Block block=world.getBlock(x,y,z);
      connectedBlocks.put(c,new BlockInfo(tileEntity,block,first));
      findConnectedBlocks(connectedBlocks,world,x + 1,y,z,false);
      findConnectedBlocks(connectedBlocks,world,x - 1,y,z,false);
      findConnectedBlocks(connectedBlocks,world,x,y - 1,z,false);
      findConnectedBlocks(connectedBlocks,world,x,y + 1,z,false);
      findConnectedBlocks(connectedBlocks,world,x,y,z - 1,false);
      findConnectedBlocks(connectedBlocks,world,x,y,z + 1,false);
    }
  }
}
Program: 166201
Project: 166201
Buggy source:
@Override public Widget mouseClick(int x,int y,int button){
  super.mouseClick(x,y,button);
  dragging=true;
  dx=x - bounds.x;
  dy=y - bounds.y;
  return this;
}

Fixed version (ground truth):
@Override public Widget mouseClick(int x,int y,int button){
  super.mouseClick(x,y,button);
  dragging=true;
  int divider=scrollable.getMaximum() - scrollable.getCountSelected();
  int first;
  if (horizontal) {
    int size=calculateKnobSize(divider,bounds.width);
    first=calculateKnobOffset(divider,size,bounds.width);
    dx=x - bounds.x - first;
    dy=0;
  }
 else {
    int size=calculateKnobSize(divider,bounds.height);
    first=calculateKnobOffset(divider,size,bounds.height);
    dx=0;
    dy=y - bounds.y - first;
  }
  return this;
}
Program: 166202
Project: 166202
Buggy source:
private void updateScrollable(int x,int y){
  int first;
  int divider=scrollable.getMaximum() - scrollable.getCountSelected();
  if (divider <= 0) {
    first=0;
  }
 else {
    if (horizontal) {
      int size=(scrollable.getCountSelected() * (bounds.width - 4)) / scrollable.getMaximum();
      first=((x - bounds.x - dx) * divider) / (bounds.width - 4 - size);
    }
 else {
      int size=(scrollable.getCountSelected() * (bounds.height - 4)) / scrollable.getMaximum();
      first=((y - bounds.y - dy) * divider) / (bounds.height - 4 - size);
    }
  }
  if (first > divider) {
    first=divider;
  }
  if (first < 0) {
    first=0;
  }
  scrollable.setFirstSelected(first);
}

Fixed version (ground truth):
private void updateScrollable(int x,int y){
  int first;
  int divider=scrollable.getMaximum() - scrollable.getCountSelected();
  if (divider <= 0) {
    first=0;
  }
 else {
    if (horizontal) {
      int size=calculateKnobSize(divider,bounds.width);
      first=((x - bounds.x - dx) * divider) / (bounds.width - 4 - size);
    }
 else {
      int size=calculateKnobSize(divider,bounds.height);
      first=((y - bounds.y - dy) * divider) / (bounds.height - 4 - size);
    }
  }
  if (first > divider) {
    first=divider;
  }
  if (first < 0) {
    first=0;
  }
  scrollable.setFirstSelected(first);
}
Program: 166203
Project: 166203
Buggy source:
@Override public void draw(int x,int y){
  super.draw(x,y);
  int xx=x + bounds.x;
  int yy=y + bounds.y;
  Gui.drawRect(xx,yy,xx + bounds.width - 1,yy + bounds.height - 1,0xff000000);
  int divider=scrollable.getMaximum() - scrollable.getCountSelected();
  if (horizontal) {
    int size;
    int first;
    if (divider <= 0) {
      size=bounds.width - 4;
      first=0;
    }
 else {
      size=(scrollable.getCountSelected() * (bounds.width - 4)) / scrollable.getMaximum();
      first=(scrollable.getFirstSelected() * (bounds.width - 4 - size)) / divider;
    }
    Gui.drawRect(xx + 2 + first,yy + 2,xx + 2 + first+ size - 1,yy + bounds.height - 4,0xff777777);
  }
 else {
    int size;
    int first;
    if (divider <= 0) {
      size=bounds.height - 4;
      first=0;
    }
 else {
      size=(scrollable.getCountSelected() * (bounds.height - 4)) / scrollable.getMaximum();
      first=(scrollable.getFirstSelected() * (bounds.height - 4 - size)) / divider;
    }
    Gui.drawRect(xx + 2,yy + 2 + first,xx + bounds.width - 4,yy + 2 + first+ size - 1,0xff777777);
  }
}

Fixed version (ground truth):
@Override public void draw(int x,int y){
  super.draw(x,y);
  int xx=x + bounds.x;
  int yy=y + bounds.y;
  Gui.drawRect(xx,yy,xx + bounds.width - 1,yy + bounds.height - 1,0xff000000);
  int divider=scrollable.getMaximum() - scrollable.getCountSelected();
  if (horizontal) {
    int size=calculateKnobSize(divider,bounds.width);
    int first=calculateKnobOffset(divider,size,bounds.width);
    Gui.drawRect(xx + 2 + first,yy + 2,xx + 2 + first+ size - 1,yy + bounds.height - 4,0xff777777);
  }
 else {
    int size=calculateKnobSize(divider,bounds.height);
    int first=calculateKnobOffset(divider,size,bounds.height);
    Gui.drawRect(xx + 2,yy + 2 + first,xx + bounds.width - 4,yy + 2 + first+ size - 1,0xff777777);
  }
}
Program: 166204
Project: 166204
Buggy source:
@Override public ServicePolicies getServicePoliciesIfUpdated(long lastKnownVersion,long lastActivationTimeInMillis) throws Exception {
  String basedir=System.getProperty("String_Node_Str");
  if (basedir == null) {
    basedir=new File("String_Node_Str").getCanonicalPath();
  }
  java.nio.file.Path cachePath=FileSystems.getDefault().getPath(basedir,"String_Node_Str" + cacheFilename);
  byte[] cacheBytes=Files.readAllBytes(cachePath);
  return gson.fromJson(new String(cacheBytes),ServicePolicies.class);
}

Fixed version (ground truth):
@Override public ServicePolicies getServicePoliciesIfUpdated(long lastKnownVersion,long lastActivationTimeInMillis) throws Exception {
  String basedir=System.getProperty("String_Node_Str");
  if (basedir == null) {
    basedir=new File("String_Node_Str").getCanonicalPath();
  }
  java.nio.file.Path cachePath=FileSystems.getDefault().getPath(basedir,"String_Node_Str" + cacheFilename);
  byte[] cacheBytes=Files.readAllBytes(cachePath);
  return gson.fromJson(new String(cacheBytes,Charset.defaultCharset()),ServicePolicies.class);
}
Program: 166209
Project: 166209
Buggy source:
public static void initResourceMap(){
  if (resourcemapProperties == null) {
    resourcemapProperties=new Properties();
    InputStream in=HadoopConfigHolder.class.getClassLoader().getResourceAsStream(RESOURCEMAP_PROP_FILE);
    if (in != null) {
      try {
        resourcemapProperties.load(in);
        for (        Map.Entry<Object,Object> entry : resourcemapProperties.entrySet()) {
          String key=(String)entry.getKey();
          String value=(String)entry.getValue();
          if (RANGER_SECTION_NAME.equals(value)) {
            rangerInternalPropertyKeys.add(key);
          }
        }
      }
 catch (      IOException e) {
        throw new HadoopException("String_Node_Str" + RESOURCEMAP_PROP_FILE + "String_Node_Str",e);
      }
 finally {
        if (in != null) {
          try {
            in.close();
          }
 catch (          IOException ioe) {
          }
        }
      }
    }
 else {
      throw new HadoopException("String_Node_Str" + RESOURCEMAP_PROP_FILE + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private static void initResourceMap(){
  Properties props=new Properties();
  InputStream in=HadoopConfigHolder.class.getClassLoader().getResourceAsStream(RESOURCEMAP_PROP_FILE);
  if (in != null) {
    try {
      props.load(in);
      for (      Map.Entry<Object,Object> entry : props.entrySet()) {
        String value=(String)entry.getValue();
        if (RANGER_SECTION_NAME.equals(value)) {
          String key=(String)entry.getKey();
          rangerInternalPropertyKeys.add(key);
        }
      }
      resourcemapProperties=props;
    }
 catch (    IOException e) {
      throw new HadoopException("String_Node_Str" + RESOURCEMAP_PROP_FILE + "String_Node_Str",e);
    }
 finally {
      if (in != null) {
        try {
          in.close();
        }
 catch (        IOException ioe) {
        }
      }
    }
  }
 else {
    throw new HadoopException("String_Node_Str" + RESOURCEMAP_PROP_FILE + "String_Node_Str");
  }
}
Program: 166210
Project: 166210
Buggy source:
/** 
 * Checks that the <b>file</b> access is <b>blocked</b> for the given user in the given groups. Throws an exception, if not.
 */
public void checkAccessBlocked(FsAction access,String userName,String... groups) throws AccessControlException {
  try {
    checkAccess(access,userName,groups);
    Assert.fail("String_Node_Str" + path + "String_Node_Str"+ access+ "String_Node_Str"+ userName+ "String_Node_Str"+ groups);
  }
 catch (  AccessControlException ace) {
    Assert.assertNotNull(ace);
  }
}

Fixed version (ground truth):
/** 
 * Checks that the <b>file</b> access is <b>blocked</b> for the given user in the given groups. Throws an exception, if not.
 */
public void checkAccessBlocked(FsAction access,String userName,String... groups) throws AccessControlException {
  try {
    checkAccess(access,userName,groups);
    Assert.fail("String_Node_Str" + path + "String_Node_Str"+ access+ "String_Node_Str"+ userName+ "String_Node_Str"+ Arrays.asList(groups));
  }
 catch (  AccessControlException ace) {
    Assert.assertNotNull(ace);
  }
}
Program: 166211
Project: 166211
Buggy source:
private boolean validatePolicyItems(List<? extends RangerPolicyItem> policyItems){
  boolean isPolicyItemValid=true;
  if (CollectionUtils.isNotEmpty(policyItems)) {
    for (    RangerPolicyItem policyItem : policyItems) {
      if (policyItem == null) {
        isPolicyItemValid=false;
        break;
      }
      if (CollectionUtils.isEmpty(policyItem.getUsers()) && CollectionUtils.isEmpty(policyItem.getGroups())) {
        isPolicyItemValid=false;
        break;
      }
      if (policyItem.getUsers() != null && (policyItem.getUsers().contains(null) || policyItem.getUsers().contains("String_Node_Str"))) {
        isPolicyItemValid=false;
        break;
      }
      if (policyItem.getGroups() != null && (policyItem.getGroups().contains(null) || policyItem.getGroups().contains("String_Node_Str"))) {
        isPolicyItemValid=false;
        break;
      }
      if (CollectionUtils.isEmpty(policyItem.getAccesses()) || policyItem.getAccesses().contains(null) || policyItem.getAccesses().contains("String_Node_Str")) {
        isPolicyItemValid=false;
        break;
      }
    }
  }
  return isPolicyItemValid;
}

Fixed version (ground truth):
private boolean validatePolicyItems(List<? extends RangerPolicyItem> policyItems){
  if (CollectionUtils.isNotEmpty(policyItems)) {
    for (    RangerPolicyItem policyItem : policyItems) {
      if (policyItem == null) {
        return false;
      }
      if (CollectionUtils.isEmpty(policyItem.getUsers()) && CollectionUtils.isEmpty(policyItem.getGroups())) {
        return false;
      }
      if (policyItem.getUsers() != null && (policyItem.getUsers().contains(null) || policyItem.getUsers().contains("String_Node_Str"))) {
        return false;
      }
      if (policyItem.getGroups() != null && (policyItem.getGroups().contains(null) || policyItem.getGroups().contains("String_Node_Str"))) {
        return false;
      }
      if (CollectionUtils.isEmpty(policyItem.getAccesses()) || policyItem.getAccesses().contains(null)) {
        return false;
      }
      for (      RangerPolicyItemAccess itemAccesses : policyItem.getAccesses()) {
        if (itemAccesses.getType() == null || itemAccesses.getIsAllowed() == null) {
          return false;
        }
      }
    }
  }
  return true;
}
Program: 166217
Project: 166217
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  XXServiceDefWithAssignedId other=(XXServiceDefWithAssignedId)obj;
  if (id == null) {
    if (other.id != null)     return false;
  }
 else   if (!id.equals(other.id))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  XXServiceDef other=(XXServiceDef)obj;
  if (id == null) {
    if (other.id != null)     return false;
  }
 else   if (!id.equals(other.id))   return false;
  return true;
}
Program: 166218
Project: 166218
Buggy source:
@GET @Path("String_Node_Str") @Produces({"String_Node_Str","String_Node_Str"}) public VXPolicyList searchPolicies(@Context HttpServletRequest request){
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str");
  }
  SearchFilter filter=searchUtil.getSearchFilterFromLegacyRequest(request,policyService.sortFields);
  int savedStartIndex=filter == null ? 0 : filter.getStartIndex();
  int savedMaxRows=filter == null ? Integer.MAX_VALUE : filter.getMaxRows();
  if (filter != null) {
    filter.setStartIndex(0);
    filter.setMaxRows(Integer.MAX_VALUE);
  }
  List<RangerPolicy> rangerPolicyList=serviceREST.getPolicies(filter);
  if (filter != null) {
    filter.setStartIndex(savedStartIndex);
    filter.setMaxRows(savedMaxRows);
  }
  VXPolicyList vXPolicyList=null;
  if (rangerPolicyList != null) {
    vXPolicyList=serviceUtil.rangerPolicyListToPublic(rangerPolicyList,filter);
  }
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + vXPolicyList);
  }
  return vXPolicyList;
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces({"String_Node_Str","String_Node_Str"}) public VXPolicyList searchPolicies(@Context HttpServletRequest request){
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str");
  }
  SearchFilter filter=searchUtil.getSearchFilterFromLegacyRequest(request,policyService.sortFields);
  int savedStartIndex=filter.getStartIndex();
  int savedMaxRows=filter.getMaxRows();
  filter.setStartIndex(0);
  filter.setMaxRows(Integer.MAX_VALUE);
  List<RangerPolicy> rangerPolicyList=serviceREST.getPolicies(filter);
  filter.setStartIndex(savedStartIndex);
  filter.setMaxRows(savedMaxRows);
  VXPolicyList vXPolicyList=null;
  if (rangerPolicyList != null) {
    vXPolicyList=serviceUtil.rangerPolicyListToPublic(rangerPolicyList,filter);
  }
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + vXPolicyList);
  }
  return vXPolicyList;
}
Program: 166219
Project: 166219
Buggy source:
private RangerPolicyList toRangerPolicyList(List<RangerPolicy> policyList,SearchFilter filter){
  RangerPolicyList ret=new RangerPolicyList();
  if (CollectionUtils.isNotEmpty(policyList)) {
    int totalCount=policyList.size();
    int startIndex=filter == null ? 0 : filter.getStartIndex();
    int pageSize=filter == null ? totalCount : filter.getMaxRows();
    int toIndex=Math.min(startIndex + pageSize,totalCount);
    String sortType=filter == null ? null : filter.getSortType();
    String sortBy=filter == null ? null : filter.getSortBy();
    List<RangerPolicy> retList=new ArrayList<RangerPolicy>();
    for (int i=startIndex; i < toIndex; i++) {
      retList.add(policyList.get(i));
    }
    ret.setPolicies(retList);
    ret.setPageSize(pageSize);
    ret.setResultSize(retList.size());
    ret.setStartIndex(startIndex);
    ret.setTotalCount(totalCount);
    ret.setSortBy(sortBy);
    ret.setSortType(sortType);
  }
  return ret;
}

Fixed version (ground truth):
private RangerPolicyList toRangerPolicyList(List<RangerPolicy> policyList,SearchFilter filter){
  RangerPolicyList ret=new RangerPolicyList();
  if (CollectionUtils.isNotEmpty(policyList)) {
    int totalCount=policyList.size();
    int startIndex=filter.getStartIndex();
    int pageSize=filter.getMaxRows();
    int toIndex=Math.min(startIndex + pageSize,totalCount);
    String sortType=filter.getSortType();
    String sortBy=filter.getSortBy();
    List<RangerPolicy> retList=new ArrayList<RangerPolicy>();
    for (int i=startIndex; i < toIndex; i++) {
      retList.add(policyList.get(i));
    }
    ret.setPolicies(retList);
    ret.setPageSize(pageSize);
    ret.setResultSize(retList.size());
    ret.setStartIndex(startIndex);
    ret.setTotalCount(totalCount);
    ret.setSortBy(sortBy);
    ret.setSortType(sortType);
  }
  return ret;
}
Program: 166220
Project: 166220
Buggy source:
private void initDBConnectivity(){
  try {
    DB_PROPERTIES=new HashMap<String,String>();
    DB_PROPERTIES.put(JPA_DB_DIALECT,conf.get(PROPERTY_PREFIX + DB_DIALECT));
    DB_PROPERTIES.put(JPA_DB_DRIVER,conf.get(PROPERTY_PREFIX + DB_DRIVER));
    DB_PROPERTIES.put(JPA_DB_URL,conf.get(PROPERTY_PREFIX + DB_URL));
    DB_PROPERTIES.put(JPA_DB_USER,conf.get(PROPERTY_PREFIX + DB_USER));
    DB_PROPERTIES.put(JPA_DB_PASSWORD,conf.get(PROPERTY_PREFIX + DB_PASSWORD));
    if (getDBFlavor(conf) == DB_FLAVOR_MYSQL) {
      updateDBSSLURL();
    }
    entityManagerFactory=Persistence.createEntityManagerFactory("String_Node_Str",DB_PROPERTIES);
    daoManager=new DaoManager();
    daoManager.setEntityManagerFactory(entityManagerFactory);
    daoManager.getEntityManager();
    logger.info("String_Node_Str" + isDbConnected());
  }
 catch (  Exception excp) {
    excp.printStackTrace();
  }
}

Fixed version (ground truth):
private void initDBConnectivity(){
  try {
    jpaProperties.put(JPA_DB_DIALECT,conf.get(PROPERTY_PREFIX + DB_DIALECT));
    jpaProperties.put(JPA_DB_DRIVER,conf.get(PROPERTY_PREFIX + DB_DRIVER));
    jpaProperties.put(JPA_DB_URL,conf.get(PROPERTY_PREFIX + DB_URL));
    jpaProperties.put(JPA_DB_USER,conf.get(PROPERTY_PREFIX + DB_USER));
    jpaProperties.put(JPA_DB_PASSWORD,conf.get(PROPERTY_PREFIX + DB_PASSWORD));
    if (getDBFlavor(conf) == DB_FLAVOR_MYSQL) {
      updateDBSSLURL();
    }
    entityManagerFactory=Persistence.createEntityManagerFactory("String_Node_Str",jpaProperties);
    daoManager=new DaoManager();
    daoManager.setEntityManagerFactory(entityManagerFactory);
    daoManager.getEntityManager();
    logger.info("String_Node_Str" + isDbConnected());
  }
 catch (  Exception excp) {
    excp.printStackTrace();
  }
}
Program: 166221
Project: 166221
Buggy source:
public int getDBFlavor(Configuration newConfig){
  String[] propertyNames={PROPERTY_PREFIX + DB_DIALECT,PROPERTY_PREFIX + DB_DRIVER,PROPERTY_PREFIX + DB_URL};
  for (  String propertyName : propertyNames) {
    String propertyValue=DB_PROPERTIES.get(propertyName);
    if (StringUtils.isBlank(propertyValue)) {
      continue;
    }
    if (StringUtils.containsIgnoreCase(propertyValue,"String_Node_Str")) {
      return DB_FLAVOR_MYSQL;
    }
 else     if (StringUtils.containsIgnoreCase(propertyValue,"String_Node_Str")) {
      return DB_FLAVOR_ORACLE;
    }
 else     if (StringUtils.containsIgnoreCase(propertyValue,"String_Node_Str")) {
      return DB_FLAVOR_POSTGRES;
    }
 else     if (StringUtils.containsIgnoreCase(propertyValue,"String_Node_Str")) {
      return DB_FLAVOR_SQLSERVER;
    }
 else     if (StringUtils.containsIgnoreCase(propertyValue,"String_Node_Str")) {
      return DB_FLAVOR_SQLSERVER;
    }
 else     if (StringUtils.containsIgnoreCase(propertyValue,"String_Node_Str")) {
      return DB_FLAVOR_SQLANYWHERE;
    }
 else     if (StringUtils.containsIgnoreCase(propertyValue,"String_Node_Str")) {
      return DB_FLAVOR_SQLANYWHERE;
    }
 else {
      if (logger.isDebugEnabled()) {
        logger.debug("String_Node_Str" + propertyName + "String_Node_Str"+ propertyValue);
      }
    }
  }
  logger.error("String_Node_Str");
  return DB_FLAVOR_UNKNOWN;
}

Fixed version (ground truth):
private int getDBFlavor(Configuration newConfig){
  String[] propertyNames={PROPERTY_PREFIX + DB_DIALECT,PROPERTY_PREFIX + DB_DRIVER,PROPERTY_PREFIX + DB_URL};
  for (  String propertyName : propertyNames) {
    String propertyValue=newConfig.get(propertyName);
    if (StringUtils.isBlank(propertyValue)) {
      continue;
    }
    if (StringUtils.containsIgnoreCase(propertyValue,"String_Node_Str")) {
      return DB_FLAVOR_MYSQL;
    }
 else     if (StringUtils.containsIgnoreCase(propertyValue,"String_Node_Str")) {
      return DB_FLAVOR_ORACLE;
    }
 else     if (StringUtils.containsIgnoreCase(propertyValue,"String_Node_Str")) {
      return DB_FLAVOR_POSTGRES;
    }
 else     if (StringUtils.containsIgnoreCase(propertyValue,"String_Node_Str")) {
      return DB_FLAVOR_SQLSERVER;
    }
 else     if (StringUtils.containsIgnoreCase(propertyValue,"String_Node_Str")) {
      return DB_FLAVOR_SQLSERVER;
    }
 else     if (StringUtils.containsIgnoreCase(propertyValue,"String_Node_Str")) {
      return DB_FLAVOR_SQLANYWHERE;
    }
 else     if (StringUtils.containsIgnoreCase(propertyValue,"String_Node_Str")) {
      return DB_FLAVOR_SQLANYWHERE;
    }
 else {
      if (logger.isDebugEnabled()) {
        logger.debug("String_Node_Str" + propertyName + "String_Node_Str"+ propertyValue);
      }
    }
  }
  logger.error("String_Node_Str");
  return DB_FLAVOR_UNKNOWN;
}
Program: 166224
Project: 166224
Buggy source:
@Override public void init() throws Throwable {
  deltaSyncUserTime=0;
  deltaSyncGroupTime=0;
  DateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  deltaSyncUserTimeStamp=dateFormat.format(new Date(0));
  deltaSyncGroupTimeStamp=dateFormat.format(new Date(0));
  setConfig();
}

Fixed version (ground truth):
@Override public void init() throws Throwable {
  deltaSyncUserTime=0;
  deltaSyncGroupTime=0;
  DateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  deltaSyncUserTimeStamp=dateFormat.format(new Date(0));
  deltaSyncGroupTimeStamp=dateFormat.format(new Date(0));
  userNameMap=new HashMap<String,String>();
  setConfig();
}
Program: 166225
Project: 166225
Buggy source:
@Override public void updateSink(UserGroupSink sink) throws Throwable {
  LOG.info("String_Node_Str");
  groupUserTable=HashBasedTable.create();
  if (!groupSearchFirstEnabled) {
    LOG.info("String_Node_Str");
    getUsers(sink);
    if (groupSearchEnabled) {
      getGroups(sink);
    }
  }
 else {
    LOG.info("String_Node_Str");
    getGroups(sink);
    if (userSearchEnabled) {
      LOG.info("String_Node_Str");
      getUsers(sink);
    }
  }
  if (groupUserTable.isEmpty()) {
    return;
  }
  Iterator<String> groupUserTableIterator=groupUserTable.rowKeySet().iterator();
  while (groupUserTableIterator.hasNext()) {
    String groupName=groupUserTableIterator.next();
    Map<String,String> groupUsersMap=groupUserTable.row(groupName);
    Set<String> userSet=new HashSet<String>();
    for (    Map.Entry<String,String> entry : groupUsersMap.entrySet()) {
      String transformUserName=userNameTransform(entry.getKey());
      userSet.add(transformUserName);
    }
    List<String> userList=new ArrayList<>(userSet);
    String transformGroupName=groupNameTransform(groupName);
    try {
      sink.addOrUpdateGroup(transformGroupName,userList);
    }
 catch (    Throwable t) {
      LOG.error("String_Node_Str" + t.getMessage() + "String_Node_Str"+ transformGroupName+ "String_Node_Str"+ userList);
    }
  }
}

Fixed version (ground truth):
@Override public void updateSink(UserGroupSink sink) throws Throwable {
  LOG.info("String_Node_Str");
  groupUserTable=HashBasedTable.create();
  if (!groupSearchFirstEnabled) {
    LOG.info("String_Node_Str");
    getUsers(sink);
    if (groupSearchEnabled) {
      getGroups(sink);
    }
  }
 else {
    LOG.info("String_Node_Str");
    getGroups(sink);
    if (userSearchEnabled) {
      LOG.info("String_Node_Str");
      getUsers(sink);
    }
  }
  if (groupUserTable.isEmpty()) {
    return;
  }
  Iterator<String> groupUserTableIterator=groupUserTable.rowKeySet().iterator();
  while (groupUserTableIterator.hasNext()) {
    String groupName=groupUserTableIterator.next();
    Map<String,String> groupUsersMap=groupUserTable.row(groupName);
    Set<String> userSet=new HashSet<String>();
    for (    Map.Entry<String,String> entry : groupUsersMap.entrySet()) {
      userSet.add(entry.getValue());
    }
    List<String> userList=new ArrayList<>(userSet);
    String transformGroupName=groupNameTransform(groupName);
    try {
      sink.addOrUpdateGroup(transformGroupName,userList);
    }
 catch (    Throwable t) {
      LOG.error("String_Node_Str" + t.getMessage() + "String_Node_Str"+ transformGroupName+ "String_Node_Str"+ userList);
    }
  }
}
Program: 166228
Project: 166228
Buggy source:
@Test public void testGroupBasedWithSingleOU() throws Throwable {
  config.setUserSearchBase("String_Node_Str");
  config.setUserSearchFilter("String_Node_Str");
  config.setGroupSearchBase("String_Node_Str");
  config.setGroupSearchFilter("String_Node_Str");
  config.setUserGroupMemberAttributeName("String_Node_Str");
  config.setUserObjectClass("String_Node_Str");
  config.setGroupObjectClass("String_Node_Str");
  config.setGroupSearchEnabled(true);
  config.setGroupSearchFirstEnabled(true);
  config.setUserSearchEnabled(true);
  ldapBuilder.init();
  PolicyMgrUserGroupBuilderTest sink=new PolicyMgrUserGroupBuilderTest();
  sink.init();
  ldapBuilder.updateSink(sink);
  assertEquals(99,sink.getTotalUsers());
  assertEquals(12,sink.getTotalGroups());
}

Fixed version (ground truth):
@Test public void testGroupBasedWithSingleOU() throws Throwable {
  config.setUserNameAttribute("String_Node_Str");
  config.setUserSearchBase("String_Node_Str");
  config.setUserSearchFilter("String_Node_Str");
  config.setGroupSearchBase("String_Node_Str");
  config.setGroupSearchFilter("String_Node_Str");
  config.setUserGroupMemberAttributeName("String_Node_Str");
  config.setUserObjectClass("String_Node_Str");
  config.setGroupObjectClass("String_Node_Str");
  config.setGroupSearchEnabled(true);
  config.setGroupSearchFirstEnabled(true);
  config.setUserSearchEnabled(true);
  ldapBuilder.init();
  PolicyMgrUserGroupBuilderTest sink=new PolicyMgrUserGroupBuilderTest();
  sink.init();
  ldapBuilder.updateSink(sink);
  assertEquals(99,sink.getTotalUsers());
  assertEquals(12,sink.getTotalGroups());
}
Program: 166229
Project: 166229
Buggy source:
@Test public void testGBWithUserSearchDisabled() throws Throwable {
  config.setUserSearchBase("String_Node_Str");
  config.setUserSearchFilter("String_Node_Str");
  config.setGroupSearchBase("String_Node_Str");
  config.setGroupSearchFilter("String_Node_Str");
  config.setUserGroupMemberAttributeName("String_Node_Str");
  config.setUserObjectClass("String_Node_Str");
  config.setGroupObjectClass("String_Node_Str");
  config.setGroupSearchEnabled(true);
  config.setGroupSearchFirstEnabled(true);
  config.setUserSearchEnabled(false);
  ldapBuilder.init();
  PolicyMgrUserGroupBuilderTest sink=new PolicyMgrUserGroupBuilderTest();
  sink.init();
  ldapBuilder.updateSink(sink);
  assertEquals(2,sink.getTotalUsers());
  assertEquals(2,sink.getTotalGroups());
}

Fixed version (ground truth):
@Test public void testGBWithUserSearchDisabled() throws Throwable {
  config.setUserNameAttribute("String_Node_Str");
  config.setUserSearchBase("String_Node_Str");
  config.setUserSearchFilter("String_Node_Str");
  config.setGroupSearchBase("String_Node_Str");
  config.setGroupSearchFilter("String_Node_Str");
  config.setUserGroupMemberAttributeName("String_Node_Str");
  config.setUserObjectClass("String_Node_Str");
  config.setGroupObjectClass("String_Node_Str");
  config.setGroupSearchEnabled(true);
  config.setGroupSearchFirstEnabled(true);
  config.setUserSearchEnabled(false);
  ldapBuilder.init();
  PolicyMgrUserGroupBuilderTest sink=new PolicyMgrUserGroupBuilderTest();
  sink.init();
  ldapBuilder.updateSink(sink);
  assertEquals(2,sink.getTotalUsers());
  assertEquals(2,sink.getTotalGroups());
}
Program: 166230
Project: 166230
Buggy source:
@Test public void testUpdateSinkMultipleOUs() throws Throwable {
  config.setUserSearchBase("String_Node_Str");
  config.setUserSearchFilter("String_Node_Str");
  config.setGroupSearchBase("String_Node_Str");
  config.setGroupSearchFilter("String_Node_Str");
  config.setUserGroupMemberAttributeName("String_Node_Str");
  config.setUserObjectClass("String_Node_Str");
  config.setGroupObjectClass("String_Node_Str");
  config.setGroupSearchEnabled(true);
  config.setGroupSearchFirstEnabled(false);
  ldapBuilder.init();
  PolicyMgrUserGroupBuilderTest sink=new PolicyMgrUserGroupBuilderTest();
  sink.init();
  ldapBuilder.updateSink(sink);
  assertEquals(111,sink.getTotalUsers());
  assertEquals(1,sink.getTotalGroups());
}

Fixed version (ground truth):
@Test public void testUpdateSinkMultipleOUs() throws Throwable {
  config.setUserNameAttribute("String_Node_Str");
  config.setUserSearchBase("String_Node_Str");
  config.setUserSearchFilter("String_Node_Str");
  config.setGroupSearchBase("String_Node_Str");
  config.setGroupSearchFilter("String_Node_Str");
  config.setUserGroupMemberAttributeName("String_Node_Str");
  config.setUserObjectClass("String_Node_Str");
  config.setGroupObjectClass("String_Node_Str");
  config.setGroupSearchEnabled(true);
  config.setGroupSearchFirstEnabled(false);
  ldapBuilder.init();
  PolicyMgrUserGroupBuilderTest sink=new PolicyMgrUserGroupBuilderTest();
  sink.init();
  ldapBuilder.updateSink(sink);
  assertEquals(111,sink.getTotalUsers());
  assertEquals(1,sink.getTotalGroups());
}
Program: 166231
Project: 166231
Buggy source:
@Test public void testShortUserNameWithGroupBased() throws Throwable {
  config.setUserSearchBase("String_Node_Str");
  config.setUserSearchFilter("String_Node_Str");
  config.setUserObjectClass("String_Node_Str");
  config.setGroupSearchBase("String_Node_Str");
  config.setGroupSearchFilter("String_Node_Str");
  config.setGroupSearchEnabled(true);
  config.setGroupSearchFirstEnabled(true);
  config.setUserGroupMemberAttributeName("String_Node_Str");
  config.setGroupObjectClass("String_Node_Str");
  config.setUserSearchEnabled(true);
  ldapBuilder.init();
  PolicyMgrUserGroupBuilderTest sink=new PolicyMgrUserGroupBuilderTest();
  sink.init();
  ldapBuilder.updateSink(sink);
  assertEquals(1,sink.getTotalUsers());
  assertEquals(3,sink.getTotalGroups());
}

Fixed version (ground truth):
@Test public void testShortUserNameWithGroupBased() throws Throwable {
  config.setUserNameAttribute("String_Node_Str");
  config.setUserSearchBase("String_Node_Str");
  config.setUserSearchFilter("String_Node_Str");
  config.setUserObjectClass("String_Node_Str");
  config.setGroupSearchBase("String_Node_Str");
  config.setGroupSearchFilter("String_Node_Str");
  config.setGroupSearchEnabled(true);
  config.setGroupSearchFirstEnabled(true);
  config.setUserGroupMemberAttributeName("String_Node_Str");
  config.setGroupObjectClass("String_Node_Str");
  config.setUserSearchEnabled(true);
  ldapBuilder.init();
  PolicyMgrUserGroupBuilderTest sink=new PolicyMgrUserGroupBuilderTest();
  sink.init();
  ldapBuilder.updateSink(sink);
  assertEquals(1,sink.getTotalUsers());
  assertEquals(3,sink.getTotalGroups());
}
Program: 166232
Project: 166232
Buggy source:
@Test public void testMultipleOUGroupsWithGroupSearch() throws Throwable {
  config.setUserSearchBase("String_Node_Str");
  config.setUserSearchFilter("String_Node_Str");
  config.setGroupSearchBase("String_Node_Str");
  config.setGroupSearchFilter("String_Node_Str");
  config.setUserGroupMemberAttributeName("String_Node_Str");
  config.setUserObjectClass("String_Node_Str");
  config.setGroupObjectClass("String_Node_Str");
  config.setGroupSearchEnabled(true);
  config.setGroupSearchFirstEnabled(false);
  ldapBuilder.init();
  PolicyMgrUserGroupBuilderTest sink=new PolicyMgrUserGroupBuilderTest();
  sink.init();
  ldapBuilder.updateSink(sink);
  assertEquals(111,sink.getTotalUsers());
  assertEquals(11,sink.getTotalGroups());
}

Fixed version (ground truth):
@Test public void testMultipleOUGroupsWithGroupSearch() throws Throwable {
  config.setUserNameAttribute("String_Node_Str");
  config.setUserSearchBase("String_Node_Str");
  config.setUserSearchFilter("String_Node_Str");
  config.setGroupSearchBase("String_Node_Str");
  config.setGroupSearchFilter("String_Node_Str");
  config.setUserGroupMemberAttributeName("String_Node_Str");
  config.setUserObjectClass("String_Node_Str");
  config.setGroupObjectClass("String_Node_Str");
  config.setGroupSearchEnabled(true);
  config.setGroupSearchFirstEnabled(false);
  ldapBuilder.init();
  PolicyMgrUserGroupBuilderTest sink=new PolicyMgrUserGroupBuilderTest();
  sink.init();
  ldapBuilder.updateSink(sink);
  assertEquals(111,sink.getTotalUsers());
  assertEquals(11,sink.getTotalGroups());
}