nus-yam/ex-repair huggingface dataset:
Program: 50847
Project: 50847
Buggy source:
public synchronized void check(final Context context){
  if (!stackTraceFile.exists())   return;
  final Builder builder=new AlertDialog.Builder(context).setIcon(android.R.drawable.ic_dialog_alert).setTitle(DIALOG_TITLE).setMessage(DIALOG_MESSAGE);
  builder.setPositiveButton("String_Node_Str",new OnClickListener(){
    public void onClick(    final DialogInterface dialog,    final int which){
      sendError(context);
      stackTraceFile.delete();
    }
  }
);
  builder.setNegativeButton("String_Node_Str",new OnClickListener(){
    public void onClick(    final DialogInterface dialog,    final int which){
      stackTraceFile.delete();
      dialog.dismiss();
    }
  }
);
  try {
    builder.show();
  }
 catch (  final Exception x) {
  }
}

Fixed version (ground truth):
public synchronized void check(final Context context){
  if (!stackTraceFile.exists())   return;
  final Builder builder=new AlertDialog.Builder(context).setIcon(android.R.drawable.ic_dialog_alert).setTitle(DIALOG_TITLE).setMessage(DIALOG_MESSAGE);
  builder.setPositiveButton("String_Node_Str",new OnClickListener(){
    public void onClick(    final DialogInterface dialog,    final int which){
      sendError(context);
      stackTraceFile.delete();
    }
  }
);
  builder.setNegativeButton("String_Node_Str",new OnClickListener(){
    public void onClick(    final DialogInterface dialog,    final int which){
      stackTraceFile.delete();
    }
  }
);
  builder.setOnCancelListener(new OnCancelListener(){
    public void onCancel(    final DialogInterface dialog){
      stackTraceFile.delete();
    }
  }
);
  try {
    builder.show();
  }
 catch (  final Exception x) {
  }
}
Program: 50850
Project: 50850
Buggy source:
private Wallet restoreWalletFromBackup(){
  try {
    final Wallet wallet=readKeys(openFileInput(Constants.WALLET_KEY_BACKUP_BASE58));
    final File file=new File(getDir("String_Node_Str",Context.MODE_WORLD_READABLE | Context.MODE_WORLD_WRITEABLE),Constants.BLOCKCHAIN_FILENAME);
    file.delete();
    Toast.makeText(this,R.string.toast_wallet_reset,Toast.LENGTH_LONG).show();
    return wallet;
  }
 catch (  final IOException x) {
    throw new RuntimeException(x);
  }
}

Fixed version (ground truth):
private Wallet restoreWalletFromBackup(){
  try {
    final Wallet wallet=readKeys(openFileInput(Constants.WALLET_KEY_BACKUP_BASE58));
    final File file=new File(getDir("String_Node_Str",Context.MODE_WORLD_READABLE | Context.MODE_WORLD_WRITEABLE),Constants.BLOCKCHAIN_FILENAME);
    file.delete();
    Toast.makeText(this,R.string.toast_wallet_reset,Toast.LENGTH_LONG).show();
    System.out.println("String_Node_Str" + Constants.WALLET_KEY_BACKUP_BASE58 + "String_Node_Str");
    return wallet;
  }
 catch (  final IOException x) {
    throw new RuntimeException(x);
  }
}
Program: 50851
Project: 50851
Buggy source:
private Wallet restoreWalletFromSnapshot() throws FileNotFoundException {
  try {
    final Wallet wallet=readKeys(getAssets().open(Constants.WALLET_KEY_BACKUP_SNAPSHOT));
    System.out.println("String_Node_Str");
    return wallet;
  }
 catch (  final FileNotFoundException x) {
    throw x;
  }
catch (  final IOException x) {
    throw new RuntimeException(x);
  }
}

Fixed version (ground truth):
private Wallet restoreWalletFromSnapshot() throws FileNotFoundException {
  try {
    final Wallet wallet=readKeys(getAssets().open(Constants.WALLET_KEY_BACKUP_SNAPSHOT));
    System.out.println("String_Node_Str" + Constants.WALLET_KEY_BACKUP_SNAPSHOT + "String_Node_Str");
    return wallet;
  }
 catch (  final FileNotFoundException x) {
    throw x;
  }
catch (  final IOException x) {
    throw new RuntimeException(x);
  }
}
Program: 50852
Project: 50852
Buggy source:
/** 
 * Returns the time at which the block was solved and broadcast, according to the clock of the solving node. 
 */
public long getTime(){
  return time;
}

Fixed version (ground truth):
/** 
 * Returns the time in seconds at which the block was solved and broadcast, according to the clock of the solving node. 
 */
public long getTime(){
  return time;
}
Program: 50853
Project: 50853
Buggy source:
public int getMaxConnections(){
  return maxConnections;
}

Fixed version (ground truth):
public int getMaxConnections(){
  return peerPool.getMaximumPoolSize();
}
Program: 50854
Project: 50854
Buggy source:
/** 
 * Create a PeerGroup
 */
public PeerGroup(BlockStore blockStore,NetworkParameters params,BlockChain chain,Wallet wallet,final PeerConnectionListener peerConnectionListener){
  this.maxConnections=DEFAULT_CONNECTIONS;
  this.blockStore=blockStore;
  this.params=params;
  this.chain=chain;
  this.wallet=wallet;
  this.peerConnectionListener=peerConnectionListener;
  inactives=new LinkedBlockingQueue<PeerAddress>();
  peers=Collections.synchronizedSet(new HashSet<Peer>());
  peerPool=new ThreadPoolExecutor(CORE_THREADS,this.maxConnections,THREAD_KEEP_ALIVE_SECONDS,TimeUnit.SECONDS,new LinkedBlockingQueue<Runnable>(1),new PeerGroupThreadFactory());
}

Fixed version (ground truth):
/** 
 * Create a PeerGroup
 */
public PeerGroup(BlockStore blockStore,NetworkParameters params,BlockChain chain,Wallet wallet,final PeerConnectionListener peerConnectionListener){
  this.blockStore=blockStore;
  this.params=params;
  this.chain=chain;
  this.wallet=wallet;
  this.peerConnectionListener=peerConnectionListener;
  inactives=new LinkedBlockingQueue<PeerAddress>();
  peers=Collections.synchronizedSet(new HashSet<Peer>());
  peerPool=new ThreadPoolExecutor(CORE_THREADS,DEFAULT_CONNECTIONS,THREAD_KEEP_ALIVE_SECONDS,TimeUnit.SECONDS,new LinkedBlockingQueue<Runnable>(1),new PeerGroupThreadFactory());
}
Program: 50855
Project: 50855
Buggy source:
/** 
 * Depending on the environment, this should normally be between 1 and 10, default is 4.
 * @param maxConnections the maximum number of peer connections that this group will try to make.
 */
public void setMaxConnections(int maxConnections){
  this.maxConnections=maxConnections;
  peerPool.setMaximumPoolSize(maxConnections);
}

Fixed version (ground truth):
/** 
 * Depending on the environment, this should normally be between 1 and 10, default is 4.
 * @param maxConnections the maximum number of peer connections that this group will try to make.
 */
public void setMaxConnections(int maxConnections){
  peerPool.setMaximumPoolSize(maxConnections);
}
Program: 50856
Project: 50856
Buggy source:
/** 
 * Start downloading the blockchain from the first available peer. <p>If no peers are currently connected, the download will be started once a peer starts.  If the peer dies, the download will resume with another peer.
 * @param listener a listener for chain download events, may not be null
 */
public synchronized void startBlockChainDownload(PeerEventListener listener){
  this.downloadListener=listener;
  if (!peers.isEmpty()) {
synchronized (peers) {
      startBlockChainDownloadFromPeer(peers.iterator().next());
    }
  }
}

Fixed version (ground truth):
/** 
 * Start downloading the blockchain from the first available peer. <p>If no peers are currently connected, the download will be started once a peer starts.  If the peer dies, the download will resume with another peer.
 * @param listener a listener for chain download events, may not be null
 */
public synchronized void startBlockChainDownload(PeerEventListener listener){
  this.downloadListener=listener;
synchronized (peers) {
    if (!peers.isEmpty()) {
      startBlockChainDownloadFromPeer(peers.iterator().next());
    }
  }
}
Program: 50857
Project: 50857
Buggy source:
protected synchronized void handlePeerDeath(Peer peer){
  if (peer == downloadPeer) {
    downloadPeer=null;
    if (downloadListener != null && !peers.isEmpty()) {
synchronized (peers) {
        startBlockChainDownloadFromPeer(peers.iterator().next());
      }
    }
  }
}

Fixed version (ground truth):
protected synchronized void handlePeerDeath(Peer peer){
  if (peer == downloadPeer) {
    downloadPeer=null;
synchronized (peers) {
      if (downloadListener != null && !peers.isEmpty()) {
        startBlockChainDownloadFromPeer(peers.iterator().next());
      }
    }
  }
}
Program: 50858
Project: 50858
Buggy source:
public String getConnectString(){
  return connectInfo.toString();
}

Fixed version (ground truth):
public String getConnectString(){
  final Util.PropertyList connectInfoClone=connectInfo.clone();
  connectInfoClone.remove(RolapConnectionProperties.JdbcPassword.name());
  return connectInfoClone.toString();
}
Program: 50859
Project: 50859
Buggy source:
private int computeHashCode(){
  int hash=42;
  hash=Util.hash(hash,schemaName);
  hash=Util.hash(hash,schemaChecksum);
  hash=Util.hash(hash,cubeName);
  hash=Util.hash(hash,measureName);
  for (  SegmentColumn col : this.constrainedColumns) {
    hash=Util.hash(hash,col.columnExpression);
    if (col.values != null) {
      hash=Util.hashArray(hash,col.values.toArray());
    }
  }
  for (  SegmentColumn col : this.excludedRegions) {
    hash=Util.hash(hash,col.columnExpression);
    if (col.values != null) {
      hash=Util.hashArray(hash,col.values.toArray());
    }
  }
  hash=Util.hash(hash,compoundPredicates);
  return hash;
}

Fixed version (ground truth):
private int computeHashCode(){
  int hash=42;
  hash=Util.hash(hash,schemaName);
  hash=Util.hash(hash,schemaChecksum);
  hash=Util.hash(hash,cubeName);
  hash=Util.hash(hash,measureName);
  for (  SegmentColumn col : getSortedColumns()) {
    hash=Util.hash(hash,col.columnExpression);
    if (col.values != null) {
      hash=Util.hashArray(hash,col.values.toArray());
    }
  }
  for (  SegmentColumn col : getSortedRegions()) {
    hash=Util.hash(hash,col.columnExpression);
    if (col.values != null) {
      hash=Util.hashArray(hash,col.values.toArray());
    }
  }
  hash=Util.hash(hash,compoundPredicates);
  return hash;
}
Program: 50861
Project: 50861
Buggy source:
/** 
 * Returns a unique identifier for this header. The identifier can be used for storage and will be the same across segments which have the same schema name, cube name, measure name, and for each constrained column, the same column name, table name, and predicate values.
 * @return A unique identification string.
 */
public ByteString getUniqueID(){
  if (this.uniqueID == null) {
    StringBuilder hashSB=new StringBuilder();
    hashSB.append(this.schemaName);
    hashSB.append(this.schemaChecksum);
    hashSB.append(this.cubeName);
    hashSB.append(this.measureName);
    for (    SegmentColumn c : constrainedColumns) {
      hashSB.append(c.columnExpression);
      if (c.values != null) {
        for (        Object value : c.values) {
          hashSB.append(String.valueOf(value));
        }
      }
    }
    for (    SegmentColumn c : excludedRegions) {
      hashSB.append(c.columnExpression);
      if (c.values != null) {
        for (        Object value : c.values) {
          hashSB.append(String.valueOf(value));
        }
      }
    }
    for (    String c : compoundPredicates) {
      hashSB.append(c);
    }
    this.uniqueID=new ByteString(Util.digestSha256(hashSB.toString()));
  }
  return uniqueID;
}

Fixed version (ground truth):
/** 
 * Returns a unique identifier for this header. The identifier can be used for storage and will be the same across segments which have the same schema name, cube name, measure name, and for each constrained column, the same column name, table name, and predicate values.
 * @return A unique identification string.
 */
public ByteString getUniqueID(){
  if (this.uniqueID == null) {
    StringBuilder hashSB=new StringBuilder();
    hashSB.append(this.schemaName);
    hashSB.append(this.schemaChecksum);
    hashSB.append(this.cubeName);
    hashSB.append(this.measureName);
    for (    SegmentColumn c : getSortedColumns()) {
      hashSB.append(c.columnExpression);
      if (c.values != null) {
        for (        Object value : c.values) {
          hashSB.append(String.valueOf(value));
        }
      }
    }
    for (    SegmentColumn c : getSortedRegions()) {
      hashSB.append(c.columnExpression);
      if (c.values != null) {
        for (        Object value : c.values) {
          hashSB.append(String.valueOf(value));
        }
      }
    }
    for (    String c : compoundPredicates) {
      hashSB.append(c);
    }
    this.uniqueID=new ByteString(Util.digestSha256(hashSB.toString()));
  }
  return uniqueID;
}
Program: 50862
Project: 50862
Buggy source:
private StarPredicate makeUnaryPredicate(RolapCubeMember member,RolapCube baseCube,Evaluator evaluator){
  List<Member> expandedMemberList=SqlConstraintUtils.expandSupportedCalculatedMember(member,evaluator);
  for (  Member checkMember : expandedMemberList) {
    if (checkMember == null || checkMember.isCalculated() || !(checkMember instanceof RolapCubeMember)) {
      throw MondrianResource.instance().UnsupportedCalculatedMember.ex(member.getName(),null);
    }
  }
  List<StarPredicate> predicates=new ArrayList<StarPredicate>(expandedMemberList.size());
  for (  Member iMember : expandedMemberList) {
    RolapCubeMember iCubeMember=((RolapCubeMember)iMember);
    RolapCubeLevel iLevel=iCubeMember.getLevel();
    RolapStar.Column iColumn=iLevel.getBaseStarKeyColumn(baseCube);
    Object iKey=iCubeMember.getKey();
    StarPredicate iPredicate=new ValueColumnPredicate(iColumn,iKey);
    predicates.add(iPredicate);
  }
  StarPredicate r=null;
  if (predicates.size() == 1) {
    r=predicates.get(0);
  }
 else {
    r=new OrPredicate(predicates);
  }
  return r;
}

Fixed version (ground truth):
private StarPredicate makeUnaryPredicate(RolapCubeMember member,RolapCube baseCube,Evaluator evaluator){
  TupleConstraintStruct constraint=new TupleConstraintStruct();
  SqlConstraintUtils.expandSupportedCalculatedMember(member,evaluator,constraint);
  List<Member> expandedMemberList=constraint.getMembers();
  for (  Member checkMember : expandedMemberList) {
    if (checkMember == null || checkMember.isCalculated() || !(checkMember instanceof RolapCubeMember)) {
      throw MondrianResource.instance().UnsupportedCalculatedMember.ex(member.getName(),null);
    }
  }
  List<StarPredicate> predicates=new ArrayList<StarPredicate>(expandedMemberList.size());
  for (  Member iMember : expandedMemberList) {
    RolapCubeMember iCubeMember=((RolapCubeMember)iMember);
    RolapCubeLevel iLevel=iCubeMember.getLevel();
    RolapStar.Column iColumn=iLevel.getBaseStarKeyColumn(baseCube);
    Object iKey=iCubeMember.getKey();
    StarPredicate iPredicate=new ValueColumnPredicate(iColumn,iKey);
    predicates.add(iPredicate);
  }
  StarPredicate r=null;
  if (predicates.size() == 1) {
    r=predicates.get(0);
  }
 else {
    r=new OrPredicate(predicates);
  }
  return r;
}
Program: 50864
Project: 50864
Buggy source:
@Override protected void runTest() throws Exception {
  if (!Bug.BugMondrian785Fixed && (getName().equals("String_Node_Str") || getName().equals("String_Node_Str") || getName().equals("String_Node_Str")) && MondrianProperties.instance().EnableNativeCrossJoin.get()) {
    return;
  }
  super.runTest();
}

Fixed version (ground truth):
@Override protected void runTest() throws Exception {
  if (!Bug.BugMondrian785Fixed && (getName().equals("String_Node_Str") || getName().equals("String_Node_Str") || getName().equals("String_Node_Str")) && MondrianProperties.instance().EnableNativeCrossJoin.get()) {
    return;
  }
  if (!Bug.BugMondrian2452Fixed && (getName().equals("String_Node_Str")) && !MondrianProperties.instance().EnableNativeCrossJoin.get()) {
    return;
  }
  super.runTest();
}
Program: 50868
Project: 50868
Buggy source:
private boolean phase(){
  if (batchingReader.isDirty()) {
    execution.tracePhase(batchingReader.getHitCount(),batchingReader.getMissCount(),batchingReader.getPendingCount());
    return batchingReader.loadAggregations();
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
private boolean phase(){
  if (batchingReader.isDirty()) {
    execution.tracePhase(batchingReader.getHitCount(),batchingReader.getMissCount(),batchingReader.getPendingCount());
    evaluator.clearExpResultCache(false);
    return batchingReader.loadAggregations();
  }
 else {
    return false;
  }
}
Program: 50870
Project: 50870
Buggy source:
/** 
 * Looks up a   {@link RolapStar}, creating it if it does not exist. <p>   {@link RolapStar.Table#addJoin} works in a similar way.
 */
synchronized RolapStar getOrCreateStar(final MondrianDef.Relation fact){
  String factTableName=fact.toString();
  RolapStar star=stars.get(factTableName);
  if (star == null) {
    star=makeRolapStar(fact);
    stars.put(factTableName,star);
  }
  return star;
}

Fixed version (ground truth):
/** 
 * Looks up a   {@link RolapStar}, creating it if it does not exist. <p>   {@link RolapStar.Table#addJoin} works in a similar way.
 */
synchronized RolapStar getOrCreateStar(final MondrianDef.Relation fact){
  final String factTableName=fact.getAlias();
  RolapStar star=stars.get(factTableName);
  if (star == null) {
    star=makeRolapStar(fact);
    stars.put(factTableName,star);
  }
  return star;
}
Program: 50871
Project: 50871
Buggy source:
private static CellRequest makeCellRequest(final Member[] members,boolean drillThrough,final boolean extendedContext,RolapCube cube,List<Exp> fieldsList){
}

Fixed version (ground truth):
private static CellRequest makeCellRequest(final Member[] members,boolean drillThrough,final boolean extendedContext,RolapCube cube,List<Exp> fieldsList,Evaluator evaluator){
}
Program: 50872
Project: 50872
Buggy source:
public void addConstraint(SqlQuery sqlQuery,RolapCube baseCube,AggStar aggStar){
  if (orderByExpr != null) {
    RolapNativeSql sql=new RolapNativeSql(sqlQuery,aggStar,getEvaluator(),null);
    String orderBySql=sql.generateTopCountOrderBy(orderByExpr);
    Dialect dialect=sqlQuery.getDialect();
    boolean nullable=deduceNullability(orderByExpr);
    if (dialect.requiresOrderByAlias()) {
      String alias=sqlQuery.nextColumnAlias();
      alias=dialect.quoteIdentifier(alias);
      sqlQuery.addSelect(orderBySql,null,alias);
      sqlQuery.addOrderBy(alias,ascending,true,nullable);
    }
 else {
      sqlQuery.addOrderBy(orderBySql,ascending,true,nullable);
    }
  }
  super.addConstraint(sqlQuery,baseCube,aggStar);
}

Fixed version (ground truth):
public void addConstraint(SqlQuery sqlQuery,RolapCube baseCube,AggStar aggStar){
  if (orderByExpr != null) {
    RolapNativeSql sql=new RolapNativeSql(sqlQuery,aggStar,getEvaluator(),null);
    final String orderBySql=sql.generateTopCountOrderBy(orderByExpr);
    boolean nullable=deduceNullability(orderByExpr);
    final String orderByAlias=sqlQuery.addSelect(orderBySql,null);
    sqlQuery.addOrderBy(orderBySql,orderByAlias,ascending,true,nullable,true);
  }
  super.addConstraint(sqlQuery,baseCube,aggStar);
}
Program: 50875
Project: 50875
Buggy source:
private Pair<String,List<SqlStatement.Type>> makeKeysSql(DataSource dataSource){
  SqlQuery sqlQuery=SqlQuery.newQuery(dataSource,"String_Node_Str" + hierarchy);
  RolapLevel[] levels=(RolapLevel[])hierarchy.getLevels();
  for (  RolapLevel level : levels) {
    if (level.isAll()) {
      continue;
    }
    MondrianDef.Expression exp=level.getKeyExp();
    hierarchy.addToFrom(sqlQuery,exp);
    String expString=exp.getExpression(sqlQuery);
    sqlQuery.addSelectGroupBy(expString,null);
    exp=level.getOrdinalExp();
    hierarchy.addToFrom(sqlQuery,exp);
    expString=exp.getExpression(sqlQuery);
    sqlQuery.addOrderBy(expString,true,false,true);
    if (!exp.equals(level.getKeyExp())) {
      sqlQuery.addSelect(expString,null);
    }
    RolapProperty[] properties=level.getProperties();
    for (    RolapProperty property : properties) {
      exp=property.getExp();
      hierarchy.addToFrom(sqlQuery,exp);
      expString=exp.getExpression(sqlQuery);
      String alias=sqlQuery.addSelect(expString,null);
      if (!sqlQuery.getDialect().allowsSelectNotInGroupBy() || !property.dependsOnLevelValue()) {
        sqlQuery.addGroupBy(expString,alias);
      }
    }
  }
  return sqlQuery.toSqlAndTypes();
}

Fixed version (ground truth):
private Pair<String,List<SqlStatement.Type>> makeKeysSql(DataSource dataSource){
  SqlQuery sqlQuery=SqlQuery.newQuery(dataSource,"String_Node_Str" + hierarchy);
  RolapLevel[] levels=(RolapLevel[])hierarchy.getLevels();
  for (  RolapLevel level : levels) {
    if (level.isAll()) {
      continue;
    }
    final MondrianDef.Expression keyExp=level.getKeyExp();
    hierarchy.addToFrom(sqlQuery,keyExp);
    final String expString=keyExp.getExpression(sqlQuery);
    final String keyAlias=sqlQuery.addSelectGroupBy(expString,null);
    if (!keyExp.equals(level.getOrdinalExp())) {
      final MondrianDef.Expression ordinalExp=level.getOrdinalExp();
      hierarchy.addToFrom(sqlQuery,ordinalExp);
      final String ordinalExpString=ordinalExp.getExpression(sqlQuery);
      final String orderAlias=sqlQuery.addSelectGroupBy(ordinalExpString,null);
      sqlQuery.addOrderBy(ordinalExpString,orderAlias,true,false,true,true);
    }
 else {
      sqlQuery.addOrderBy(expString,keyAlias,true,false,true,true);
    }
    RolapProperty[] properties=level.getProperties();
    for (    RolapProperty property : properties) {
      final MondrianDef.Expression propExpr=property.getExp();
      hierarchy.addToFrom(sqlQuery,propExpr);
      final String propStringExpr=propExpr.getExpression(sqlQuery);
      final String propAlias=sqlQuery.addSelect(propStringExpr,null);
      if (!sqlQuery.getDialect().allowsSelectNotInGroupBy() || !property.dependsOnLevelValue()) {
        sqlQuery.addGroupBy(propStringExpr,propAlias);
      }
    }
  }
  return sqlQuery.toSqlAndTypes();
}
Program: 50879
Project: 50879
Buggy source:
public void testAllowsCompoundCountDistinct(){
  String sql=dialectize("String_Node_Str" + "String_Node_Str");
  if (getDialect().allowsCompoundCountDistinct()) {
    assertQuerySucceeds(sql);
  }
 else {
    String[] errs={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",INFOBRIGHT_UNSUPPORTED,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
}

Fixed version (ground truth):
public void testAllowsCompoundCountDistinct(){
  String sql=dialectize("String_Node_Str" + "String_Node_Str");
  if (getDialect().allowsCompoundCountDistinct()) {
    assertQuerySucceeds(sql);
  }
 else {
    String[] errs={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",INFOBRIGHT_UNSUPPORTED,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
}
Program: 50880
Project: 50880
Buggy source:
/** 
 * Unit test for   {@link Dialect#allowsSelectNotInGroupBy}.
 */
public void testAllowsSelectNotInGroupBy() throws SQLException {
  Dialect dialect=getDialect();
  String sql="String_Node_Str" + dialect.quoteIdentifier("String_Node_Str") + "String_Node_Str"+ dialect.quoteIdentifier("String_Node_Str")+ "String_Node_Str"+ dialect.quoteIdentifier("String_Node_Str")+ "String_Node_Str"+ dialect.quoteIdentifier("String_Node_Str");
  if (dialect.allowsSelectNotInGroupBy()) {
    final ResultSet resultSet=getConnection().createStatement().executeQuery(sql);
    assertTrue(resultSet.next());
    resultSet.close();
  }
 else {
    String[] errs={"String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
}

Fixed version (ground truth):
/** 
 * Unit test for   {@link Dialect#allowsSelectNotInGroupBy}.
 */
public void testAllowsSelectNotInGroupBy() throws SQLException {
  Dialect dialect=getDialect();
  String sql="String_Node_Str" + dialect.quoteIdentifier("String_Node_Str") + "String_Node_Str"+ dialect.quoteIdentifier("String_Node_Str")+ "String_Node_Str"+ dialect.quoteIdentifier("String_Node_Str")+ "String_Node_Str"+ dialect.quoteIdentifier("String_Node_Str");
  if (dialect.allowsSelectNotInGroupBy()) {
    final ResultSet resultSet=getConnection().createStatement().executeQuery(sql);
    assertTrue(resultSet.next());
    resultSet.close();
  }
 else {
    String[] errs={"String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
}
Program: 50881
Project: 50881
Buggy source:
public void testSupportsMultiValueInExpr(){
  String sql=dialectize("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  if (getDialect().supportsMultiValueInExpr()) {
    assertQuerySucceeds(sql);
  }
 else {
    String[] errs={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",INFOBRIGHT_UNSUPPORTED,NEOVIEW_SYNTAX_ERROR,"String_Node_Str","String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
}

Fixed version (ground truth):
public void testSupportsMultiValueInExpr(){
  String sql=dialectize("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  if (getDialect().supportsMultiValueInExpr()) {
    assertQuerySucceeds(sql);
  }
 else {
    String[] errs={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",INFOBRIGHT_UNSUPPORTED,NEOVIEW_SYNTAX_ERROR,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
}
Program: 50882
Project: 50882
Buggy source:
public void testRequiresUnionOrderByExprToBeInSelectClause(){
  String sql=dialectize("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  if (!getDialect().requiresUnionOrderByExprToBeInSelectClause()) {
    assertQuerySucceeds(sql);
  }
 else {
    String[] errs={"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str","String_Node_Str","String_Node_Str",NEOVIEW_SYNTAX_ERROR,"String_Node_Str" + "String_Node_Str","String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
}

Fixed version (ground truth):
public void testRequiresUnionOrderByExprToBeInSelectClause(){
  String sql=dialectize("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  if (!getDialect().requiresUnionOrderByExprToBeInSelectClause()) {
    assertQuerySucceeds(sql);
  }
 else {
    String[] errs={"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str","String_Node_Str","String_Node_Str",NEOVIEW_SYNTAX_ERROR,"String_Node_Str" + "String_Node_Str","String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
}
Program: 50883
Project: 50883
Buggy source:
public void testDialectVsDatabaseProduct() throws SQLException {
  final Dialect dialect=getDialect();
  final Dialect.DatabaseProduct databaseProduct=dialect.getDatabaseProduct();
  final DatabaseMetaData databaseMetaData=getConnection().getMetaData();
switch (databaseProduct) {
case MYSQL:
    assertTrue(dialect instanceof MySqlDialect);
  assertFalse(dialect instanceof InfobrightDialect);
assertFalse(MySqlDialect.isInfobright(databaseMetaData));
assertEquals("String_Node_Str",databaseMetaData.getDatabaseProductName());
break;
case HIVE:
assertTrue(dialect instanceof HiveDialect);
break;
case INFOBRIGHT:
assertTrue(dialect instanceof MySqlDialect);
assertTrue(dialect instanceof InfobrightDialect);
assertTrue(MySqlDialect.isInfobright(databaseMetaData));
assertEquals("String_Node_Str",databaseMetaData.getDatabaseProductName());
break;
case POSTGRESQL:
assertTrue(dialect instanceof PostgreSqlDialect);
assertFalse(dialect instanceof NetezzaDialect);
assertTrue(databaseMetaData.getDatabaseProductName().indexOf("String_Node_Str") >= 0);
break;
case NETEZZA:
assertTrue(dialect instanceof PostgreSqlDialect);
assertTrue(dialect instanceof NetezzaDialect);
assertTrue(databaseMetaData.getDatabaseProductName().indexOf("String_Node_Str") >= 0);
break;
default :
assertFalse(dialect instanceof MySqlDialect);
assertFalse(dialect instanceof InfobrightDialect);
assertNotSame("String_Node_Str",databaseMetaData.getDatabaseProductName());
break;
}
}

Fixed version (ground truth):
public void testDialectVsDatabaseProduct() throws SQLException {
  final Dialect dialect=getDialect();
  final Dialect.DatabaseProduct databaseProduct=dialect.getDatabaseProduct();
  final DatabaseMetaData databaseMetaData=getConnection().getMetaData();
switch (databaseProduct) {
case MYSQL:
    assertTrue(dialect instanceof MySqlDialect);
  assertFalse(dialect instanceof InfobrightDialect);
assertFalse(MySqlDialect.isInfobright(databaseMetaData));
assertEquals("String_Node_Str",databaseMetaData.getDatabaseProductName());
break;
case HIVE:
assertTrue(dialect instanceof HiveDialect);
break;
case INFOBRIGHT:
assertTrue(dialect instanceof MySqlDialect);
assertTrue(dialect instanceof InfobrightDialect);
assertTrue(MySqlDialect.isInfobright(databaseMetaData));
assertEquals("String_Node_Str",databaseMetaData.getDatabaseProductName());
break;
case POSTGRESQL:
assertTrue(dialect instanceof PostgreSqlDialect);
assertFalse(dialect instanceof NetezzaDialect);
assertTrue(databaseMetaData.getDatabaseProductName().indexOf("String_Node_Str") >= 0);
break;
case MSSQL:
assertTrue(dialect instanceof MicrosoftSqlServerDialect);
assertTrue(databaseMetaData.getDatabaseProductName().contains("String_Node_Str"));
break;
case NETEZZA:
assertTrue(dialect instanceof PostgreSqlDialect);
assertTrue(dialect instanceof NetezzaDialect);
assertTrue(databaseMetaData.getDatabaseProductName().indexOf("String_Node_Str") >= 0);
break;
default :
assertFalse(dialect instanceof MySqlDialect);
assertFalse(dialect instanceof InfobrightDialect);
assertNotSame("String_Node_Str",databaseMetaData.getDatabaseProductName());
break;
}
}
Program: 50884
Project: 50884
Buggy source:
public void testRequiresFromQueryAlias(){
  if (getDialect().requiresAliasForFromQuery()) {
    assertTrue(getDialect().allowsFromQuery());
  }
  if (!getDialect().allowsFromQuery()) {
    return;
  }
  String sql=dialectize("String_Node_Str");
  if (getDialect().requiresAliasForFromQuery()) {
    String[] errs={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str",NEOVIEW_SYNTAX_ERROR,"String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
 else {
    assertQuerySucceeds(sql);
  }
}

Fixed version (ground truth):
public void testRequiresFromQueryAlias(){
  if (getDialect().requiresAliasForFromQuery()) {
    assertTrue(getDialect().allowsFromQuery());
  }
  if (!getDialect().allowsFromQuery()) {
    return;
  }
  String sql=dialectize("String_Node_Str");
  if (getDialect().requiresAliasForFromQuery()) {
    String[] errs={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str",NEOVIEW_SYNTAX_ERROR,"String_Node_Str","String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
 else {
    assertQuerySucceeds(sql);
  }
}
Program: 50885
Project: 50885
Buggy source:
public void testAllowsCompoundCountDistinct(){
  String sql=dialectize("String_Node_Str" + "String_Node_Str");
  if (getDialect().allowsCompoundCountDistinct()) {
    assertQuerySucceeds(sql);
  }
 else {
    String[] errs={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",INFOBRIGHT_UNSUPPORTED,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
}

Fixed version (ground truth):
public void testAllowsCompoundCountDistinct(){
  String sql=dialectize("String_Node_Str" + "String_Node_Str");
  if (getDialect().allowsCompoundCountDistinct()) {
    assertQuerySucceeds(sql);
  }
 else {
    String[] errs={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",INFOBRIGHT_UNSUPPORTED,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
}
Program: 50886
Project: 50886
Buggy source:
public void testSupportsGroupByExpressions(){
  String sql=dialectize("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  if (getDialect().supportsGroupByExpressions()) {
    assertQuerySucceeds(sql);
  }
 else {
    final String[] errs={"String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
}

Fixed version (ground truth):
public void testSupportsGroupByExpressions(){
  String sql=dialectize("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  if (getDialect().supportsGroupByExpressions()) {
    assertQuerySucceeds(sql);
  }
 else {
    final String[] errs={"String_Node_Str","String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
}
Program: 50887
Project: 50887
Buggy source:
/** 
 * Unit test for   {@link Dialect#allowsSelectNotInGroupBy}.
 */
public void testAllowsSelectNotInGroupBy() throws SQLException {
  Dialect dialect=getDialect();
  String sql="String_Node_Str" + dialect.quoteIdentifier("String_Node_Str") + "String_Node_Str"+ dialect.quoteIdentifier("String_Node_Str")+ "String_Node_Str"+ dialect.quoteIdentifier("String_Node_Str")+ "String_Node_Str"+ dialect.quoteIdentifier("String_Node_Str");
  if (dialect.allowsSelectNotInGroupBy()) {
    final ResultSet resultSet=getConnection().createStatement().executeQuery(sql);
    assertTrue(resultSet.next());
    resultSet.close();
  }
 else {
    String[] errs={"String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
}

Fixed version (ground truth):
/** 
 * Unit test for   {@link Dialect#allowsSelectNotInGroupBy}.
 */
public void testAllowsSelectNotInGroupBy() throws SQLException {
  Dialect dialect=getDialect();
  String sql="String_Node_Str" + dialect.quoteIdentifier("String_Node_Str") + "String_Node_Str"+ dialect.quoteIdentifier("String_Node_Str")+ "String_Node_Str"+ dialect.quoteIdentifier("String_Node_Str")+ "String_Node_Str"+ dialect.quoteIdentifier("String_Node_Str");
  if (dialect.allowsSelectNotInGroupBy()) {
    final ResultSet resultSet=getConnection().createStatement().executeQuery(sql);
    assertTrue(resultSet.next());
    resultSet.close();
  }
 else {
    String[] errs={"String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
}
Program: 50888
Project: 50888
Buggy source:
public void testSupportsMultiValueInExpr(){
  String sql=dialectize("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  if (getDialect().supportsMultiValueInExpr()) {
    assertQuerySucceeds(sql);
  }
 else {
    String[] errs={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",INFOBRIGHT_UNSUPPORTED,NEOVIEW_SYNTAX_ERROR,"String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
}

Fixed version (ground truth):
public void testSupportsMultiValueInExpr(){
  String sql=dialectize("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  if (getDialect().supportsMultiValueInExpr()) {
    assertQuerySucceeds(sql);
  }
 else {
    String[] errs={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",INFOBRIGHT_UNSUPPORTED,NEOVIEW_SYNTAX_ERROR,"String_Node_Str","String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
}
Program: 50889
Project: 50889
Buggy source:
/** 
 * Tests that the  {@link mondrian.spi.Dialect#supportsGroupingSets()}dialect property is accurate.
 */
public void testAllowsGroupingSets(){
  String sql=dialectize("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  if (getDialect().supportsGroupingSets()) {
    assertQuerySucceeds(sql);
  }
 else {
    String[] errs={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",NEOVIEW_SYNTAX_ERROR,"String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
}

Fixed version (ground truth):
/** 
 * Tests that the  {@link mondrian.spi.Dialect#supportsGroupingSets()}dialect property is accurate.
 */
public void testAllowsGroupingSets(){
  String sql=dialectize("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  if (getDialect().supportsGroupingSets()) {
    assertQuerySucceeds(sql);
  }
 else {
    String[] errs={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",NEOVIEW_SYNTAX_ERROR,"String_Node_Str","String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
}
Program: 50890
Project: 50890
Buggy source:
public void testRequiresFromQueryAlias(){
  if (getDialect().requiresAliasForFromQuery()) {
    assertTrue(getDialect().allowsFromQuery());
  }
  if (!getDialect().allowsFromQuery()) {
    return;
  }
  String sql=dialectize("String_Node_Str");
  if (getDialect().requiresAliasForFromQuery()) {
    String[] errs={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str",NEOVIEW_SYNTAX_ERROR,"String_Node_Str"};
    assertQueryFails(sql,errs);
  }
 else {
    assertQuerySucceeds(sql);
  }
}

Fixed version (ground truth):
public void testRequiresFromQueryAlias(){
  if (getDialect().requiresAliasForFromQuery()) {
    assertTrue(getDialect().allowsFromQuery());
  }
  if (!getDialect().allowsFromQuery()) {
    return;
  }
  String sql=dialectize("String_Node_Str");
  if (getDialect().requiresAliasForFromQuery()) {
    String[] errs={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str",NEOVIEW_SYNTAX_ERROR,"String_Node_Str","String_Node_Str"};
    assertQueryFails(sql,errs);
  }
 else {
    assertQuerySucceeds(sql);
  }
}
Program: 50892
Project: 50892
Buggy source:
public RolapResultShepherd(){
  final IntegerProperty property=MondrianProperties.instance().RolapConnectionShepherdNbThreads;
  final int maximumPoolSize=property.get();
  executor=Util.getExecutorService(maximumPoolSize,0,1,"String_Node_Str",new RejectedExecutionHandler(){
    public void rejectedExecution(    Runnable r,    ThreadPoolExecutor executor){
      throw MondrianResource.instance().QueryLimitReached.ex(maximumPoolSize,property.getPath());
    }
  }
);
  final Pair<Long,TimeUnit> interval=Util.parseInterval(MondrianProperties.instance().RolapConnectionShepherdThreadPollingInterval.get(),TimeUnit.MILLISECONDS);
  long period=interval.right.toMillis(interval.left);
  timer.scheduleAtFixedRate(new TimerTask(){
    public void run(){
      for (      final Pair<FutureTask<Result>,Execution> task : tasks) {
        if (task.left.isDone()) {
          tasks.remove(task);
          continue;
        }
        if (task.right.isCancelOrTimeout()) {
          tasks.remove(task);
          task.left.cancel(false);
          executor.submit(new Runnable(){
            public void run(){
              try {
                task.right.cancelSqlStatements();
              }
 catch (              Throwable e) {
                e.printStackTrace();
              }
            }
          }
);
        }
      }
    }
  }
,period,period);
}

Fixed version (ground truth):
public RolapResultShepherd(){
  final IntegerProperty property=MondrianProperties.instance().RolapConnectionShepherdNbThreads;
  final int maximumPoolSize=property.get();
  executor=Util.getExecutorService(maximumPoolSize,0,1,"String_Node_Str",new RejectedExecutionHandler(){
    public void rejectedExecution(    Runnable r,    ThreadPoolExecutor executor){
      throw MondrianResource.instance().QueryLimitReached.ex(maximumPoolSize,property.getPath());
    }
  }
);
  final Pair<Long,TimeUnit> interval=Util.parseInterval(String.valueOf(MondrianProperties.instance().RolapConnectionShepherdThreadPollingInterval.get()),TimeUnit.MILLISECONDS);
  long period=interval.right.toMillis(interval.left);
  timer.scheduleAtFixedRate(new TimerTask(){
    public void run(){
      for (      final Pair<FutureTask<Result>,Execution> task : tasks) {
        if (task.left.isDone()) {
          tasks.remove(task);
          continue;
        }
        if (task.right.isCancelOrTimeout()) {
          tasks.remove(task);
          task.left.cancel(false);
          executor.submit(new Runnable(){
            public void run(){
              try {
                task.right.cancelSqlStatements();
              }
 catch (              Throwable e) {
                e.printStackTrace();
              }
            }
          }
);
        }
      }
    }
  }
,period,period);
}
Program: 50893
Project: 50893
Buggy source:
/** 
 * Creates a DynamicContentFinder.
 * @param dataSourcesConfigUrl URL of repository
 */
public DynamicContentFinder(String dataSourcesConfigUrl){
  super(dataSourcesConfigUrl);
  reloadDataSources();
  timer=Util.newTimer("String_Node_Str",true);
  final Pair<Long,TimeUnit> interval=Util.parseInterval(MondrianProperties.instance().XmlaSchemaRefreshInterval.get(),TimeUnit.MILLISECONDS);
  final long period=interval.right.toMillis(interval.left);
  timer.scheduleAtFixedRate(new TimerTask(){
    public void run(){
      reloadDataSources();
    }
  }
,period,period);
}

Fixed version (ground truth):
/** 
 * Creates a DynamicContentFinder.
 * @param dataSourcesConfigUrl URL of repository
 */
public DynamicContentFinder(String dataSourcesConfigUrl){
  super(dataSourcesConfigUrl);
  reloadDataSources();
  timer=Util.newTimer("String_Node_Str",true);
  final Pair<Long,TimeUnit> interval=Util.parseInterval(String.valueOf(MondrianProperties.instance().XmlaSchemaRefreshInterval.get()),TimeUnit.MILLISECONDS);
  final long period=interval.right.toMillis(interval.left);
  timer.scheduleAtFixedRate(new TimerTask(){
    public void run(){
      reloadDataSources();
    }
  }
,period,period);
}
Program: 50894
Project: 50894
Buggy source:
private synchronized void setTimer(T referent,String timeoutString){
  final long timeout=toMillis(timeoutString);
  if (timeout == Long.MIN_VALUE && expiry != Long.MIN_VALUE) {
    return;
  }
  if (timeout == 0) {
    expiry=Long.MAX_VALUE;
    this.hardRef=referent;
    return;
  }
  if (timeout > 0) {
    long newExpiry=System.currentTimeMillis() + timeout;
    if (newExpiry > expiry) {
      expiry=newExpiry;
    }
    this.hardRef=referent;
    timer.schedule(getTask(),timeout + 10);
    return;
  }
  this.hardRef=null;
}

Fixed version (ground truth):
private synchronized void setTimer(T referent,String timeoutString){
  Pair<Long,TimeUnit> pair=Util.parseInterval(timeoutString,null);
  final long timeout=pair.right.toMillis(pair.left);
  if (timeout == Long.MIN_VALUE && expiry != Long.MIN_VALUE) {
    return;
  }
  if (timeout == 0) {
    expiry=Long.MAX_VALUE;
    this.hardRef=referent;
    return;
  }
  if (timeout > 0) {
    long newExpiry=System.currentTimeMillis() + timeout;
    if (newExpiry > expiry) {
      expiry=newExpiry;
    }
    this.hardRef=referent;
    timer.schedule(getTask(),timeout + 10);
    return;
  }
  this.hardRef=null;
}
Program: 50895
Project: 50895
Buggy source:
V get(K key);

Fixed version (ground truth):
/** 
 * Looks up and returns a cache value according to a given key. If the cache does not correspond an entry corresponding to the key, <code>null</code> is returned.
 */
V get(K key);
Program: 50896
Project: 50896
Buggy source:
/** 
 * Places a key/value pair into the queue.
 * @param key Key
 * @param value Value
 * @return the previous value of <code>key</code> or null
 */
V put(K key,V value);

Fixed version (ground truth):
/** 
 * Places a key/value pair into the cache.
 * @param key Key
 * @param value Value
 * @return the previous value of <code>key</code> or null
 */
V put(K key,V value);
Program: 50897
Project: 50897
Buggy source:
@Override public String processSchema(String schemaUrl,PropertyList connectInfo) throws Exception {
  return Util.readVirtualFileAsString(schemaUrl);
}

Fixed version (ground truth):
public String processSchema(String schemaUrl,PropertyList connectInfo) throws Exception {
  return Util.readVirtualFileAsString(schemaUrl);
}
Program: 50901
Project: 50901
Buggy source:
private List<String> getHierarchies(){
  List<String> hiers=new ArrayList<String>();
  Object po=getParentObject();
  if (po != null) {
    MondrianGuiDef.CubeGrant parent=(MondrianGuiDef.CubeGrant)po;
    if (!(parent.cube == null || parent.cube.equals("String_Node_Str"))) {
      MondrianGuiDef.Schema s=getSchema();
      if (s != null) {
        for (int i=0; i < s.cubes.length; i++) {
          if (s.cubes[i].name.equals(parent.cube)) {
            for (int j=0; j < s.cubes[i].dimensions.length; j++) {
              NodeDef[] children=s.cubes[i].dimensions[j].getChildren();
              for (int k=0; k < children.length; k++) {
                if (children[k] instanceof Hierarchy && (((Hierarchy)children[k]).name != null)) {
                  hiers.add(((Hierarchy)children[k]).name);
                }
              }
            }
            break;
          }
        }
      }
    }
  }
  return hiers;
}

Fixed version (ground truth):
private List<String> getHierarchies(){
  List<String> hiers=new ArrayList<String>();
  Object po=getParentObject();
  if (po != null) {
    MondrianGuiDef.CubeGrant parent=(MondrianGuiDef.CubeGrant)po;
    if (!(parent.cube == null || parent.cube.equals("String_Node_Str"))) {
      MondrianGuiDef.Schema s=getSchema();
      if (s != null) {
        for (int i=0; i < s.cubes.length; i++) {
          if (s.cubes[i].name.equals(parent.cube)) {
            for (int j=0; j < s.cubes[i].dimensions.length; j++) {
              MondrianGuiDef.Dimension sharedDim=lookupDimension(s,s.cubes[i].dimensions[j]);
              NodeDef[] children=sharedDim.getChildren();
              for (int k=0; k < children.length; k++) {
                if (children[k] instanceof Hierarchy) {
                  String hname=((Hierarchy)children[k]).name;
                  if (hname != null) {
                    if (MondrianProperties.instance().SsasCompatibleNaming.get()) {
                      hiers.add(Util.quoteMdxIdentifier(s.cubes[i].dimensions[j].name) + "String_Node_Str" + Util.quoteMdxIdentifier(hname));
                    }
 else {
                      hiers.add(Util.quoteMdxIdentifier(s.cubes[i].dimensions[j].name + "String_Node_Str" + hname));
                    }
                  }
 else {
                    hiers.add(Util.quoteMdxIdentifier(s.cubes[i].dimensions[j].name));
                  }
                }
              }
            }
            break;
          }
        }
      }
    }
  }
  return hiers;
}