nus-yam/ex-repair huggingface dataset:
Program: 32606
Project: 32606
Buggy source:
private void patch(){
  PluginConfig config=Settings.getConfig();
  for (  final Player player : this.getServer().getOnlinePlayers()) {
    this.getServer().getScheduler().runTask(this,() -> PacketExtension.registerPlayer(player));
    User user=User.get(player);
    user.getScoreboard();
    user.getDummy();
    user.getRank();
    if (config.playerlistEnable) {
      AbstractTablist.createTablist(config.playerList,config.playerListHeader,config.playerListFooter,config.playerListPing,player);
    }
  }
  for (  Guild guild : GuildUtils.getGuilds()) {
    EntityUtil.spawn(guild);
    guild.updateRank();
  }
}

Fixed version (ground truth):
private void patch(){
  PluginConfig config=Settings.getConfig();
  for (  final Player player : this.getServer().getOnlinePlayers()) {
    this.getServer().getScheduler().runTask(this,() -> PacketExtension.registerPlayer(player));
    User user=User.get(player);
    user.getScoreboard();
    user.getDummy();
    user.getRank();
    if (config.playerlistEnable) {
      AbstractTablist.createTablist(config.playerList,config.playerListHeader,config.playerListFooter,config.playerListPing,player);
    }
  }
  for (  Guild guild : GuildUtils.getGuilds()) {
    if (config.createMaterial == Material.DRAGON_EGG) {
      EntityUtil.spawn(guild);
    }
    guild.updateRank();
  }
}
Program: 32607
Project: 32607
Buggy source:
@Override public void execute(CommandSender s,String[] args){
  MessagesConfig m=Messages.getInstance();
  Player p=(Player)s;
  User lp=User.get(p);
  if (!lp.hasGuild()) {
    p.sendMessage(m.enlargeHasNotGuild);
    return;
  }
  if (!lp.isOwner() && !lp.isDeputy()) {
    p.sendMessage(m.enlargeIsNotOwner);
    return;
  }
  Region region=Region.get(lp.getGuild().getRegion());
  int enlarge=region.getEnlarge();
  PluginConfig c=Settings.getConfig();
  if (enlarge > c.enlargeItems.size() - 1) {
    p.sendMessage(m.enlargeMaxSize);
    return;
  }
  ItemStack need=c.enlargeItems.get(enlarge);
  if (!p.getInventory().containsAtLeast(need,need.getAmount())) {
    p.sendMessage(m.enlargeItem.replace("String_Node_Str",need.getAmount() + "String_Node_Str" + need.getType().name().toLowerCase()));
    return;
  }
  if (RegionUtils.isNear(region.getCenter())) {
    p.sendMessage(m.enlargeIsNear);
    return;
  }
  p.getInventory().removeItem(need);
  region.setEnlarge(enlarge + 1);
  region.setSize(region.getSize() + c.enlargeSize);
  String tm=m.enlargeDone.replace("String_Node_Str",region.getSize() + "String_Node_Str").replace("String_Node_Str",region.getEnlarge() + "String_Node_Str");
  for (  User user : lp.getGuild().getMembers()) {
    OfflinePlayer of=Bukkit.getOfflinePlayer(user.getName());
    if (of.isOnline()) {
      of.getPlayer().sendMessage(tm);
    }
  }
}

Fixed version (ground truth):
@Override public void execute(CommandSender s,String[] args){
  MessagesConfig m=Messages.getInstance();
  PluginConfig c=Settings.getConfig();
  Player p=(Player)s;
  User lp=User.get(p);
  if (!c.enlargeEnable) {
    return;
  }
  if (!lp.hasGuild()) {
    p.sendMessage(m.enlargeHasNotGuild);
    return;
  }
  if (!lp.isOwner() && !lp.isDeputy()) {
    p.sendMessage(m.enlargeIsNotOwner);
    return;
  }
  Region region=Region.get(lp.getGuild().getRegion());
  int enlarge=region.getEnlarge();
  if (enlarge > c.enlargeItems.size() - 1) {
    p.sendMessage(m.enlargeMaxSize);
    return;
  }
  ItemStack need=c.enlargeItems.get(enlarge);
  if (!p.getInventory().containsAtLeast(need,need.getAmount())) {
    p.sendMessage(m.enlargeItem.replace("String_Node_Str",need.getAmount() + "String_Node_Str" + need.getType().name().toLowerCase()));
    return;
  }
  if (RegionUtils.isNear(region.getCenter())) {
    p.sendMessage(m.enlargeIsNear);
    return;
  }
  p.getInventory().removeItem(need);
  region.setEnlarge(enlarge + 1);
  region.setSize(region.getSize() + c.enlargeSize);
  String tm=m.enlargeDone.replace("String_Node_Str",region.getSize() + "String_Node_Str").replace("String_Node_Str",region.getEnlarge() + "String_Node_Str");
  for (  User user : lp.getGuild().getMembers()) {
    OfflinePlayer of=Bukkit.getOfflinePlayer(user.getName());
    if (of.isOnline()) {
      of.getPlayer().sendMessage(tm);
    }
  }
}
Program: 32609
Project: 32609
Buggy source:
public static boolean has(Player player){
  return bars.containsKey(player) && bars.get(player) != null;
}

Fixed version (ground truth):
public static boolean has(Player player){
  return DRAGONBAR_CACHE.containsKey(player) && DRAGONBAR_CACHE.get(player) != null;
}
Program: 32610
Project: 32610
Buggy source:
public static void set(final Player player,String text,float percent,int time){
  remove(player);
  FakeDragon dragon=bars.containsKey(player) ? bars.get(player) : null;
  if (text.length() > 64) {
    text=text.substring(0,63);
  }
  if (percent > 1.0f) {
    percent=1.0f;
  }
  if (percent < 0.05f) {
    percent=0.05f;
  }
  if (text.isEmpty() && dragon != null) {
    remove(player);
  }
  if (dragon == null) {
    dragon=new FakeDragon(player.getLocation().add(0,-200,0),text,percent);
    sendPacket(player,dragon.getSpawnPacket());
    bars.put(player,dragon);
  }
 else {
    dragon.setName(text);
    dragon.setHealth(percent);
    sendPacket(player,dragon.getMetaPacket(dragon.getWatcher()));
    sendPacket(player,dragon.getTeleportPacket(player.getLocation().add(0,-200,0)));
  }
  Bukkit.getScheduler().runTaskLater(FunnyGuilds.getInstance(),new Runnable(){
    @Override public void run(){
      NotificationBar.remove(player);
    }
  }
,time * 20);
}

Fixed version (ground truth):
public static void set(final Player player,String text,float percent,int time){
  remove(player);
  FakeDragon dragon=DRAGONBAR_CACHE.containsKey(player) ? DRAGONBAR_CACHE.get(player) : null;
  if (text.length() > 64) {
    text=text.substring(0,63);
  }
  if (percent > 1.0f) {
    percent=1.0f;
  }
  if (percent < 0.05f) {
    percent=0.05f;
  }
  if (text.isEmpty() && dragon != null) {
    remove(player);
  }
  if (dragon == null) {
    dragon=new FakeDragon(player.getLocation().add(0,-200,0),text,percent);
    sendPacket(player,dragon.getSpawnPacket());
    DRAGONBAR_CACHE.put(player,dragon);
  }
 else {
    dragon.setName(text);
    dragon.setHealth(percent);
    sendPacket(player,dragon.getMetaPacket(dragon.getWatcher()));
    sendPacket(player,dragon.getTeleportPacket(player.getLocation().add(0,-200,0)));
  }
  Bukkit.getScheduler().runTaskLater(FunnyGuilds.getInstance(),new Runnable(){
    @Override public void run(){
      NotificationBar.remove(player);
    }
  }
,time * 20);
}
Program: 32611
Project: 32611
Buggy source:
@Override public void run(){
  player_list++;
  ban_system++;
  validity_system++;
  if (validity_system >= 10) {
    validitySystem();
  }
  if (ban_system >= 7) {
    banSystem();
  }
  for (  Player player : Bukkit.getOnlinePlayers()) {
    if (!AbstractTablist.hasTablist(player)) {
      AbstractTablist.createTablist(Settings.getConfig().playerList,Settings.getConfig().playerListHeader,Settings.getConfig().playerListFooter,Settings.getConfig().playerListPing,player);
    }
    final AbstractTablist tablist=AbstractTablist.getTablist(player);
    tablist.send();
  }
}

Fixed version (ground truth):
@Override public void run(){
  player_list++;
  ban_system++;
  validity_system++;
  if (validity_system >= 10) {
    validitySystem();
  }
  if (ban_system >= 7) {
    banSystem();
  }
  if (Settings.getConfig().playerlistEnable) {
    for (    Player player : Bukkit.getOnlinePlayers()) {
      if (!AbstractTablist.hasTablist(player)) {
        AbstractTablist.createTablist(Settings.getConfig().playerList,Settings.getConfig().playerListHeader,Settings.getConfig().playerListFooter,Settings.getConfig().playerListPing,player);
      }
      final AbstractTablist tablist=AbstractTablist.getTablist(player);
      tablist.send();
    }
  }
}
Program: 32612
Project: 32612
Buggy source:
@EventHandler public void onJoin(PlayerJoinEvent e){
  final Player player=e.getPlayer();
  final User user=User.get(player);
  if (config.playerlistEnable) {
    AbstractTablist.createTablist(config.playerList,config.playerListHeader,config.playerListFooter,config.playerListPing,player);
  }
  user.getScoreboard();
  IndependentThread.actions(ActionType.PREFIX_GLOBAL_UPDATE_PLAYER,player);
  IndependentThread.actions(ActionType.DUMMY_GLOBAL_UPDATE_USER,user);
  IndependentThread.actions(ActionType.RANK_UPDATE_USER,user);
  this.plugin.getServer().getScheduler().runTaskLaterAsynchronously(this.plugin,() -> {
    PacketExtension.registerPlayer(player);
    Version.check(player);
    Region region=RegionUtils.getAt(player.getLocation());
    if (region == null || region.getGuild() == null) {
      return;
    }
    if (Settings.getConfig().createStringMaterial.equalsIgnoreCase("String_Node_Str")) {
      EntityUtil.spawn(region.getGuild(),player);
    }
  }
,30L);
}

Fixed version (ground truth):
@EventHandler public void onJoin(PlayerJoinEvent e){
  final Player player=e.getPlayer();
  final User user=User.get(player);
  if (config.playerlistEnable) {
    if (!AbstractTablist.hasTablist(player)) {
      AbstractTablist.createTablist(config.playerList,config.playerListHeader,config.playerListFooter,config.playerListPing,player);
    }
  }
  user.getScoreboard();
  IndependentThread.actions(ActionType.PREFIX_GLOBAL_UPDATE_PLAYER,player);
  IndependentThread.actions(ActionType.DUMMY_GLOBAL_UPDATE_USER,user);
  IndependentThread.actions(ActionType.RANK_UPDATE_USER,user);
  this.plugin.getServer().getScheduler().runTaskLaterAsynchronously(this.plugin,() -> {
    PacketExtension.registerPlayer(player);
    Version.check(player);
    Region region=RegionUtils.getAt(player.getLocation());
    if (region == null || region.getGuild() == null) {
      return;
    }
    if (Settings.getConfig().createStringMaterial.equalsIgnoreCase("String_Node_Str")) {
      EntityUtil.spawn(region.getGuild(),player);
    }
  }
,30L);
}
Program: 32613
Project: 32613
Buggy source:
@Override public void run(){
  player_list++;
  ban_system++;
  validity_system++;
  if (validity_system >= 10) {
    validitySystem();
  }
  if (ban_system >= 7) {
    banSystem();
  }
  for (  Player player : Bukkit.getOnlinePlayers()) {
    final AbstractTablist tablist=AbstractTablist.getTablist(player);
    tablist.send();
  }
}

Fixed version (ground truth):
@Override public void run(){
  player_list++;
  ban_system++;
  validity_system++;
  if (validity_system >= 10) {
    validitySystem();
  }
  if (ban_system >= 7) {
    banSystem();
  }
  for (  Player player : Bukkit.getOnlinePlayers()) {
    if (!AbstractTablist.hasTablist(player)) {
      AbstractTablist.createTablist(Settings.getConfig().playerList,Settings.getConfig().playerListHeader,Settings.getConfig().playerListFooter,Settings.getConfig().playerListPing,player);
    }
    final AbstractTablist tablist=AbstractTablist.getTablist(player);
    tablist.send();
  }
}
Program: 32614
Project: 32614
Buggy source:
@EventHandler public void onJoin(PlayerJoinEvent e){
  final Player player=e.getPlayer();
  User user=User.get(player);
  user.getScoreboard();
  IndependentThread.actions(ActionType.PREFIX_GLOBAL_UPDATE_PLAYER,player);
  IndependentThread.actions(ActionType.DUMMY_GLOBAL_UPDATE_USER,user);
  IndependentThread.actions(ActionType.RANK_UPDATE_USER,user);
  IndependentThread.action(ActionType.PLAYERLIST_SEND,user);
  this.plugin.getServer().getScheduler().runTaskLaterAsynchronously(this.plugin,() -> {
    PacketExtension.registerPlayer(player);
    if (Settings.getConfig().createStringMaterial.equalsIgnoreCase("String_Node_Str")) {
      EntityUtil.spawn(player);
    }
    Version.check(player);
  }
,40L);
}

Fixed version (ground truth):
@EventHandler public void onJoin(PlayerJoinEvent e){
  final Player player=e.getPlayer();
  User user=User.get(player);
  user.getScoreboard();
  IndependentThread.actions(ActionType.PREFIX_GLOBAL_UPDATE_PLAYER,player);
  IndependentThread.actions(ActionType.DUMMY_GLOBAL_UPDATE_USER,user);
  IndependentThread.actions(ActionType.RANK_UPDATE_USER,user);
  IndependentThread.action(ActionType.PLAYERLIST_SEND,user);
  this.plugin.getServer().getScheduler().runTaskLaterAsynchronously(this.plugin,() -> {
    PacketExtension.registerPlayer(player);
    Version.check(player);
  }
,30L);
}
Program: 32616
Project: 32616
Buggy source:
public static void spawn(Player... players){
  for (  Guild guild : GuildUtils.getGuilds()) {
    try {
      Object o=null;
      if (!entitesMap.containsKey(guild)) {
        Location loc=Region.get(guild.getRegion()).getCenter();
        if (loc == null) {
          continue;
        }
        int id=spawnPacket(loc);
        o=ids.get(id);
        entitesMap.put(guild,id);
      }
 else {
        o=ids.get(entitesMap.get(guild));
      }
      PacketSender.sendPacket(players,o);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public static void spawn(Guild guild,Player... players){
  try {
    Object o=null;
    if (!entitesMap.containsKey(guild)) {
      Location loc=Region.get(guild.getRegion()).getCenter();
      if (loc == null) {
        return;
      }
      int id=spawnPacket(loc);
      o=ids.get(id);
      entitesMap.put(guild,id);
    }
 else {
      o=ids.get(entitesMap.get(guild));
    }
    PacketSender.sendPacket(players,o);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 32617
Project: 32617
Buggy source:
public static boolean isNear(Location center){
  if (center == null) {
    return false;
  }
  PluginConfig s=Settings.getConfig();
  int i=s.regionSize;
  if (s.enlargeItems != null) {
    i+=s.enlargeItems.size() * s.enlargeSize;
  }
  int requiredDistance=2 * i + s.regionMinDistance;
  for (  Region region : regions) {
    if (region.getCenter() == null) {
      return false;
    }
    if (!center.getWorld().equals(region.getCenter().getWorld())) {
      return false;
    }
    double distance=center.distance(region.getCenter());
    return distance < requiredDistance;
  }
  return false;
}

Fixed version (ground truth):
public static boolean isNear(Location center){
  if (center == null) {
    return false;
  }
  PluginConfig s=Settings.getConfig();
  int i=s.regionSize;
  if (s.enlargeItems != null) {
    i+=(s.enlargeItems.size() * s.enlargeSize);
  }
  int requiredDistance=(2 * i) + s.regionMinDistance;
  for (  Region region : regions) {
    if (region.getCenter() == null)     continue;
    if (region.getCenter().equals(center))     continue;
    if (!center.getWorld().equals(region.getCenter().getWorld()))     continue;
    if (center.distance(region.getCenter()) < requiredDistance)     return true;
  }
  return false;
}
Program: 32619
Project: 32619
Buggy source:
public void update(Guild guild){
  if (!this.guilds.contains(guild.getRank())) {
    this.guilds.add(guild.getRank());
  }
 else {
    Collections.sort(this.guilds);
  }
}

Fixed version (ground truth):
public void update(Guild guild){
  if (!this.guilds.contains(guild.getRank())) {
    this.guilds.add(guild.getRank());
  }
 else {
    Collections.sort(this.guilds);
    for (int i=0; i < guilds.size(); i++) {
      Rank rank=guilds.get(i);
      rank.setPosition(i + 1);
    }
  }
}
Program: 32620
Project: 32620
Buggy source:
@EventHandler public void onReceive(PacketReceiveEvent event){
  try {
    if (!event.getPacketName().equals("String_Node_Str")) {
      return;
    }
    Object packet=event.getPacket();
    if (packet == null) {
      return;
    }
    final Player player=event.getPlayer();
    int id=Reflections.getPrivateField(packet.getClass(),"String_Node_Str").getInt(packet);
    Object actionEnum=Reflections.getPrivateField(packet.getClass(),"String_Node_Str").get(packet);
    int action=Reflections.getPrivateField(actionEnum.getClass(),"String_Node_Str").getInt(actionEnum);
    for (    final Entry<Guild,Integer> entry : EntityUtil.map.entrySet()) {
      if (!entry.getValue().equals(id)) {
        continue;
      }
      Guild guild=entry.getKey();
      if (SecuritySystem.getSecurity().checkPlayer(player,guild)) {
        return;
      }
      if (action == 1) {
        WarSystem.getInstance().attack(player,entry.getKey());
      }
 else {
        new ExcInfo().execute(player,new String[]{entry.getKey().getTag()});
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@EventHandler public void onReceive(PacketReceiveEvent event){
  try {
    if (!event.getPacketName().equals("String_Node_Str")) {
      return;
    }
    Object packet=event.getPacket();
    if (packet == null) {
      return;
    }
    Field aField=Reflections.getPrivateField(packet.getClass(),"String_Node_Str");
    if (aField == null) {
      return;
    }
    int id=aField.getInt(packet);
    Field actionField=Reflections.getPrivateField(packet.getClass(),"String_Node_Str");
    if (actionField == null) {
      return;
    }
    Object actionEnum=actionField.get(packet);
    if (actionEnum == null) {
      return;
    }
    Player player=event.getPlayer();
    int action=Reflections.getPrivateField(actionEnum.getClass(),"String_Node_Str").getInt(actionEnum);
    for (    final Entry<Guild,Integer> entry : EntityUtil.map.entrySet()) {
      if (!entry.getValue().equals(id)) {
        continue;
      }
      Guild guild=entry.getKey();
      if (SecuritySystem.getSecurity().checkPlayer(player,guild)) {
        return;
      }
      if (action == 1) {
        WarSystem.getInstance().attack(player,entry.getKey());
      }
 else {
        ExcInfo excInfo=new ExcInfo();
        String[] parameters=new String[]{entry.getKey().getTag()};
        excInfo.execute(player,parameters);
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 32622
Project: 32622
Buggy source:
public void fadeView(View c,int top,int heightOfView,ListView listView,AtomicInteger firstVisiblePosition,AtomicBoolean lowerHalf,AtomicInteger initialPosition,int startingPositionForScroll,StringBuilder firstVisibleText,AtomicBoolean oneViewScrolled){
  int fadeFraction=0;
  if (!lowerHalf.get()) {
    fadeFraction=findFadeFraction(top,heightOfView,listView,firstVisiblePosition,lowerHalf,initialPosition,firstVisibleText);
  }
 else {
    fadeFraction=findFadeFractionLower(c,top,heightOfView,listView,firstVisiblePosition,lowerHalf,initialPosition,startingPositionForScroll,oneViewScrolled);
  }
  mColorDrawable.setAlpha(fadeFraction);
  TextView rowText=(TextView)mDummyView.findViewById(R.id.row_text);
  if (fadeFraction == 0) {
    rowText.setTextColor(getResources().getColor(mSelectedRowResourceId));
  }
 else {
    rowText.setTextColor(mColorDrawable.getColor());
  }
}

Fixed version (ground truth):
public void fadeView(View c,int top,int heightOfView,ListView listView,AtomicInteger firstVisiblePosition,AtomicBoolean lowerHalf,AtomicInteger initialPosition,int startingPositionForScroll,StringBuilder firstVisibleText,AtomicBoolean oneViewScrolled){
  int fadeFraction=0;
  if (!lowerHalf.get()) {
    fadeFraction=findFadeFraction(c,top,heightOfView,listView,firstVisiblePosition,lowerHalf,initialPosition,firstVisibleText);
  }
 else {
    fadeFraction=findFadeFractionLower(c,top,heightOfView,listView,firstVisiblePosition,lowerHalf,initialPosition,startingPositionForScroll,oneViewScrolled);
  }
  mColorDrawable.setAlpha(fadeFraction);
  TextView rowText=(TextView)mDummyView.findViewById(R.id.row_text);
  if (fadeFraction == 0) {
    rowText.setTextColor(getResources().getColor(mSelectedRowResourceId));
  }
 else {
    rowText.setTextColor(mColorDrawable.getColor());
  }
}
Program: 32624
Project: 32624
Buggy source:
public int findFadeFraction(int top,int heightOfView,ListView listView,AtomicInteger firstVisiblePosition,AtomicBoolean lowerHalf,AtomicInteger initialPosition,StringBuilder firstVisibleText){
  int id=0;
  if (listView.getId() == R.id.month_listview) {
    id=R.id.row_text;
  }
 else {
    id=R.id.row_number;
  }
  if (Math.abs(top - initialPosition.get()) >= heightOfView && !firstVisibleText.toString().equalsIgnoreCase(((TextView)(getMiddleView(listView,0).findViewById(id))).getText().toString())) {
    initialPosition.set(top);
    lowerHalf.set(true);
    firstVisibleText.delete(0,firstVisibleText.length());
    firstVisibleText.append(((TextView)(getMiddleView(listView,0).findViewById(id))).getText().toString());
    setNewDayOfWeek(listView);
    return 0;
  }
 else   if (top == initialPosition.get())   return (255);
  int x=(int)((255.0 * 1 * initialPosition.get()) / (Math.abs(top - initialPosition.get()) + initialPosition.get())) - Math.abs(top - initialPosition.get());
  return x >= 0 ? x : 0;
}

Fixed version (ground truth):
public int findFadeFraction(View c,int top,int heightOfView,ListView listView,AtomicInteger firstVisiblePosition,AtomicBoolean lowerHalf,AtomicInteger initialPosition,StringBuilder firstVisibleText){
  int id=0;
  id=R.id.row_number;
  if (Math.abs(top - initialPosition.get()) >= heightOfView) {
    int currentValue=Integer.parseInt(((TextView)c.findViewById(R.id.row_number)).getText().toString());
    int newValue=0;
    if (top > initialPosition.get()) {
      if (currentValue == 1)       currentValue=13;
      setNewDayOfWeek(listView,currentValue - 1);
    }
 else     if (top < initialPosition.get()) {
      if (currentValue == 12)       currentValue=0;
      setNewDayOfWeek(listView,currentValue + 1);
    }
    initialPosition.set(top);
    lowerHalf.set(true);
    firstVisibleText.delete(0,firstVisibleText.length());
    firstVisibleText.append(((TextView)(getMiddleView(listView,0).findViewById(id))).getText().toString());
    return 0;
  }
 else   if (top == initialPosition.get())   return (255);
  int x=(int)((255.0 * 1 * initialPosition.get()) / (Math.abs(top - initialPosition.get()) + initialPosition.get())) - Math.abs(top - initialPosition.get());
  return x >= 0 ? x : 0;
}
Program: 32625
Project: 32625
Buggy source:
private void setNewDayOfWeek(ListView listView){
  View monthView=getMiddleView(mMonthListview,mMiddlePositionFromTop);
  View yearView=getMiddleView(mYearListView,mMiddlePositionFromTop);
  int month=Integer.parseInt(((TextView)monthView.findViewById(R.id.row_number)).getText().toString());
  int year=Integer.parseInt(((TextView)yearView.findViewById(R.id.row_number)).getText().toString());
  int dateInDummyView=Integer.parseInt(((TextView)mDummyView.findViewById(R.id.row_number)).getText().toString());
  Date date=new GregorianCalendar(year,month - 1,dateInDummyView).getTime();
  ((TextView)mDummyView.findViewById(R.id.row_text)).setText(new SimpleDateFormat("String_Node_Str").format(date));
}

Fixed version (ground truth):
private void setNewDayOfWeek(ListView listView,int value){
  View monthView=getMiddleView(mMonthListview,mMiddlePositionFromTop);
  View yearView=getMiddleView(mYearListView,mMiddlePositionFromTop);
  int month=Integer.parseInt(((TextView)monthView.findViewById(R.id.row_number)).getText().toString());
  int year=Integer.parseInt(((TextView)yearView.findViewById(R.id.row_number)).getText().toString());
  int dateInDummyView=Integer.parseInt(((TextView)mDummyView.findViewById(R.id.row_number)).getText().toString());
  if (listView.getId() == R.id.month_listview) {
    month=value;
  }
 else {
    year=value;
  }
  Date date=new GregorianCalendar(year,month - 1,dateInDummyView).getTime();
  ((TextView)mDummyView.findViewById(R.id.row_text)).setText(new SimpleDateFormat("String_Node_Str").format(date));
}
Program: 32626
Project: 32626
Buggy source:
private void scrollUp(final ListView listview,final View view,final int viewTop,final ListView listView,final MonthYearAdapter adapter,final int currentPosInMiddle){
  listView.post(new Runnable(){
    @Override public void run(){
      highLightMiddleRow(listView,view,adapter,currentPosInMiddle);
      listView.smoothScrollBy(viewTop - mRootLayoutHeight / 3,1000);
    }
  }
);
}

Fixed version (ground truth):
private void scrollUp(final int i,final ListView listview,final View view,final int viewTop,final ListView listView,final MonthYearAdapter adapter,final int currentPosInMiddle){
  listView.post(new Runnable(){
    @Override public void run(){
      highLightMiddleRow(listView,view,adapter,currentPosInMiddle);
      listView.smoothScrollBy(viewTop - mRootLayoutHeight / 3,1000);
      putDayOnDummyView(listview,i);
    }
  }
);
}
Program: 32628
Project: 32628
Buggy source:
private void scrollDown(final ListView listview,final View view,final int viewBottom,final int viewHeight,final ListView listView,final MonthYearAdapter adapter,final int currentPosInMiddle){
  listView.post(new Runnable(){
    @Override public void run(){
      highLightMiddleRow(listview,view,adapter,currentPosInMiddle);
      listView.smoothScrollBy(viewBottom - (mRootLayoutHeight / 3 + viewHeight),1000);
    }
  }
);
}

Fixed version (ground truth):
private void scrollDown(final int i,final ListView listview,final View view,final int viewBottom,final int viewHeight,final ListView listView,final MonthYearAdapter adapter,final int currentPosInMiddle){
  listView.post(new Runnable(){
    @Override public void run(){
      highLightMiddleRow(listview,view,adapter,currentPosInMiddle);
      listView.smoothScrollBy(viewBottom - (mRootLayoutHeight / 3 + viewHeight),1000);
      putDayOnDummyView(listview,i);
    }
  }
);
}
Program: 32629
Project: 32629
Buggy source:
public int findFadeFractionLower(View c,int top,int heightOfView,ListView listView,AtomicInteger firstVisiblePosition,AtomicBoolean lowerhalf,AtomicInteger initialPosition,int startingPositionForScroll,AtomicBoolean oneViewScrolled){
  if (Math.abs(top - initialPosition.get()) >= heightOfView) {
    lowerhalf.set(false);
    initialPosition.set(startingPositionForScroll);
    firstVisiblePosition.set(listView.getFirstVisiblePosition());
    c.setTag(null);
    oneViewScrolled.set(false);
    return 255;
  }
 else   if (top < initialPosition.get() || c.getBottom() > initialPosition.get() + heightOfView) {
    setNewDayOfWeek(listView);
  }
 else   if (top == initialPosition.get())   return 0;
  int x=(int)((Math.abs(top - initialPosition.get()) * 1.0 / initialPosition.get()) * 255.0) + Math.abs(top - initialPosition.get());
  return x <= 255 ? x : 255;
}

Fixed version (ground truth):
public int findFadeFractionLower(View c,int top,int heightOfView,ListView listView,AtomicInteger firstVisiblePosition,AtomicBoolean lowerhalf,AtomicInteger initialPosition,int startingPositionForScroll,AtomicBoolean oneViewScrolled){
  if (Math.abs(top - initialPosition.get()) >= heightOfView) {
    lowerhalf.set(false);
    initialPosition.set(mRootLayoutHeight / 3);
    firstVisiblePosition.set(listView.getFirstVisiblePosition());
    c.setTag(null);
    oneViewScrolled.set(false);
    return 255;
  }
 else   if (initialPosition.get() > mRootLayoutHeight / 3 && top < initialPosition.get() || ((initialPosition.get() < mRootLayoutHeight / 3 + heightOfView) && (c.getBottom() > mRootLayoutHeight / 3 + heightOfView))) {
    int currentValue=Integer.parseInt(((TextView)c.findViewById(R.id.row_number)).getText().toString());
    int newValue=0;
    setNewDayOfWeek(listView,currentValue);
  }
 else   if (top == initialPosition.get())   return 0;
  int x=(int)((Math.abs(top - initialPosition.get()) * 1.0 / initialPosition.get()) * 255.0) + Math.abs(top - initialPosition.get());
  return x <= 255 ? x : 255;
}
Program: 32630
Project: 32630
Buggy source:
public void onScrollStateChanged(AbsListView view,int scrollState){
  state.setScrollState(scrollState);
  mActionBar.getCustomView().findViewById(R.id.done).setVisibility(View.GONE);
  if (scrollState == OnScrollListener.SCROLL_STATE_IDLE) {
    mActionBar.getCustomView().findViewById(R.id.done).setVisibility(View.VISIBLE);
    if (listView.getId() == R.id.month_listview || listView.getId() == R.id.year_listview) {
      putDayOnDummyView();
    }
  }
  if (scrollState == OnScrollListener.SCROLL_STATE_IDLE && !listBeingTouched.get()) {
    putSomeRowInMiddle(listView,adapter);
    itemScrolledToMiddle.set(true);
  }
}

Fixed version (ground truth):
public void onScrollStateChanged(AbsListView view,int scrollState){
  state.setScrollState(scrollState);
  mActionBar.getCustomView().findViewById(R.id.done).setVisibility(View.GONE);
  if (scrollState == OnScrollListener.SCROLL_STATE_IDLE) {
    mActionBar.getCustomView().findViewById(R.id.done).setVisibility(View.VISIBLE);
    if (listView.getId() == R.id.month_listview || listView.getId() == R.id.year_listview) {
    }
  }
  if (scrollState == OnScrollListener.SCROLL_STATE_IDLE && !listBeingTouched.get()) {
    putSomeRowInMiddle(listView,adapter);
    itemScrolledToMiddle.set(true);
  }
}
Program: 32631
Project: 32631
Buggy source:
private void putDayOnDummyView(){
  View monthView=getMiddleView(mMonthListview,mMiddlePositionFromTop);
  View yearView=getMiddleView(mYearListView,mMiddlePositionFromTop);
  int month=Integer.parseInt(((TextView)monthView.findViewById(R.id.row_number)).getText().toString());
  int year=Integer.parseInt(((TextView)yearView.findViewById(R.id.row_number)).getText().toString());
  int date=Integer.parseInt(((TextView)mDummyView.findViewById(R.id.row_number)).getText().toString());
  Calendar cal=new GregorianCalendar(year,month - 1,date);
  String dayOfWeek=new SimpleDateFormat("String_Node_Str").format(cal.getTime());
  ((TextView)mDummyView.findViewById(R.id.row_text)).setText(dayOfWeek);
}

Fixed version (ground truth):
private void putDayOnDummyView(ListView listView,int position){
  View monthView=getMiddleView(mMonthListview,mMiddlePositionFromTop);
  View yearView=getMiddleView(mYearListView,mMiddlePositionFromTop);
  if (listView.getId() == R.id.month_listview) {
    monthView=getMiddleView(mMonthListview,position);
    yearView=getMiddleView(mYearListView,mMiddlePositionFromTop);
  }
 else   if (listView.getId() == R.id.year_listview) {
    yearView=getMiddleView(mYearListView,position);
    monthView=getMiddleView(mMonthListview,mMiddlePositionFromTop);
  }
  int month=Integer.parseInt(((TextView)monthView.findViewById(R.id.row_number)).getText().toString());
  int year=Integer.parseInt(((TextView)yearView.findViewById(R.id.row_number)).getText().toString());
  int date=Integer.parseInt(((TextView)mDummyView.findViewById(R.id.row_number)).getText().toString());
  Calendar cal=new GregorianCalendar(year,month - 1,date);
  String dayOfWeek=new SimpleDateFormat("String_Node_Str").format(cal.getTime());
  ((TextView)mDummyView.findViewById(R.id.row_text)).setText(dayOfWeek);
}
Program: 32633
Project: 32633
Buggy source:
private void scrollUp(ListView listview,final View view,final int viewTop,final ListView listView,final MonthYearAdapter adapter,final int currentPosInMiddle){
  listView.post(new Runnable(){
    @Override public void run(){
      listView.smoothScrollBy(viewTop - mRootLayoutHeight / 3,1000);
      highLightMiddleRow(listView,view,adapter,currentPosInMiddle);
    }
  }
);
}

Fixed version (ground truth):
private void scrollUp(final ListView listview,final View view,final int viewTop,final ListView listView,final MonthYearAdapter adapter,final int currentPosInMiddle){
  listView.post(new Runnable(){
    @Override public void run(){
      highLightMiddleRow(listView,view,adapter,currentPosInMiddle);
      listView.smoothScrollBy(viewTop - mRootLayoutHeight / 3,1000);
    }
  }
);
}
Program: 32635
Project: 32635
Buggy source:
private void scrollDown(final ListView listview,final View view,final int viewBottom,final int viewHeight,final ListView listView,final MonthYearAdapter adapter,final int currentPosInMiddle){
  listView.post(new Runnable(){
    @Override public void run(){
      listView.smoothScrollBy(viewBottom - (mRootLayoutHeight / 3 + viewHeight),1000);
      highLightMiddleRow(listview,view,adapter,currentPosInMiddle);
    }
  }
);
}

Fixed version (ground truth):
private void scrollDown(final ListView listview,final View view,final int viewBottom,final int viewHeight,final ListView listView,final MonthYearAdapter adapter,final int currentPosInMiddle){
  listView.post(new Runnable(){
    @Override public void run(){
      highLightMiddleRow(listview,view,adapter,currentPosInMiddle);
      listView.smoothScrollBy(viewBottom - (mRootLayoutHeight / 3 + viewHeight),1000);
    }
  }
);
}
Program: 32636
Project: 32636
Buggy source:
private void setAllListeners(){
  setListenersOnListView(mMonthAdapter,mMonthListview,mMonthListBeingTouched,mScrollStateOfMonthView,mMonthViewVisible,mFirstVisiblePositionMonth,mLowerHalfMonth,mInitialPositionMonth,mStartingPositionOfScrollMonth,mFirstVisibleMonth);
  setListenersOnListView(mYearAdapter,mYearListView,mYearListBeingTouched,mScrollStateOfYearView,mYearViewVisible,mFirstVisiblePositionYear,mLowerHalfYear,mInitialPositionYear,mStartingPositionOfScrollYear,mFirstVisibleYear);
  setListenersOnListView(mDateAdapter,mDateListView,mDateListBeingTouched,mScrollStateOfDayView,mDateViewVisible,new AtomicInteger(0),new AtomicBoolean(),new AtomicInteger(0),0,null);
}

Fixed version (ground truth):
private void setAllListeners(){
  setListenersOnListView(mMonthAdapter,mMonthListview,mMonthListBeingTouched,mScrollStateOfMonthView,mMonthViewVisible,mFirstVisiblePositionMonth,mLowerHalfMonth,mInitialPositionMonth,mStartingPositionOfScrollMonth,mFirstVisibleMonth,itemScrolledToMiddleMonth);
  setListenersOnListView(mYearAdapter,mYearListView,mYearListBeingTouched,mScrollStateOfYearView,mYearViewVisible,mFirstVisiblePositionYear,mLowerHalfYear,mInitialPositionYear,mStartingPositionOfScrollYear,mFirstVisibleYear,itemScrolledToMiddleYear);
  setListenersOnListView(mDateAdapter,mDateListView,mDateListBeingTouched,mScrollStateOfDayView,mDateViewVisible,new AtomicInteger(0),new AtomicBoolean(),new AtomicInteger(0),0,null,itemScrolledToMiddleDate);
}
Program: 32637
Project: 32637
Buggy source:
public void onScrollStateChanged(AbsListView view,int scrollState){
  state.setScrollState(scrollState);
  mActionBar.getCustomView().findViewById(R.id.done).setVisibility(View.GONE);
  if (scrollState == OnScrollListener.SCROLL_STATE_IDLE) {
    mActionBar.getCustomView().findViewById(R.id.done).setVisibility(View.VISIBLE);
  }
  if (scrollState == OnScrollListener.SCROLL_STATE_IDLE && !listBeingTouched.get() && !mItemMovedToMiddle) {
    putSomeRowInMiddle(listView,adapter);
    mItemMovedToMiddle=true;
  }
}

Fixed version (ground truth):
public void onScrollStateChanged(AbsListView view,int scrollState){
  state.setScrollState(scrollState);
  mActionBar.getCustomView().findViewById(R.id.done).setVisibility(View.GONE);
  if (scrollState == OnScrollListener.SCROLL_STATE_IDLE) {
    mActionBar.getCustomView().findViewById(R.id.done).setVisibility(View.VISIBLE);
  }
  if (scrollState == OnScrollListener.SCROLL_STATE_IDLE && !listBeingTouched.get()) {
    putSomeRowInMiddle(listView,adapter);
    itemScrolledToMiddle.set(true);
  }
}
Program: 32640
Project: 32640
Buggy source:
@Override public boolean onTouch(View v,MotionEvent event){
  if (event.getAction() == MotionEvent.ACTION_DOWN) {
    if (state.getScrollState() == OnScrollListener.SCROLL_STATE_IDLE) {
      setOtherListViewsInvisible(listView);
      if (!adapter.getAllItemsVisible()) {
        listBeingTouched.set(true);
        adapter.setAllItemsVisible(true);
        adapter.highlightCurrentMonthColor(false);
        adapter.notifyDataSetChanged();
      }
 else       if (adapter.getAllItemsVisible() && adapter.getHighlightCurrentMonth()) {
        listBeingTouched.set(true);
        adapter.highlightCurrentMonthColor(false);
        adapter.notifyDataSetChanged();
      }
    }
 else     if (state.getScrollState() == OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) {
      listBeingTouched.set(true);
    }
  }
  if (event.getAction() == MotionEvent.ACTION_UP) {
    if (state.getScrollState() == OnScrollListener.SCROLL_STATE_IDLE) {
      listBeingTouched.compareAndSet(true,false);
      adapter.highlightCurrentMonthColor(true);
      adapter.notifyDataSetChanged();
    }
 else     if (state.getScrollState() == OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) {
      listBeingTouched.compareAndSet(true,false);
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onTouch(View v,MotionEvent event){
  if (event.getAction() == MotionEvent.ACTION_DOWN) {
    if (state.getScrollState() == OnScrollListener.SCROLL_STATE_IDLE) {
      setOtherListViewsInvisible(listView);
      if (!adapter.getAllItemsVisible()) {
        listBeingTouched.set(true);
        adapter.setAllItemsVisible(true);
        adapter.highlightCurrentMonthColor(false);
        adapter.notifyDataSetChanged();
      }
 else       if (adapter.getAllItemsVisible() && adapter.getHighlightCurrentMonth()) {
        listBeingTouched.set(true);
        adapter.highlightCurrentMonthColor(false);
        adapter.notifyDataSetChanged();
      }
    }
 else     if (state.getScrollState() == OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) {
      listBeingTouched.set(true);
    }
  }
  if (event.getAction() == MotionEvent.ACTION_UP) {
    if (state.getScrollState() == OnScrollListener.SCROLL_STATE_IDLE) {
      listBeingTouched.compareAndSet(true,false);
      putThisViewInMiddle(event.getY(),listView);
      adapter.highlightCurrentMonthColor(true);
      adapter.notifyDataSetChanged();
    }
 else     if (state.getScrollState() == OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) {
      listBeingTouched.compareAndSet(true,false);
    }
  }
  return false;
}
Program: 32641
Project: 32641
Buggy source:
void putThisViewInMiddle(float y,final ListView listView,MonthYearAdapter adapter){
  double yValue=Math.ceil((double)y);
  Log.d("String_Node_Str","String_Node_Str" + yValue);
  for (int i=0; i <= listView.getLastVisiblePosition() - listView.getFirstVisiblePosition(); i++) {
    View v=listView.getChildAt(i);
    if (v != null) {
      if (yValue >= v.getTop() - listView.getDividerHeight() && yValue <= v.getBottom()) {
        Log.d("String_Node_Str","String_Node_Str" + v.getTop() + "String_Node_Str"+ v.getBottom()+ "String_Node_Str"+ mRootLayoutHeight / 3);
        scrollToMiddle(listView,i,v,adapter);
        break;
      }
    }
  }
}

Fixed version (ground truth):
void putThisViewInMiddle(float y,final ListView listView,MonthYearAdapter adapter){
  double yValue=Math.ceil((double)y);
  for (int i=0; i <= listView.getLastVisiblePosition() - listView.getFirstVisiblePosition(); i++) {
    View v=listView.getChildAt(i);
    if (v != null) {
      if (yValue >= v.getTop() - listView.getDividerHeight() && yValue <= v.getBottom()) {
        scrollToMiddle(listView,i,v,adapter);
        break;
      }
    }
  }
}
Program: 32642
Project: 32642
Buggy source:
@Override public void onGlobalLayout(){
  rootLayout.getViewTreeObserver().removeGlobalOnLayoutListener(this);
  mRootLayoutHeight=rootLayout.getMeasuredHeight();
  mMonthListview.setSelectionFromTop(mCurrentMonthPosition,mRootLayoutHeight / 3);
  mYearListView.setSelectionFromTop(mCurrentYearPosition,mRootLayoutHeight / 3);
  mDateListView.setSelectionFromTop(mCurrentDatePosition,mRootLayoutHeight / 3);
  setListenersOnListView(mMonthAdapter,mMonthListview,mMonthListBeingTouched,mScrollStateOfMonthView,mMonthViewVisible);
  setListenersOnListView(mYearAdapter,mYearListView,mYearListBeingTouched,mScrollStateOfYearView,mYearViewVisible);
  setListenersOnListView(mDateAdapter,mDateListView,mDateListBeingTouched,mScrollStateOfDayView,mDateViewVisible);
  mMiddlePositionFromTop=mCurrentMonthPosition - mMonthListview.getFirstVisiblePosition();
}

Fixed version (ground truth):
@Override public void onGlobalLayout(){
  rootLayout.getViewTreeObserver().removeGlobalOnLayoutListener(this);
  mRootLayoutHeight=rootLayout.getMeasuredHeight();
  mMonthListview.setSelectionFromTop(mCurrentMonthPosition,mRootLayoutHeight / 3);
  mYearListView.setSelectionFromTop(mCurrentYearPosition,mRootLayoutHeight / 3);
  mDateListView.setSelectionFromTop(mCurrentDatePosition,mRootLayoutHeight / 3);
  setListenersOnListView(mMonthAdapter,mMonthListview,mMonthListBeingTouched,mScrollStateOfMonthView,mMonthViewVisible);
  setListenersOnListView(mYearAdapter,mYearListView,mYearListBeingTouched,mScrollStateOfYearView,mYearViewVisible);
  setListenersOnListView(mDateAdapter,mDateListView,mDateListBeingTouched,mScrollStateOfDayView,mDateViewVisible);
  getMiddlePosition();
}
Program: 32644
Project: 32644
Buggy source:
void scrollToMiddle(final ListView listView,final int i,final View v,MonthYearAdapter adapter){
  adapter.setCurrentPos(listView.getFirstVisiblePosition() + i);
  adapter.notifyDataSetChanged();
  listView.smoothScrollBy(v.getTop() - mRootLayoutHeight / 3,1000);
  Log.d("String_Node_Str","String_Node_Str" + v.getTop() + "String_Node_Str"+ v.getBottom()+ "String_Node_Str"+ mRootLayoutHeight / 3);
}

Fixed version (ground truth):
void scrollToMiddle(final ListView listView,final int i,final View v,MonthYearAdapter adapter){
  adapter.setCurrentPos(listView.getFirstVisiblePosition() + i);
  adapter.notifyDataSetChanged();
  listView.smoothScrollBy(v.getTop() - mRootLayoutHeight / 3,1000);
  getInitialAndFinalMonth(listView.getFirstVisiblePosition() + i,mFinalMonth,mInitialMonth);
}
Program: 32646
Project: 32646
Buggy source:
private void findCalendarForCurrentMonth(){
  Calendar cal=new GregorianCalendar();
  cal.clear();
  cal.set(mCurrentYear,mCurrentMonth - 1,1);
  mNumberOfMonthDays=cal.getActualMaximum(Calendar.DAY_OF_MONTH);
  daysOfTheMonth=new String[mNumberOfMonthDays + 1];
  for (int i=1; i <= mNumberOfMonthDays; i++) {
    daysOfTheMonth[i]=String.valueOf(i);
  }
}

Fixed version (ground truth):
private void findCalendarForCurrentMonth(int currentYear,int currentMonth){
  Calendar cal=new GregorianCalendar();
  cal.clear();
  cal.set(currentYear,currentMonth - 1,1);
  mNumberOfMonthDays=cal.getActualMaximum(Calendar.DAY_OF_MONTH);
  Log.d("String_Node_Str","String_Node_Str" + mNumberOfMonthDays + "String_Node_Str"+ currentMonth);
  daysOfTheMonth=new String[mNumberOfMonthDays];
  for (int i=0; i < mNumberOfMonthDays; i++) {
    daysOfTheMonth[i]=String.valueOf(i + 1);
  }
}
Program: 32647
Project: 32647
Buggy source:
public void onScrollStateChanged(AbsListView view,int scrollState){
  state.setScrollState(scrollState);
  if (scrollState == OnScrollListener.SCROLL_STATE_IDLE && !listBeingTouched.get()) {
    listBeingTouched.set(true);
    putSomeRowInMiddle(listView,adapter);
  }
}

Fixed version (ground truth):
public void onScrollStateChanged(AbsListView view,int scrollState){
  state.setScrollState(scrollState);
  Log.d("String_Node_Str","String_Node_Str" + scrollState);
  if (scrollState == OnScrollListener.SCROLL_STATE_IDLE && !listBeingTouched.get()) {
    listBeingTouched.set(true);
    putSomeRowInMiddle(listView,adapter);
  }
}
Program: 32648
Project: 32648
Buggy source:
private void highLightMiddleRow(MonthYearAdapter adapter,int currentPosInMiddle){
  adapter.setCurrentPos(currentPosInMiddle);
  adapter.highlightCurrentMonthColor(true);
  adapter.notifyDataSetChanged();
}

Fixed version (ground truth):
private void highLightMiddleRow(MonthYearAdapter adapter,int currentPosInMiddle){
  adapter.setCurrentPos(currentPosInMiddle);
  adapter.highlightCurrentMonthColor(true);
  adapter.notifyDataSetChanged();
  getInitialAndFinalMonth(currentPosInMiddle,mFinalMonth,mInitialMonth);
}
Program: 32649
Project: 32649
Buggy source:
@Override public boolean onTouch(View v,MotionEvent event){
  if (event.getAction() == MotionEvent.ACTION_DOWN) {
    disableOtherListViews(listView);
    Log.d("String_Node_Str","String_Node_Str");
    if (state.getScrollState() == OnScrollListener.SCROLL_STATE_IDLE) {
      stopOtherScrolls(listView);
      setOtherListViewsInvisible(listView);
      if (!adapter.getAllItemsVisible()) {
        listBeingTouched.set(true);
        adapter.setAllItemsVisible(true);
        adapter.highlightCurrentMonthColor(false);
        adapter.notifyDataSetChanged();
      }
 else       if (adapter.getAllItemsVisible() && adapter.getHighlightCurrentMonth()) {
        listBeingTouched.set(true);
        adapter.highlightCurrentMonthColor(false);
        adapter.notifyDataSetChanged();
      }
    }
 else     if (state.getScrollState() == OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) {
      listBeingTouched.set(true);
    }
  }
  if (event.getAction() == MotionEvent.ACTION_UP) {
    enableAllListViews();
    if (state.getScrollState() == OnScrollListener.SCROLL_STATE_IDLE) {
      listBeingTouched.compareAndSet(true,false);
      adapter.highlightCurrentMonthColor(true);
      if (completeListVisible.isCompleteListViewVisible()) {
        putThisViewInMiddle(event.getY(),listView,adapter);
      }
 else {
        adapter.notifyDataSetChanged();
      }
      completeListVisible.setCompleteListViewVisible(true);
    }
 else     if (state.getScrollState() == OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) {
      listBeingTouched.compareAndSet(true,false);
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onTouch(View v,MotionEvent event){
  if (event.getAction() == MotionEvent.ACTION_DOWN) {
    disableOtherListViews(listView);
    setOtherListViewsInvisible(listView);
    stopOtherScrolls(listView);
    if (!adapter.getAllItemsVisible()) {
      listBeingTouched.set(true);
      adapter.setAllItemsVisible(true);
      adapter.highlightCurrentMonthColor(false);
      adapter.notifyDataSetChanged();
    }
 else     if (adapter.getAllItemsVisible() && adapter.getHighlightCurrentMonth()) {
      listBeingTouched.set(true);
      adapter.highlightCurrentMonthColor(false);
      adapter.notifyDataSetChanged();
    }
    if (state.getScrollState() == OnScrollListener.SCROLL_STATE_IDLE) {
      if (listView.getId() == R.id.date_listview) {
        addDatesInDateView();
      }
    }
 else     if (state.getScrollState() == OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) {
      listBeingTouched.set(true);
    }
  }
  if (event.getAction() == MotionEvent.ACTION_UP) {
    enableAllListViews();
    listBeingTouched.compareAndSet(true,false);
    if (completeListVisible.isCompleteListViewVisible()) {
      putThisViewInMiddle(event.getY(),listView,adapter);
    }
    if (state.getScrollState() == OnScrollListener.SCROLL_STATE_IDLE) {
      adapter.highlightCurrentMonthColor(true);
      if (completeListVisible.isCompleteListViewVisible()) {
      }
 else {
        adapter.notifyDataSetChanged();
      }
      completeListVisible.setCompleteListViewVisible(true);
    }
  }
  return false;
}
Program: 32650
Project: 32650
Buggy source:
private void putSomeRowInMiddle(int firstVisiblePosition,int lastVisiblePosition){
  for (int i=firstVisiblePosition; i <= lastVisiblePosition; i++) {
    View v=month_listview.getAdapter().getView(i,null,null);
    Log.d("String_Node_Str","String_Node_Str" + v.getId());
  }
}

Fixed version (ground truth):
private void putSomeRowInMiddle(int firstVisiblePosition,int lastVisiblePosition){
  for (int i=firstVisiblePosition; i <= lastVisiblePosition; i++) {
    View v=month_listview.getChildAt(i);
    Log.d("String_Node_Str","String_Node_Str" + v);
    Rect rectf=new Rect();
  }
}
Program: 32651
Project: 32651
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  View vi=convertView;
  if (vi == null)   vi=inflater.inflate(R.layout.calendar_row,null);
  TextView subText=(TextView)vi.findViewById(R.id.sub_text);
  TextView mainText=(TextView)vi.findViewById(R.id.main_text);
  int actualPosition=position % data.length;
  subText.setText(data[actualPosition]);
  mainText.setText(String.valueOf(actualPosition + 1));
  return vi;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  View vi=convertView;
  if (vi == null)   vi=inflater.inflate(R.layout.calendar_row,null);
  TextView subText=(TextView)vi.findViewById(R.id.sub_text);
  TextView mainText=(TextView)vi.findViewById(R.id.main_text);
  int actualPosition=position % data.length;
  subText.setText(data[actualPosition]);
  mainText.setText(String.valueOf(actualPosition + 1));
  if (position == currentMonthPos) {
    Log.d("String_Node_Str","String_Node_Str" + (position == currentMonthPos));
    vi.setBackgroundColor(Color.RED);
  }
  return vi;
}