nus-yam/ex-repair huggingface dataset:
Program: 154876
Project: 154876
Buggy source:
@Override protected void rebuildIdGenerator(){
  logger.fine("String_Node_Str" + getStorageFileName() + "String_Node_Str");
  closeIdGenerator();
  File file=new File(getStorageFileName() + "String_Node_Str");
  if (file.exists()) {
    boolean success=file.delete();
    assert success;
  }
  createIdGenerator(getStorageFileName() + "String_Node_Str");
  openIdGenerator();
  FileChannel fileChannel=getFileChannel();
  long highId=-1;
  int recordSize=getRecordSize();
  try {
    long fileSize=fileChannel.size();
    ByteBuffer byteBuffer=ByteBuffer.wrap(new byte[recordSize]);
    for (int i=0; i * recordSize < fileSize; i++) {
      fileChannel.read(byteBuffer,i * recordSize);
      byteBuffer.flip();
      byte inUse=byteBuffer.get();
      byteBuffer.flip();
      if (inUse != Record.IN_USE.byteValue()) {
        byteBuffer.clear();
        byteBuffer.put(Record.IN_USE.byteValue()).putInt(Record.RESERVED.intValue());
        byteBuffer.flip();
        fileChannel.write(byteBuffer,i * recordSize);
        byteBuffer.clear();
      }
 else {
        highId=i;
      }
      nextId();
    }
    highId++;
    fileChannel.truncate(highId * recordSize);
  }
 catch (  IOException e) {
    throw new UnderlyingStorageException("String_Node_Str" + getStorageFileName(),e);
  }
  setHighId(highId);
  logger.fine("String_Node_Str" + getStorageFileName() + "String_Node_Str"+ getHighId());
  closeIdGenerator();
  openIdGenerator();
}

Fixed version (ground truth):
@Override protected void rebuildIdGenerator(){
  logger.fine("String_Node_Str" + getStorageFileName() + "String_Node_Str");
  closeIdGenerator();
  File file=new File(getStorageFileName() + "String_Node_Str");
  if (file.exists()) {
    boolean success=file.delete();
    assert success;
  }
  createIdGenerator(getStorageFileName() + "String_Node_Str");
  openIdGenerator();
  FileChannel fileChannel=getFileChannel();
  long highId=-1;
  int recordSize=getRecordSize();
  try {
    long fileSize=fileChannel.size();
    ByteBuffer byteBuffer=ByteBuffer.wrap(new byte[recordSize]);
    for (int i=0; i * recordSize < fileSize; i++) {
      fileChannel.read(byteBuffer,i * recordSize);
      byteBuffer.flip();
      byte inUse=byteBuffer.get();
      byteBuffer.flip();
      if (inUse != Record.IN_USE.byteValue()) {
        byteBuffer.clear();
        byteBuffer.put(Record.IN_USE.byteValue()).putInt(Record.RESERVED.intValue());
        byteBuffer.flip();
        fileChannel.write(byteBuffer,i * recordSize);
        byteBuffer.clear();
      }
 else {
        highId=i;
      }
    }
    highId++;
    fileChannel.truncate(highId * recordSize);
  }
 catch (  IOException e) {
    throw new UnderlyingStorageException("String_Node_Str" + getStorageFileName(),e);
  }
  setHighId(highId);
  logger.fine("String_Node_Str" + getStorageFileName() + "String_Node_Str"+ getHighId());
  closeIdGenerator();
  openIdGenerator();
}
Program: 154877
Project: 154877
Buggy source:
public synchronized void applyTransactionWithoutTxId(ReadableByteChannel byteChannel,long nextTxId) throws IOException {
  if (nextTxId != (xaTf.getLastCommittedTx() + 1)) {
    throw new IllegalStateException("String_Node_Str" + nextTxId + "String_Node_Str"+ (xaTf.getCurrentVersion() + 1));
  }
  log.fine("String_Node_Str" + logVersion + "String_Node_Str"+ nextTxId+ "String_Node_Str");
  long logEntriesFound=0;
  LogApplier logApplier=new LogApplier(byteChannel);
  int xidIdent=getNextIdentifier();
  while (logApplier.readAndApplyAndWriteEntry(xidIdent)) {
    logEntriesFound++;
  }
  byteChannel.close();
  LogEntry.Start entry=logApplier.startEntry;
  if (entry == null) {
    throw new IOException("String_Node_Str");
  }
  LogEntry.OnePhaseCommit commit=new LogEntry.OnePhaseCommit(entry.getIdentifier(),nextTxId);
  LogIoUtils.writeLogEntry(commit,writeBuffer);
  Xid xid=entry.getXid();
  try {
    XaTransaction xaTx=xaRm.getXaTransaction(xid);
    xaTx.setCommitTxId(nextTxId);
    xaRm.commit(xid,true);
  }
 catch (  XAException e) {
    e.printStackTrace();
    throw new IOException(e.getMessage());
  }
  LogEntry.Done done=new LogEntry.Done(entry.getIdentifier());
  LogIoUtils.writeLogEntry(done,writeBuffer);
  log.info("String_Node_Str" + nextTxId + "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
public synchronized void applyTransactionWithoutTxId(ReadableByteChannel byteChannel,long nextTxId) throws IOException {
  if (nextTxId != (xaTf.getLastCommittedTx() + 1)) {
    throw new IllegalStateException("String_Node_Str" + nextTxId + "String_Node_Str"+ (xaTf.getCurrentVersion() + 1));
  }
  log.fine("String_Node_Str" + logVersion + "String_Node_Str"+ nextTxId+ "String_Node_Str");
  long logEntriesFound=0;
  LogApplier logApplier=new LogApplier(byteChannel);
  int xidIdent=getNextIdentifier();
  while (logApplier.readAndApplyAndWriteEntry(xidIdent)) {
    logEntriesFound++;
  }
  byteChannel.close();
  LogEntry.Start entry=logApplier.startEntry;
  if (entry == null) {
    throw new IOException("String_Node_Str");
  }
  LogEntry.OnePhaseCommit commit=new LogEntry.OnePhaseCommit(entry.getIdentifier(),nextTxId);
  LogIoUtils.writeLogEntry(commit,writeBuffer);
  Xid xid=entry.getXid();
  try {
    XaTransaction xaTx=xaRm.getXaTransaction(xid);
    xaTx.setCommitTxId(nextTxId);
    xaRm.commit(xid,true);
  }
 catch (  XAException e) {
    e.printStackTrace();
    throw new IOException(e.getMessage());
  }
  log.info("String_Node_Str" + nextTxId + "String_Node_Str"+ "String_Node_Str");
}
Program: 154878
Project: 154878
Buggy source:
public DynamicStringStore(String fileName,Map<?,?> config){
  super(fileName,config);
}

Fixed version (ground truth):
public DynamicStringStore(String fileName,Map<?,?> config,IdType idType){
  super(fileName,config);
  this.idType=idType;
}
Program: 154879
Project: 154879
Buggy source:
@Override protected IdType getIdType(){
  return IdType.STRING_BLOCK;
}

Fixed version (ground truth):
@Override protected IdType getIdType(){
  return idType;
}
Program: 154880
Project: 154880
Buggy source:
protected void initStorage(){
  keyPropertyStore=new DynamicStringStore(getStorageFileName() + "String_Node_Str",getConfig());
}

Fixed version (ground truth):
protected void initStorage(){
  keyPropertyStore=new DynamicStringStore(getStorageFileName() + "String_Node_Str",getConfig(),IdType.PROPERTY_INDEX_BLOCK);
}
Program: 154881
Project: 154881
Buggy source:
/** 
 * See   {@link AbstractStore#AbstractStore(String)}
 */
@Override protected void initStorage(){
  stringPropertyStore=new DynamicStringStore(getStorageFileName() + "String_Node_Str",getConfig());
  propertyIndexStore=new PropertyIndexStore(getStorageFileName() + "String_Node_Str",getConfig());
  arrayPropertyStore=new DynamicArrayStore(getStorageFileName() + "String_Node_Str",getConfig());
}

Fixed version (ground truth):
/** 
 * See   {@link AbstractStore#AbstractStore(String)}
 */
@Override protected void initStorage(){
  stringPropertyStore=new DynamicStringStore(getStorageFileName() + "String_Node_Str",getConfig(),IdType.STRING_BLOCK);
  propertyIndexStore=new PropertyIndexStore(getStorageFileName() + "String_Node_Str",getConfig());
  arrayPropertyStore=new DynamicArrayStore(getStorageFileName() + "String_Node_Str",getConfig());
}
Program: 154882
Project: 154882
Buggy source:
@Override protected void initStorage(){
  typeNameStore=new DynamicStringStore(getStorageFileName() + "String_Node_Str",getConfig());
}

Fixed version (ground truth):
@Override protected void initStorage(){
  typeNameStore=new DynamicStringStore(getStorageFileName() + "String_Node_Str",getConfig(),IdType.RELATIONSHIP_TYPE_BLOCK);
}
Program: 154883
Project: 154883
Buggy source:
public synchronized void setLastCommittedTx(long txId){
  long current=getRecord(3);
  if ((current + 1) != txId && !isInRecoveryMode()) {
    throw new InvalidRecordException("String_Node_Str" + txId + "String_Node_Str"+ current+ "String_Node_Str");
  }
  setRecord(3,txId);
  if (isStarted && lastCommittedTxIdSetter != null && txId == getLastCommittedTx() + 1) {
    lastCommittedTxIdSetter.setLastCommittedTxId(txId);
  }
}

Fixed version (ground truth):
public synchronized void setLastCommittedTx(long txId){
  long current=getRecord(3);
  if ((current + 1) != txId && !isInRecoveryMode()) {
    throw new InvalidRecordException("String_Node_Str" + txId + "String_Node_Str"+ current+ "String_Node_Str");
  }
  setRecord(3,txId);
  if (isStarted && lastCommittedTxIdSetter != null) {
    lastCommittedTxIdSetter.setLastCommittedTxId(txId);
  }
}
Program: 154884
Project: 154884
Buggy source:
public synchronized void setLastCommittedTx(long txId){
  long current=getRecord(3);
  if ((current + 1) != txId && !isInRecoveryMode()) {
    throw new InvalidRecordException("String_Node_Str" + txId + "String_Node_Str"+ current+ "String_Node_Str");
  }
  setRecord(3,txId);
  if (lastCommittedTxIdSetter != null) {
    lastCommittedTxIdSetter.setLastCommittedTxId(txId);
  }
}

Fixed version (ground truth):
public synchronized void setLastCommittedTx(long txId){
  long current=getRecord(3);
  if ((current + 1) != txId && !isInRecoveryMode()) {
    throw new InvalidRecordException("String_Node_Str" + txId + "String_Node_Str"+ current+ "String_Node_Str");
  }
  setRecord(3,txId);
  if (lastCommittedTxIdSetter != null && !isInRecoveryMode() && txId == getLastCommittedTx() + 1) {
    lastCommittedTxIdSetter.setLastCommittedTxId(txId);
  }
}
Program: 154885
Project: 154885
Buggy source:
private Pair<String,Integer> getHaServer(int machineId){
  String host=haServers.get(getMyMachineId());
  int pos=host.indexOf("String_Node_Str");
  return new Pair<String,Integer>(host.substring(0,pos),Integer.parseInt(host.substring(pos + 1)));
}

Fixed version (ground truth):
private Pair<String,Integer> getHaServer(int machineId){
  String host=haServers.get(machineId);
  int pos=host.indexOf("String_Node_Str");
  return new Pair<String,Integer>(host.substring(0,pos),Integer.parseInt(host.substring(pos + 1)));
}
Program: 154886
Project: 154886
Buggy source:
public NeoStoreUtil(String storeDir){
  try {
    FileChannel fileChannel=new RandomAccessFile(storeDir + "String_Node_Str","String_Node_Str").getChannel();
    ByteBuffer buf=ByteBuffer.allocate(32);
    if (fileChannel.read(buf) != 32) {
      throw new RuntimeException("String_Node_Str");
    }
    buf.flip();
    creationTime=buf.getLong();
    storeId=buf.getLong();
    buf.getLong();
    txId=buf.getLong();
    fileChannel.close();
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public NeoStoreUtil(String storeDir){
  try {
    FileChannel fileChannel=new RandomAccessFile(storeDir + "String_Node_Str","String_Node_Str").getChannel();
    ByteBuffer buf=ByteBuffer.allocate(4 * 9);
    if (fileChannel.read(buf) != 4 * 9) {
      throw new RuntimeException("String_Node_Str");
    }
    buf.flip();
    buf.get();
    creationTime=buf.getLong();
    buf.get();
    storeId=buf.getLong();
    buf.get();
    buf.getLong();
    buf.get();
    txId=buf.getLong();
    fileChannel.close();
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 154887
Project: 154887
Buggy source:
private String getRoot(){
  String rootPath="String_Node_Str" + storeCreationTime + "String_Node_Str"+ storeId;
  byte[] rootData=null;
  do {
    try {
      rootData=zooKeeper.getData(rootPath,false,null);
      ByteBuffer buf=ByteBuffer.wrap(rootData);
      globalCommittedTx=buf.getLong();
      if (globalCommittedTx < committedTx) {
        throw new IllegalStateException("String_Node_Str" + globalCommittedTx + "String_Node_Str"+ machineId+ "String_Node_Str"+ committedTx);
      }
      return rootPath;
    }
 catch (    KeeperException e) {
      if (e.code() != KeeperException.Code.NONODE) {
        throw new ZooKeeperException("String_Node_Str",e);
      }
    }
catch (    InterruptedException e) {
      Thread.interrupted();
      throw new ZooKeeperException("String_Node_Str",e);
    }
    try {
      byte data[]=new byte[8];
      ByteBuffer buf=ByteBuffer.wrap(data);
      buf.putLong(committedTx);
      zooKeeper.create(rootPath,data,ZooDefs.Ids.OPEN_ACL_UNSAFE,CreateMode.PERSISTENT);
    }
 catch (    KeeperException e) {
      if (e.code() != KeeperException.Code.NODEEXISTS) {
        throw new ZooKeeperException("String_Node_Str",e);
      }
    }
catch (    InterruptedException e) {
      Thread.interrupted();
      throw new ZooKeeperException("String_Node_Str",e);
    }
  }
 while (rootData == null);
  throw new IllegalStateException();
}

Fixed version (ground truth):
private String getRoot(){
  String rootPath="String_Node_Str" + storeCreationTime + "String_Node_Str"+ storeId;
  byte[] rootData=null;
  do {
    try {
      rootData=zooKeeper.getData(rootPath,false,null);
      return rootPath;
    }
 catch (    KeeperException e) {
      if (e.code() != KeeperException.Code.NONODE) {
        throw new ZooKeeperException("String_Node_Str",e);
      }
    }
catch (    InterruptedException e) {
      Thread.interrupted();
      throw new ZooKeeperException("String_Node_Str",e);
    }
    try {
      byte data[]=new byte[0];
      zooKeeper.create(rootPath,data,ZooDefs.Ids.OPEN_ACL_UNSAFE,CreateMode.PERSISTENT);
    }
 catch (    KeeperException e) {
      if (e.code() != KeeperException.Code.NODEEXISTS) {
        throw new ZooKeeperException("String_Node_Str",e);
      }
    }
catch (    InterruptedException e) {
      Thread.interrupted();
      throw new ZooKeeperException("String_Node_Str",e);
    }
  }
 while (rootData == null);
  throw new IllegalStateException();
}
Program: 154888
Project: 154888
Buggy source:
public synchronized int getMaster(){
  try {
    String root=getRoot();
    List<String> children=zooKeeper.getChildren(root,false);
    int currentMasterId=-1;
    int lowestSeq=Integer.MAX_VALUE;
    for (    String child : children) {
      int index=child.indexOf('_');
      int id=Integer.parseInt(child.substring(0,index));
      int seq=Integer.parseInt(child.substring(index + 1));
      try {
        byte[] data=zooKeeper.getData(root + "String_Node_Str" + child,false,null);
        ByteBuffer buf=ByteBuffer.wrap(data);
        long tx=buf.getLong();
        if (tx == globalCommittedTx) {
          if (seq < lowestSeq) {
            currentMasterId=id;
            lowestSeq=seq;
          }
        }
      }
 catch (      KeeperException inner) {
        if (inner.code() != KeeperException.Code.NONODE) {
          throw new ZooKeeperException("String_Node_Str",inner);
        }
      }
    }
    return currentMasterId;
  }
 catch (  KeeperException e) {
    throw new ZooKeeperException("String_Node_Str",e);
  }
catch (  InterruptedException e) {
    Thread.interrupted();
    throw new ZooKeeperException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public synchronized int getMaster(){
  try {
    String root=getRoot();
    List<String> children=zooKeeper.getChildren(root,false);
    int currentMasterId=-1;
    int lowestSeq=Integer.MAX_VALUE;
    long highestTxId=-1;
    for (    String child : children) {
      int index=child.indexOf('_');
      int id=Integer.parseInt(child.substring(0,index));
      int seq=Integer.parseInt(child.substring(index + 1));
      try {
        byte[] data=zooKeeper.getData(root + "String_Node_Str" + child,false,null);
        ByteBuffer buf=ByteBuffer.wrap(data);
        long tx=buf.getLong();
        if (tx > highestTxId) {
          highestTxId=tx;
          if (seq < lowestSeq) {
            currentMasterId=id;
            lowestSeq=seq;
          }
        }
      }
 catch (      KeeperException inner) {
        if (inner.code() != KeeperException.Code.NONODE) {
          throw new ZooKeeperException("String_Node_Str",inner);
        }
      }
    }
    return currentMasterId;
  }
 catch (  KeeperException e) {
    throw new ZooKeeperException("String_Node_Str",e);
  }
catch (  InterruptedException e) {
    Thread.interrupted();
    throw new ZooKeeperException("String_Node_Str",e);
  }
}
Program: 154889
Project: 154889
Buggy source:
public int getMyMachineId(){
  return zooClient.getMaster();
}

Fixed version (ground truth):
public int getMyMachineId(){
  return machineId;
}
Program: 154890
Project: 154890
Buggy source:
public void setHighId(long id){
  this.highestIdInUse=id;
}

Fixed version (ground truth):
public void setHighId(long id){
  this.highestIdInUse=id;
  this.localIdGenerator.setHighId(id);
}
Program: 154891
Project: 154891
Buggy source:
private void updateLocalIdGenerator(){
  long localHighId=this.localIdGenerator.getHighId();
  if (this.highestIdInUse > localHighId) {
    this.localIdGenerator.setHighId(this.highestIdInUse);
    System.out.println("String_Node_Str" + localHighId);
  }
}

Fixed version (ground truth):
private void updateLocalIdGenerator(){
  long localHighId=this.localIdGenerator.getHighId();
  if (this.highestIdInUse > localHighId) {
    this.localIdGenerator.setHighId(this.highestIdInUse);
  }
}
Program: 154892
Project: 154892
Buggy source:
@Test public void testMultipleSlaves(){
  initializeDbs(3);
  GraphDatabaseService db1=haDbs.get(0);
  GraphDatabaseService db2=haDbs.get(1);
  GraphDatabaseService db3=haDbs.get(2);
  Transaction tx=db1.beginTx();
  try {
    Node node=db1.createNode();
    db1.getReferenceNode().createRelationshipTo(node,REL_TYPE);
    tx.success();
  }
  finally {
    tx.finish();
  }
  tx=db2.beginTx();
  try {
    db2.getReferenceNode().removeProperty("String_Node_Str");
    Node node=db2.getReferenceNode().getSingleRelationship(REL_TYPE,Direction.OUTGOING).getEndNode();
    node.setProperty("String_Node_Str","String_Node_Str");
    tx.success();
  }
  finally {
    tx.finish();
  }
  ((HighlyAvailableGraphDatabase)db1).pullUpdates();
  ((HighlyAvailableGraphDatabase)db3).pullUpdates();
  verificationFilter=new Predicate<Integer>(){
    public boolean accept(    Integer item){
      return item == 2;
    }
  }
;
}

Fixed version (ground truth):
@Test public void testMultipleSlaves(){
  initializeDbs(3);
  GraphDatabaseService db1=haDbs.get(0);
  GraphDatabaseService db2=haDbs.get(1);
  GraphDatabaseService db3=haDbs.get(2);
  Transaction tx=db1.beginTx();
  try {
    Node node=db1.createNode();
    db1.getReferenceNode().createRelationshipTo(node,REL_TYPE);
    tx.success();
  }
  finally {
    tx.finish();
  }
  tx=db2.beginTx();
  try {
    db2.getReferenceNode().removeProperty("String_Node_Str");
    Node node=db2.getReferenceNode().getSingleRelationship(REL_TYPE,Direction.OUTGOING).getEndNode();
    node.setProperty("String_Node_Str","String_Node_Str");
    tx.success();
  }
  finally {
    tx.finish();
  }
  ((HighlyAvailableGraphDatabase)db1).pullUpdates();
  ((HighlyAvailableGraphDatabase)db3).pullUpdates();
}
Program: 154893
Project: 154893
Buggy source:
public boolean accept(Integer item){
  return item == 2;
}

Fixed version (ground truth):
public boolean accept(Integer item){
  return true;
}
Program: 154894
Project: 154894
Buggy source:
@Override public void applyLog(ReadableByteChannel byteChannel) throws IOException {
  logApplied=true;
  xaContainer.getLogicalLog().applyLog(byteChannel);
}

Fixed version (ground truth):
@Override public void applyLog(ReadableByteChannel byteChannel) throws IOException {
  logApplied=true;
  super.applyLog(byteChannel);
}
Program: 154895
Project: 154895
Buggy source:
/** 
 * Creates a data source with minimum (no memory mapped) configuration.
 * @param neoStoreFileName The file name of the store
 * @param logicalLogPath The file name of the logical log
 * @throws IOException If unable to open store
 */
public NeoStoreXaDataSource(String neoStoreFileName,String logicalLogPath,LockManager lockManager,LockReleaser lockReleaser) throws IOException, InstantiationException {
  super(null);
  this.readOnly=false;
  this.lockManager=lockManager;
  this.lockReleaser=lockReleaser;
  storeDir=logicalLogPath;
  neoStore=new NeoStore(neoStoreFileName);
  xaContainer=XaContainer.create(this,logicalLogPath,new CommandFactory(neoStore),new TransactionFactory(),null);
  xaContainer.openLogicalLog();
  if (!xaContainer.getResourceManager().hasRecoveredTransactions()) {
    neoStore.makeStoreOk();
  }
 else {
    logger.info("String_Node_Str" + "String_Node_Str");
  }
  idGenerators=new ArrayMap<Class<?>,Store>(5,false,false);
  this.idGenerators.put(Node.class,neoStore.getNodeStore());
  this.idGenerators.put(Relationship.class,neoStore.getRelationshipStore());
  this.idGenerators.put(RelationshipType.class,neoStore.getRelationshipTypeStore());
  this.idGenerators.put(PropertyStore.class,neoStore.getPropertyStore());
  this.idGenerators.put(PropertyIndex.class,neoStore.getPropertyStore().getIndexStore());
}

Fixed version (ground truth):
/** 
 * Creates a data source with minimum (no memory mapped) configuration.
 * @param neoStoreFileName The file name of the store
 * @param logicalLogPath The file name of the logical log
 * @throws IOException If unable to open store
 */
public NeoStoreXaDataSource(String neoStoreFileName,String logicalLogPath,LockManager lockManager,LockReleaser lockReleaser) throws IOException, InstantiationException {
  super(null);
  this.readOnly=false;
  this.lockManager=lockManager;
  this.lockReleaser=lockReleaser;
  storeDir=logicalLogPath;
  neoStore=new NeoStore(neoStoreFileName);
  xaContainer=XaContainer.create(this,logicalLogPath,new CommandFactory(neoStore),new TransactionFactory(),null);
  setLogicalLogAtCreationTime(xaContainer.getLogicalLog());
  xaContainer.openLogicalLog();
  if (!xaContainer.getResourceManager().hasRecoveredTransactions()) {
    neoStore.makeStoreOk();
  }
 else {
    logger.info("String_Node_Str" + "String_Node_Str");
  }
  idGenerators=new ArrayMap<Class<?>,Store>(5,false,false);
  this.idGenerators.put(Node.class,neoStore.getNodeStore());
  this.idGenerators.put(Relationship.class,neoStore.getRelationshipStore());
  this.idGenerators.put(RelationshipType.class,neoStore.getRelationshipTypeStore());
  this.idGenerators.put(PropertyStore.class,neoStore.getPropertyStore());
  this.idGenerators.put(PropertyIndex.class,neoStore.getPropertyStore().getIndexStore());
}
Program: 154897
Project: 154897
Buggy source:
private void assertLogCanContainTx(long txId,long prevTxId) throws IOException {
  if (prevTxId < txId) {
    throw new IOException("String_Node_Str" + txId + "String_Node_Str"+ prevTxId+ "String_Node_Str");
  }
}

Fixed version (ground truth):
private void assertLogCanContainTx(long txId,long prevTxId) throws IOException {
  if (prevTxId >= txId) {
    throw new IOException("String_Node_Str" + txId + "String_Node_Str"+ prevTxId+ "String_Node_Str");
  }
}
Program: 154898
Project: 154898
Buggy source:
private long findLogContainingTxId(long txId) throws IOException {
  long version=logVersion;
  long committedTx=previousLogLastCommittedTx;
  while (version >= 0) {
    ReadableByteChannel log=getLogicalLogOrMyself(version);
    ByteBuffer buf=ByteBuffer.allocate(16);
    if (log.read(buf) != 16) {
      throw new IOException("String_Node_Str" + version);
    }
    buf.flip();
    long readVersion=buffer.getLong();
    if (readVersion != version) {
      throw new IOException("String_Node_Str" + readVersion + "String_Node_Str"+ version);
    }
    committedTx=buffer.getLong();
    log.close();
    if (committedTx <= txId) {
      break;
    }
    version--;
  }
  return version;
}

Fixed version (ground truth):
private long findLogContainingTxId(long txId) throws IOException {
  long version=logVersion;
  long committedTx=previousLogLastCommittedTx;
  while (version >= 0) {
    ReadableByteChannel log=getLogicalLogOrMyself(version);
    ByteBuffer buf=ByteBuffer.allocate(16);
    if (log.read(buf) != 16) {
      throw new IOException("String_Node_Str" + version);
    }
    buf.flip();
    long readVersion=buf.getLong();
    if (readVersion != version) {
      throw new IOException("String_Node_Str" + readVersion + "String_Node_Str"+ version);
    }
    committedTx=buf.getLong();
    log.close();
    if (committedTx <= txId) {
      break;
    }
    version--;
  }
  return version;
}
Program: 154899
Project: 154899
Buggy source:
private List<LogEntry> extractPreparedTransactionFromLog(long identifier,ReadableByteChannel log) throws IOException {
  buffer.clear();
  buffer.limit(8);
  log.read(buffer);
  long versionInLog=buffer.getLong();
  long prevTxId=buffer.getLong();
  List<LogEntry> logEntryList=null;
  Map<Integer,List<LogEntry>> transactions=new HashMap<Integer,List<LogEntry>>();
  while (logEntryList == null && fileChannel.read(buffer) != buffer.limit()) {
    buffer.flip();
    byte entry=buffer.get();
    LogEntry logEntry;
switch (entry) {
case LogEntry.TX_START:
      logEntry=LogIoUtils.readTxStartEntry(buffer,log,-1);
    if (logEntry.getIdentifier() == identifier) {
      List<LogEntry> list=new LinkedList<LogEntry>();
      list.add(logEntry);
      transactions.put(logEntry.getIdentifier(),list);
    }
  break;
case LogEntry.TX_PREPARE:
logEntry=LogIoUtils.readTxPrepareEntry(buffer,log);
if (logEntry.getIdentifier() == identifier) {
logEntryList=transactions.get(logEntry.getIdentifier());
logEntryList.add(logEntry);
}
break;
case LogEntry.COMMAND:
logEntry=LogIoUtils.readTxCommand(buffer,log,cf);
if (logEntry.getIdentifier() == identifier) {
transactions.get(logEntry.getIdentifier()).add(logEntry);
}
break;
default :
throw new IOException("String_Node_Str" + identifier);
}
buffer.clear();
buffer.limit(1);
}
if (logEntryList == null) {
throw new IOException("String_Node_Str" + identifier + "String_Node_Str");
}
return logEntryList;
}

Fixed version (ground truth):
private List<LogEntry> extractPreparedTransactionFromLog(long identifier,ReadableByteChannel log) throws IOException {
  buffer.clear();
  buffer.limit(16);
  log.read(buffer);
  List<LogEntry> logEntryList=null;
  Map<Integer,List<LogEntry>> transactions=new HashMap<Integer,List<LogEntry>>();
  buffer.clear();
  buffer.limit(1);
  while (logEntryList == null && log.read(buffer) == buffer.limit()) {
    buffer.flip();
    byte entry=buffer.get();
    LogEntry logEntry;
switch (entry) {
case LogEntry.TX_START:
      logEntry=LogIoUtils.readTxStartEntry(buffer,log,-1);
    if (logEntry.getIdentifier() == identifier) {
      List<LogEntry> list=new LinkedList<LogEntry>();
      list.add(logEntry);
      transactions.put(logEntry.getIdentifier(),list);
    }
  break;
case LogEntry.TX_PREPARE:
logEntry=LogIoUtils.readTxPrepareEntry(buffer,log);
if (logEntry.getIdentifier() == identifier) {
logEntryList=transactions.get(logEntry.getIdentifier());
logEntryList.add(logEntry);
}
break;
case LogEntry.COMMAND:
logEntry=LogIoUtils.readTxCommand(buffer,log,cf);
if (logEntry.getIdentifier() == identifier) {
transactions.get(logEntry.getIdentifier()).add(logEntry);
}
break;
case LogEntry.TX_1P_COMMIT:
logEntry=LogIoUtils.readTxOnePhaseCommit(buffer,log);
break;
case LogEntry.TX_2P_COMMIT:
logEntry=LogIoUtils.readTxTwoPhaseCommit(buffer,log);
break;
case LogEntry.DONE:
logEntry=LogIoUtils.readTxDoneEntry(buffer,log);
break;
default :
throw new IOException("String_Node_Str" + entry);
}
buffer.clear();
buffer.limit(1);
}
if (logEntryList == null) {
throw new IOException("String_Node_Str" + identifier + "String_Node_Str");
}
return logEntryList;
}
Program: 154901
Project: 154901
Buggy source:
public int getOrCreate(TransactionManager txManager,EntityIdGenerator idGenerator,PersistenceManager persistence,String name){
  RelTypeCreater createrThread=new RelTypeCreater(name,txManager,idGenerator,persistence);
synchronized (createrThread) {
    createrThread.start();
    while (createrThread.isAlive()) {
      try {
        createrThread.wait(50);
      }
 catch (      InterruptedException e) {
        Thread.interrupted();
      }
    }
  }
  if (createrThread.succeded()) {
    return createrThread.getRelTypeId();
  }
  throw new TransactionFailureException("String_Node_Str" + name);
}

Fixed version (ground truth):
public int getOrCreate(TransactionManager txManager,EntityIdGenerator idGenerator,PersistenceManager persistence,RelationshipTypeHolder relTypeHolder,String name){
  RelTypeCreater createrThread=new RelTypeCreater(name,txManager,idGenerator,persistence);
synchronized (createrThread) {
    createrThread.start();
    while (createrThread.isAlive()) {
      try {
        createrThread.wait(50);
      }
 catch (      InterruptedException e) {
        Thread.interrupted();
      }
    }
  }
  if (createrThread.succeded()) {
    int id=createrThread.getRelTypeId();
    relTypeHolder.addRawRelationshipType(new RelationshipTypeData(id,name));
    return id;
  }
  throw new TransactionFailureException("String_Node_Str" + name);
}
Program: 154902
Project: 154902
Buggy source:
int getOrCreate(TransactionManager txManager,EntityIdGenerator idGenerator,PersistenceManager persistence,String name);

Fixed version (ground truth):
int getOrCreate(TransactionManager txManager,EntityIdGenerator idGenerator,PersistenceManager persistence,RelationshipTypeHolder relTypeHolder,String name);
Program: 154903
Project: 154903
Buggy source:
void addRawRelationshipTypes(RelationshipTypeData[] types){
  for (int i=0; i < types.length; i++) {
    relTypes.put(types[i].getName(),types[i].getId());
    relTranslation.put(types[i].getId(),types[i].getName());
  }
}

Fixed version (ground truth):
void addRawRelationshipTypes(RelationshipTypeData[] types){
  for (int i=0; i < types.length; i++) {
    addRawRelationshipType(types[i]);
  }
}
Program: 154904
Project: 154904
Buggy source:
void addRawRelationshipType(RelationshipTypeData type){
  relTypes.put(type.getName(),type.getId());
  relTranslation.put(type.getId(),type.getName());
}

Fixed version (ground truth):
void addRawRelationshipType(RelationshipTypeData type){
  relTypes.put(type.getName(),type.getId());
  relTranslation.put(type.getId(),type.getName());
  printIt(type.getId(),type.getName());
}
Program: 154905
Project: 154905
Buggy source:
public RelationshipType addValidRelationshipType(String name,boolean create){
  if (relTypes.get(name) == null) {
    if (!create) {
      return null;
    }
    int id=createRelationshipType(name);
    relTranslation.put(id,name);
  }
 else {
    relTranslation.put(relTypes.get(name),name);
  }
  return new RelationshipTypeImpl(name);
}

Fixed version (ground truth):
public RelationshipType addValidRelationshipType(String name,boolean create){
  if (relTypes.get(name) == null) {
    if (!create) {
      return null;
    }
    int id=createRelationshipType(name);
    relTranslation.put(id,name);
    printIt(id,name);
  }
 else {
    relTranslation.put(relTypes.get(name),name);
    printIt(relTypes.get(name),name);
  }
  return new RelationshipTypeImpl(name);
}
Program: 154906
Project: 154906
Buggy source:
private synchronized int createRelationshipType(String name){
  Integer id=relTypes.get(name);
  if (id != null) {
    return id;
  }
  id=relTypeCreator.getOrCreate(transactionManager,idGenerator,persistenceManager,name);
  addRelType(name,id);
  return id;
}

Fixed version (ground truth):
private synchronized int createRelationshipType(String name){
  Integer id=relTypes.get(name);
  if (id != null) {
    return id;
  }
  id=relTypeCreator.getOrCreate(transactionManager,idGenerator,persistenceManager,this,name);
  addRelType(name,id);
  return id;
}
Program: 154907
Project: 154907
Buggy source:
@Override protected boolean versionFound(String version){
  if (!version.startsWith("String_Node_Str")) {
    return false;
  }
  if (version.equals("String_Node_Str")) {
    ByteBuffer buffer=ByteBuffer.wrap(new byte[3 * RECORD_SIZE]);
    long time=System.currentTimeMillis();
    long random=r.nextLong();
    buffer.put(Record.IN_USE.byteValue()).putLong(time);
    buffer.put(Record.IN_USE.byteValue()).putLong(random);
    buffer.put(Record.IN_USE.byteValue()).putLong(0);
    buffer.put(Record.IN_USE.byteValue()).putLong(0);
    buffer.flip();
    try {
      getFileChannel().write(buffer,0);
    }
 catch (    IOException e) {
      throw new UnderlyingStorageException(e);
    }
    rebuildIdGenerator();
    closeIdGenerator();
    return true;
  }
  throw new IllegalStoreVersionException("String_Node_Str" + version + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
@Override protected boolean versionFound(String version){
  if (!version.startsWith("String_Node_Str")) {
    return false;
  }
  if (version.equals("String_Node_Str")) {
    ByteBuffer buffer=ByteBuffer.wrap(new byte[4 * RECORD_SIZE]);
    long time=System.currentTimeMillis();
    long random=r.nextLong();
    buffer.put(Record.IN_USE.byteValue()).putLong(time);
    buffer.put(Record.IN_USE.byteValue()).putLong(random);
    buffer.put(Record.IN_USE.byteValue()).putLong(0);
    buffer.put(Record.IN_USE.byteValue()).putLong(0);
    buffer.flip();
    try {
      getFileChannel().write(buffer,0);
    }
 catch (    IOException e) {
      throw new UnderlyingStorageException(e);
    }
    rebuildIdGenerator();
    closeIdGenerator();
    return true;
  }
  throw new IllegalStoreVersionException("String_Node_Str" + version + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}
Program: 154908
Project: 154908
Buggy source:
private ReadableByteChannel getLogicalLogOrMyself(long version) throws IOException {
  if (version < logVersion) {
    return getLogicalLog(version);
  }
 else {
    String currentLogName=fileName + (currentLog == LOG1 ? "String_Node_Str" : "String_Node_Str");
    return new RandomAccessFile(currentLogName,"String_Node_Str").getChannel();
  }
}

Fixed version (ground truth):
private ReadableByteChannel getLogicalLogOrMyself(long version) throws IOException {
  if (version < logVersion) {
    return getLogicalLog(version);
  }
 else   if (version == logVersion) {
    String currentLogName=fileName + (currentLog == LOG1 ? "String_Node_Str" : "String_Node_Str");
    return new RandomAccessFile(currentLogName,"String_Node_Str").getChannel();
  }
 else {
    throw new RuntimeException("String_Node_Str" + version + "String_Node_Str"+ logVersion+ "String_Node_Str");
  }
}
Program: 154909
Project: 154909
Buggy source:
private long findLogContainingTxId(long txId) throws IOException {
  long version=logVersion;
  long committedTx=previousLogLastCommittedTx;
  while (committedTx <= txId) {
    version--;
    ReadableByteChannel log=getLogicalLog(version);
    ByteBuffer buf=ByteBuffer.allocate(16);
    if (log.read(buf) != 16) {
      throw new IOException("String_Node_Str" + version);
    }
    buf.flip();
    long readVersion=buffer.getLong();
    if (readVersion != version) {
      throw new IOException("String_Node_Str" + readVersion + "String_Node_Str"+ version);
    }
    committedTx=buffer.getLong();
    log.close();
  }
  return version;
}

Fixed version (ground truth):
private long findLogContainingTxId(long txId) throws IOException {
  long version=logVersion;
  long committedTx=previousLogLastCommittedTx;
  while (version >= 0) {
    ReadableByteChannel log=getLogicalLogOrMyself(version);
    ByteBuffer buf=ByteBuffer.allocate(16);
    if (log.read(buf) != 16) {
      throw new IOException("String_Node_Str" + version);
    }
    buf.flip();
    long readVersion=buffer.getLong();
    if (readVersion != version) {
      throw new IOException("String_Node_Str" + readVersion + "String_Node_Str"+ version);
    }
    committedTx=buffer.getLong();
    log.close();
    if (committedTx <= txId) {
      break;
    }
    version--;
  }
  return version;
}
Program: 154910
Project: 154910
Buggy source:
private void ensureEntitiesAreGathered(){
  if (nodes == null) {
    nodes=new LinkedList<Node>();
    relationships=new LinkedList<Relationship>();
    TraversalBranch stepper=branch;
    while (stepper != null) {
      nodes.addFirst(stepper.node());
      Relationship relationship=stepper.relationship();
      if (relationship != null) {
        relationships.addFirst(relationship);
      }
      stepper=stepper.parent();
    }
  }
}

Fixed version (ground truth):
private void ensureEntitiesAreGathered(){
  if (nodes == null) {
    LinkedList<Node> nodesList=new LinkedList<Node>();
    LinkedList<Relationship> relationshipsList=new LinkedList<Relationship>();
    TraversalBranch stepper=branch;
    while (stepper != null) {
      nodesList.addFirst(stepper.node());
      Relationship relationship=stepper.relationship();
      if (relationship != null) {
        relationshipsList.addFirst(relationship);
      }
      stepper=stepper.parent();
    }
    nodes=nodesList;
    relationships=relationshipsList;
  }
}
Program: 154911
Project: 154911
Buggy source:
public Iterator<PropertyContainer> iterator(){
  return new Iterator<PropertyContainer>(){
    Iterator<? extends PropertyContainer> current=relationships().iterator();
    Iterator<? extends PropertyContainer> next=nodes().iterator();
    public boolean hasNext(){
      return current.hasNext();
    }
    public PropertyContainer next(){
      try {
        return current.next();
      }
  finally {
        Iterator<? extends PropertyContainer> temp=current;
        current=next;
        next=temp;
      }
    }
    public void remove(){
      next.remove();
    }
  }
;
}

Fixed version (ground truth):
public Iterator<PropertyContainer> iterator(){
  return new Iterator<PropertyContainer>(){
    Iterator<? extends PropertyContainer> current=nodes().iterator();
    Iterator<? extends PropertyContainer> next=relationships().iterator();
    public boolean hasNext(){
      return current.hasNext();
    }
    public PropertyContainer next(){
      try {
        return current.next();
      }
  finally {
        Iterator<? extends PropertyContainer> temp=current;
        current=next;
        next=temp;
      }
    }
    public void remove(){
      next.remove();
    }
  }
;
}
Program: 154912
Project: 154912
Buggy source:
public boolean isStartNode(){
  return position.length() > 0;
}

Fixed version (ground truth):
public boolean isStartNode(){
  return position.length() == 0;
}
Program: 154913
Project: 154913
Buggy source:
private void writeInt(FileChannel channel,int value) throws IOException {
  NioUtils.writeInt(channel,buffer(4),value);
}

Fixed version (ground truth):
private void writeInt(FileChannel channel,int value) throws IOException {
  PrimitiveUtils.writeInt(channel,buffer(4),value);
}
Program: 154914
Project: 154914
Buggy source:
private Integer readNextInt(FileChannel channel) throws IOException {
  return NioUtils.readInt(channel,buffer(4));
}

Fixed version (ground truth):
private Integer readNextInt(FileChannel channel) throws IOException {
  return PrimitiveUtils.readInt(channel,buffer(4));
}
Program: 154915
Project: 154915
Buggy source:
private String readNextString(FileChannel channel) throws IOException {
  return NioUtils.readLengthAndString(channel,buffer(100));
}

Fixed version (ground truth):
private String readNextString(FileChannel channel) throws IOException {
  return PrimitiveUtils.readLengthAndString(channel,buffer(100));
}
Program: 154916
Project: 154916
Buggy source:
private void writeString(FileChannel channel,String value) throws IOException {
  NioUtils.writeLengthAndString(channel,buffer(200),value);
}

Fixed version (ground truth):
private void writeString(FileChannel channel,String value) throws IOException {
  PrimitiveUtils.writeLengthAndString(channel,buffer(200),value);
}
Program: 154917
Project: 154917
Buggy source:
public void add(long entityId,Map<String,Object> properties){
  put(type.newDocument(entityId),properties);
}

Fixed version (ground truth):
public void add(long entityId,Map<String,Object> properties){
  try {
    Document document=type.newDocument(entityId);
    for (    Map.Entry<String,Object> entry : properties.entrySet()) {
      String key=entry.getKey();
      for (      Object value : PrimitiveUtils.asArray(entry.getValue())) {
        type.addToDocument(document,key,value);
      }
    }
    writer().addDocument(document);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 154918
Project: 154918
Buggy source:
public void updateOrAdd(long entityId,Map<String,Object> properties){
  Document document=LuceneDataSource.findDocument(type,searcher(),entityId);
  put(document != null ? document : type.newDocument(entityId),properties);
}

Fixed version (ground truth):
public void updateOrAdd(long entityId,Map<String,Object> properties){
  try {
    writer().deleteDocuments(type.idTermQuery(entityId));
    add(entityId,properties);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 154919
Project: 154919
Buggy source:
static CommandData readCommandData(ReadableByteChannel channel,ByteBuffer buffer,LuceneDataSource dataSource) throws IOException {
  buffer.clear();
  buffer.limit(21);
  if (channel.read(buffer) != buffer.limit()) {
    return null;
  }
  buffer.flip();
  byte cls=buffer.get();
  Class<?> itemsClass=null;
  if (cls == NODE) {
    itemsClass=Node.class;
  }
 else   if (cls == RELATIONSHIP) {
    itemsClass=Relationship.class;
  }
 else {
    return null;
  }
  int indexNameLength=buffer.getInt();
  long entityId=buffer.getLong();
  int keyCharLength=buffer.getInt();
  int valueCharLength=buffer.getInt();
  String indexName=NioUtils.readString(channel,buffer,indexNameLength);
  if (indexName == null) {
    return null;
  }
  String key=NioUtils.readString(channel,buffer,keyCharLength);
  if (key == null) {
    return null;
  }
  String value=NioUtils.readString(channel,buffer,valueCharLength);
  if (value == null) {
    return null;
  }
  IndexIdentifier identifier=new IndexIdentifier(itemsClass,indexName,dataSource.indexStore.get(indexName));
  return new CommandData(identifier,entityId,key,value);
}

Fixed version (ground truth):
static CommandData readCommandData(ReadableByteChannel channel,ByteBuffer buffer,LuceneDataSource dataSource) throws IOException {
  buffer.clear();
  buffer.limit(21);
  if (channel.read(buffer) != buffer.limit()) {
    return null;
  }
  buffer.flip();
  byte cls=buffer.get();
  Class<?> itemsClass=null;
  if (cls == NODE) {
    itemsClass=Node.class;
  }
 else   if (cls == RELATIONSHIP) {
    itemsClass=Relationship.class;
  }
 else {
    return null;
  }
  int indexNameLength=buffer.getInt();
  long entityId=buffer.getLong();
  int keyCharLength=buffer.getInt();
  int valueCharLength=buffer.getInt();
  String indexName=PrimitiveUtils.readString(channel,buffer,indexNameLength);
  if (indexName == null) {
    return null;
  }
  String key=PrimitiveUtils.readString(channel,buffer,keyCharLength);
  if (key == null) {
    return null;
  }
  String value=PrimitiveUtils.readString(channel,buffer,valueCharLength);
  if (value == null) {
    return null;
  }
  IndexIdentifier identifier=new IndexIdentifier(itemsClass,indexName,dataSource.indexStore.get(indexName));
  return new CommandData(identifier,entityId,key,value);
}
Program: 154920
Project: 154920
Buggy source:
/** 
 * See   {@link Index#add(PropertyContainer,String,Object)} for more genericdocumentation. Adds key/value to the  {@code entity} in this index. Added values aresearchable withing the transaction, but composite  {@code AND}queries aren't guaranteed to return added values correctly within that transaction. When the transaction has been committed all such queries are guaranteed to return correct results.
 * @param entity the entity (i.e {@link Node} or {@link Relationship}) to associate the key/value pair with.
 * @param key the key in the key/value pair to associate with the entity.
 * @param value the value in the key/value pair to associate with theentity.
 */
public void add(T entity,String key,Object value){
  getConnection().add(this,entity,key,value);
}

Fixed version (ground truth):
/** 
 * See   {@link Index#add(PropertyContainer,String,Object)} for more genericdocumentation. Adds key/value to the  {@code entity} in this index. Added values aresearchable withing the transaction, but composite  {@code AND}queries aren't guaranteed to return added values correctly within that transaction. When the transaction has been committed all such queries are guaranteed to return correct results.
 * @param entity the entity (i.e {@link Node} or {@link Relationship}) to associate the key/value pair with.
 * @param key the key in the key/value pair to associate with the entity.
 * @param value the value in the key/value pair to associate with theentity.
 */
public void add(T entity,String key,Object value){
  for (  Object oneValue : PrimitiveUtils.asArray(value)) {
    getConnection().add(this,entity,key,oneValue);
  }
}
Program: 154921
Project: 154921
Buggy source:
/** 
 * See   {@link Index#remove(PropertyContainer,String,Object)} for moregeneric documentation. Removes key/value to the  {@code entity} in this index. Removed valuesare excluded withing the transaction, but composite  {@code AND}queries aren't guaranteed to exclude removed values correctly within that transaction. When the transaction has been committed all such queries are guaranteed to return correct results.
 * @param entity the entity (i.e {@link Node} or {@link Relationship}) to dissociate the key/value pair from.
 * @param key the key in the key/value pair to dissociate from the entity.
 * @param value the value in the key/value pair to dissociate from theentity.
 */
public void remove(T entity,String key,Object value){
  getConnection().remove(this,entity,key,value);
}

Fixed version (ground truth):
/** 
 * See   {@link Index#remove(PropertyContainer,String,Object)} for moregeneric documentation. Removes key/value to the  {@code entity} in this index. Removed valuesare excluded withing the transaction, but composite  {@code AND}queries aren't guaranteed to exclude removed values correctly within that transaction. When the transaction has been committed all such queries are guaranteed to return correct results.
 * @param entity the entity (i.e {@link Node} or {@link Relationship}) to dissociate the key/value pair from.
 * @param key the key in the key/value pair to dissociate from the entity.
 * @param value the value in the key/value pair to dissociate from theentity.
 */
public void remove(T entity,String key,Object value){
  for (  Object oneValue : PrimitiveUtils.asArray(value)) {
    getConnection().remove(this,entity,key,oneValue);
  }
}
Program: 154923
Project: 154923
Buggy source:
public static <T>T getBean(int instanceId,Class<T> beanType){
  if (beanType.isInterface() && beanType.getPackage().equals("String_Node_Str")) {
    if (PROXY_MAKER == null) {
      throw new UnsupportedOperationException("String_Node_Str");
    }
 else {
      ObjectName name=getObjectName(instanceId,beanType,null);
      return PROXY_MAKER.makeProxy(name,beanType);
    }
  }
  throw new IllegalArgumentException("String_Node_Str" + beanType);
}

Fixed version (ground truth):
public static <T>T getBean(int instanceId,Class<T> beanType){
  if (beanType.isInterface() && beanType.getPackage().getName().equals("String_Node_Str")) {
    if (PROXY_MAKER == null) {
      throw new UnsupportedOperationException("String_Node_Str");
    }
 else {
      ObjectName name=getObjectName(instanceId,beanType,null);
      return PROXY_MAKER.makeProxy(name,beanType);
    }
  }
  throw new IllegalArgumentException("String_Node_Str" + beanType);
}
Program: 154924
Project: 154924
Buggy source:
public String relationshipRepresentation(Path path,Node from,Relationship relationship){
  return relationship.getStartNode().equals(from) ? "String_Node_Str" : "String_Node_Str";
}

Fixed version (ground truth):
@Override public String relationshipRepresentation(Path path,Node from,Relationship relationship){
  return relationship.getStartNode().equals(from) ? "String_Node_Str" : "String_Node_Str";
}