nus-yam/ex-repair huggingface dataset:
Program: 40636
Project: 40636
Buggy source:
static void w(String message){
  if (!warning && message != null && !message.isEmpty())   return;
  Log.d("String_Node_Str",message);
}

Fixed version (ground truth):
static void w(String message){
  if (!warning && message != null && !message.isEmpty())   return;
  Log.d("String_Node_Str","String_Node_Str" + message);
}
Program: 40637
Project: 40637
Buggy source:
static void vi(String message){
  if (!verboseInternal && message != null && !message.isEmpty())   return;
  Log.d("String_Node_Str","String_Node_Str" + message);
}

Fixed version (ground truth):
static void vi(String message){
  if (!verboseInternal || message == null || message.isEmpty())   return;
  Log.d("String_Node_Str","String_Node_Str" + message);
}
Program: 40638
Project: 40638
Buggy source:
static void d(String message){
  if (!debug && message != null && !message.isEmpty())   return;
  Log.d("String_Node_Str","String_Node_Str" + message);
}

Fixed version (ground truth):
static void d(String message){
  if (!debug || message == null || message.isEmpty())   return;
  Log.d("String_Node_Str","String_Node_Str" + message);
}
Program: 40639
Project: 40639
Buggy source:
static void e(String message){
  if (!error && message != null && !message.isEmpty())   return;
  Log.d("String_Node_Str","String_Node_Str" + message);
}

Fixed version (ground truth):
static void e(String message){
  if (!error || message == null || message.isEmpty())   return;
  Log.d("String_Node_Str","String_Node_Str" + message);
}
Program: 40640
Project: 40640
Buggy source:
static void v(String message){
  if (!verbose && message != null && !message.isEmpty())   return;
  Log.d("String_Node_Str","String_Node_Str" + message);
}

Fixed version (ground truth):
static void v(String message){
  if (!verbose || message == null || message.isEmpty())   return;
  Log.d("String_Node_Str","String_Node_Str" + message);
}
Program: 40641
Project: 40641
Buggy source:
static void w(String message){
  if (!warning && message != null && !message.isEmpty())   return;
  Log.d("String_Node_Str","String_Node_Str" + message);
}

Fixed version (ground truth):
static void w(String message){
  if (!warning || message == null || message.isEmpty())   return;
  Log.d("String_Node_Str","String_Node_Str" + message);
}
Program: 40642
Project: 40642
Buggy source:
/** 
 */
public static void main(String[] args){
  Node<String> first=new Node<String>();
  Node<String> second=new Node<String>();
  Node<String> third=new Node<String>();
  Node<String> forth=new Node<String>();
  Node<String> fifth=new Node<String>();
  first.item="String_Node_Str";
  first.next=second;
  second.item="String_Node_Str";
  second.next=third;
  third.item="String_Node_Str";
  third.next=forth;
  forth.item="String_Node_Str";
  forth.next=fifth;
  fifth.item="String_Node_Str";
  fifth.next=null;
  LinkedListExecise4<String> linkedListExercise4=new LinkedListExecise4<String>();
  Node targetNode=first;
  System.out.println("String_Node_Str" + targetNode + "String_Node_Str");
  Node resultNode=linkedListExercise4.removeAfter(targetNode,first);
  System.out.println("String_Node_Str");
  Node current2=resultNode;
  while (current2.next != null) {
    System.out.println(current2.item);
    current2=current2.next;
  }
  System.out.println(current2.item);
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
/** 
 */
public static void main(String[] args){
  Node<String> first=new Node<String>();
  Node<String> second=new Node<String>();
  Node<String> third=new Node<String>();
  Node<String> forth=new Node<String>();
  Node<String> fifth=new Node<String>();
  first.item="String_Node_Str";
  first.next=second;
  second.item="String_Node_Str";
  second.next=third;
  third.item="String_Node_Str";
  third.next=forth;
  forth.item="String_Node_Str";
  forth.next=fifth;
  fifth.item="String_Node_Str";
  fifth.next=null;
  LinkedListExecise4<String> linkedListExercise4=new LinkedListExecise4<String>();
  Node targetNode=first;
  System.out.println("String_Node_Str" + targetNode + "String_Node_Str");
  Node resultNode=linkedListExercise4.removeAfter(targetNode,first);
  System.out.println("String_Node_Str");
  Node current2=resultNode;
  while (current2 != null) {
    System.out.println(current2.item);
    current2=current2.next;
  }
  System.out.println(current2);
  System.out.println("String_Node_Str");
}
Program: 40643
Project: 40643
Buggy source:
public Node<Item> removeAfter(Node node,Node first){
  if (first == null) {
    return null;
  }
  Node current=first;
  while (current != null) {
    if (current.item.equals(node.item)) {
      if (current.next != null) {
        current.next=current.next.next;
        return first;
      }
 else {
        return first;
      }
    }
    current=current.next;
  }
  return null;
}

Fixed version (ground truth):
public Node<Item> removeAfter(Node node,Node first){
  if (first == null) {
    return null;
  }
  Node current=first;
  while (current != null) {
    if (current.equals(node)) {
      if (current.next != null) {
        current.next=current.next.next;
        return first;
      }
 else {
        return first;
      }
    }
    current=current.next;
  }
  return null;
}
Program: 40644
Project: 40644
Buggy source:
/** 
 * @param args
 */
public static void main(String[] args){
  Node first=new Node();
  Node second=new Node();
  Node third=new Node();
  Node forth=new Node();
  Node fifth=new Node();
  first.item=1;
  first.next=second;
  second.item=3;
  second.next=third;
  third.item=999;
  third.next=forth;
  forth.item=33;
  forth.next=fifth;
  fifth.item=21;
  fifth.next=null;
  System.out.println("String_Node_Str");
  Node current1=first;
  while (current1.next != null) {
    System.out.println(current1.item);
    current1=current1.next;
  }
  System.out.println(current1.item);
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  LinkedListExecise7 linkedListExercise7=new LinkedListExecise7();
  Integer result=linkedListExercise7.max(first);
  System.out.println("String_Node_Str" + result);
}

Fixed version (ground truth):
/** 
 * @param args
 */
public static void main(String[] args){
  Node first=new Node();
  Node second=new Node();
  Node third=new Node();
  Node forth=new Node();
  Node fifth=new Node();
  first.item=1;
  second.item=3;
  third.item=999;
  forth.item=33;
  fifth.item=21;
  first.next=second;
  second.next=third;
  third.next=forth;
  forth.next=fifth;
  fifth.next=null;
  System.out.println("String_Node_Str");
  Node current1=first;
  while (current1.next != null) {
    System.out.println(current1.item);
    current1=current1.next;
  }
  System.out.println(current1.item);
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  LinkedListExecise7 linkedListExercise7=new LinkedListExecise7();
  Integer result=linkedListExercise7.max(first);
  System.out.println("String_Node_Str" + result);
}
Program: 40645
Project: 40645
Buggy source:
@Override public boolean isBeaconBase(IBlockAccess worldObj,BlockPos pos,BlockPos beacon){
  return rule.fromBlock.isBeaconBase(new UCWBlockAccess(worldObj),pos,beacon);
}

Fixed version (ground truth):
@Override public boolean isBeaconBase(IBlockAccess world,BlockPos pos,BlockPos beacon){
  return rule.fromBlock.isBeaconBase(new UCWBlockAccess(world,false),pos,beacon);
}
Program: 40646
Project: 40646
Buggy source:
@Override public boolean canHarvestBlock(IBlockAccess world,BlockPos pos,EntityPlayer player){
  return rule.fromBlock.canHarvestBlock(new UCWBlockAccess(world),pos,player);
}

Fixed version (ground truth):
@Override public boolean canHarvestBlock(IBlockAccess world,BlockPos pos,EntityPlayer player){
  return rule.fromBlock.canHarvestBlock(new UCWBlockAccess(world,false),pos,player);
}
Program: 40647
Project: 40647
Buggy source:
@Override public int getLightOpacity(IBlockState state,IBlockAccess world,BlockPos pos){
  return base.getLightOpacity(new UCWBlockAccess(world),pos);
}

Fixed version (ground truth):
@Override public int getLightOpacity(IBlockState state,IBlockAccess world,BlockPos pos){
  return base.getLightOpacity(new UCWBlockAccess(world,false),pos);
}
Program: 40648
Project: 40648
Buggy source:
@Override public boolean isLeaves(IBlockState state,IBlockAccess world,BlockPos pos){
  return base.getBlock().isLeaves(base,new UCWBlockAccess(world),pos);
}

Fixed version (ground truth):
@Override public boolean isLeaves(IBlockState state,IBlockAccess world,BlockPos pos){
  return base.getBlock().isLeaves(base,new UCWBlockAccess(world,false),pos);
}
Program: 40649
Project: 40649
Buggy source:
@Override public boolean isFoliage(IBlockAccess world,BlockPos pos){
  return base.getBlock().isFoliage(new UCWBlockAccess(world),pos);
}

Fixed version (ground truth):
@Override public boolean isFoliage(IBlockAccess world,BlockPos pos){
  return base.getBlock().isFoliage(new UCWBlockAccess(world,false),pos);
}
Program: 40650
Project: 40650
Buggy source:
@Override public boolean isReplaceable(IBlockAccess worldIn,BlockPos pos){
  return base.getBlock().isReplaceable(new UCWBlockAccess(worldIn),pos);
}

Fixed version (ground truth):
@Override public boolean isReplaceable(IBlockAccess worldIn,BlockPos pos){
  return base.getBlock().isReplaceable(new UCWBlockAccess(worldIn,false),pos);
}
Program: 40651
Project: 40651
Buggy source:
@Override public boolean isWood(IBlockAccess world,BlockPos pos){
  return base.getBlock().isWood(new UCWBlockAccess(world),pos);
}

Fixed version (ground truth):
@Override public boolean isWood(IBlockAccess world,BlockPos pos){
  return base.getBlock().isWood(new UCWBlockAccess(world,false),pos);
}
Program: 40652
Project: 40652
Buggy source:
@Override public float getSlipperiness(IBlockState state,IBlockAccess world,BlockPos pos,@Nullable Entity entity){
  return base.getBlock().getSlipperiness(base,new UCWBlockAccess(world),pos,entity);
}

Fixed version (ground truth):
@Override public float getSlipperiness(IBlockState state,IBlockAccess world,BlockPos pos,@Nullable Entity entity){
  return base.getBlock().getSlipperiness(base,new UCWBlockAccess(world,false),pos,entity);
}
Program: 40653
Project: 40653
Buggy source:
@Override public boolean isFlammable(IBlockAccess world,BlockPos pos,EnumFacing face){
  return rule.fromBlock.isFlammable(new UCWBlockAccess(world),pos,face);
}

Fixed version (ground truth):
@Override public boolean isFlammable(IBlockAccess world,BlockPos pos,EnumFacing face){
  return rule.fromBlock.isFlammable(new UCWBlockAccess(world,false),pos,face);
}
Program: 40654
Project: 40654
Buggy source:
@Override public MapColor getMapColor(IBlockState state,IBlockAccess worldIn,BlockPos pos){
  return base.getMapColor(new UCWBlockAccess(worldIn),pos);
}

Fixed version (ground truth):
@Override public MapColor getMapColor(IBlockState state,IBlockAccess worldIn,BlockPos pos){
  return base.getMapColor(new UCWBlockAccess(worldIn,false),pos);
}
Program: 40655
Project: 40655
Buggy source:
@Override public int getLightValue(IBlockState state,IBlockAccess world,BlockPos pos){
  return base.getLightValue(new UCWBlockAccess(world),pos);
}

Fixed version (ground truth):
@Override public int getLightValue(IBlockState state,IBlockAccess world,BlockPos pos){
  return base.getLightValue(new UCWBlockAccess(world,false),pos);
}
Program: 40656
Project: 40656
Buggy source:
@Override public int getFlammability(IBlockAccess world,BlockPos pos,EnumFacing face){
  return rule.fromBlock.getFlammability(new UCWBlockAccess(world),pos,face);
}

Fixed version (ground truth):
@Override public int getFlammability(IBlockAccess world,BlockPos pos,EnumFacing face){
  return rule.fromBlock.getFlammability(new UCWBlockAccess(world,false),pos,face);
}
Program: 40657
Project: 40657
Buggy source:
@Override public int getFireSpreadSpeed(IBlockAccess world,BlockPos pos,EnumFacing face){
  return rule.fromBlock.getFireSpreadSpeed(new UCWBlockAccess(world),pos,face);
}

Fixed version (ground truth):
@Override public int getFireSpreadSpeed(IBlockAccess world,BlockPos pos,EnumFacing face){
  return rule.fromBlock.getFireSpreadSpeed(new UCWBlockAccess(world,false),pos,face);
}
Program: 40658
Project: 40658
Buggy source:
@Override public IBlockState getBlockState(BlockPos pos){
  IBlockState state=parent.getBlockState(pos);
  if (state.getBlock() instanceof IUCWBlock) {
    return ((IUCWBlock)state.getBlock()).getBaseState();
  }
 else {
    return state;
  }
}

Fixed version (ground truth):
@Override public IBlockState getBlockState(BlockPos pos){
  IBlockState state=parent.getBlockState(pos);
  if (state.getBlock() instanceof IUCWBlock) {
    if (isThrough) {
      return ((IUCWBlock)state.getBlock()).getThroughState(state);
    }
 else {
      return ((IUCWBlock)state.getBlock()).getBaseState();
    }
  }
 else {
    return state;
  }
}
Program: 40659
Project: 40659
Buggy source:
public UCWBlockAccess(IBlockAccess parent){
  this.parent=parent;
}

Fixed version (ground truth):
public UCWBlockAccess(IBlockAccess parent,boolean isThrough){
  this.parent=parent;
  this.isThrough=isThrough;
}
Program: 40660
Project: 40660
Buggy source:
@Override public void onResourceManagerReload(IResourceManager resourceManager){
  data.clear();
  jsonCache.clear();
}

Fixed version (ground truth):
@Override public void onResourceManagerReload(IResourceManager resourceManager){
  invalidate();
}
Program: 40661
Project: 40661
Buggy source:
@Override public InputStream getInputStream(ResourceLocation location) throws IOException {
  if (!data.containsKey(location)) {
    ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
    String[] str=getStr(location);
    JsonElement element;
    ResourceLocation nonProxiedLoc=new ResourceLocation(str[1],str[2]);
    if (jsonCache.containsKey(nonProxiedLoc)) {
      element=jsonCache.get(nonProxiedLoc);
    }
 else {
      InputStream nonProxied=Minecraft.getMinecraft().getResourceManager().getResource(nonProxiedLoc).getInputStream();
      Reader reader=new InputStreamReader(nonProxied);
      try {
        element=JsonUtils.fromJson(UnlimitedChiselWorks.GSON,reader,JsonElement.class);
      }
 catch (      Exception e) {
        element=null;
        reader.close();
        nonProxied.close();
      }
    }
    if (element != null) {
      JsonElement newElement=parseJsonElement(str,element);
      byte[] b=UnlimitedChiselWorks.GSON.toJson(newElement).getBytes(Charsets.UTF_8);
      byteArrayOutputStream.write(b);
    }
 else {
      InputStream nonProxied=Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation(str[1],str[2])).getInputStream();
      while (nonProxied.available() > 0)       byteArrayOutputStream.write(nonProxied.read());
      nonProxied.close();
    }
    byteArrayOutputStream.close();
    byte[] out=byteArrayOutputStream.toByteArray();
    data.put(location,out);
    return new ByteArrayInputStream(out);
  }
 else {
    return new ByteArrayInputStream(data.get(location));
  }
}

Fixed version (ground truth):
@Override public InputStream getInputStream(ResourceLocation location) throws IOException {
  if (!data.containsKey(location)) {
    String[] str=getStr(location);
    JsonElement element;
    ResourceLocation nonProxiedLoc=new ResourceLocation(str[1],str[2]);
    if (jsonCache.containsKey(nonProxiedLoc)) {
      element=jsonCache.get(nonProxiedLoc);
    }
 else {
      InputStream nonProxied=Minecraft.getMinecraft().getResourceManager().getResource(nonProxiedLoc).getInputStream();
      Reader reader=new InputStreamReader(nonProxied);
      try {
        element=JsonUtils.fromJson(UnlimitedChiselWorks.GSON,reader,JsonElement.class);
      }
 catch (      Exception e) {
        element=null;
        reader.close();
        nonProxied.close();
      }
    }
    byte[] out;
    if (element != null) {
      JsonElement newElement=parseJsonElement(str,element);
      out=UnlimitedChiselWorks.GSON.toJson(newElement).getBytes(Charsets.UTF_8);
    }
 else {
      if (data.containsKey(nonProxiedLoc)) {
        out=data.get(nonProxiedLoc);
      }
 else {
        InputStream nonProxied=Minecraft.getMinecraft().getResourceManager().getResource(nonProxiedLoc).getInputStream();
        out=ByteStreams.toByteArray(nonProxied);
        nonProxied.close();
        data.put(nonProxiedLoc,out);
      }
    }
    data.put(location,out);
    return new ByteArrayInputStream(out);
  }
 else {
    return new ByteArrayInputStream(data.get(location));
  }
}
Program: 40665
Project: 40665
Buggy source:
@Override public void execute(MinecraftServer server,ICommandSender sender,String[] args) throws CommandException {
  if (sender instanceof EntityPlayerMP) {
    World world=sender.getEntityWorld();
    BlockPos pos=sender.getPosition();
    for (    UCWBlockRule rule : UnlimitedChiselWorks.BLOCK_RULES) {
      if (args.length >= 1 && !rule.fromBlock.getRegistryName().toString().toLowerCase().startsWith(args[0].toLowerCase())) {
        continue;
      }
      for (      UCWObjectFactory factory : rule.objectFactories.valueCollection()) {
        BlockPos.MutableBlockPos posCopy=new BlockPos.MutableBlockPos(pos);
        NonNullList<ItemStack> stackList=NonNullList.create();
        factory.item.getSubItems(CreativeTabs.SEARCH,stackList);
        world.setBlockState(posCopy,factory.base);
        posCopy.move(EnumFacing.EAST);
        for (        ItemStack stack : stackList) {
          try {
            world.setBlockState(posCopy,factory.block.getStateFromMeta(stack.getMetadata()));
            posCopy.move(EnumFacing.EAST);
          }
 catch (          Exception e) {
          }
        }
        pos=pos.south();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void execute(MinecraftServer server,ICommandSender sender,String[] args) throws CommandException {
  if (sender instanceof EntityPlayerMP) {
    World world=sender.getEntityWorld();
    BlockPos pos=sender.getPosition();
    for (    UCWBlockRule rule : UnlimitedChiselWorks.BLOCK_RULES) {
      if (args.length >= 1 && !rule.fromBlock.getRegistryName().toString().toLowerCase().startsWith(args[0].toLowerCase())) {
        continue;
      }
      for (      UCWObjectFactory factory : rule.objectFactories.valueCollection()) {
        NonNullList<ItemStack> stackList=NonNullList.create();
        factory.item.getSubItems(CreativeTabs.SEARCH,stackList);
        world.setBlockState(pos,factory.base);
        BlockPos posCopy=pos.offset(EnumFacing.EAST);
        for (        ItemStack stack : stackList) {
          try {
            world.setBlockState(posCopy,factory.block.getStateFromMeta(stack.getMetadata()));
            posCopy=posCopy.offset(EnumFacing.EAST);
          }
 catch (          Exception e) {
          }
        }
        pos=pos.south();
      }
    }
  }
}
Program: 40666
Project: 40666
Buggy source:
public static ResourceLocation getLocation(IBlockState state,ModelResourceLocation location,IModel model){
  String domain=location.getResourceDomain();
  if ("String_Node_Str".equals(domain)) {
    String[] name=state.getBlock().getRegistryName().getResourcePath().split("String_Node_Str",2);
    IProperty variantProp=state.getBlock().getBlockState().getProperty("String_Node_Str");
    if (variantProp != null) {
      String variant=variantProp.getName(state.getValue(variantProp));
      if (name.length == 2 && ("String_Node_Str".equals(name[0]))) {
        return new ResourceLocation("String_Node_Str","String_Node_Str" + name[0] + "String_Node_Str"+ variant);
      }
    }
  }
 else   if ("String_Node_Str".equals(domain)) {
    String[] name=state.getBlock().getRegistryName().getResourcePath().split("String_Node_Str",2);
    IProperty variantProp=state.getBlock().getBlockState().getProperty("String_Node_Str");
    if (variantProp != null) {
      String variant=variantProp.getName(state.getValue(variantProp));
      if (name.length == 2 && ("String_Node_Str".equals(name[0]))) {
        return new ResourceLocation("String_Node_Str","String_Node_Str" + variant);
      }
    }
  }
  return model.getTextures().iterator().next();
}

Fixed version (ground truth):
public static ResourceLocation getLocation(IBlockState state,ModelResourceLocation location,IModel model){
  String domain=location.getResourceDomain();
  if ("String_Node_Str".equals(domain)) {
    String[] name=state.getBlock().getRegistryName().getResourcePath().split("String_Node_Str",2);
    IProperty variantProp=state.getBlock().getBlockState().getProperty("String_Node_Str");
    if (variantProp != null) {
      String variant=variantProp.getName(state.getValue(variantProp));
      if (name.length == 2 && ("String_Node_Str".equals(name[0]))) {
        return new ResourceLocation("String_Node_Str","String_Node_Str" + name[0] + "String_Node_Str"+ variant);
      }
    }
  }
 else   if ("String_Node_Str".equals(domain)) {
    String[] name=state.getBlock().getRegistryName().getResourcePath().split("String_Node_Str",2);
    IProperty variantProp=state.getBlock().getBlockState().getProperty("String_Node_Str");
    if (variantProp != null) {
      String variant=variantProp.getName(state.getValue(variantProp));
      if (name.length == 2 && ("String_Node_Str".equals(name[0]))) {
        return new ResourceLocation("String_Node_Str","String_Node_Str" + variant);
      }
    }
  }
  if (model.getTextures().size() == 1) {
    return model.getTextures().iterator().next();
  }
 else {
    try {
      IBakedModel bakedModel=model.bake(TRSRTransformation.identity(),DefaultVertexFormats.ITEM,FakeSprite::new);
      Collection<BakedQuad> quadList=bakedModel.getQuads(state,EnumFacing.NORTH,0);
      if (quadList.size() > 0) {
        return new ResourceLocation(quadList.iterator().next().getSprite().getIconName());
      }
    }
 catch (    Exception e) {
    }
    return model.getTextures().iterator().next();
  }
}
Program: 40667
Project: 40667
Buggy source:
public boolean isValid(){
  return from.size() > 0 && through.size() > 0 && (basedUpon.size() == 1 || basedUpon.size() == through.size());
}

Fixed version (ground truth):
public boolean isValid(){
  return from.size() > 0 && through.size() > 0 && (basedUpon.size() == 1 || basedUpon.size() == through.size()) && fromBlock != Blocks.AIR && throughBlock != Blocks.AIR && basedUponBlock != Blocks.AIR;
}
Program: 40668
Project: 40668
Buggy source:
@EventHandler public void postInit(FMLInitializationEvent event){
  for (  UCWBlockRule rule : BLOCK_RULES) {
    ItemStack stack=new ItemStack(rule.fromBlock,1,OreDictionary.WILDCARD_VALUE);
    int[] ids=OreDictionary.getOreIDs(stack);
    if (ids.length > 0) {
      for (      UCWObjectFactory factory : rule.objectFactories.valueCollection()) {
        for (        int i : ids) {
          OreDictionary.registerOre(OreDictionary.getOreName(i),factory.block);
        }
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler public void postInit(FMLInitializationEvent event){
  for (  UCWBlockRule rule : BLOCK_RULES) {
    ItemStack stack=new ItemStack(rule.fromBlock,1,OreDictionary.WILDCARD_VALUE);
    if (!stack.isEmpty()) {
      int[] ids=OreDictionary.getOreIDs(stack);
      if (ids.length > 0) {
        for (        UCWObjectFactory factory : rule.objectFactories.valueCollection()) {
          for (          int i : ids) {
            OreDictionary.registerOre(OreDictionary.getOreName(i),factory.block);
          }
        }
      }
    }
  }
}
Program: 40669
Project: 40669
Buggy source:
public boolean isValid(){
  return from.size() > 0 && through.size() > 0 && (basedUpon.size() == 1 || basedUpon.size() == through.size()) && fromBlock != Blocks.AIR && throughBlock != Blocks.AIR && basedUponBlock != Blocks.AIR;
}

Fixed version (ground truth):
public boolean isValid(){
  return !from.isEmpty() && !overlay.isEmpty() && !through.isEmpty()&& (basedUpon.size() == 1 || basedUpon.size() == through.size())&& fromBlock != Blocks.AIR && overlayBlock != Blocks.AIR && throughBlock != Blocks.AIR && basedUponBlock != Blocks.AIR;
}
Program: 40670
Project: 40670
Buggy source:
@Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack,@Nullable World worldIn,List<String> tooltip,ITooltipFlag flagIn){
  getItemThrough().addInformation(UCWMagic.copyChangeItem(stack,getItemThrough()),worldIn,tooltip,flagIn);
}

Fixed version (ground truth):
@Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack,@Nullable World worldIn,List<String> tooltip,ITooltipFlag flagIn){
  getItemThrough().addInformation(UCWUtils.copyChangeItem(stack,getItemThrough()),worldIn,tooltip,flagIn);
}
Program: 40671
Project: 40671
Buggy source:
@Override public void getSubItems(CreativeTabs tab,NonNullList<ItemStack> items){
  Item origItem=getItemThrough();
  NonNullList<ItemStack> proxyList=NonNullList.create();
  origItem.getSubItems(tab,proxyList);
  for (  ItemStack stack : proxyList) {
    if (stack.getItem() == origItem) {
      if (rule.throughBlock.getRegistryName().toString().equals("String_Node_Str") && stack.getItemDamage() == 9) {
        continue;
      }
      items.add(UCWMagic.copyChangeItem(stack,this));
    }
  }
}

Fixed version (ground truth):
@Override public void getSubItems(CreativeTabs tab,NonNullList<ItemStack> items){
  Item origItem=getItemThrough();
  NonNullList<ItemStack> proxyList=NonNullList.create();
  origItem.getSubItems(tab,proxyList);
  for (  ItemStack stack : proxyList) {
    if (stack.getItem() == origItem) {
      if (rule.throughBlock.getRegistryName().toString().equals("String_Node_Str") && stack.getItemDamage() == 9) {
        continue;
      }
      items.add(UCWUtils.copyChangeItem(stack,this));
    }
  }
}
Program: 40673
Project: 40673
Buggy source:
/** 
 * 计算出指定股票指定日期范围的指数平滑异同移动平均线值序列。
 * @param stockPrice 股价序列
 * @param paramSHORT 短期
 * @param paramLONG 长期
 * @param paramM DEA周期paramLONG+paramM-1后数据才有效
 * @return 指数平滑异同移动平均线值序列
 */
private List<Map<String,Double>> calcStkDailyMACD(List<Double> stockPrice,int paramSHORT,int paramLONG,int paramM){
  List<Map<String,Double>> result=new ArrayList<>();
  double shortEMA=getMa(stockPrice,paramLONG - paramSHORT,paramSHORT);
  double longEMA=getMa(stockPrice,0,paramLONG);
  double diffValue=getDIFFValue(shortEMA,longEMA);
  double deaValue=diffValue;
  double close;
  int i=paramLONG;
  double shortSmoth=2 / (paramSHORT + 1);
  double longSmoth=2 / (paramLONG + 1);
  do {
    close=stockPrice.get(i);
    Map<String,Double> indicatorValue=new HashMap<String,Double>();
    shortEMA=shortSmoth * close + (paramSHORT - 1) / (paramSHORT + 1) * shortEMA;
    longEMA=longSmoth * close + (paramLONG - 1) / (paramLONG + 1) * longEMA;
    diffValue=getDIFFValue(shortEMA,longEMA);
    indicatorValue.put(VALUE_DIFF,diffValue);
    deaValue=2 / (paramM + 1) * diffValue + (paramM - 1) / (paramM + 1) * deaValue;
    indicatorValue.put(VALUE_DEA,deaValue);
    double macdValue=2 * (diffValue - deaValue);
    if (macdValue >= 0) {
      indicatorValue.put(VALUE_RMACD,macdValue);
    }
 else {
      indicatorValue.put(VALUE_FMACD,macdValue);
    }
    result.add(indicatorValue);
    i++;
  }
 while (i < stockPrice.size());
  return result;
}

Fixed version (ground truth):
/** 
 * 计算出指定股票指定日期范围的指数平滑异同移动平均线值序列。
 * @param stockPrice 股价序列
 * @param paramSHORT 短期
 * @param paramLONG 长期
 * @param paramM DEA周期paramLONG+paramM-1后数据才有效
 * @return 指数平滑异同移动平均线值序列
 */
private List<Map<String,Double>> calcStkDailyMACD(List<Double> stockPrice,int paramSHORT,int paramLONG,int paramM){
  List<Map<String,Double>> result=new ArrayList<Map<String,Double>>();
  double shortEMA=getMa(stockPrice,paramLONG - paramSHORT,paramSHORT);
  double longEMA=getMa(stockPrice,0,paramLONG);
  double diffValue=getDIFFValue(shortEMA,longEMA);
  double deaValue=diffValue;
  double close;
  int i=paramLONG;
  double shortSmoth=2 / (paramSHORT + 1);
  double longSmoth=2 / (paramLONG + 1);
  do {
    close=stockPrice.get(i);
    Map<String,Double> indicatorValue=new HashMap<String,Double>();
    shortEMA=shortSmoth * close + (paramSHORT - 1) / (paramSHORT + 1) * shortEMA;
    longEMA=longSmoth * close + (paramLONG - 1) / (paramLONG + 1) * longEMA;
    diffValue=getDIFFValue(shortEMA,longEMA);
    indicatorValue.put(VALUE_DIFF,diffValue);
    deaValue=2 / (paramM + 1) * diffValue + (paramM - 1) / (paramM + 1) * deaValue;
    indicatorValue.put(VALUE_DEA,deaValue);
    double macdValue=2 * (diffValue - deaValue);
    if (macdValue >= 0) {
      indicatorValue.put(VALUE_RMACD,macdValue);
    }
 else {
      indicatorValue.put(VALUE_FMACD,macdValue);
    }
    result.add(indicatorValue);
    i++;
  }
 while (i < stockPrice.size());
  return result;
}
Program: 40674
Project: 40674
Buggy source:
@Test public void testUserUpdateDefaultSerdes() throws Exception {
  final User user=new User();
  final User.UserUpdate userUpdate=User.UserUpdate.buildFrom(user);
  assertEquals(null,userUpdate.getNewSession());
  assertEquals(null,userUpdate.getUnsubscribedFromEmails());
  assertEquals(null,userUpdate.getUnsubscribedFromEmails());
  assertEquals(null,userUpdate.isNewSession());
  assertEquals(null,userUpdate.isUpdateLastRequestAt());
  assertEquals(null,userUpdate.getType());
  final String json=mapper.writeValueAsString(userUpdate);
  assertFalse(json.contains("String_Node_Str"));
  assertFalse(json.contains("String_Node_Str"));
  assertFalse(json.contains("String_Node_Str"));
  assertFalse(json.contains("String_Node_Str"));
  final Map map=mapper.readValue(json,Map.class);
  assertFalse(map.containsKey("String_Node_Str"));
  assertFalse(map.containsKey("String_Node_Str"));
  assertFalse(map.containsKey("String_Node_Str"));
  assertFalse(map.containsKey("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testUserUpdateDefaultSerdes() throws Exception {
  final User user=new User();
  final User.UserUpdate userUpdate=User.UserUpdate.buildFrom(user);
  assertEquals(null,userUpdate.getUnsubscribedFromEmails());
  assertEquals(null,userUpdate.isNewSession());
  assertEquals(null,userUpdate.isUpdateLastRequestAt());
  assertEquals(null,userUpdate.getType());
  final String json=mapper.writeValueAsString(userUpdate);
  assertFalse(json.contains("String_Node_Str"));
  assertFalse(json.contains("String_Node_Str"));
  assertFalse(json.contains("String_Node_Str"));
  assertFalse(json.contains("String_Node_Str"));
  final Map map=mapper.readValue(json,Map.class);
  assertFalse(map.containsKey("String_Node_Str"));
  assertFalse(map.containsKey("String_Node_Str"));
  assertFalse(map.containsKey("String_Node_Str"));
  assertFalse(map.containsKey("String_Node_Str"));
}
Program: 40675
Project: 40675
Buggy source:
@Test public void testUserUpdateDefaultModifiedSerdes() throws Exception {
  final User user=new User();
  user.setNewSession(true);
  user.setUnsubscribedFromEmails(true);
  user.setUpdateLastRequestAt(true);
  final User.UserUpdate userUpdate=User.UserUpdate.buildFrom(user);
  assertEquals(true,userUpdate.getNewSession());
  assertEquals(true,userUpdate.getUnsubscribedFromEmails());
  assertEquals(true,userUpdate.getUnsubscribedFromEmails());
  assertEquals(true,userUpdate.isNewSession());
  assertEquals(true,userUpdate.isUpdateLastRequestAt());
  final String json=mapper.writeValueAsString(userUpdate);
  assertTrue(json.contains("String_Node_Str"));
  assertTrue(json.contains("String_Node_Str"));
  assertTrue(json.contains("String_Node_Str"));
  final Map map=mapper.readValue(json,Map.class);
  assertTrue(map.containsKey("String_Node_Str"));
  assertTrue(map.containsKey("String_Node_Str"));
  assertTrue(map.containsKey("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testUserUpdateDefaultModifiedSerdes() throws Exception {
  final User user=new User();
  user.setNewSession(true);
  user.setUnsubscribedFromEmails(true);
  user.setUpdateLastRequestAt(true);
  final User.UserUpdate userUpdate=User.UserUpdate.buildFrom(user);
  assertEquals(true,userUpdate.getUnsubscribedFromEmails());
  assertEquals(true,userUpdate.isNewSession());
  assertEquals(true,userUpdate.isUpdateLastRequestAt());
  final String json=mapper.writeValueAsString(userUpdate);
  assertTrue(json.contains("String_Node_Str"));
  assertTrue(json.contains("String_Node_Str"));
  assertTrue(json.contains("String_Node_Str"));
  final Map map=mapper.readValue(json,Map.class);
  assertTrue(map.containsKey("String_Node_Str"));
  assertTrue(map.containsKey("String_Node_Str"));
  assertTrue(map.containsKey("String_Node_Str"));
}
Program: 40676
Project: 40676
Buggy source:
@Override public MumblerNode convert(){
  if (this.list.size() == 0) {
    return new LiteralListNode(MumblerList.EMPTY);
  }
 else   if (this.list.get(0) instanceof SymbolConvertible && this.isSpecialForm((SymbolConvertible)this.list.get(0))) {
    return this.toSpecialForm();
  }
  return new InvokeNode(this.list.get(0).convert(),this.list.subList(1,this.list.size()).toArray(new MumblerNode[]{}));
}

Fixed version (ground truth):
@Override public MumblerNode convert(){
  if (this.list.size() == 0) {
    return new LiteralListNode(MumblerList.EMPTY);
  }
 else   if (this.list.get(0) instanceof SymbolConvertible && this.isSpecialForm((SymbolConvertible)this.list.get(0))) {
    return this.toSpecialForm();
  }
  return new InvokeNode(this.list.get(0).convert(),this.list.subList(1,this.list.size()).stream().map(Convertible::convert).toArray(size -> new MumblerNode[size]));
}
Program: 40677
Project: 40677
Buggy source:
private MumblerNode toSpecialForm(){
  SymbolConvertible symbol=(SymbolConvertible)this.list.get(0);
switch (symbol.name) {
case "String_Node_Str":
    return quote(this.list.get(1));
case "String_Node_Str":
  return new IfNode(this.list.get(1).convert(),this.list.get(2).convert(),this.list.get(3).convert());
case "String_Node_Str":
return DefineNodeFactory.create(this.list.get(2).convert(),frameDescriptors.peek().findOrAddFrameSlot(((SymbolConvertible)this.list.get(1)).name));
case "String_Node_Str":
frameDescriptors.push(new FrameDescriptor());
List<FrameSlot> formalParameters=new ArrayList<>();
for (Convertible arg : ((ListConvertible)this.list.get(1)).list) {
formalParameters.add(((SymbolNode)arg.convert()).getSlot());
}
List<MumblerNode> bodyNodes=new ArrayList<>();
for (Convertible bodyConv : this.list.subList(2,this.list.size())) {
bodyNodes.add(bodyConv.convert());
}
frameDescriptors.pop();
MumblerFunction function=MumblerFunction.create(formalParameters.toArray(new FrameSlot[]{}),bodyNodes.toArray(new MumblerNode[]{}));
return LambdaNodeFactory.create(function);
default :
throw new IllegalStateException("String_Node_Str");
}
}

Fixed version (ground truth):
private MumblerNode toSpecialForm(){
  SymbolConvertible symbol=(SymbolConvertible)this.list.get(0);
switch (symbol.name) {
case "String_Node_Str":
    return quote(this.list.get(1));
case "String_Node_Str":
  return new IfNode(this.list.get(1).convert(),this.list.get(2).convert(),this.list.get(3).convert());
case "String_Node_Str":
return DefineNodeFactory.create(this.list.get(2).convert(),frameDescriptors.peek().findOrAddFrameSlot(((SymbolConvertible)this.list.get(1)).name));
case "String_Node_Str":
frameDescriptors.push(new FrameDescriptor());
List<FrameSlot> formalParameters=new ArrayList<>();
for (Convertible arg : ((ListConvertible)this.list.get(1)).list) {
formalParameters.add(((SymbolNode)arg.convert()).getSlot());
}
List<MumblerNode> bodyNodes=new ArrayList<>();
for (Convertible bodyConv : this.list.subList(2,this.list.size())) {
bodyNodes.add(bodyConv.convert());
}
frameDescriptors.pop();
MumblerFunction function=MumblerFunction.create(formalParameters.toArray(new FrameSlot[]{}),bodyNodes.toArray(new MumblerNode[]{}),frameDescriptors.peek());
return LambdaNodeFactory.create(function);
default :
throw new IllegalStateException("String_Node_Str");
}
}
Program: 40678
Project: 40678
Buggy source:
private static void runMumbler(String filename) throws IOException {
  MumblerList<MumblerNode> nodes=Reader.read(new FileInputStream(filename));
  execute(nodes);
}

Fixed version (ground truth):
private static void runMumbler(String filename) throws IOException {
  VirtualFrame topFrame=createTopFrame(Reader.frameDescriptors.peek());
  MumblerList<MumblerNode> nodes=Reader.read(new FileInputStream(filename));
  execute(nodes,topFrame);
}
Program: 40679
Project: 40679
Buggy source:
private static VirtualFrame createTopFrame(FrameDescriptor frameDescriptor){
  VirtualFrame virtualFrame=Truffle.getRuntime().createVirtualFrame(new Object[]{},frameDescriptor);
  virtualFrame.setObject(frameDescriptor.addFrameSlot("String_Node_Str"),createBuiltinFunction(AddBuiltinNodeFactory.getInstance()));
  virtualFrame.setObject(frameDescriptor.addFrameSlot("String_Node_Str"),createBuiltinFunction(PrintlnBuiltinNodeFactory.getInstance()));
  virtualFrame.setObject(frameDescriptor.addFrameSlot("String_Node_Str"),createBuiltinFunction(NowBuiltinNodeFactory.getInstance()));
  return virtualFrame;
}

Fixed version (ground truth):
private static VirtualFrame createTopFrame(FrameDescriptor frameDescriptor){
  VirtualFrame virtualFrame=Truffle.getRuntime().createVirtualFrame(new Object[]{},frameDescriptor);
  virtualFrame.setObject(frameDescriptor.addFrameSlot("String_Node_Str"),createBuiltinFunction(AddBuiltinNodeFactory.getInstance(),frameDescriptor));
  virtualFrame.setObject(frameDescriptor.addFrameSlot("String_Node_Str"),createBuiltinFunction(PrintlnBuiltinNodeFactory.getInstance(),frameDescriptor));
  virtualFrame.setObject(frameDescriptor.addFrameSlot("String_Node_Str"),createBuiltinFunction(NowBuiltinNodeFactory.getInstance(),frameDescriptor));
  return virtualFrame;
}
Program: 40680
Project: 40680
Buggy source:
private static void startREPL() throws IOException {
  Console console=System.console();
  while (true) {
    String data=console.readLine("String_Node_Str");
    if (data == null) {
      break;
    }
    MumblerList<MumblerNode> nodes=Reader.read(new ByteArrayInputStream(data.getBytes()));
    Object result=execute(nodes);
    if (result != MumblerList.EMPTY) {
      System.out.println(result);
    }
  }
}

Fixed version (ground truth):
private static void startREPL() throws IOException {
  VirtualFrame topFrame=createTopFrame(Reader.frameDescriptors.peek());
  Console console=System.console();
  while (true) {
    String data=console.readLine("String_Node_Str");
    if (data == null) {
      break;
    }
    MumblerList<MumblerNode> nodes=Reader.read(new ByteArrayInputStream(data.getBytes()));
    Object result=execute(nodes,topFrame);
    if (result != MumblerList.EMPTY) {
      System.out.println(result);
    }
  }
}
Program: 40681
Project: 40681
Buggy source:
private static Object execute(MumblerList<MumblerNode> nodes){
  MumblerFunction function=MumblerFunction.create(new FrameSlot[]{},StreamSupport.stream(nodes.spliterator(),false).toArray(size -> new MumblerNode[size]));
  DirectCallNode directCallNode=Truffle.getRuntime().createDirectCallNode(function.callTarget);
  return directCallNode.call(createTopFrame(Reader.frameDescriptors.peek()),new Object[]{});
}

Fixed version (ground truth):
private static Object execute(MumblerList<MumblerNode> nodes,VirtualFrame topFrame){
  FrameDescriptor frameDescriptor=topFrame.getFrameDescriptor();
  MumblerFunction function=MumblerFunction.create(new FrameSlot[]{},StreamSupport.stream(nodes.spliterator(),false).toArray(size -> new MumblerNode[size]),frameDescriptor);
  DirectCallNode directCallNode=Truffle.getRuntime().createDirectCallNode(function.callTarget);
  return directCallNode.call(topFrame,new Object[]{topFrame.materialize()});
}
Program: 40682
Project: 40682
Buggy source:
public static MumblerRootNode create(FrameSlot[] argumentNames,MumblerNode[] bodyNodes){
  MumblerNode[] allNodes=new MumblerNode[argumentNames.length + bodyNodes.length];
  for (int i=0; i < argumentNames.length; i++) {
    allNodes[i]=DefineNodeFactory.create(new ReadArgumentNode(i),argumentNames[i]);
  }
  System.arraycopy(bodyNodes,bodyNodes.length,allNodes,argumentNames.length,bodyNodes.length);
  return new MumblerRootNode(bodyNodes);
}

Fixed version (ground truth):
public static MumblerRootNode create(FrameSlot[] argumentNames,MumblerNode[] bodyNodes,FrameDescriptor frameDescriptor){
  MumblerNode[] allNodes=new MumblerNode[argumentNames.length + bodyNodes.length];
  for (int i=0; i < argumentNames.length; i++) {
    allNodes[i]=DefineNodeFactory.create(new ReadArgumentNode(i),argumentNames[i]);
  }
  System.arraycopy(bodyNodes,0,allNodes,argumentNames.length,bodyNodes.length);
  return new MumblerRootNode(allNodes,frameDescriptor);
}
Program: 40683
Project: 40683
Buggy source:
public MumblerRootNode(MumblerNode[] bodyNodes){
  this.bodyNodes=bodyNodes;
}

Fixed version (ground truth):
public MumblerRootNode(MumblerNode[] bodyNodes,FrameDescriptor frameDescriptor){
  super(null,frameDescriptor);
  this.bodyNodes=bodyNodes;
}
Program: 40684
Project: 40684
Buggy source:
public <T>T readUpStack(FrameGet<T> getter,Frame frame) throws FrameSlotTypeException {
  T value=getter.get(frame,this.getSlot());
  while (value == null) {
    frame=this.getLexicalScope(frame);
    if (frame == null) {
      throw new RuntimeException("String_Node_Str" + this.getSlot().getIdentifier());
    }
    value=getter.get(frame,this.getSlot());
  }
  return value;
}

Fixed version (ground truth):
public <T>T readUpStack(FrameGet<T> getter,Frame frame) throws FrameSlotTypeException {
  FrameSlot slot=this.getSlot();
  Object identifier=slot.getIdentifier();
  T value=getter.get(frame,slot);
  while (value == null) {
    frame=this.getLexicalScope(frame);
    if (frame == null) {
      throw new RuntimeException("String_Node_Str" + this.getSlot().getIdentifier());
    }
    FrameDescriptor desc=frame.getFrameDescriptor();
    slot=desc.findFrameSlot(identifier);
    if (slot != null) {
      value=getter.get(frame,slot);
    }
  }
  return value;
}
Program: 40685
Project: 40685
Buggy source:
protected Frame getLexicalScope(Frame frame){
  return (Frame)frame.getArguments()[0];
}

Fixed version (ground truth):
protected Frame getLexicalScope(Frame frame){
  Object[] args=frame.getArguments();
  if (args.length > 0) {
    return (Frame)frame.getArguments()[0];
  }
 else {
    return null;
  }
}
Program: 40686
Project: 40686
Buggy source:
public static MumblerFunction createBuiltinFunction(NodeFactory<? extends BuiltinNode> factory){
  int argumentCount=factory.getExecutionSignature().size();
  MumblerNode[] argumentNodes=new MumblerNode[argumentCount];
  for (int i=0; i < argumentCount; i++) {
    argumentNodes[i]=new ReadArgumentNode(i);
  }
  BuiltinNode node=factory.createNode((Object)argumentNodes);
  return new MumblerFunction(Truffle.getRuntime().createCallTarget(new MumblerRootNode(new MumblerNode[]{node})));
}

Fixed version (ground truth):
public static MumblerFunction createBuiltinFunction(NodeFactory<? extends BuiltinNode> factory,FrameDescriptor frameDescriptor){
  int argumentCount=factory.getExecutionSignature().size();
  MumblerNode[] argumentNodes=new MumblerNode[argumentCount];
  for (int i=0; i < argumentCount; i++) {
    argumentNodes[i]=new ReadArgumentNode(i);
  }
  BuiltinNode node=factory.createNode((Object)argumentNodes);
  return new MumblerFunction(Truffle.getRuntime().createCallTarget(new MumblerRootNode(new MumblerNode[]{node},frameDescriptor)));
}
Program: 40687
Project: 40687
Buggy source:
public InvokeNode(MumblerNode functionNode,MumblerNode[] argumentNodes){
  this.functionNode=functionNode;
  this.argumentNodes=argumentNodes;
  this.dispatchNode=new DispatchNode();
}

Fixed version (ground truth):
public InvokeNode(MumblerNode functionNode,MumblerNode[] argumentNodes){
  this.functionNode=functionNode;
  this.argumentNodes=argumentNodes;
  this.callNode=Truffle.getRuntime().createIndirectCallNode();
}
Program: 40688
Project: 40688
Buggy source:
@Override @ExplodeLoop public Object execute(VirtualFrame virtualFrame){
  MumblerFunction function=this.evaluateFunction(virtualFrame);
  CompilerAsserts.compilationConstant(this.argumentNodes.length);
  Object[] argumentValues=new Object[this.argumentNodes.length + 1];
  argumentValues[0]=function.getLexicalScope();
  for (int i=1; i <= argumentValues.length; i++) {
    argumentValues[i]=this.argumentNodes[i - 1].execute(virtualFrame);
  }
  return this.dispatchNode.executeDispatch(virtualFrame,function,argumentValues);
}

Fixed version (ground truth):
@Override @ExplodeLoop public Object execute(VirtualFrame virtualFrame){
  MumblerFunction function=this.evaluateFunction(virtualFrame);
  Object[] argumentValues=new Object[this.argumentNodes.length + 1];
  argumentValues[0]=function.getLexicalScope();
  for (int i=0; i < this.argumentNodes.length; i++) {
    argumentValues[i + 1]=this.argumentNodes[i].execute(virtualFrame);
  }
  return this.callNode.call(virtualFrame,function.callTarget,argumentValues);
}
Program: 40689
Project: 40689
Buggy source:
public static MumblerFunction create(FrameSlot[] arguments,MumblerNode[] bodyNodes){
  return new MumblerFunction(Truffle.getRuntime().createCallTarget(MumblerRootNode.create(arguments,bodyNodes)));
}

Fixed version (ground truth):
public static MumblerFunction create(FrameSlot[] arguments,MumblerNode[] bodyNodes,FrameDescriptor frameDescriptor){
  return new MumblerFunction(Truffle.getRuntime().createCallTarget(MumblerRootNode.create(arguments,bodyNodes,frameDescriptor)));
}
Program: 40691
Project: 40691
Buggy source:
@Override public void onFail(){
  mMessageHelper.notifyUploadFail(title);
  mMakerItemProgressBar.setVisibility(View.INVISIBLE);
}

Fixed version (ground truth):
@Override public void onFail(){
  Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_LONG).show();
  mMakerItemProgressBar.setVisibility(View.INVISIBLE);
}
Program: 40692
Project: 40692
Buggy source:
public void startItemUpload(final String title,final String description){
  mMakerItemProgressBar.setVisibility(View.VISIBLE);
  mStickyFooterContainer.setVisibility(View.INVISIBLE);
  mRequestMethods.addMakerItem(title,catId,description,mMediaUri,new RequestMethods.RequestCallback(){
    @Override public void onSuccess(){
      mMessageHelper.notifyUploadSuccess(title);
      mMakerItemProgressBar.setVisibility(View.INVISIBLE);
      finish();
    }
    @Override public void onFail(){
      mMessageHelper.notifyUploadFail(title);
      mMakerItemProgressBar.setVisibility(View.INVISIBLE);
    }
  }
);
}

Fixed version (ground truth):
public void startItemUpload(final String title,final String description){
  mMakerItemProgressBar.setVisibility(View.VISIBLE);
  mDoneButton.setEnabled(false);
  mDoneButton.setTextColor(getResources().getColor(R.color.hint_disabled_text_material_light));
  mRequestMethods.addMakerItem(title,catId,description,mMediaUri,new RequestMethods.RequestCallback(){
    @Override public void onSuccess(){
      new android.os.Handler().postDelayed(new Runnable(){
        @Override public void run(){
          Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_LONG).show();
          mMakerItemProgressBar.setVisibility(View.INVISIBLE);
          Intent intent=new Intent(AddItemActivity.this,MainActivity.class);
          startActivity(intent);
        }
      }
,1000);
    }
    @Override public void onFail(){
      Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_LONG).show();
      mMakerItemProgressBar.setVisibility(View.INVISIBLE);
    }
  }
);
}
Program: 40693
Project: 40693
Buggy source:
@Override public void onSuccess(){
  mMessageHelper.notifyUploadSuccess(title);
  mMakerItemProgressBar.setVisibility(View.INVISIBLE);
  finish();
}

Fixed version (ground truth):
@Override public void onSuccess(){
  new android.os.Handler().postDelayed(new Runnable(){
    @Override public void run(){
      Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_LONG).show();
      mMakerItemProgressBar.setVisibility(View.INVISIBLE);
      Intent intent=new Intent(AddItemActivity.this,MainActivity.class);
      startActivity(intent);
    }
  }
,1000);
}
Program: 40696
Project: 40696
Buggy source:
@Override public void onViewTap(View view,float x,float y){
  Log.v(TAG,"String_Node_Str");
  if (galleryImage.getVisibility() == View.INVISIBLE) {
    galleryImage.setVisibility(View.VISIBLE);
  }
 else {
    galleryImage.setVisibility(View.INVISIBLE);
  }
}

Fixed version (ground truth):
@Override public void onViewTap(View view,float x,float y){
  Log.v(TAG,"String_Node_Str");
  if (galleryCaption.getVisibility() == View.INVISIBLE) {
    galleryCaption.setVisibility(View.VISIBLE);
  }
 else {
    galleryCaption.setVisibility(View.INVISIBLE);
  }
}