nus-yam/ex-repair huggingface dataset:
Program: 155101
Project: 155101
Buggy source:
public synchronized void registerCache(Cache<?,?> cache,float ratio,int minSize){
  if (cache == null || ratio >= 1 || ratio <= 0 || minSize < 0) {
    throw new IllegalArgumentException("String_Node_Str" + cache + "String_Node_Str"+ ratio+ "String_Node_Str"+ minSize);
  }
  if (cache instanceof SoftLruCache) {
    softCaches.add((SoftLruCache<?,?>)cache);
    return;
  }
  for (  AdaptiveCacheElement element : caches) {
    if (element.getCache() == cache) {
      log.fine("String_Node_Str" + cache.getName() + "String_Node_Str");
      return;
    }
  }
  AdaptiveCacheElement element=new AdaptiveCacheElement(cache,ratio,minSize);
  caches.add(element);
  cache.setAdaptiveStatus(true);
  log.fine("String_Node_Str" + cache.getName() + "String_Node_Str"+ ratio+ "String_Node_Str"+ minSize+ "String_Node_Str");
}

Fixed version (ground truth):
public synchronized void registerCache(Cache<?,?> cache,float ratio,int minSize){
  if (cache == null || ratio >= 1 || ratio <= 0 || minSize < 0) {
    throw new IllegalArgumentException("String_Node_Str" + cache + "String_Node_Str"+ ratio+ "String_Node_Str"+ minSize);
  }
  if (cache instanceof SoftLruCache<?,?>) {
    softCaches.add((SoftLruCache<?,?>)cache);
    return;
  }
  for (  AdaptiveCacheElement element : caches) {
    if (element.getCache() == cache) {
      log.fine("String_Node_Str" + cache.getName() + "String_Node_Str");
      return;
    }
  }
  AdaptiveCacheElement element=new AdaptiveCacheElement(cache,ratio,minSize);
  caches.add(element);
  cache.setAdaptiveStatus(true);
  log.fine("String_Node_Str" + cache.getName() + "String_Node_Str"+ ratio+ "String_Node_Str"+ minSize+ "String_Node_Str");
}
Program: 155102
Project: 155102
Buggy source:
public synchronized void unregisterCache(Cache<?,?> cache){
  if (cache == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (cache instanceof SoftLruCache) {
    softCaches.remove(cache);
    return;
  }
  Iterator<AdaptiveCacheElement> itr=caches.iterator();
  while (itr.hasNext()) {
    AdaptiveCacheElement element=itr.next();
    if (element.getCache() == cache) {
      itr.remove();
      break;
    }
  }
  log.fine("String_Node_Str" + cache.getName() + "String_Node_Str");
}

Fixed version (ground truth):
public synchronized void unregisterCache(Cache<?,?> cache){
  if (cache == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (cache instanceof SoftLruCache<?,?>) {
    softCaches.remove(cache);
    return;
  }
  Iterator<AdaptiveCacheElement> itr=caches.iterator();
  while (itr.hasNext()) {
    AdaptiveCacheElement element=itr.next();
    if (element.getCache() == cache) {
      itr.remove();
      break;
    }
  }
  log.fine("String_Node_Str" + cache.getName() + "String_Node_Str");
}
Program: 155103
Project: 155103
Buggy source:
public void pollAll(){
  SoftValue cv;
  while ((cv=(SoftValue)refQueue.poll()) != null) {
    cache.remove(cv.key);
  }
}

Fixed version (ground truth):
public void pollAll(){
  SoftValue<?,?> cv;
  while ((cv=(SoftValue<?,?>)refQueue.poll()) != null) {
    cache.remove(cv.key);
  }
}
Program: 155104
Project: 155104
Buggy source:
TxCommitHook(Transaction tx){
  this.tx=tx;
}

Fixed version (ground truth):
TxCommitHook(){
}
Program: 155105
Project: 155105
Buggy source:
PropertyIndex createPropertyIndex(String key){
  Transaction tx=getTransaction();
  if (tx == null) {
    throw new NotInTransactionException("String_Node_Str" + key);
  }
  TxCommitHook hook=txCommitHooks.get(tx);
  if (hook == null) {
    hook=new TxCommitHook(tx);
    txCommitHooks.put(tx,hook);
  }
  PropertyIndex index=hook.getIndex(key);
  if (index != null) {
    return index;
  }
  int id=idGenerator.nextId(PropertyIndex.class);
  index=new PropertyIndex(key,id);
  hook.addIndex(index);
  persistenceManager.createPropertyIndex(key,id);
  return index;
}

Fixed version (ground truth):
PropertyIndex createPropertyIndex(String key){
  Transaction tx=getTransaction();
  if (tx == null) {
    throw new NotInTransactionException("String_Node_Str" + key);
  }
  TxCommitHook hook=txCommitHooks.get(tx);
  if (hook == null) {
    hook=new TxCommitHook();
    txCommitHooks.put(tx,hook);
  }
  PropertyIndex index=hook.getIndex(key);
  if (index != null) {
    return index;
  }
  int id=idGenerator.nextId(PropertyIndex.class);
  index=new PropertyIndex(key,id);
  hook.addIndex(index);
  persistenceManager.createPropertyIndex(key,id);
  return index;
}
Program: 155106
Project: 155106
Buggy source:
RelationshipTypeEventConsumerImpl(NeoStoreXaConnection xaCon){
  this.xaCon=xaCon;
  this.relTypeStore=getRelationshipTypeStore();
}

Fixed version (ground truth):
RelationshipTypeEventConsumerImpl(NeoStoreXaConnection xaCon){
  this.xaCon=xaCon;
  this.relTypeStore=xaCon.getRelationshipTypeStore();
}
Program: 155107
Project: 155107
Buggy source:
public RelationshipEventConsumerImpl(NeoStoreXaConnection xaCon){
  this.xaCon=xaCon;
  this.relStore=getRelationshipStore();
}

Fixed version (ground truth):
public RelationshipEventConsumerImpl(NeoStoreXaConnection xaCon){
  this.xaCon=xaCon;
}
Program: 155108
Project: 155108
Buggy source:
public NodeEventConsumerImpl(NeoStoreXaConnection xaCon){
  this.xaCon=xaCon;
  nodeStore=getNodeStore();
}

Fixed version (ground truth):
public NodeEventConsumerImpl(NeoStoreXaConnection xaCon){
  this.xaCon=xaCon;
}
Program: 155110
Project: 155110
Buggy source:
public Relationship createRelationshipTo(Node otherNode,RelationshipType type){
  long relId=neoService.getBatchInserter().createRelationship(id,otherNode.getId(),type,null);
  RelationshipBatchImpl rel=new RelationshipBatchImpl(new SimpleRelationship((int)relId,(int)id,(int)otherNode.getId(),type),neoService,emptyProps());
  neoService.addRelationshipToCache(id,rel);
  return rel;
}

Fixed version (ground truth):
public Relationship createRelationshipTo(Node otherNode,RelationshipType type){
  long relId=neoService.getBatchInserter().createRelationship(id,otherNode.getId(),type,null);
  RelationshipBatchImpl rel=new RelationshipBatchImpl(new SimpleRelationship((int)relId,(int)id,(int)otherNode.getId(),type),neoService,emptyProps());
  neoService.addRelationshipToCache(relId,rel);
  return rel;
}
Program: 155111
Project: 155111
Buggy source:
private static void createExampleNodeSpace(){
  Transaction tx=neo.beginTx();
  try {
    System.out.println("String_Node_Str");
    Node usersReferenceNode=neo.createNode();
    neo.getReferenceNode().createRelationshipTo(usersReferenceNode,RelTypes.USERS_REFERENCE);
    for (int id=0; id < 100; id++) {
      Node userNode=createUser(formUserName(id));
      usersReferenceNode.createRelationshipTo(userNode,RelTypes.USER);
    }
    tx.success();
  }
  finally {
    tx.finish();
  }
}

Fixed version (ground truth):
private static void createExampleNodeSpace(){
  Transaction tx=neo.beginTx();
  try {
    System.out.println("String_Node_Str");
    Random random=new Random();
    Node usersReferenceNode=neo.createNode();
    neo.getReferenceNode().createRelationshipTo(usersReferenceNode,RelTypes.USERS_REFERENCE);
    List<Node> users=new ArrayList<Node>();
    for (int id=0; id < 100; id++) {
      Node userNode=createUser(formUserName(id));
      usersReferenceNode.createRelationshipTo(userNode,RelTypes.USER);
      if (id > 10) {
        int numberOfFriends=random.nextInt(5);
        Set<Node> knows=new HashSet<Node>();
        for (int i=0; i < numberOfFriends; i++) {
          Node friend=users.get(random.nextInt(users.size()));
          if (knows.add(friend)) {
            userNode.createRelationshipTo(friend,RelTypes.KNOWS);
          }
        }
      }
      users.add(userNode);
    }
    tx.success();
  }
  finally {
    tx.finish();
  }
}
Program: 155112
Project: 155112
Buggy source:
public static void main(String[] args) throws Exception {
  neo=new EmbeddedNeo(NEO_DB_PATH);
  registerShutdownHookForNeo();
  createExampleNodeSpace();
  boolean trueForLocal=waitForUserInput("String_Node_Str" + "String_Node_Str" + "String_Node_Str").equalsIgnoreCase("String_Node_Str");
  if (trueForLocal) {
    startLocalShell();
  }
 else {
    startRemoteShellAndWait();
  }
  deleteExampleNodeSpace();
  System.out.println("String_Node_Str");
  shutdown();
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  registerShutdownHookForNeo();
  startNeo();
  createExampleNodeSpace();
  boolean trueForLocal=waitForUserInput("String_Node_Str" + "String_Node_Str" + "String_Node_Str").equalsIgnoreCase("String_Node_Str");
  if (trueForLocal) {
    startLocalShell();
  }
 else {
    startRemoteShellAndWait();
  }
  System.out.println("String_Node_Str");
  shutdown();
}
Program: 155113
Project: 155113
Buggy source:
private static void deleteExampleNodeSpace(){
  Transaction tx=neo.beginTx();
  try {
    System.out.println("String_Node_Str");
    Node usersReferenceNode=neo.getReferenceNode().getSingleRelationship(RelTypes.USERS_REFERENCE,Direction.OUTGOING).getEndNode();
    for (    Relationship relationship : usersReferenceNode.getRelationships(RelTypes.USER,Direction.OUTGOING)) {
      Node user=relationship.getEndNode();
      user.delete();
      relationship.delete();
    }
    usersReferenceNode.getSingleRelationship(RelTypes.USERS_REFERENCE,Direction.INCOMING).delete();
    usersReferenceNode.delete();
    tx.success();
  }
  finally {
    tx.finish();
  }
}

Fixed version (ground truth):
private static void deleteExampleNodeSpace(){
  Transaction tx=neo.beginTx();
  try {
    System.out.println("String_Node_Str");
    Node usersReferenceNode=neo.getReferenceNode().getSingleRelationship(RelTypes.USERS_REFERENCE,Direction.OUTGOING).getEndNode();
    for (    Relationship relationship : usersReferenceNode.getRelationships(RelTypes.USER,Direction.OUTGOING)) {
      Node user=relationship.getEndNode();
      for (      Relationship knowsRelationship : user.getRelationships(RelTypes.KNOWS)) {
        knowsRelationship.delete();
      }
      user.delete();
      relationship.delete();
    }
    usersReferenceNode.getSingleRelationship(RelTypes.USERS_REFERENCE,Direction.INCOMING).delete();
    usersReferenceNode.delete();
    tx.success();
  }
  finally {
    tx.finish();
  }
}
Program: 155114
Project: 155114
Buggy source:
private static void startLocalShell() throws Exception {
  ShellServer shellServer=new LocalNeoShellServer(neo);
  new SameJvmClient(shellServer).grabPrompt();
  shellServer.shutdown();
}

Fixed version (ground truth):
private static void startLocalShell() throws Exception {
  shutdownNeo();
  ShellServer shellServer=new LocalNeoShellServer(NEO_DB_PATH,false);
  new SameJvmClient(shellServer).grabPrompt();
  shellServer.shutdown();
  startNeo();
}
Program: 155115
Project: 155115
Buggy source:
private static void shutdown(){
  neo.shutdown();
}

Fixed version (ground truth):
private static void shutdown(){
  if (neo != null) {
    deleteExampleNodeSpace();
    shutdownNeo();
  }
}
Program: 155116
Project: 155116
Buggy source:
private void getNextElement(){
  while (nextElement == null && relItr.hasNext()) {
    Relationship possibleRel=neoService.getRelationshipById(relItr.next());
    if (dir == Direction.OUTGOING && possibleRel.getEndNode().getId() == nodeId) {
      continue;
    }
    if (dir == Direction.INCOMING && possibleRel.getStartNode().getId() == nodeId) {
      continue;
    }
    if (types != null) {
      for (      RelationshipType type : types) {
        if (type.name().equals(possibleRel.getType().name())) {
          nextElement=possibleRel;
          break;
        }
      }
    }
    nextElement=possibleRel;
  }
}

Fixed version (ground truth):
private void getNextElement(){
  while (nextElement == null && relItr.hasNext()) {
    Relationship possibleRel=neoService.getRelationshipById(relItr.next());
    if (dir == Direction.OUTGOING && possibleRel.getEndNode().getId() == nodeId) {
      continue;
    }
    if (dir == Direction.INCOMING && possibleRel.getStartNode().getId() == nodeId) {
      continue;
    }
    if (types != null) {
      for (      RelationshipType type : types) {
        if (type.name().equals(possibleRel.getType().name())) {
          nextElement=possibleRel;
          break;
        }
      }
    }
 else {
      nextElement=possibleRel;
    }
  }
}
Program: 155117
Project: 155117
Buggy source:
public EmbeddedReadOnlyNeo(String storeDir,Map<String,String> params){
  this.neoImpl=new EmbeddedNeoImpl(storeDir,params,this);
}

Fixed version (ground truth):
public EmbeddedReadOnlyNeo(String storeDir,Map<String,String> params){
  params.put("String_Node_Str","String_Node_Str");
  this.neoImpl=new EmbeddedNeoImpl(storeDir,params,this);
}
Program: 155118
Project: 155118
Buggy source:
private void sendUdpPingStarted(){
  sessionId=r.nextLong();
  sendUdpPing(NEO_STARTED,sessionId);
  timer.schedule(new TimerTask(){
    @Override public void run(){
      sendUdpPingRunning();
    }
  }
,UDP_PING_DELAY);
}

Fixed version (ground truth):
private void sendUdpPingStarted(){
  sessionId=r.nextLong();
  final ByteBuffer buf=setupUdpPing(NEO_STARTED,sessionId);
  timer.schedule(new TimerTask(){
    @Override public void run(){
      SocketAddress host=new InetSocketAddress(UDP_HOST,UDP_PORT);
      new UdpPinger(buf,host).sendPing();
    }
  }
,0);
  timer.schedule(new TimerTask(){
    @Override public void run(){
      ByteBuffer buffer=setupUdpPing(NEO_RUNNING,sessionId);
      SocketAddress host=new InetSocketAddress(UDP_HOST,UDP_PORT);
      new UdpPinger(buffer,host).sendPing();
    }
  }
,UDP_PING_DELAY,UDP_PING_DELAY);
}
Program: 155119
Project: 155119
Buggy source:
@Override public void run(){
  sendUdpPingRunning();
}

Fixed version (ground truth):
@Override public void run(){
  ByteBuffer buffer=setupUdpPing(NEO_RUNNING,sessionId);
  SocketAddress host=new InetSocketAddress(UDP_HOST,UDP_PORT);
  new UdpPinger(buffer,host).sendPing();
}
Program: 155120
Project: 155120
Buggy source:
private void sendUdpPingShutdown(){
  sendUdpPing(NEO_SHUTDOWN,sessionId);
}

Fixed version (ground truth):
private void sendUdpPingShutdown(){
  ByteBuffer buf=setupUdpPing(NEO_SHUTDOWN,sessionId);
  SocketAddress host=new InetSocketAddress(UDP_HOST,UDP_PORT);
  new UdpPinger(buf,host).sendPing();
}
Program: 155121
Project: 155121
Buggy source:
public void sendPing(){
  new Thread(){
    public void run(){
      try {
        DatagramChannel sendChannel=DatagramChannel.open();
        sendChannel.send(buf,host);
        sendChannel.close();
      }
 catch (      Exception e) {
      }
    }
  }
.start();
}

Fixed version (ground truth):
public void sendPing(){
  try {
    DatagramChannel sendChannel=DatagramChannel.open();
    sendChannel.send(buf,host);
    sendChannel.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 155122
Project: 155122
Buggy source:
/** 
 * Sets the highest id in use (use this when rebuilding id generator).
 * @param highId The high id to set.
 */
protected void setHighId(long highId){
  idGenerator.setHighId(highId);
}

Fixed version (ground truth):
/** 
 * Sets the highest id in use (use this when rebuilding id generator).
 * @param highId The high id to set.
 */
protected void setHighId(long highId){
  if (idGenerator != null) {
    idGenerator.setHighId(highId);
  }
}
Program: 155123
Project: 155123
Buggy source:
private void commitRecovered(){
  try {
    committed=true;
    CommandSorter sorter=new CommandSorter();
    java.util.Collections.sort(relTypeCommands,sorter);
    for (    Command.RelationshipTypeCommand command : relTypeCommands) {
      command.execute();
      addRelationshipType(command.getKey());
    }
    java.util.Collections.sort(nodeCommands,sorter);
    for (    Command.NodeCommand command : nodeCommands) {
      command.execute();
      removeNodeFromCache(command.getKey());
    }
    java.util.Collections.sort(relCommands,sorter);
    for (    Command.RelationshipCommand command : relCommands) {
      command.execute();
      removeRelationshipFromCache(command.getKey());
    }
    java.util.Collections.sort(propIndexCommands,sorter);
    for (    Command.PropertyIndexCommand command : propIndexCommands) {
      command.execute();
      addPropertyIndexCommand(command.getKey());
    }
    java.util.Collections.sort(propCommands,sorter);
    for (    Command.PropertyCommand command : propCommands) {
      command.execute();
    }
    if (!isRecovered()) {
      lockReleaser.commit();
    }
  }
  finally {
    nodeRecords.clear();
    propertyRecords.clear();
    relRecords.clear();
    relTypeRecords.clear();
    propIndexRecords.clear();
    nodeCommands.clear();
    propCommands.clear();
    propIndexCommands.clear();
    relCommands.clear();
    relTypeCommands.clear();
  }
}

Fixed version (ground truth):
private void commitRecovered(){
  try {
    committed=true;
    CommandSorter sorter=new CommandSorter();
    java.util.Collections.sort(relTypeCommands,sorter);
    for (    Command.RelationshipTypeCommand command : relTypeCommands) {
      command.execute();
      addRelationshipType(command.getKey());
    }
    java.util.Collections.sort(nodeCommands,sorter);
    for (    Command.NodeCommand command : nodeCommands) {
      command.execute();
      removeNodeFromCache(command.getKey());
    }
    java.util.Collections.sort(relCommands,sorter);
    for (    Command.RelationshipCommand command : relCommands) {
      command.execute();
      removeRelationshipFromCache(command.getKey());
    }
    java.util.Collections.sort(propIndexCommands,sorter);
    for (    Command.PropertyIndexCommand command : propIndexCommands) {
      command.execute();
      addPropertyIndexCommand(command.getKey());
    }
    java.util.Collections.sort(propCommands,sorter);
    for (    Command.PropertyCommand command : propCommands) {
      command.execute();
      removePropertyFromCache(command);
    }
    neoStore.updateIdGenerators();
    if (!isRecovered()) {
      lockReleaser.commit();
    }
  }
  finally {
    nodeRecords.clear();
    propertyRecords.clear();
    relRecords.clear();
    relTypeRecords.clear();
    propIndexRecords.clear();
    nodeCommands.clear();
    propCommands.clear();
    propIndexCommands.clear();
    relCommands.clear();
    relTypeCommands.clear();
  }
}
Program: 155124
Project: 155124
Buggy source:
public void recoveryComplete(){
  logger.fine("String_Node_Str" + "String_Node_Str");
  logger.fine("String_Node_Str" + "String_Node_Str");
  neoStore.makeStoreOk();
  logger.fine("String_Node_Str");
}

Fixed version (ground truth):
public void recoveryComplete(){
  logger.fine("String_Node_Str" + "String_Node_Str");
  logger.fine("String_Node_Str" + "String_Node_Str");
  neoStore.flushAll();
  neoStore.makeStoreOk();
  logger.fine("String_Node_Str");
}
Program: 155125
Project: 155125
Buggy source:
@Override public Iterable<String> getAllAvailableCommands(){
  return this.apps.keySet();
}

Fixed version (ground truth):
@Override public Iterable<String> getAllAvailableCommands(){
  return new ArrayList<String>(apps.keySet());
}
Program: 155126
Project: 155126
Buggy source:
public void removeRelationshipTypeFromCache(int id){
  nodeManager.removeRelationshipTypeFromCache(id);
}

Fixed version (ground truth):
public void removeRelationshipTypeFromCache(int id){
  if (nodeManager != null) {
    nodeManager.removeRelationshipTypeFromCache(id);
  }
}
Program: 155127
Project: 155127
Buggy source:
public void addPropertyIndex(PropertyIndexData index){
  nodeManager.addPropertyIndex(index);
}

Fixed version (ground truth):
public void addPropertyIndex(PropertyIndexData index){
  if (nodeManager != null) {
    nodeManager.addPropertyIndex(index);
  }
}
Program: 155128
Project: 155128
Buggy source:
public void removeNodeFromCache(int nodeId){
  nodeManager.removeNodeFromCache(nodeId);
}

Fixed version (ground truth):
public void removeNodeFromCache(int nodeId){
  if (nodeManager != null) {
    nodeManager.removeNodeFromCache(nodeId);
  }
}
Program: 155129
Project: 155129
Buggy source:
public void removeRelationshipFromCache(int id){
  nodeManager.removeRelationshipFromCache(id);
}

Fixed version (ground truth):
public void removeRelationshipFromCache(int id){
  if (nodeManager != null) {
    nodeManager.removeRelationshipFromCache(id);
  }
}
Program: 155130
Project: 155130
Buggy source:
public void addRelationshipType(RelationshipTypeData type){
  nodeManager.addRelationshipType(type);
}

Fixed version (ground truth):
public void addRelationshipType(RelationshipTypeData type){
  if (nodeManager != null) {
    nodeManager.addRelationshipType(type);
  }
}
Program: 155131
Project: 155131
Buggy source:
public PropertyIndexData getPropertyIndex(int id){
  PropertyIndexRecord record=getRecord(id);
  return new PropertyIndexData(record.getId(),getStringFor(record));
}

Fixed version (ground truth):
public PropertyIndexData getPropertyIndex(int id,boolean recovered){
  assert recovered;
  try {
    setRecovered();
    PropertyIndexRecord record=getRecord(id);
    return new PropertyIndexData(record.getId(),getStringFor(record));
  }
  finally {
    unsetRecovered();
  }
}
Program: 155132
Project: 155132
Buggy source:
private void addPropertyIndexCommand(int id){
  PropertyIndexData index=neoStore.getPropertyStore().getIndexStore().getPropertyIndex(id);
  lockReleaser.addPropertyIndex(index);
}

Fixed version (ground truth):
private void addPropertyIndexCommand(int id){
  PropertyIndexData index;
  if (isRecovered()) {
    index=neoStore.getPropertyStore().getIndexStore().getPropertyIndex(id,true);
  }
 else {
    index=neoStore.getPropertyStore().getIndexStore().getPropertyIndex(id);
  }
  lockReleaser.addPropertyIndex(index);
}
Program: 155133
Project: 155133
Buggy source:
private void addRelationshipType(int id){
  RelationshipTypeData type=neoStore.getRelationshipTypeStore().getRelationshipType(id);
  lockReleaser.addRelationshipType(type);
}

Fixed version (ground truth):
private void addRelationshipType(int id){
  setRecovered();
  RelationshipTypeData type;
  if (isRecovered()) {
    type=neoStore.getRelationshipTypeStore().getRelationshipType(id,true);
  }
 else {
    type=neoStore.getRelationshipTypeStore().getRelationshipType(id);
  }
  lockReleaser.addRelationshipType(type);
}
Program: 155134
Project: 155134
Buggy source:
private static String findTitle(NeoShellServer server,Session session,Node node){
  String keys=(String)safeGet(session,AbstractClient.TITLE_KEYS_KEY);
  if (keys == null) {
    return null;
  }
  String[] titleKeys=keys.split(Pattern.quote("String_Node_Str"));
  Pattern[] patterns=new Pattern[titleKeys.length];
  for (int i=0; i < titleKeys.length; i++) {
    patterns[i]=Pattern.compile(titleKeys[i]);
  }
  for (  String nodeKey : node.getPropertyKeys()) {
    for (    Pattern pattern : patterns) {
      if (matches(pattern,nodeKey,false,false)) {
        return trimLength(session,Ls.format(node.getProperty(nodeKey),false));
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private static String findTitle(NeoShellServer server,Session session,Node node){
  String keys=(String)safeGet(session,AbstractClient.TITLE_KEYS_KEY);
  if (keys == null) {
    return null;
  }
  String[] titleKeys=keys.split(Pattern.quote("String_Node_Str"));
  Pattern[] patterns=new Pattern[titleKeys.length];
  for (int i=0; i < titleKeys.length; i++) {
    patterns[i]=Pattern.compile(titleKeys[i]);
  }
  for (  Pattern pattern : patterns) {
    for (    String nodeKey : node.getPropertyKeys()) {
      if (matches(pattern,nodeKey,false,false)) {
        return trimLength(session,Ls.format(node.getProperty(nodeKey),false));
      }
    }
  }
  return null;
}
Program: 155135
Project: 155135
Buggy source:
public void createNode(long id,Map<String,Object> properties){
  if (id < 0 || id > 0xFFFFFFFFL) {
    throw new IllegalArgumentException("String_Node_Str" + id);
  }
  int nodeId=(int)(id & 0xFFFFFFFF);
  NodeStore nodeStore=neoStore.getNodeStore();
  if (neoStore.getNodeStore().loadLightNode(nodeId)) {
    throw new IllegalArgumentException("String_Node_Str" + id + "String_Node_Str");
  }
  long highId=nodeStore.getHighId();
  if (highId <= id) {
    nodeStore.setHighId(nodeId + 1);
  }
  NodeRecord nodeRecord=new NodeRecord(nodeId);
  nodeRecord.setInUse(true);
  nodeRecord.setCreated();
  nodeRecord.setNextProp(createPropertyChain(properties));
}

Fixed version (ground truth):
public void createNode(long id,Map<String,Object> properties){
  if (id < 0 || id > 0xFFFFFFFFL) {
    throw new IllegalArgumentException("String_Node_Str" + id);
  }
  int nodeId=(int)(id & 0xFFFFFFFF);
  NodeStore nodeStore=neoStore.getNodeStore();
  if (neoStore.getNodeStore().loadLightNode(nodeId)) {
    throw new IllegalArgumentException("String_Node_Str" + id + "String_Node_Str");
  }
  long highId=nodeStore.getHighId();
  if (highId <= id) {
    nodeStore.setHighId(nodeId + 1);
  }
  NodeRecord nodeRecord=new NodeRecord(nodeId);
  nodeRecord.setInUse(true);
  nodeRecord.setCreated();
  nodeRecord.setNextProp(createPropertyChain(properties));
  getNodeStore().updateRecord(nodeRecord);
}
Program: 155136
Project: 155136
Buggy source:
public String toString(){
  return "String_Node_Str" + buf + "String_Node_Str"+ persistenceWindow+ "String_Node_Str";
}

Fixed version (ground truth):
public String toString(){
  return "String_Node_Str" + buf.position() + "String_Node_Str"+ buf.capacity()+ "String_Node_Str"+ persistenceWindow+ "String_Node_Str";
}
Program: 155137
Project: 155137
Buggy source:
EventElement getNextEventElement(){
synchronized (eventElements) {
    if (eventElements == null) {
      return null;
    }
    if (!eventElements.isEmpty()) {
      try {
        return eventElements.removeFirst();
      }
 catch (      NoSuchElementException e) {
      }
    }
  }
  return null;
}

Fixed version (ground truth):
EventElement getNextEventElement(){
synchronized (eventElements) {
    if (!eventElements.isEmpty()) {
      try {
        return eventElements.removeFirst();
      }
 catch (      NoSuchElementException e) {
      }
    }
  }
  return null;
}
Program: 155138
Project: 155138
Buggy source:
void readPosition(){
  try {
    long fileSize=getFileChannel().size();
    long recordCount=fileSize / recordSize;
    if (position > recordCount) {
      return;
    }
    ByteBuffer byteBuffer=buffer.getBuffer();
    byteBuffer.clear();
    int count=getFileChannel().read(byteBuffer,position * recordSize);
    byteBuffer.clear();
  }
 catch (  IOException e) {
    throw new StoreFailureException("String_Node_Str" + position + "String_Node_Str"+ position * recordSize + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
void readPosition(){
  try {
    long fileSize=getFileChannel().size();
    long recordCount=fileSize / recordSize;
    if (position > recordCount) {
      return;
    }
    ByteBuffer byteBuffer=buffer.getBuffer();
    byteBuffer.clear();
    getFileChannel().read(byteBuffer,position * recordSize);
    byteBuffer.clear();
  }
 catch (  IOException e) {
    throw new StoreFailureException("String_Node_Str" + position + "String_Node_Str"+ position * recordSize + "String_Node_Str",e);
  }
}
Program: 155139
Project: 155139
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=new Random(time).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.flip();
    try {
      getFileChannel().write(buffer,0);
    }
 catch (    IOException e) {
      throw new StoreFailureException(e);
    }
    rebuildIdGenerator();
    closeIdGenerator();
    return true;
  }
 else   if (version.equals("String_Node_Str")) {
    rebuildIdGenerator();
    closeIdGenerator();
    return true;
  }
  throw new RuntimeException("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[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.flip();
    try {
      getFileChannel().write(buffer,0);
    }
 catch (    IOException e) {
      throw new StoreFailureException(e);
    }
    rebuildIdGenerator();
    closeIdGenerator();
    return true;
  }
 else   if (version.equals("String_Node_Str")) {
    rebuildIdGenerator();
    closeIdGenerator();
    return true;
  }
  throw new RuntimeException("String_Node_Str" + version + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}
Program: 155140
Project: 155140
Buggy source:
/** 
 * Creates the neo,node,relationship,property and relationship type stores.
 * @param fileName The name of neo store
 * @throws IOException If unable to create stores or name null
 */
public static void createStore(String fileName){
  createEmptyStore(fileName,VERSION);
  NodeStore.createStore(fileName + "String_Node_Str");
  RelationshipStore.createStore(fileName + "String_Node_Str");
  PropertyStore.createStore(fileName + "String_Node_Str");
  RelationshipTypeStore.createStore(fileName + "String_Node_Str");
  NeoStore neoStore=new NeoStore(fileName);
  neoStore.nextId();
  neoStore.nextId();
  neoStore.nextId();
  long time=System.currentTimeMillis();
  neoStore.setCreationTime(time);
  neoStore.setRandomNumber(new Random(time).nextLong());
  neoStore.setVersion(0);
  neoStore.close();
}

Fixed version (ground truth):
/** 
 * Creates the neo,node,relationship,property and relationship type stores.
 * @param fileName The name of neo store
 * @throws IOException If unable to create stores or name null
 */
public static void createStore(String fileName){
  createEmptyStore(fileName,VERSION);
  NodeStore.createStore(fileName + "String_Node_Str");
  RelationshipStore.createStore(fileName + "String_Node_Str");
  PropertyStore.createStore(fileName + "String_Node_Str");
  RelationshipTypeStore.createStore(fileName + "String_Node_Str");
  NeoStore neoStore=new NeoStore(fileName);
  neoStore.nextId();
  neoStore.nextId();
  neoStore.nextId();
  long time=System.currentTimeMillis();
  neoStore.setCreationTime(time);
  neoStore.setRandomNumber(r.nextLong());
  neoStore.setVersion(0);
  neoStore.close();
}
Program: 155141
Project: 155141
Buggy source:
private RelationshipRecord getRelationshipRecord(long id){
  if (id < 0 || id >= getNodeStore().getHighId()) {
    throw new IllegalArgumentException("String_Node_Str" + id);
  }
  return getRelationshipStore().getRecord((int)(id & 0xFFFFFFFF));
}

Fixed version (ground truth):
private RelationshipRecord getRelationshipRecord(long id){
  if (id < 0 || id >= getRelationshipStore().getHighId()) {
    throw new IllegalArgumentException("String_Node_Str" + id);
  }
  return getRelationshipStore().getRecord((int)(id & 0xFFFFFFFF));
}
Program: 155142
Project: 155142
Buggy source:
public synchronized Node next(){
  Node nextNode=currentNode;
  currentNode=null;
  if (nextNode == null) {
    throw new NoSuchElementException();
  }
  return nextNode;
}

Fixed version (ground truth):
public synchronized Node next(){
  if (!hasNext()) {
    throw new NoSuchElementException();
  }
  Node nextNode=currentNode;
  currentNode=null;
  return nextNode;
}
Program: 155143
Project: 155143
Buggy source:
public void testGetAllNode(){
  long highId=getNodeManager().getHighestPossibleIdInUse(Node.class);
  if (highId >= 0 && highId < 10000) {
    int count=0;
    for (    Node node : getEmbeddedNeo().getAllNodes()) {
      count++;
    }
    boolean found=false;
    Node newNode=getNeo().createNode();
    newTransaction();
    int oldCount=count;
    count=0;
    for (    Node node : getEmbeddedNeo().getAllNodes()) {
      count++;
      if (node.equals(newNode)) {
        found=true;
      }
    }
    assertTrue(found);
    assertEquals(count,oldCount + 1);
    newNode.delete();
    newTransaction();
    found=false;
    count=0;
    for (    Node node : getEmbeddedNeo().getAllNodes()) {
      count++;
      if (node.equals(newNode)) {
        found=true;
      }
    }
    assertTrue(!found);
    assertEquals(count,oldCount);
  }
}

Fixed version (ground truth):
public void testGetAllNode(){
  long highId=getNodeManager().getHighestPossibleIdInUse(Node.class);
  if (highId >= 0 && highId < 10000) {
    int count=0;
    for (    Node node : getEmbeddedNeo().getAllNodes()) {
      count++;
    }
    boolean found=false;
    Node newNode=getNeo().createNode();
    newTransaction();
    int oldCount=count;
    count=0;
    for (    Node node : getEmbeddedNeo().getAllNodes()) {
      count++;
      if (node.equals(newNode)) {
        found=true;
      }
    }
    assertTrue(found);
    assertEquals(count,oldCount + 1);
    Iterator<Node> allNodesIterator=getEmbeddedNeo().getAllNodes().iterator();
    assertNotNull(allNodesIterator.next());
    newNode.delete();
    newTransaction();
    found=false;
    count=0;
    for (    Node node : getEmbeddedNeo().getAllNodes()) {
      count++;
      if (node.equals(newNode)) {
        found=true;
      }
    }
    assertTrue(!found);
    assertEquals(count,oldCount);
  }
}
Program: 155145
Project: 155145
Buggy source:
void nodeChangeProperty(int nodeId,int propertyId,Object value){
  NodeRecord nodeRecord=getNodeRecord(nodeId);
  if (nodeRecord == null) {
    nodeRecord=getNodeStore().getRecord(nodeId);
  }
  if (!nodeRecord.inUse()) {
    throw new IllegalStateException("String_Node_Str" + nodeId + "String_Node_Str");
  }
  PropertyRecord propertyRecord=getPropertyRecord(propertyId);
  if (propertyRecord == null) {
    propertyRecord=getPropertyStore().getRecord(propertyId);
    addPropertyRecord(propertyRecord);
  }
  propertyRecord.setNodeId(nodeId);
  if (propertyRecord.isLight()) {
    getPropertyStore().makeHeavy(propertyRecord);
  }
  if (propertyRecord.getType() == PropertyType.STRING) {
    for (    DynamicRecord record : propertyRecord.getValueRecords()) {
      if (record.inUse()) {
        record.setInUse(false,PropertyType.STRING.intValue());
      }
    }
  }
 else   if (propertyRecord.getType() == PropertyType.ARRAY) {
    for (    DynamicRecord record : propertyRecord.getValueRecords()) {
      if (record.inUse()) {
        record.setInUse(false,PropertyType.ARRAY.intValue());
      }
    }
  }
  getPropertyStore().encodeValue(propertyRecord,value);
  addPropertyRecord(propertyRecord);
}

Fixed version (ground truth):
void nodeChangeProperty(int nodeId,int propertyId,Object value){
  NodeRecord nodeRecord=getNodeRecord(nodeId);
  if (nodeRecord == null) {
    nodeRecord=getNodeStore().getRecord(nodeId);
  }
  if (!nodeRecord.inUse()) {
    throw new IllegalStateException("String_Node_Str" + nodeId + "String_Node_Str");
  }
  PropertyRecord propertyRecord=getPropertyRecord(propertyId);
  if (propertyRecord == null) {
    propertyRecord=getPropertyStore().getRecord(propertyId);
    addPropertyRecord(propertyRecord);
  }
  if (!propertyRecord.inUse()) {
    throw new IllegalStateException("String_Node_Str" + propertyId + "String_Node_Str");
  }
  propertyRecord.setNodeId(nodeId);
  if (propertyRecord.isLight()) {
    getPropertyStore().makeHeavy(propertyRecord);
  }
  if (propertyRecord.getType() == PropertyType.STRING) {
    for (    DynamicRecord record : propertyRecord.getValueRecords()) {
      if (record.inUse()) {
        record.setInUse(false,PropertyType.STRING.intValue());
      }
    }
  }
 else   if (propertyRecord.getType() == PropertyType.ARRAY) {
    for (    DynamicRecord record : propertyRecord.getValueRecords()) {
      if (record.inUse()) {
        record.setInUse(false,PropertyType.ARRAY.intValue());
      }
    }
  }
  getPropertyStore().encodeValue(propertyRecord,value);
  addPropertyRecord(propertyRecord);
}
Program: 155146
Project: 155146
Buggy source:
void relRemoveProperty(int relId,int propertyId){
  RelationshipRecord relRecord=getRelationshipRecord(relId);
  if (relRecord == null) {
    relRecord=getRelationshipStore().getRecord(relId);
  }
  if (!relRecord.inUse()) {
    throw new IllegalStateException("String_Node_Str" + relId + "String_Node_Str");
  }
  PropertyRecord propRecord=getPropertyRecord(propertyId);
  if (propRecord == null) {
    propRecord=getPropertyStore().getRecord(propertyId);
    addPropertyRecord(propRecord);
  }
  propRecord.setRelId(relId);
  if (propRecord.isLight()) {
    getPropertyStore().makeHeavy(propRecord);
  }
  propRecord.setInUse(false);
  for (  DynamicRecord valueRecord : propRecord.getValueRecords()) {
    if (valueRecord.inUse()) {
      valueRecord.setInUse(false,propRecord.getType().intValue());
    }
  }
  int prevProp=propRecord.getPrevProp();
  int nextProp=propRecord.getNextProp();
  if (relRecord.getNextProp() == propertyId) {
    relRecord.setNextProp(nextProp);
    addRelationshipRecord(relRecord);
  }
  if (prevProp != Record.NO_PREVIOUS_PROPERTY.intValue()) {
    PropertyRecord prevPropRecord=getPropertyRecord(prevProp);
    if (prevPropRecord == null) {
      prevPropRecord=getPropertyStore().getLightRecord(prevProp);
      addPropertyRecord(prevPropRecord);
    }
    prevPropRecord.setNextProp(nextProp);
  }
  if (nextProp != Record.NO_NEXT_PROPERTY.intValue()) {
    PropertyRecord nextPropRecord=getPropertyRecord(nextProp);
    if (nextPropRecord == null) {
      nextPropRecord=getPropertyStore().getLightRecord(nextProp);
      addPropertyRecord(nextPropRecord);
    }
    nextPropRecord.setPrevProp(prevProp);
  }
}

Fixed version (ground truth):
void relRemoveProperty(int relId,int propertyId){
}
Program: 155147
Project: 155147
Buggy source:
void relChangeProperty(int relId,int propertyId,Object value){
  RelationshipRecord relRecord=getRelationshipRecord(relId);
  if (relRecord == null) {
    relRecord=getRelationshipStore().getRecord(relId);
  }
  if (!relRecord.inUse()) {
    throw new IllegalStateException("String_Node_Str" + relId + "String_Node_Str");
  }
  PropertyRecord propertyRecord=getPropertyRecord(propertyId);
  if (propertyRecord == null) {
    propertyRecord=getPropertyStore().getRecord(propertyId);
    addPropertyRecord(propertyRecord);
  }
  propertyRecord.setRelId(relId);
  if (propertyRecord.isLight()) {
    getPropertyStore().makeHeavy(propertyRecord);
  }
  if (propertyRecord.getType() == PropertyType.STRING) {
    for (    DynamicRecord record : propertyRecord.getValueRecords()) {
      if (record.inUse()) {
        record.setInUse(false,PropertyType.STRING.intValue());
      }
    }
  }
 else   if (propertyRecord.getType() == PropertyType.ARRAY) {
    for (    DynamicRecord record : propertyRecord.getValueRecords()) {
      if (record.inUse()) {
        record.setInUse(false,PropertyType.ARRAY.intValue());
      }
    }
  }
  getPropertyStore().encodeValue(propertyRecord,value);
  addPropertyRecord(propertyRecord);
}

Fixed version (ground truth):
void relChangeProperty(int relId,int propertyId,Object value){
  RelationshipRecord relRecord=getRelationshipRecord(relId);
  if (relRecord == null) {
    relRecord=getRelationshipStore().getRecord(relId);
  }
  if (!relRecord.inUse()) {
    throw new IllegalStateException("String_Node_Str" + relId + "String_Node_Str");
  }
  PropertyRecord propertyRecord=getPropertyRecord(propertyId);
  if (propertyRecord == null) {
    propertyRecord=getPropertyStore().getRecord(propertyId);
    addPropertyRecord(propertyRecord);
  }
  if (!propertyRecord.inUse()) {
    throw new IllegalStateException("String_Node_Str" + propertyId + "String_Node_Str");
  }
  propertyRecord.setRelId(relId);
  if (propertyRecord.isLight()) {
    getPropertyStore().makeHeavy(propertyRecord);
  }
  if (propertyRecord.getType() == PropertyType.STRING) {
    for (    DynamicRecord record : propertyRecord.getValueRecords()) {
      if (record.inUse()) {
        record.setInUse(false,PropertyType.STRING.intValue());
      }
    }
  }
 else   if (propertyRecord.getType() == PropertyType.ARRAY) {
    for (    DynamicRecord record : propertyRecord.getValueRecords()) {
      if (record.inUse()) {
        record.setInUse(false,PropertyType.ARRAY.intValue());
      }
    }
  }
  getPropertyStore().encodeValue(propertyRecord,value);
  addPropertyRecord(propertyRecord);
}
Program: 155148
Project: 155148
Buggy source:
void nodeRemoveProperty(int nodeId,int propertyId){
  NodeRecord nodeRecord=getNodeRecord(nodeId);
  if (nodeRecord == null) {
    nodeRecord=getNodeStore().getRecord(nodeId);
  }
  if (!nodeRecord.inUse()) {
    throw new IllegalStateException("String_Node_Str" + nodeId + "String_Node_Str");
  }
  PropertyRecord propRecord=getPropertyRecord(propertyId);
  if (propRecord == null) {
    propRecord=getPropertyStore().getRecord(propertyId);
    addPropertyRecord(propRecord);
  }
  propRecord.setNodeId(nodeId);
  if (propRecord.isLight()) {
    getPropertyStore().makeHeavy(propRecord);
  }
  propRecord.setInUse(false);
  for (  DynamicRecord valueRecord : propRecord.getValueRecords()) {
    if (valueRecord.inUse()) {
      valueRecord.setInUse(false,propRecord.getType().intValue());
    }
  }
  int prevProp=propRecord.getPrevProp();
  int nextProp=propRecord.getNextProp();
  if (nodeRecord.getNextProp() == propertyId) {
    nodeRecord.setNextProp(nextProp);
    addNodeRecord(nodeRecord);
  }
  if (prevProp != Record.NO_PREVIOUS_PROPERTY.intValue()) {
    PropertyRecord prevPropRecord=getPropertyRecord(prevProp);
    if (prevPropRecord == null) {
      prevPropRecord=getPropertyStore().getLightRecord(prevProp);
    }
    prevPropRecord.setNextProp(nextProp);
    addPropertyRecord(prevPropRecord);
  }
  if (nextProp != Record.NO_NEXT_PROPERTY.intValue()) {
    PropertyRecord nextPropRecord=getPropertyRecord(nextProp);
    if (nextPropRecord == null) {
      nextPropRecord=getPropertyStore().getLightRecord(nextProp);
    }
    nextPropRecord.setPrevProp(prevProp);
    addPropertyRecord(nextPropRecord);
  }
}

Fixed version (ground truth):
void nodeRemoveProperty(int nodeId,int propertyId){
}
Program: 155149
Project: 155149
Buggy source:
public boolean hasNext(){
  if (nextElement != null) {
    return true;
  }
  do {
    if (currentTypeIterator.hasNext()) {
      int nextId=currentTypeIterator.next();
      try {
        Relationship possibleElement=nodeManager.getRelationshipById(nextId);
        if (direction == Direction.INCOMING && possibleElement.getEndNode().equals(fromNode)) {
          nextElement=possibleElement;
          return true;
        }
 else         if (direction == Direction.OUTGOING && possibleElement.getStartNode().equals(fromNode)) {
          nextElement=possibleElement;
          return true;
        }
 else         if (direction == Direction.BOTH) {
          nextElement=possibleElement;
          return true;
        }
      }
 catch (      NotFoundException e) {
        log.log(Level.FINE,"String_Node_Str" + nextId,e);
      }
    }
    while (!currentTypeIterator.hasNext() && typeIterator.hasNext()) {
      currentTypeIterator=typeIterator.next();
    }
  }
 while (currentTypeIterator.hasNext());
  return nextElement != null;
}

Fixed version (ground truth):
public boolean hasNext(){
  if (nextElement != null) {
    return true;
  }
  do {
    if (currentTypeIterator.hasNext()) {
      int nextId=currentTypeIterator.next();
      try {
        Relationship possibleElement=nodeManager.getRelationshipById(nextId);
        if (direction == Direction.INCOMING && possibleElement.getEndNode().equals(fromNode)) {
          nextElement=possibleElement;
          return true;
        }
 else         if (direction == Direction.OUTGOING && possibleElement.getStartNode().equals(fromNode)) {
          nextElement=possibleElement;
          return true;
        }
 else         if (direction == Direction.BOTH) {
          nextElement=possibleElement;
          return true;
        }
      }
 catch (      NotFoundException e) {
        log.log(Level.FINE,"String_Node_Str" + nextId,e);
      }
    }
    while (!currentTypeIterator.hasNext() && typeIterator.hasNext()) {
      currentTypeIterator=typeIterator.next();
    }
  }
 while (currentTypeIterator.hasNext());
  return false;
}
Program: 155150
Project: 155150
Buggy source:
public Node getNodeById(int nodeId) throws NotFoundException {
  if (nodeId < 0) {
    throw new IllegalArgumentException("String_Node_Str" + nodeId);
  }
  NodeImpl node=nodeCache.get(nodeId);
  if (node != null) {
    return new NodeProxy(nodeId,this);
  }
  node=new NodeImpl(nodeId,this);
  ReentrantLock loadLock=lockId(nodeId);
  try {
    if (nodeCache.get(nodeId) != null) {
      node=nodeCache.get(nodeId);
      return new NodeProxy(nodeId,this);
    }
    if (!persistenceManager.loadLightNode(nodeId)) {
      throw new NotFoundException("String_Node_Str" + nodeId + "String_Node_Str");
    }
    nodeCache.add(nodeId,node);
    return new NodeProxy(nodeId,this);
  }
  finally {
    loadLock.unlock();
  }
}

Fixed version (ground truth):
public Node getNodeById(int nodeId) throws NotFoundException {
  if (nodeId < 0) {
    throw new IllegalArgumentException("String_Node_Str" + nodeId);
  }
  NodeImpl node=nodeCache.get(nodeId);
  if (node != null) {
    return new NodeProxy(nodeId,this);
  }
  node=new NodeImpl(nodeId,this);
  ReentrantLock loadLock=lockId(nodeId);
  try {
    if (nodeCache.get(nodeId) != null) {
      return new NodeProxy(nodeId,this);
    }
    if (!persistenceManager.loadLightNode(nodeId)) {
      throw new NotFoundException("String_Node_Str" + nodeId + "String_Node_Str");
    }
    nodeCache.add(nodeId,node);
    return new NodeProxy(nodeId,this);
  }
  finally {
    loadLock.unlock();
  }
}
Program: 155152
Project: 155152
Buggy source:
public synchronized void close() throws IOException {
  if (fileChannel == null || !fileChannel.isOpen()) {
    log.info("String_Node_Str" + fileName + "String_Node_Str");
    return;
  }
  long endPosition=writeBuffer.getFileChannelPosition();
  if (xidIdentMap.size() > 0) {
    log.info("String_Node_Str" + xidIdentMap.size() + "String_Node_Str");
    if (writeBuffer != null) {
      writeBuffer.force();
    }
    writeBuffer=null;
    fileChannel.close();
    log.info("String_Node_Str" + fileName + "String_Node_Str"+ currentLog+ "String_Node_Str"+ "String_Node_Str");
    return;
  }
  if (!keepLogs || backupSlave) {
    if (currentLog == CLEAN) {
      deleteCurrentLogFile(fileName);
    }
 else {
      deleteCurrentLogFile(fileName + "String_Node_Str" + currentLog);
    }
  }
 else {
    renameCurrentLogFileAndIncrementVersion(fileName + "String_Node_Str" + currentLog,endPosition);
  }
  if (currentLog != CLEAN) {
    setActiveLog(CLEAN);
  }
}

Fixed version (ground truth):
public synchronized void close() throws IOException {
  if (fileChannel == null || !fileChannel.isOpen()) {
    log.info("String_Node_Str" + fileName + "String_Node_Str");
    return;
  }
  long endPosition=writeBuffer.getFileChannelPosition();
  if (xidIdentMap.size() > 0) {
    log.info("String_Node_Str" + xidIdentMap.size() + "String_Node_Str");
    writeBuffer.force();
    writeBuffer=null;
    fileChannel.close();
    log.info("String_Node_Str" + fileName + "String_Node_Str"+ currentLog+ "String_Node_Str"+ "String_Node_Str");
    return;
  }
  if (!keepLogs || backupSlave) {
    if (currentLog == CLEAN) {
      deleteCurrentLogFile(fileName);
    }
 else {
      deleteCurrentLogFile(fileName + "String_Node_Str" + currentLog);
    }
  }
 else {
    renameCurrentLogFileAndIncrementVersion(fileName + "String_Node_Str" + currentLog,endPosition);
  }
  if (currentLog != CLEAN) {
    setActiveLog(CLEAN);
  }
}