nus-yam/ex-repair huggingface dataset:
Program: 87007
Project: 87007
Buggy source:
/** 
 * Overriden here to have more performant impl
 */
public Collection<InetAddress> getWriteEndpoints(Token token,String table,Collection<InetAddress> naturalEndpoints){
  if (tokenMetadata_.getPendingRanges(table).isEmpty())   return naturalEndpoints;
  Collection<InetAddress> pending=tokenMetadata_.getPendingRanges(table).get(toRange(Integer.parseInt(keyToken(token).toString(),16)));
  if (pending == null || pending.isEmpty())   return naturalEndpoints;
  List<InetAddress> endpoints=new ArrayList<InetAddress>(naturalEndpoints.size() + pending.size());
  endpoints.addAll(naturalEndpoints);
  endpoints.addAll(pending);
  return endpoints;
}

Fixed version (ground truth):
/** 
 * Overriden here to have more performant impl
 */
public Collection<InetAddress> getWriteEndpoints(Token token,String table,Collection<InetAddress> naturalEndpoints){
  if (tokenMetadata_.getPendingRanges(table).isEmpty())   return naturalEndpoints;
  Collection<InetAddress> pending=tokenMetadata_.getPendingRanges(table).get(toRange(keyTokenDomain(keyToken(token).toString())));
  if (pending == null || pending.isEmpty())   return naturalEndpoints;
  List<InetAddress> endpoints=new ArrayList<InetAddress>(naturalEndpoints.size() + pending.size());
  endpoints.addAll(naturalEndpoints);
  endpoints.addAll(pending);
  return endpoints;
}
Program: 87008
Project: 87008
Buggy source:
protected ArrayList<InetAddress> doCalculateEndpoints(Token keyToken,TokenMetadata metadata,String table){
  int replicas=DatabaseDescriptor.getReplicationFactor(table);
  ArrayList<InetAddress> endpoints=new ArrayList<InetAddress>(replicas);
  List<Token> tokens=metadata.sortedTokens();
  if (tokens.isEmpty())   return endpoints;
  String[] racks=ringRacks(metadata,tokens).toArray(new String[replicas]);
  StringToken[] rackDomain=new StringToken[replicas];
  int domain=Integer.parseInt(keyToken.toString().substring(0,2),16) & 0xFF;
  int rackIndex=domain % replicas;
  for (int i=0; i < racks.length; i++) {
    rackDomain[i]=odklPartitioner.toStringToken(domain,keyToken.toString());
    domain=shuffle(domain);
  }
  do {
    String rack=racks[rackIndex];
    tokens=getReplicaTokens(metadata,rack);
    keyToken=rackDomain[rackIndex];
    Token t=TokenMetadata.firstToken(tokens,keyToken);
    InetAddress endPoint=metadata.getEndPoint(t);
    endpoints.add(endPoint);
    rackIndex=(rackIndex + 1) % replicas;
  }
 while (endpoints.size() < replicas);
  return endpoints;
}

Fixed version (ground truth):
protected ArrayList<InetAddress> doCalculateEndpoints(Token keyToken,TokenMetadata metadata,String table){
}
Program: 87009
Project: 87009
Buggy source:
/** 
 */
public GossipNetworkTopologySnith(){
  if (DatabaseDescriptor.getAllowedLocations() == null) {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 */
public GossipNetworkTopologySnith(){
  if (DatabaseDescriptor.getAllowedLocations() == null) {
    throw new RuntimeException("String_Node_Str");
  }
  putEndpoints(Collections.singletonMap(FBUtilities.getLocalAddress(),DatabaseDescriptor.getLocation().split("String_Node_Str")));
}
Program: 87010
Project: 87010
Buggy source:
void put(String key,byte[] buffer) throws IOException {
  if (isThresholdViolated()) {
    lock.lock();
    try {
      if (!isFrozen) {
        isFrozen=true;
        cfs.submitFlush(this);
        cfs.switchBinaryMemtable(key,buffer);
      }
 else {
        cfs.applyBinary(key,buffer);
      }
    }
  finally {
      lock.unlock();
    }
  }
 else {
    resolve(key,buffer);
  }
}

Fixed version (ground truth):
void put(String key,byte[] buffer){
  if (isThresholdViolated()) {
    lock.lock();
    try {
      if (!isFrozen) {
        isFrozen=true;
        cfs.submitFlush(this);
        cfs.switchBinaryMemtable(key,buffer);
      }
 else {
        cfs.applyBinary(key,buffer);
      }
    }
  finally {
      lock.unlock();
    }
  }
 else {
    resolve(key,buffer);
  }
}
Program: 87011
Project: 87011
Buggy source:
/** 
 * get a list of columns starting from a given column, in a specified order. only the latest version of a column is returned.
 * @return null if there is no data and no tombstones; otherwise a ColumnFamily
 */
public ColumnFamily getColumnFamily(QueryFilter filter,int gcBefore) throws IOException {
}

Fixed version (ground truth):
/** 
 * get a list of columns starting from a given column, in a specified order. only the latest version of a column is returned.
 * @return null if there is no data and no tombstones; otherwise a ColumnFamily
 */
public ColumnFamily getColumnFamily(QueryFilter filter,int gcBefore){
}
Program: 87012
Project: 87012
Buggy source:
private ColumnFamily getTopLevelColumns(QueryFilter filter,int gcBefore) throws IOException {
  List<ColumnIterator> iterators=new ArrayList<ColumnIterator>();
  try {
    final ColumnFamily returnCF;
    ColumnIterator iter;
    Table.flusherLock.readLock().lock();
    try {
      iter=filter.getMemColumnIterator(memtable_,getComparator());
      returnCF=iter.getColumnFamily();
    }
  finally {
      Table.flusherLock.readLock().unlock();
    }
    iterators.add(iter);
    for (    Memtable memtable : getMemtablesPendingFlush()) {
      iter=filter.getMemColumnIterator(memtable,getComparator());
      returnCF.delete(iter.getColumnFamily());
      iterators.add(iter);
    }
    for (    SSTableReader sstable : ssTables_) {
      iter=filter.getSSTableColumnIterator(sstable);
      if (iter.getColumnFamily() != null) {
        returnCF.delete(iter.getColumnFamily());
        iterators.add(iter);
      }
    }
    Comparator<IColumn> comparator=filter.getColumnComparator(getComparator());
    Iterator collated=IteratorUtils.collatedIterator(comparator,iterators);
    filter.collectCollatedColumns(returnCF,collated,gcBefore);
    return removeDeleted(returnCF,gcBefore);
  }
  finally {
    for (    ColumnIterator ci : iterators) {
      try {
        ci.close();
      }
 catch (      Throwable th) {
        logger_.error("String_Node_Str" + ci,th);
      }
    }
  }
}

Fixed version (ground truth):
private ColumnFamily getTopLevelColumns(QueryFilter filter,int gcBefore){
  List<ColumnIterator> iterators=new ArrayList<ColumnIterator>();
  try {
    final ColumnFamily returnCF;
    ColumnIterator iter;
    Table.flusherLock.readLock().lock();
    try {
      iter=filter.getMemColumnIterator(memtable_,getComparator());
      returnCF=iter.getColumnFamily();
    }
  finally {
      Table.flusherLock.readLock().unlock();
    }
    iterators.add(iter);
    for (    Memtable memtable : getMemtablesPendingFlush()) {
      iter=filter.getMemColumnIterator(memtable,getComparator());
      returnCF.delete(iter.getColumnFamily());
      iterators.add(iter);
    }
    for (    SSTableReader sstable : ssTables_) {
      iter=filter.getSSTableColumnIterator(sstable);
      if (iter.getColumnFamily() != null) {
        returnCF.delete(iter.getColumnFamily());
        iterators.add(iter);
      }
    }
    Comparator<IColumn> comparator=filter.getColumnComparator(getComparator());
    Iterator collated=IteratorUtils.collatedIterator(comparator,iterators);
    filter.collectCollatedColumns(returnCF,collated,gcBefore);
    return removeDeleted(returnCF,gcBefore);
  }
 catch (  IOException e) {
    throw new FSReadError(e);
  }
 finally {
    for (    ColumnIterator ci : iterators) {
      try {
        ci.close();
      }
 catch (      Throwable th) {
        logger_.error("String_Node_Str" + ci,th);
      }
    }
  }
}
Program: 87013
Project: 87013
Buggy source:
void applyBinary(String key,byte[] buffer) throws IOException {
  long start=System.nanoTime();
  binaryMemtable_.get().put(key,buffer);
  writeStats_.addNano(System.nanoTime() - start);
}

Fixed version (ground truth):
void applyBinary(String key,byte[] buffer){
  long start=System.nanoTime();
  binaryMemtable_.get().put(key,buffer);
  writeStats_.addNano(System.nanoTime() - start);
}
Program: 87014
Project: 87014
Buggy source:
/** 
 * @param super_column
 * @param range: either a Bounds, which includes start key, or a Range, which does not.
 * @param keyMax maximum number of keys to process, regardless of startKey/finishKey
 * @param sliceRange may be null if columnNames is specified. specifies contiguous columns to return in what order.
 * @param columnNames may be null if sliceRange is specified. specifies which columns to return in what order.      @return list of key->list<column> tuples.
 * @throws IOException
 * @throws ExecutionException
 * @throws InterruptedException
 */
public RangeSliceReply getRangeSlice(byte[] super_column,final AbstractBounds range,int keyMax,SliceRange sliceRange,List<byte[]> columnNames) throws IOException, ExecutionException, InterruptedException {
}

Fixed version (ground truth):
/** 
 * @param super_column
 * @param range: either a Bounds, which includes start key, or a Range, which does not.
 * @param keyMax maximum number of keys to process, regardless of startKey/finishKey
 * @param sliceRange may be null if columnNames is specified. specifies contiguous columns to return in what order.
 * @param columnNames may be null if sliceRange is specified. specifies which columns to return in what order.      @return list of key->list<column> tuples.
 * @throws ExecutionException
 * @throws InterruptedException
 */
public RangeSliceReply getRangeSlice(byte[] super_column,final AbstractBounds range,int keyMax,SliceRange sliceRange,List<byte[]> columnNames) throws ExecutionException, InterruptedException {
}
Program: 87015
Project: 87015
Buggy source:
public void forceBlockingFlush() throws IOException, ExecutionException, InterruptedException {
  Future<?> future=forceFlush();
  if (future != null)   future.get();
}

Fixed version (ground truth):
public void forceBlockingFlush() throws ExecutionException, InterruptedException {
  Future<?> future=forceFlush();
  if (future != null)   future.get();
}
Program: 87016
Project: 87016
Buggy source:
public void forceFlushIfExpired() throws IOException, ExecutionException, InterruptedException {
  if (memtable_.isExpired())   forceBlockingFlush();
}

Fixed version (ground truth):
public void forceFlushIfExpired() throws ExecutionException, InterruptedException {
  if (memtable_.isExpired())   forceBlockingFlush();
}
Program: 87017
Project: 87017
Buggy source:
public Table getTable(){
  try {
    return Table.open(table_);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public Table getTable(){
  try {
    return Table.open(table_);
  }
 catch (  IOException e) {
    throw new FSReadError(e);
  }
}
Program: 87018
Project: 87018
Buggy source:
private ColumnFamily cacheRow(String key) throws IOException {
  ColumnFamily cached;
  if ((cached=ssTables_.getRowCache().get(key)) == null) {
    cached=getTopLevelColumns(new IdentityQueryFilter(key,new QueryPath(columnFamily_)),Integer.MIN_VALUE);
    if (cached == null)     return null;
    ssTables_.getRowCache().put(key,cached);
  }
  return cached;
}

Fixed version (ground truth):
private ColumnFamily cacheRow(String key){
  ColumnFamily cached;
  if ((cached=ssTables_.getRowCache().get(key)) == null) {
    cached=getTopLevelColumns(new IdentityQueryFilter(key,new QueryPath(columnFamily_)),Integer.MIN_VALUE);
    if (cached == null)     return null;
    ssTables_.getRowCache().put(key,cached);
  }
  return cached;
}
Program: 87019
Project: 87019
Buggy source:
/** 
 * flush the given memtable and swap in a new one for its CFS, if it hasn't been frozen already.  threadsafe. 
 */
Future<?> maybeSwitchMemtable(Memtable oldMemtable,final boolean writeCommitLog) throws IOException {
  Table.flusherLock.writeLock().lock();
  try {
    if (oldMemtable.isFrozen()) {
      return null;
    }
    oldMemtable.freeze();
    final Future<CommitLogContext> ctx=writeCommitLog ? CommitLog.instance().getContext() : null;
    final Condition condition=submitFlush(oldMemtable);
    memtable_=new Memtable(this);
    return postFlushExecutor.submit(new WrappedRunnable(){
      public void runMayThrow() throws InterruptedException, IOException {
        condition.await();
        if (writeCommitLog) {
          try {
            CommitLogContext ctxValue=ctx.get();
            logger_.info(columnFamily_ + "String_Node_Str" + ctxValue);
            CommitLog.instance().discardCompletedSegments(table_,columnFamily_,ctxValue);
          }
 catch (          ExecutionException e) {
            throw new RuntimeException(e);
          }
        }
      }
    }
);
  }
  finally {
    Table.flusherLock.writeLock().unlock();
    if (memtableSwitchCount == Integer.MAX_VALUE) {
      memtableSwitchCount=0;
    }
    memtableSwitchCount++;
  }
}

Fixed version (ground truth):
/** 
 * flush the given memtable and swap in a new one for its CFS, if it hasn't been frozen already.  threadsafe. 
 */
Future<?> maybeSwitchMemtable(Memtable oldMemtable,final boolean writeCommitLog){
  Table.flusherLock.writeLock().lock();
  try {
    if (oldMemtable.isFrozen()) {
      return null;
    }
    oldMemtable.freeze();
    final Future<CommitLogContext> ctx=writeCommitLog ? CommitLog.instance().getContext() : null;
    final Condition condition=submitFlush(oldMemtable);
    memtable_=new Memtable(this);
    return postFlushExecutor.submit(new WrappedRunnable(){
      public void runMayThrow() throws InterruptedException, IOException {
        condition.await();
        if (writeCommitLog) {
          try {
            CommitLogContext ctxValue=ctx.get();
            logger_.info(columnFamily_ + "String_Node_Str" + ctxValue);
            CommitLog.instance().discardCompletedSegments(table_,columnFamily_,ctxValue);
          }
 catch (          ExecutionException e) {
            throw new RuntimeException(e);
          }
        }
      }
    }
);
  }
  finally {
    Table.flusherLock.writeLock().unlock();
    if (memtableSwitchCount == Integer.MAX_VALUE) {
      memtableSwitchCount=0;
    }
    memtableSwitchCount++;
  }
}
Program: 87020
Project: 87020
Buggy source:
void switchBinaryMemtable(String key,byte[] buffer) throws IOException {
  binaryMemtable_.set(new BinaryMemtable(this));
  binaryMemtable_.get().put(key,buffer);
}

Fixed version (ground truth):
void switchBinaryMemtable(String key,byte[] buffer){
  binaryMemtable_.set(new BinaryMemtable(this));
  binaryMemtable_.get().put(key,buffer);
}
Program: 87021
Project: 87021
Buggy source:
public void initRowCache(){
  String msgSuffix=String.format("String_Node_Str",columnFamily_,table_);
  int rowCacheSavePeriodInSeconds=DatabaseDescriptor.getTableMetaData(table_).get(columnFamily_).rowCacheSavePeriodInSeconds;
  int keyCacheSavePeriodInSeconds=DatabaseDescriptor.getTableMetaData(table_).get(columnFamily_).keyCacheSavePeriodInSeconds;
  long start=System.currentTimeMillis();
  try {
    for (    String key : readSavedCache(DatabaseDescriptor.getSerializedRowCachePath(table_,columnFamily_),true))     cacheRow(key);
  }
 catch (  IOException ioe) {
    logger_.warn("String_Node_Str" + msgSuffix,ioe);
  }
  if (ssTables_.getRowCache().getSize() > 0)   logger_.info(String.format("String_Node_Str",System.currentTimeMillis() - start,ssTables_.getRowCache().getSize(),msgSuffix));
  rowCacheWriteTask=new WrappedRunnable(){
    protected void runMayThrow() throws IOException {
      ssTables_.saveRowCache();
    }
  }
;
  if (rowCacheSavePeriodInSeconds > 0) {
    cacheSavingExecutor.scheduleWithFixedDelay(rowCacheWriteTask,rowCacheSavePeriodInSeconds,rowCacheSavePeriodInSeconds,TimeUnit.SECONDS);
  }
  keyCacheWriteTask=new WrappedRunnable(){
    protected void runMayThrow() throws IOException {
      ssTables_.saveKeyCache();
    }
  }
;
  if (keyCacheSavePeriodInSeconds > 0) {
    cacheSavingExecutor.scheduleWithFixedDelay(keyCacheWriteTask,keyCacheSavePeriodInSeconds,keyCacheSavePeriodInSeconds,TimeUnit.SECONDS);
  }
}

Fixed version (ground truth):
public void initRowCache(){
  String msgSuffix=String.format("String_Node_Str",columnFamily_,table_);
  int rowCacheSavePeriodInSeconds=DatabaseDescriptor.getTableMetaData(table_).get(columnFamily_).rowCacheSavePeriodInSeconds;
  int keyCacheSavePeriodInSeconds=DatabaseDescriptor.getTableMetaData(table_).get(columnFamily_).keyCacheSavePeriodInSeconds;
  long start=System.currentTimeMillis();
  for (  String key : readSavedCache(DatabaseDescriptor.getSerializedRowCachePath(table_,columnFamily_),true)) {
    cacheRow(key);
  }
  if (ssTables_.getRowCache().getSize() > 0)   logger_.info(String.format("String_Node_Str",System.currentTimeMillis() - start,ssTables_.getRowCache().getSize(),msgSuffix));
  rowCacheWriteTask=new WrappedRunnable(){
    protected void runMayThrow() throws IOException {
      ssTables_.saveRowCache();
    }
  }
;
  if (rowCacheSavePeriodInSeconds > 0) {
    cacheSavingExecutor.scheduleWithFixedDelay(rowCacheWriteTask,rowCacheSavePeriodInSeconds,rowCacheSavePeriodInSeconds,TimeUnit.SECONDS);
  }
  keyCacheWriteTask=new WrappedRunnable(){
    protected void runMayThrow() throws IOException {
      ssTables_.saveKeyCache();
    }
  }
;
  if (keyCacheSavePeriodInSeconds > 0) {
    cacheSavingExecutor.scheduleWithFixedDelay(keyCacheWriteTask,keyCacheSavePeriodInSeconds,keyCacheSavePeriodInSeconds,TimeUnit.SECONDS);
  }
}
Program: 87022
Project: 87022
Buggy source:
/** 
 * @param range: either a Bounds, which includes start key, or a Range, which does not.
 * @param maxResults
 * @return list of keys between startWith and stopAtTODO refactor better.  this is just getKeyRange w/o the deletion check, for the benefit of range_slice.  still opens one randomaccessfile per key, which sucks.  something like compactioniterator would be better.
 */
private void getKeyRange(List<String> keys,final AbstractBounds range,int maxResults) throws IOException, ExecutionException, InterruptedException {
}

Fixed version (ground truth):
/** 
 * @param range: either a Bounds, which includes start key, or a Range, which does not.
 * @param maxResults
 * @return list of keys between startWith and stopAtTODO refactor better.  this is just getKeyRange w/o the deletion check, for the benefit of range_slice.  still opens one randomaccessfile per key, which sucks.  something like compactioniterator would be better.
 */
private void getKeyRange(List<String> keys,final AbstractBounds range,int maxResults) throws ExecutionException, InterruptedException {
}
Program: 87023
Project: 87023
Buggy source:
void replaceCompactedSSTables(Collection<SSTableReader> sstables,Iterable<SSTableReader> replacements) throws IOException {
  ssTables_.replace(sstables,replacements);
}

Fixed version (ground truth):
void replaceCompactedSSTables(Collection<SSTableReader> sstables,Iterable<SSTableReader> replacements){
  ssTables_.replace(sstables,replacements);
}
Program: 87024
Project: 87024
Buggy source:
public Future<?> forceFlush() throws IOException {
  if (memtable_.isClean())   return null;
  return maybeSwitchMemtable(memtable_,true);
}

Fixed version (ground truth):
public Future<?> forceFlush(){
  if (memtable_.isClean())   return null;
  return maybeSwitchMemtable(memtable_,true);
}
Program: 87025
Project: 87025
Buggy source:
/** 
 * Given a column family this, function creates an in-memory structure that represents the column index for the column family, and subsequently writes it to disk.
 * @param columnFamily Column family to create index for
 * @param dos data output stream
 * @param skipBloom true to skip bloom filter write for this column family when not needed (if columnBloom mode is activated, for example, or. say, you dont have SSTableNamesIterator queries)
 * @throws IOException
 */
public static void serialize(ColumnFamily columnFamily,DataOutput dos,boolean skipBloom){
  Collection<IColumn> columns=columnFamily.getSortedColumns();
  try {
    if (skipBloom) {
      dos.writeInt(0);
    }
 else {
      BloomFilter bf=createColumnBloomFilter(columns);
      BloomFilterSerializer serializer=(BloomFilterSerializer)BloomFilter.serializer();
      dos.writeInt((int)serializer.serializeSize(bf));
      serializer.serialize(bf,dos);
    }
    doIndexing(columnFamily.getComparator(),columns,dos);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Given a column family this, function creates an in-memory structure that represents the column index for the column family, and subsequently writes it to disk.
 * @param columnFamily Column family to create index for
 * @param dos data output stream
 * @param skipBloom true to skip bloom filter write for this column family when not needed (if columnBloom mode is activated, for example, or. say, you dont have SSTableNamesIterator queries)
 * @throws IOException
 */
public static void serialize(ColumnFamily columnFamily,DataOutput dos,boolean skipBloom){
  Collection<IColumn> columns=columnFamily.getSortedColumns();
  try {
    if (skipBloom) {
      dos.writeInt(0);
    }
 else {
      BloomFilter bf=createColumnBloomFilter(columns);
      BloomFilterSerializer serializer=(BloomFilterSerializer)BloomFilter.serializer();
      dos.writeInt((int)serializer.serializeSize(bf));
      serializer.serialize(bf,dos);
    }
    doIndexing(columnFamily.getComparator(),columns,dos);
  }
 catch (  IOException e) {
    throw new FSWriteError(e);
  }
}
Program: 87026
Project: 87026
Buggy source:
private SSTableReader writeSortedContents() throws IOException {
  logger.info("String_Node_Str" + this);
  SSTableWriter writer=new SSTableWriter(cfs.getFlushPath(),columnFamilies.size(),StorageService.getPartitioner());
  boolean bloomColumns=writer.getBloomFilterWriter().isBloomColumns();
  BloomFilterWriter bloomFilterWriter=writer.getBloomFilterWriter();
  if (bloomColumns)   bloomFilterWriter.setEstimatedColumnCount(getCurrentOperations());
  DataOutputBuffer buffer=new DataOutputBuffer();
  for (  Map.Entry<DecoratedKey,ColumnFamily> entry : columnFamilies.entrySet()) {
    buffer.reset();
    ColumnFamily.serializer().serializeWithIndexes(entry.getValue(),buffer,bloomColumns);
    writer.append(entry.getKey(),buffer);
    if (bloomColumns)     bloomFilterWriter.add(entry.getKey(),entry.getValue());
  }
  SSTableReader ssTable=writer.closeAndOpenReader();
  logger.info(String.format("String_Node_Str",ssTable.getFilename(),new File(ssTable.getFilename()).length()));
  return ssTable;
}

Fixed version (ground truth):
private SSTableReader writeSortedContents(){
  try {
    logger.info("String_Node_Str" + this);
    SSTableWriter writer=new SSTableWriter(cfs.getFlushPath(),columnFamilies.size(),StorageService.getPartitioner());
    boolean bloomColumns=writer.getBloomFilterWriter().isBloomColumns();
    BloomFilterWriter bloomFilterWriter=writer.getBloomFilterWriter();
    if (bloomColumns)     bloomFilterWriter.setEstimatedColumnCount(getCurrentOperations());
    DataOutputBuffer buffer=new DataOutputBuffer();
    for (    Map.Entry<DecoratedKey,ColumnFamily> entry : columnFamilies.entrySet()) {
      buffer.reset();
      ColumnFamily.serializer().serializeWithIndexes(entry.getValue(),buffer,bloomColumns);
      writer.append(entry.getKey(),buffer);
      if (bloomColumns)       bloomFilterWriter.add(entry.getKey(),entry.getValue());
    }
    SSTableReader ssTable=writer.closeAndOpenReader();
    logger.info(String.format("String_Node_Str",ssTable.getFilename(),new File(ssTable.getFilename()).length()));
    return ssTable;
  }
 catch (  IOException e) {
    throw new FSWriteError(e);
  }
}
Program: 87027
Project: 87027
Buggy source:
private void reBuffer() throws IOException {
  flush();
  bufferOffset=current;
  if (bufferOffset >= channel.size()) {
    validBufferBytes=0;
    return;
  }
  if (bufferOffset < minBufferOffset)   minBufferOffset=bufferOffset;
  channel.position(bufferOffset);
  int read=0;
  while (read < buffer.length) {
    int n=super.read(buffer,read,buffer.length - read);
    if (n < 0)     break;
    read+=n;
  }
  validBufferBytes=read;
  bytesSinceCacheFlush+=read;
  if (skipCache && bytesSinceCacheFlush >= MAX_BYTES_IN_PAGE_CACHE) {
    CLibrary.trySkipCache(this.fd,(int)minBufferOffset,0);
    bytesSinceCacheFlush=0;
    minBufferOffset=Long.MAX_VALUE;
  }
}

Fixed version (ground truth):
private void reBuffer() throws IOException {
  flush();
  resetBuffer();
  if (bufferOffset >= channel.size())   return;
  if (bufferOffset < minBufferOffset)   minBufferOffset=bufferOffset;
  channel.position(bufferOffset);
  int read=0;
  while (read < buffer.length) {
    int n=super.read(buffer,read,buffer.length - read);
    if (n < 0)     break;
    read+=n;
  }
  validBufferBytes=read;
  bytesSinceCacheFlush+=read;
  if (skipCache && bytesSinceCacheFlush >= MAX_BYTES_IN_PAGE_CACHE) {
    CLibrary.trySkipCache(this.fd,(int)minBufferOffset,0);
    bytesSinceCacheFlush=0;
    minBufferOffset=Long.MAX_VALUE;
  }
}
Program: 87028
Project: 87028
Buggy source:
public void sync() throws IOException {
  if (syncNeeded) {
    flush();
    channel.force(true);
    if (skipCache) {
      CLibrary.trySkipCache(this.fd,0,0);
      minBufferOffset=Long.MAX_VALUE;
      bytesSinceCacheFlush=0;
    }
    syncNeeded=false;
  }
}

Fixed version (ground truth):
/** 
 * Flush (flush()) whatever writes are pending, and block until the data has been persistently committed (fsync()).
 */
public void sync() throws IOException {
  if (syncNeeded) {
    flush();
    channel.force(true);
    if (skipCache) {
      CLibrary.trySkipCache(this.fd,0,0);
      minBufferOffset=Long.MAX_VALUE;
      bytesSinceCacheFlush=0;
    }
    syncNeeded=false;
  }
}
Program: 87029
Project: 87029
Buggy source:
public void flush() throws IOException {
  if (isDirty) {
    if (channel.position() != bufferOffset)     channel.position(bufferOffset);
    super.write(buffer,0,validBufferBytes);
    if (skipCache) {
      bytesSinceCacheFlush+=validBufferBytes;
      if (bufferOffset < minBufferOffset)       minBufferOffset=bufferOffset;
      if (bytesSinceCacheFlush >= MAX_BYTES_IN_PAGE_CACHE) {
        CLibrary.trySkipCache(this.fd,(int)minBufferOffset,0);
        minBufferOffset=bufferOffset;
        bytesSinceCacheFlush=0;
      }
    }
    isDirty=false;
  }
}

Fixed version (ground truth):
/** 
 * If we are dirty, flush dirty contents to the operating system. Does not imply fsync(). Currently, for implementation reasons, this also invalidates the buffer.
 */
public void flush() throws IOException {
  if (isDirty) {
    if (channel.position() != bufferOffset)     channel.position(bufferOffset);
    super.write(buffer,0,validBufferBytes);
    if (skipCache) {
      bytesSinceCacheFlush+=validBufferBytes;
      if (bufferOffset < minBufferOffset)       minBufferOffset=bufferOffset;
      if (bytesSinceCacheFlush >= MAX_BYTES_IN_PAGE_CACHE) {
        CLibrary.trySkipCache(this.fd,(int)minBufferOffset,0);
        minBufferOffset=bufferOffset;
        bytesSinceCacheFlush=0;
      }
    }
    resetBuffer();
    isDirty=false;
  }
}
Program: 87030
Project: 87030
Buggy source:
private String createForeignKeyForTable(final ColumnMetaData columnMetaData,final int counter){
  final TableMetaData tableMetaData=columnMetaData.getTableMetaData();
  final String schemaPrefix="String_Node_Str".equals(_targetSchema) ? "String_Node_Str" : _targetSchema + "String_Node_Str";
  final ColumnMetaData referencedColumn=columnMetaData.getReferencedColumn();
  final String tablename=_caseConversionMode.convert(tableMetaData.getTableName());
  final StringBuilder builder=new StringBuilder("String_Node_Str" + schemaPrefix + tablename+ "String_Node_Str");
  final String foreignkeyName=tablename + "String_Node_Str" + _caseConversionMode.convert(columnMetaData.getColumnName())+ "String_Node_Str"+ _caseConversionMode.convert(referencedColumn.getColumnName());
  builder.append("String_Node_Str" + (foreignkeyName.length() > 55 ? foreignkeyName.substring(0,55) : foreignkeyName) + "String_Node_Str"+ counter);
  builder.append("String_Node_Str" + _caseConversionMode.convert(columnMetaData.getColumnName()) + "String_Node_Str"+ schemaPrefix+ _caseConversionMode.convert(referencedColumn.getTableMetaData().getTableName())+ "String_Node_Str"+ _caseConversionMode.convert(referencedColumn.getColumnName())+ "String_Node_Str");
  return builder.toString();
}

Fixed version (ground truth):
private String createForeignKeyForTable(final ColumnMetaData columnMetaData,final int counter){
  final TableMetaData tableMetaData=columnMetaData.getTableMetaData();
  final String schemaPrefix="String_Node_Str".equals(_targetSchema) ? "String_Node_Str" : _targetSchema + "String_Node_Str";
  final ColumnMetaData referencedColumn=columnMetaData.getReferencedColumn();
  final String tablename=_caseConversionMode.convert(tableMetaData.getTableName());
  final StringBuilder builder=new StringBuilder("String_Node_Str" + schemaPrefix + tablename+ "String_Node_Str");
  builder.append("String_Node_Str" + tablename + "String_Node_Str"+ _caseConversionMode.convert(columnMetaData.getColumnName())+ "String_Node_Str"+ _caseConversionMode.convert(referencedColumn.getColumnName())+ "String_Node_Str"+ counter);
  builder.append("String_Node_Str" + _caseConversionMode.convert(columnMetaData.getColumnName()) + "String_Node_Str"+ schemaPrefix+ _caseConversionMode.convert(referencedColumn.getTableMetaData().getTableName())+ "String_Node_Str"+ _caseConversionMode.convert(referencedColumn.getColumnName())+ "String_Node_Str");
  return builder.toString();
}
Program: 87031
Project: 87031
Buggy source:
private String createForeignKeyForTable(final ColumnMetaData columnMetaData,int counter){
  final TableMetaData tableMetaData=columnMetaData.getTableMetaData();
  final String schemaPrefix="String_Node_Str".equals(_targetSchema) ? "String_Node_Str" : _targetSchema + "String_Node_Str";
  final ColumnMetaData referencedColumn=columnMetaData.getReferencedColumn();
  final String tablename=_caseConversionMode.convert(tableMetaData.getTableName());
  final StringBuilder builder=new StringBuilder("String_Node_Str" + schemaPrefix + tablename+ "String_Node_Str");
  final String foreignkeyName=tablename + "String_Node_Str" + _caseConversionMode.convert(columnMetaData.getColumnName())+ "String_Node_Str"+ _caseConversionMode.convert(referencedColumn.getColumnName());
  builder.append("String_Node_Str" + (foreignkeyName.length() > 55 ? foreignkeyName.substring(0,55) : foreignkeyName) + "String_Node_Str"+ counter++);
  builder.append("String_Node_Str" + _caseConversionMode.convert(columnMetaData.getColumnName()) + "String_Node_Str"+ schemaPrefix+ _caseConversionMode.convert(referencedColumn.getTableMetaData().getTableName())+ "String_Node_Str"+ _caseConversionMode.convert(referencedColumn.getColumnName())+ "String_Node_Str");
  return builder.toString();
}

Fixed version (ground truth):
private String createForeignKeyForTable(final ColumnMetaData columnMetaData,final int counter){
  final TableMetaData tableMetaData=columnMetaData.getTableMetaData();
  final String schemaPrefix="String_Node_Str".equals(_targetSchema) ? "String_Node_Str" : _targetSchema + "String_Node_Str";
  final ColumnMetaData referencedColumn=columnMetaData.getReferencedColumn();
  final String tablename=_caseConversionMode.convert(tableMetaData.getTableName());
  final StringBuilder builder=new StringBuilder("String_Node_Str" + schemaPrefix + tablename+ "String_Node_Str");
  final String foreignkeyName=tablename + "String_Node_Str" + _caseConversionMode.convert(columnMetaData.getColumnName())+ "String_Node_Str"+ _caseConversionMode.convert(referencedColumn.getColumnName());
  builder.append("String_Node_Str" + (foreignkeyName.length() > 55 ? foreignkeyName.substring(0,55) : foreignkeyName) + "String_Node_Str"+ counter);
  builder.append("String_Node_Str" + _caseConversionMode.convert(columnMetaData.getColumnName()) + "String_Node_Str"+ schemaPrefix+ _caseConversionMode.convert(referencedColumn.getTableMetaData().getTableName())+ "String_Node_Str"+ _caseConversionMode.convert(referencedColumn.getColumnName())+ "String_Node_Str");
  return builder.toString();
}
Program: 87032
Project: 87032
Buggy source:
public List<String> createForeignKeyStatements() throws SQLException {
  final List<String> result=new ArrayList<String>();
  for (  final TableMetaData tableMetaData : _sourceDatabaseMetaData.getTableMetaData()) {
    final int counter=1;
    final List<ColumnMetaData> columns=tableMetaData.getColumnMetaData();
    for (    final ColumnMetaData columnMetaData : columns) {
      if (columnMetaData.getReferencedColumn() != null) {
        result.add(createForeignKeyForTable(columnMetaData,counter));
      }
    }
  }
  return result;
}

Fixed version (ground truth):
public List<String> createForeignKeyStatements() throws SQLException {
  final List<String> result=new ArrayList<String>();
  for (  final TableMetaData tableMetaData : _sourceDatabaseMetaData.getTableMetaData()) {
    int counter=1;
    final List<ColumnMetaData> columns=tableMetaData.getColumnMetaData();
    for (    final ColumnMetaData columnMetaData : columns) {
      if (columnMetaData.getReferencedColumn() != null) {
        result.add(createForeignKeyForTable(columnMetaData,counter++));
      }
    }
  }
  return result;
}
Program: 87033
Project: 87033
Buggy source:
public List<String> createIndexStatements() throws SQLException {
  final List<String> result=new ArrayList<String>();
  for (  final TableMetaData tableMetaData : _sourceDatabaseMetaData.getTableMetaData()) {
    final int counter=1;
    final List<IndexMetaData> indexes=tableMetaData.getIndexes();
    for (    final IndexMetaData indexMetaData : indexes) {
      result.add(createIndexesForTable(indexMetaData,counter));
    }
  }
  return result;
}

Fixed version (ground truth):
public List<String> createIndexStatements() throws SQLException {
  final List<String> result=new ArrayList<String>();
  for (  final TableMetaData tableMetaData : _sourceDatabaseMetaData.getTableMetaData()) {
    int counter=1;
    final List<IndexMetaData> indexes=tableMetaData.getIndexes();
    for (    final IndexMetaData indexMetaData : indexes) {
      result.add(createIndexesForTable(indexMetaData,counter++));
    }
  }
  return result;
}
Program: 87034
Project: 87034
Buggy source:
private String createPrimaryKeyStatement(final TableMetaData tableMetaData,final List<ColumnMetaData> primaryKeyColumns,int counter){
  final String tableName=_caseConversionMode.convert(tableMetaData.getTableName());
  final StringBuilder builder=new StringBuilder("String_Node_Str" + ("String_Node_Str".equals(_targetSchema) ? "String_Node_Str" : _targetSchema + "String_Node_Str") + tableName+ "String_Node_Str"+ tableName+ "String_Node_Str"+ counter+++ "String_Node_Str");
  for (  final ColumnMetaData columnMetaData : primaryKeyColumns) {
    builder.append(_caseConversionMode.convert(columnMetaData.getColumnName()) + "String_Node_Str");
  }
  builder.setLength(builder.length() - 2);
  builder.append("String_Node_Str");
  return builder.toString();
}

Fixed version (ground truth):
private String createPrimaryKeyStatement(final TableMetaData tableMetaData,final List<ColumnMetaData> primaryKeyColumns,final int counter){
  final String tableName=_caseConversionMode.convert(tableMetaData.getTableName());
  final StringBuilder builder=new StringBuilder("String_Node_Str" + ("String_Node_Str".equals(_targetSchema) ? "String_Node_Str" : _targetSchema + "String_Node_Str") + tableName+ "String_Node_Str"+ tableName+ "String_Node_Str"+ counter+ "String_Node_Str");
  for (  final ColumnMetaData columnMetaData : primaryKeyColumns) {
    builder.append(_caseConversionMode.convert(columnMetaData.getColumnName()) + "String_Node_Str");
  }
  builder.setLength(builder.length() - 2);
  builder.append("String_Node_Str");
  return builder.toString();
}
Program: 87035
Project: 87035
Buggy source:
public List<String> createPrimaryKeyStatements() throws SQLException {
  final List<String> result=new ArrayList<String>();
  for (  final TableMetaData tableMetaData : _sourceDatabaseMetaData.getTableMetaData()) {
    final int counter=1;
    final List<ColumnMetaData> primaryKeyColumns=tableMetaData.getPrimaryKeyColumns();
    if (!primaryKeyColumns.isEmpty()) {
      result.add(createPrimaryKeyStatement(tableMetaData,primaryKeyColumns,counter));
    }
  }
  return result;
}

Fixed version (ground truth):
public List<String> createPrimaryKeyStatements() throws SQLException {
  final List<String> result=new ArrayList<String>();
  for (  final TableMetaData tableMetaData : _sourceDatabaseMetaData.getTableMetaData()) {
    int counter=1;
    final List<ColumnMetaData> primaryKeyColumns=tableMetaData.getPrimaryKeyColumns();
    if (!primaryKeyColumns.isEmpty()) {
      result.add(createPrimaryKeyStatement(tableMetaData,primaryKeyColumns,counter++));
    }
  }
  return result;
}
Program: 87036
Project: 87036
Buggy source:
private String createIndexesForTable(final IndexMetaData indexMetaData,int counter){
  final TableMetaData tableMetaData=indexMetaData.getTableMetaData();
  final String schemaPrefix="String_Node_Str".equals(_targetSchema) ? "String_Node_Str" : _targetSchema + "String_Node_Str";
  final String unique=indexMetaData.isUnique() ? "String_Node_Str" : "String_Node_Str";
  final StringBuilder builder=new StringBuilder("String_Node_Str" + unique + "String_Node_Str"+ _caseConversionMode.convert(indexMetaData.getIndexName())+ "String_Node_Str"+ _caseConversionMode.convert(tableMetaData.getTableName())+ "String_Node_Str"+ counter+++ "String_Node_Str"+ schemaPrefix+ _caseConversionMode.convert(tableMetaData.getTableName())+ "String_Node_Str");
  for (final Iterator<ColumnMetaData> iterator=indexMetaData.getColumnMetaData().iterator(); iterator.hasNext(); ) {
    final ColumnMetaData columnMetaData=iterator.next();
    builder.append(_caseConversionMode.convert(columnMetaData.getColumnName()));
    if (iterator.hasNext()) {
      builder.append("String_Node_Str");
    }
  }
  builder.append("String_Node_Str");
  return builder.toString();
}

Fixed version (ground truth):
private String createIndexesForTable(final IndexMetaData indexMetaData,final int counter){
  final TableMetaData tableMetaData=indexMetaData.getTableMetaData();
  final String schemaPrefix="String_Node_Str".equals(_targetSchema) ? "String_Node_Str" : _targetSchema + "String_Node_Str";
  final String unique=indexMetaData.isUnique() ? "String_Node_Str" : "String_Node_Str";
  final StringBuilder builder=new StringBuilder("String_Node_Str" + unique + "String_Node_Str"+ _caseConversionMode.convert(indexMetaData.getIndexName())+ "String_Node_Str"+ _caseConversionMode.convert(tableMetaData.getTableName())+ "String_Node_Str"+ counter+ "String_Node_Str"+ schemaPrefix+ _caseConversionMode.convert(tableMetaData.getTableName())+ "String_Node_Str");
  for (final Iterator<ColumnMetaData> iterator=indexMetaData.getColumnMetaData().iterator(); iterator.hasNext(); ) {
    final ColumnMetaData columnMetaData=iterator.next();
    builder.append(_caseConversionMode.convert(columnMetaData.getColumnName()));
    if (iterator.hasNext()) {
      builder.append("String_Node_Str");
    }
  }
  builder.append("String_Node_Str");
  return builder.toString();
}
Program: 87037
Project: 87037
Buggy source:
@Override public String toString(){
  return _tableMetaData.getTableName() + "String_Node_Str" + getReferencedTables()+ "String_Node_Str"+ getReferencedByTables();
}

Fixed version (ground truth):
private static String toString(final List<TableNode> referencedTables){
  List<String> result=new ArrayList<String>();
  for (  TableNode tableNode : referencedTables) {
    result.add(tableNode.getTableMetaData().getTableName());
  }
  return result.toString();
}
Program: 87038
Project: 87038
Buggy source:
public void addDroppedColumn(final String targetTableName,final String sourceColumName){
}

Fixed version (ground truth):
public DroppingColumnMapper addDroppedColumn(final String targetTableName,final String sourceColumName){
}
Program: 87040
Project: 87040
Buggy source:
/** 
 * Create SELECT statement in the target table to retrieve data from the mapped columns. I.e., since the target table configuration may be different, the SELECT statement may be different. This is needed to check data compatibility with the   {@link CheckEqualTableDataTool}
 */
public PreparedStatement createMappedSelectStatement(final TableMetaData sourceTableMetaData,final String tableName,final TableMetaData targetTableMetaData,final Connection connection,final String sourceConnectorId) throws SQLException {
  final List<ColumnMetaData> columns=getMappedTargetColumns(sourceTableMetaData,targetTableMetaData,sourceConnectorId);
  final String sql=createSQL(tableName,targetTableMetaData,columns);
  return connection.prepareStatement(sql);
}

Fixed version (ground truth):
/** 
 * Create SELECT statement in the target table to retrieve data from the mapped columns. I.e., since the target table configuration may be different, the SELECT statement may be different. This is needed to check data compatibility with the  {@link CheckEqualTableDataTool}
 */
public PreparedStatement createMappedSelectStatement(final TableMetaData sourceTableMetaData,final String tableName,final TableMetaData targetTableMetaData,final Connection connection,final String sourceConnectorId) throws SQLException {
  final List<ColumnMetaData> columns=getMappedTargetColumns(sourceTableMetaData,targetTableMetaData,sourceConnectorId);
  final String sql=createSQL(tableName,targetTableMetaData,columns);
  return connection.prepareStatement(sql);
}
Program: 87041
Project: 87041
Buggy source:
/** 
 * Create SELECT statement in the spource table to retrieve data from the configured source columns.
 */
public PreparedStatement createSelectStatement(final String tableName,final TableMetaData tableMetaData,final Connection connection) throws SQLException {
  final List<ColumnMetaData> columns=ColumnOrderHint.getSortedColumns(_connectorRepository,_connectorId,tableMetaData);
  final String sql=createSQL(tableName,tableMetaData,columns);
  LOG.debug("String_Node_Str" + sql);
  return connection.prepareStatement(sql);
}

Fixed version (ground truth):
/** 
 * Create SELECT statement in the source table to retrieve data from the configured source columns.
 */
public PreparedStatement createSelectStatement(final String tableName,final TableMetaData tableMetaData,final Connection connection) throws SQLException {
  final List<ColumnMetaData> columns=ColumnOrderHint.getSortedColumns(_connectorRepository,_connectorId,tableMetaData);
  final String sql=createSQL(tableName,tableMetaData,columns);
  LOG.debug("String_Node_Str" + sql);
  return connection.prepareStatement(sql);
}
Program: 87043
Project: 87043
Buggy source:
/** 
 * Compares this to another object.
 * @param otherRepository The other Repository to which this is compared.
 * @return true if it is the same object, otherwise false
 */
public boolean equals(Repository otherRepository){
  return name.equals(otherRepository.getName());
}

Fixed version (ground truth):
/** 
 * Compares this to another object.
 * @param otherRepository The other Repository to which this is compared.
 * @return true if it is the same object, otherwise false
 */
public boolean equals(Repository otherRepository){
  return name == null ? otherRepository.getName() == null : name.equals(otherRepository.getName());
}
Program: 87045
Project: 87045
Buggy source:
/** 
 * Calculates hashCode value of this group.
 * @return Hashcode of this object
 */
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + (name == null ? 0 : name.hashCode());
  return result;
}

Fixed version (ground truth):
/** 
 * Calculates hashCode value of this group.
 * @return Hashcode of this object
 */
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + (getName() == null ? 0 : getName().hashCode());
  return result;
}
Program: 87046
Project: 87046
Buggy source:
/** 
 * Compares this object with the provided AuthzGroup object for equality.
 * @param object Object to compare
 * @return True if this object matches the provided object, otherwise false
 */
@Override public boolean equals(final Object object){
  if (this == object) {
    return true;
  }
  if (object == null) {
    return false;
  }
  if (getClass() != object.getClass()) {
    return false;
  }
  final AuthzGroupImpl other=(AuthzGroupImpl)object;
  if (name == null) {
    if (other.name != null) {
      return false;
    }
  }
 else   if (!name.equals(other.name)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Compares this object with the provided AuthzGroup object for equality.
 * @param object Object to compare
 * @return True if this object matches the provided object, otherwise false
 */
@Override public boolean equals(final Object object){
  if (this == object) {
    return true;
  }
  if (object == null) {
    return false;
  }
  if (getClass() != object.getClass()) {
    return false;
  }
  final AuthzGroupImpl other=(AuthzGroupImpl)object;
  if (getName() == null) {
    if (other.getName() != null) {
      return false;
    }
  }
 else   if (!getName().equals(other.getName())) {
    return false;
  }
  return true;
}
Program: 87047
Project: 87047
Buggy source:
/** 
 * Creates a string representation of this group.
 * @return String representation of this group
 */
@Override public String toString(){
  final ToStringBuilder toStringBuilder=new ToStringBuilder(this);
  toStringBuilder.append("String_Node_Str",name);
  return toStringBuilder.toString();
}

Fixed version (ground truth):
/** 
 * Creates a string representation of this group.
 * @return String representation of this group
 */
@Override public String toString(){
  final ToStringBuilder toStringBuilder=new ToStringBuilder(this);
  toStringBuilder.append("String_Node_Str",getName());
  return toStringBuilder.toString();
}
Program: 87048
Project: 87048
Buggy source:
/** 
 * Adds access rule to collection access rules.
 * @param accessRule Access rule to add to collection
 * @return True if access rule added
 * @throws AuthzAccessRuleAlreadyAppliedException If the access rule is already applied to the member
 */
protected boolean addAccessRule(final AuthzAccessRule accessRule) throws AuthzAccessRuleAlreadyAppliedException {
  LOGGER.debug("String_Node_Str",accessRule);
  Preconditions.checkNotNull(accessRule,"String_Node_Str");
  if (accessRules.contains(accessRule)) {
    LOGGER.error("String_Node_Str");
    throw new AuthzAccessRuleAlreadyAppliedException();
  }
  if (accessRules.add(accessRule)) {
    Collections.sort(accessRules);
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Adds access rule to collection access rules.
 * @param accessRule Access rule to add to collection
 * @return True if access rule added
 * @throws AuthzAccessRuleAlreadyAppliedException If the access rule is already applied to the member
 */
protected final boolean addAccessRule(final AuthzAccessRule accessRule) throws AuthzAccessRuleAlreadyAppliedException {
  LOGGER.debug("String_Node_Str",accessRule);
  Preconditions.checkNotNull(accessRule,"String_Node_Str");
  if (accessRules.contains(accessRule)) {
    LOGGER.error("String_Node_Str");
    throw new AuthzAccessRuleAlreadyAppliedException();
  }
  if (accessRules.add(accessRule)) {
    Collections.sort(accessRules);
    return true;
  }
 else {
    return false;
  }
}
Program: 87049
Project: 87049
Buggy source:
/** 
 * Calculates hashCode value of this user.
 * @return Hashcode of this object
 */
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + (alias == null ? 0 : alias.hashCode());
  result=prime * result + (name == null ? 0 : name.hashCode());
  return result;
}

Fixed version (ground truth):
/** 
 * Calculates hashCode value of this user.
 * @return Hashcode of this object
 */
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + (alias == null ? 0 : alias.hashCode());
  result=prime * result + (getName() == null ? 0 : getName().hashCode());
  return result;
}