nus-yam/ex-repair huggingface dataset:
Program: 33492
Project: 33492
Buggy source:
private Collection<Filter> createDeleteFilter(Operations operations,Operator operator){
  Collection<Filter> filters=new LinkedList<>();
  ColumnName name=new ColumnName(CATALOG,TABLE,COLUMN_PK);
  ColumnSelector primaryKey=new ColumnSelector(name);
  Selector rightTerm=new IntegerSelector(1);
  Relation relation=new Relation(primaryKey,operator,rightTerm);
  filters.add(new Filter(operations,relation));
  return filters;
}

Fixed version (ground truth):
private Collection<Filter> createDeleteFilter(Operations operations,Operator operator){
  Collection<Filter> filters=new LinkedList<>();
  ColumnName name=new ColumnName(CATALOG,TABLE,COLUMN_PK);
  ColumnSelector primaryKey=new ColumnSelector(name);
  Selector rightTerm=new StringSelector("String_Node_Str");
  Relation relation=new Relation(primaryKey,operator,rightTerm);
  filters.add(new Filter(operations,relation));
  return filters;
}
Program: 33493
Project: 33493
Buggy source:
@Test public void testInsertSamePK() throws ConnectorException {
  ClusterName clusterName=getClusterName();
  System.out.println("String_Node_Str" + clusterName.getName() + "String_Node_Str");
  insertRow(clusterName,OTHER_VALUE_4,ColumnType.VARCHAR,VALUE_1,true);
  insertRow(clusterName,VALUE_4,ColumnType.VARCHAR,VALUE_1,true);
  verifyInsert(clusterName,OTHER_VALUE_4);
}

Fixed version (ground truth):
@Test public void testInsertSamePK() throws ConnectorException {
  ClusterName clusterName=getClusterName();
  System.out.println("String_Node_Str" + clusterName.getName() + "String_Node_Str");
  insertRow(clusterName,OTHER_VALUE_4,ColumnType.VARCHAR,VALUE_1,true);
  insertRow(clusterName,VALUE_4,ColumnType.VARCHAR,VALUE_1,true);
  verifyInsert(clusterName,VALUE_4);
}
Program: 33495
Project: 33495
Buggy source:
@Test public void testInsertLong() throws ConnectorException {
  ClusterName clusterName=getClusterName();
  System.out.println("String_Node_Str" + clusterName.getName() + "String_Node_Str");
  Object value4=1L;
  insertRow(clusterName,value4,ColumnType.BIGINT,VALUE_1,true);
  ResultSet resultIterator=createResultSet(clusterName);
  assertEquals("String_Node_Str",1,resultIterator.size());
  for (  Row recoveredRow : resultIterator) {
    assertEquals("String_Node_Str",Long.class.getCanonicalName(),recoveredRow.getCell(COLUMN_4).getValue().getClass().getCanonicalName());
    assertEquals("String_Node_Str",value4,recoveredRow.getCell(COLUMN_4).getValue());
  }
}

Fixed version (ground truth):
@Test public void testInsertLong() throws ConnectorException {
  ClusterName clusterName=getClusterName();
  System.out.println("String_Node_Str" + clusterName.getName() + "String_Node_Str");
  Object value4=1L;
  insertRow(clusterName,value4,ColumnType.BIGINT,VALUE_1,true);
  ResultSet resultIterator=createResultSetTyped(clusterName,ColumnType.BIGINT);
  assertEquals("String_Node_Str",1,resultIterator.size());
  for (  Row recoveredRow : resultIterator) {
    assertEquals("String_Node_Str",Long.class.getCanonicalName(),recoveredRow.getCell(COLUMN_4).getValue().getClass().getCanonicalName());
    assertEquals("String_Node_Str",value4,recoveredRow.getCell(COLUMN_4).getValue());
  }
}
Program: 33496
Project: 33496
Buggy source:
protected void insertRow(ClusterName cluesterName,Object value_4,ColumnType colType_4,String PK_VALUE,boolean withPK) throws ConnectorException {
  Row row=new Row();
  Map<String,Cell> cells=new HashMap<>();
  cells.put(COLUMN_1,new Cell(PK_VALUE));
  cells.put(COLUMN_2,new Cell(VALUE_2));
  cells.put(COLUMN_3,new Cell(VALUE_3));
  cells.put(COLUMN_4,new Cell(value_4));
  row.setCells(cells);
  TableMetadataBuilder tableMetadataBuilder=new TableMetadataBuilder(CATALOG,TABLE);
  tableMetadataBuilder.addColumn(COLUMN_1,ColumnType.VARCHAR).addColumn(COLUMN_2,ColumnType.VARCHAR).addColumn(COLUMN_3,ColumnType.VARCHAR).addColumn(COLUMN_4,colType_4);
  if (withPK) {
    tableMetadataBuilder.withPartitionKey(COLUMN_1);
  }
  TableMetadata targetTable=tableMetadataBuilder.build();
  if (getConnectorHelper().isTableMandatory()) {
    connector.getMetadataEngine().createTable(getClusterName(),targetTable);
  }
  connector.getStorageEngine().insert(cluesterName,targetTable,row);
  refresh(CATALOG);
}

Fixed version (ground truth):
protected void insertRow(ClusterName cluesterName,Object value_4,ColumnType colType_4,String PK_VALUE,boolean withPK) throws ConnectorException {
  Row row=new Row();
  Map<String,Cell> cells=new HashMap<>();
  cells.put(COLUMN_1,new Cell(PK_VALUE));
  cells.put(COLUMN_2,new Cell(VALUE_2));
  cells.put(COLUMN_3,new Cell(VALUE_3));
  cells.put(COLUMN_4,new Cell(value_4));
  row.setCells(cells);
  TableMetadataBuilder tableMetadataBuilder=new TableMetadataBuilder(CATALOG,TABLE);
  tableMetadataBuilder.addColumn(COLUMN_1,ColumnType.VARCHAR).addColumn(COLUMN_2,ColumnType.INT).addColumn(COLUMN_3,ColumnType.BOOLEAN).addColumn(COLUMN_4,colType_4);
  if (withPK) {
    tableMetadataBuilder.withPartitionKey(COLUMN_1);
  }
  TableMetadata targetTable=tableMetadataBuilder.build();
  if (getConnectorHelper().isTableMandatory()) {
    connector.getMetadataEngine().createTable(getClusterName(),targetTable);
  }
  connector.getStorageEngine().insert(cluesterName,targetTable,row);
  refresh(CATALOG);
}
Program: 33497
Project: 33497
Buggy source:
private void insertRow(int ikey,int age,int money,ClusterName clusterNodeName,boolean withPk) throws UnsupportedOperationException, ConnectorException {
  Row row=new Row();
  Map<String,Cell> cells=new HashMap<>();
  cells.put(COLUMN_1,new Cell("String_Node_Str" + ikey + "String_Node_Str"));
  cells.put(COLUMN_2,new Cell("String_Node_Str" + ikey + "String_Node_Str"));
  cells.put(COLUMN_3,new Cell("String_Node_Str" + ikey + "String_Node_Str"));
  cells.put(COLUMN_AGE,new Cell(age));
  cells.put(COLUMN_MONEY,new Cell(money));
  cells.put(COLUMN_PK,new Cell(ikey));
  TableMetadataBuilder tableMetadataBuilder=new TableMetadataBuilder(CATALOG,TABLE);
  tableMetadataBuilder.addColumn(COLUMN_1,ColumnType.VARCHAR).addColumn(COLUMN_2,ColumnType.VARCHAR).addColumn(COLUMN_3,ColumnType.VARCHAR).addColumn(COLUMN_AGE,ColumnType.INT).addColumn(COLUMN_MONEY,ColumnType.INT);
  tableMetadataBuilder.withPartitionKey(COLUMN_PK);
  TableMetadata targetTable=tableMetadataBuilder.build();
  row.setCells(cells);
  connector.getStorageEngine().insert(clusterNodeName,targetTable,row);
}

Fixed version (ground truth):
private void insertRow(int ikey,int age,int money,ClusterName clusterNodeName,boolean withPk) throws UnsupportedOperationException, ConnectorException {
  Row row=new Row();
  Map<String,Cell> cells=new HashMap<>();
  cells.put(COLUMN_1,new Cell("String_Node_Str" + ikey + "String_Node_Str"));
  cells.put(COLUMN_2,new Cell("String_Node_Str" + ikey + "String_Node_Str"));
  cells.put(COLUMN_3,new Cell("String_Node_Str" + ikey + "String_Node_Str"));
  cells.put(COLUMN_AGE,new Cell(age));
  cells.put(COLUMN_MONEY,new Cell(money));
  cells.put(COLUMN_PK,new Cell(ikey));
  TableMetadataBuilder tableMetadataBuilder=new TableMetadataBuilder(CATALOG,TABLE);
  tableMetadataBuilder.addColumn(COLUMN_1,ColumnType.VARCHAR).addColumn(COLUMN_2,ColumnType.VARCHAR).addColumn(COLUMN_3,ColumnType.VARCHAR).addColumn(COLUMN_AGE,ColumnType.INT).addColumn(COLUMN_MONEY,ColumnType.INT).addColumn(COLUMN_PK,ColumnType.INT);
  tableMetadataBuilder.withPartitionKey(COLUMN_PK);
  TableMetadata targetTable=tableMetadataBuilder.build();
  row.setCells(cells);
  connector.getStorageEngine().insert(clusterNodeName,targetTable,row);
}
Program: 33498
Project: 33498
Buggy source:
@Test public void selectPKDoubleFilterDistinct() throws ConnectorException {
  ClusterName clusterNodeName=getClusterName();
  System.out.println("String_Node_Str");
  insertRow(1,10,5,clusterNodeName,true);
  insertRow(2,9,1,clusterNodeName,true);
  insertRow(3,11,1,clusterNodeName,true);
  insertRow(4,10,1,clusterNodeName,true);
  insertRow(5,20,1,clusterNodeName,true);
  refresh(CATALOG);
  LinkedList<LogicalWorkFlowCreator.ConnectorField> connectorFields=new LinkedList<>();
  connectorFields.add(logicalWorkFlowCreator.createConnectorField(COLUMN_1,ALIAS_COLUMN_1,ColumnType.VARCHAR));
  connectorFields.add(logicalWorkFlowCreator.createConnectorField(COLUMN_AGE,ALIAS_COLUMN_AGE,ColumnType.INT));
  LogicalWorkflow logicalPlan=logicalWorkFlowCreator.addDefaultColumns().addColumnName(COLUMN_PK).addSelect(connectorFields).addDistinctFilter(COLUMN_PK,new Integer(2),false,true).addDistinctFilter(COLUMN_PK,new Integer(3),false,true).getLogicalWorkflow();
  QueryResult queryResult=connector.getQueryEngine().execute(logicalPlan);
  assertEquals("String_Node_Str",0,queryResult.getResultSet().size());
}

Fixed version (ground truth):
@Test public void selectPKDoubleFilterDistinct() throws ConnectorException {
  ClusterName clusterNodeName=getClusterName();
  System.out.println("String_Node_Str");
  insertRow(1,10,5,clusterNodeName,true);
  insertRow(2,9,1,clusterNodeName,true);
  insertRow(3,11,1,clusterNodeName,true);
  insertRow(4,10,1,clusterNodeName,true);
  insertRow(5,20,1,clusterNodeName,true);
  refresh(CATALOG);
  LinkedList<LogicalWorkFlowCreator.ConnectorField> connectorFields=new LinkedList<>();
  connectorFields.add(logicalWorkFlowCreator.createConnectorField(COLUMN_1,ALIAS_COLUMN_1,ColumnType.VARCHAR));
  connectorFields.add(logicalWorkFlowCreator.createConnectorField(COLUMN_AGE,ALIAS_COLUMN_AGE,ColumnType.INT));
  LogicalWorkflow logicalPlan=logicalWorkFlowCreator.addDefaultColumns().addColumnName(COLUMN_PK).addSelect(connectorFields).addDistinctFilter(COLUMN_PK,new Integer(2),false,true).addDistinctFilter(COLUMN_PK,new Integer(3),false,true).getLogicalWorkflow();
  QueryResult queryResult=connector.getQueryEngine().execute(logicalPlan);
  assertEquals("String_Node_Str",3,queryResult.getResultSet().size());
}
Program: 33499
Project: 33499
Buggy source:
/** 
 * Return the  date of last use.
 * @return the date of last use.
 */
public String getLastDateInfo(){
  return lastDateInfo;
}

Fixed version (ground truth):
/** 
 * Return the date of last use.
 * @return the date of last use.
 */
public String getLastDateInfo(){
  return lastDateInfo;
}
Program: 33500
Project: 33500
Buggy source:
/** 
 * Set the connection status.
 * @param workInProgress the connection work status.
 */
public void setWorkInProgress(Boolean workInProgress){
  if (workInProgress) {
    status="String_Node_Str";
  }
 else {
    status="String_Node_Str";
  }
  lastDateInfo=dateFormat.format(new Date());
  this.workInProgress=workInProgress;
}

Fixed version (ground truth):
/** 
 * Set the connection status.
 * @param workInProgress the connection work status.
 */
public void setWorkInProgress(Boolean workInProgress){
  final DateFormat dateFormat=new SimpleDateFormat(FILENAME_DATE_PATTERN);
  if (workInProgress) {
    status="String_Node_Str";
  }
 else {
    status="String_Node_Str";
  }
  lastDateInfo=dateFormat.format(new Date());
  this.workInProgress=workInProgress;
}
Program: 33501
Project: 33501
Buggy source:
/** 
 * Abstract method which must be implemented by the concrete database metadataEngine to create a table.
 * @param tableMetadata the table metadata.
 * @param connection    the connection.
 * @throws UnsupportedException if an operation is not supported.
 * @throws ExecutionException   if a error happens.
 */
protected abstract void createTable(TableMetadata tableMetadata,Connection<T> connection) throws UnsupportedException, ExecutionException ;

Fixed version (ground truth):
/** 
 * Abstract method which must be implemented by the concrete database metadataEngine to create a table.
 * @param tableMetadata the table metadata.
 * @param connection the connection.
 * @throws UnsupportedException if an operation is not supported.
 * @throws ExecutionException if a error happens.
 */
protected abstract void createTable(TableMetadata tableMetadata,Connection<T> connection) throws UnsupportedException, ExecutionException ;
Program: 33502
Project: 33502
Buggy source:
/** 
 * Abstract method which must be implemented by the concrete database metadataEngine to create a catalog.
 * @param catalogMetadata the catalog metadata.
 * @param connection      the connection.
 * @throws UnsupportedException if an operation is not supported.
 * @throws ExecutionException   if a error happens.
 */
protected abstract void createCatalog(CatalogMetadata catalogMetadata,Connection<T> connection) throws UnsupportedException, ExecutionException ;

Fixed version (ground truth):
/** 
 * Abstract method which must be implemented by the concrete database metadataEngine to create a catalog.
 * @param catalogMetadata the catalog metadata.
 * @param connection the connection.
 * @throws UnsupportedException if an operation is not supported.
 * @throws ExecutionException if a error happens.
 */
protected abstract void createCatalog(CatalogMetadata catalogMetadata,Connection<T> connection) throws UnsupportedException, ExecutionException ;
Program: 33503
Project: 33503
Buggy source:
/** 
 * Abstract method which must be implemented by the concrete database metadataEngine to drop a catalog.
 * @param name       the catalog name.
 * @param connection the connection.
 * @throws UnsupportedException if an operation is not supported.
 * @throws ExecutionException   if a error happens.
 */
protected abstract void dropCatalog(CatalogName name,Connection<T> connection) throws UnsupportedException, ExecutionException ;

Fixed version (ground truth):
/** 
 * Abstract method which must be implemented by the concrete database metadataEngine to drop a catalog.
 * @param name the catalog name.
 * @param connection the connection.
 * @throws UnsupportedException if an operation is not supported.
 * @throws ExecutionException if a error happens.
 */
protected abstract void dropCatalog(CatalogName name,Connection<T> connection) throws UnsupportedException, ExecutionException ;
Program: 33504
Project: 33504
Buggy source:
/** 
 * Abstract method which must be implemented by the concrete database metadataEngine to create a index.
 * @param indexMetadata the index metadata.
 * @param connection    the connection.
 * @throws UnsupportedException if an operation is not supported.
 * @throws ExecutionException   if a error happens.
 */
protected abstract void createIndex(IndexMetadata indexMetadata,Connection<T> connection) throws UnsupportedException, ExecutionException ;

Fixed version (ground truth):
/** 
 * Abstract method which must be implemented by the concrete database metadataEngine to create a index.
 * @param indexMetadata the index metadata.
 * @param connection the connection.
 * @throws UnsupportedException if an operation is not supported.
 * @throws ExecutionException if a error happens.
 */
protected abstract void createIndex(IndexMetadata indexMetadata,Connection<T> connection) throws UnsupportedException, ExecutionException ;
Program: 33505
Project: 33505
Buggy source:
/** 
 * Abstract method which must be implemented by the concrete database metadataEngine to drop a table.
 * @param name       the catalog name.
 * @param connection the connection.
 * @throws UnsupportedException if an operation is not supported.
 * @throws ExecutionException   if a error happens.
 */
protected abstract void dropTable(TableName name,Connection<T> connection) throws UnsupportedException, ExecutionException ;

Fixed version (ground truth):
/** 
 * Abstract method which must be implemented by the concrete database metadataEngine to drop a table.
 * @param name the catalog name.
 * @param connection the connection.
 * @throws UnsupportedException if an operation is not supported.
 * @throws ExecutionException if a error happens.
 */
protected abstract void dropTable(TableName name,Connection<T> connection) throws UnsupportedException, ExecutionException ;
Program: 33506
Project: 33506
Buggy source:
/** 
 * Abstract method which must be implemented by the concrete database metadataEngine to drop a index.
 * @param indexMetadata the index metadata.
 * @param connection    the connection.
 * @throws UnsupportedException if an operation is not supported.
 * @throws ExecutionException   if a error happens.
 */
protected abstract void dropIndex(IndexMetadata indexMetadata,Connection<T> connection) throws UnsupportedException, ExecutionException ;

Fixed version (ground truth):
/** 
 * Abstract method which must be implemented by the concrete database metadataEngine to drop a index.
 * @param indexMetadata the index metadata.
 * @param connection the connection.
 * @throws UnsupportedException if an operation is not supported.
 * @throws ExecutionException if a error happens.
 */
protected abstract void dropIndex(IndexMetadata indexMetadata,Connection<T> connection) throws UnsupportedException, ExecutionException ;
Program: 33507
Project: 33507
Buggy source:
private void validateResult(Set<Object> proveSet,ResultSet resultSet){
  assertEquals("String_Node_Str",getRowsToSearch(),(Integer)resultSet.size());
  for (int i=0; i < getRowsToSearch(); i++) {
    assertTrue("String_Node_Str",proveSet.contains("String_Node_Str" + i));
    assertTrue("String_Node_Str",proveSet.contains("String_Node_Str" + i));
    assertTrue("String_Node_Str",proveSet.contains("String_Node_Str" + i));
  }
}

Fixed version (ground truth):
private void validateResult(Set<Object> proveSet,ResultSet resultSet){
  assertEquals("String_Node_Str",getRowsToSearch(),(Integer)resultSet.size());
  for (int i=0; i < getRowsToSearch(); i++) {
    assertTrue("String_Node_Str",proveSet.contains(ALIAS_COLUMN_1 + "String_Node_Str" + i));
    assertTrue("String_Node_Str",proveSet.contains(ALIAS_COLUMN_2 + "String_Node_Str" + i));
    assertTrue("String_Node_Str",proveSet.contains(ALIAS_COLUMN_3 + "String_Node_Str" + i));
  }
}
Program: 33508
Project: 33508
Buggy source:
public LogicalWorkflow getLogicalWorkflow(){
  List<LogicalStep> logiclaSteps=new ArrayList<>();
  Project project=new Project(Operations.PROJECT,new TableName(catalog,table),clusterName,columns);
  LogicalStep lastStep=project;
  for (  Filter filter : filters) {
    lastStep.setNextStep(filter);
    lastStep=filter;
  }
  if (limit != null) {
    lastStep.setNextStep(limit);
    lastStep=limit;
  }
  if (window != null) {
    lastStep.setNextStep(window);
    lastStep=window;
  }
  if (select == null) {
    Map<ColumnName,String> selectColumn=new LinkedHashMap<>();
    Map<String,ColumnType> typeMap=new LinkedHashMap();
    Map<ColumnName,ColumnType> typeMapColumnName=new LinkedHashMap<>();
    for (    ColumnName columnName : project.getColumnList()) {
      ColumnName columnNameTemp=new ColumnName(catalog,table,columnName.getName());
      selectColumn.put(columnNameTemp,"String_Node_Str" + columnName.getName());
      typeMap.put(columnName.getQualifiedName(),ColumnType.VARCHAR);
      typeMapColumnName.put(columnNameTemp,ColumnType.VARCHAR);
    }
    select=new Select(Operations.PROJECT,selectColumn,typeMap,typeMapColumnName);
  }
  lastStep.setNextStep(select);
  logiclaSteps.add(project);
  return new LogicalWorkflow(logiclaSteps);
}

Fixed version (ground truth):
public LogicalWorkflow getLogicalWorkflow(){
  List<LogicalStep> logiclaSteps=new ArrayList<>();
  Project project=new Project(Operations.PROJECT,new TableName(catalog,table),clusterName,columns);
  LogicalStep lastStep=project;
  for (  Filter filter : filters) {
    lastStep.setNextStep(filter);
    lastStep=filter;
  }
  if (limit != null) {
    lastStep.setNextStep(limit);
    lastStep=limit;
  }
  if (window != null) {
    lastStep.setNextStep(window);
    lastStep=window;
  }
  if (select == null) {
    Map<ColumnName,String> selectColumn=new LinkedHashMap<>();
    Map<String,ColumnType> typeMap=new LinkedHashMap();
    Map<ColumnName,ColumnType> typeMapColumnName=new LinkedHashMap<>();
    for (    ColumnName columnName : project.getColumnList()) {
      ColumnName columnNameTemp=new ColumnName(catalog,table,columnName.getName());
      selectColumn.put(columnNameTemp,columnName.getName());
      typeMap.put(columnName.getQualifiedName(),ColumnType.VARCHAR);
      typeMapColumnName.put(columnNameTemp,ColumnType.VARCHAR);
    }
    select=new Select(Operations.PROJECT,selectColumn,typeMap,typeMapColumnName);
  }
  lastStep.setNextStep(select);
  logiclaSteps.add(project);
  return new LogicalWorkflow(logiclaSteps);
}
Program: 33509
Project: 33509
Buggy source:
private void loadFromPost(){
  if (!TextUtils.isEmpty(notice_id)) {
    MessageAPI.ignoreOneNotice(notice_id);
    notice_id=null;
  }
  PostAPI.getPostDetailByID(post.getId()).observeOn(AndroidSchedulers.mainThread()).subscribe(new SimpleSubscriber<ResponseObject<Post>>(){
    @Override public void onNext(    ResponseObject<Post> result){
      if (isFinishing()) {
        return;
      }
      if (result.ok) {
        progressBar.setVisibility(View.VISIBLE);
        floatingActionsMenu.setVisibility(View.VISIBLE);
        loadingView.onSuccess();
        result.result.setFeatured(post != null && post.isFeatured());
        post=result.result;
        post.setDesc(loadDesc);
        adapter.add(0,post);
        adapter.notifyDataSetChanged();
        loadReplies(0);
      }
 else {
        if (result.statusCode == 404) {
          toastSingleton(R.string.post_404);
          finish();
        }
 else {
          loadingView.onFailed();
          toastSingleton(getString(R.string.load_failed));
          progressBar.setVisibility(View.GONE);
        }
      }
      setMenuVisibility();
    }
  }
);
}

Fixed version (ground truth):
private void loadFromPost(){
  if (!TextUtils.isEmpty(notice_id)) {
    MessageAPI.ignoreOneNotice(notice_id);
    notice_id=null;
  }
  PostAPI.getPostDetailByID(post.getId()).observeOn(AndroidSchedulers.mainThread()).subscribe(new SimpleSubscriber<ResponseObject<Post>>(){
    @Override public void onNext(    ResponseObject<Post> result){
      if (isFinishing()) {
        return;
      }
      if (result.ok) {
        progressBar.setVisibility(View.VISIBLE);
        floatingActionsMenu.setVisibility(View.VISIBLE);
        loadingView.onSuccess();
        result.result.setFeatured(post != null && post.isFeatured());
        post=result.result;
        post.setDesc(loadDesc);
        adapter.clear();
        adapter.add(post);
        adapter.notifyDataSetChanged();
        loadReplies(0);
      }
 else {
        if (result.statusCode == 404) {
          toastSingleton(R.string.post_404);
          finish();
        }
 else {
          loadingView.onFailed();
          toastSingleton(getString(R.string.load_failed));
          progressBar.setVisibility(View.GONE);
        }
      }
      setMenuVisibility();
    }
  }
);
}
Program: 33510
Project: 33510
Buggy source:
@Override public void onClick(View v){
  if (UiUtil.shouldThrottle()) {
    return;
  }
switch (v.getId()) {
case R.id.button_reply:
    replyArticle();
  break;
case R.id.button_recommend:
recommend();
break;
case R.id.button_favor:
favor();
break;
}
}

Fixed version (ground truth):
@Override public void onClick(View v){
switch (v.getId()) {
case R.id.button_reply:
    replyArticle();
  break;
case R.id.button_recommend:
recommend();
break;
case R.id.button_favor:
favor();
break;
}
}
Program: 33511
Project: 33511
Buggy source:
private void replyArticle(UComment comment){
  if (!UserAPI.isLoggedIn()) {
    gotoLogin();
  }
 else {
    Intent intent=new Intent(this,ReplyActivity.class);
    intent.putExtra(Consts.Extra_Ace_Model,article);
    if (comment != null) {
      intent.putExtra(Consts.Extra_Simple_Comment,comment);
    }
    startActivityForResult(intent,Consts.Code_Reply_Article);
  }
}

Fixed version (ground truth):
private void replyArticle(UComment comment){
  if (!UserAPI.isLoggedIn()) {
    gotoLogin();
  }
 else {
    Intent intent=new Intent(this,ReplyActivity.class);
    intent.putExtra(Consts.Extra_Ace_Model,article);
    if (comment != null) {
      intent.putExtra(Consts.Extra_Simple_Comment,comment);
    }
    startOneActivityForResult(intent,Consts.Code_Reply_Article);
  }
}
Program: 33513
Project: 33513
Buggy source:
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  if (UiUtil.shouldThrottle()) {
    return;
  }
  if (view instanceof AnswerListItemView) {
    Intent intent=new Intent();
    intent.setClass(MyAnswersActivity.this,AnswerActivity.class);
    Uri answerUri=Uri.parse("String_Node_Str" + ((AnswerListItemView)view).getData().getID() + "String_Node_Str");
    intent.setData(answerUri);
    startOneActivity(intent);
  }
}

Fixed version (ground truth):
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  if (view instanceof AnswerListItemView) {
    Intent intent=new Intent();
    intent.setClass(MyAnswersActivity.this,AnswerActivity.class);
    Uri answerUri=Uri.parse("String_Node_Str" + ((AnswerListItemView)view).getData().getID() + "String_Node_Str");
    intent.setData(answerUri);
    startOneActivity(intent);
  }
}
Program: 33514
Project: 33514
Buggy source:
private void replyPost(UComment comment){
  if (!UserAPI.isLoggedIn()) {
    gotoLogin();
  }
 else {
    Intent intent=new Intent(this,ReplyActivity.class);
    intent.putExtra(Consts.Extra_Ace_Model,post);
    if (comment != null) {
      intent.putExtra(Consts.Extra_Simple_Comment,comment);
    }
    startActivityForResult(intent,Consts.Code_Reply_Post);
  }
}

Fixed version (ground truth):
private void replyPost(UComment comment){
  if (!UserAPI.isLoggedIn()) {
    gotoLogin();
  }
 else {
    Intent intent=new Intent(this,ReplyActivity.class);
    intent.putExtra(Consts.Extra_Ace_Model,post);
    if (comment != null) {
      intent.putExtra(Consts.Extra_Simple_Comment,comment);
    }
    startOneActivityForResult(intent,Consts.Code_Reply_Post);
  }
}
Program: 33515
Project: 33515
Buggy source:
private void invokeCamera(){
  String parentPath;
  File pFile=null;
  if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
    pFile=getExternalFilesDir(Environment.DIRECTORY_PICTURES);
  }
  if (pFile == null) {
    pFile=getFilesDir();
  }
  parentPath=pFile.getAbsolutePath();
  tmpUploadFile=new File(parentPath,System.currentTimeMillis() + "String_Node_Str");
  Intent intent=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  Uri localUri=Uri.fromFile(tmpUploadFile);
  intent.putExtra(MediaStore.EXTRA_OUTPUT,localUri);
  startActivityForResult(intent,Consts.Code_Invoke_Camera);
}

Fixed version (ground truth):
private void invokeCamera(){
  String parentPath;
  File pFile=null;
  if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
    pFile=getExternalFilesDir(Environment.DIRECTORY_PICTURES);
  }
  if (pFile == null) {
    pFile=getFilesDir();
  }
  parentPath=pFile.getAbsolutePath();
  tmpUploadFile=new File(parentPath,System.currentTimeMillis() + "String_Node_Str");
  Intent intent=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  Uri localUri=Uri.fromFile(tmpUploadFile);
  intent.putExtra(MediaStore.EXTRA_OUTPUT,localUri);
  startOneActivityForResult(intent,Consts.Code_Invoke_Camera);
}
Program: 33516
Project: 33516
Buggy source:
private void invokeImageDialog(){
  String[] ways={getString(R.string.add_image_from_disk),getString(R.string.add_image_from_camera),getString(R.string.add_image_from_link)};
  new AlertDialog.Builder(this).setTitle(R.string.way_to_add_image).setItems(ways,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
switch (which) {
case 0:
        Intent intent=new Intent();
      intent.setType("String_Node_Str");
    intent.setAction(Intent.ACTION_GET_CONTENT);
  startActivityForResult(intent,Consts.Code_Invoke_Image_Selector);
break;
case 1:
invokeCamera();
break;
case 2:
invokeImageUrlDialog();
break;
}
}
}
).create().show();
}

Fixed version (ground truth):
private void invokeImageDialog(){
  String[] ways={getString(R.string.add_image_from_disk),getString(R.string.add_image_from_camera),getString(R.string.add_image_from_link)};
  new AlertDialog.Builder(this).setTitle(R.string.way_to_add_image).setItems(ways,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
switch (which) {
case 0:
        Intent intent=new Intent();
      intent.setType("String_Node_Str");
    intent.setAction(Intent.ACTION_GET_CONTENT);
  startOneActivityForResult(intent,Consts.Code_Invoke_Image_Selector);
break;
case 1:
invokeCamera();
break;
case 2:
invokeImageUrlDialog();
break;
}
}
}
).create().show();
}
Program: 33517
Project: 33517
Buggy source:
private void invokeCamera(){
  String parentPath;
  File pFile=null;
  if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
    pFile=getExternalFilesDir(Environment.DIRECTORY_PICTURES);
  }
  if (pFile == null) {
    pFile=getFilesDir();
  }
  parentPath=pFile.getAbsolutePath();
  tmpUploadFile=new File(parentPath,System.currentTimeMillis() + "String_Node_Str");
  Intent intent=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  Uri localUri=Uri.fromFile(tmpUploadFile);
  intent.putExtra(MediaStore.EXTRA_OUTPUT,localUri);
  startActivityForResult(intent,Consts.Code_Invoke_Camera);
}

Fixed version (ground truth):
private void invokeCamera(){
  String parentPath;
  File pFile=null;
  if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
    pFile=getExternalFilesDir(Environment.DIRECTORY_PICTURES);
  }
  if (pFile == null) {
    pFile=getFilesDir();
  }
  parentPath=pFile.getAbsolutePath();
  tmpUploadFile=new File(parentPath,System.currentTimeMillis() + "String_Node_Str");
  Intent intent=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  Uri localUri=Uri.fromFile(tmpUploadFile);
  intent.putExtra(MediaStore.EXTRA_OUTPUT,localUri);
  startOneActivityForResult(intent,Consts.Code_Invoke_Camera);
}
Program: 33518
Project: 33518
Buggy source:
private void invokeImageDialog(){
  String[] ways={getString(R.string.add_image_from_disk),getString(R.string.add_image_from_camera),getString(R.string.add_image_from_link)};
  new AlertDialog.Builder(this).setTitle(R.string.way_to_add_image).setItems(ways,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
switch (which) {
case 0:
        Intent intent=new Intent();
      intent.setType("String_Node_Str");
    intent.setAction(Intent.ACTION_GET_CONTENT);
  startActivityForResult(intent,Consts.Code_Invoke_Image_Selector);
break;
case 1:
invokeCamera();
break;
case 2:
invokeImageUrlDialog();
break;
}
}
}
).create().show();
}

Fixed version (ground truth):
private void invokeImageDialog(){
  String[] ways={getString(R.string.add_image_from_disk),getString(R.string.add_image_from_camera),getString(R.string.add_image_from_link)};
  new AlertDialog.Builder(this).setTitle(R.string.way_to_add_image).setItems(ways,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
switch (which) {
case 0:
        Intent intent=new Intent();
      intent.setType("String_Node_Str");
    intent.setAction(Intent.ACTION_GET_CONTENT);
  startOneActivityForResult(intent,Consts.Code_Invoke_Image_Selector);
break;
case 1:
invokeCamera();
break;
case 2:
invokeImageUrlDialog();
break;
}
}
}
).create().show();
}
Program: 33519
Project: 33519
Buggy source:
/** 
 * 是否应该阻止第二次单击 if(shouldThrottle()){ return; }
 * @return
 */
public static boolean shouldThrottle(){
  long crtTime=System.currentTimeMillis();
  boolean flag=Math.abs(crtTime - lastClickTime) <= Config.throttleSpan;
  lastClickTime=crtTime;
  return flag;
}

Fixed version (ground truth):
/** 
 * 是否应该阻止第二次单击 if(shouldThrottle()){ return; }
 * @return
 */
public static boolean shouldThrottle(){
  System.out.println("String_Node_Str");
  long crtTime=System.currentTimeMillis();
  System.out.println(crtTime - lastClickTime);
  boolean flag=Math.abs(crtTime - lastClickTime) <= Config.throttleSpan;
  lastClickTime=crtTime;
  return flag;
}
Program: 33521
Project: 33521
Buggy source:
private String combine(String url,List<Param> params){
  return HttpUrl.parse(url).newBuilder().query(getQueryString(params)).build().toString();
}

Fixed version (ground truth):
private String combine(String url,List<Param> params){
  HttpUrl.Builder builder=HttpUrl.parse(url).newBuilder();
  if (params != null) {
    for (    Param param : params) {
      builder.addQueryParameter(param.key,param.value);
    }
  }
  return builder.build().toString();
}
Program: 33522
Project: 33522
Buggy source:
/** 
 * 将地址与参数拼合,地址本身可以含有参数
 * @param url
 * @param params
 * @return
 */
public static String combine(String url,List<Param> params){
  return HttpUrl.parse(url).newBuilder().query(getQueryString(params)).build().toString();
}

Fixed version (ground truth):
/** 
 * 将地址与参数拼合,地址本身可以含有参数
 * @param url
 * @param params
 * @return
 */
public static String combine(String url,List<Param> params){
  HttpUrl.Builder builder=HttpUrl.parse(url).newBuilder();
  if (params != null) {
    for (    Param param : params) {
      builder.addQueryParameter(param.key,param.value);
    }
  }
  return builder.build().toString();
}
Program: 33523
Project: 33523
Buggy source:
private void writePost(){
  if (UserAPI.isLoggedIn()) {
    Intent intent=new Intent(getActivity(),ShuffleActivity.class);
    intent.putExtra(Consts.Extra_SubItem,subItem);
    startActivityForResult(intent,Code_Publish_Post);
  }
 else {
    ((BaseActivity)getActivity()).notifyNeedLog();
  }
}

Fixed version (ground truth):
private void writePost(){
  if (UserAPI.isLoggedIn()) {
    Intent intent=new Intent(getActivity(),PublishPostActivity.class);
    intent.putExtra(Consts.Extra_SubItem,subItem);
    startActivityForResult(intent,Code_Publish_Post);
  }
 else {
    ((BaseActivity)getActivity()).notifyNeedLog();
  }
}
Program: 33524
Project: 33524
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_shuffle);
  desk=(ShuffleDesk)findViewById(R.id.shuffle_desk);
  desk.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      desk.getViewTreeObserver().removeGlobalOnLayoutListener(this);
      initView();
    }
  }
);
  netTask=new LoaderFromNetTask();
  netTask.executeOnExecutor(android.os.AsyncTask.THREAD_POOL_EXECUTOR);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_shuffle);
  desk=(ShuffleDesk)findViewById(R.id.shuffle_desk);
  desk.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      desk.getViewTreeObserver().removeGlobalOnLayoutListener(this);
      initView();
    }
  }
);
  dbTask=new LoaderFromDBTask();
  dbTask.executeOnExecutor(android.os.AsyncTask.THREAD_POOL_EXECUTOR);
}
Program: 33526
Project: 33526
Buggy source:
public static void putUnselectedGroups(List<MyGroup> myGroups){
  List<MyGroup> groups=getSelectedGroups();
  groups.addAll(myGroups);
  for (int i=0; i < groups.size(); i++) {
    groups.get(i).setId(null);
  }
  MyGroupDao myGroupDao=AppApplication.getDaoSession().getMyGroupDao();
  myGroupDao.deleteAll();
  myGroupDao.insertInTx(groups);
}

Fixed version (ground truth):
/** 
 * 调整未选中项的顺序，不修改Key_Last_Post_Groups_Version
 * @param myGroups
 */
public static void putUnselectedGroups(List<MyGroup> myGroups){
  AppApplication.getDaoSession().getDatabase().beginTransaction();
  try {
    List<MyGroup> groups=getSelectedGroups();
    groups.addAll(myGroups);
    for (int i=0; i < groups.size(); i++) {
      groups.get(i).setId(null);
    }
    MyGroupDao myGroupDao=AppApplication.getDaoSession().getMyGroupDao();
    myGroupDao.deleteAll();
    myGroupDao.insertInTx(groups);
    AppApplication.getDaoSession().getDatabase().setTransactionSuccessful();
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str");
  }
 finally {
    AppApplication.getDaoSession().getDatabase().endTransaction();
  }
}
Program: 33527
Project: 33527
Buggy source:
public static void putAllMyGroups(List<MyGroup> myGroups){
  MyGroupDao myGroupDao=AppApplication.getDaoSession().getMyGroupDao();
  myGroupDao.deleteAll();
  myGroupDao.insertInTx(myGroups);
}

Fixed version (ground truth):
public static void putAllMyGroups(List<MyGroup> myGroups){
  AppApplication.getDaoSession().getDatabase().beginTransaction();
  try {
    MyGroupDao myGroupDao=AppApplication.getDaoSession().getMyGroupDao();
    myGroupDao.deleteAll();
    myGroupDao.insertInTx(myGroups);
    AppApplication.getDaoSession().getDatabase().setTransactionSuccessful();
    SharedUtil.saveLong(Consts.Key_Last_Post_Groups_Version,System.currentTimeMillis());
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str");
  }
 finally {
    AppApplication.getDaoSession().getDatabase().endTransaction();
  }
}
Program: 33528
Project: 33528
Buggy source:
/** 
 * 临时办法  FIXME
 */
private void checkChannelList(){
  ArrayList<SubItem> subItems=adapter.getSubLists().get(1);
  SubItem item=subItems.get(0);
  boolean isItemMy=item.getType() == SubItem.Type_Private_Channel;
  if (UserAPI.isLoggedIn()) {
    if (GroupHelper.getMyGroupsNumber() > 0) {
      subItems.clear();
      subItems.add(0,new SubItem(SubItem.Section_Post,SubItem.Type_Private_Channel,"String_Node_Str","String_Node_Str"));
      subItems.addAll(GroupHelper.getSelectedGroupSubItems());
    }
 else {
      if (!isItemMy) {
        subItems.add(0,new SubItem(SubItem.Section_Post,SubItem.Type_Private_Channel,"String_Node_Str","String_Node_Str"));
        adapter.notifyDataSetChanged();
      }
    }
  }
 else {
    if (isItemMy) {
      subItems.remove(0);
      adapter.notifyDataSetChanged();
    }
 else {
    }
  }
}

Fixed version (ground truth):
/** 
 * 临时办法  FIXME
 */
private void checkChannelList(){
  ArrayList<SubItem> subItems=adapter.getSubLists().get(1);
  SubItem item=subItems.get(0);
  boolean isItemMy=item.getType() == SubItem.Type_Private_Channel;
  if (UserAPI.isLoggedIn()) {
    if (GroupHelper.getMyGroupsNumber() > 0) {
      subItems.clear();
      subItems.add(new SubItem(SubItem.Section_Post,SubItem.Type_Private_Channel,"String_Node_Str","String_Node_Str"));
      subItems.add(new SubItem(SubItem.Section_Post,SubItem.Type_Collections,"String_Node_Str","String_Node_Str"));
      subItems.addAll(GroupHelper.getSelectedGroupSubItems());
    }
 else {
      if (!isItemMy) {
        subItems.add(0,new SubItem(SubItem.Section_Post,SubItem.Type_Private_Channel,"String_Node_Str","String_Node_Str"));
      }
    }
  }
 else {
    subItems.clear();
    subItems.addAll(ChannelHelper.getPosts());
  }
  adapter.notifyDataSetInvalidated();
}
Program: 33529
Project: 33529
Buggy source:
@Override public void onResume(){
  super.onResume();
  if (isFirstLoad) {
    if (UserAPI.isLoggedIn()) {
      String nameString=SharedUtil.readString(Consts.Key_User_Name,"String_Node_Str");
      if (!TextUtils.isEmpty(nameString)) {
        userName.setText(nameString);
      }
      String avatarString=SharedUtil.readString(Consts.Key_User_Avatar,"String_Node_Str");
      if (!TextUtils.isEmpty(avatarString)) {
        Picasso.with(getActivity()).load(avatarString).resizeDimen(R.dimen.list_standard_comment_avatar_dimen,R.dimen.list_standard_comment_avatar_dimen).into(avatarView);
      }
      testLogin();
    }
    isFirstLoad=false;
  }
 else {
    if (loginState != UserAPI.isLoggedIn()) {
      checkChannelList();
      if (UserAPI.isLoggedIn()) {
        loadUserInfo();
        loginState=true;
      }
 else {
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  if (isFirstLoad) {
    if (UserAPI.isLoggedIn()) {
      String nameString=SharedUtil.readString(Consts.Key_User_Name,"String_Node_Str");
      if (!TextUtils.isEmpty(nameString)) {
        userName.setText(nameString);
      }
      String avatarString=SharedUtil.readString(Consts.Key_User_Avatar,"String_Node_Str");
      if (!TextUtils.isEmpty(avatarString)) {
        Picasso.with(getActivity()).load(avatarString).resizeDimen(R.dimen.list_standard_comment_avatar_dimen,R.dimen.list_standard_comment_avatar_dimen).into(avatarView);
      }
      testLogin();
    }
    isFirstLoad=false;
  }
 else {
    if (loginState != UserAPI.isLoggedIn()) {
      checkChannelList();
      if (UserAPI.isLoggedIn()) {
        loadUserInfo();
        loginState=true;
      }
 else {
      }
    }
 else {
      long lastDBVersion=SharedUtil.readLong(Consts.Key_Last_Post_Groups_Version,0);
      if (currentDBVersion != lastDBVersion) {
        ArrayList<SubItem> subItems=adapter.getSubLists().get(1);
        subItems.clear();
        subItems.add(new SubItem(SubItem.Section_Post,SubItem.Type_Private_Channel,"String_Node_Str","String_Node_Str"));
        subItems.add(new SubItem(SubItem.Section_Post,SubItem.Type_Collections,"String_Node_Str","String_Node_Str"));
        subItems.addAll(GroupHelper.getSelectedGroupSubItems());
        adapter.notifyDataSetChanged();
        currentDBVersion=lastDBVersion;
      }
    }
  }
}
Program: 33530
Project: 33530
Buggy source:
@Override public void resetData(SubItem subItem){
  if (subItem.equals(this.subItem)) {
    triggerRefresh();
  }
 else {
    currentPage=-1;
    this.subItem=subItem;
    adapter.clear();
    adapter.notifyDataSetInvalidated();
    listView.setCanPullToRefresh(false);
    listView.setCanPullToLoadMore(false);
    headerView.getLayoutParams().height=1;
    headerView.setVisibility(View.GONE);
    loadOver();
  }
  setTitle();
}

Fixed version (ground truth):
@Override public void resetData(SubItem subItem){
  if (subItem.equals(this.subItem)) {
    triggerRefresh();
  }
 else {
    currentPage=-1;
    this.subItem=subItem;
    adapter.clear();
    adapter.notifyDataSetInvalidated();
    listView.setCanPullToRefresh(false);
    listView.setCanPullToLoadMore(false);
    headerView.getLayoutParams().height=1;
    headerView.setVisibility(View.GONE);
    loadOver();
  }
  hideMoreGroups();
  setTitle();
}
Program: 33531
Project: 33531
Buggy source:
private void showMoreGroups(){
  isMoreGroupsButtonShowing=true;
  if (animatorSet != null && animatorSet.isRunning()) {
    animatorSet.cancel();
  }
  animatorSet=new AnimatorSet();
  ObjectAnimator layoutAnimator=ObjectAnimator.ofFloat(moreGroupsLayout,"String_Node_Str",moreGroupsLayout.getTranslationY(),0);
  layoutAnimator.setInterpolator(new DecelerateInterpolator());
  ObjectAnimator imageAnimator=ObjectAnimator.ofFloat(moreGroupImageView,"String_Node_Str",moreGroupImageView.getRotation(),180);
  imageAnimator.setInterpolator(new DecelerateInterpolator());
  ArrayList<Animator> animators=new ArrayList<>();
  animators.add(layoutAnimator);
  animators.add(imageAnimator);
  animatorSet.addListener(new Animator.AnimatorListener(){
    @Override public void onAnimationEnd(    Animator animation){
      if (!hasLoadedGroups) {
        getButtons();
        initView();
        hasLoadedGroups=true;
      }
    }
    @Override public void onAnimationStart(    Animator animation){
    }
    @Override public void onAnimationCancel(    Animator animation){
    }
    @Override public void onAnimationRepeat(    Animator animation){
    }
  }
);
  animatorSet.playTogether(animators);
  animatorSet.setDuration(350);
  animatorSet.start();
}

Fixed version (ground truth):
private void showMoreGroups(){
  isMoreGroupsButtonShowing=true;
  if (animatorSet != null && animatorSet.isRunning()) {
    animatorSet.cancel();
  }
  animatorSet=new AnimatorSet();
  ObjectAnimator layoutAnimator=ObjectAnimator.ofFloat(moreGroupsLayout,"String_Node_Str",moreGroupsLayout.getTranslationY(),0);
  layoutAnimator.setInterpolator(new DecelerateInterpolator());
  ObjectAnimator imageAnimator=ObjectAnimator.ofFloat(moreGroupImageView,"String_Node_Str",moreGroupImageView.getRotation(),180);
  imageAnimator.setInterpolator(new DecelerateInterpolator());
  ArrayList<Animator> animators=new ArrayList<>();
  animators.add(layoutAnimator);
  animators.add(imageAnimator);
  animatorSet.addListener(new Animator.AnimatorListener(){
    @Override public void onAnimationEnd(    Animator animation){
      long lastDBVersion=SharedUtil.readLong(Consts.Key_Last_Post_Groups_Version,0);
      if (currentDBVersion != lastDBVersion) {
        getButtons();
        initView();
        currentDBVersion=SharedUtil.readLong(Consts.Key_Last_Post_Groups_Version,0);
      }
    }
    @Override public void onAnimationStart(    Animator animation){
    }
    @Override public void onAnimationCancel(    Animator animation){
    }
    @Override public void onAnimationRepeat(    Animator animation){
    }
  }
);
  animatorSet.playTogether(animators);
  animatorSet.setDuration(350);
  animatorSet.start();
}
Program: 33532
Project: 33532
Buggy source:
private void writePost(){
  if (UserAPI.isLoggedIn()) {
    Intent intent=new Intent(getActivity(),PublishPostActivity.class);
    intent.putExtra(Consts.Extra_SubItem,subItem);
    startActivityForResult(intent,Code_Publish_Post);
  }
 else {
    ((BaseActivity)getActivity()).notifyNeedLog();
  }
}

Fixed version (ground truth):
private void writePost(){
  if (UserAPI.isLoggedIn()) {
    Intent intent=new Intent(getActivity(),ShuffleActivity.class);
    intent.putExtra(Consts.Extra_SubItem,subItem);
    startActivityForResult(intent,Code_Publish_Post);
  }
 else {
    ((BaseActivity)getActivity()).notifyNeedLog();
  }
}
Program: 33533
Project: 33533
Buggy source:
@Override public void onResume(){
  super.onResume();
  if (isFirstLoad) {
    if (UserAPI.isLoggedIn()) {
      String nameString=SharedUtil.readString(Consts.Key_User_Name,"String_Node_Str");
      if (!TextUtils.isEmpty(nameString)) {
        userName.setText(nameString);
      }
      String avatarString=SharedUtil.readString(Consts.Key_User_Avatar,"String_Node_Str");
      if (!TextUtils.isEmpty(avatarString)) {
        Picasso.with(getActivity()).load(avatarString).resizeDimen(R.dimen.list_standard_comment_avatar_dimen,R.dimen.list_standard_comment_avatar_dimen).into(avatarView);
      }
      testLogin();
    }
    isFirstLoad=false;
  }
 else {
    if (loginState != UserAPI.isLoggedIn()) {
      checkChannelList();
      if (UserAPI.isLoggedIn()) {
        loadUserInfo();
        loginState=true;
      }
 else {
      }
    }
 else {
      long lastDBVersion=SharedUtil.readLong(Consts.Key_Last_Post_Groups_Version,0);
      if (currentDBVersion != lastDBVersion) {
        ArrayList<SubItem> subItems=adapter.getSubLists().get(1);
        subItems.clear();
        subItems.add(new SubItem(SubItem.Section_Post,SubItem.Type_Private_Channel,"String_Node_Str","String_Node_Str"));
        subItems.add(new SubItem(SubItem.Section_Post,SubItem.Type_Collections,"String_Node_Str","String_Node_Str"));
        subItems.addAll(GroupHelper.getSelectedGroupSubItems());
        adapter.notifyDataSetChanged();
        currentDBVersion=lastDBVersion;
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  if (isFirstLoad) {
    if (UserAPI.isLoggedIn()) {
      String nameString=SharedUtil.readString(Consts.Key_User_Name,"String_Node_Str");
      if (!TextUtils.isEmpty(nameString)) {
        userName.setText(nameString);
      }
      String avatarString=SharedUtil.readString(Consts.Key_User_Avatar,"String_Node_Str");
      if (!TextUtils.isEmpty(avatarString)) {
        Picasso.with(getActivity()).load(avatarString).resizeDimen(R.dimen.list_standard_comment_avatar_dimen,R.dimen.list_standard_comment_avatar_dimen).into(avatarView);
      }
      testLogin();
    }
    isFirstLoad=false;
  }
 else {
    if (loginState != UserAPI.isLoggedIn()) {
      checkChannelList();
      if (UserAPI.isLoggedIn()) {
        loadUserInfo();
        loginState=true;
      }
 else {
      }
    }
 else {
      long lastDBVersion=SharedUtil.readLong(Consts.Key_Last_Post_Groups_Version,0);
      if (currentDBVersion != lastDBVersion && GroupHelper.getMyGroupsNumber() > 0) {
        ArrayList<SubItem> subItems=adapter.getSubLists().get(1);
        subItems.clear();
        subItems.add(new SubItem(SubItem.Section_Post,SubItem.Type_Private_Channel,"String_Node_Str","String_Node_Str"));
        subItems.add(new SubItem(SubItem.Section_Post,SubItem.Type_Collections,"String_Node_Str","String_Node_Str"));
        subItems.addAll(GroupHelper.getSelectedGroupSubItems());
        adapter.notifyDataSetChanged();
        currentDBVersion=lastDBVersion;
      }
    }
  }
}