nus-yam/ex-repair huggingface dataset:
Program: 175743
Project: 175743
Buggy source:
@Test public void testPlay_Basic(){
  int numCards=12;
  int maxCard=numCards;
  Strategy strategy=new NextCard();
  List<Player> players=new ArrayList<>();
  Hand h1=new Hand(Arrays.asList(new Integer[]{1,5,9}));
  Player p1=new Player("String_Node_Str",strategy,maxCard,h1);
  Hand h2=new Hand(Arrays.asList(new Integer[]{4,8,6}));
  Player p2=new Player("String_Node_Str",strategy,maxCard,h2);
  Hand h3=new Hand(Arrays.asList(new Integer[]{7,2,3}));
  Player p3=new Player("String_Node_Str",strategy,maxCard,h3);
  players.add(p1);
  players.add(p2);
  players.add(p3);
  Hand kitty=new Hand(Arrays.asList(new Integer[]{10,11,12}));
  List<Player> newPlayers=new Game(numCards,false).play(kitty,players.stream()).collect(toList());
  assertEquals(3,newPlayers.size());
  assertEquals(0,newPlayers.get(0).getNumCardsInHand());
  assertEquals(0,newPlayers.get(1).getNumCardsInHand());
  assertEquals(0,newPlayers.get(2).getNumCardsInHand());
  assertEquals(3,newPlayers.stream().filter(p -> p.getPlayerStats().getNumRoundsWon() == 1).count());
  assertEquals(1,newPlayers.stream().filter(p -> p.getPlayerStats().getTotal() == 10).count());
  assertEquals(1,newPlayers.stream().filter(p -> p.getPlayerStats().getTotal() == 11).count());
  assertEquals(1,newPlayers.stream().filter(p -> p.getPlayerStats().getTotal() == 12).count());
}

Fixed version (ground truth):
@Test public void testPlay_Basic(){
  int numCards=12;
  int maxCard=numCards;
  List<Player> players=new ArrayList<>();
  Hand h1=new Hand(Arrays.asList(new Integer[]{1,5,9}));
  Player p1=new Player("String_Node_Str",strategy,maxCard,h1);
  Hand h2=new Hand(Arrays.asList(new Integer[]{4,8,6}));
  Player p2=new Player("String_Node_Str",strategy,maxCard,h2);
  Hand h3=new Hand(Arrays.asList(new Integer[]{7,2,3}));
  Player p3=new Player("String_Node_Str",strategy,maxCard,h3);
  players.add(p1);
  players.add(p2);
  players.add(p3);
  Hand kitty=new Hand(Arrays.asList(new Integer[]{10,11,12}));
  List<Player> newPlayers=new Game(numCards,false).play(kitty,players.stream()).collect(toList());
  assertEquals(3,newPlayers.size());
  assertEquals(0,newPlayers.get(0).getNumCardsInHand());
  assertEquals(0,newPlayers.get(1).getNumCardsInHand());
  assertEquals(0,newPlayers.get(2).getNumCardsInHand());
  assertEquals(3,newPlayers.stream().filter(p -> p.getPlayerStats().getNumRoundsWon() == 1).count());
  assertEquals(1,newPlayers.stream().filter(p -> p.getPlayerStats().getTotal() == 10).count());
  assertEquals(1,newPlayers.stream().filter(p -> p.getPlayerStats().getTotal() == 11).count());
  assertEquals(1,newPlayers.stream().filter(p -> p.getPlayerStats().getTotal() == 12).count());
}
Program: 175744
Project: 175744
Buggy source:
@Test public void testApply_Basic(){
  int numCards=12;
  int maxCard=numCards;
  Strategy strategy=new MaxCard();
  List<Player> players=new ArrayList<>();
  Hand h1=new Hand(Arrays.asList(new Integer[]{1,2,3}));
  Player p1=new Player("String_Node_Str",strategy,maxCard,h1);
  Hand h2=new Hand(Arrays.asList(new Integer[]{4,5,6}));
  Player p2=new Player("String_Node_Str",strategy,maxCard,h2);
  Hand h3=new Hand(Arrays.asList(new Integer[]{7,8,9}));
  Player p3=new Player("String_Node_Str",strategy,maxCard,h3);
  players.add(p1);
  players.add(p2);
  players.add(p3);
  int prizeCard=10;
  List<Player> newPlayers=new Round(prizeCard).apply(players.stream()).collect(toList());
  assertEquals(3,newPlayers.size());
  assertEquals(2,newPlayers.get(0).getNumCardsInHand());
  assertEquals(2,newPlayers.get(1).getNumCardsInHand());
  assertEquals(2,newPlayers.get(2).getNumCardsInHand());
  assertEquals(1,newPlayers.stream().filter(p -> p.getPlayerStats().getNumRoundsWon() == 1).count());
  assertEquals(1,newPlayers.stream().filter(p -> p.getPlayerStats().getTotal() == 10).count());
  assertEquals(2,newPlayers.stream().filter(p -> p.getPlayerStats().getNumRoundsWon() == 0).count());
  assertEquals(2,newPlayers.stream().filter(p -> p.getPlayerStats().getTotal() == 0).count());
}

Fixed version (ground truth):
@Test public void testApply_Basic(){
  int numCards=12;
  int maxCard=numCards;
  List<Player> players=new ArrayList<>();
  Hand h1=new Hand(Arrays.asList(new Integer[]{1,2,3}));
  Player p1=new Player("String_Node_Str",strategy,maxCard,h1);
  Hand h2=new Hand(Arrays.asList(new Integer[]{4,5,6}));
  Player p2=new Player("String_Node_Str",strategy,maxCard,h2);
  Hand h3=new Hand(Arrays.asList(new Integer[]{7,8,9}));
  Player p3=new Player("String_Node_Str",strategy,maxCard,h3);
  players.add(p1);
  players.add(p2);
  players.add(p3);
  int prizeCard=10;
  List<Player> newPlayers=new Round(prizeCard).apply(players.stream()).collect(toList());
  assertEquals(3,newPlayers.size());
  assertEquals(2,newPlayers.get(0).getNumCardsInHand());
  assertEquals(2,newPlayers.get(1).getNumCardsInHand());
  assertEquals(2,newPlayers.get(2).getNumCardsInHand());
  assertEquals(1,newPlayers.stream().filter(p -> p.getPlayerStats().getNumRoundsWon() == 1).count());
  assertEquals(1,newPlayers.stream().filter(p -> p.getPlayerStats().getTotal() == 10).count());
  assertEquals(2,newPlayers.stream().filter(p -> p.getPlayerStats().getNumRoundsWon() == 0).count());
  assertEquals(2,newPlayers.stream().filter(p -> p.getPlayerStats().getTotal() == 0).count());
}
Program: 175745
Project: 175745
Buggy source:
@Test public void testGetAllBids_Basic(){
  Round round=new Round();
  int numCards=12;
  int maxCard=numCards;
  Strategy strategy=new MaxCard();
  List<Player> players=new ArrayList<>();
  Hand h1=new Hand(Arrays.asList(new Integer[]{1,2,3}));
  Player p1=new Player("String_Node_Str",strategy,maxCard,h1);
  Hand h2=new Hand(Arrays.asList(new Integer[]{4,5,6}));
  Player p2=new Player("String_Node_Str",strategy,maxCard,h2);
  Hand h3=new Hand(Arrays.asList(new Integer[]{7,8,9}));
  Player p3=new Player("String_Node_Str",strategy,maxCard,h3);
  players.add(p1);
  players.add(p2);
  players.add(p3);
  List<Bid> result=round.getAllBids(players.stream(),10);
  assertEquals(3,result.size());
}

Fixed version (ground truth):
@Test public void testGetAllBids_Basic(){
  Round round=new Round();
  int numCards=12;
  int maxCard=numCards;
  List<Player> players=new ArrayList<>();
  Hand h1=new Hand(Arrays.asList(new Integer[]{1,2,3}));
  Player p1=new Player("String_Node_Str",strategy,maxCard,h1);
  Hand h2=new Hand(Arrays.asList(new Integer[]{4,5,6}));
  Player p2=new Player("String_Node_Str",strategy,maxCard,h2);
  Hand h3=new Hand(Arrays.asList(new Integer[]{7,8,9}));
  Player p3=new Player("String_Node_Str",strategy,maxCard,h3);
  players.add(p1);
  players.add(p2);
  players.add(p3);
  List<Bid> result=round.getAllBids(players.stream(),10);
  assertEquals(3,result.size());
}
Program: 175746
Project: 175746
Buggy source:
@Test public void testFindWinningBid_Basic(){
  Round round=new Round();
  int maxCard=50;
  Strategy strategy=new MaxCard();
  Player p1=new Player("String_Node_Str",strategy,maxCard,new Hand());
  Player p2=new Player("String_Node_Str",strategy,maxCard,new Hand());
  Player p3=new Player("String_Node_Str",strategy,maxCard,new Hand());
  int prizeCard=20;
  List<Bid> bids=new ArrayList<>();
  bids.add(new Bid(prizeCard,10,p1));
  bids.add(new Bid(prizeCard,12,p2));
  bids.add(new Bid(prizeCard,14,p3));
  Bid result=round.findWinningBid(bids);
  assertEquals("String_Node_Str",result.getBidder().getName());
}

Fixed version (ground truth):
@Test public void testFindWinningBid_Basic(){
  Round round=new Round();
  int maxCard=50;
  Player p1=new Player("String_Node_Str",strategy,maxCard,new Hand());
  Player p2=new Player("String_Node_Str",strategy,maxCard,new Hand());
  Player p3=new Player("String_Node_Str",strategy,maxCard,new Hand());
  int prizeCard=20;
  List<Bid> bids=new ArrayList<>();
  bids.add(new Bid(prizeCard,10,p1));
  bids.add(new Bid(prizeCard,12,p2));
  bids.add(new Bid(prizeCard,14,p3));
  Bid result=round.findWinningBid(bids);
  assertEquals("String_Node_Str",result.getBidder().getName());
}
Program: 175747
Project: 175747
Buggy source:
@Test public void testDeal_Table_Basic(){
  Dealer dealer=new Dealer();
  int numCards=12;
  int maxCard=numCards;
  Strategy strategy=new MaxCard();
  List<Player> players=new ArrayList<>();
  Hand h1=new Hand(Arrays.asList(new Integer[]{1,2,3}));
  Player p1=new Player("String_Node_Str",strategy,maxCard,h1);
  Hand h2=new Hand(Arrays.asList(new Integer[]{4,5,6}));
  Player p2=new Player("String_Node_Str",strategy,maxCard,h2);
  Hand h3=new Hand(Arrays.asList(new Integer[]{7,8,9}));
  Player p3=new Player("String_Node_Str",strategy,maxCard,h3);
  players.add(p1);
  players.add(p2);
  players.add(p3);
  Table table=dealer.deal(20,players);
  assertEquals(5,table.getKitty().cardsAsIntStream().count());
  assertEquals(5,table.getPlayers().get(0).getNumCardsInHand());
  assertEquals(5,table.getPlayers().get(1).getNumCardsInHand());
  assertEquals(5,table.getPlayers().get(2).getNumCardsInHand());
}

Fixed version (ground truth):
@Test public void testDeal_Table_Basic(){
  Dealer dealer=new Dealer();
  int numCards=12;
  int maxCard=numCards;
  List<Player> players=new ArrayList<>();
  Hand h1=new Hand(Arrays.asList(new Integer[]{1,2,3}));
  Player p1=new Player("String_Node_Str",strategy,maxCard,h1);
  Hand h2=new Hand(Arrays.asList(new Integer[]{4,5,6}));
  Player p2=new Player("String_Node_Str",strategy,maxCard,h2);
  Hand h3=new Hand(Arrays.asList(new Integer[]{7,8,9}));
  Player p3=new Player("String_Node_Str",strategy,maxCard,h3);
  players.add(p1);
  players.add(p2);
  players.add(p3);
  Table table=dealer.deal(20,players);
  assertEquals(5,table.getKitty().cardsAsIntStream().count());
  assertEquals(5,table.getPlayers().get(0).getNumCardsInHand());
  assertEquals(5,table.getPlayers().get(1).getNumCardsInHand());
  assertEquals(5,table.getPlayers().get(2).getNumCardsInHand());
}
Program: 175748
Project: 175748
Buggy source:
@Override protected void onCreate(Bundle arg0){
  super.onCreate(arg0);
  setContentView(R.layout.activity_friend_info_layout);
  schoolMate=(SchoolMate)params;
  mLayout.bindSchoolMate(schoolMate);
  mLayout.disableButton();
  updateLayout();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle arg0){
  super.onCreate(arg0);
  setContentView(R.layout.activity_friend_info_layout);
  schoolMate=(SchoolMate)params;
  mLayout.bindSchoolMate(schoolMate);
  mLayout.showButton(false);
  updateLayout();
}
Program: 175749
Project: 175749
Buggy source:
private void updateLayout(){
  HashMap<String,Object> conditions=new HashMap<>();
  conditions.put(AddRequest.TO_USER,UserCacheHelper.getInstance().getCachedAVUser(schoolMate.getUserId()));
  FriendsManager.getInstance().findSendRequests(new FindCallback<AddRequest>(){
    @Override public void done(    List<AddRequest> list,    AVException e){
      if (e == null) {
        if (list != null) {
          if (list.size() > 0) {
            AddRequest addRequest=list.get(0);
            int status=addRequest.getStatus();
            if (status == AddRequest.STATUS_DONE) {
              mLayout.setButtonType(2);
              mLayout.enableButton();
            }
 else {
              mLayout.setButtonType(3);
              mLayout.disableButton();
            }
          }
 else {
            mLayout.setButtonType(1);
            mLayout.enableButton();
          }
        }
 else {
          mLayout.setButtonType(1);
          mLayout.enableButton();
        }
      }
    }
  }
,false,conditions);
}

Fixed version (ground truth):
private void updateLayout(){
  HashMap<String,Object> conditions=new HashMap<>();
  conditions.put(AddRequest.TO_USER,UserCacheHelper.getInstance().getCachedAVUser(schoolMate.getUserId()));
  FriendsManager.getInstance().findSendRequests(new FindCallback<AddRequest>(){
    @Override public void done(    List<AddRequest> list,    AVException e){
      NLog.i(TAG,"String_Node_Str" + list + "String_Node_Str"+ Thread.currentThread().getName());
      if (e == null) {
        if (list != null) {
          if (list.size() > 0) {
            AddRequest addRequest=list.get(0);
            int status=addRequest.getStatus();
            NLog.i(TAG,"String_Node_Str" + status);
            if (status == AddRequest.STATUS_DONE) {
              mLayout.setButtonType(2);
              mLayout.enableButton();
              mLayout.showButton(true);
            }
 else {
              mLayout.setButtonType(3);
              mLayout.disableButton();
              mLayout.showButton(true);
            }
          }
 else {
            mLayout.setButtonType(1);
            mLayout.enableButton();
            mLayout.showButton(true);
          }
        }
 else {
          mLayout.setButtonType(1);
          mLayout.enableButton();
          mLayout.showButton(true);
        }
      }
 else {
        NLog.e(TagUtil.makeTag(FriendInfoActivity.class),"String_Node_Str",e);
      }
    }
  }
,false,conditions);
}
Program: 175750
Project: 175750
Buggy source:
@Override public void done(List<AddRequest> list,AVException e){
  if (e == null) {
    if (list != null) {
      if (list.size() > 0) {
        AddRequest addRequest=list.get(0);
        int status=addRequest.getStatus();
        if (status == AddRequest.STATUS_DONE) {
          mLayout.setButtonType(2);
          mLayout.enableButton();
        }
 else {
          mLayout.setButtonType(3);
          mLayout.disableButton();
        }
      }
 else {
        mLayout.setButtonType(1);
        mLayout.enableButton();
      }
    }
 else {
      mLayout.setButtonType(1);
      mLayout.enableButton();
    }
  }
}

Fixed version (ground truth):
@Override public void done(List<AddRequest> list,AVException e){
  NLog.i(TAG,"String_Node_Str" + list + "String_Node_Str"+ Thread.currentThread().getName());
  if (e == null) {
    if (list != null) {
      if (list.size() > 0) {
        AddRequest addRequest=list.get(0);
        int status=addRequest.getStatus();
        NLog.i(TAG,"String_Node_Str" + status);
        if (status == AddRequest.STATUS_DONE) {
          mLayout.setButtonType(2);
          mLayout.enableButton();
          mLayout.showButton(true);
        }
 else {
          mLayout.setButtonType(3);
          mLayout.disableButton();
          mLayout.showButton(true);
        }
      }
 else {
        mLayout.setButtonType(1);
        mLayout.enableButton();
        mLayout.showButton(true);
      }
    }
 else {
      mLayout.setButtonType(1);
      mLayout.enableButton();
      mLayout.showButton(true);
    }
  }
 else {
    NLog.e(TagUtil.makeTag(FriendInfoActivity.class),"String_Node_Str",e);
  }
}
Program: 175751
Project: 175751
Buggy source:
public void disableButton(){
  shrinkButton.setEnabled(false);
  shrinkButton.setBackground(mRes.getDrawable(R.drawable.button_rounded_color_grey_background));
}

Fixed version (ground truth):
public void disableButton(){
  addFriendBtn.setEnabled(false);
  addFriendBtn.setBackground(mRes.getDrawable(R.drawable.button_rounded_color_grey_background));
}
Program: 175752
Project: 175752
Buggy source:
public void enableButton(){
  shrinkButton.setEnabled(true);
  shrinkButton.reset();
  shrinkButton.setBackground(mRes.getDrawable(R.drawable.button_rounded_color_yellow_background));
}

Fixed version (ground truth):
public void enableButton(){
  addFriendBtn.setEnabled(true);
  addFriendBtn.setBackground(mRes.getDrawable(R.drawable.button_rounded_color_yellow_background));
}
Program: 175753
Project: 175753
Buggy source:
/** 
 * @param type type 1:add friend  type 2:talk type 3:wait
 */
public void setButtonType(int type){
  shrinkButton.setTag(R.id.button_type,type);
switch (type) {
case 1:
    shrinkButton.setText(mRes.getString(R.string.sendMessage));
  break;
case 2:
shrinkButton.setText(mRes.getString(R.string.add_friend));
break;
case 3:
shrinkButton.setText(mRes.getString(R.string.wait_for_verfiy));
break;
}
}

Fixed version (ground truth):
/** 
 * @param type type 1:add friend  type 2:talk type 3:wait
 */
public void setButtonType(int type){
  addFriendBtn.setTag(R.id.button_type,type);
switch (type) {
case 2:
    addFriendBtn.setText(mRes.getString(R.string.sendMessage));
  break;
case 1:
addFriendBtn.setText(mRes.getString(R.string.add_friend));
break;
case 3:
addFriendBtn.setText(mRes.getString(R.string.wait_for_verfiy));
break;
}
}
Program: 175754
Project: 175754
Buggy source:
@Override public void onContentViewCreate(View view){
  super.onContentViewCreate(view);
  LayoutIdBinder.LAYOUT.bindViewToLayout(this);
  titlebar.setDelegate(new BGATitlebar.BGATitlebarDelegate(){
    @Override public void onClickLeftCtv(){
      super.onClickLeftCtv();
      if (onLayoutActionListener != null) {
        onLayoutActionListener.onBack();
      }
    }
  }
);
  shrinkButton.setTag(R.id.button_type,1);
  shrinkButton.setOnClickListener(View -> {
    shrinkButton.setEnabled(false);
    if (onLayoutActionListener != null) {
      int type=(int)shrinkButton.getTag(R.id.button_type);
      if (type == 1) {
        onLayoutActionListener.addFriend();
      }
 else       if (type == 2) {
        onLayoutActionListener.onTalkWithFriend();
      }
    }
 else {
      enableButton();
    }
  }
);
}

Fixed version (ground truth):
@Override public void onContentViewCreate(View view){
  super.onContentViewCreate(view);
  LayoutIdBinder.LAYOUT.bindViewToLayout(this);
  titlebar.setDelegate(new BGATitlebar.BGATitlebarDelegate(){
    @Override public void onClickLeftCtv(){
      super.onClickLeftCtv();
      if (onLayoutActionListener != null) {
        onLayoutActionListener.onBack();
      }
    }
  }
);
  addFriendBtn.setTag(R.id.button_type,1);
  addFriendBtn.setOnClickListener(View -> {
    addFriendBtn.setEnabled(false);
    if (onLayoutActionListener != null) {
      int type=(int)addFriendBtn.getTag(R.id.button_type);
      if (type == 1) {
        onLayoutActionListener.addFriend();
      }
 else       if (type == 2) {
        onLayoutActionListener.onTalkWithFriend();
      }
    }
 else {
      enableButton();
    }
  }
);
}
Program: 175755
Project: 175755
Buggy source:
public DaoMaster(SQLiteDatabase db){
  super(db,SCHEMA_VERSION);
  registerDaoClass(SchoolmateDao.class);
  registerDaoClass(UserDao.class);
  registerDaoClass(BeanDao.class);
  registerDaoClass(ConversationDao.class);
}

Fixed version (ground truth):
public DaoMaster(SQLiteDatabase db){
  super(db,SCHEMA_VERSION);
  registerDaoClass(BeanDao.class);
  registerDaoClass(ConversationDao.class);
  registerDaoClass(UserDao.class);
  registerDaoClass(SchoolmateDao.class);
}
Program: 175756
Project: 175756
Buggy source:
/** 
 * Drops underlying database table using DAOs. 
 */
public static void dropAllTables(SQLiteDatabase db,boolean ifExists){
  SchoolmateDao.dropTable(db,ifExists);
  UserDao.dropTable(db,ifExists);
  BeanDao.dropTable(db,ifExists);
  ConversationDao.dropTable(db,ifExists);
}

Fixed version (ground truth):
/** 
 * Drops underlying database table using DAOs. 
 */
public static void dropAllTables(SQLiteDatabase db,boolean ifExists){
  BeanDao.dropTable(db,ifExists);
  ConversationDao.dropTable(db,ifExists);
  UserDao.dropTable(db,ifExists);
  SchoolmateDao.dropTable(db,ifExists);
}
Program: 175757
Project: 175757
Buggy source:
/** 
 * Creates underlying database table using DAOs. 
 */
public static void createAllTables(SQLiteDatabase db,boolean ifNotExists){
  SchoolmateDao.createTable(db,ifNotExists);
  UserDao.createTable(db,ifNotExists);
  BeanDao.createTable(db,ifNotExists);
  ConversationDao.createTable(db,ifNotExists);
}

Fixed version (ground truth):
/** 
 * Creates underlying database table using DAOs. 
 */
public static void createAllTables(SQLiteDatabase db,boolean ifNotExists){
  BeanDao.createTable(db,ifNotExists);
  ConversationDao.createTable(db,ifNotExists);
  UserDao.createTable(db,ifNotExists);
  SchoolmateDao.createTable(db,ifNotExists);
}
Program: 175758
Project: 175758
Buggy source:
public void clear(){
  schoolmateDaoConfig.getIdentityScope().clear();
  userDaoConfig.getIdentityScope().clear();
  beanDaoConfig.getIdentityScope().clear();
  conversationDaoConfig.getIdentityScope().clear();
}

Fixed version (ground truth):
public void clear(){
  beanDaoConfig.getIdentityScope().clear();
  conversationDaoConfig.getIdentityScope().clear();
  userDaoConfig.getIdentityScope().clear();
  schoolmateDaoConfig.getIdentityScope().clear();
}
Program: 175759
Project: 175759
Buggy source:
public DaoSession(SQLiteDatabase db,IdentityScopeType type,Map<Class<? extends AbstractDao<?,?>>,DaoConfig> daoConfigMap){
  super(db);
  schoolmateDaoConfig=daoConfigMap.get(SchoolmateDao.class).clone();
  schoolmateDaoConfig.initIdentityScope(type);
  userDaoConfig=daoConfigMap.get(UserDao.class).clone();
  userDaoConfig.initIdentityScope(type);
  beanDaoConfig=daoConfigMap.get(BeanDao.class).clone();
  beanDaoConfig.initIdentityScope(type);
  conversationDaoConfig=daoConfigMap.get(ConversationDao.class).clone();
  conversationDaoConfig.initIdentityScope(type);
  schoolmateDao=new SchoolmateDao(schoolmateDaoConfig,this);
  userDao=new UserDao(userDaoConfig,this);
  beanDao=new BeanDao(beanDaoConfig,this);
  conversationDao=new ConversationDao(conversationDaoConfig,this);
  registerDao(Schoolmate.class,schoolmateDao);
  registerDao(User.class,userDao);
  registerDao(Bean.class,beanDao);
  registerDao(Conversation.class,conversationDao);
}

Fixed version (ground truth):
public DaoSession(SQLiteDatabase db,IdentityScopeType type,Map<Class<? extends AbstractDao<?,?>>,DaoConfig> daoConfigMap){
  super(db);
  beanDaoConfig=daoConfigMap.get(BeanDao.class).clone();
  beanDaoConfig.initIdentityScope(type);
  conversationDaoConfig=daoConfigMap.get(ConversationDao.class).clone();
  conversationDaoConfig.initIdentityScope(type);
  userDaoConfig=daoConfigMap.get(UserDao.class).clone();
  userDaoConfig.initIdentityScope(type);
  schoolmateDaoConfig=daoConfigMap.get(SchoolmateDao.class).clone();
  schoolmateDaoConfig.initIdentityScope(type);
  beanDao=new BeanDao(beanDaoConfig,this);
  conversationDao=new ConversationDao(conversationDaoConfig,this);
  userDao=new UserDao(userDaoConfig,this);
  schoolmateDao=new SchoolmateDao(schoolmateDaoConfig,this);
  registerDao(Bean.class,beanDao);
  registerDao(Conversation.class,conversationDao);
  registerDao(User.class,userDao);
  registerDao(Schoolmate.class,schoolmateDao);
}
Program: 175760
Project: 175760
Buggy source:
public Schoolmate(String userId,Integer friendState,java.util.Date createAt){
  this.userId=userId;
  this.friendState=friendState;
  this.createAt=createAt;
}

Fixed version (ground truth):
public Schoolmate(String userId,String releatedId,Integer friendState,java.util.Date createAt){
  this.userId=userId;
  this.releatedId=releatedId;
  this.friendState=friendState;
  this.createAt=createAt;
}
Program: 175761
Project: 175761
Buggy source:
/** 
 * @inheritdoc 
 */
@Override public void readEntity(Cursor cursor,Schoolmate entity,int offset){
  entity.setUserId(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
  entity.setFriendState(cursor.isNull(offset + 1) ? null : cursor.getInt(offset + 1));
  entity.setCreateAt(cursor.isNull(offset + 2) ? null : new java.util.Date(cursor.getLong(offset + 2)));
}

Fixed version (ground truth):
/** 
 * @inheritdoc 
 */
@Override public void readEntity(Cursor cursor,Schoolmate entity,int offset){
  entity.setUserId(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
  entity.setReleatedId(cursor.getString(offset + 1));
  entity.setFriendState(cursor.isNull(offset + 2) ? null : cursor.getInt(offset + 2));
  entity.setCreateAt(cursor.isNull(offset + 3) ? null : new java.util.Date(cursor.getLong(offset + 3)));
}
Program: 175762
Project: 175762
Buggy source:
/** 
 * Creates the underlying database table. 
 */
public static void createTable(SQLiteDatabase db,boolean ifNotExists){
  String constraint=ifNotExists ? "String_Node_Str" : "String_Node_Str";
  db.execSQL("String_Node_Str" + constraint + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Creates the underlying database table. 
 */
public static void createTable(SQLiteDatabase db,boolean ifNotExists){
  String constraint=ifNotExists ? "String_Node_Str" : "String_Node_Str";
  db.execSQL("String_Node_Str" + constraint + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}
Program: 175763
Project: 175763
Buggy source:
/** 
 * @inheritdoc 
 */
@Override protected void bindValues(SQLiteStatement stmt,Schoolmate entity){
  stmt.clearBindings();
  String userId=entity.getUserId();
  if (userId != null) {
    stmt.bindString(1,userId);
  }
  Integer friendState=entity.getFriendState();
  if (friendState != null) {
    stmt.bindLong(2,friendState);
  }
  java.util.Date createAt=entity.getCreateAt();
  if (createAt != null) {
    stmt.bindLong(3,createAt.getTime());
  }
}

Fixed version (ground truth):
/** 
 * @inheritdoc 
 */
@Override protected void bindValues(SQLiteStatement stmt,Schoolmate entity){
  stmt.clearBindings();
  String userId=entity.getUserId();
  if (userId != null) {
    stmt.bindString(1,userId);
  }
  stmt.bindString(2,entity.getReleatedId());
  Integer friendState=entity.getFriendState();
  if (friendState != null) {
    stmt.bindLong(3,friendState);
  }
  java.util.Date createAt=entity.getCreateAt();
  if (createAt != null) {
    stmt.bindLong(4,createAt.getTime());
  }
}
Program: 175764
Project: 175764
Buggy source:
@Override public void onRegisterError(int code,final String message){
  runOnUiThread(new Runnable(){
    @Override public void run(){
      NToast.shortToast(RegisterActivity.this,getString(R.string.registerFailed) + message);
      mLayout.resetRegisterButton();
    }
  }
);
}

Fixed version (ground truth):
@Override public void onRegisterError(int code,final String message){
  runOnUiThread(() -> {
    NToast.shortToast(RegisterActivity.this,getString(R.string.registerFailed) + message);
    mLayout.resetRegisterButton();
  }
);
}
Program: 175765
Project: 175765
Buggy source:
private void checkAndInstallEatMark(){
  Class<?>[] declaredClasses=getClass().getDeclaredClasses();
  if (declaredClasses != null) {
    for (    Class<?> declaredClass : declaredClasses) {
      EatMark eatMark=declaredClass.getAnnotation(EatMark.class);
      if (eatMark != null && eatMark.action() != null) {
        IEater iEater=null;
        try {
          Constructor<?> constructor=declaredClass.getConstructor(this.getClass());
          constructor.setAccessible(true);
          iEater=(IEater)constructor.newInstance(this);
        }
 catch (        java.lang.InstantiationException e) {
          e.printStackTrace();
        }
catch (        IllegalAccessException e) {
          e.printStackTrace();
        }
catch (        NoSuchMethodException e) {
          e.printStackTrace();
        }
catch (        InvocationTargetException e) {
          e.printStackTrace();
        }
        if (iEater != null) {
          eater.add(iEater);
          NLog.i(TagUtil.makeTag(getClass()),"String_Node_Str" + eatMark.action());
          EaterManager.getInstance().registerEater(eatMark.action(),iEater);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void checkAndInstallEatMark(){
  Class<?>[] declaredClasses=getClass().getDeclaredClasses();
  if (declaredClasses != null) {
    for (    Class<?> declaredClass : declaredClasses) {
      EatMark eatMark=declaredClass.getAnnotation(EatMark.class);
      if (eatMark != null && eatMark.action() != null) {
        IEater iEater=null;
        try {
          Constructor<?> constructor=declaredClass.getConstructor(this.getClass());
          constructor.setAccessible(true);
          iEater=(IEater)constructor.newInstance(this);
        }
 catch (        java.lang.InstantiationException e) {
          e.printStackTrace();
        }
catch (        IllegalAccessException e) {
          e.printStackTrace();
        }
catch (        NoSuchMethodException e) {
          e.printStackTrace();
        }
catch (        InvocationTargetException e) {
          e.printStackTrace();
        }
        if (iEater != null) {
          eater.add(iEater);
          EaterManager.getInstance().registerEater(eatMark.action(),iEater);
        }
      }
    }
  }
}
Program: 175766
Project: 175766
Buggy source:
@Override public void onRefresh(){
  updateSchoolMates(task -> {
    mLayout.notifyFreshDone();
    if (task.getResult() != null) {
      mLayout.setData(task.getResult(),500);
    }
    return null;
  }
);
}

Fixed version (ground truth):
@Override public void onRefresh(){
  updateSchoolMates(task -> {
    mLayout.notifyFreshDone();
    if (task.getResult() != null) {
      mLayout.refresh(task.getResult());
    }
    return null;
  }
);
}
Program: 175767
Project: 175767
Buggy source:
private void updateSchoolMates(Continuation<List<SchoolMate>,Void> continuation){
  SchoolMatesManager.getInstance().queryAllSchoolMates().continueWith(task -> {
    final List<SchoolMate> result=task.getResult();
    if (result != null) {
      Collections.sort(result,new LetterComparator<SchoolMate>());
      ToolKit.runOnMainThreadAsync(() -> {
        if (continuation != null) {
          Task.<List<SchoolMate>>forResult(result).continueWith(continuation);
        }
      }
);
    }
 else {
      if (continuation != null) {
        Task.<List<SchoolMate>>forResult(null).continueWith(continuation);
      }
    }
    return null;
  }
);
}

Fixed version (ground truth):
private void updateSchoolMates(Continuation<List<SchoolMate>,Void> continuation){
  SchoolMatesManager.getInstance().queryAllSchoolMates().continueWith(task -> {
    final List<SchoolMate> result=task.getResult();
    if (result != null) {
      Collections.sort(result,new LetterComparator<>());
      if (continuation != null) {
        Task.<List<SchoolMate>>forResult(result).continueWith(continuation,Task.UI_THREAD_EXECUTOR);
      }
    }
 else {
      if (continuation != null) {
        Task.<List<SchoolMate>>forResult(null).continueWith(continuation,Task.UI_THREAD_EXECUTOR);
      }
    }
    return null;
  }
);
}
Program: 175768
Project: 175768
Buggy source:
@Override protected void onViewCreated(){
  super.onViewCreated();
  updateSchoolMates(task -> {
    if (task.getResult() != null) {
      mLayout.setData(task.getResult());
    }
    return null;
  }
);
  mLayout.setOnFreshListener(new SpringView.OnFreshListener(){
    @Override public void onRefresh(){
      updateSchoolMates(task -> {
        mLayout.notifyFreshDone();
        if (task.getResult() != null) {
          mLayout.setData(task.getResult(),500);
        }
        return null;
      }
);
    }
    @Override public void onLoadmore(){
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onViewCreated(){
  super.onViewCreated();
  updateSchoolMates(task -> {
    if (task.getResult() != null) {
      mLayout.setData(task.getResult());
    }
    return null;
  }
);
  mLayout.setOnFreshListener(new SpringView.OnFreshListener(){
    @Override public void onRefresh(){
      updateSchoolMates(task -> {
        mLayout.notifyFreshDone();
        if (task.getResult() != null) {
          mLayout.refresh(task.getResult());
        }
        return null;
      }
);
    }
    @Override public void onLoadmore(){
    }
  }
);
  handler=new Handler();
}
Program: 175769
Project: 175769
Buggy source:
private void listenToClient(){
  mClientOpenListener=new AbstractHandler<ClientOpenParam>(){
    @Override public boolean isParamAvailable(    LightParam param){
      return param != null && param instanceof ClientOpenParam;
    }
    @Override public void doJobWithParam(    ClientOpenParam param){
      if (param.mOpened) {
        initSquareConversation();
      }
 else {
        NToast.shortToast(mAppCtx,getString(R.string.internet_not_connect_warn));
      }
    }
  }
;
}

Fixed version (ground truth):
private void listenToClient(){
  mClientOpenListener=new AbstractHandler<ClientOpenParam>(){
    @Override public boolean isParamAvailable(    LightParam param){
      return param != null && param instanceof ClientOpenParam;
    }
    @Override public void doJobWithParam(    ClientOpenParam param){
      NLog.i(TagUtil.makeTag(getClass()),"String_Node_Str" + param.mOpened);
      if (param.mOpened) {
        initSquareConversation();
      }
 else {
        NToast.shortToast(mAppCtx,getString(R.string.internet_not_connect_warn));
      }
    }
  }
;
}
Program: 175770
Project: 175770
Buggy source:
private void fetchMessages(){
  if (mAvimConversation != null) {
    mAvimConversation.queryMessages(new AVIMMessagesQueryCallback(){
      @Override public void done(      List<AVIMMessage> list,      AVIMException e){
        if (filterException(e)) {
          if (mLayout.getChatLt() != null) {
            mLayout.getChatLt().clear();
            mLayout.pushMessagesAndRefreshToBottom(IMessageWrap.buildFrom(list,false));
          }
        }
      }
    }
);
  }
}

Fixed version (ground truth):
private Task<List<AVIMMessage>> fetchMessages(){
  if (mAvimConversation != null) {
    return Task.callInBackground(new Callable<List<AVIMMessage>>(){
      List<AVIMMessage> queryResult;
      @Override public List<AVIMMessage> call() throws Exception {
        int syncLatch=SyncUtils.getSyncLatch();
        mAvimConversation.queryMessages(new AVIMMessagesQueryCallback(){
          @Override public void done(          List<AVIMMessage> list,          AVIMException e){
            if (filterException(e)) {
              queryResult=list;
            }
            SyncUtils.notify(syncLatch);
          }
        }
);
        SyncUtils.wait(syncLatch);
        NLog.i(TagUtil.makeTag(getClass()),"String_Node_Str" + queryResult);
        return queryResult;
      }
    }
).continueWith(task -> {
      List<AVIMMessage> result=task.getResult();
      if (result != null && mLayout.getChatLt() != null) {
        mLayout.getChatLt().clear();
        mLayout.pushMessagesAndRefreshToBottom(IMessageWrap.buildFrom(result,false));
        return result;
      }
      return null;
    }
,Task.UI_THREAD_EXECUTOR);
  }
  return Task.forResult(null);
}
Program: 175771
Project: 175771
Buggy source:
@Override public void onRefresh(){
  if (mLayout != null) {
    IMessageWrap firstMessage=mLayout.getChatLt().getFirstMessage();
    if (firstMessage == null) {
      mLayout.getChatLt().finshRefresh();
    }
 else {
      if (mAvimConversation != null) {
        mAvimConversation.queryMessages(firstMessage.message_.getMessageId(),firstMessage.message_.getTimestamp(),20,new AVIMMessagesQueryCallback(){
          @Override public void done(          List<AVIMMessage> list,          AVIMException e){
            if (e == null && list != null) {
              mLayout.pushMessagesAndRefreshToTop(IMessageWrap.buildFrom(list,true));
            }
            mLayout.getChatLt().finshRefresh();
          }
        }
);
      }
 else {
        mLayout.getChatLt().finshRefresh();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onRefresh(){
  if (mLayout != null) {
    IMessageWrap firstMessage=mLayout.getChatLt().getFirstMessage();
    if (firstMessage == null) {
      fetchMessages().continueWith(task -> {
        mLayout.getChatLt().finshRefresh();
        return null;
      }
);
    }
 else {
      if (mAvimConversation != null) {
        mAvimConversation.queryMessages(firstMessage.message_.getMessageId(),firstMessage.message_.getTimestamp(),20,new AVIMMessagesQueryCallback(){
          @Override public void done(          List<AVIMMessage> list,          AVIMException e){
            if (e == null && list != null) {
              mLayout.pushMessagesAndRefreshToTop(IMessageWrap.buildFrom(list,true));
            }
            mLayout.getChatLt().finshRefresh();
          }
        }
);
      }
 else {
        mLayout.getChatLt().finshRefresh();
      }
    }
  }
}
Program: 175773
Project: 175773
Buggy source:
@Override protected void onViewCreated(){
  super.onViewCreated();
  init();
  mLayout.setMessageListFreshListener(new ChatMessageListLayout.IMessageListFreshListener(){
    @Override public void onRefresh(){
      if (mLayout != null) {
        IMessageWrap firstMessage=mLayout.getChatLt().getFirstMessage();
        if (firstMessage == null) {
          mLayout.getChatLt().finshRefresh();
        }
 else {
          if (mAvimConversation != null) {
            mAvimConversation.queryMessages(firstMessage.message_.getMessageId(),firstMessage.message_.getTimestamp(),20,new AVIMMessagesQueryCallback(){
              @Override public void done(              List<AVIMMessage> list,              AVIMException e){
                if (e == null && list != null) {
                  mLayout.pushMessagesAndRefreshToTop(IMessageWrap.buildFrom(list,true));
                }
                mLayout.getChatLt().finshRefresh();
              }
            }
);
          }
 else {
            mLayout.getChatLt().finshRefresh();
          }
        }
      }
    }
    @Override public void onLoadmore(){
    }
  }
);
  if (mRequest.size() > 0) {
    mRequest.poll();
    fetchMessages();
  }
}

Fixed version (ground truth):
@Override protected void onViewCreated(){
  super.onViewCreated();
  init();
  mLayout.setMessageListFreshListener(new ChatMessageListLayout.IMessageListFreshListener(){
    @Override public void onRefresh(){
      if (mLayout != null) {
        IMessageWrap firstMessage=mLayout.getChatLt().getFirstMessage();
        if (firstMessage == null) {
          fetchMessages().continueWith(task -> {
            mLayout.getChatLt().finshRefresh();
            return null;
          }
);
        }
 else {
          if (mAvimConversation != null) {
            mAvimConversation.queryMessages(firstMessage.message_.getMessageId(),firstMessage.message_.getTimestamp(),20,new AVIMMessagesQueryCallback(){
              @Override public void done(              List<AVIMMessage> list,              AVIMException e){
                if (e == null && list != null) {
                  mLayout.pushMessagesAndRefreshToTop(IMessageWrap.buildFrom(list,true));
                }
                mLayout.getChatLt().finshRefresh();
              }
            }
);
          }
 else {
            mLayout.getChatLt().finshRefresh();
          }
        }
      }
    }
    @Override public void onLoadmore(){
    }
  }
);
  if (mRequest.size() > 0) {
    mRequest.poll();
    fetchMessages();
  }
}
Program: 175774
Project: 175774
Buggy source:
private void init(){
  conditionSearchCi=(CommonItem)findViewById(R.id.conditionSearch);
  fillCommonItem(conditionSearchCi,R.drawable.condif,mRes.getString(R.string.conditionSearch));
  conditionSearchCi.showDivider(true);
  nearByCi=(CommonItem)findViewById(R.id.nearbyp);
  fillCommonItem(nearByCi,R.drawable.nearby,mRes.getString(R.string.nearbyp));
  nearByCi.showDivider(false);
  recyclerView=(SRecyclerView)findViewById(R.id.schoolmateList);
  recyclerView.setHasFixedSize(true);
  int orientation=LinearLayoutManager.VERTICAL;
  final LinearLayoutManager layoutManager=new LinearLayoutManager(mCtx,orientation,false);
  recyclerView.setLayoutManager(layoutManager);
  schoolMatesAdapter=new SchoolMatesAdapter();
  recyclerView.setAdapter(schoolMatesAdapter);
  final StickyRecyclerHeadersDecoration headersDecor=new StickyRecyclerHeadersDecoration(schoolMatesAdapter);
  recyclerView.addItemDecoration(headersDecor);
  recyclerView.addItemDecoration(new DividerDecoration(mCtx));
  recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener(){
    @Override public void onScrolled(    RecyclerView recyclerView,    int dx,    int dy){
      super.onScrolled(recyclerView,dx,dy);
      animateCommonItems(dy);
    }
  }
);
  smSv=(SpringView)findViewById(R.id.smLtSv);
  smSv.setHeader(new AddressRotationHeader(mAppCtx));
}

Fixed version (ground truth):
private void init(){
  conditionSearchCi=(CommonItem)findViewById(R.id.conditionSearch);
  fillCommonItem(conditionSearchCi,R.drawable.condif,mRes.getString(R.string.conditionSearch));
  conditionSearchCi.showDivider(true);
  nearByCi=(CommonItem)findViewById(R.id.nearbyp);
  fillCommonItem(nearByCi,R.drawable.nearby,mRes.getString(R.string.nearbyp));
  nearByCi.showDivider(false);
  recyclerView=(SRecyclerView)findViewById(R.id.schoolmateList);
  recyclerView.setHasFixedSize(true);
  int orientation=LinearLayoutManager.VERTICAL;
  final LinearLayoutManager layoutManager=new LinearLayoutManager(mCtx,orientation,false);
  recyclerView.setLayoutManager(layoutManager);
  schoolMatesAdapter=new SchoolMatesAdapter();
  recyclerView.setAdapter(schoolMatesAdapter);
  final StickyRecyclerHeadersDecoration headersDecor=new StickyRecyclerHeadersDecoration(schoolMatesAdapter);
  recyclerView.addItemDecoration(headersDecor);
  recyclerView.addItemDecoration(new DividerDecoration(mCtx));
  recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener(){
    @Override public void onScrolled(    RecyclerView recyclerView,    int dx,    int dy){
      super.onScrolled(recyclerView,dx,dy);
      animateCommonItems(dy);
    }
  }
);
  smSv=(SpringView)findViewById(R.id.smLtSv);
  smSv.setHeader(new AddressRotationHeader(mAct));
}
Program: 175775
Project: 175775
Buggy source:
public void setData(List<SchoolMate> result,int i){
  mRootView.postDelayed(() -> schoolMatesAdapter.addAll(result),i);
}

Fixed version (ground truth):
public void setData(List<SchoolMate> result,int i){
  handler.postDelayed(() -> schoolMatesAdapter.addAll(result),i);
}
Program: 175776
Project: 175776
Buggy source:
@Override public void onViewCreate(View root){
  super.onViewCreate(root);
  init();
}

Fixed version (ground truth):
@Override public void onViewCreate(View root){
  super.onViewCreate(root);
  handler=new Handler();
  init();
}
Program: 175777
Project: 175777
Buggy source:
@Override public void onBindHeaderViewHolder(RecyclerView.ViewHolder holder,int position){
  TextView textView=(TextView)holder.itemView;
  String showValue=String.valueOf(getItem(position).getSortLetters().charAt(0));
  textView.setText(showValue);
}

Fixed version (ground truth):
@Override public void onBindHeaderViewHolder(RecyclerView.ViewHolder holder,int position){
  NLog.i(TagUtil.makeTag(getClass()),"String_Node_Str" + position);
  NLog.i(TagUtil.makeTag(getClass()),"String_Node_Str" + getItem(position));
  TextView textView=(TextView)holder.itemView;
  String showValue=String.valueOf(getItem(position).getSortLetters().charAt(0));
  textView.setText(showValue);
}
Program: 175778
Project: 175778
Buggy source:
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent,int viewType){
  View view=null;
  if (viewType == HEADER) {
    view=LayoutInflater.from(parent.getContext()).inflate(R.layout.schoolmateheader,parent,false);
    return new RecyclerView.ViewHolder(view){
    }
;
  }
  view=LayoutInflater.from(parent.getContext()).inflate(R.layout.schoolmate_item,parent,false);
  return new SchoolMateViewHolder(view);
}

Fixed version (ground truth):
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent,int viewType){
  View view;
  if (viewType == HEADER) {
    view=LayoutInflater.from(parent.getContext()).inflate(R.layout.schoolmateheader,parent,false);
    return new RecyclerView.ViewHolder(view){
    }
;
  }
  view=LayoutInflater.from(parent.getContext()).inflate(R.layout.schoolmate_item,parent,false);
  return new SchoolMateViewHolder(view);
}
Program: 175779
Project: 175779
Buggy source:
@Override public SchoolMate getItem(int position){
  if (position == 0) {
    return new SchoolMate();
  }
  return super.getItem(getAdjustPosition(position));
}

Fixed version (ground truth):
@Override public SchoolMate getItem(int position){
  if (position == 0) {
    return null;
  }
  return super.getItem(getAdjustPosition(position));
}
Program: 175780
Project: 175780
Buggy source:
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder,int position){
  if (holder instanceof SchoolMateViewHolder) {
    ((SchoolMateViewHolder)holder).initWithModel(getItem(position));
  }
}

Fixed version (ground truth):
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder,int position){
  if (position != 0) {
    ((SchoolMateViewHolder)holder).initWithModel(getItem(position));
  }
}
Program: 175781
Project: 175781
Buggy source:
@Override public void notifyDataAddChanged(int position){
  if (position == -1) {
    notifyItemInserted(getItemCount() - 1);
  }
 else   if (position == 0) {
    if (super.getItemCount() > 0) {
      notifyItemRangeChanged(1,super.getItemCount());
    }
  }
 else {
    notifyItemInserted(position);
    notifyItemRangeChanged(position,super.getItemCount() - position);
  }
}

Fixed version (ground truth):
@Override public void notifyDataAddChanged(int position){
  if (position == -1) {
    notifyItemInserted(getItemCount() - 1);
  }
 else   if (position == 0) {
    notifyDataSetChanged();
  }
 else {
    notifyItemInserted(position);
    notifyItemRangeChanged(position,super.getItemCount() - position);
  }
}
Program: 175782
Project: 175782
Buggy source:
@Override public int getDragLimitHeight(View rootView){
  return rootView.getMeasuredHeight() / 4;
}

Fixed version (ground truth):
@Override public int getDragLimitHeight(View rootView){
  return rootView.getMeasuredHeight() / 3;
}
Program: 175783
Project: 175783
Buggy source:
@Override public void onDropAnim(View rootView,int dy){
  int maxY=DisplayUtil.dip2px(context,60);
  float y=maxY * Math.abs(dy) / rootView.getMeasuredHeight();
  if (y > maxY)   return;
  rootView.setTranslationY(y);
  float rota=360 * dy / rootView.getMeasuredHeight();
  progress.setRotation(rota);
}

Fixed version (ground truth):
@Override public void onDropAnim(View rootView,int dy){
  float rota=360 * dy / rootView.getMeasuredHeight();
  progress.setRotation(rota);
}
Program: 175784
Project: 175784
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_room);
  accessToken=this.getSharedPreferences("String_Node_Str",0).getString("String_Node_Str","String_Node_Str");
  uid=this.getSharedPreferences("String_Node_Str",0).getString("String_Node_Str","String_Node_Str");
  Log.i("String_Node_Str","String_Node_Str" + uid + accessToken);
  Intent i=getIntent();
  Bundle bundle=i.getExtras();
  roomId=(String)bundle.get("String_Node_Str");
  usercount=(int)bundle.get("String_Node_Str");
  status=bundle.getString("String_Node_Str");
  Log.i("String_Node_Str","String_Node_Str" + status);
  RoomFragment roomFragment=new RoomFragment();
  roomFragment.setArguments(bundle);
  getSupportFragmentManager().beginTransaction().replace(R.id.room_fragment_holder,roomFragment).commit();
  roomdb=RoomsDatabase.getInstance(this);
  roomsDao=roomdb.roomsDao();
  messagesDatabase=MessagesDatabase.getInstance(this);
  messagesDao=messagesDatabase.messagesDao();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_room);
  accessToken=this.getSharedPreferences("String_Node_Str",0).getString("String_Node_Str","String_Node_Str");
  uid=this.getSharedPreferences("String_Node_Str",0).getString("String_Node_Str","String_Node_Str");
  Log.i("String_Node_Str","String_Node_Str" + uid + accessToken);
  Intent i=getIntent();
  Bundle bundle=i.getExtras();
  roomId=(String)bundle.get("String_Node_Str");
  usercount=(int)bundle.get("String_Node_Str");
  status=bundle.getString("String_Node_Str");
  Log.i("String_Node_Str","String_Node_Str" + status);
  RoomFragment roomFragment=new RoomFragment();
  roomFragment.setArguments(bundle);
  getSupportFragmentManager().beginTransaction().replace(R.id.room_fragment_holder,roomFragment).commit();
  roomdb=RoomsDatabase.getInstance(this);
  roomsDao=roomdb.roomsDao();
  messagesDatabase=MessagesDatabase.getInstance(this);
  messagesDao=messagesDatabase.messagesDao();
  ActionBar actionBar=getSupportActionBar();
  actionBar.setDisplayHomeAsUpEnabled(true);
}