nus-yam/ex-repair huggingface dataset:
Program: 31044
Project: 31044
Buggy source:
public long getTxn(){
  if (isOpen()) {
    return txLog.getCurrentTxn();
  }
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
public long getTxn(){
}
Program: 31045
Project: 31045
Buggy source:
public void notifyTxError(){
  if (txListener != null) {
    try {
      txListener.onError();
    }
 catch (    Throwable e) {
      LOG.error().$("String_Node_Str").$(e).$();
    }
  }
}

Fixed version (ground truth):
public void notifyTxError(int event){
  if (txListener != null) {
    try {
      txListener.onError(event);
    }
 catch (    Throwable e) {
      LOG.error().$("String_Node_Str").$(e).$();
    }
  }
}
Program: 31046
Project: 31046
Buggy source:
private void rollback0(long address,boolean writeDiscard) throws JournalException {
  if (address == -1L) {
    notifyTxError();
    throw new IncompatibleJournalException("String_Node_Str",this.getLocation());
  }
  txLog.read(address,tx);
  if (tx.address == 0) {
    throw new JournalException("String_Node_Str");
  }
  if (writeDiscard) {
    LOG.info().$("String_Node_Str").$(metadata.getLocation()).$("String_Node_Str").$(tx.txn).$("String_Node_Str").$ts(tx.timestamp).$();
    writeDiscardFile(tx.journalMaxRowID);
  }
  rollbackPartitions(tx);
  Partition<T> lag=getIrregularPartition();
  if (tx.lagName != null && tx.lagName.length() > 0 && (lag == null || !tx.lagName.equals(lag.getName()))) {
    Partition<T> newLag=createTempPartition(tx.lagName);
    setIrregularPartition(newLag);
    newLag.applyTx(tx.lagSize,tx.lagIndexPointers);
  }
 else   if (lag != null && tx.lagName == null) {
    removeIrregularPartitionInternal();
  }
 else   if (lag != null) {
    lag.truncate(tx.lagSize);
  }
  if (tx.symbolTableSizes.length == 0) {
    for (int i=0, sz=getSymbolTableCount(); i < sz; i++) {
      getSymbolTable(i).truncate();
    }
  }
 else {
    for (int i=0, sz=getSymbolTableCount(); i < sz; i++) {
      getSymbolTable(i).truncate(tx.symbolTableSizes[i]);
    }
  }
  appendTimestampLo=-1;
  appendTimestampHi=-1;
  appendPartition=null;
  txLog.writeTxAddress(tx.address);
  txActive=false;
}

Fixed version (ground truth):
private void rollback0(long address,boolean writeDiscard) throws JournalException {
  if (address == -1L) {
    notifyTxError(JournalEvents.EVT_JNL_UNKNOWN_TRANSACTION);
    throw new IncompatibleJournalException("String_Node_Str",this.getLocation());
  }
  txLog.read(address,tx);
  if (tx.address == 0) {
    throw new JournalException("String_Node_Str");
  }
  if (writeDiscard) {
    LOG.info().$("String_Node_Str").$(metadata.getLocation()).$("String_Node_Str").$(tx.txn).$("String_Node_Str").$ts(tx.timestamp).$();
    writeDiscardFile(tx.journalMaxRowID);
  }
  rollbackPartitions(tx);
  Partition<T> lag=getIrregularPartition();
  if (tx.lagName != null && tx.lagName.length() > 0 && (lag == null || !tx.lagName.equals(lag.getName()))) {
    Partition<T> newLag=createTempPartition(tx.lagName);
    setIrregularPartition(newLag);
    newLag.applyTx(tx.lagSize,tx.lagIndexPointers);
  }
 else   if (lag != null && tx.lagName == null) {
    removeIrregularPartitionInternal();
  }
 else   if (lag != null) {
    lag.truncate(tx.lagSize);
  }
  if (tx.symbolTableSizes.length == 0) {
    for (int i=0, sz=getSymbolTableCount(); i < sz; i++) {
      getSymbolTable(i).truncate();
    }
  }
 else {
    for (int i=0, sz=getSymbolTableCount(); i < sz; i++) {
      getSymbolTable(i).truncate(tx.symbolTableSizes[i]);
    }
  }
  appendTimestampLo=-1;
  appendTimestampHi=-1;
  appendPartition=null;
  txLog.writeTxAddress(tx.address);
  txActive=false;
}
Program: 31047
Project: 31047
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public Journal reader(JournalMetadata metadata) throws JournalException {
  JournalKey key=metadata.getKey();
  String name=key.derivedLocation();
  Journal result=readers.get(name);
  if (result == null) {
    if (getConfiguration().exists(name) != JournalConfiguration.EXISTS) {
      throw new JournalException("String_Node_Str");
    }
    result=new Journal<>(metadata,key);
    result.setCloseListener(this);
    readers.put(name,result);
    journalList.add(result);
  }
  return result;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public Journal reader(JournalMetadata metadata) throws JournalException {
  JournalKey key=metadata.getKey();
  String name=key.path();
  Journal result=readers.get(name);
  if (result == null) {
    if (getConfiguration().exists(name) != JournalConfiguration.EXISTS) {
      throw new JournalException("String_Node_Str");
    }
    result=new Journal<>(metadata,key);
    result.setCloseListener(this);
    readers.put(name,result);
    journalList.add(result);
  }
  return result;
}
Program: 31048
Project: 31048
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public <T>JournalMetadata<T> getOrCreateMetadata(JournalKey<T> key) throws JournalException {
  String name=key.derivedLocation();
  JournalMetadata m=metadata.get(name);
  if (m == null) {
    m=super.getOrCreateMetadata(key);
    metadata.put(name,m);
  }
  return m;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public <T>JournalMetadata<T> getOrCreateMetadata(JournalKey<T> key) throws JournalException {
  String name=key.path();
  JournalMetadata m=metadata.get(name);
  if (m == null) {
    m=super.getOrCreateMetadata(key);
    metadata.put(name,m);
  }
  return m;
}
Program: 31049
Project: 31049
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public <T>JournalBulkReader<T> bulkReader(JournalKey<T> key) throws JournalException {
  String name=key.derivedLocation();
  checkBlocked(name);
  JournalBulkReader<T> result=bulkReaders.get(name);
  if (result == null) {
    result=new JournalBulkReader<>(getOrCreateMetadata(key),key);
    result.setCloseListener(this);
    bulkReaders.put(name,result);
    journalList.add(result);
  }
  return result;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public <T>JournalBulkReader<T> bulkReader(JournalKey<T> key) throws JournalException {
  String name=key.path();
  checkBlocked(name);
  JournalBulkReader<T> result=bulkReaders.get(name);
  if (result == null) {
    result=new JournalBulkReader<>(getOrCreateMetadata(key),key);
    result.setCloseListener(this);
    bulkReaders.put(name,result);
    journalList.add(result);
  }
  return result;
}
Program: 31050
Project: 31050
Buggy source:
@Override public void onEvent(int evt){
switch (evt) {
case JournalClient.EVT_INCOMPATIBLE_JOURNAL:
case JournalClient.EVT_CLIENT_HALT:
case JournalClient.EVT_AUTH_CONFIG_ERROR:
case JournalClient.EVT_CLIENT_EXCEPTION:
    halt();
  break;
case JournalClient.EVT_SERVER_ERROR:
if (running.get()) {
  server.joinCluster(statusListener);
}
break;
default :
break;
}
}

Fixed version (ground truth):
@Override public void onEvent(int evt){
switch (evt) {
case JournalClientEvents.EVT_INCOMPATIBLE_JOURNAL:
case JournalClientEvents.EVT_CLIENT_HALT:
case JournalClientEvents.EVT_AUTH_CONFIG_ERROR:
case JournalClientEvents.EVT_CLIENT_EXCEPTION:
    halt();
  break;
case JournalClientEvents.EVT_SERVER_ERROR:
if (running.get()) {
  server.joinCluster(statusListener);
}
break;
default :
break;
}
}
Program: 31051
Project: 31051
Buggy source:
public boolean isRunning() throws JournalNetworkException {
  long cursor=subscriptionSubSequence.next();
  if (cursor < 0) {
    return true;
  }
  long available=subscriptionSubSequence.available();
  while (cursor < available) {
    SubscriptionHolder holder=subscriptionQueue.get(cursor++);
    if (holder.type == MSG_HALT) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean isRunning(){
  long cursor=subscriptionSubSequence.next();
  if (cursor < 0) {
    return true;
  }
  long available=subscriptionSubSequence.available();
  while (cursor < available) {
    SubscriptionHolder holder=subscriptionQueue.get(cursor++);
    if (holder.type == MSG_HALT) {
      return false;
    }
  }
  return true;
}
Program: 31053
Project: 31053
Buggy source:
private void resubscribe() throws JournalNetworkException {
  for (int i=0, n=subscriptions.size(); i < n; i++) {
    SubscriptionHolder h=subscriptions.get(i);
    subscribeOne(i,h,h.local.path(),false);
  }
}

Fixed version (ground truth):
private void resubscribe(){
  for (int i=0, n=subscriptions.size(); i < n; i++) {
    SubscriptionHolder h=subscriptions.get(i);
    subscribeOne(i,h,h.local.path(),false);
  }
}
Program: 31054
Project: 31054
Buggy source:
private byte[] getToken() throws JournalNetworkException, AuthenticationProviderException {
  try {
    return credentialProvider.createToken();
  }
 catch (  Throwable e) {
    LOG.error().$("String_Node_Str").$(e).$();
    throw new AuthenticationProviderException();
  }
}

Fixed version (ground truth):
private byte[] getToken() throws AuthenticationProviderException {
  try {
    return credentialProvider.createToken();
  }
 catch (  Throwable e) {
    LOG.error().$("String_Node_Str").$(e).$();
    throw new AuthenticationProviderException();
  }
}
Program: 31055
Project: 31055
Buggy source:
public boolean processSubscriptionQueue() throws JournalNetworkException {
  long cursor=subscriptionSubSequence.next();
  if (cursor < 0) {
    return true;
  }
  long available=subscriptionSubSequence.available();
  int i=writers.size();
  while (cursor < available) {
    SubscriptionHolder holder=subscriptionQueue.get(cursor++);
switch (holder.type) {
case MSG_SUBSCRIBE:
      String loc=holder.local.path();
    if (subscribedJournals.add(loc)) {
      subscribeOne(i++,holder,loc,true);
    }
 else {
      if (holder.listener != null) {
        holder.listener.onEvent(JournalEvents.EVT_JNL_ALREADY_SUBSCRIBED);
      }
      LOG.error().$("String_Node_Str").$(loc).$();
    }
  break;
case MSG_UNSUBSCRIBE:
break;
case MSG_HALT:
return false;
default :
LOG.error().$("String_Node_Str").$(holder.type).$();
break;
}
}
subscriptionSubSequence.done(available - 1);
return true;
}

Fixed version (ground truth):
public boolean processSubscriptionQueue(){
  long cursor=subscriptionSubSequence.next();
  if (cursor < 0) {
    return true;
  }
  long available=subscriptionSubSequence.available();
  int i=writers.size();
  while (cursor < available) {
    SubscriptionHolder holder=subscriptionQueue.get(cursor++);
switch (holder.type) {
case MSG_SUBSCRIBE:
      String loc=holder.local.path();
    if (subscribedJournals.add(loc)) {
      subscribeOne(i++,holder,loc,true);
    }
 else {
      if (holder.listener != null) {
        holder.listener.onEvent(JournalEvents.EVT_JNL_ALREADY_SUBSCRIBED);
      }
      LOG.error().$("String_Node_Str").$(loc).$();
    }
  break;
case MSG_UNSUBSCRIBE:
break;
case MSG_HALT:
return false;
default :
LOG.error().$("String_Node_Str").$(holder.type).$();
break;
}
}
subscriptionSubSequence.done(available - 1);
return true;
}
Program: 31056
Project: 31056
Buggy source:
private void removeClientKey(ByteChannel channel) throws JournalNetworkException {
  setKeyRequestConsumer.read(channel);
  IndexedJournalKey indexedKey=setKeyRequestConsumer.getValue();
  LOG.debug().$(socketAddress).$("String_Node_Str").$(indexedKey.getIndex()).$();
  JournalKey<?> readerKey=indexedKey.getKey();
  int index=indexedKey.getIndex();
  IndexedJournalKey augmentedReaderKey=server.getWriterIndex0(readerKey);
  if (augmentedReaderKey == null) {
    error(channel,"String_Node_Str" + readerKey);
  }
 else {
    writerToReaderMap.put(augmentedReaderKey.getIndex(),JOURNAL_INDEX_NOT_FOUND);
    readerToWriterMap.extendAndSet(index,JOURNAL_INDEX_NOT_FOUND);
    try {
      removeReader(index);
      clientStates.setQuick(index,null);
      ok(channel);
    }
 catch (    JournalException e) {
      error(channel,"String_Node_Str" + readerKey,e);
    }
  }
}

Fixed version (ground truth):
private void removeClientKey(ByteChannel channel) throws JournalNetworkException {
  setKeyRequestConsumer.read(channel);
  IndexedJournalKey indexedKey=setKeyRequestConsumer.getValue();
  LOG.debug().$(socketAddress).$("String_Node_Str").$(indexedKey.getIndex()).$();
  JournalKey<?> readerKey=indexedKey.getKey();
  int index=indexedKey.getIndex();
  IndexedJournalKey augmentedReaderKey=server.getWriterIndex0(readerKey);
  if (augmentedReaderKey == null) {
    error(channel,"String_Node_Str" + readerKey);
  }
 else {
    writerToReaderMap.put(augmentedReaderKey.getIndex(),JOURNAL_INDEX_NOT_FOUND);
    readerToWriterMap.extendAndSet(index,JOURNAL_INDEX_NOT_FOUND);
    removeReader(index);
    clientStates.setQuick(index,null);
    ok(channel);
  }
}
Program: 31057
Project: 31057
Buggy source:
private void removeReader(int index) throws JournalException {
  Journal journal=readers.getQuiet(index);
  if (journal != null) {
    journal.close();
    if (index < readers.size()) {
      readers.setQuick(index,null);
    }
  }
  JournalDeltaProducer producer=producers.getQuiet(index);
  if (producer != null) {
    producer.free();
    if (index < producers.size()) {
      producers.setQuick(index,null);
    }
  }
}

Fixed version (ground truth):
private void removeReader(int index){
  Journal journal=readers.getQuiet(index);
  if (journal != null) {
    journal.close();
    if (index < readers.size()) {
      readers.setQuick(index,null);
    }
  }
  JournalDeltaProducer producer=producers.getQuiet(index);
  if (producer != null) {
    producer.free();
    if (index < producers.size()) {
      producers.setQuick(index,null);
    }
  }
}
Program: 31058
Project: 31058
Buggy source:
@Override public CharSequence getFlyweightStr(int col){
  long readAddress=addressOf(col);
  final int len=Unsafe.getUnsafe().getInt(readAddress);
  if (len < 0)   return null;
  return Unsafe.arrayGet(csA,col).of(readAddress + 4,readAddress + 4 + len * 2);
}

Fixed version (ground truth):
@Override public CharSequence getFlyweightStr(int col){
}
Program: 31059
Project: 31059
Buggy source:
public RecordListRecord(RecordMetadata metadata,MemoryPages mem){
  this.mem=mem;
  offsets=new int[metadata.getColumnCount()];
  csA=new DirectCharSequence[offsets.length];
  csB=new DirectCharSequence[offsets.length];
  int varColIndex=0;
  for (int i=0; i < offsets.length; i++) {
    int ct=metadata.getColumnQuick(i).getType();
    int size=ColumnType.sizeOf(ct);
    if (size != 0) {
      offsets[i]=fixedSize;
      fixedSize+=size;
    }
 else {
      offsets[i]=-(varColIndex++);
      csA[i]=new DirectCharSequence();
      csB[i]=new DirectCharSequence();
    }
  }
  fixedSize=((fixedSize + 7) >> 3) << 3;
  headerSize=varColIndex * 8;
}

Fixed version (ground truth):
public RecordListRecord(RecordMetadata metadata,MemoryPages mem){
  this.mem=mem;
  offsets=new int[metadata.getColumnCount()];
  DirectCharSequence[] csA=null;
  DirectCharSequence[] csB=null;
  int varColIndex=0;
  for (int i=0; i < offsets.length; i++) {
    int ct=metadata.getColumnQuick(i).getType();
    int size=ColumnType.sizeOf(ct);
    if (size != 0) {
      offsets[i]=fixedSize;
      fixedSize+=size;
    }
 else {
      offsets[i]=-(varColIndex++);
      if (csA == null) {
        csA=new DirectCharSequence[offsets.length];
        csB=new DirectCharSequence[offsets.length];
      }
      csA[i]=new DirectCharSequence();
      csB[i]=new DirectCharSequence();
    }
  }
  this.csA=csA;
  this.csB=csB;
  fixedSize=((fixedSize + 7) >> 3) << 3;
  headerSize=varColIndex * 8;
}
Program: 31060
Project: 31060
Buggy source:
@Override public IntList newInstance(){
  return new IntList();
}

Fixed version (ground truth):
@Override public ObjList<RecordColumnMetadata> newInstance(){
  return new ObjList<>();
}
Program: 31061
Project: 31061
Buggy source:
public static int compare(CharSequence l,CharSequence r){
  if (l == r) {
    return 0;
  }
  if (l == null) {
    return -1;
  }
  if (r == null) {
    return 1;
  }
  int ll=l.length();
  int rl=r.length();
  if (ll < rl) {
    return -1;
  }
  if (ll > rl) {
    return 1;
  }
  for (int i=0, n=ll < rl ? ll : rl; i < n; i++) {
    int k=l.charAt(i) - r.charAt(i);
    if (k != 0) {
      return k;
    }
  }
  return 0;
}

Fixed version (ground truth):
public static int compare(CharSequence l,CharSequence r){
  if (l == r) {
    return 0;
  }
  if (l == null) {
    return -1;
  }
  if (r == null) {
    return 1;
  }
  int ll=l.length();
  int rl=r.length();
  for (int i=0, n=ll < rl ? ll : rl; i < n; i++) {
    int k=l.charAt(i) - r.charAt(i);
    if (k != 0) {
      return k;
    }
  }
  if (ll < rl) {
    return -1;
  }
  if (ll > rl) {
    return 1;
  }
  return 0;
}
Program: 31062
Project: 31062
Buggy source:
@Override public CharSequence getFlyweightStrB(int col){
  long readAddress=addressOf(col);
  final int len=Unsafe.getUnsafe().getInt(readAddress);
  if (len < 0)   return null;
  return csB.of(readAddress + 4,readAddress + 4 + len * 2);
}

Fixed version (ground truth):
@Override public CharSequence getFlyweightStrB(int col){
  long readAddress=addressOf(col);
  final int len=Unsafe.getUnsafe().getInt(readAddress);
  if (len < 0)   return null;
  return Unsafe.arrayGet(csB,col).of(readAddress + 4,readAddress + 4 + len * 2);
}
Program: 31063
Project: 31063
Buggy source:
@Override public CharSequence getFlyweightStr(int col){
  long readAddress=addressOf(col);
  final int len=Unsafe.getUnsafe().getInt(readAddress);
  if (len < 0)   return null;
  return csA.of(readAddress + 4,readAddress + 4 + len * 2);
}

Fixed version (ground truth):
@Override public CharSequence getFlyweightStr(int col){
  long readAddress=addressOf(col);
  final int len=Unsafe.getUnsafe().getInt(readAddress);
  if (len < 0)   return null;
  return Unsafe.arrayGet(csA,col).of(readAddress + 4,readAddress + 4 + len * 2);
}
Program: 31064
Project: 31064
Buggy source:
public RecordListRecord(RecordMetadata metadata,MemoryPages mem){
  this.mem=mem;
  offsets=new int[metadata.getColumnCount()];
  int varColIndex=0;
  for (int i=0; i < offsets.length; i++) {
    int ct=metadata.getColumnQuick(i).getType();
    int size=ColumnType.sizeOf(ct);
    if (size != 0) {
      offsets[i]=fixedSize;
      fixedSize+=size;
    }
 else {
      offsets[i]=-(varColIndex++);
    }
  }
  fixedSize=((fixedSize + 7) >> 3) << 3;
  headerSize=varColIndex * 8;
}

Fixed version (ground truth):
public RecordListRecord(RecordMetadata metadata,MemoryPages mem){
  this.mem=mem;
  offsets=new int[metadata.getColumnCount()];
  csA=new DirectCharSequence[offsets.length];
  csB=new DirectCharSequence[offsets.length];
  int varColIndex=0;
  for (int i=0; i < offsets.length; i++) {
    int ct=metadata.getColumnQuick(i).getType();
    int size=ColumnType.sizeOf(ct);
    if (size != 0) {
      offsets[i]=fixedSize;
      fixedSize+=size;
    }
 else {
      offsets[i]=-(varColIndex++);
      csA[i]=new DirectCharSequence();
      csB[i]=new DirectCharSequence();
    }
  }
  fixedSize=((fixedSize + 7) >> 3) << 3;
  headerSize=varColIndex * 8;
}
Program: 31065
Project: 31065
Buggy source:
public AggregatedRecordSource(RecordSource recordSource,@Transient ObjHashSet<String> keyColumns,ObjList<AggregatorFunction> aggregators,int pageSize,RecordKeyCopierCompiler compiler){
  int keyColumnsSize=keyColumns.size();
  IntList keyIndices=new IntList(keyColumnsSize);
  this.aggregators=aggregators;
  RecordMetadata rm=recordSource.getMetadata();
  for (int i=0; i < keyColumnsSize; i++) {
    keyIndices.add(rm.getColumnIndex(keyColumns.get(i)));
  }
  this.copier=compiler.compile(rm,keyIndices);
  ObjList<MapRecordValueInterceptor> interceptors=null;
  ObjList<RecordColumnMetadata> columns=AggregationUtils.TL_COLUMNS.get();
  columns.clear();
  int index=0;
  for (int i=0, sz=aggregators.size(); i < sz; i++) {
    AggregatorFunction func=aggregators.getQuick(i);
    int n=columns.size();
    func.prepare(columns,index);
    index+=columns.size() - n;
    if (func instanceof MapRecordValueInterceptor) {
      if (interceptors == null) {
        interceptors=new ObjList<>();
      }
      interceptors.add((MapRecordValueInterceptor)func);
    }
  }
  this.interceptors=interceptors;
  this.metadata=new DirectMapMetadata(rm,keyColumns,columns);
  this.storageFacade=new DirectMapStorageFacade(columns.size(),keyIndices);
  this.map=new DirectMap(pageSize,keyColumnsSize,AggregationUtils.toThreadLocalTypes(columns));
  this.recordSource=recordSource;
  this.record=new DirectMapRecord(storageFacade);
}

Fixed version (ground truth):
public AggregatedRecordSource(RecordSource recordSource,@Transient ObjHashSet<String> keyColumns,ObjList<AggregatorFunction> aggregators,int pageSize,RecordKeyCopierCompiler compiler){
  int keyColumnsSize=keyColumns.size();
  IntList keyIndices=new IntList(keyColumnsSize);
  this.aggregators=aggregators;
  RecordMetadata rm=recordSource.getMetadata();
  for (int i=0; i < keyColumnsSize; i++) {
    keyIndices.add(rm.getColumnIndex(keyColumns.get(i)));
  }
  this.copier=compiler.compile(rm,keyIndices);
  ObjList<MapRecordValueInterceptor> interceptors=null;
  ObjList<RecordColumnMetadata> columns=AggregationUtils.TL_COLUMNS.get();
  columns.clear();
  int index=0;
  for (int i=0, sz=aggregators.size(); i < sz; i++) {
    AggregatorFunction func=aggregators.getQuick(i);
    int n=columns.size();
    func.prepare(columns,index);
    index+=columns.size() - n;
    if (func instanceof MapRecordValueInterceptor) {
      if (interceptors == null) {
        interceptors=new ObjList<>();
      }
      interceptors.add((MapRecordValueInterceptor)func);
    }
  }
  this.interceptors=interceptors;
  this.metadata=new DirectMapMetadata(rm,keyColumns,columns);
  this.storageFacade=new DirectMapStorageFacade(columns.size(),keyIndices);
  this.map=new DirectMap(pageSize,tlMetadataTypeResolver.get().of(rm,keyIndices),tlVirtualColumnTypeResolver.get().of(columns));
  this.recordSource=recordSource;
  this.record=new DirectMapRecord(storageFacade);
}
Program: 31067
Project: 31067
Buggy source:
public AbstractOrderedAnalyticFunction(int pageSize,VirtualColumn valueColumn){
  this.map=new DirectMap(pageSize,1,MapUtils.ROWID_MAP_VALUES);
  this.valueColumn=valueColumn;
}

Fixed version (ground truth):
public AbstractOrderedAnalyticFunction(int pageSize,VirtualColumn valueColumn){
  this.map=new DirectMap(pageSize,LongResolver.INSTANCE,LongResolver.INSTANCE);
  this.valueColumn=valueColumn;
}
Program: 31068
Project: 31068
Buggy source:
public AbstractRankOrderedAnalyticFunction(int pageSize,String name){
  super(name);
  this.map=new DirectMap(pageSize,1,MapUtils.ROWID_MAP_VALUES);
}

Fixed version (ground truth):
public AbstractRankOrderedAnalyticFunction(int pageSize,String name){
  super(name);
  this.map=new DirectMap(pageSize,LongResolver.INSTANCE,LongResolver.INSTANCE);
}
Program: 31069
Project: 31069
Buggy source:
public DenseRankOPAnalyticFunction(int pageSize,String name,ObjList<VirtualColumn> partitionBy){
  super(pageSize,name);
  this.partitionMap=new DirectMap(pageSize,1,MapUtils.ROWID_MAP_VALUES);
  this.partitionBy=partitionBy;
}

Fixed version (ground truth):
public DenseRankOPAnalyticFunction(int pageSize,String name,ObjList<VirtualColumn> partitionBy){
  super(pageSize,name);
  this.partitionMap=new DirectMap(pageSize,tlPartitionByTypeResolver.get().of(partitionBy),LongResolver.INSTANCE);
  this.partitionBy=partitionBy;
}
Program: 31070
Project: 31070
Buggy source:
public DenseRankPartitionedAnalyticFunction(int pageSize,String name,ObjList<VirtualColumn> partitionBy){
  super(name);
  this.partitionBy=partitionBy;
  this.map=new DirectMap(pageSize,partitionBy.size(),MapUtils.toTypeList(ColumnType.LONG));
}

Fixed version (ground truth):
public DenseRankPartitionedAnalyticFunction(int pageSize,String name,ObjList<VirtualColumn> partitionBy){
  super(name);
  this.partitionBy=partitionBy;
  this.map=new DirectMap(pageSize,tlPartitionByTypeResolver.get().of(partitionBy),LongResolver.INSTANCE);
}
Program: 31071
Project: 31071
Buggy source:
public NextOrderedPartitionedAnalyticFunction(int pageSize,ObjList<VirtualColumn> partitionBy,VirtualColumn valueColumn){
  super(pageSize,valueColumn);
  this.prevMap=new DirectMap(pageSize,1,MapUtils.ROWID_MAP_VALUES);
  this.partitionBy=partitionBy;
}

Fixed version (ground truth):
public NextOrderedPartitionedAnalyticFunction(int pageSize,ObjList<VirtualColumn> partitionBy,VirtualColumn valueColumn){
  super(pageSize,valueColumn);
  this.prevMap=new DirectMap(pageSize,tlPartitionByTypeResolver.get().of(partitionBy),LongResolver.INSTANCE);
  this.partitionBy=partitionBy;
}
Program: 31072
Project: 31072
Buggy source:
public NextPartitionedAnalyticFunction(int pageSize,ObjList<VirtualColumn> partitionBy,VirtualColumn valueColumn){
  super(pageSize,valueColumn);
  this.partitionBy=partitionBy;
  this.map=new DirectMap(pageSize,partitionBy.size(),MapUtils.toTypeList(ColumnType.LONG));
}

Fixed version (ground truth):
public NextPartitionedAnalyticFunction(int pageSize,ObjList<VirtualColumn> partitionBy,VirtualColumn valueColumn){
  super(pageSize,valueColumn);
  this.partitionBy=partitionBy;
  this.map=new DirectMap(pageSize,tlPartitionByTypeResolver.get().of(partitionBy),LongResolver.INSTANCE);
}
Program: 31073
Project: 31073
Buggy source:
public PrevOrderedPartitionedAnalyticFunction(int pageSize,ObjList<VirtualColumn> partitionBy,VirtualColumn valueColumn){
  super(pageSize,valueColumn);
  this.prevMap=new DirectMap(pageSize,1,MapUtils.ROWID_MAP_VALUES);
  this.partitionBy=partitionBy;
}

Fixed version (ground truth):
public PrevOrderedPartitionedAnalyticFunction(int pageSize,ObjList<VirtualColumn> partitionBy,VirtualColumn valueColumn){
  super(pageSize,valueColumn);
  this.prevMap=new DirectMap(pageSize,tlPartitionByTypeResolver.get().of(partitionBy),LongResolver.INSTANCE);
  this.partitionBy=partitionBy;
}
Program: 31074
Project: 31074
Buggy source:
public PrevPartitionedAnalyticFunction(int pageSize,ObjList<VirtualColumn> partitionBy,VirtualColumn valueColumn){
  super(valueColumn);
  this.partitionBy=partitionBy;
  this.map=new DirectMap(pageSize,partitionBy.size(),MapUtils.toTypeList(valueColumn.getType()));
}

Fixed version (ground truth):
public PrevPartitionedAnalyticFunction(int pageSize,ObjList<VirtualColumn> partitionBy,VirtualColumn valueColumn){
  super(valueColumn);
  this.partitionBy=partitionBy;
  this.map=new DirectMap(pageSize,tlPartitionByTypeResolver.get().of(partitionBy),tlVirtualColumnResolver.get().of(valueColumn));
}
Program: 31075
Project: 31075
Buggy source:
public PrevStrPartitionedAnalyticFunction(int pageSize,ObjList<VirtualColumn> partitionBy,VirtualColumn valueColumn){
  this.partitionBy=partitionBy;
  this.valueColumn=valueColumn;
  this.map=new DirectMap(pageSize,partitionBy.size(),MapUtils.toTypeList(ColumnType.LONG,ColumnType.BYTE));
}

Fixed version (ground truth):
public PrevStrPartitionedAnalyticFunction(int pageSize,ObjList<VirtualColumn> partitionBy,VirtualColumn valueColumn){
  this.partitionBy=partitionBy;
  this.valueColumn=valueColumn;
  this.map=new DirectMap(pageSize,tlPartitionByTypeResolver.get().of(partitionBy),LongByteResolver.INSTANCE);
}
Program: 31076
Project: 31076
Buggy source:
@Test public void testClientWithoutAuthProvider() throws Exception {
  JournalServer server=new JournalServer(new ServerConfig(){
{
      setHeartbeatFrequency(TimeUnit.MILLISECONDS.toMillis(500));
      setEnableMultiCast(false);
    }
  }
,factory,new AuthorizationHandler(){
    @Override public boolean isAuthorized(    byte[] token,    ObjList<JournalKey> requestedKeys){
      return "String_Node_Str".equals(new String(token));
    }
  }
);
  server.start();
  try {
    final CountDownLatch error=new CountDownLatch(1);
    JournalClient client=new JournalClient(local,factory,null,new JournalClient.Callback(){
      @Override public void onEvent(      int evt){
        if (evt == JournalClient.EVT_AUTH_CONFIG_ERROR) {
          error.countDown();
        }
      }
    }
);
    client.start();
    Assert.assertTrue(error.await(5,TimeUnit.SECONDS));
    Assert.assertFalse(client.isRunning());
  }
  finally {
    server.halt();
  }
}

Fixed version (ground truth):
@Test public void testClientWithoutAuthProvider() throws Exception {
  JournalServer server=new JournalServer(new ServerConfig(){
{
      setHeartbeatFrequency(TimeUnit.MILLISECONDS.toMillis(500));
      setEnableMultiCast(false);
    }
  }
,factory,new AuthorizationHandler(){
    @Override public boolean isAuthorized(    byte[] token,    ObjList<JournalKey> requestedKeys){
      return "String_Node_Str".equals(new String(token));
    }
  }
);
  server.start();
  try {
    final AtomicInteger authErrors=new AtomicInteger();
    final CountDownLatch error=new CountDownLatch(1);
    JournalClient client=new JournalClient(local,factory,null,new JournalClient.Callback(){
      @Override public void onEvent(      int evt){
switch (evt) {
case JournalClient.EVT_AUTH_CONFIG_ERROR:
          authErrors.incrementAndGet();
        break;
case JournalClient.EVT_TERMINATED:
      error.countDown();
    break;
default :
  break;
}
}
}
);
client.start();
Assert.assertTrue(error.await(5,TimeUnit.SECONDS));
Assert.assertFalse(client.isRunning());
}
  finally {
server.halt();
}
}
Program: 31077
Project: 31077
Buggy source:
public Journal(JournalMetadata<T> metadata,JournalKey<T> key) throws JournalException {
  this.metadata=metadata;
  this.key=key;
  this.location=new File(metadata.getLocation());
  this.txLog=new TxLog(location,getMode(),metadata.getTxCountHint());
  this.open=true;
  this.timestampOffset=getMetadata().getTimestampMetadata() == null ? -1 : getMetadata().getTimestampMetadata().offset;
  this.inactiveColumns=new BitSet(metadata.getColumnCount());
  configure();
}

Fixed version (ground truth):
public Journal(JournalMetadata<T> metadata,JournalKey<T> key) throws JournalException {
  this.metadata=metadata;
  this.key=key;
  this.location=new File(metadata.getLocation());
  this.txLog=new TxLog(location,getMode(),metadata.getTxCountHint());
  this.open=true;
  this.timestampOffset=getMetadata().getTimestampMetadata() == null ? -1 : getMetadata().getTimestampMetadata().offset;
  this.inactiveColumns=new BitSet(metadata.getColumnCount());
  this.openFileTtl=metadata.getOpenFileTTL();
  this.expireRecheckInterval=(long)(this.openFileTtl * 0.1);
  configure();
}
Program: 31078
Project: 31078
Buggy source:
public void refresh(){
  for (int i=0, sz=journalList.size(); i < sz; i++) {
    journalList.get(i).refresh();
  }
}

Fixed version (ground truth):
public void refresh(){
  for (int i=0, sz=journalList.size(); i < sz; i++) {
    journalList.getQuick(i).refresh();
  }
}
Program: 31079
Project: 31079
Buggy source:
@Override public void close(){
  if (pool != null) {
    if (!inPool) {
      inPool=true;
      pool.release(this);
    }
  }
 else {
    if (closed.compareAndSet(false,true)) {
      for (int i=0, sz=journalList.size(); i < sz; i++) {
        Journal journal=journalList.get(i);
        journal.setCloseListener(null);
        if (journal.isOpen()) {
          journal.close();
        }
      }
      readers.clear();
      bulkReaders.clear();
    }
  }
}

Fixed version (ground truth):
@Override public void close(){
  if (pool != null) {
    if (!inPool) {
      inPool=true;
      pool.release(this);
    }
  }
 else {
    if (closed.compareAndSet(false,true)) {
      for (int i=0, sz=journalList.size(); i < sz; i++) {
        Journal journal=journalList.getQuick(i);
        journal.setCloseListener(null);
        if (journal.isOpen()) {
          journal.close();
        }
      }
      readers.clear();
      bulkReaders.clear();
    }
  }
}
Program: 31080
Project: 31080
Buggy source:
void expireOpenFiles(){
  for (int i=0, sz=journalList.size(); i < sz; i++) {
    journalList.get(i).expireOpenFiles();
  }
}

Fixed version (ground truth):
void expireOpenFiles(){
  for (int i=0, sz=journalList.size(); i < sz; i++) {
    journalList.getQuick(i).expireOpenFiles0();
  }
}
Program: 31082
Project: 31082
Buggy source:
public void configure(long txn,long txPin) throws JournalException {
  String loc=journal.getKey().getId();
  LOG.debug().$("String_Node_Str").$(loc).$("String_Node_Str").$(txn).$("String_Node_Str").$(txPin).$('}').$();
  journalServerState.reset();
  journal.refresh();
  long thisTxn=journal.getTxn();
  long thisTxnPin=journal.getTxPin();
  if (thisTxn < txn) {
    LOG.info().$("String_Node_Str").$(loc).$("String_Node_Str").$("String_Node_Str").$(txn).$("String_Node_Str").$(txPin).$('}').$();
    journalServerState.setTxn(-1);
  }
 else   if (thisTxn == txn) {
    if (thisTxnPin != txPin) {
      LOG.info().$("String_Node_Str").$(loc).$("String_Node_Str").$("String_Node_Str").$(txn).$("String_Node_Str").$(txPin).$('}').$();
      journalServerState.setTxn(-1);
    }
  }
 else   if (thisTxn > txn) {
    Tx tx=journal.find(txn,txPin);
    if (tx == null) {
      LOG.info().$("String_Node_Str").$(loc).$("String_Node_Str").$("String_Node_Str").$(txn).$("String_Node_Str").$(txPin).$('}').$();
      journalServerState.setTxn(-1);
    }
 else {
      journalServerState.setTxn(thisTxn);
      journalServerState.setTxPin(thisTxnPin);
      configure0(tx);
    }
  }
}

Fixed version (ground truth):
public void configure(long txn,long txPin) throws JournalException {
  journalServerState.reset();
  journal.refresh();
  long thisTxn=journal.getTxn();
  long thisTxnPin=journal.getTxPin();
  if (thisTxn < txn) {
    LOG.info().$("String_Node_Str").$(journal.getKey().path()).$("String_Node_Str").$("String_Node_Str").$(txn).$("String_Node_Str").$(txPin).$('}').$();
    journalServerState.setTxn(-1);
  }
 else   if (thisTxn == txn) {
    if (thisTxnPin != txPin) {
      LOG.info().$("String_Node_Str").$(journal.getKey().path()).$("String_Node_Str").$("String_Node_Str").$(txn).$("String_Node_Str").$(txPin).$('}').$();
      journalServerState.setTxn(-1);
    }
  }
 else   if (thisTxn > txn) {
    Tx tx=journal.find(txn,txPin);
    if (tx == null) {
      LOG.info().$("String_Node_Str").$(journal.getKey().path()).$("String_Node_Str").$("String_Node_Str").$(txn).$("String_Node_Str").$(txPin).$('}').$();
      journalServerState.setTxn(-1);
    }
 else {
      journalServerState.setTxn(thisTxn);
      journalServerState.setTxPin(thisTxnPin);
      configure0(tx);
    }
  }
}
Program: 31083
Project: 31083
Buggy source:
@Override public void write(WritableByteChannel channel) throws JournalNetworkException {
  journalServerStateProducer.write(channel,journalServerState);
  if (journalSymbolTableProducer.hasContent()) {
    journalSymbolTableProducer.write(channel);
  }
  for (int i=0, sz=partitionDeltaProducers.size(); i < sz; i++) {
    partitionDeltaProducers.getQuick(i).write(channel);
  }
  if (lagPartitionDeltaProducer != null && lagPartitionDeltaProducer.hasContent()) {
    lagPartitionDeltaProducer.write(channel);
  }
  journalServerState.reset();
  journal.expireOpenFiles();
}

Fixed version (ground truth):
@Override public void write(WritableByteChannel channel) throws JournalNetworkException {
  journalServerStateProducer.write(channel,journalServerState);
  if (journalSymbolTableProducer.hasContent()) {
    journalSymbolTableProducer.write(channel);
  }
  for (int i=0, sz=partitionDeltaProducers.size(); i < sz; i++) {
    partitionDeltaProducers.getQuick(i).write(channel);
  }
  if (lagPartitionDeltaProducer != null && lagPartitionDeltaProducer.hasContent()) {
    lagPartitionDeltaProducer.write(channel);
  }
  journalServerState.reset();
  journal.expireOpenFiles0();
}
Program: 31084
Project: 31084
Buggy source:
@Test public void testRecovery() throws Exception {
  long ts;
  try (JournalWriter<Quote> w=factory.writer(Quote.class)){
    w.setCommitOnClose(false);
    Assert.assertFalse(w.isCommitOnClose());
    TestUtils.generateQuoteData(w,10000,new Interval("String_Node_Str","String_Node_Str"));
    ts=w.getMaxTimestamp();
    TestUtils.generateQuoteData(w,10000,new Interval("String_Node_Str","String_Node_Str"),false);
    Assert.assertTrue(w.getMaxTimestamp() > ts);
  }
   try (Journal<Quote> w=factory.reader(Quote.class)){
    Assert.assertEquals(ts,w.getMaxTimestamp());
    Assert.assertEquals(10000,w.size());
  }
   try (JournalWriter<Quote> w=factory.writer(Quote.class)){
    w.setCommitOnClose(false);
    Assert.assertEquals(ts,w.getMaxTimestamp());
    Assert.assertEquals(10000,w.size());
  }
 }

Fixed version (ground truth):
@Test public void testRecovery() throws Exception {
  long ts;
  try (JournalWriter<Quote> w=factory.writer(Quote.class)){
    w.disableCommitOnClose();
    Assert.assertFalse(w.isCommitOnClose());
    TestUtils.generateQuoteData(w,10000,new Interval("String_Node_Str","String_Node_Str"));
    ts=w.getMaxTimestamp();
    TestUtils.generateQuoteData(w,10000,new Interval("String_Node_Str","String_Node_Str"),false);
    Assert.assertTrue(w.getMaxTimestamp() > ts);
  }
   try (Journal<Quote> w=factory.reader(Quote.class)){
    Assert.assertEquals(ts,w.getMaxTimestamp());
    Assert.assertEquals(10000,w.size());
  }
   try (JournalWriter<Quote> w=factory.writer(Quote.class)){
    w.disableCommitOnClose();
    Assert.assertEquals(ts,w.getMaxTimestamp());
    Assert.assertEquals(10000,w.size());
  }
 }
Program: 31085
Project: 31085
Buggy source:
@Test public void testLagRecovery() throws Exception {
  JournalWriter<Quote> origin=factory.writer(Quote.class,"String_Node_Str");
  TestUtils.generateQuoteData(origin,100000,new Interval("String_Node_Str","String_Node_Str"));
  try (Journal<Quote> r=factory.reader(Quote.class,"String_Node_Str")){
    Assert.assertEquals(100000,r.size());
  }
   long ts;
  try (JournalWriter<Quote> w=factory.writer(Quote.class)){
    w.setCommitOnClose(false);
    w.append(origin.query().all().asResultSet().subset(0,15000));
    w.mergeAppend(origin.query().all().asResultSet().subset(15000,17000));
    w.commit();
    ts=w.getMaxTimestamp();
    w.mergeAppend(origin.query().all().asResultSet().subset(16000,27000));
    w.mergeAppend(origin.query().all().asResultSet().subset(23000,37000));
    Assert.assertTrue(ts < w.getMaxTimestamp());
    Assert.assertEquals(37672,w.size());
  }
   try (Journal<Quote> w=factory.reader(Quote.class)){
    Assert.assertEquals(ts,w.getMaxTimestamp());
    Assert.assertEquals(17000,w.size());
  }
   try (JournalWriter<Quote> w=factory.writer(Quote.class)){
    Assert.assertEquals(ts,w.getMaxTimestamp());
    Assert.assertEquals(17000,w.size());
  }
 }

Fixed version (ground truth):
@Test public void testLagRecovery() throws Exception {
  JournalWriter<Quote> origin=factory.writer(Quote.class,"String_Node_Str");
  TestUtils.generateQuoteData(origin,100000,new Interval("String_Node_Str","String_Node_Str"));
  try (Journal<Quote> r=factory.reader(Quote.class,"String_Node_Str")){
    Assert.assertEquals(100000,r.size());
  }
   long ts;
  try (JournalWriter<Quote> w=factory.writer(Quote.class)){
    w.disableCommitOnClose();
    w.append(origin.query().all().asResultSet().subset(0,15000));
    w.mergeAppend(origin.query().all().asResultSet().subset(15000,17000));
    w.commit();
    ts=w.getMaxTimestamp();
    w.mergeAppend(origin.query().all().asResultSet().subset(16000,27000));
    w.mergeAppend(origin.query().all().asResultSet().subset(23000,37000));
    Assert.assertTrue(ts < w.getMaxTimestamp());
    Assert.assertEquals(37672,w.size());
  }
   try (Journal<Quote> w=factory.reader(Quote.class)){
    Assert.assertEquals(ts,w.getMaxTimestamp());
    Assert.assertEquals(17000,w.size());
  }
   try (JournalWriter<Quote> w=factory.writer(Quote.class)){
    Assert.assertEquals(ts,w.getMaxTimestamp());
    Assert.assertEquals(17000,w.size());
  }
 }
Program: 31086
Project: 31086
Buggy source:
private boolean analyzeNotListOfValues(String column,RecordMetadata m,ExprNode node){
  RecordColumnMetadata meta=m.getColumn(column);
switch (meta.getType()) {
case ColumnType.SYMBOL:
case ColumnType.STRING:
case ColumnType.LONG:
case ColumnType.INT:
    if (meta.isIndexed() && (preferredKeyColumn == null || preferredKeyColumn.equals(column))) {
      keyExclNodes.add(node);
    }
  break;
default :
break;
}
return false;
}

Fixed version (ground truth):
private boolean analyzeNotListOfValues(String column,RecordMetadata m,ExprNode notNode){
  RecordColumnMetadata meta=m.getColumn(column);
switch (meta.getType()) {
case ColumnType.SYMBOL:
case ColumnType.STRING:
case ColumnType.LONG:
case ColumnType.INT:
    if (meta.isIndexed() && (preferredKeyColumn == null || preferredKeyColumn.equals(column))) {
      keyExclNodes.add(notNode);
    }
  break;
default :
break;
}
return false;
}
Program: 31087
Project: 31087
Buggy source:
private boolean analyzeNotIn(AliasTranslator translator,IntrinsicModel model,ExprNode notNode,RecordMetadata m) throws ParserException {
  ExprNode node=notNode.rhs;
  if (node.paramCount < 2) {
    throw QueryError.$(node.position,"String_Node_Str");
  }
  ExprNode col=node.paramCount < 3 ? node.lhs : node.args.getLast();
  if (col.type != ExprNode.LITERAL) {
    throw QueryError.$(col.position,"String_Node_Str");
  }
  String column=translator.translateAlias(col.token).toString();
  if (m.getColumnIndexQuiet(column) == -1) {
    throw QueryError.invalidColumn(col.position,col.token);
  }
  boolean ok=analyzeNotInInterval(model,col,node) || analyzeNotListOfValues(column,m,node);
  if (ok) {
    notNode.intrinsicValue=IntrinsicValue.TRUE;
  }
  return ok;
}

Fixed version (ground truth):
private boolean analyzeNotIn(AliasTranslator translator,IntrinsicModel model,ExprNode notNode,RecordMetadata m) throws ParserException {
  ExprNode node=notNode.rhs;
  if (node.paramCount < 2) {
    throw QueryError.$(node.position,"String_Node_Str");
  }
  ExprNode col=node.paramCount < 3 ? node.lhs : node.args.getLast();
  if (col.type != ExprNode.LITERAL) {
    throw QueryError.$(col.position,"String_Node_Str");
  }
  String column=translator.translateAlias(col.token).toString();
  if (m.getColumnIndexQuiet(column) == -1) {
    throw QueryError.invalidColumn(col.position,col.token);
  }
  boolean ok=analyzeNotInInterval(model,col,node) || analyzeNotListOfValues(column,m,notNode);
  if (ok) {
    notNode.intrinsicValue=IntrinsicValue.TRUE;
  }
  return ok;
}
Program: 31088
Project: 31088
Buggy source:
private void applyKeyExclusions(AliasTranslator translator,IntrinsicModel model){
  if (model.keyColumn != null && keyExclNodes.size() > 0) {
    for (int i=0, n=keyExclNodes.size(); i < n; i++) {
      ExprNode node=keyExclNodes.getQuick(i);
      ExprNode col;
      ExprNode val;
      if (node.lhs.type == ExprNode.LITERAL) {
        col=node.lhs;
        val=node.rhs;
      }
 else {
        col=node.rhs;
        val=node.lhs;
      }
      final String column=translator.translateAlias(col.token).toString();
      if (column.equals(model.keyColumn)) {
        String value=Chars.equals("String_Node_Str",val.token) ? null : Chars.stripQuotes(val.token);
        int index=model.keyValues.remove(value);
        if (index > -1) {
          model.keyValuePositions.removeIndex(index);
        }
        node.intrinsicValue=IntrinsicValue.TRUE;
        if (model.keyValues.size() == 0) {
          model.intrinsicValue=IntrinsicValue.FALSE;
          break;
        }
      }
    }
  }
  keyExclNodes.clear();
}

Fixed version (ground truth):
private void applyKeyExclusions(AliasTranslator translator,IntrinsicModel model){
  if (model.keyColumn != null && keyExclNodes.size() > 0) {
    OUT:     for (int i=0, n=keyExclNodes.size(); i < n; i++) {
      ExprNode parent=keyExclNodes.getQuick(i);
      ExprNode node="String_Node_Str".equals(parent.token) ? parent.rhs : parent;
      if (node.paramCount == 2) {
        ExprNode col;
        ExprNode val;
        if (node.lhs.type == ExprNode.LITERAL) {
          col=node.lhs;
          val=node.rhs;
        }
 else {
          col=node.rhs;
          val=node.lhs;
        }
        final String column=translator.translateAlias(col.token).toString();
        if (column.equals(model.keyColumn)) {
          model.excludeValue(val);
          parent.intrinsicValue=IntrinsicValue.TRUE;
          if (model.intrinsicValue == IntrinsicValue.FALSE) {
            break;
          }
        }
      }
      if (node.paramCount > 2) {
        ExprNode col=node.args.getQuick(node.paramCount - 1);
        final String column=translator.translateAlias(col.token).toString();
        if (column.equals(model.keyColumn)) {
          for (int j=node.paramCount - 2; j > -1; j--) {
            ExprNode val=node.args.getQuick(j);
            model.excludeValue(val);
            if (model.intrinsicValue == IntrinsicValue.FALSE) {
              break OUT;
            }
          }
          parent.intrinsicValue=IntrinsicValue.TRUE;
        }
      }
    }
  }
  keyExclNodes.clear();
}
Program: 31089
Project: 31089
Buggy source:
private boolean analyzeNotEquals(IntrinsicModel model,ExprNode node) throws ParserException {
  checkNodeValid(node);
  if (Chars.equals(node.lhs.token,node.rhs.token)) {
    model.intrinsicValue=IntrinsicValue.FALSE;
  }
  ExprNode a=node.lhs;
  ExprNode b=node.rhs;
  if (a.type == ExprNode.LITERAL && b.type == ExprNode.CONSTANT && isTimestamp(a)) {
    CharSequence seq=quoteEraser.ofQuoted(b.token);
    model.subtractIntervals(seq,0,seq.length(),b.position);
    node.intrinsicValue=IntrinsicValue.TRUE;
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean analyzeNotEquals(AliasTranslator translator,IntrinsicModel model,ExprNode node,RecordMetadata m) throws ParserException {
  checkNodeValid(node);
  return analyzeNotEquals0(translator,model,node,node.lhs,node.rhs,m) || analyzeNotEquals0(translator,model,node,node.rhs,node.lhs,m);
}
Program: 31090
Project: 31090
Buggy source:
private boolean removeAndIntrinsics(AliasTranslator translator,IntrinsicModel model,ExprNode node,RecordMetadata m) throws ParserException {
switch (node.token) {
case "String_Node_Str":
    return analyzeIn(translator,model,node,m);
case "String_Node_Str":
  return analyzeGreater(model,node,1);
case "String_Node_Str":
return analyzeGreater(model,node,0);
case "String_Node_Str":
return analyzeLess(model,node,1);
case "String_Node_Str":
return analyzeLess(model,node,0);
case "String_Node_Str":
return analyzeEquals(translator,model,node,m);
case "String_Node_Str":
return analyzeNotEquals(model,node);
default :
return false;
}
}

Fixed version (ground truth):
private boolean removeAndIntrinsics(AliasTranslator translator,IntrinsicModel model,ExprNode node,RecordMetadata m) throws ParserException {
switch (node.token) {
case "String_Node_Str":
    return analyzeIn(translator,model,node,m);
case "String_Node_Str":
  return analyzeGreater(model,node,1);
case "String_Node_Str":
return analyzeGreater(model,node,0);
case "String_Node_Str":
return analyzeLess(model,node,1);
case "String_Node_Str":
return analyzeLess(model,node,0);
case "String_Node_Str":
return analyzeEquals(translator,model,node,m);
case "String_Node_Str":
return analyzeNotEquals(translator,model,node,m);
default :
return false;
}
}