nus-yam/ex-repair huggingface dataset:
Program: 10568
Project: 10568
Buggy source:
public void update(Observable obj,Object arg){
  if (arg instanceof PropertyFilterUpdate[]) {
    PropertyFilterUpdate[] pfus=(PropertyFilterUpdate[])arg;
    for (int i=0; pfus != null && i < pfus.length; i++) {
      ObjectUpdate[] ous=pfus[i].getObjectSet();
      for (int j=0; j < ous.length; j++) {
        ManagedObjectReference mor=ous[j].getObj();
        if (!items.containsKey(mor)) {
          items.put(mor,new ConcurrentHashMap<String,Object>());
        }
        Map<String,Object> moMap=items.get(mor);
        PropertyChange[] pcs=ous[j].getChangeSet();
        for (int k=0; k < pcs.length; k++) {
          moMap.put(pcs[k].getName(),pcs[k].getVal());
        }
      }
    }
  }
  isReady=true;
}

Fixed version (ground truth):
public void update(Observable obj,Object arg){
  if (arg instanceof PropertyFilterUpdate[]) {
    PropertyFilterUpdate[] pfus=(PropertyFilterUpdate[])arg;
    for (int i=0; pfus != null && i < pfus.length; i++) {
      ObjectUpdate[] ous=pfus[i].getObjectSet();
      for (int j=0; j < ous.length; j++) {
        ManagedObjectReference mor=ous[j].getObj();
        if (!items.containsKey(mor)) {
          items.put(mor,new ConcurrentHashMap<String,Object>());
        }
        Map<String,Object> moMap=items.get(mor);
        PropertyChange[] pcs=ous[j].getChangeSet();
        for (int k=0; k < pcs.length; k++) {
          Object value=pcs[k].getVal();
          value=value == null ? NULL : value;
          moMap.put(pcs[k].getName(),value);
        }
      }
    }
  }
  isReady=true;
}
Program: 10569
Project: 10569
Buggy source:
public static Object fromXML(String type,Element root) throws Exception {
  List<Element> subNodes=root.elements();
  if (subNodes.size() == 0) {
    return null;
  }
  if (type.startsWith("String_Node_Str")) {
    if (!type.endsWith("String_Node_Str")) {
      Element e=subNodes.get(0);
      return createMOR(e.attributeValue("String_Node_Str"),e.getText());
    }
 else {
      ManagedObjectReference[] mos=new ManagedObjectReference[subNodes.size()];
      for (int i=0; i < subNodes.size(); i++) {
        Element elem=(Element)subNodes.get(i);
        mos[i]=XmlGen.createMOR(elem.attributeValue("String_Node_Str"),elem.getText());
      }
      return mos;
    }
  }
 else   if (isBasicType(type)) {
    String[] vals=new String[subNodes.size()];
    for (int i=0; i < vals.length; i++) {
      vals[i]=subNodes.get(i).getText();
    }
    return parseValue(type,vals);
  }
 else   if (type.endsWith("String_Node_Str")) {
    String singleTypeName=type.substring(0,type.length() - 2);
    Element e=subNodes.get(0);
    String xsiType=e.attributeValue(XSI_TYPE);
    if (xsiType != null) {
      singleTypeName=xsiType;
    }
    Class clazz=getVimClass(singleTypeName);
    Object ao=Array.newInstance(clazz,subNodes.size());
    for (int i=0; i < subNodes.size(); i++) {
      Object o=fromXml(getVimClass(singleTypeName),subNodes.get(i));
      Array.set(ao,i,o);
    }
    return ao;
  }
 else {
    return fromXml(getVimClass(type),subNodes.get(0));
  }
}

Fixed version (ground truth):
public static Object fromXML(String type,Element root) throws Exception {
  List<Element> subNodes=root.elements();
  if (subNodes.size() == 0) {
    return null;
  }
  if (type.startsWith("String_Node_Str")) {
    if (!type.endsWith("String_Node_Str")) {
      Element e=subNodes.get(0);
      return createMOR(e.attributeValue("String_Node_Str"),e.getText());
    }
 else {
      ManagedObjectReference[] mos=new ManagedObjectReference[subNodes.size()];
      for (int i=0; i < subNodes.size(); i++) {
        Element elem=(Element)subNodes.get(i);
        mos[i]=XmlGen.createMOR(elem.attributeValue("String_Node_Str"),elem.getText());
      }
      return mos;
    }
  }
 else   if (isBasicType(type)) {
    String[] vals=new String[subNodes.size()];
    for (int i=0; i < vals.length; i++) {
      vals[i]=subNodes.get(i).getText();
    }
    return parseValue(type,vals);
  }
 else   if (type.endsWith("String_Node_Str")) {
    String arrayItemTypeName=type.substring(0,type.length() - 2);
    Class clazz=getVimClass(arrayItemTypeName);
    Object ao=Array.newInstance(clazz,subNodes.size());
    for (int i=0; i < subNodes.size(); i++) {
      Element e=subNodes.get(i);
      String xsiType=e.attributeValue(XSI_TYPE);
      Object o=fromXml(getVimClass(xsiType == null ? arrayItemTypeName : xsiType),subNodes.get(i));
      Array.set(ao,i,o);
    }
    return ao;
  }
 else {
    return fromXml(getVimClass(type),subNodes.get(0));
  }
}
Program: 10570
Project: 10570
Buggy source:
public OptionManager getOvfManager(){
  return (OptionManager)createMO(getServiceContent().getOvfManager());
}

Fixed version (ground truth):
public OvfManager getOvfManager(){
  return (OvfManager)createMO(getServiceContent().getOvfManager());
}
Program: 10571
Project: 10571
Buggy source:
private static void fieldToXML(StringBuffer sb,String fName,String typeName,Object obj){
  if (typeName.endsWith("String_Node_Str")) {
    ManagedObjectReference mor=(ManagedObjectReference)obj;
    sb.append("String_Node_Str" + fName + "String_Node_Str"+ mor.type+ "String_Node_Str");
    sb.append(mor.val);
    sb.append("String_Node_Str" + fName + "String_Node_Str");
    return;
  }
  boolean isComplexType=typeName.startsWith(PACKAGE_NAME);
  if (!isComplexType) {
    sb.append("String_Node_Str" + fName + "String_Node_Str");
    sb.append(obj);
    sb.append("String_Node_Str" + fName + "String_Node_Str");
  }
 else {
    String realFieldType=obj.getClass().getCanonicalName();
    if (realFieldType.equals(typeName)) {
      sb.append(toXML(fName,obj,null));
    }
 else {
      int lastDot=realFieldType.lastIndexOf("String_Node_Str");
      String nameSpaceType=realFieldType.substring(lastDot + 1);
      sb.append(toXML(fName,obj,nameSpaceType));
    }
  }
}

Fixed version (ground truth):
private static void fieldToXML(StringBuffer sb,String fName,String typeName,Object obj){
  if (typeName.endsWith("String_Node_Str")) {
    ManagedObjectReference mor=(ManagedObjectReference)obj;
    sb.append("String_Node_Str" + fName + "String_Node_Str"+ mor.type+ "String_Node_Str");
    sb.append(mor.val);
    sb.append("String_Node_Str" + fName + "String_Node_Str");
    return;
  }
  boolean isComplexType=typeName.startsWith(PACKAGE_NAME);
  if (!isComplexType) {
    sb.append("String_Node_Str" + fName + "String_Node_Str");
    if (typeName.endsWith("String_Node_Str")) {
      sb.append(DatatypeConverter.printDateTime((Calendar)obj));
    }
 else {
      sb.append(obj);
    }
    sb.append("String_Node_Str" + fName + "String_Node_Str");
  }
 else {
    String realFieldType=obj.getClass().getCanonicalName();
    if (realFieldType.equals(typeName)) {
      sb.append(toXML(fName,obj,null));
    }
 else {
      int lastDot=realFieldType.lastIndexOf("String_Node_Str");
      String nameSpaceType=realFieldType.substring(lastDot + 1);
      sb.append(toXML(fName,obj,nameSpaceType));
    }
  }
}
Program: 10579
Project: 10579
Buggy source:
public static Object convertProperty(Object dynaPropVal){
  Object propertyValue=null;
  Class propClass=dynaPropVal.getClass();
  String propName=propClass.getName();
  if (propName.indexOf("String_Node_Str") != -1) {
    String methodName=propName.substring(propName.indexOf("String_Node_Str") + "String_Node_Str".length());
    try {
      Method getMethod=propClass.getMethod("String_Node_Str" + methodName,(Class[])null);
      if (getMethod == null) {
        getMethod=propClass.getMethod("String_Node_Str" + methodName.toLowerCase(),(Class[])null);
      }
      propertyValue=getMethod.invoke(dynaPropVal,(Object[])null);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
 else   if (dynaPropVal.getClass().isArray()) {
    propertyValue=dynaPropVal;
  }
 else {
    propertyValue=dynaPropVal;
  }
  return propertyValue;
}

Fixed version (ground truth):
public static Object convertProperty(Object dynaPropVal){
  Object propertyValue=null;
  Class propClass=dynaPropVal.getClass();
  String propName=propClass.getName();
  if (propName.indexOf("String_Node_Str") != -1) {
    String methodName=propName.substring(propName.indexOf("String_Node_Str") + "String_Node_Str".length());
    try {
      Method getMethod=null;
      try {
        getMethod=propClass.getMethod("String_Node_Str" + methodName,(Class[])null);
      }
 catch (      NoSuchMethodException nsme) {
        getMethod=propClass.getMethod("String_Node_Str" + methodName.toLowerCase(),(Class[])null);
      }
      propertyValue=getMethod.invoke(dynaPropVal,(Object[])null);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
 else   if (dynaPropVal.getClass().isArray()) {
    propertyValue=dynaPropVal;
  }
 else {
    propertyValue=dynaPropVal;
  }
  return propertyValue;
}
Program: 10580
Project: 10580
Buggy source:
/** 
 * Find a VM by its location on a datastore
 * @param datacenter The datacenter within which it searches.
 * @param dPath The datastore path, for example, "[storage1] WinXP/WinXP.vmx".
 * @return A VirtualMachine that pointed by the dPath
 * @throws RemoteException 
 * @throws RuntimeFault 
 * @throws InvalidDatastore 
 */
public VirtualMachine findByDatastorePath(Datacenter datacenter,String dPath) throws InvalidDatastore, RuntimeFault, RemoteException {
  if (datacenter == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ManagedObjectReference mor=getVimService().findByDatastorePath(getMOR(),datacenter.getMOR(),dPath);
  return new VirtualMachine(getServerConnection(),mor);
}

Fixed version (ground truth):
/** 
 * Find a VM by its location on a datastore
 * @param datacenter The datacenter within which it searches.
 * @param dPath The datastore path, for example, "[storage1] WinXP/WinXP.vmx".
 * @return A VirtualMachine that pointed by the dPath
 * @throws RemoteException 
 * @throws RuntimeFault 
 * @throws InvalidDatastore 
 */
public VirtualMachine findByDatastorePath(Datacenter datacenter,String dPath) throws InvalidDatastore, RuntimeFault, RemoteException {
  if (datacenter == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ManagedObjectReference mor=getVimService().findByDatastorePath(getMOR(),datacenter.getMOR(),dPath);
  return (VirtualMachine)MorUtil.createExactManagedEntity(getServerConnection(),mor);
}
Program: 10581
Project: 10581
Buggy source:
protected int adjustStoredItemCount(int amount,boolean notify){
  if (protoStack.isEmpty() || amount == 0)   return amount;
  if (amount > 0) {
    if (attrs.isUnlimitedVending())     return 0;
    int originalCount=count;
    count=Math.min(count + amount,getMaxCapacity());
    if (count != originalCount && notify)     onAmountChanged();
    if (attrs.isVoid())     return 0;
    return amount - (count - originalCount);
  }
 else {
    int originalCount=count;
    setStoredItemCount(originalCount + amount,notify);
    return amount - (count - originalCount);
  }
}

Fixed version (ground truth):
protected int adjustStoredItemCount(int amount,boolean notify){
  if (protoStack.isEmpty() || amount == 0)   return amount;
  if (amount > 0) {
    if (attrs.isUnlimitedVending())     return 0;
    int originalCount=count;
    count=Math.min(count + amount,getMaxCapacity());
    if (count != originalCount && notify)     onAmountChanged();
    if (attrs.isVoid())     return 0;
    return amount - (count - originalCount);
  }
 else {
    int originalCount=count;
    setStoredItemCount(originalCount + amount,notify);
    return -amount - (originalCount - count);
  }
}
Program: 10582
Project: 10582
Buggy source:
@Override public TileEntityDrawers createNewTileEntity(World world,int meta){
  IBlockState state=getStateFromMeta(meta);
  EnumBasicDrawer type=state.getValue(BLOCK);
  return new TileEntityDrawersStandard(type.getDrawerCount());
}

Fixed version (ground truth):
@Override public TileEntityDrawers createNewTileEntity(World world,int meta){
  IBlockState state=getStateFromMeta(meta);
  EnumBasicDrawer type=state.getValue(BLOCK);
  return TileEntityDrawersStandard.createEntity(type.getDrawerCount());
}
Program: 10583
Project: 10583
Buggy source:
public int putItemsIntoSlot(int slot,@Nonnull ItemStack stack,int count){
  IDrawer drawer=getGroup().getDrawer(slot);
  if (!drawer.isEnabled())   return 0;
  if (drawer.isEmpty())   drawer.setStoredItem(stack);
  if (!drawer.canItemBeStored(stack))   return 0;
  int countAdded=Math.min(count,stack.getCount());
  if (!drawerAttributes.isVoid())   countAdded=Math.min(countAdded,drawer.getRemainingCapacity());
  drawer.setStoredItemCount(drawer.getStoredItemCount() + countAdded);
  stack.shrink(countAdded);
  return countAdded;
}

Fixed version (ground truth):
public int putItemsIntoSlot(int slot,@Nonnull ItemStack stack,int count){
  IDrawer drawer=getGroup().getDrawer(slot);
  if (!drawer.isEnabled())   return 0;
  if (drawer.isEmpty())   drawer=drawer.setStoredItem(stack);
  if (!drawer.canItemBeStored(stack))   return 0;
  int countAdded=Math.min(count,stack.getCount());
  if (!drawerAttributes.isVoid())   countAdded=Math.min(countAdded,drawer.getRemainingCapacity());
  drawer.setStoredItemCount(drawer.getStoredItemCount() + countAdded);
  stack.shrink(countAdded);
  return countAdded;
}
Program: 10584
Project: 10584
Buggy source:
@SideOnly(Side.CLIENT) private void clientUpdateCountAsync(int slot,int count){
  IDrawer drawer=getDrawer(slot);
  if (!drawer.isEnabled() && drawer.getStoredItemCount() != count)   drawer.setStoredItemCount(count);
}

Fixed version (ground truth):
@SideOnly(Side.CLIENT) private void clientUpdateCountAsync(int slot,int count){
  IDrawer drawer=getDrawer(slot);
  if (drawer.isEnabled() && drawer.getStoredItemCount() != count)   drawer.setStoredItemCount(count);
}
Program: 10585
Project: 10585
Buggy source:
@Override protected IDrawerGroup getGroup(){
  return groupData;
}

Fixed version (ground truth):
@Override protected IDrawerGroup getGroup(){
  return null;
}
Program: 10586
Project: 10586
Buggy source:
private void populateSlots(@Nonnull ItemStack itemPrototype){
  World world=group.getWorld();
  if (world == null) {
    protoStack[0]=itemPrototype;
    convRate[0]=1;
    return;
  }
  CompactingHelper compacting=new CompactingHelper(world);
  Stack<CompactingHelper.Result> resultStack=new Stack<>();
  @Nonnull ItemStack lookupTarget=itemPrototype;
  for (int i=0; i < slotCount; i++) {
    CompactingHelper.Result lookup=compacting.findHigherTier(lookupTarget);
    if (lookup.getStack().isEmpty())     break;
    resultStack.push(lookup);
    lookupTarget=lookup.getStack();
  }
  int index=0;
  for (int n=resultStack.size(); index < n; index++) {
    CompactingHelper.Result result=resultStack.pop();
    populateRawSlot(index,result.getStack(),result.getSize());
    group.log("String_Node_Str" + result.getStack().toString() + "String_Node_Str"+ result.getSize());
    for (int i=0; i < index - 1; i++)     convRate[i]*=result.getSize();
  }
  if (index == slotCount)   return;
  populateRawSlot(index,itemPrototype,1);
  lookupTarget=itemPrototype;
  for (; index < slotCount; index++) {
    CompactingHelper.Result lookup=compacting.findLowerTier(lookupTarget);
    if (lookup.getStack().isEmpty())     break;
    populateRawSlot(index,lookup.getStack(),lookup.getSize());
    group.log("String_Node_Str" + lookup.getStack().toString() + "String_Node_Str"+ lookup.getSize());
    for (int i=0; i < index - 1; i++)     convRate[i]*=lookup.getSize();
    lookupTarget=lookup.getStack();
  }
}

Fixed version (ground truth):
private void populateSlots(@Nonnull ItemStack itemPrototype){
  World world=group.getWorld();
  if (world == null) {
    protoStack[0]=itemPrototype;
    convRate[0]=1;
    return;
  }
  CompactingHelper compacting=new CompactingHelper(world);
  Stack<CompactingHelper.Result> resultStack=new Stack<>();
  @Nonnull ItemStack lookupTarget=itemPrototype;
  for (int i=0; i < slotCount; i++) {
    CompactingHelper.Result lookup=compacting.findHigherTier(lookupTarget);
    if (lookup.getStack().isEmpty())     break;
    resultStack.push(lookup);
    lookupTarget=lookup.getStack();
  }
  int index=0;
  for (int n=resultStack.size(); index < n; index++) {
    CompactingHelper.Result result=resultStack.pop();
    populateRawSlot(index,result.getStack(),result.getSize());
    group.log("String_Node_Str" + result.getStack().toString() + "String_Node_Str"+ result.getSize());
    for (int i=0; i < index - 1; i++)     convRate[i]*=result.getSize();
  }
  if (index == slotCount)   return;
  populateRawSlot(index++,itemPrototype,1);
  lookupTarget=itemPrototype;
  for (; index < slotCount; index++) {
    CompactingHelper.Result lookup=compacting.findLowerTier(lookupTarget);
    if (lookup.getStack().isEmpty())     break;
    populateRawSlot(index,lookup.getStack(),1);
    group.log("String_Node_Str" + lookup.getStack().toString() + "String_Node_Str"+ lookup.getSize());
    for (int i=0; i < index; i++)     convRate[i]*=lookup.getSize();
    lookupTarget=lookup.getStack();
  }
}
Program: 10587
Project: 10587
Buggy source:
@Override public NBTTagCompound writeToNBT(NBTTagCompound tag){
  NBTTagList itemList=new NBTTagList();
  for (  DrawerData slot : slots)   itemList.appendTag(slot.serializeNBT());
  tag.setTag("String_Node_Str",itemList);
  return tag;
}

Fixed version (ground truth):
@Override public NBTTagCompound writeToNBT(NBTTagCompound tag){
  if (slots == null)   return tag;
  NBTTagList itemList=new NBTTagList();
  for (  DrawerData slot : slots)   itemList.appendTag(slot.serializeNBT());
  tag.setTag("String_Node_Str",itemList);
  return tag;
}
Program: 10588
Project: 10588
Buggy source:
@Override public void readFromNBT(NBTTagCompound tag){
  deserializeNBT(tag);
}

Fixed version (ground truth):
@Override public void readFromNBT(NBTTagCompound tag){
  for (int i=0; i < upgrades.length; i++)   upgrades[i]=ItemStack.EMPTY;
  if (!tag.hasKey("String_Node_Str"))   return;
  NBTTagList tagList=tag.getTagList("String_Node_Str",Constants.NBT.TAG_COMPOUND);
  for (int i=0; i < tagList.tagCount(); i++) {
    NBTTagCompound upgradeTag=tagList.getCompoundTagAt(i);
    int slot=upgradeTag.getByte("String_Node_Str");
    upgrades[slot]=new ItemStack(upgradeTag);
  }
  syncUpgrades();
}
Program: 10589
Project: 10589
Buggy source:
@Override public NBTTagCompound writeToNBT(NBTTagCompound tag){
  NBTTagCompound stag=serializeNBT();
  tag.setTag("String_Node_Str",stag.getCompoundTag("String_Node_Str"));
  return tag;
}

Fixed version (ground truth):
@Override public NBTTagCompound writeToNBT(NBTTagCompound tag){
  NBTTagList tagList=new NBTTagList();
  for (int i=0; i < upgrades.length; i++) {
    if (!upgrades[i].isEmpty()) {
      NBTTagCompound upgradeTag=upgrades[i].writeToNBT(new NBTTagCompound());
      upgradeTag.setByte("String_Node_Str",(byte)i);
      tagList.appendTag(upgradeTag);
    }
  }
  tag.setTag("String_Node_Str",tagList);
  return tag;
}
Program: 10591
Project: 10591
Buggy source:
@Nonnull private ItemStack insertItemInternal(int slot,@Nonnull ItemStack stack,boolean simulate){
  IDrawer drawer=group.getDrawer(slot);
  if (!drawer.isEnabled() || !drawer.canItemBeStored(stack))   return stack;
  int availableCount=drawer.isEmpty() ? drawer.getMaxCapacity(stack) : drawer.getRemainingCapacity();
  IDrawerAttributes attrs=capProvider.getCapability(DRAWER_ATTRIBUTES_CAPABILITY,null);
  if (attrs != null && attrs.isVoid())   availableCount=Integer.MAX_VALUE;
  int stackSize=stack.getCount();
  int insertCount=Math.min(stackSize,availableCount);
  int remainder=stackSize - insertCount;
  if (remainder == stackSize)   return stack;
  if (!simulate) {
    if (drawer.isEmpty())     drawer.setStoredItem(stack);
    drawer.setStoredItemCount(drawer.getStoredItemCount() + insertCount);
  }
  if (remainder == 0)   return ItemStack.EMPTY;
  ItemStack returnStack=stack.copy();
  returnStack.setCount(remainder);
  return returnStack;
}

Fixed version (ground truth):
@Nonnull private ItemStack insertItemInternal(int slot,@Nonnull ItemStack stack,boolean simulate){
  IDrawer drawer=group.getDrawer(slot);
  if (!drawer.isEnabled() || !drawer.canItemBeStored(stack))   return stack;
  int availableCount=drawer.isEmpty() ? drawer.getMaxCapacity(stack) : drawer.getRemainingCapacity();
  IDrawerAttributes attrs=capProvider.getCapability(DRAWER_ATTRIBUTES_CAPABILITY,null);
  if (attrs != null && attrs.isVoid())   availableCount=Integer.MAX_VALUE;
  int stackSize=stack.getCount();
  int insertCount=Math.min(stackSize,availableCount);
  int remainder=stackSize - insertCount;
  if (remainder == stackSize)   return stack;
  if (!simulate) {
    if (drawer.isEmpty())     drawer=drawer.setStoredItem(stack);
    drawer.setStoredItemCount(drawer.getStoredItemCount() + insertCount);
  }
  if (remainder == 0)   return ItemStack.EMPTY;
  ItemStack returnStack=stack.copy();
  returnStack.setCount(remainder);
  return returnStack;
}
Program: 10592
Project: 10592
Buggy source:
@Override public void putStack(@Nonnull ItemStack stack){
  drawer.setStoredItem(stack);
  if (!ItemStackHelper.isStackEncoded(stack))   drawer.setStoredItemCount(stack.getCount());
}

Fixed version (ground truth):
@Override public void putStack(@Nonnull ItemStack stack){
  IDrawer target=drawer.setStoredItem(stack);
  if (!ItemStackHelper.isStackEncoded(stack))   target.setStoredItemCount(stack.getCount());
}
Program: 10594
Project: 10594
Buggy source:
@Override public int getDrawerCapacity(){
  if (capacity == 0) {
    ConfigManager config=StorageDrawers.config;
    capacity=config.getBlockBaseStorage("String_Node_Str");
    if (capacity <= 0)     capacity=1;
    attributeChanged();
  }
  return capacity;
}

Fixed version (ground truth):
@Override public int getDrawerCapacity(){
  if (world == null || world.isRemote)   return super.getDrawerCapacity();
  if (capacity == 0) {
    ConfigManager config=StorageDrawers.config;
    capacity=config.getBlockBaseStorage("String_Node_Str");
    if (capacity <= 0)     capacity=1;
    attributeChanged();
  }
  return capacity;
}
Program: 10595
Project: 10595
Buggy source:
@Override public int getDrawerCapacity(){
  if (capacity == 0) {
    if (world == null)     return 1;
    IBlockState blockState=world.getBlockState(this.pos);
    if (!blockState.getPropertyKeys().contains(BlockStandardDrawers.BLOCK))     return 1;
    EnumBasicDrawer type=blockState.getValue(BlockStandardDrawers.BLOCK);
    ConfigManager config=StorageDrawers.config;
switch (type) {
case FULL1:
      capacity=config.getBlockBaseStorage("String_Node_Str");
    break;
case FULL2:
  capacity=config.getBlockBaseStorage("String_Node_Str");
break;
case FULL4:
capacity=config.getBlockBaseStorage("String_Node_Str");
break;
case HALF2:
capacity=config.getBlockBaseStorage("String_Node_Str");
break;
case HALF4:
capacity=config.getBlockBaseStorage("String_Node_Str");
break;
default :
capacity=1;
}
if (capacity <= 0) capacity=1;
attributeChanged();
}
return capacity;
}

Fixed version (ground truth):
@Override public int getDrawerCapacity(){
  if (world == null || world.isRemote)   return super.getDrawerCapacity();
  if (capacity == 0) {
    IBlockState blockState=world.getBlockState(this.pos);
    if (!blockState.getPropertyKeys().contains(BlockStandardDrawers.BLOCK))     return 1;
    EnumBasicDrawer type=blockState.getValue(BlockStandardDrawers.BLOCK);
    ConfigManager config=StorageDrawers.config;
switch (type) {
case FULL1:
      capacity=config.getBlockBaseStorage("String_Node_Str");
    break;
case FULL2:
  capacity=config.getBlockBaseStorage("String_Node_Str");
break;
case FULL4:
capacity=config.getBlockBaseStorage("String_Node_Str");
break;
case HALF2:
capacity=config.getBlockBaseStorage("String_Node_Str");
break;
case HALF4:
capacity=config.getBlockBaseStorage("String_Node_Str");
break;
default :
capacity=1;
}
if (capacity <= 0) capacity=1;
attributeChanged();
}
return capacity;
}
Program: 10597
Project: 10597
Buggy source:
@Nullable @Override @SuppressWarnings("String_Node_Str") public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState,World worldIn,BlockPos pos){
  return NULL_AABB;
}

Fixed version (ground truth):
@Nullable @Override @SuppressWarnings("String_Node_Str") public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState,IBlockAccess worldIn,BlockPos pos){
  return NULL_AABB;
}
Program: 10598
Project: 10598
Buggy source:
@Override public boolean onBlockActivated(World worldIn,BlockPos pos,IBlockState state,EntityPlayer playerIn,EnumHand hand,@Nullable ItemStack heldItem,EnumFacing side,float hitX,float hitY,float hitZ){
  state=getActualState(state,worldIn,pos);
  if (state.getValue(POWERED))   return true;
  TileEntityKeyButton tile=getTileEntity(worldIn,pos);
  if (tile != null)   tile.setPowered(true);
  worldIn.setBlockState(pos,state.withProperty(POWERED,true),3);
  worldIn.markBlockRangeForRenderUpdate(pos,pos);
  worldIn.playSound(playerIn,pos,SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON,SoundCategory.BLOCKS,0.3F,0.6F);
  notifyNeighbors(worldIn,pos,state.getValue(FACING));
  worldIn.scheduleUpdate(pos,this,tickRate(worldIn));
  BlockPos targetPos=pos.offset(state.getValue(FACING).getOpposite());
  Block target=worldIn.getBlockState(targetPos).getBlock();
  if (target instanceof BlockController) {
    BlockController controller=(BlockController)target;
    controller.toggle(worldIn,targetPos,playerIn,state.getValue(VARIANT));
  }
 else   if (target instanceof BlockSlave) {
    BlockSlave slave=(BlockSlave)target;
    slave.toggle(worldIn,targetPos,playerIn,state.getValue(VARIANT));
  }
  return super.onBlockActivated(worldIn,pos,state,playerIn,hand,heldItem,side,hitX,hitY,hitZ);
}

Fixed version (ground truth):
@Override public boolean onBlockActivated(World worldIn,BlockPos pos,IBlockState state,EntityPlayer playerIn,EnumHand hand,EnumFacing side,float hitX,float hitY,float hitZ){
  state=getActualState(state,worldIn,pos);
  if (state.getValue(POWERED))   return true;
  TileEntityKeyButton tile=getTileEntity(worldIn,pos);
  if (tile != null)   tile.setPowered(true);
  worldIn.setBlockState(pos,state.withProperty(POWERED,true),3);
  worldIn.markBlockRangeForRenderUpdate(pos,pos);
  worldIn.playSound(playerIn,pos,SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON,SoundCategory.BLOCKS,0.3F,0.6F);
  notifyNeighbors(worldIn,pos,state.getValue(FACING));
  worldIn.scheduleUpdate(pos,this,tickRate(worldIn));
  BlockPos targetPos=pos.offset(state.getValue(FACING).getOpposite());
  Block target=worldIn.getBlockState(targetPos).getBlock();
  if (target instanceof BlockController) {
    BlockController controller=(BlockController)target;
    controller.toggle(worldIn,targetPos,playerIn,state.getValue(VARIANT));
  }
 else   if (target instanceof BlockSlave) {
    BlockSlave slave=(BlockSlave)target;
    slave.toggle(worldIn,targetPos,playerIn,state.getValue(VARIANT));
  }
  return super.onBlockActivated(worldIn,pos,state,playerIn,hand,side,hitX,hitY,hitZ);
}
Program: 10599
Project: 10599
Buggy source:
@Override public void getSubBlocks(Item item,CreativeTabs tab,List<ItemStack> list){
  for (  EnumKeyType type : EnumKeyType.values()) {
    list.add(new ItemStack(item,1,type.getMetadata()));
  }
}

Fixed version (ground truth):
@Override public void getSubBlocks(Item item,CreativeTabs tab,NonNullList<ItemStack> list){
  for (  EnumKeyType type : EnumKeyType.values()) {
    list.add(new ItemStack(item,1,type.getMetadata()));
  }
}
Program: 10600
Project: 10600
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public void neighborChanged(IBlockState state,World worldIn,BlockPos pos,Block blockIn){
  state=getActualState(state,worldIn,pos);
  if (checkForDrop(worldIn,pos,state) && !canPlaceBlock(worldIn,pos,state.getValue(FACING).getOpposite())) {
    dropBlockAsItem(worldIn,pos,state,0);
    worldIn.setBlockToAir(pos);
  }
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public void neighborChanged(IBlockState state,World worldIn,BlockPos pos,Block blockIn,BlockPos fromPos){
  state=getActualState(state,worldIn,pos);
  if (checkForDrop(worldIn,pos,state) && !canPlaceBlock(worldIn,pos,state.getValue(FACING).getOpposite())) {
    dropBlockAsItem(worldIn,pos,state,0);
    worldIn.setBlockToAir(pos);
  }
}
Program: 10601
Project: 10601
Buggy source:
public BlockKeyButton(String blockName){
  super(Material.CIRCUITS);
  setHardness(5);
  setUnlocalizedName(blockName);
  setRegistryName(blockName);
  setSoundType(SoundType.STONE);
  setCreativeTab(ModCreativeTabs.tabStorageDrawers);
  setTickRandomly(true);
  setDefaultState(blockState.getBaseState().withProperty(FACING,EnumFacing.NORTH).withProperty(POWERED,false).withProperty(VARIANT,EnumKeyType.DRAWER));
}

Fixed version (ground truth):
public BlockKeyButton(String registryName,String blockName){
  super(Material.CIRCUITS);
  setHardness(5);
  setUnlocalizedName(blockName);
  setRegistryName(registryName);
  setSoundType(SoundType.STONE);
  setCreativeTab(ModCreativeTabs.tabStorageDrawers);
  setTickRandomly(true);
  setDefaultState(blockState.getBaseState().withProperty(FACING,EnumFacing.NORTH).withProperty(POWERED,false).withProperty(VARIANT,EnumKeyType.DRAWER));
}
Program: 10602
Project: 10602
Buggy source:
@Override public IBlockState getStateForPlacement(World world,BlockPos pos,EnumFacing facing,float hitX,float hitY,float hitZ,int meta,EntityLivingBase placer,ItemStack stack){
  if (canPlaceBlock(world,pos,facing.getOpposite()))   return getStateFromMeta(meta).withProperty(FACING,facing).withProperty(POWERED,false);
  return getStateFromMeta(meta).withProperty(FACING,EnumFacing.DOWN).withProperty(POWERED,false);
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public IBlockState getStateForPlacement(World world,BlockPos pos,EnumFacing facing,float hitX,float hitY,float hitZ,int meta,EntityLivingBase placer){
  if (canPlaceBlock(world,pos,facing.getOpposite()))   return getStateFromMeta(meta).withProperty(FACING,facing).withProperty(POWERED,false);
  return getStateFromMeta(meta).withProperty(FACING,EnumFacing.DOWN).withProperty(POWERED,false);
}
Program: 10603
Project: 10603
Buggy source:
private void notifyNeighbors(World worldIn,BlockPos pos,EnumFacing facing){
  worldIn.notifyNeighborsOfStateChange(pos,this);
  worldIn.notifyNeighborsOfStateChange(pos.offset(facing.getOpposite()),this);
}

Fixed version (ground truth):
private void notifyNeighbors(World worldIn,BlockPos pos,EnumFacing facing){
  worldIn.notifyNeighborsOfStateChange(pos,this,false);
  worldIn.notifyNeighborsOfStateChange(pos.offset(facing.getOpposite()),this,false);
}
Program: 10604
Project: 10604
Buggy source:
@Override public void onBlockPlacedBy(World worldIn,BlockPos pos,IBlockState state,EntityLivingBase placer,ItemStack stack){
  TileEntityKeyButton tile=getTileEntity(worldIn,pos);
  if (tile != null)   tile.setDirection(state.getValue(FACING));
  super.onBlockPlacedBy(worldIn,pos,state,placer,stack);
}

Fixed version (ground truth):
@Override public void onBlockPlacedBy(World worldIn,BlockPos pos,IBlockState state,EntityLivingBase placer,@Nonnull ItemStack stack){
  TileEntityKeyButton tile=getTileEntity(worldIn,pos);
  if (tile != null)   tile.setDirection(state.getValue(FACING));
  super.onBlockPlacedBy(worldIn,pos,state,placer,stack);
}
Program: 10605
Project: 10605
Buggy source:
public boolean canAddUpgrade(ItemStack upgrade){
  if (upgrade == null)   return false;
  if (!(upgrade.getItem() instanceof ItemUpgrade))   return false;
  ItemUpgrade candidate=(ItemUpgrade)upgrade.getItem();
  if (candidate.getAllowMultiple())   return true;
  for (  ItemStack stack : upgrades) {
    if (stack == null)     continue;
    if (!(stack.getItem() instanceof ItemUpgrade))     continue;
    ItemUpgrade reference=(ItemUpgrade)stack.getItem();
    if (candidate == reference)     return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean canAddUpgrade(@Nonnull ItemStack upgrade){
  if (upgrade.isEmpty())   return false;
  if (!(upgrade.getItem() instanceof ItemUpgrade))   return false;
  ItemUpgrade candidate=(ItemUpgrade)upgrade.getItem();
  if (candidate.getAllowMultiple())   return true;
  for (  ItemStack stack : upgrades) {
    if (stack.isEmpty())     continue;
    if (!(stack.getItem() instanceof ItemUpgrade))     continue;
    ItemUpgrade reference=(ItemUpgrade)stack.getItem();
    if (candidate == reference)     return false;
  }
  return true;
}
Program: 10606
Project: 10606
Buggy source:
public int getEffectiveDrawerCapacity(){
  for (  ItemStack upgrade : upgrades) {
    if (upgrade != null && upgrade.getItem() == ModItems.upgradeOneStack)     return 1;
  }
  return getDrawerCapacity();
}

Fixed version (ground truth):
public int getEffectiveDrawerCapacity(){
  for (  ItemStack upgrade : upgrades) {
    if (!upgrade.isEmpty() && upgrade.getItem() == ModItems.upgradeOneStack)     return 1;
  }
  return getDrawerCapacity();
}
Program: 10607
Project: 10607
Buggy source:
@Override public boolean isItemValid(ItemStack stack){
  if (stack == null)   return false;
  if (inventory instanceof InventoryUpgrade) {
    if (!((InventoryUpgrade)inventory).canAddUpgrade(stack))     return false;
    if (stack.getItem() == ModItems.upgradeOneStack)     return ((InventoryUpgrade)inventory).canAddOneStackUpgrade();
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isItemValid(@Nonnull ItemStack stack){
  if (stack.isEmpty())   return false;
  if (inventory instanceof InventoryUpgrade) {
    if (!((InventoryUpgrade)inventory).canAddUpgrade(stack))     return false;
    if (stack.getItem() == ModItems.upgradeOneStack)     return ((InventoryUpgrade)inventory).canAddOneStackUpgrade();
    return true;
  }
  return false;
}
Program: 10608
Project: 10608
Buggy source:
@Nullable @Override public Object apply(@Nullable Object input){
  ItemStack stack=(ItemStack)input;
  return EnumKeyType.byMetadata(stack.getMetadata()).getName();
}

Fixed version (ground truth):
@Override @Nonnull public String apply(@Nonnull ItemStack input){
  return EnumKeyType.byMetadata(input.getMetadata()).getName();
}
Program: 10609
Project: 10609
Buggy source:
public ItemKeyButton(Block block){
  super(block,block,new Function(){
    @Nullable @Override public Object apply(    @Nullable Object input){
      ItemStack stack=(ItemStack)input;
      return EnumKeyType.byMetadata(stack.getMetadata()).getName();
    }
  }
);
  setHasSubtypes(true);
}

Fixed version (ground truth):
public ItemKeyButton(Block block){
  super(block,block,new Mapper(){
    @Override @Nonnull public String apply(    @Nonnull ItemStack input){
      return EnumKeyType.byMetadata(input.getMetadata()).getName();
    }
  }
);
  setHasSubtypes(true);
}
Program: 10610
Project: 10610
Buggy source:
@Override public String getUnlocalizedName(ItemStack itemStack){
  return super.getUnlocalizedName() + "String_Node_Str" + EnumKeyType.byMetadata(itemStack.getMetadata()).getName();
}

Fixed version (ground truth):
@Override public String getUnlocalizedName(@Nonnull ItemStack itemStack){
  return super.getUnlocalizedName() + "String_Node_Str" + EnumKeyType.byMetadata(itemStack.getMetadata()).getName();
}
Program: 10611
Project: 10611
Buggy source:
@Override public boolean doesSideBlockRendering(IBlockState state,IBlockAccess world,BlockPos pos,EnumFacing face){
  TileEntityDrawers tile=getTileEntity(world,pos);
  if (tile != null && tile.getEffectiveMaterialSide() == null)   return false;
  return super.doesSideBlockRendering(state,world,pos,face);
}

Fixed version (ground truth):
@Override public boolean doesSideBlockRendering(IBlockState state,IBlockAccess world,BlockPos pos,EnumFacing face){
  TileEntityDrawers tile=getTileEntity(world,pos);
  if (tile != null && tile.getEffectiveMaterialSide().isEmpty())   return false;
  return super.doesSideBlockRendering(state,world,pos,face);
}
Program: 10612
Project: 10612
Buggy source:
@Override @Nonnull protected ItemStack getMainDrop(IBlockAccess world,BlockPos pos,IBlockState state){
  TileEntityDrawers tile=getTileEntity(world,pos);
  if (tile == null)   return ItemCustomDrawers.makeItemStack(state,1,ItemStack.EMPTY,ItemStack.EMPTY,ItemStack.EMPTY);
  ItemStack drop=ItemCustomDrawers.makeItemStack(state,1,tile.getMaterialSide(),tile.getMaterialTrim(),tile.getMaterialFront());
  if (drop == null)   return null;
  NBTTagCompound data=drop.getTagCompound();
  if (data == null)   data=new NBTTagCompound();
  if (tile.isSealed()) {
    NBTTagCompound tiledata=new NBTTagCompound();
    tile.writeToNBT(tiledata);
    data.setTag("String_Node_Str",tiledata);
  }
  drop.setTagCompound(data);
  return drop;
}

Fixed version (ground truth):
@Override @Nonnull protected ItemStack getMainDrop(IBlockAccess world,BlockPos pos,IBlockState state){
  TileEntityDrawers tile=getTileEntity(world,pos);
  if (tile == null)   return ItemCustomDrawers.makeItemStack(state,1,ItemStack.EMPTY,ItemStack.EMPTY,ItemStack.EMPTY);
  ItemStack drop=ItemCustomDrawers.makeItemStack(state,1,tile.getMaterialSide(),tile.getMaterialTrim(),tile.getMaterialFront());
  if (drop.isEmpty())   return ItemStack.EMPTY;
  NBTTagCompound data=drop.getTagCompound();
  if (data == null)   data=new NBTTagCompound();
  if (tile.isSealed()) {
    NBTTagCompound tiledata=new NBTTagCompound();
    tile.writeToNBT(tiledata);
    data.setTag("String_Node_Str",tiledata);
  }
  drop.setTagCompound(data);
  return drop;
}
Program: 10613
Project: 10613
Buggy source:
public BlockPos getControllerPos(){
  return controllerCoord;
}

Fixed version (ground truth):
public BlockPos getControllerPos(){
  return controllerData.getCoord();
}
Program: 10614
Project: 10614
Buggy source:
private static void spawnItemStack(World world,double x,double y,double z,ItemStack stack){
  float xOff=RANDOM.nextFloat() * 0.8F + 0.1F;
  float yOff=RANDOM.nextFloat() * 0.8F + 0.1F;
  float zOff=RANDOM.nextFloat() * 0.8F + 0.1F;
  int stackSize=stack.getCount();
  while (stackSize > 0) {
    int dropAmt=RANDOM.nextInt(21) + 10;
    if (dropAmt > stackSize)     dropAmt=stackSize;
    stack.shrink(dropAmt);
    stackSize=stack.getCount();
    EntityItem entityitem=new EntityItem(world,x + (double)xOff,y + (double)yOff,z + (double)zOff,new ItemStack(stack.getItem(),dropAmt,stack.getMetadata()));
    if (stack.hasTagCompound())     entityitem.getEntityItem().setTagCompound(stack.getTagCompound().copy());
    float velocity=0.05F;
    entityitem.motionX=RANDOM.nextGaussian() * (double)velocity;
    entityitem.motionY=RANDOM.nextGaussian() * (double)velocity + 0.20000000298023224D;
    entityitem.motionZ=RANDOM.nextGaussian() * (double)velocity;
    world.spawnEntity(entityitem);
  }
}

Fixed version (ground truth):
private static void spawnItemStack(World world,double x,double y,double z,ItemStack stack){
  float xOff=RANDOM.nextFloat() * 0.8F + 0.1F;
  float yOff=RANDOM.nextFloat() * 0.8F + 0.1F;
  float zOff=RANDOM.nextFloat() * 0.8F + 0.1F;
  while (!stack.isEmpty()) {
    EntityItem entityitem=new EntityItem(world,x + xOff,y + yOff,z + zOff,stack.splitStack(RANDOM.nextInt(21) + 10));
    float velocity=0.05F;
    entityitem.motionX=RANDOM.nextGaussian() * (double)velocity;
    entityitem.motionY=RANDOM.nextGaussian() * (double)velocity + 0.20000000298023224D;
    entityitem.motionZ=RANDOM.nextGaussian() * (double)velocity;
    world.spawnEntity(entityitem);
  }
}
Program: 10615
Project: 10615
Buggy source:
public static void dropInventoryItems(World world,BlockPos pos,IDrawerGroup group){
  for (int i=0; i < group.getDrawerCount(); i++) {
    IDrawer drawer=group.getDrawerIfEnabled(i);
    if (drawer == null)     continue;
    while (drawer.getStoredItemCount() > 0) {
      ItemStack stack=drawer.getStoredItemPrototype().copy();
      stack.setCount(drawer.getStoredItemCount());
      if (!stack.isEmpty())       break;
      spawnItemStack(world,pos.getX(),pos.getY(),pos.getZ(),stack);
      drawer.setStoredItemCount(0);
    }
  }
}

Fixed version (ground truth):
public static void dropInventoryItems(World world,BlockPos pos,IDrawerGroup group){
  for (int i=0; i < group.getDrawerCount(); i++) {
    IDrawer drawer=group.getDrawerIfEnabled(i);
    if (drawer == null)     continue;
    while (drawer.getStoredItemCount() > 0) {
      ItemStack stack=drawer.getStoredItemPrototype().copy();
      stack.setCount(drawer.getStoredItemCount());
      if (stack.isEmpty())       break;
      spawnItemStack(world,pos.getX(),pos.getY(),pos.getZ(),stack);
      drawer.setStoredItemCount(0);
    }
  }
}
Program: 10616
Project: 10616
Buggy source:
public boolean isLocked(int slot,LockAttribute attr);

Fixed version (ground truth):
boolean isLocked(int slot,LockAttribute attr);
Program: 10617
Project: 10617
Buggy source:
public boolean isStorageUnlimited(int slot);

Fixed version (ground truth):
boolean isStorageUnlimited(int slot);
Program: 10618
Project: 10618
Buggy source:
private void populateSlot(int slot,ItemStack stack,int conversion){
  convRate[slot]=conversion;
  protoStack[slot]=stack.copy();
}

Fixed version (ground truth):
private void populateSlot(int slot,ItemStack stack,int conversion){
  convRate[slot]=conversion;
  protoStack[slot]=stack.copy();
  if (worldObj != null && !worldObj.isRemote) {
    IBlockState state=worldObj.getBlockState(getPos());
    worldObj.notifyBlockUpdate(getPos(),state,state,3);
  }
}
Program: 10619
Project: 10619
Buggy source:
@Override public AxisAlignedBB getBoundingBox(IBlockState state,IBlockAccess blockAccess,BlockPos pos){
  if (isHalfDepth(state)) {
switch (state.getValue(FACING)) {
case NORTH:
      return AABB_NORTH_HALF;
case SOUTH:
    return AABB_SOUTH_HALF;
case WEST:
  return AABB_WEST_HALF;
case EAST:
return AABB_EAST_HALF;
}
}
return FULL_BLOCK_AABB;
}

Fixed version (ground truth):
@Override public AxisAlignedBB getBoundingBox(IBlockState state,IBlockAccess blockAccess,BlockPos pos){
  TileEntityDrawers tile=getTileEntity(blockAccess,pos);
  if (tile != null && isHalfDepth(state)) {
switch (EnumFacing.getFront(tile.getDirection())) {
case NORTH:
      return AABB_NORTH_HALF;
case SOUTH:
    return AABB_SOUTH_HALF;
case WEST:
  return AABB_WEST_HALF;
case EAST:
return AABB_EAST_HALF;
}
}
return FULL_BLOCK_AABB;
}
Program: 10620
Project: 10620
Buggy source:
@Override public boolean removedByPlayer(IBlockState state,World world,BlockPos pos,EntityPlayer player,boolean willHarvest){
  if (world.isRemote && player.capabilities.isCreativeMode) {
    RayTraceResult ray=Minecraft.getMinecraft().objectMouseOver;
    if (state.getValue(FACING) == ray.sideHit) {
      onBlockClicked(world,pos,player);
      return false;
    }
  }
  return willHarvest || super.removedByPlayer(state,world,pos,player,false);
}

Fixed version (ground truth):
@Override public boolean removedByPlayer(IBlockState state,World world,BlockPos pos,EntityPlayer player,boolean willHarvest){
  if (world.isRemote && player.capabilities.isCreativeMode) {
    RayTraceResult ray=Minecraft.getMinecraft().objectMouseOver;
    if (getDirection(world,pos) == ray.sideHit) {
      onBlockClicked(world,pos,player);
      return false;
    }
  }
  return willHarvest || super.removedByPlayer(state,world,pos,player,false);
}
Program: 10621
Project: 10621
Buggy source:
@Override @SideOnly(Side.CLIENT) public boolean addHitEffects(IBlockState state,World worldObj,RayTraceResult target,EffectRenderer effectRenderer){
  if (state.getValue(FACING) == target.sideHit)   return true;
  return super.addHitEffects(state,worldObj,target,effectRenderer);
}

Fixed version (ground truth):
@Override @SideOnly(Side.CLIENT) public boolean addHitEffects(IBlockState state,World worldObj,RayTraceResult target,EffectRenderer effectRenderer){
  if (getDirection(worldObj,target.getBlockPos()) == target.sideHit)   return true;
  return super.addHitEffects(state,worldObj,target,effectRenderer);
}
Program: 10622
Project: 10622
Buggy source:
@Override public ItemStack decrStackSize(int slot,int count){
  if (tableItemStacks[slot] != null) {
    if (tableItemStacks[slot].stackSize <= count) {
      ItemStack stack=tableItemStacks[slot];
      tableItemStacks[slot]=null;
      markDirty();
      return stack;
    }
 else {
      ItemStack stack=tableItemStacks[slot].splitStack(slot);
      if (tableItemStacks[slot].stackSize == 0)       tableItemStacks[slot]=null;
      markDirty();
      return stack;
    }
  }
 else   return null;
}

Fixed version (ground truth):
@Override public ItemStack decrStackSize(int slot,int count){
  if (tableItemStacks[slot] != null) {
    if (tableItemStacks[slot].stackSize <= count) {
      ItemStack stack=tableItemStacks[slot];
      tableItemStacks[slot]=null;
      markDirty();
      return stack;
    }
 else {
      ItemStack stack=tableItemStacks[slot].splitStack(count);
      if (tableItemStacks[slot].stackSize == 0)       tableItemStacks[slot]=null;
      markDirty();
      return stack;
    }
  }
 else   return null;
}
Program: 10623
Project: 10623
Buggy source:
@Override public void toBytes(ByteBuf buf){
  buf.writeInt(x);
  buf.writeShort(y);
  buf.writeInt(z);
  buf.writeByte(side);
  buf.writeByte((int)(hitX * 16));
  buf.writeByte((int)(hitY * 16));
  buf.writeByte((int)(hitZ * 16));
  buf.writeBoolean(invertShift);
}

Fixed version (ground truth):
@Override public void toBytes(ByteBuf buf){
  buf.writeInt(x);
  buf.writeShort(y);
  buf.writeInt(z);
  buf.writeByte(side);
  buf.writeFloat(hitX);
  buf.writeFloat(hitY);
  buf.writeFloat(hitZ);
  buf.writeBoolean(invertShift);
}
Program: 10624
Project: 10624
Buggy source:
@Override public void fromBytes(ByteBuf buf){
  x=buf.readInt();
  y=buf.readShort();
  z=buf.readInt();
  side=buf.readByte();
  hitX=buf.readByte() / 16f;
  hitY=buf.readByte() / 16f;
  hitZ=buf.readByte() / 16f;
  invertShift=buf.readBoolean();
}

Fixed version (ground truth):
@Override public void fromBytes(ByteBuf buf){
  x=buf.readInt();
  y=buf.readShort();
  z=buf.readInt();
  side=buf.readByte();
  hitX=buf.readFloat();
  hitY=buf.readFloat();
  hitZ=buf.readFloat();
  invertShift=buf.readBoolean();
}
Program: 10625
Project: 10625
Buggy source:
public void setInStack(ItemStack stack){
  if (stack != null) {
    if (inStack == null)     applyDiff(stack.stackSize);
 else     applyDiff(stack.stackSize - inCount);
  }
  inStack=stack;
  syncInStack();
  syncOutStack();
}

Fixed version (ground truth):
public void setInStack(ItemStack stack){
  if (stack != null) {
    if (inStack == null)     applyDiff(stack.stackSize);
 else     applyDiff(stack.stackSize - inCount);
  }
  inStack=null;
  syncInStack();
  setOutStack(outStack);
}
Program: 10626
Project: 10626
Buggy source:
public BlockController(String blockName){
  super(Material.rock);
  setCreativeTab(ModCreativeTabs.tabStorageDrawers);
  setHardness(5f);
  setBlockName(blockName);
  setStepSound(Block.soundTypeStone);
  setLightOpacity(255);
  setBlockBounds(0,0,0,1,1,1);
  setTickRandomly(true);
}

Fixed version (ground truth):
public BlockController(String blockName){
  super(Material.rock);
  this.useNeighborBrightness=true;
  setCreativeTab(ModCreativeTabs.tabStorageDrawers);
  setHardness(5f);
  setBlockName(blockName);
  setStepSound(Block.soundTypeStone);
  setLightOpacity(255);
  setBlockBounds(0,0,0,1,1,1);
  setTickRandomly(true);
}
Program: 10627
Project: 10627
Buggy source:
protected BlockDrawers(Material material,String blockName,int drawerCount,boolean halfDepth){
  super(material);
  this.drawerCount=drawerCount;
  this.halfDepth=halfDepth;
  setCreativeTab(ModCreativeTabs.tabStorageDrawers);
  setHardness(5f);
  setStepSound(Block.soundTypeWood);
  setBlockName(blockName);
  if (!halfDepth)   setLightOpacity(255);
}

Fixed version (ground truth):
protected BlockDrawers(Material material,String blockName,int drawerCount,boolean halfDepth){
  super(material);
  this.drawerCount=drawerCount;
  this.halfDepth=halfDepth;
  this.useNeighborBrightness=true;
  setCreativeTab(ModCreativeTabs.tabStorageDrawers);
  setHardness(5f);
  setStepSound(Block.soundTypeWood);
  setBlockName(blockName);
  setLightOpacity(255);
}