nus-yam/ex-repair huggingface dataset:
Program: 79923
Project: 79923
Buggy source:
private void initializeMenu(Menu menu){
  getMenuInflater().inflate(R.menu.radar_actions,menu);
  addFavorite=menu.findItem(R.id.action_add_favorite);
  removeFavorite=menu.findItem(R.id.action_remove_favorite);
  MenuItem refresh=menu.findItem(R.id.action_refresh);
  List<Favorite> favorites=settingsDB.favoriteDao().findByData(source,location,type,loop,enhanced,distance);
  if (favorites.size() > 0) {
    addFavorite.setVisible(false);
    currentFavorite=favorites.get(0).getUid();
  }
 else {
    removeFavorite.setVisible(false);
  }
  if (needKey)   refresh.setVisible(false);
}

Fixed version (ground truth):
private void initializeMenu(Menu menu){
  getMenuInflater().inflate(R.menu.radar_actions,menu);
  addFavorite=menu.findItem(R.id.action_add_favorite);
  removeFavorite=menu.findItem(R.id.action_remove_favorite);
  MenuItem refresh=menu.findItem(R.id.action_refresh);
  List<Favorite> favorites=settingsDB.favoriteDao().findByData(source,location,type,loop,enhanced,distance);
  if (favorites.size() > 0) {
    addFavorite.setVisible(false);
    if (!needKey)     currentFavorite=favorites.get(0).getUid();
  }
 else {
    removeFavorite.setVisible(false);
  }
  if (needKey)   refresh.setVisible(false);
}
Program: 79924
Project: 79924
Buggy source:
private void scheduleRefresh(){
  if (timer != null) {
    timer.cancel();
    timer=null;
  }
  timer=new Timer();
  refreshed=true;
  timer.schedule(new TimerTask(){
    @Override public void run(){
      refreshed=false;
    }
  }
,1000 * 60 * 5);
}

Fixed version (ground truth):
private void scheduleRefresh(){
  if (timer != null) {
    timer.cancel();
    timer=null;
  }
  timer=new Timer();
  refreshed=true;
  timer.scheduleAtFixedRate(new TimerTask(){
    @Override public void run(){
      refreshed=false;
    }
  }
,1000 * 60 * 5,1000 * 60 * 5);
}
Program: 79925
Project: 79925
Buggy source:
@Override public void onCreate(final Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  addPreferencesFromResource(R.xml.preferences);
  AppDatabase settingsDB=AppDatabase.getAppDatabase(getActivity());
  List<Favorite> favorites=settingsDB.favoriteDao().getAll();
  final ListPreference selectedFavorite=(ListPreference)findPreference("String_Node_Str");
  ArrayList<String> names=new ArrayList<>();
  ArrayList<String> values=new ArrayList<>();
  for (  Favorite favorite : favorites) {
    names.add(favorite.getName());
    values.add(String.valueOf(favorite.getUid()));
  }
  CharSequence[] n=names.toArray(new CharSequence[names.size()]);
  CharSequence[] v=values.toArray(new CharSequence[values.size()]);
  selectedFavorite.setEntries(n);
  selectedFavorite.setEntryValues(v);
  final SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(getActivity());
  selectedFavorite.setEnabled(settings.getBoolean("String_Node_Str",false));
  CheckBoxPreference showFavorite=(CheckBoxPreference)findPreference("String_Node_Str");
  showFavorite.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener(){
    @Override public boolean onPreferenceChange(    Preference preference,    Object o){
      selectedFavorite.setEnabled(!settings.getBoolean("String_Node_Str",false));
      return true;
    }
  }
);
}

Fixed version (ground truth):
@Override public void onCreate(final Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  addPreferencesFromResource(R.xml.preferences);
  final ListPreference selectedFavorite=(ListPreference)findPreference("String_Node_Str");
  final CheckBoxPreference showFavorite=(CheckBoxPreference)findPreference("String_Node_Str");
  AppDatabase settingsDB=AppDatabase.getAppDatabase(getActivity());
  List<Favorite> favorites=settingsDB.favoriteDao().getAll();
  if (favorites.size() == 0) {
    selectedFavorite.setEnabled(false);
    showFavorite.setEnabled(false);
    showFavorite.setChecked(false);
  }
  ArrayList<String> names=new ArrayList<>();
  ArrayList<String> values=new ArrayList<>();
  for (  Favorite favorite : favorites) {
    names.add(favorite.getName());
    values.add(String.valueOf(favorite.getUid()));
  }
  CharSequence[] n=names.toArray(new CharSequence[names.size()]);
  CharSequence[] v=values.toArray(new CharSequence[values.size()]);
  selectedFavorite.setEntries(n);
  selectedFavorite.setEntryValues(v);
  final SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(getActivity());
  selectedFavorite.setEnabled(settings.getBoolean("String_Node_Str",false));
  showFavorite.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener(){
    @Override public boolean onPreferenceChange(    Preference preference,    Object o){
      selectedFavorite.setEnabled(!settings.getBoolean("String_Node_Str",false));
      return true;
    }
  }
);
}
Program: 79926
Project: 79926
Buggy source:
/** 
 * Flux.generate( (Consumer<SynchronousSink<WebSocketMessage>>) sink -> sink.next(session.textMessage("Hello " + System.currentTimeMillis())) ).delayElements(Duration.ofSeconds(1))
 * @return
 */
private double randomDelta(){
  state+=ThreadLocalRandom.current().nextDouble(-2.0,5.0);
  return 0.0;
}

Fixed version (ground truth):
private double randomDelta(){
  return ThreadLocalRandom.current().nextDouble(-2.0,5.0);
}
Program: 79928
Project: 79928
Buggy source:
@Override public boolean onLongClick(View v){
  if (!isBigliettoComprato) {
    daAcquistare=true;
    Vibrator vibe=(Vibrator)getSystemService(Context.VIBRATOR_SERVICE);
    if (vibe != null) {
      vibe.vibrate(VIBRATION_DURATE);
    }
    doRevealAnimation();
    new Handler().postDelayed(new Runnable(){
      @Override public void run(){
        Snackbar snack=Snackbar.make(findViewById(R.id.resume_container_1),R.string.snackConfermaPrenotazione,Snackbar.LENGTH_LONG);
        snack.setAction(android.R.string.cancel,new View.OnClickListener(){
          @Override public void onClick(          View v){
            daAcquistare=false;
          }
        }
);
        snack.setDuration(SNACKBAR_CONFERMA_DURATION);
        snack.show();
        new Handler().postDelayed(new Runnable(){
          @Override public void run(){
            if (daAcquistare) {
              long idPrenotazione=PrenotazioneQueries.addPrenotazione(new Prenotazione(0,idProgrammazione,idUtente));
              for (              Integer index : posti) {
                PostoPrenotato p=new PostoPrenotato(0,(int)idPrenotazione,index);
                PostoPrenotatoQueries.addPostoPrenotato(p);
                isBigliettoComprato=!isBigliettoComprato;
              }
            }
 else {
              Snackbar.make(findViewById(R.id.resume_container_1),R.string.snackAnnullataPrenotazione,Snackbar.LENGTH_LONG).show();
            }
          }
        }
,SNACKBAR_CONFERMA_DURATION);
      }
    }
,ANIMATION_DURATION + SECOND_ANIM_DURATION);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onLongClick(View v){
  if (!isBigliettoComprato) {
    daAcquistare=true;
    Vibrator vibe=(Vibrator)getSystemService(Context.VIBRATOR_SERVICE);
    if (vibe != null) {
      vibe.vibrate(VIBRATION_DURATE);
    }
    doRevealAnimation();
    new Handler().postDelayed(new Runnable(){
      @Override public void run(){
        Snackbar snack=Snackbar.make(findViewById(R.id.resume_container_1),R.string.snackConfermaPrenotazione,Snackbar.LENGTH_LONG);
        snack.setAction(android.R.string.cancel,new View.OnClickListener(){
          @Override public void onClick(          View v){
            daAcquistare=false;
          }
        }
);
        snack.setDuration(SNACKBAR_CONFERMA_DURATION);
        snack.show();
        new Handler().postDelayed(new Runnable(){
          @Override public void run(){
            if (daAcquistare) {
              long idPrenotazione=PrenotazioneQueries.addPrenotazione(new Prenotazione(0,idProgrammazione,idUtente));
              for (              Integer index : posti) {
                PostoPrenotato p=new PostoPrenotato(0,(int)idPrenotazione,index);
                PostoPrenotatoQueries.addPostoPrenotato(p);
              }
              isBigliettoComprato=!isBigliettoComprato;
            }
 else {
              Snackbar.make(findViewById(R.id.resume_container_1),R.string.snackAnnullataPrenotazione,Snackbar.LENGTH_LONG).show();
            }
          }
        }
,SNACKBAR_CONFERMA_DURATION);
      }
    }
,ANIMATION_DURATION + SECOND_ANIM_DURATION);
  }
  return true;
}
Program: 79929
Project: 79929
Buggy source:
private boolean quantumLocking(){
  if (!WAConfig.angels.angelLocking)   return false;
  if (ticksExisted % 5 == 0) {
    List<EntityQuantumLockBase> entityList=world.getEntitiesWithinAABB(EntityQuantumLockBase.class,getEntityBoundingBox().grow(32.0D));
    if (entityList.isEmpty()) {
      return false;
    }
    for (    EntityQuantumLockBase viewer : entityList) {
      if (viewer != this && !world.isRemote) {
        if (viewer instanceof EntityWeepingAngel) {
          EntityWeepingAngel angelViewer=(EntityWeepingAngel)viewer;
          if (angelViewer.getPose().equals(PoseManager.AngelPoses.HIDING_FACE.toString())) {
          }
        }
        boolean viewed=AngelUtils.isInSight(viewer,this);
        if (viewed) {
          setSeenTime(getSeenTime() + 1);
        }
 else {
          setSeenTime(0);
        }
        return viewed;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean quantumLocking(){
  if (!WAConfig.angels.angelLocking)   return false;
  if (ticksExisted % 5 == 0) {
    for (    EntityQuantumLockBase viewer : world.getEntitiesWithinAABB(EntityQuantumLockBase.class,getEntityBoundingBox().grow(32.0D))) {
      if (viewer != this && !world.isRemote) {
        if (viewer instanceof EntityWeepingAngel) {
          EntityWeepingAngel angelViewer=(EntityWeepingAngel)viewer;
          if (angelViewer.getPose().equals(PoseManager.AngelPoses.HIDING_FACE.toString())) {
            return false;
          }
        }
        boolean viewed=AngelUtils.isInSight(viewer,this);
        if (viewed) {
          setSeenTime(getSeenTime() + 1);
        }
 else {
          setSeenTime(0);
        }
        return viewed;
      }
    }
  }
  return false;
}
Program: 79930
Project: 79930
Buggy source:
@Override public void render(Entity entityIn,float limbSwing,float limbSwingAmount,float ageInTicks,float netHeadYaw,float headPitch,float scale){
  setRotationAngles(limbSwing,limbSwingAmount,ageInTicks,netHeadYaw,headPitch,scale,entityIn);
  this.head_2.render(scale);
  this.head.render(scale);
  GlStateManager.pushMatrix();
  GL11.glEnable(GL11.GL_CULL_FACE);
  GlStateManager.translate(this.body.offsetX,this.body.offsetY,this.body.offsetZ);
  GlStateManager.translate(this.body.rotationPointX * scale,this.body.rotationPointY * scale,this.body.rotationPointZ * scale);
  GlStateManager.scale(0.7D,0.7D,0.7D);
  GlStateManager.translate(-this.body.offsetX,-this.body.offsetY,-this.body.offsetZ);
  GlStateManager.translate(-this.body.rotationPointX * scale,-this.body.rotationPointY * scale,-this.body.rotationPointZ * scale);
  this.body.render(scale);
  GL11.glDisable(GL11.GL_CULL_FACE);
  GlStateManager.popMatrix();
}

Fixed version (ground truth):
@Override public void render(Entity entityIn,float limbSwing,float limbSwingAmount,float ageInTicks,float netHeadYaw,float headPitch,float scale){
  if (entityIn instanceof EntityAngel) {
    EntityAngel angel=(EntityAngel)entityIn;
    if (angel.getSeenTime() == 1) {
      angelAngles(limbSwing,limbSwingAmount,ageInTicks,netHeadYaw,headPitch,scale,entityIn);
    }
  }
  this.head_2.render(scale);
  this.head.render(scale);
  GlStateManager.pushMatrix();
  GL11.glEnable(GL11.GL_CULL_FACE);
  GlStateManager.translate(this.body.offsetX,this.body.offsetY,this.body.offsetZ);
  GlStateManager.translate(this.body.rotationPointX * scale,this.body.rotationPointY * scale,this.body.rotationPointZ * scale);
  GlStateManager.scale(0.7D,0.7D,0.7D);
  GlStateManager.translate(-this.body.offsetX,-this.body.offsetY,-this.body.offsetZ);
  GlStateManager.translate(-this.body.rotationPointX * scale,-this.body.rotationPointY * scale,-this.body.rotationPointZ * scale);
  this.body.render(scale);
  GL11.glDisable(GL11.GL_CULL_FACE);
  GlStateManager.popMatrix();
}
Program: 79931
Project: 79931
Buggy source:
public static AngelPoses getBestPoseForSituation(EntityAngel angel,EntityPlayer player){
  if (angel.getDistance(player) < 1.0F) {
    return AngelPoses.ANGRY;
  }
  if (angel.getDistance(player) < 5.0F) {
    return AngelPoses.ANGRY_TWO;
  }
  if (angel.getDistance(player) < 10.0F) {
    return AngelPoses.OPEN_ARMS;
  }
  if (angel.getDistance(player) < 15.0F) {
    return AngelPoses.THINKING;
  }
  if (angel.getDistance(player) < 25.0F) {
    return AngelPoses.SHY;
  }
  return AngelPoses.DAB;
}

Fixed version (ground truth):
public static AngelPoses getBestPoseForSituation(EntityAngel angel,EntityLivingBase player){
  if (angel.getDistance(player) < 1.0F) {
    return AngelPoses.ANGRY;
  }
  if (angel.getDistance(player) < 5.0F) {
    return AngelPoses.ANGRY_TWO;
  }
  if (angel.getDistance(player) < 10.0F) {
    return AngelPoses.OPEN_ARMS;
  }
  if (angel.getDistance(player) < 15.0F) {
    return AngelPoses.THINKING;
  }
  if (angel.getDistance(player) < 25.0F) {
    return AngelPoses.SHY;
  }
  return AngelPoses.DAB;
}
Program: 79932
Project: 79932
Buggy source:
public EventAngelSeen(EntityPlayer player,EntityAngel angel){
  this.player=player;
  this.angel=angel;
}

Fixed version (ground truth):
public EventAngelSeen(EntityLivingBase entity,EntityAngel angel){
  this.entity=entity;
  this.angel=angel;
}
Program: 79933
Project: 79933
Buggy source:
public WorldGenArms(Block arm){
  this.arm=arm;
  this.state=arm.getDefaultState();
}

Fixed version (ground truth):
public WorldGenArms(){
  this.state=WAObjects.WABlocks.angelArm.getDefaultState();
}
Program: 79934
Project: 79934
Buggy source:
@SubscribeEvent public static void decorateBiomeEvent(DecorateBiomeEvent e){
  if (e.getWorld().getBiome(e.getPos()).isSnowyBiome()) {
    WorldGenArms arms=new WorldGenArms(WAObjects.WABlocks.angelArm);
    if (e.getRand().nextInt(30) <= 10) {
      arms.generate(e.getWorld(),e.getRand(),e.getPos());
    }
  }
}

Fixed version (ground truth):
@SubscribeEvent public static void decorateBiomeEvent(DecorateBiomeEvent e){
  if (e.getWorld().getBiome(e.getPos()).isSnowyBiome()) {
    WorldGenArms arms=new WorldGenArms();
    if (e.getRand().nextInt(30) <= 10) {
      arms.generate(e.getWorld(),e.getRand(),e.getPos());
    }
  }
}
Program: 79935
Project: 79935
Buggy source:
@SubscribeEvent public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent e){
  EntityPlayer player=e.player;
  if (!player.world.isRemote) {
    ForgeVersion.CheckResult version=ForgeVersion.getResult(Loader.instance().activeModContainer());
    if (version.status == ForgeVersion.Status.OUTDATED) {
      TextComponentString url=new TextComponentString(TextFormatting.AQUA + TextFormatting.BOLD.toString() + "String_Node_Str");
      url.getStyle().setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL,"String_Node_Str"));
      url.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,new TextComponentString("String_Node_Str")));
      player.sendMessage(new TextComponentString(TextFormatting.GOLD + "String_Node_Str").appendSibling(url));
      String changes=String.valueOf(version.changes).replace("String_Node_Str" + version.target + "String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
      player.sendMessage(new TextComponentString(TextFormatting.GOLD + "String_Node_Str" + TextFormatting.BLUE+ changes));
    }
  }
}

Fixed version (ground truth):
@SubscribeEvent public static void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent e){
  EntityPlayer player=e.player;
  if (!player.world.isRemote) {
    ForgeVersion.CheckResult version=ForgeVersion.getResult(Loader.instance().activeModContainer());
    if (version.status == ForgeVersion.Status.OUTDATED) {
      TextComponentString url=new TextComponentString(TextFormatting.AQUA + TextFormatting.BOLD.toString() + "String_Node_Str");
      url.getStyle().setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL,"String_Node_Str"));
      url.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,new TextComponentString("String_Node_Str")));
      player.sendMessage(new TextComponentString(TextFormatting.GOLD + "String_Node_Str").appendSibling(url));
      String changes=String.valueOf(version.changes).replace("String_Node_Str" + version.target + "String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
      player.sendMessage(new TextComponentString(TextFormatting.GOLD + "String_Node_Str" + TextFormatting.BLUE+ changes));
    }
  }
}
Program: 79936
Project: 79936
Buggy source:
@SubscribeEvent public void onEntityUpdate(LivingEvent.LivingUpdateEvent event){
  if (event.getEntity() instanceof EntityPlayer) {
    EntityPlayer player=(EntityPlayer)event.getEntity();
    AngelUtils.getAllAngels(player,40,40);
  }
  if (event.getEntity() instanceof EntityAngel) {
    EntityAngel angel=(EntityAngel)event.getEntity();
    if (WAConfig.angels.angelLocking) {
      AngelUtils.getAllAngels(angel);
    }
  }
}

Fixed version (ground truth):
@SubscribeEvent public static void onEntityUpdate(LivingEvent.LivingUpdateEvent event){
  if (event.getEntity() instanceof EntityPlayer) {
    EntityPlayer player=(EntityPlayer)event.getEntity();
    AngelUtils.getAllAngels(player,40,40);
  }
  if (event.getEntity() instanceof EntityAngel) {
    EntityAngel angel=(EntityAngel)event.getEntity();
    if (WAConfig.angels.angelLocking) {
      AngelUtils.getAllAngels(angel);
    }
  }
}
Program: 79937
Project: 79937
Buggy source:
@EventHandler public void init(FMLInitializationEvent event){
  MinecraftForge.EVENT_BUS.register(new CommonEvents());
  WAObjects.setUpSpawns();
  GameRegistry.registerWorldGenerator(new WorldGenCatacombs(),8);
  GameRegistry.registerTileEntity(TileSnowArm.class,WeepingAngels.MODID + "String_Node_Str");
  GameRegistry.registerTileEntity(TileCG.class,WeepingAngels.MODID + "String_Node_Str");
  PoseManager.init();
  if (event.getSide() == Side.CLIENT) {
    WAObjects.setUpRenders();
  }
}

Fixed version (ground truth):
@EventHandler public void init(FMLInitializationEvent event){
  WAObjects.setUpSpawns();
  GameRegistry.registerWorldGenerator(new WorldGenCatacombs(),8);
  GameRegistry.registerTileEntity(TileSnowArm.class,WeepingAngels.MODID + "String_Node_Str");
  GameRegistry.registerTileEntity(TileCG.class,WeepingAngels.MODID + "String_Node_Str");
  PoseManager.init();
  if (event.getSide() == Side.CLIENT) {
    WAObjects.setUpRenders();
  }
}
Program: 79938
Project: 79938
Buggy source:
public static void getAllAngels(EntityAngel angel){
  for (  EntityAngel angel2 : angel.world.getEntitiesWithinAABB(EntityAngel.class,angel.getEntityBoundingBox().grow(20,20,20))) {
    if (angel.canEntityBeSeen(angel2) && angel != angel2 && isInSight(angel,angel2)) {
      angel2.setSeen(true);
    }
  }
}

Fixed version (ground truth):
public static void getAllAngels(EntityAngel angel_viewer){
  for (  EntityAngel angel2 : angel_viewer.world.getEntitiesWithinAABB(EntityAngel.class,angel_viewer.getEntityBoundingBox().grow(20,20,20))) {
    if (angel_viewer.canEntityBeSeen(angel2) && angel_viewer != angel2 && isInSight(angel_viewer,angel2)) {
      angel2.setSeen(true);
    }
  }
}
Program: 79939
Project: 79939
Buggy source:
private static boolean isInSight(EntityLivingBase player,Entity angel){
  return player.canEntityBeSeen(angel) && isInEyeLine(player,angel);
}

Fixed version (ground truth):
private static boolean isInSight(EntityLivingBase livingBase,Entity angel){
  return livingBase.canEntityBeSeen(angel) && isInEyeLine(livingBase,angel);
}
Program: 79940
Project: 79940
Buggy source:
private static boolean isInEyeLine(Entity player,Entity angel){
  double dx=angel.posX - player.posX;
  double dz;
  for (dz=angel.posZ - player.posZ; dx * dx + dz * dz < 1.0E-4D; dz=(Math.random() - Math.random()) * 0.01D) {
    dx=(Math.random() - Math.random()) * 0.01D;
  }
  while (player.rotationYaw > 360) {
    player.rotationYaw-=360;
  }
  while (player.rotationYaw < -360) {
    player.rotationYaw+=360;
  }
  float yaw=(float)(Math.atan2(dz,dx) * 180.0D / Math.PI) - player.rotationYaw;
  yaw=yaw - 90;
  while (yaw < -180) {
    yaw+=360;
  }
  while (yaw >= 180) {
    yaw-=360;
  }
  return yaw < 60 && yaw > -60;
}

Fixed version (ground truth):
private static boolean isInEyeLine(Entity livingBase,Entity angel){
  double dx=angel.posX - livingBase.posX;
  double dz;
  for (dz=angel.posZ - livingBase.posZ; dx * dx + dz * dz < 1.0E-4D; dz=(Math.random() - Math.random()) * 0.01D) {
    dx=(Math.random() - Math.random()) * 0.01D;
  }
  while (livingBase.rotationYaw > 360) {
    livingBase.rotationYaw-=360;
  }
  while (livingBase.rotationYaw < -360) {
    livingBase.rotationYaw+=360;
  }
  float yaw=(float)(Math.atan2(dz,dx) * 180.0D / Math.PI) - livingBase.rotationYaw;
  yaw=yaw - 90;
  while (yaw < -180) {
    yaw+=360;
  }
  while (yaw >= 180) {
    yaw-=360;
  }
  return yaw < 60 && yaw > -60;
}
Program: 79941
Project: 79941
Buggy source:
public static boolean isInMainHand(EntityPlayer holder,Item item){
  return isInHand(EnumHand.MAIN_HAND,holder,item);
}

Fixed version (ground truth):
public static boolean isInMainHand(EntityLivingBase holder,Item item){
  return isInHand(EnumHand.MAIN_HAND,holder,item);
}
Program: 79942
Project: 79942
Buggy source:
public static boolean isInEitherHand(EntityPlayer holder,Item item){
  return isInMainHand(holder,item) || isInOffHand(holder,item);
}

Fixed version (ground truth):
public static boolean isInEitherHand(EntityLivingBase holder,Item item){
  return isInMainHand(holder,item) || isInOffHand(holder,item);
}
Program: 79943
Project: 79943
Buggy source:
public static boolean isInHand(EnumHand hand,EntityPlayer holder,Item item){
  if (!holder.getHeldItem(hand).isEmpty()) {
    ItemStack heldItem=holder.getHeldItem(hand);
    return heldItem.getItem() == item;
  }
  return false;
}

Fixed version (ground truth):
public static boolean isInHand(EnumHand hand,EntityLivingBase holder,Item item){
  if (!holder.getHeldItem(hand).isEmpty()) {
    ItemStack heldItem=holder.getHeldItem(hand);
    return heldItem.getItem() == item;
  }
  return false;
}
Program: 79944
Project: 79944
Buggy source:
public static boolean isInOffHand(EntityPlayer holder,Item item){
  return isInHand(EnumHand.OFF_HAND,holder,item);
}

Fixed version (ground truth):
public static boolean isInOffHand(EntityLivingBase holder,Item item){
  return isInHand(EnumHand.OFF_HAND,holder,item);
}
Program: 79945
Project: 79945
Buggy source:
public static boolean handLightCheck(EntityPlayer player){
  for (  Item item : lightItems) {
    if (isInEitherHand(player,item)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean handLightCheck(EntityLivingBase player){
  for (  Item item : lightItems) {
    if (isInEitherHand(player,item)) {
      return true;
    }
  }
  return false;
}
Program: 79946
Project: 79946
Buggy source:
@EventHandler public void init(FMLInitializationEvent event){
  MinecraftForge.EVENT_BUS.register(new CommonEvents());
  WAObjects.setUpSpawns();
  GameRegistry.registerWorldGenerator(new WorldGenCatacombs(),8);
  GameRegistry.registerTileEntity(TileSnowArm.class,"String_Node_Str");
  PoseRegistry.init();
  if (event.getSide() == Side.CLIENT) {
    WAObjects.setUpRenders();
  }
}

Fixed version (ground truth):
@EventHandler public void init(FMLInitializationEvent event){
  MinecraftForge.EVENT_BUS.register(new CommonEvents());
  WAObjects.setUpSpawns();
  GameRegistry.registerTileEntity(TileSnowArm.class,"String_Node_Str");
  PoseRegistry.init();
  if (event.getSide() == Side.CLIENT) {
    WAObjects.setUpRenders();
  }
}
Program: 79947
Project: 79947
Buggy source:
public static List<EntityAngel> getAllAngels(EntityLivingBase seeker,int distance,double radius){
  if (distance < 0 || distance > 256) {
    distance=256;
  }
  List<EntityAngel> targets=new ArrayList<>();
  Vec3d vec3=seeker.getLookVec();
  double targetX=seeker.posX;
  double targetY=seeker.posY + seeker.getEyeHeight() - 0.10000000149011612D;
  double targetZ=seeker.posZ;
  double distanceTraveled=0;
  while ((int)distanceTraveled < distance) {
    targetX+=vec3.x;
    targetY+=vec3.y;
    targetZ+=vec3.z;
    distanceTraveled+=vec3.lengthVector();
    AxisAlignedBB bb=new AxisAlignedBB(targetX - radius,targetY - radius,targetZ - radius,targetX + radius,targetY + radius,targetZ + radius);
    List<EntityAngel> list=seeker.world.getEntitiesWithinAABB(EntityAngel.class,bb);
    for (    EntityAngel target : list) {
      if (target != seeker && target.canBeCollidedWith() && isTargetInSight(seeker,target)) {
        if (!targets.contains(target)) {
          targets.add(target);
        }
      }
    }
  }
  return targets;
}

Fixed version (ground truth):
public static void getAllAngels(EntityLivingBase seeker,int distance,double radius){
  if (distance < 0 || distance > 256) {
    distance=256;
  }
  Vec3d vec3=seeker.getLookVec();
  double targetX=seeker.posX;
  double targetY=seeker.posY + seeker.getEyeHeight() - 0.10000000149011612D;
  double targetZ=seeker.posZ;
  double distanceTraveled=0;
  while ((int)distanceTraveled < distance) {
    targetX+=vec3.x;
    targetY+=vec3.y;
    targetZ+=vec3.z;
    distanceTraveled+=vec3.lengthVector();
    AxisAlignedBB bb=new AxisAlignedBB(targetX - radius,targetY - radius,targetZ - radius,targetX + radius,targetY + radius,targetZ + radius);
    List<EntityAngel> list=seeker.world.getEntitiesWithinAABB(EntityAngel.class,bb);
    for (    EntityAngel target : list) {
      if (target != seeker && target.canBeCollidedWith() && isTargetInSight(seeker,target)) {
        target.setSeen(true);
      }
    }
  }
}
Program: 79948
Project: 79948
Buggy source:
public RenderAngel(RenderManager manager,ModelBase model,float shadowSize){
  super(manager,model,shadowSize);
}

Fixed version (ground truth):
public RenderAngel(RenderManager manager,ModelBase model,float shadowSize){
  super(manager,model,shadowSize);
  this.mainModel=modelTwo;
}
Program: 79949
Project: 79949
Buggy source:
@Override protected ResourceLocation getEntityTexture(T entity){
  return TEXTURE;
}

Fixed version (ground truth):
@Override protected ResourceLocation getEntityTexture(T entity){
  return TEXTURE_ONE;
}
Program: 79952
Project: 79952
Buggy source:
@Override public boolean attackEntityAsMob(Entity entity){
  entity.attackEntityFrom(WAObjects.ANGEL,4.0F);
  return super.attackEntityAsMob(entity);
}

Fixed version (ground truth):
@Override public boolean attackEntityAsMob(Entity entity){
  if (rand.nextInt(4) < 2) {
    entity.attackEntityFrom(WAObjects.ANGEL,4.0F);
  }
 else {
    entity.attackEntityFrom(WAObjects.ANGEL_NECK_SNAP,4.0F);
  }
  return super.attackEntityAsMob(entity);
}
Program: 79953
Project: 79953
Buggy source:
private void spawnAngel(World world){
  EntityAngel angel=new EntityAngel(world);
  Utils.teleportEntity(world,angel,this.posX + 1,this.posY + 1,this.posZ + 1);
  world.spawnEntity(angel);
}

Fixed version (ground truth):
private void spawnAngel(World world){
  if (!world.isRemote) {
    EntityAngel angel=new EntityAngel(world);
    angel.copyLocationAndAnglesFrom(this);
    Utils.teleportEntity(world,angel,this.posX + 1,this.posY + 1,this.posZ + 1);
    world.spawnEntity(angel);
  }
}
Program: 79954
Project: 79954
Buggy source:
@Override public void onUpdate(){
  super.onUpdate();
  if (this.rand.nextInt(500) == 250) {
    if (art == EnumArt.AngelOne) {
      spawnAngel(world);
      art=EnumArt.BlankPaintingOne;
    }
    if (art == EnumArt.AngelTwo) {
      spawnAngel(world);
      art=EnumArt.BlankPaintingTwo;
    }
    if (art == EnumArt.AngelThree) {
      spawnAngel(world);
      art=EnumArt.BlankPaintingThree;
    }
    if (art == EnumArt.AngelFour) {
      spawnAngel(world);
      art=EnumArt.BlankPaintingFour;
    }
    if (art == EnumArt.AngelFive) {
      spawnAngel(world);
      art=EnumArt.BlankPaintingFive;
    }
    if (art == EnumArt.AngelSix) {
      spawnAngel(world);
      art=EnumArt.BlankPaintingSix;
    }
  }
}

Fixed version (ground truth):
@Override public void onUpdate(){
  super.onUpdate();
  if (this.rand.nextInt(500) == 250) {
    if (art == EnumArt.AngelOne) {
      spawnAngel(getEntityWorld());
      art=EnumArt.BlankPaintingOne;
    }
    if (art == EnumArt.AngelTwo) {
      spawnAngel(getEntityWorld());
      art=EnumArt.BlankPaintingTwo;
    }
    if (art == EnumArt.AngelThree) {
      spawnAngel(getEntityWorld());
      art=EnumArt.BlankPaintingThree;
    }
    if (art == EnumArt.AngelFour) {
      spawnAngel(getEntityWorld());
      art=EnumArt.BlankPaintingFour;
    }
    if (art == EnumArt.AngelFive) {
      spawnAngel(getEntityWorld());
      art=EnumArt.BlankPaintingFive;
    }
    if (art == EnumArt.AngelSix) {
      spawnAngel(getEntityWorld());
      art=EnumArt.BlankPaintingSix;
    }
  }
}
Program: 79955
Project: 79955
Buggy source:
@SubscribeEvent public static void decorBiomeEvent(DecorateBiomeEvent e){
  if (e.getWorld().getBiome(e.getPos()).isSnowyBiome()) {
    WorldGenArms arms=new WorldGenArms(WAObjects.angelArm);
    if (e.getRand().nextInt(50) == 20) {
      arms.generate(e.getWorld(),e.getRand(),e.getPos());
    }
  }
}

Fixed version (ground truth):
@SubscribeEvent public static void decorBiomeEvent(DecorateBiomeEvent e){
  if (e.getWorld().getBiome(e.getPos()).isSnowyBiome()) {
    WorldGenArms arms=new WorldGenArms(WAObjects.angelArm);
    if (e.getRand().nextInt(30) <= 10) {
      arms.generate(e.getWorld(),e.getRand(),e.getPos());
    }
  }
}
Program: 79956
Project: 79956
Buggy source:
@Override public void update(){
  if (!world.getEntitiesWithinAABB(EntityPlayer.class,AABB.offset(getPos())).isEmpty() && !world.isRemote) {
    EntityAngel angel=new EntityAngel(world);
    Utils.teleportEntity(world,angel,getPos().getX(),getPos().getY(),getPos().getZ());
    angel.setType(0);
    world.spawnEntity(angel);
    world.setBlockToAir(getPos());
  }
}

Fixed version (ground truth):
@Override public void update(){
  if (!world.getEntitiesWithinAABB(EntityPlayer.class,AABB.offset(getPos())).isEmpty() && !world.isRemote) {
    EntityAngel angel=new EntityAngel(world);
    Utils.teleportEntity(world,angel,getPos().getX(),getPos().getY(),getPos().getZ());
    world.spawnEntity(angel);
    world.setBlockToAir(getPos());
  }
}
Program: 79957
Project: 79957
Buggy source:
public void saveStat(Player player,String stat){
  User user=UserManager.getUser(player.getUniqueId());
  config.set(player.getUniqueId().toString() + "String_Node_Str" + stat,user.getInt(stat));
  try {
    config.save(ConfigurationManager.getFile("String_Node_Str"));
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void saveStat(Player player,String stat){
  User user=UserManager.getUser(player.getUniqueId());
  config.set(player.getUniqueId().toString() + "String_Node_Str" + stat,user.getInt(stat));
  try {
    config.save(ConfigurationManager.getFile("String_Node_Str"));
  }
 catch (  IOException e) {
    e.printStackTrace();
    MessageUtils.errorOccured();
    Bukkit.getConsoleSender().sendMessage("String_Node_Str");
    Bukkit.getConsoleSender().sendMessage("String_Node_Str");
  }
}
Program: 79958
Project: 79958
Buggy source:
public Map<UUID,Integer> getColumn(String stat){
  ResultSet set=executeQuery("String_Node_Str" + stat + "String_Node_Str"+ stat+ "String_Node_Str");
  Map<java.util.UUID,java.lang.Integer> column=new LinkedHashMap<>();
  try {
    while (set.next()) {
      column.put(java.util.UUID.fromString(set.getString("String_Node_Str")),set.getInt(stat));
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
  }
  return column;
}

Fixed version (ground truth):
public Map<UUID,Integer> getColumn(String stat){
  ResultSet set=executeQuery("String_Node_Str" + stat + "String_Node_Str"+ stat+ "String_Node_Str");
  Map<java.util.UUID,java.lang.Integer> column=new LinkedHashMap<>();
  try {
    while (set.next()) {
      column.put(java.util.UUID.fromString(set.getString("String_Node_Str")),set.getInt(stat));
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
    MessageUtils.errorOccured();
    Bukkit.getConsoleSender().sendMessage("String_Node_Str");
    Bukkit.getConsoleSender().sendMessage("String_Node_Str");
  }
  return column;
}
Program: 79959
Project: 79959
Buggy source:
public int getStat(String UUID,String stat){
  if (ConfigPreferences.isNameUsedInDatabase()) {
    UUID=Bukkit.getOfflinePlayer(java.util.UUID.fromString(UUID)).getName();
  }
  ResultSet set=executeQuery("String_Node_Str" + stat + "String_Node_Str"+ UUID+ "String_Node_Str");
  try {
    if (!set.next())     return 0;
    return (set.getInt(1));
  }
 catch (  SQLException e) {
    e.printStackTrace();
    return 0;
  }
}

Fixed version (ground truth):
public int getStat(String UUID,String stat){
  if (ConfigPreferences.isNameUsedInDatabase()) {
    UUID=Bukkit.getOfflinePlayer(java.util.UUID.fromString(UUID)).getName();
  }
  ResultSet set=executeQuery("String_Node_Str" + stat + "String_Node_Str"+ UUID+ "String_Node_Str");
  try {
    if (!set.next())     return 0;
    return (set.getInt(1));
  }
 catch (  SQLException e) {
    e.printStackTrace();
    MessageUtils.errorOccured();
    Bukkit.getConsoleSender().sendMessage("String_Node_Str");
    Bukkit.getConsoleSender().sendMessage("String_Node_Str");
    return 0;
  }
}
Program: 79960
Project: 79960
Buggy source:
public QuitEvents(Main plugin){
  this.plugin=plugin;
}

Fixed version (ground truth):
public QuitEvents(Main plugin){
  this.plugin=plugin;
  plugin.getServer().getPluginManager().registerEvents(this,plugin);
}
Program: 79961
Project: 79961
Buggy source:
private void initRecyclerView(){
  RecyclerView recyclerView=findViewById(R.id.recycler_view33);
  recyclerView.setHasFixedSize(true);
  recyclerView.setAdapter(mAdapter);
  recyclerView.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false));
}

Fixed version (ground truth):
private void initRecyclerView(){
  RecyclerView recyclerView=findViewById(R.id.recycler_view33);
  recyclerView.setHasFixedSize(true);
  mAdapter=new CategoriesSearchPageAdapter(this,categoryNames,basket);
  recyclerView.setAdapter(mAdapter);
  recyclerView.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false));
}
Program: 79962
Project: 79962
Buggy source:
@Override public void onAttach(Context context){
  super.onAttach(context);
  dialogListener=(DialogListener)context;
}

Fixed version (ground truth):
@Override public void onAttach(Activity activity){
  super.onAttach(activity);
  dialogListener=(DialogListener)activity;
}
Program: 79963
Project: 79963
Buggy source:
private void initRecyclerView(){
  RecyclerView recyclerView=findViewById(R.id.recycler_view_searched_items);
  recyclerView.setHasFixedSize(true);
  recyclerView.setAdapter(mAdapter);
  recyclerView.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false));
}

Fixed version (ground truth):
private void initRecyclerView(){
  RecyclerView recyclerView=findViewById(R.id.recycler_view_searched_items);
  recyclerView.setHasFixedSize(true);
  mAdapter.replaceBasket(basket);
  recyclerView.setAdapter(mAdapter);
  recyclerView.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false));
}
Program: 79964
Project: 79964
Buggy source:
private void getProductsByCategory(){
  Runnable r=() -> {
    products=gson.getProductsByCategory(category_id);
    if (products != null) {
      mAdapter.replaceList(products);
      runOnUiThread(new Thread(() -> mAdapter.notifyDataSetChanged()));
    }
 else {
      Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_LONG).show();
    }
  }
;
  if (t.isAlive()) {
    t.interrupt();
  }
  t=new Thread(r);
  t.start();
}

Fixed version (ground truth):
private void getProductsByCategory(){
  Runnable r=() -> {
    products=gson.getProductsByCategory(category_id - 1);
    if (products != null) {
      mAdapter.replaceList(products);
      runOnUiThread(new Thread(() -> mAdapter.notifyDataSetChanged()));
    }
 else {
      Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_LONG).show();
    }
  }
;
  if (t.isAlive()) {
    t.interrupt();
  }
  t=new Thread(r);
  t.start();
}
Program: 79965
Project: 79965
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.categories_search_page);
  search_text=findViewById(R.id.search_text);
  search_button=findViewById(R.id.search_button);
  Bundle bundle=getIntent().getBundleExtra("String_Node_Str");
  basket=(Basket)bundle.getSerializable("String_Node_Str");
  initRecyclerView();
  Thread t=new Thread(() -> {
    categorynames=gson.getCategories();
    Log.i("String_Node_Str","String_Node_Str");
    if (categorynames != null) {
      mAdapter.replaceList(categorynames);
      runOnUiThread(new Thread(() -> mAdapter.notifyDataSetChanged()));
    }
    Log.i("String_Node_Str","String_Node_Str");
  }
);
  t.start();
  search_button.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      Intent intent=new Intent(v.getContext(),SearchResults.class);
      Bundle bundle=new Bundle();
      bundle.putSerializable("String_Node_Str",basket);
      bundle.putCharSequence("String_Node_Str",search_text.getText().toString());
      bundle.putInt("String_Node_Str",-1);
      intent.putExtra("String_Node_Str",bundle);
      startActivity(intent);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.categories_search_page);
  search_text=findViewById(R.id.search_text);
  search_button=findViewById(R.id.search_button);
  back_button=findViewById(R.id.backButton);
  Bundle bundle=getIntent().getBundleExtra("String_Node_Str");
  basket=(Basket)bundle.getSerializable("String_Node_Str");
  initRecyclerView();
  Thread t=new Thread(() -> {
    categorynames=gson.getCategories();
    Log.i("String_Node_Str","String_Node_Str");
    if (categorynames != null) {
      mAdapter.replaceList(categorynames);
      runOnUiThread(new Thread(() -> mAdapter.notifyDataSetChanged()));
    }
    Log.i("String_Node_Str","String_Node_Str");
  }
);
  t.start();
  search_button.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      Intent intent=new Intent(v.getContext(),SearchResults.class);
      Bundle bundle=new Bundle();
      bundle.putSerializable("String_Node_Str",basket);
      bundle.putCharSequence("String_Node_Str",search_text.getText().toString());
      bundle.putInt("String_Node_Str",-1);
      intent.putExtra("String_Node_Str",bundle);
      startActivity(intent);
    }
  }
);
  back_button.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      Intent intent=new Intent(v.getContext(),HomeScreen.class);
      Bundle bundle=new Bundle();
      bundle.putSerializable("String_Node_Str",basket);
      intent.putExtra("String_Node_Str",bundle);
      startActivity(intent);
    }
  }
);
}
Program: 79966
Project: 79966
Buggy source:
@Override public void onClick(View v){
  Intent intent=new Intent(v.getContext(),SearchResults.class);
  Bundle bundle=new Bundle();
  bundle.putSerializable("String_Node_Str",basket);
  bundle.putCharSequence("String_Node_Str",search_text.getText().toString());
  bundle.putInt("String_Node_Str",-1);
  intent.putExtra("String_Node_Str",bundle);
  startActivity(intent);
}

Fixed version (ground truth):
@Override public void onClick(View v){
  Intent intent=new Intent(v.getContext(),HomeScreen.class);
  Bundle bundle=new Bundle();
  bundle.putSerializable("String_Node_Str",basket);
  intent.putExtra("String_Node_Str",bundle);
  startActivity(intent);
}
Program: 79967
Project: 79967
Buggy source:
private void explode(){
  this.world.createExplosion(this,this.posX,this.posY + (double)(this.height / 16.0F),this.posZ,8.0F,false);
}

Fixed version (ground truth):
private void explode(){
  this.world.createExplosion(this,this.posX,this.posY + (double)(this.height / 16.0F),this.posZ,8.0F,true);
}
Program: 79968
Project: 79968
Buggy source:
public ItemThrowableTNT(RenderManager renderManagerIn,Item itemIn,RenderItem itemRendererIn){
  super(renderManagerIn);
  this.item=itemIn;
  this.itemRenderer=itemRendererIn;
}

Fixed version (ground truth):
public ItemThrowableTNT(String name){
  MMItems.ITEMS.add(this);
  this.maxStackSize=16;
  this.setRegistryName(name);
  this.setUnlocalizedName(name);
  this.setFull3D();
  this.setCreativeTab(Marcus8448Mod.marcus8448TabItems);
}
Program: 79971
Project: 79971
Buggy source:
@When("String_Node_Str") public void I_send_the_HTTP_request(String method,String url) throws Throwable {
  int pathLength=0;
  if (this.contextPath.length() > 0) {
    pathLength+=this.contextPath.length() + 1;
  }
  if (this.servletPath.length() > 0) {
    pathLength+=this.servletPath.length() + 1;
  }
  request=new MockHttpServletRequest(this.wac.getServletContext(),method,url);
  request.setContextPath(this.contextPath);
  request.setServletPath(this.servletPath);
  request.addHeader("String_Node_Str",host);
  for (  HTTPHeader header : headers) {
    request.addHeader(header.name,header.value);
  }
  for (  HTTPParam param : queryParams) {
    request.addParameter(param.name,param.value);
  }
  request.setPathInfo(url.substring(pathLength));
  chain=this.hm.getHandler(request);
}

Fixed version (ground truth):
@When("String_Node_Str") public void I_send_the_HTTP_request(String method,String url) throws Throwable {
  int pathLength=0;
  if (this.contextPath.length() > 0) {
    pathLength+=this.contextPath.length();
  }
  if (this.servletPath.length() > 0) {
    pathLength+=this.servletPath.length();
  }
  request=new MockHttpServletRequest(this.wac.getServletContext(),method,url);
  request.setContextPath(this.contextPath);
  request.setServletPath(this.servletPath);
  request.addHeader("String_Node_Str",host);
  for (  HTTPHeader header : headers) {
    request.addHeader(header.name,header.value);
  }
  for (  HTTPParam param : queryParams) {
    request.addParameter(param.name,param.value);
  }
  request.setPathInfo(url.substring(pathLength));
  chain=this.hm.getHandler(request);
}
Program: 79972
Project: 79972
Buggy source:
@When("String_Node_Str") public void I_send_the_HTTP_request_with_a_null_pathInfo(String method,String url) throws Throwable {
  request=new MockHttpServletRequest(this.wac.getServletContext(),method,url);
  request.setContextPath(this.contextPath);
  request.setServletPath(this.servletPath);
  request.addHeader("String_Node_Str",host);
  for (  HTTPHeader header : headers) {
    request.addHeader(header.name,header.value);
  }
  for (  HTTPParam param : queryParams) {
    request.addParameter(param.name,param.value);
  }
  request.setPathInfo(null);
  chain=this.hm.getHandler(request);
}

Fixed version (ground truth):
@When("String_Node_Str") public void I_send_the_HTTP_request_with_a_null_pathInfo(String method,String url) throws Throwable {
  request=new MockHttpServletRequest(this.wac.getServletContext());
  request.setMethod(method);
  request.setContextPath(this.contextPath);
  request.setServletPath(url.replaceFirst(this.contextPath,"String_Node_Str"));
  request.addHeader("String_Node_Str",host);
  for (  HTTPHeader header : headers) {
    request.addHeader(header.name,header.value);
  }
  for (  HTTPParam param : queryParams) {
    request.addParameter(param.name,param.value);
  }
  request.setPathInfo(null);
  chain=this.hm.getHandler(request);
}
Program: 79973
Project: 79973
Buggy source:
/** 
 * Get the ran max or min range bound for an autoincrement column.
 * @param dtd The type of the autoincrement column.
 * @param topOrBottom RANGE_TOP or RANGE_BOTTOM
 * @returns the top or bottom of the range
 */
private long getRangeBound(DataTypeDescriptor dtd,int topOrBottom) throws StandardException {
  TypeId typeId=dtd.getTypeId();
  boolean bottom=(topOrBottom == RANGE_BOTTOM);
  if (typeId == TypeId.SMALLINT_ID) {
    return (bottom ? Long.valueOf(Short.MIN_VALUE) : Long.valueOf(Short.MAX_VALUE));
  }
 else   if (typeId == TypeId.INTEGER_ID) {
    return (bottom ? Long.valueOf(Integer.MIN_VALUE) : Long.valueOf(Integer.MAX_VALUE));
  }
 else {
    if (typeId != TypeId.BIGINT_ID) {
      throw StandardException.newException(SQLState.NOT_IMPLEMENTED);
    }
    return (bottom ? Long.MIN_VALUE : Long.MAX_VALUE);
  }
}

Fixed version (ground truth):
/** 
 * Get the ran max or min range bound for an autoincrement column.
 * @param dtd The type of the autoincrement column.
 * @param topOrBottom RANGE_TOP or RANGE_BOTTOM
 * @return the top or bottom of the range
 */
private long getRangeBound(DataTypeDescriptor dtd,int topOrBottom) throws StandardException {
  TypeId typeId=dtd.getTypeId();
  boolean bottom=(topOrBottom == RANGE_BOTTOM);
  if (typeId == TypeId.SMALLINT_ID) {
    return (bottom ? Long.valueOf(Short.MIN_VALUE) : Long.valueOf(Short.MAX_VALUE));
  }
 else   if (typeId == TypeId.INTEGER_ID) {
    return (bottom ? Long.valueOf(Integer.MIN_VALUE) : Long.valueOf(Integer.MAX_VALUE));
  }
 else {
    if (typeId != TypeId.BIGINT_ID) {
      throw StandardException.newException(SQLState.NOT_IMPLEMENTED);
    }
    return (bottom ? Long.MIN_VALUE : Long.MAX_VALUE);
  }
}
Program: 79974
Project: 79974
Buggy source:
public void doneReading(int mode,LanguageConnectionContext lcc) throws StandardException {
  int bindCount=lcc.decrementBindCount();
synchronized (this) {
    if (bindCount == 0) {
      if (mode == DataDictionary.COMPILE_ONLY_MODE) {
        if ((lcc.getStatementContext() != null) && lcc.getStatementContext().inUse()) {
          CompatibilitySpace space=lcc.getTransactionExecute().getLockSpace();
          int unlockCount=lockFactory.unlock(space,space.getOwner(),cacheCoordinator,ShExQual.SH);
          if (SanityManager.DEBUG) {
            if (unlockCount != 1) {
              SanityManager.THROWASSERT("String_Node_Str" + "String_Node_Str" + unlockCount);
            }
          }
        }
      }
 else {
        readersInDDLMode--;
        if (ddlUsers == 0 && readersInDDLMode == 0) {
          clearCaches();
          setCacheMode(DataDictionary.COMPILE_ONLY_MODE);
        }
        if (SanityManager.DEBUG) {
          SanityManager.ASSERT(readersInDDLMode >= 0,"String_Node_Str");
        }
      }
    }
  }
}

Fixed version (ground truth):
public void doneReading(int mode,LanguageConnectionContext lcc) throws StandardException {
  int bindCount=lcc.decrementBindCount();
synchronized (this) {
    if (bindCount == 0) {
      if (mode == DataDictionary.COMPILE_ONLY_MODE) {
        if ((lcc.getStatementContext() != null) && lcc.getStatementContext().inUse()) {
          CompatibilitySpace space=lcc.getTransactionExecute().getLockSpace();
          int unlockCount=lockFactory.unlock(space,space.getOwner(),cacheCoordinator,ShExQual.SH);
          if (SanityManager.DEBUG) {
            if (unlockCount != 1) {
              SanityManager.THROWASSERT("String_Node_Str" + "String_Node_Str" + unlockCount);
            }
          }
        }
      }
 else {
        readersInDDLMode--;
        if (ddlUsers == 0 && readersInDDLMode == 0) {
          clearCaches(false);
          setCacheMode(DataDictionary.COMPILE_ONLY_MODE);
        }
        if (SanityManager.DEBUG) {
          SanityManager.ASSERT(readersInDDLMode >= 0,"String_Node_Str");
        }
      }
    }
  }
}