nus-yam/ex-repair huggingface dataset:
Program: 154756
Project: 154756
Buggy source:
public static void main(final String[] args){
  graphDb=new EmbeddedGraphDatabase(DB_PATH);
  indexService=new LuceneIndexService(graphDb);
  registerShutdownHook();
  Transaction tx=graphDb.beginTx();
  try {
    Node usersReferenceNode=graphDb.createNode();
    graphDb.getReferenceNode().createRelationshipTo(usersReferenceNode,RelTypes.USERS_REFERENCE);
    for (int id=0; id < 100; id++) {
      Node userNode=createAndIndexUser(idToUserName(id));
      usersReferenceNode.createRelationshipTo(userNode,RelTypes.USER);
    }
    System.out.println("String_Node_Str");
    int idToFind=45;
    Node foundUser=indexService.getSingleNode(USERNAME_KEY,idToUserName(idToFind));
    System.out.println("String_Node_Str" + idToFind + "String_Node_Str"+ foundUser.getProperty(USERNAME_KEY));
    for (    Relationship relationship : usersReferenceNode.getRelationships(RelTypes.USER,Direction.OUTGOING)) {
      Node user=relationship.getEndNode();
      indexService.removeIndex(user,USERNAME_KEY,user.getProperty(USERNAME_KEY));
      user.delete();
      relationship.delete();
    }
    usersReferenceNode.getSingleRelationship(RelTypes.USERS_REFERENCE,Direction.INCOMING).delete();
    usersReferenceNode.delete();
    tx.success();
  }
  finally {
    tx.finish();
  }
  System.out.println("String_Node_Str");
  shutdown();
  System.exit(0);
}

Fixed version (ground truth):
public static void main(final String[] args){
  graphDb=new EmbeddedGraphDatabase(DB_PATH);
  indexService=new LuceneIndexService(graphDb);
  registerShutdownHook();
  Transaction tx=graphDb.beginTx();
  try {
    Node usersReferenceNode=graphDb.createNode();
    graphDb.getReferenceNode().createRelationshipTo(usersReferenceNode,RelTypes.USERS_REFERENCE);
    for (int id=0; id < 100; id++) {
      Node userNode=createAndIndexUser(idToUserName(id));
      usersReferenceNode.createRelationshipTo(userNode,RelTypes.USER);
    }
    System.out.println("String_Node_Str");
    int idToFind=45;
    Node foundUser=indexService.getSingleNode(USERNAME_KEY,idToUserName(idToFind));
    System.out.println("String_Node_Str" + idToFind + "String_Node_Str"+ foundUser.getProperty(USERNAME_KEY));
    for (    Relationship relationship : usersReferenceNode.getRelationships(RelTypes.USER,Direction.OUTGOING)) {
      Node user=relationship.getEndNode();
      indexService.removeIndex(user,USERNAME_KEY,user.getProperty(USERNAME_KEY));
      user.delete();
      relationship.delete();
    }
    usersReferenceNode.getSingleRelationship(RelTypes.USERS_REFERENCE,Direction.INCOMING).delete();
    usersReferenceNode.delete();
    tx.success();
  }
  finally {
    tx.finish();
  }
  System.out.println("String_Node_Str");
  shutdown();
}
Program: 154757
Project: 154757
Buggy source:
public static void main(final String[] args) throws Exception {
  registerShutdownHookForNeo();
  boolean trueForLocal=waitForUserInput("String_Node_Str" + "String_Node_Str" + "String_Node_Str").equalsIgnoreCase("String_Node_Str");
  if (trueForLocal) {
    startLocalShell();
  }
 else {
    startRemoteShellAndWait();
  }
  shutdown();
  System.exit(0);
}

Fixed version (ground truth):
public static void main(final String[] args) throws Exception {
  registerShutdownHookForNeo();
  boolean trueForLocal=waitForUserInput("String_Node_Str" + "String_Node_Str" + "String_Node_Str").equalsIgnoreCase("String_Node_Str");
  if (trueForLocal) {
    startLocalShell();
  }
 else {
    startRemoteShellAndWait();
  }
  shutdown();
}
Program: 154758
Project: 154758
Buggy source:
public Object propertyGetValue(int id){
  PropertyRecord propertyRecord=getPropertyRecord(id);
  if (propertyRecord == null) {
    propertyRecord=getPropertyStore().getRecord(id);
  }
  if (propertyRecord.isLight()) {
    getPropertyStore().makeHeavy(propertyRecord);
  }
  PropertyType type=propertyRecord.getType();
  if (type == PropertyType.INT) {
    return (int)propertyRecord.getPropBlock();
  }
  if (type == PropertyType.STRING) {
    return getPropertyStore().getStringFor(propertyRecord);
  }
  if (type == PropertyType.BOOL) {
    if (propertyRecord.getPropBlock() == 1) {
      return Boolean.valueOf(true);
    }
    return Boolean.valueOf(false);
  }
  if (type == PropertyType.DOUBLE) {
    return new Double(Double.longBitsToDouble(propertyRecord.getPropBlock()));
  }
  if (type == PropertyType.FLOAT) {
    return new Float(Float.intBitsToFloat((int)propertyRecord.getPropBlock()));
  }
  if (type == PropertyType.LONG) {
    return propertyRecord.getPropBlock();
  }
  if (type == PropertyType.BYTE) {
    return (byte)propertyRecord.getPropBlock();
  }
  if (type == PropertyType.CHAR) {
    return (char)propertyRecord.getPropBlock();
  }
  if (type == PropertyType.ARRAY) {
    return getPropertyStore().getArrayFor(propertyRecord);
  }
  if (type == PropertyType.SHORT) {
    return (short)propertyRecord.getPropBlock();
  }
  throw new InvalidRecordException("String_Node_Str" + type + "String_Node_Str"+ propertyRecord);
}

Fixed version (ground truth):
public Object propertyGetValue(int id){
  PropertyRecord propertyRecord=getPropertyStore().getRecord(id);
  if (propertyRecord.isLight()) {
    getPropertyStore().makeHeavy(propertyRecord);
  }
  PropertyType type=propertyRecord.getType();
  if (type == PropertyType.INT) {
    return (int)propertyRecord.getPropBlock();
  }
  if (type == PropertyType.STRING) {
    return getPropertyStore().getStringFor(propertyRecord);
  }
  if (type == PropertyType.BOOL) {
    if (propertyRecord.getPropBlock() == 1) {
      return Boolean.valueOf(true);
    }
    return Boolean.valueOf(false);
  }
  if (type == PropertyType.DOUBLE) {
    return new Double(Double.longBitsToDouble(propertyRecord.getPropBlock()));
  }
  if (type == PropertyType.FLOAT) {
    return new Float(Float.intBitsToFloat((int)propertyRecord.getPropBlock()));
  }
  if (type == PropertyType.LONG) {
    return propertyRecord.getPropBlock();
  }
  if (type == PropertyType.BYTE) {
    return (byte)propertyRecord.getPropBlock();
  }
  if (type == PropertyType.CHAR) {
    return (char)propertyRecord.getPropBlock();
  }
  if (type == PropertyType.ARRAY) {
    return getPropertyStore().getArrayFor(propertyRecord);
  }
  if (type == PropertyType.SHORT) {
    return (short)propertyRecord.getPropBlock();
  }
  throw new InvalidRecordException("String_Node_Str" + type + "String_Node_Str"+ propertyRecord);
}
Program: 154759
Project: 154759
Buggy source:
public ArrayMap<Integer,PropertyData> relGetProperties(int relId,boolean light){
  RelationshipRecord relRecord=getRelationshipRecord(relId);
  if (relRecord != null) {
    if (!relRecord.inUse() && !light) {
      throw new IllegalStateException("String_Node_Str" + relId + "String_Node_Str");
    }
  }
 else {
    relRecord=getRelationshipStore().getRecord(relId);
  }
  if (!relRecord.inUse()) {
    throw new InvalidRecordException("String_Node_Str" + relId + "String_Node_Str");
  }
  int nextProp=relRecord.getNextProp();
  ArrayMap<Integer,PropertyData> propertyMap=new ArrayMap<Integer,PropertyData>(9,false,true);
  while (nextProp != Record.NO_NEXT_PROPERTY.intValue()) {
    PropertyRecord propRecord=getPropertyRecord(nextProp);
    if (propRecord == null) {
      propRecord=getPropertyStore().getLightRecord(nextProp);
    }
    if (!propRecord.isCreated()) {
      propertyMap.put(propRecord.getKeyIndexId(),new PropertyData(propRecord.getId(),propertyGetValueOrNull(propRecord)));
    }
    nextProp=propRecord.getNextProp();
  }
  return propertyMap;
}

Fixed version (ground truth):
public ArrayMap<Integer,PropertyData> relGetProperties(int relId,boolean light){
  ArrayMap<Integer,PropertyData> propertyMap=new ArrayMap<Integer,PropertyData>(9,false,true);
  RelationshipRecord relRecord=getRelationshipRecord(relId);
  if (relRecord != null && relRecord.isCreated()) {
    return propertyMap;
  }
  if (relRecord != null) {
    if (!relRecord.inUse() && !light) {
      throw new IllegalStateException("String_Node_Str" + relId + "String_Node_Str");
    }
  }
  relRecord=getRelationshipStore().getRecord(relId);
  if (!relRecord.inUse()) {
    throw new InvalidRecordException("String_Node_Str" + relId + "String_Node_Str");
  }
  int nextProp=relRecord.getNextProp();
  while (nextProp != Record.NO_NEXT_PROPERTY.intValue()) {
    PropertyRecord propRecord=getPropertyStore().getLightRecord(nextProp);
    propertyMap.put(propRecord.getKeyIndexId(),new PropertyData(propRecord.getId(),propertyGetValueOrNull(propRecord)));
    nextProp=propRecord.getNextProp();
  }
  return propertyMap;
}
Program: 154760
Project: 154760
Buggy source:
public RelationshipChainPosition getRelationshipChainPosition(int nodeId){
  NodeRecord nodeRecord=getNodeRecord(nodeId);
  if (nodeRecord == null) {
    nodeRecord=getNodeStore().getRecord(nodeId);
  }
  int nextRel=nodeRecord.getNextRel();
  return new RelationshipChainPosition(nextRel);
}

Fixed version (ground truth):
public RelationshipChainPosition getRelationshipChainPosition(int nodeId){
  NodeRecord nodeRecord=getNodeRecord(nodeId);
  if (nodeRecord != null && nodeRecord.isCreated()) {
    return new RelationshipChainPosition(Record.NO_NEXT_RELATIONSHIP.intValue());
  }
  nodeRecord=getNodeStore().getRecord(nodeId);
  int nextRel=nodeRecord.getNextRel();
  return new RelationshipChainPosition(nextRel);
}
Program: 154761
Project: 154761
Buggy source:
ArrayMap<Integer,PropertyData> nodeGetProperties(int nodeId,boolean light){
  NodeRecord nodeRecord=getNodeRecord(nodeId);
  if (nodeRecord != null) {
    if (!nodeRecord.inUse() && !light) {
      throw new IllegalStateException("String_Node_Str" + nodeId + "String_Node_Str");
    }
  }
 else {
    nodeRecord=getNodeStore().getRecord(nodeId);
  }
  if (!nodeRecord.inUse()) {
    throw new InvalidRecordException("String_Node_Str" + nodeId + "String_Node_Str");
  }
  int nextProp=nodeRecord.getNextProp();
  ArrayMap<Integer,PropertyData> propertyMap=new ArrayMap<Integer,PropertyData>(9,false,true);
  while (nextProp != Record.NO_NEXT_PROPERTY.intValue()) {
    PropertyRecord propRecord=getPropertyRecord(nextProp);
    if (propRecord == null) {
      propRecord=getPropertyStore().getLightRecord(nextProp);
    }
    if (!propRecord.isCreated()) {
      propertyMap.put(propRecord.getKeyIndexId(),new PropertyData(propRecord.getId(),propertyGetValueOrNull(propRecord)));
    }
    nextProp=propRecord.getNextProp();
  }
  return propertyMap;
}

Fixed version (ground truth):
ArrayMap<Integer,PropertyData> nodeGetProperties(int nodeId,boolean light){
  ArrayMap<Integer,PropertyData> propertyMap=new ArrayMap<Integer,PropertyData>(9,false,true);
  NodeRecord nodeRecord=getNodeRecord(nodeId);
  if (nodeRecord != null && nodeRecord.isCreated()) {
    return propertyMap;
  }
  if (nodeRecord != null) {
    if (!nodeRecord.inUse() && !light) {
      throw new IllegalStateException("String_Node_Str" + nodeId + "String_Node_Str");
    }
  }
  nodeRecord=getNodeStore().getRecord(nodeId);
  if (!nodeRecord.inUse()) {
    throw new InvalidRecordException("String_Node_Str" + nodeId + "String_Node_Str");
  }
  int nextProp=nodeRecord.getNextProp();
  while (nextProp != Record.NO_NEXT_PROPERTY.intValue()) {
    PropertyRecord propRecord=getPropertyStore().getLightRecord(nextProp);
    propertyMap.put(propRecord.getKeyIndexId(),new PropertyData(propRecord.getId(),propertyGetValueOrNull(propRecord)));
    nextProp=propRecord.getNextProp();
  }
  return propertyMap;
}
Program: 154762
Project: 154762
Buggy source:
public Iterable<RelationshipData> getMoreRelationships(int nodeId,RelationshipChainPosition position){
  int nextRel=position.getNextRecord();
  List<RelationshipData> rels=new ArrayList<RelationshipData>();
  for (int i=0; i < getRelGrabSize() && nextRel != Record.NO_NEXT_RELATIONSHIP.intValue(); i++) {
    RelationshipRecord relRecord=getRelationshipRecord(nextRel);
    if (relRecord == null) {
      relRecord=getRelationshipStore().getChainRecord(nextRel);
    }
    if (relRecord == null) {
      position.setNextRecord(Record.NO_NEXT_RELATIONSHIP.intValue());
      return rels;
    }
    int firstNode=relRecord.getFirstNode();
    int secondNode=relRecord.getSecondNode();
    if (relRecord.inUse() && !relRecord.isCreated()) {
      rels.add(new RelationshipData(relRecord.getId(),firstNode,secondNode,relRecord.getType()));
    }
 else {
      i--;
    }
    if (firstNode == nodeId) {
      nextRel=relRecord.getFirstNextRel();
    }
 else     if (secondNode == nodeId) {
      nextRel=relRecord.getSecondNextRel();
    }
 else {
      throw new InvalidRecordException("String_Node_Str" + nodeId + "String_Node_Str"+ firstNode+ "String_Node_Str"+ secondNode+ "String_Node_Str");
    }
  }
  position.setNextRecord(nextRel);
  return rels;
}

Fixed version (ground truth):
public Iterable<RelationshipData> getMoreRelationships(int nodeId,RelationshipChainPosition position){
  int nextRel=position.getNextRecord();
  List<RelationshipData> rels=new ArrayList<RelationshipData>();
  for (int i=0; i < getRelGrabSize() && nextRel != Record.NO_NEXT_RELATIONSHIP.intValue(); i++) {
    RelationshipRecord relRecord=getRelationshipStore().getChainRecord(nextRel);
    if (relRecord == null) {
      position.setNextRecord(Record.NO_NEXT_RELATIONSHIP.intValue());
      return rels;
    }
    int firstNode=relRecord.getFirstNode();
    int secondNode=relRecord.getSecondNode();
    if (relRecord.inUse()) {
      rels.add(new RelationshipData(relRecord.getId(),firstNode,secondNode,relRecord.getType()));
    }
 else {
      i--;
    }
    if (firstNode == nodeId) {
      nextRel=relRecord.getFirstNextRel();
    }
 else     if (secondNode == nodeId) {
      nextRel=relRecord.getSecondNextRel();
    }
 else {
      throw new InvalidRecordException("String_Node_Str" + nodeId + "String_Node_Str"+ firstNode+ "String_Node_Str"+ secondNode+ "String_Node_Str");
    }
  }
  position.setNextRecord(nextRel);
  return rels;
}
Program: 154765
Project: 154765
Buggy source:
@Test public void testRels1() throws Exception {
  initializeStores();
  startTx();
  int relType1=ds.nextId(RelationshipType.class);
  relTypeStore.addRelationshipType(relType1,"String_Node_Str");
  int nodeIds[]=new int[3];
  for (int i=0; i < 3; i++) {
    nodeIds[i]=ds.nextId(Node.class);
    nStore.createNode(nodeIds[i]);
    nStore.addProperty(nodeIds[i],pStore.nextId(),index("String_Node_Str"),new Integer(10 - i));
  }
  for (int i=0; i < 2; i++) {
    rStore.createRelationship(ds.nextId(Relationship.class),nodeIds[i],nodeIds[i + 1],relType1);
  }
  commitTx();
  startTx();
  for (int i=0; i < 3; i++) {
    RelationshipChainPosition pos=rStore.getRelationshipChainPosition(nodeIds[i]);
    for (    RelationshipData rel : rStore.getMoreRelationships(nodeIds[i],pos)) {
      rStore.deleteRelationship(rel.getId());
    }
    nStore.deleteNode(nodeIds[i]);
  }
  commitTx();
  ds.close();
}

Fixed version (ground truth):
@Test public void testRels1() throws Exception {
  initializeStores();
  startTx();
  int relType1=ds.nextId(RelationshipType.class);
  relTypeStore.addRelationshipType(relType1,"String_Node_Str");
  int nodeIds[]=new int[3];
  for (int i=0; i < 3; i++) {
    nodeIds[i]=ds.nextId(Node.class);
    nStore.createNode(nodeIds[i]);
    nStore.addProperty(nodeIds[i],pStore.nextId(),index("String_Node_Str"),new Integer(10 - i));
  }
  for (int i=0; i < 2; i++) {
    rStore.createRelationship(ds.nextId(Relationship.class),nodeIds[i],nodeIds[i + 1],relType1);
  }
  commitTx();
  startTx();
  for (int i=0; i < 3; i+=2) {
    RelationshipChainPosition pos=rStore.getRelationshipChainPosition(nodeIds[i]);
    for (    RelationshipData rel : rStore.getMoreRelationships(nodeIds[i],pos)) {
      rStore.deleteRelationship(rel.getId());
    }
    nStore.deleteNode(nodeIds[i]);
  }
  commitTx();
  ds.close();
}
Program: 154766
Project: 154766
Buggy source:
private void deleteNode1(int node,int prop1,int prop2,int prop3) throws IOException {
  ArrayMap<Integer,PropertyData> props=nStore.getProperties(node,false);
  int count=0;
  for (  int keyId : props.keySet()) {
    int id=props.get(keyId).getId();
    PropertyRecord record=pStore.getRecord(id);
    PropertyData data=new PropertyData(id,getValue(record));
    if (data.getId() == prop1) {
      assertEquals("String_Node_Str",MyPropertyIndex.getIndexFor(keyId).getKey());
      assertEquals("String_Node_Str",data.getValue());
    }
 else     if (data.getId() == prop2) {
      assertEquals("String_Node_Str",MyPropertyIndex.getIndexFor(keyId).getKey());
      assertEquals(new Integer(-1),data.getValue());
    }
 else     if (data.getId() == prop3) {
      assertEquals("String_Node_Str",MyPropertyIndex.getIndexFor(keyId).getKey());
      assertEquals(new Boolean(false),data.getValue());
      nStore.removeProperty(node,prop3);
    }
 else {
      throw new IOException();
    }
    count++;
  }
  assertEquals(3,count);
  assertEquals(2,nStore.getProperties(node,false).size());
  RelationshipChainPosition pos=rStore.getRelationshipChainPosition(node);
  Iterator<RelationshipData> rels=rStore.getMoreRelationships(node,pos).iterator();
  assertTrue(!rels.hasNext());
  nStore.deleteNode(node);
}

Fixed version (ground truth):
private void deleteNode1(int node,int prop1,int prop2,int prop3) throws IOException {
  ArrayMap<Integer,PropertyData> props=nStore.getProperties(node,false);
  int count=0;
  for (  int keyId : props.keySet()) {
    int id=props.get(keyId).getId();
    PropertyRecord record=pStore.getRecord(id);
    PropertyData data=new PropertyData(id,getValue(record));
    if (data.getId() == prop1) {
      assertEquals("String_Node_Str",MyPropertyIndex.getIndexFor(keyId).getKey());
      assertEquals("String_Node_Str",data.getValue());
    }
 else     if (data.getId() == prop2) {
      assertEquals("String_Node_Str",MyPropertyIndex.getIndexFor(keyId).getKey());
      assertEquals(new Integer(-1),data.getValue());
    }
 else     if (data.getId() == prop3) {
      assertEquals("String_Node_Str",MyPropertyIndex.getIndexFor(keyId).getKey());
      assertEquals(new Boolean(false),data.getValue());
      nStore.removeProperty(node,prop3);
    }
 else {
      throw new IOException();
    }
    count++;
  }
  assertEquals(3,count);
  assertEquals(3,nStore.getProperties(node,false).size());
  RelationshipChainPosition pos=rStore.getRelationshipChainPosition(node);
  Iterator<RelationshipData> rels=rStore.getMoreRelationships(node,pos).iterator();
  assertTrue(rels.hasNext());
  nStore.deleteNode(node);
}
Program: 154767
Project: 154767
Buggy source:
private void deleteNode2(int node,int prop1,int prop2,int prop3) throws IOException {
  ArrayMap<Integer,PropertyData> props=nStore.getProperties(node,false);
  int count=0;
  for (  int keyId : props.keySet()) {
    int id=props.get(keyId).getId();
    PropertyRecord record=pStore.getRecord(id);
    PropertyData data=new PropertyData(id,getValue(record));
    if (data.getId() == prop1) {
      assertEquals("String_Node_Str",MyPropertyIndex.getIndexFor(keyId).getKey());
      assertEquals("String_Node_Str",data.getValue());
    }
 else     if (data.getId() == prop2) {
      assertEquals("String_Node_Str",MyPropertyIndex.getIndexFor(keyId).getKey());
      assertEquals(new Integer(-2),data.getValue());
    }
 else     if (data.getId() == prop3) {
      assertEquals("String_Node_Str",MyPropertyIndex.getIndexFor(keyId).getKey());
      assertEquals(new Boolean(true),data.getValue());
      nStore.removeProperty(node,prop3);
    }
 else {
      throw new IOException();
    }
    count++;
  }
  assertEquals(3,count);
  assertEquals(2,nStore.getProperties(node,false).size());
  RelationshipChainPosition pos=rStore.getRelationshipChainPosition(node);
  Iterator<RelationshipData> rels=rStore.getMoreRelationships(node,pos).iterator();
  assertTrue(!rels.hasNext());
  nStore.deleteNode(node);
}

Fixed version (ground truth):
private void deleteNode2(int node,int prop1,int prop2,int prop3) throws IOException {
  ArrayMap<Integer,PropertyData> props=nStore.getProperties(node,false);
  int count=0;
  for (  int keyId : props.keySet()) {
    int id=props.get(keyId).getId();
    PropertyRecord record=pStore.getRecord(id);
    PropertyData data=new PropertyData(id,getValue(record));
    if (data.getId() == prop1) {
      assertEquals("String_Node_Str",MyPropertyIndex.getIndexFor(keyId).getKey());
      assertEquals("String_Node_Str",data.getValue());
    }
 else     if (data.getId() == prop2) {
      assertEquals("String_Node_Str",MyPropertyIndex.getIndexFor(keyId).getKey());
      assertEquals(new Integer(-2),data.getValue());
    }
 else     if (data.getId() == prop3) {
      assertEquals("String_Node_Str",MyPropertyIndex.getIndexFor(keyId).getKey());
      assertEquals(new Boolean(true),data.getValue());
      nStore.removeProperty(node,prop3);
    }
 else {
      throw new IOException();
    }
    count++;
  }
  assertEquals(3,count);
  assertEquals(3,nStore.getProperties(node,false).size());
  RelationshipChainPosition pos=rStore.getRelationshipChainPosition(node);
  Iterator<RelationshipData> rels=rStore.getMoreRelationships(node,pos).iterator();
  assertTrue(rels.hasNext());
  nStore.deleteNode(node);
}
Program: 154768
Project: 154768
Buggy source:
public Node getNodeById(long id){
  return new ReadOnlyNodeProxy(getNodeById(id));
}

Fixed version (ground truth):
public Node getNodeById(long id){
  return new ReadOnlyNodeProxy(actual.getNodeById(id));
}
Program: 154769
Project: 154769
Buggy source:
public Node getReferenceNode(){
  return new ReadOnlyNodeProxy(getReferenceNode());
}

Fixed version (ground truth):
public Node getReferenceNode(){
  return new ReadOnlyNodeProxy(actual.getReferenceNode());
}
Program: 154770
Project: 154770
Buggy source:
protected void possiblyGrabDefaultVariableFromServer(String key,Serializable defaultValue){
  try {
    if (this.session().get(key) == null) {
      Serializable value=this.getServer().getProperty(key);
      if (value == null) {
        value=defaultValue;
      }
      if (value != null) {
        this.session().set(key,value);
      }
    }
  }
 catch (  RemoteException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
protected void possiblyGrabDefaultVariableFromServer(String key,Serializable defaultValue){
  try {
    if (this.session().get(key) == null) {
      grabbedKeysFromServer.add(key);
      Serializable value=this.getServer().getProperty(key);
      if (value == null) {
        value=defaultValue;
      }
      if (value != null) {
        this.session().set(key,value);
      }
    }
  }
 catch (  RemoteException e) {
    throw new RuntimeException(e);
  }
}
Program: 154771
Project: 154771
Buggy source:
public ShellServer getServer(){
  boolean shouldTryToReconnect=this.server == null;
  try {
    if (!shouldTryToReconnect) {
      this.server.welcome();
    }
  }
 catch (  RemoteException e) {
    shouldTryToReconnect=true;
  }
  Exception originException=null;
  if (shouldTryToReconnect) {
    this.server=null;
    try {
      this.server=findRemoteServer();
      getOutput().println("String_Node_Str");
    }
 catch (    ShellException ee) {
      originException=ee;
    }
catch (    RemoteException ee) {
      originException=ee;
    }
  }
  if (this.server == null) {
    throw new RuntimeException("String_Node_Str" + originException.getMessage(),originException);
  }
  return this.server;
}

Fixed version (ground truth):
public ShellServer getServer(){
  boolean shouldTryToReconnect=this.server == null;
  try {
    if (!shouldTryToReconnect) {
      this.server.welcome();
    }
  }
 catch (  RemoteException e) {
    shouldTryToReconnect=true;
  }
  Exception originException=null;
  if (shouldTryToReconnect) {
    this.server=null;
    try {
      this.server=findRemoteServer();
      getOutput().println("String_Node_Str");
      regrabVariablesFromServer();
    }
 catch (    ShellException ee) {
      originException=ee;
    }
catch (    RemoteException ee) {
      originException=ee;
    }
  }
  if (this.server == null) {
    throw new RuntimeException("String_Node_Str" + originException.getMessage(),originException);
  }
  return this.server;
}
Program: 154772
Project: 154772
Buggy source:
public boolean isStopNode(TraversalPosition position){
  Relationship rel=position.lastRelationshipTraversed();
  return rel != null && rel.getType() == MyRelTypes.TEST_TRAVERSAL;
}

Fixed version (ground truth):
public boolean isStopNode(TraversalPosition position){
  Relationship rel=position.lastRelationshipTraversed();
  return rel != null && rel.isType(MyRelTypes.TEST_TRAVERSAL);
}
Program: 154773
Project: 154773
Buggy source:
@Test public void testStopOnLastRelationship() throws Exception {
  Node root=this.buildIseTreePopulation();
  RelationshipType[] traversableRels=new RelationshipType[]{MyRelTypes.TEST,MyRelTypes.TEST_TRAVERSAL};
  StopEvaluator stopEvaluator=new StopEvaluator(){
    public boolean isStopNode(    TraversalPosition position){
      Relationship rel=position.lastRelationshipTraversed();
      return rel != null && rel.getType() == MyRelTypes.TEST_TRAVERSAL;
    }
  }
;
  Traverser traverser=root.traverse(BREADTH_FIRST,stopEvaluator,ReturnableEvaluator.ALL,traversableRels[0],Direction.BOTH,traversableRels[1],Direction.BOTH);
  try {
    this.assertLevelsOfNodes(traverser,new String[][]{new String[]{"String_Node_Str"},new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}});
    assertTrue("String_Node_Str",traverser.iterator().hasNext() == false);
  }
 catch (  java.util.NoSuchElementException nsee) {
    fail("String_Node_Str");
  }
 finally {
    this.deleteNodeTreeRecursively(root,0);
  }
}

Fixed version (ground truth):
@Test public void testStopOnLastRelationship() throws Exception {
  Node root=this.buildIseTreePopulation();
  RelationshipType[] traversableRels=new RelationshipType[]{MyRelTypes.TEST,MyRelTypes.TEST_TRAVERSAL};
  StopEvaluator stopEvaluator=new StopEvaluator(){
    public boolean isStopNode(    TraversalPosition position){
      Relationship rel=position.lastRelationshipTraversed();
      return rel != null && rel.isType(MyRelTypes.TEST_TRAVERSAL);
    }
  }
;
  Traverser traverser=root.traverse(BREADTH_FIRST,stopEvaluator,ReturnableEvaluator.ALL,traversableRels[0],Direction.BOTH,traversableRels[1],Direction.BOTH);
  try {
    this.assertLevelsOfNodes(traverser,new String[][]{new String[]{"String_Node_Str"},new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}});
    assertTrue("String_Node_Str",traverser.iterator().hasNext() == false);
  }
 catch (  java.util.NoSuchElementException nsee) {
    fail("String_Node_Str");
  }
 finally {
    this.deleteNodeTreeRecursively(root,0);
  }
}
Program: 154774
Project: 154774
Buggy source:
public static Long readLong(ReadableByteChannel channel,ByteBuffer buffer) throws IOException {
  buffer.clear();
  buffer.limit(8);
  int read=channel.read(buffer);
  if (read < 8) {
    return null;
  }
  buffer.flip();
  return buffer.getLong();
}

Fixed version (ground truth):
public static Long readLong(ReadableByteChannel channel,ByteBuffer buffer) throws IOException {
  return readAndFlip(channel,buffer,8) ? buffer.getLong() : null;
}
Program: 154775
Project: 154775
Buggy source:
public static Integer readInt(ReadableByteChannel channel,ByteBuffer buffer) throws IOException {
  buffer.clear();
  buffer.limit(4);
  int read=channel.read(buffer);
  if (read < 4) {
    return null;
  }
  buffer.flip();
  return buffer.getInt();
}

Fixed version (ground truth):
public static Integer readInt(ReadableByteChannel channel,ByteBuffer buffer) throws IOException {
  return readAndFlip(channel,buffer,4) ? buffer.getInt() : null;
}
Program: 154779
Project: 154779
Buggy source:
public synchronized void applyTransaction(ReadableByteChannel byteChannel) throws IOException {
  long logEntriesFound=0;
  scanIsComplete=false;
  LogApplier logApplier=new LogApplier(byteChannel);
  int xidIdent=getNextIdentifier();
  while (logApplier.readAndWriteAndApplyEntry(xidIdent)) {
    logEntriesFound++;
  }
  byteChannel.close();
  scanIsComplete=true;
}

Fixed version (ground truth):
public synchronized void applyTransaction(ReadableByteChannel byteChannel) throws IOException {
  long logEntriesFound=0;
  scanIsComplete=false;
  LogApplier logApplier=new LogApplier(byteChannel);
  int xidIdent=getNextIdentifier();
  long startEntryPosition=writeBuffer.getFileChannelPosition();
  while (logApplier.readAndWriteAndApplyEntry(xidIdent)) {
    logEntriesFound++;
  }
  byteChannel.close();
  scanIsComplete=true;
  LogEntry.Start startEntry=logApplier.startEntry;
  if (startEntry == null) {
    throw new IOException("String_Node_Str");
  }
  startEntry.setStartPosition(startEntryPosition);
  cacheTxStartPosition(logApplier.commitEntry.getTxId(),startEntry);
}
Program: 154781
Project: 154781
Buggy source:
boolean readAndWriteAndApplyEntry(int newXidIdentifier) throws IOException {
  LogEntry entry=LogIoUtils.readEntry(buffer,byteChannel,cf);
  if (entry != null) {
    entry.setIdentifier(newXidIdentifier);
    if (entry instanceof LogEntry.Commit) {
      msgLog.logMessage("String_Node_Str" + ((LogEntry.Commit)entry).getTxId());
    }
 else     if (entry instanceof LogEntry.Start) {
      startEntry=(LogEntry.Start)entry;
    }
    LogIoUtils.writeLogEntry(entry,writeBuffer);
    applyEntry(entry);
    return true;
  }
  return false;
}

Fixed version (ground truth):
boolean readAndWriteAndApplyEntry(int newXidIdentifier) throws IOException {
  LogEntry entry=LogIoUtils.readEntry(buffer,byteChannel,cf);
  if (entry != null) {
    entry.setIdentifier(newXidIdentifier);
    if (entry instanceof LogEntry.Commit) {
      commitEntry=(LogEntry.Commit)entry;
      msgLog.logMessage("String_Node_Str" + ((LogEntry.Commit)entry).getTxId());
    }
 else     if (entry instanceof LogEntry.Start) {
      startEntry=(LogEntry.Start)entry;
    }
    LogIoUtils.writeLogEntry(entry,writeBuffer);
    applyEntry(entry);
    return true;
  }
  return false;
}
Program: 154782
Project: 154782
Buggy source:
private List<LogEntry> extractTransactionFromLog(long txId,long expectedVersion,ReadableByteChannel log) throws IOException {
  List<LogEntry> logEntryList=null;
  Map<Integer,List<LogEntry>> transactions=new HashMap<Integer,List<LogEntry>>();
  LogEntry entry;
  while ((entry=LogIoUtils.readEntry(buffer,log,cf)) != null && logEntryList == null) {
    if (entry instanceof LogEntry.Start) {
      List<LogEntry> list=new LinkedList<LogEntry>();
      list.add(entry);
      transactions.put(entry.getIdentifier(),list);
    }
 else     if (entry instanceof LogEntry.Commit) {
      if (((LogEntry.Commit)entry).getTxId() == txId) {
        logEntryList=transactions.get(entry.getIdentifier());
        logEntryList.add(entry);
      }
 else {
        transactions.remove(entry.getIdentifier());
      }
    }
 else     if (entry instanceof LogEntry.Command || entry instanceof LogEntry.Prepare) {
      transactions.get(entry.getIdentifier()).add(entry);
    }
 else     if (entry instanceof LogEntry.Done) {
      transactions.remove(entry.getIdentifier());
    }
 else {
      throw new RuntimeException("String_Node_Str" + entry);
    }
  }
  if (logEntryList == null) {
    msgLog.logMessage("String_Node_Str" + txId + "String_Node_Str"+ expectedVersion);
    throw new IOException("String_Node_Str" + txId + "String_Node_Str"+ expectedVersion+ "String_Node_Str");
  }
  logEntryList.add(new LogEntry.Done(logEntryList.get(0).getIdentifier()));
  return logEntryList;
}

Fixed version (ground truth):
private List<LogEntry> extractTransactionFromLog(long txId,long expectedVersion,ReadableByteChannel log) throws IOException {
  List<LogEntry> logEntryList=null;
  Map<Integer,List<LogEntry>> transactions=new HashMap<Integer,List<LogEntry>>();
  LogEntry entry;
  while ((entry=LogIoUtils.readEntry(buffer,log,cf)) != null && logEntryList == null) {
    if (entry instanceof LogEntry.Start) {
      List<LogEntry> list=new LinkedList<LogEntry>();
      list.add(entry);
      transactions.put(entry.getIdentifier(),list);
    }
 else     if (entry instanceof LogEntry.Commit) {
      if (((LogEntry.Commit)entry).getTxId() == txId) {
        logEntryList=transactions.get(entry.getIdentifier());
        logEntryList.add(entry);
      }
 else {
        transactions.remove(entry.getIdentifier());
      }
    }
 else     if (entry instanceof LogEntry.Command || entry instanceof LogEntry.Prepare) {
      transactions.get(entry.getIdentifier()).add(entry);
    }
 else     if (entry instanceof LogEntry.Done) {
      transactions.remove(entry.getIdentifier());
    }
 else {
      throw new RuntimeException("String_Node_Str" + entry);
    }
  }
  if (logEntryList == null) {
    msgLog.logMessage("String_Node_Str" + txId + "String_Node_Str"+ expectedVersion);
    throw new IOException("String_Node_Str" + txId + "String_Node_Str"+ expectedVersion+ "String_Node_Str"+ "String_Node_Str"+ this.logVersion+ "String_Node_Str");
  }
  logEntryList.add(new LogEntry.Done(logEntryList.get(0).getIdentifier()));
  return logEntryList;
}
Program: 154783
Project: 154783
Buggy source:
private void applyOnePhaseCommitEntry(LogEntry.OnePhaseCommit commit) throws IOException {
  int identifier=commit.getIdentifier();
  long txId=commit.getTxId();
  LogEntry.Start startEntry=xidIdentMap.get(identifier);
  if (startEntry == null) {
    throw new IOException("String_Node_Str" + identifier);
  }
  Xid xid=startEntry.getXid();
  try {
    XaTransaction xaTx=xaRm.getXaTransaction(xid);
    xaTx.setCommitTxId(txId);
    xaRm.injectOnePhaseCommit(xid);
    cacheTxStartPosition(txId,startEntry);
    msgLog.logMessage("String_Node_Str" + commit.getTxId());
  }
 catch (  XAException e) {
    e.printStackTrace();
    throw new IOException(e.getMessage());
  }
}

Fixed version (ground truth):
private void applyOnePhaseCommitEntry(LogEntry.OnePhaseCommit commit) throws IOException {
  int identifier=commit.getIdentifier();
  long txId=commit.getTxId();
  LogEntry.Start startEntry=xidIdentMap.get(identifier);
  if (startEntry == null) {
    throw new IOException("String_Node_Str" + identifier);
  }
  Xid xid=startEntry.getXid();
  try {
    XaTransaction xaTx=xaRm.getXaTransaction(xid);
    xaTx.setCommitTxId(txId);
    xaRm.injectOnePhaseCommit(xid);
    msgLog.logMessage("String_Node_Str" + commit.getTxId());
  }
 catch (  XAException e) {
    e.printStackTrace();
    throw new IOException(e.getMessage());
  }
}
Program: 154784
Project: 154784
Buggy source:
private void applyTwoPhaseCommitEntry(LogEntry.TwoPhaseCommit commit) throws IOException {
  int identifier=commit.getIdentifier();
  long txId=commit.getTxId();
  LogEntry.Start startEntry=xidIdentMap.get(identifier);
  if (startEntry == null) {
    throw new IOException("String_Node_Str" + identifier);
  }
  Xid xid=startEntry.getXid();
  if (xid == null) {
    throw new IOException("String_Node_Str" + identifier);
  }
  try {
    XaTransaction xaTx=xaRm.getXaTransaction(xid);
    xaTx.setCommitTxId(txId);
    xaRm.injectTwoPhaseCommit(xid);
    cacheTxStartPosition(txId,startEntry);
    msgLog.logMessage("String_Node_Str" + commit.getTxId());
  }
 catch (  XAException e) {
    e.printStackTrace();
    throw new IOException(e.getMessage());
  }
}

Fixed version (ground truth):
private void applyTwoPhaseCommitEntry(LogEntry.TwoPhaseCommit commit) throws IOException {
  int identifier=commit.getIdentifier();
  long txId=commit.getTxId();
  LogEntry.Start startEntry=xidIdentMap.get(identifier);
  if (startEntry == null) {
    throw new IOException("String_Node_Str" + identifier);
  }
  Xid xid=startEntry.getXid();
  if (xid == null) {
    throw new IOException("String_Node_Str" + identifier);
  }
  try {
    XaTransaction xaTx=xaRm.getXaTransaction(xid);
    xaTx.setCommitTxId(txId);
    xaRm.injectTwoPhaseCommit(xid);
    msgLog.logMessage("String_Node_Str" + commit.getTxId());
  }
 catch (  XAException e) {
    e.printStackTrace();
    throw new IOException(e.getMessage());
  }
}
Program: 154785
Project: 154785
Buggy source:
private synchronized void cacheTxStartPosition(long txId,LogEntry.Start startEntry){
  txStartPositionCache.put(txId,new Pair<Long,Long>(logVersion,startEntry.getStartPosition()));
}

Fixed version (ground truth):
private synchronized void cacheTxStartPosition(long txId,LogEntry.Start startEntry){
  if (startEntry.getStartPosition() == -1) {
    throw new RuntimeException("String_Node_Str" + startEntry.getStartPosition());
  }
  txStartPositionCache.put(txId,new Pair<Long,Long>(logVersion,startEntry.getStartPosition()));
}
Program: 154786
Project: 154786
Buggy source:
private void writeOutLogEntryList(List<LogEntry> logEntryList,File txFile,boolean tempWriteOutFirst) throws IOException {
  int identifier=logEntryList.get(0).getIdentifier();
  File tempFile=tempWriteOutFirst ? File.createTempFile(String.valueOf(identifier),"String_Node_Str") : txFile;
  msgLog.logMessage("String_Node_Str" + tempFile);
  FileChannel txLog=new RandomAccessFile(tempFile,"String_Node_Str").getChannel();
  LogBuffer buf=new DirectMappedLogBuffer(txLog);
  for (  LogEntry entry : logEntryList) {
    LogIoUtils.writeLogEntry(entry,buf);
  }
  buf.force();
  txLog.close();
  if (tempWriteOutFirst) {
    if (!tempFile.renameTo(txFile)) {
      throw new IOException("String_Node_Str" + tempFile + "String_Node_Str"+ txFile);
    }
  }
}

Fixed version (ground truth):
private void writeOutLogEntryList(List<LogEntry> logEntryList,File txFile,boolean tempWriteOutFirst) throws IOException {
  int identifier=logEntryList.get(0).getIdentifier();
  File tempFile=tempWriteOutFirst ? File.createTempFile("String_Node_Str","String_Node_Str" + identifier) : txFile;
  msgLog.logMessage("String_Node_Str" + tempFile);
  FileChannel txLog=new RandomAccessFile(tempFile,"String_Node_Str").getChannel();
  LogBuffer buf=new DirectMappedLogBuffer(txLog);
  for (  LogEntry entry : logEntryList) {
    LogIoUtils.writeLogEntry(entry,buf);
  }
  buf.force();
  txLog.close();
  if (tempWriteOutFirst) {
    if (!tempFile.renameTo(txFile)) {
      throw new IOException("String_Node_Str" + tempFile + "String_Node_Str"+ txFile);
    }
  }
}
Program: 154787
Project: 154787
Buggy source:
public synchronized ReadableByteChannel getCommittedTransaction(long txId) throws IOException {
  String name=fileName + "String_Node_Str" + txId;
  File txFile=new File(name);
  List<LogEntry> logEntryList=extractLogEntryList(txId);
  writeOutLogEntryList(logEntryList,txFile,true);
  ReadableByteChannel result=new RandomAccessFile(txFile,"String_Node_Str").getChannel();
  return result;
}

Fixed version (ground truth):
public synchronized ReadableByteChannel getCommittedTransaction(long txId) throws IOException {
  String name=fileName + "String_Node_Str" + txId;
  File txFile=new File(storeDir,name);
  List<LogEntry> logEntryList=extractLogEntryList(txId);
  writeOutLogEntryList(logEntryList,txFile,true);
  ReadableByteChannel result=new RandomAccessFile(txFile,"String_Node_Str").getChannel();
  return result;
}
Program: 154788
Project: 154788
Buggy source:
protected StandaloneDbCom spawnJvm(File path,int port,int machineId,String... extraArgs) throws Exception {
  Collection<String> list=new ArrayList<String>(Arrays.asList("String_Node_Str","String_Node_Str",System.getProperty("String_Node_Str"),StandaloneDb.class.getName(),"String_Node_Str",path.getAbsolutePath(),"String_Node_Str","String_Node_Str" + port,"String_Node_Str","String_Node_Str" + machineId,"String_Node_Str","String_Node_Str"));
  list.addAll(Arrays.asList(extraArgs));
  Runtime.getRuntime().exec(list.toArray(new String[list.size()]));
  StandaloneDbCom result=null;
  long startTime=System.currentTimeMillis();
  RmiLocation location=RmiLocation.location("String_Node_Str",port,"String_Node_Str");
  RemoteException latestException=null;
  while (result == null && (System.currentTimeMillis() - startTime) < 1000 * 10) {
    try {
      result=(StandaloneDbCom)location.getBoundObject();
    }
 catch (    RemoteException e) {
      latestException=e;
      try {
        Thread.sleep(200);
      }
 catch (      InterruptedException ee) {
      }
    }
  }
  if (result == null) {
    throw latestException;
  }
  return result;
}

Fixed version (ground truth):
protected StandaloneDbCom spawnJvm(File path,int port,int machineId,String... extraArgs) throws Exception {
  Collection<String> list=new ArrayList<String>(Arrays.asList("String_Node_Str","String_Node_Str",System.getProperty("String_Node_Str"),StandaloneDb.class.getName(),"String_Node_Str",path.getAbsolutePath(),"String_Node_Str","String_Node_Str" + port,"String_Node_Str","String_Node_Str" + machineId,"String_Node_Str","String_Node_Str"));
  list.addAll(Arrays.asList(extraArgs));
  Runtime.getRuntime().exec(list.toArray(new String[list.size()]));
  return awaitJvmStarted(port);
}
Program: 154789
Project: 154789
Buggy source:
@Override protected void startUpMaster(Map<String,String> config) throws Exception {
  Map<String,String> newConfig=new HashMap<String,String>(config);
  newConfig.put("String_Node_Str","String_Node_Str");
  StandaloneDbCom com=spawnJvm(dbPath(0),MASTER_PORT,0,buildExtraArgs(newConfig));
  com.awaitStarted();
  if (jvms.isEmpty()) {
    jvms.add(com);
  }
 else {
    jvms.set(0,com);
  }
}

Fixed version (ground truth):
@Override protected void startUpMaster(Map<String,String> config) throws Exception {
  Map<String,String> newConfig=new HashMap<String,String>(config);
  newConfig.put("String_Node_Str","String_Node_Str");
  StandaloneDbCom com=spawnJvm(dbPath(0),MASTER_PORT,0,buildExtraArgs(newConfig));
  if (jvms.isEmpty()) {
    jvms.add(com);
  }
 else {
    jvms.set(0,com);
  }
  Thread.sleep(1000);
}
Program: 154790
Project: 154790
Buggy source:
protected void initializeDbs(int numSlaves,Map<String,String> config) throws Exception {
  jvms=new ArrayList<StandaloneDbCom>();
  try {
    createDeadDbs(numSlaves);
    startUpMaster(config);
    for (int i=1; i <= numSlaves; i++) {
      File slavePath=dbPath(i);
      StandaloneDbCom slaveJvm=spawnJvm(slavePath,MASTER_PORT + i,i,buildExtraArgs(config));
      jvms.add(slaveJvm);
    }
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
protected void initializeDbs(int numSlaves,Map<String,String> config) throws Exception {
  jvms=new ArrayList<StandaloneDbCom>();
  try {
    createDeadDbs(numSlaves);
    startUpMaster(config);
    for (int i=1; i <= numSlaves; i++) {
      File slavePath=dbPath(i);
      StandaloneDbCom slaveJvm=spawnJvm(slavePath,MASTER_PORT + i,i,buildExtraArgs(config));
      jvms.add(slaveJvm);
    }
    Thread.sleep(1000);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 154793
Project: 154793
Buggy source:
/** 
 * Return the highest id in use.
 * @return The highest id in use.
 */
public long getHighId(){
  return idGenerator != null ? idGenerator.getHighId() : -1;
}

Fixed version (ground truth):
/** 
 * Return the highest id in use.
 * @return The highest id in use.
 */
public long getHighId(){
  long genHighId=idGenerator != null ? idGenerator.getHighId() : -1;
  long updateHighId=highestUpdateRecordId;
  if (updateHighId > genHighId) {
    return updateHighId;
  }
  return genHighId;
}
Program: 154794
Project: 154794
Buggy source:
/** 
 * Acquires a   {@link PersistenceWindow} for <CODE>position</CODE> andoperation <CODE>type</CODE>. Window must be released after operation has been performed via  {@link #releaseWindow(PersistenceWindow)}.
 * @param position The record position
 * @param type The operation type
 * @return a persistence window encapsulating the record
 * @throws IOException If unable to acquire window
 */
protected PersistenceWindow acquireWindow(int sPosition,OperationType type){
  long position=makeUnsignedInt(sPosition);
  if (!isInRecoveryMode() && (position > idGenerator.getHighId() || !storeOk)) {
    throw new InvalidRecordException("String_Node_Str" + position + "String_Node_Str"+ idGenerator.getHighId()+ "String_Node_Str"+ storeOk+ "String_Node_Str");
  }
  return windowPool.acquire(position,type);
}

Fixed version (ground truth):
/** 
 * Acquires a   {@link PersistenceWindow} for <CODE>position</CODE> andoperation <CODE>type</CODE>. Window must be released after operation has been performed via  {@link #releaseWindow(PersistenceWindow)}.
 * @param position The record position
 * @param type The operation type
 * @return a persistence window encapsulating the record
 * @throws IOException If unable to acquire window
 */
protected PersistenceWindow acquireWindow(int sPosition,OperationType type){
  long position=makeUnsignedInt(sPosition);
  if (!isInRecoveryMode() && (position > getHighId() || !storeOk)) {
    throw new InvalidRecordException("String_Node_Str" + position + "String_Node_Str"+ getHighId()+ "String_Node_Str"+ storeOk+ "String_Node_Str");
  }
  return windowPool.acquire(position,type);
}
Program: 154796
Project: 154796
Buggy source:
/** 
 * @param startCost Starting cost for both the start node and the end node
 * @param startNode the start node
 * @param endNode the end node
 * @param costRelationType the relationship that should be included in thepath
 * @param relationDirection relationship direction to follow
 * @param costEvaluator the cost function per relationship
 * @param costAccumulator adding up the path cost
 * @param costComparator comparing to path costs
 */
public Dijkstra(CostType startCost,Node startNode,Node endNode,CostEvaluator<CostType> costEvaluator,CostAccumulator<CostType> costAccumulator,Comparator<CostType> costComparator,Direction relationDirection,RelationshipType... costRelationTypes){
  super();
  this.startCost=startCost;
  this.startNode=startNode;
  this.endNode=endNode;
  this.costRelationTypes=costRelationTypes;
  this.relationDirection=relationDirection;
  this.costEvaluator=costEvaluator;
  this.costAccumulator=costAccumulator;
  this.costComparator=costComparator;
}

Fixed version (ground truth):
/** 
 * @param startCost Starting cost for both the start node and the end node
 * @param startNode the start node
 * @param endNode the end node
 * @param costRelationTypes the relationship that should be included in thepath
 * @param relationDirection relationship direction to follow
 * @param costEvaluator the cost function per relationship
 * @param costAccumulator adding up the path cost
 * @param costComparator comparing to path costs
 */
public Dijkstra(CostType startCost,Node startNode,Node endNode,CostEvaluator<CostType> costEvaluator,CostAccumulator<CostType> costAccumulator,Comparator<CostType> costComparator,Direction relationDirection,RelationshipType... costRelationTypes){
  super();
  this.startCost=startCost;
  this.startNode=startNode;
  this.endNode=endNode;
  this.costRelationTypes=costRelationTypes;
  this.relationDirection=relationDirection;
  this.costEvaluator=costEvaluator;
  this.costAccumulator=costAccumulator;
  this.costComparator=costComparator;
}