nus-yam/ex-repair huggingface dataset:
Program: 154710
Project: 154710
Buggy source:
public <T>T receive(Response<T> response){
  try {
    for (    Pair<String,TransactionStream> streams : response.transactions().getStreams()) {
      String resourceName=streams.first();
      XaDataSource dataSource=localDataSourceManager.getXaDataSource(resourceName);
      for (      Pair<Long,ReadableByteChannel> channel : streams.other().getChannels()) {
        dataSource.applyCommittedTransaction(channel.first(),channel.other());
        channel.other().close();
      }
    }
    return response.response();
  }
 catch (  IOException e) {
    newMaster(broker.getMaster(),e);
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public <T>T receive(Response<T> response){
  try {
    XaDataSourceManager localDataSourceManager=localGraph.getConfig().getTxModule().getXaDataSourceManager();
    for (    Pair<String,TransactionStream> streams : response.transactions().getStreams()) {
      String resourceName=streams.first();
      XaDataSource dataSource=localDataSourceManager.getXaDataSource(resourceName);
      for (      Pair<Long,ReadableByteChannel> channel : streams.other().getChannels()) {
        dataSource.applyCommittedTransaction(channel.first(),channel.other());
        channel.other().close();
      }
    }
    return response.response();
  }
 catch (  IOException e) {
    newMaster(broker.getMaster(),e);
    throw new RuntimeException(e);
  }
}
Program: 154711
Project: 154711
Buggy source:
public SlaveContext getSlaveContext(int eventIdentifier){
  Collection<XaDataSource> dataSources=localDataSourceManager.getAllRegisteredDataSources();
  @SuppressWarnings("String_Node_Str") Pair<String,Long>[] txs=new Pair[dataSources.size()];
  int i=0;
  for (  XaDataSource dataSource : dataSources) {
    txs[i++]=new Pair<String,Long>(dataSource.getName(),dataSource.getLastCommittedTxId());
  }
  return new SlaveContext(machineId,eventIdentifier,txs);
}

Fixed version (ground truth):
public SlaveContext getSlaveContext(int eventIdentifier){
  XaDataSourceManager localDataSourceManager=localGraph.getConfig().getTxModule().getXaDataSourceManager();
  Collection<XaDataSource> dataSources=localDataSourceManager.getAllRegisteredDataSources();
  @SuppressWarnings("String_Node_Str") Pair<String,Long>[] txs=new Pair[dataSources.size()];
  int i=0;
  for (  XaDataSource dataSource : dataSources) {
    txs[i++]=new Pair<String,Long>(dataSource.getName(),dataSource.getLastCommittedTxId());
  }
  return new SlaveContext(machineId,eventIdentifier,txs);
}
Program: 154712
Project: 154712
Buggy source:
protected synchronized void reevaluateMyself(Pair<Master,Machine> master){
  if (master == null) {
    master=broker.getMasterReally();
  }
  boolean restarted=false;
  boolean iAmCurrentlyMaster=masterServer != null;
  msgLog.logMessage("String_Node_Str" + machineId + "String_Node_Str"+ master+ "String_Node_Str"+ iAmCurrentlyMaster+ "String_Node_Str");
  if (master.other().getMachineId() == machineId) {
    if (this.localGraph == null || !iAmCurrentlyMaster) {
      internalShutdown();
      startAsMaster();
      restarted=true;
    }
    broker.rebindMaster();
  }
 else {
    if (this.localGraph == null || iAmCurrentlyMaster) {
      internalShutdown();
      startAsSlave();
      restarted=true;
    }
    tryToEnsureIAmNotABrokenMachine(broker.getMaster());
  }
  if (restarted) {
    for (    TransactionEventHandler<?> handler : transactionEventHandlers) {
      this.localGraph.registerTransactionEventHandler(handler);
    }
    for (    KernelEventHandler handler : kernelEventHandlers) {
      this.localGraph.registerKernelEventHandler(handler);
    }
    this.localDataSourceManager=localGraph.getConfig().getTxModule().getXaDataSourceManager();
  }
}

Fixed version (ground truth):
protected synchronized void reevaluateMyself(Pair<Master,Machine> master){
  if (master == null) {
    master=broker.getMasterReally();
  }
  boolean restarted=false;
  boolean iAmCurrentlyMaster=masterServer != null;
  msgLog.logMessage("String_Node_Str" + machineId + "String_Node_Str"+ master+ "String_Node_Str"+ iAmCurrentlyMaster+ "String_Node_Str");
  if (master.other().getMachineId() == machineId) {
    if (this.localGraph == null || !iAmCurrentlyMaster) {
      internalShutdown();
      startAsMaster();
      restarted=true;
    }
    broker.rebindMaster();
  }
 else {
    if (this.localGraph == null || iAmCurrentlyMaster) {
      internalShutdown();
      startAsSlave();
      restarted=true;
    }
    tryToEnsureIAmNotABrokenMachine(broker.getMaster());
  }
  if (restarted) {
    for (    TransactionEventHandler<?> handler : transactionEventHandlers) {
      this.localGraph.registerTransactionEventHandler(handler);
    }
    for (    KernelEventHandler handler : kernelEventHandlers) {
      this.localGraph.registerKernelEventHandler(handler);
    }
  }
}
Program: 154713
Project: 154713
Buggy source:
private void startAsMaster(){
  msgLog.logMessage("String_Node_Str" + machineId + "String_Node_Str");
  this.localGraph=new EmbeddedGraphDbImpl(storeDir,config,this,CommonFactories.defaultLockManagerFactory(),new MasterIdGeneratorFactory(),CommonFactories.defaultRelationshipTypeCreator(),new MasterTxIdGeneratorFactory(broker),CommonFactories.defaultTxFinishHook(),new ZooKeeperLastCommittedTxIdSetter(broker));
  this.masterServer=(MasterServer)broker.instantiateMasterServer(this);
  msgLog.logMessage("String_Node_Str");
}

Fixed version (ground truth):
private void startAsMaster(){
  msgLog.logMessage("String_Node_Str" + machineId + "String_Node_Str",true);
  this.localGraph=new EmbeddedGraphDbImpl(storeDir,config,this,CommonFactories.defaultLockManagerFactory(),new MasterIdGeneratorFactory(),CommonFactories.defaultRelationshipTypeCreator(),new MasterTxIdGeneratorFactory(broker),CommonFactories.defaultTxFinishHook(),new ZooKeeperLastCommittedTxIdSetter(broker));
  this.masterServer=(MasterServer)broker.instantiateMasterServer(this);
  msgLog.logMessage("String_Node_Str",true);
}
Program: 154714
Project: 154714
Buggy source:
private void startAsSlave(){
  msgLog.logMessage("String_Node_Str" + machineId + "String_Node_Str");
  this.localGraph=new EmbeddedGraphDbImpl(storeDir,config,this,new SlaveLockManagerFactory(broker,this),new SlaveIdGeneratorFactory(broker,this),new SlaveRelationshipTypeCreator(broker,this),new SlaveTxIdGeneratorFactory(broker,this),new SlaveTxRollbackHook(broker,this),new ZooKeeperLastCommittedTxIdSetter(broker));
  instantiateAutoUpdatePullerIfConfigSaysSo();
  msgLog.logMessage("String_Node_Str");
}

Fixed version (ground truth):
private void startAsSlave(){
  msgLog.logMessage("String_Node_Str" + machineId + "String_Node_Str",true);
  this.localGraph=new EmbeddedGraphDbImpl(storeDir,config,this,new SlaveLockManagerFactory(broker,this),new SlaveIdGeneratorFactory(broker,this),new SlaveRelationshipTypeCreator(broker,this),new SlaveTxIdGeneratorFactory(broker,this),new SlaveTxRollbackHook(broker,this),new ZooKeeperLastCommittedTxIdSetter(broker));
  instantiateAutoUpdatePullerIfConfigSaysSo();
  msgLog.logMessage("String_Node_Str",true);
}
Program: 154715
Project: 154715
Buggy source:
public synchronized void shutdown(){
  msgLog.logMessage("String_Node_Str" + machineId + "String_Node_Str"+ this);
  if (this.broker != null) {
    this.broker.shutdown();
  }
  internalShutdown();
}

Fixed version (ground truth):
public synchronized void shutdown(){
  msgLog.logMessage("String_Node_Str" + machineId + "String_Node_Str"+ this,true);
  if (this.broker != null) {
    this.broker.shutdown();
  }
  internalShutdown();
}
Program: 154716
Project: 154716
Buggy source:
@Override protected Triplet<Channel,ChannelBuffer,ByteBuffer> create(){
  ChannelFuture channelFuture=bootstrap.connect(address);
  channelFuture.awaitUninterruptibly(5,TimeUnit.SECONDS);
  Triplet<Channel,ChannelBuffer,ByteBuffer> channel=null;
  if (channelFuture.isSuccess()) {
    channel=Triplet.of(channelFuture.getChannel(),ChannelBuffers.dynamicBuffer(),ByteBuffer.allocateDirect(1024 * 1024));
    msgLog.logMessage("String_Node_Str" + address);
  }
  return channel;
}

Fixed version (ground truth):
@Override protected Triplet<Channel,ChannelBuffer,ByteBuffer> create(){
  ChannelFuture channelFuture=bootstrap.connect(address);
  channelFuture.awaitUninterruptibly(5,TimeUnit.SECONDS);
  Triplet<Channel,ChannelBuffer,ByteBuffer> channel=null;
  if (channelFuture.isSuccess()) {
    channel=Triplet.of(channelFuture.getChannel(),ChannelBuffers.dynamicBuffer(),ByteBuffer.allocateDirect(1024 * 1024));
    msgLog.logMessage("String_Node_Str" + address,true);
    return channel;
  }
  String msg="String_Node_Str" + address;
  msgLog.logMessage(msg,true);
  throw new HaCommunicationException(msg);
}
Program: 154717
Project: 154717
Buggy source:
public void shutdown(){
  msgLog.logMessage("String_Node_Str");
  channelPool.close(true);
}

Fixed version (ground truth):
public void shutdown(){
  msgLog.logMessage("String_Node_Str",true);
  channelPool.close(true);
}
Program: 154718
Project: 154718
Buggy source:
public void shutdown(){
  deadConnectionsPoller.shutdown();
  msgLog.logMessage("String_Node_Str");
  channelGroup.close().awaitUninterruptibly();
  executor.shutdown();
}

Fixed version (ground truth):
public void shutdown(){
  deadConnectionsPoller.shutdown();
  msgLog.logMessage("String_Node_Str",true);
  channelGroup.close().awaitUninterruptibly();
  executor.shutdown();
}
Program: 154719
Project: 154719
Buggy source:
public MasterServer(Master realMaster,final int port,String storeDir){
  this.realMaster=realMaster;
  this.msgLog=StringLogger.getLogger(storeDir + "String_Node_Str");
  executor=Executors.newCachedThreadPool();
  channelFactory=new NioServerSocketChannelFactory(executor,executor,MAX_NUMBER_OF_CONCURRENT_TRANSACTIONS);
  bootstrap=new ServerBootstrap(channelFactory);
  bootstrap.setPipelineFactory(this);
  channelGroup=new DefaultChannelGroup();
  executor.execute(new Runnable(){
    public void run(){
      Channel channel=bootstrap.bind(new InetSocketAddress(port));
      channelGroup.add(channel);
      msgLog.logMessage("String_Node_Str" + port);
    }
  }
);
  deadConnectionsPoller=new ScheduledThreadPoolExecutor(1);
  deadConnectionsPoller.scheduleWithFixedDelay(new Runnable(){
    public void run(){
    }
  }
,DEAD_CONNECTIONS_CHECK_INTERVAL,DEAD_CONNECTIONS_CHECK_INTERVAL,TimeUnit.SECONDS);
}

Fixed version (ground truth):
public MasterServer(Master realMaster,final int port,String storeDir){
  this.realMaster=realMaster;
  this.msgLog=StringLogger.getLogger(storeDir + "String_Node_Str");
  executor=Executors.newCachedThreadPool();
  channelFactory=new NioServerSocketChannelFactory(executor,executor,MAX_NUMBER_OF_CONCURRENT_TRANSACTIONS);
  bootstrap=new ServerBootstrap(channelFactory);
  bootstrap.setPipelineFactory(this);
  channelGroup=new DefaultChannelGroup();
  executor.execute(new Runnable(){
    public void run(){
      Channel channel=bootstrap.bind(new InetSocketAddress(port));
      channelGroup.add(channel);
      msgLog.logMessage("String_Node_Str" + port,true);
    }
  }
);
  deadConnectionsPoller=new ScheduledThreadPoolExecutor(1);
  deadConnectionsPoller.scheduleWithFixedDelay(new Runnable(){
    public void run(){
    }
  }
,DEAD_CONNECTIONS_CHECK_INTERVAL,DEAD_CONNECTIONS_CHECK_INTERVAL,TimeUnit.SECONDS);
}
Program: 154720
Project: 154720
Buggy source:
private Channel getChannel() throws Exception {
  Thread thread=Thread.currentThread();
synchronized (channels) {
    Channel channel=channels.get(thread);
    if (channel == null) {
      while (channel == null) {
        Channel unusedChannel=unusedChannels.poll();
        if (unusedChannel == null) {
          break;
        }
 else         if (unusedChannel.isConnected()) {
          msgLog.logMessage("String_Node_Str");
          channel=unusedChannel;
        }
 else {
          msgLog.logMessage("String_Node_Str");
        }
      }
      if (channel == null) {
        for (int i=0; i < 5; i++) {
          ChannelFuture channelFuture=bootstrap.connect(new InetSocketAddress(hostNameOrIp,port));
          channelFuture.awaitUninterruptibly();
          if (channelFuture.isSuccess()) {
            channel=channelFuture.getChannel();
            msgLog.logMessage("String_Node_Str" + hostNameOrIp + "String_Node_Str"+ port);
            break;
          }
 else {
            msgLog.logMessage("String_Node_Str" + hostNameOrIp + "String_Node_Str"+ port);
            try {
              Thread.sleep(500);
            }
 catch (            InterruptedException e) {
              Thread.interrupted();
            }
          }
        }
      }
      if (channel == null) {
        throw new IOException("String_Node_Str");
      }
      channels.put(thread,channel);
    }
    return channel;
  }
}

Fixed version (ground truth):
private Channel getChannel() throws Exception {
  Thread thread=Thread.currentThread();
synchronized (channels) {
    Channel channel=channels.get(thread);
    if (channel == null) {
      while (channel == null) {
        Channel unusedChannel=unusedChannels.poll();
        if (unusedChannel == null) {
          break;
        }
 else         if (unusedChannel.isConnected()) {
          msgLog.logMessage("String_Node_Str");
          channel=unusedChannel;
        }
 else {
          msgLog.logMessage("String_Node_Str");
        }
      }
      if (channel == null) {
        for (int i=0; i < 5; i++) {
          ChannelFuture channelFuture=bootstrap.connect(new InetSocketAddress(hostNameOrIp,port));
          channelFuture.awaitUninterruptibly();
          if (channelFuture.isSuccess()) {
            channel=channelFuture.getChannel();
            msgLog.logMessage("String_Node_Str" + hostNameOrIp + "String_Node_Str"+ port,true);
            break;
          }
 else {
            msgLog.logMessage("String_Node_Str" + hostNameOrIp + "String_Node_Str"+ port,true);
            try {
              Thread.sleep(500);
            }
 catch (            InterruptedException e) {
              Thread.interrupted();
            }
          }
        }
      }
      if (channel == null) {
        throw new IOException("String_Node_Str");
      }
      channels.put(thread,channel);
    }
    return channel;
  }
}
Program: 154721
Project: 154721
Buggy source:
public void shutdown(){
  msgLog.logMessage("String_Node_Str");
synchronized (channels) {
    for (    Channel channel : unusedChannels) {
      channel.close();
    }
    for (    Channel channel : channels.values()) {
      channel.close();
    }
  }
}

Fixed version (ground truth):
public void shutdown(){
  msgLog.logMessage("String_Node_Str",true);
synchronized (channels) {
    for (    Channel channel : unusedChannels) {
      channel.close();
    }
    for (    Channel channel : channels.values()) {
      channel.close();
    }
  }
}
Program: 154722
Project: 154722
Buggy source:
public void shutdown(){
  deadConnectionsPoller.shutdown();
  msgLog.logMessage("String_Node_Str");
  channelGroup.close().awaitUninterruptibly();
}

Fixed version (ground truth):
public void shutdown(){
  deadConnectionsPoller.shutdown();
  msgLog.logMessage("String_Node_Str",true);
  channelGroup.close().awaitUninterruptibly();
}
Program: 154723
Project: 154723
Buggy source:
public MasterServer(Master realMaster,final int port,String storeDir){
  this.realMaster=realMaster;
  this.msgLog=StringLogger.getLogger(storeDir + "String_Node_Str");
  ExecutorService executor=Executors.newCachedThreadPool();
  channelFactory=new NioServerSocketChannelFactory(executor,executor,MAX_NUMBER_OF_CONCURRENT_TRANSACTIONS);
  bootstrap=new ServerBootstrap(channelFactory);
  bootstrap.setPipelineFactory(this);
  channelGroup=new DefaultChannelGroup();
  executor.execute(new Runnable(){
    public void run(){
      Channel channel=bootstrap.bind(new InetSocketAddress(port));
      channelGroup.add(channel);
      msgLog.logMessage("String_Node_Str" + port);
    }
  }
);
  deadConnectionsPoller=new ScheduledThreadPoolExecutor(1);
  deadConnectionsPoller.scheduleWithFixedDelay(new Runnable(){
    public void run(){
    }
  }
,DEAD_CONNECTIONS_CHECK_INTERVAL,DEAD_CONNECTIONS_CHECK_INTERVAL,TimeUnit.SECONDS);
}

Fixed version (ground truth):
public MasterServer(Master realMaster,final int port,String storeDir){
  this.realMaster=realMaster;
  this.msgLog=StringLogger.getLogger(storeDir + "String_Node_Str");
  ExecutorService executor=Executors.newCachedThreadPool();
  channelFactory=new NioServerSocketChannelFactory(executor,executor,MAX_NUMBER_OF_CONCURRENT_TRANSACTIONS);
  bootstrap=new ServerBootstrap(channelFactory);
  bootstrap.setPipelineFactory(this);
  channelGroup=new DefaultChannelGroup();
  executor.execute(new Runnable(){
    public void run(){
      Channel channel=bootstrap.bind(new InetSocketAddress(port));
      channelGroup.add(channel);
      msgLog.logMessage("String_Node_Str" + port,true);
    }
  }
);
  deadConnectionsPoller=new ScheduledThreadPoolExecutor(1);
  deadConnectionsPoller.scheduleWithFixedDelay(new Runnable(){
    public void run(){
    }
  }
,DEAD_CONNECTIONS_CHECK_INTERVAL,DEAD_CONNECTIONS_CHECK_INTERVAL,TimeUnit.SECONDS);
}
Program: 154725
Project: 154725
Buggy source:
public synchronized void setCommittedTx(long tx){
  msgLog.logMessage("String_Node_Str" + tx + "String_Node_Str"+ machineId);
  waitForSyncConnected();
  this.committedTx=tx;
  String root=getRoot();
  String path=root + "String_Node_Str" + machineId+ "String_Node_Str"+ sequenceNr;
  byte[] data=dataRepresentingMe(tx);
  try {
    zooKeeper.setData(path,data,-1);
  }
 catch (  KeeperException e) {
    throw new ZooKeeperException("String_Node_Str",e);
  }
catch (  InterruptedException e) {
    Thread.interrupted();
    throw new ZooKeeperException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public synchronized void setCommittedTx(long tx){
  msgLog.logMessage("String_Node_Str" + tx + "String_Node_Str"+ machineId,true);
  waitForSyncConnected();
  this.committedTx=tx;
  String root=getRoot();
  String path=root + "String_Node_Str" + machineId+ "String_Node_Str"+ sequenceNr;
  byte[] data=dataRepresentingMe(tx);
  try {
    zooKeeper.setData(path,data,-1);
  }
 catch (  KeeperException e) {
    throw new ZooKeeperException("String_Node_Str",e);
  }
catch (  InterruptedException e) {
    Thread.interrupted();
    throw new ZooKeeperException("String_Node_Str",e);
  }
}
Program: 154726
Project: 154726
Buggy source:
private void writeHaServerConfig() throws InterruptedException, KeeperException {
  String path=rootPath + "String_Node_Str" + HA_SERVERS_CHILD;
  try {
    zooKeeper.create(path,new byte[0],ZooDefs.Ids.OPEN_ACL_UNSAFE,CreateMode.PERSISTENT);
  }
 catch (  KeeperException e) {
    if (e.code() != KeeperException.Code.NODEEXISTS) {
      throw e;
    }
  }
  String machinePath=path + "String_Node_Str" + machineId;
  byte[] data=haServerAsData();
  try {
    zooKeeper.create(machinePath,data,ZooDefs.Ids.OPEN_ACL_UNSAFE,CreateMode.EPHEMERAL);
  }
 catch (  KeeperException e) {
    if (e.code() != KeeperException.Code.NODEEXISTS) {
      throw e;
    }
  }
  zooKeeper.setData(machinePath,data,-1);
  msgLog.logMessage("String_Node_Str" + haServer + "String_Node_Str");
}

Fixed version (ground truth):
private void writeHaServerConfig() throws InterruptedException, KeeperException {
  String path=rootPath + "String_Node_Str" + HA_SERVERS_CHILD;
  try {
    zooKeeper.create(path,new byte[0],ZooDefs.Ids.OPEN_ACL_UNSAFE,CreateMode.PERSISTENT);
  }
 catch (  KeeperException e) {
    if (e.code() != KeeperException.Code.NODEEXISTS) {
      throw e;
    }
  }
  String machinePath=path + "String_Node_Str" + machineId;
  byte[] data=haServerAsData();
  try {
    zooKeeper.create(machinePath,data,ZooDefs.Ids.OPEN_ACL_UNSAFE,CreateMode.EPHEMERAL);
  }
 catch (  KeeperException e) {
    if (e.code() != KeeperException.Code.NODEEXISTS) {
      throw e;
    }
    msgLog.logMessage("String_Node_Str");
    try {
      zooKeeper.delete(machinePath,-1);
    }
 catch (    KeeperException ee) {
      ee.printStackTrace();
    }
 finally {
      writeHaServerConfig();
    }
  }
  zooKeeper.setData(machinePath,data,-1);
  msgLog.logMessage("String_Node_Str" + haServer + "String_Node_Str");
}
Program: 154727
Project: 154727
Buggy source:
private void parseArgs(String[] args){
  for (int i=0; i < args.length; i++) {
    String arg=args[i];
    if (isOption(arg)) {
      arg=stripOption(arg);
      int equalIndex=arg.indexOf('=');
      if (equalIndex != -1) {
        String key=arg.substring(0,equalIndex);
        String value=arg.substring(equalIndex + 1);
        if (value.length() > 0) {
          map.put(key,value);
        }
      }
 else {
        String key=arg;
        int nextIndex=++i;
        String value=nextIndex < args.length ? args[nextIndex] : null;
        value=value == null || isOption(value) ? null : value;
        map.put(key,value);
      }
    }
 else {
      orphans.add(arg);
    }
  }
}

Fixed version (ground truth):
private void parseArgs(String[] args){
  for (int i=0; i < args.length; i++) {
    String arg=args[i];
    if (isOption(arg)) {
      arg=stripOption(arg);
      int equalIndex=arg.indexOf('=');
      if (equalIndex != -1) {
        String key=arg.substring(0,equalIndex);
        String value=arg.substring(equalIndex + 1);
        if (value.length() > 0) {
          map.put(key,value);
        }
      }
 else {
        String key=arg;
        int nextIndex=i + 1;
        String value=nextIndex < args.length ? args[nextIndex] : null;
        value=value == null || isOption(value) ? null : value;
        if (value != null) {
          i=nextIndex;
        }
        map.put(key,value);
      }
    }
 else {
      orphans.add(arg);
    }
  }
}
Program: 154729
Project: 154729
Buggy source:
private void parseArgs(String[] args){
  for (int i=0; i < args.length; i++) {
    String arg=args[i];
    if (isOption(arg)) {
      arg=stripOption(arg);
      int equalIndex=arg.indexOf('=');
      if (equalIndex != -1) {
        String key=arg.substring(0,equalIndex);
        String value=arg.substring(equalIndex + 1);
        if (value.length() > 0) {
          map.put(key,value);
        }
      }
 else {
        String key=arg;
        int nextIndex=++i;
        String value=nextIndex < args.length ? args[nextIndex] : null;
        value=value == null || isOption(value) ? null : value;
        map.put(key,value);
      }
    }
 else {
      orphans.add(arg);
    }
  }
}

Fixed version (ground truth):
private void parseArgs(String[] args){
  for (int i=0; i < args.length; i++) {
    String arg=args[i];
    if (isOption(arg)) {
      arg=stripOption(arg);
      int equalIndex=arg.indexOf('=');
      if (equalIndex != -1) {
        String key=arg.substring(0,equalIndex);
        String value=arg.substring(equalIndex + 1);
        if (value.length() > 0) {
          map.put(key,value);
        }
      }
 else {
        String key=arg;
        int nextIndex=i + 1;
        String value=nextIndex < args.length ? args[nextIndex] : null;
        value=value == null || isOption(value) ? null : value;
        if (value != null) {
          i=nextIndex;
        }
        map.put(key,value);
      }
    }
 else {
      orphans.add(arg);
    }
  }
}
Program: 154730
Project: 154730
Buggy source:
public String get(String key,String defaultValue){
  return this.map.containsKey(key) ? this.map.get(key) : defaultValue;
}

Fixed version (ground truth):
public String get(String key,String defaultValue){
  String value=this.map.get(key);
  return value != null ? value : defaultValue;
}
Program: 154731
Project: 154731
Buggy source:
boolean isReadOnly(){
  return readOnly;
}

Fixed version (ground truth):
public boolean isReadOnly(){
  return readOnly;
}
Program: 154732
Project: 154732
Buggy source:
public void load(final Map<Object,Object> params){
  extensions=new KernelExtension.KernelData(){
    @Override public String version(){
      return KERNEL_VERSION;
    }
    @Override public Config getConfig(){
      return config;
    }
    @Override public Map<Object,Object> getConfigParams(){
      return params;
    }
    @Override public GraphDatabaseService graphDatabase(){
      return EmbeddedGraphDbImpl.this.graphDbService;
    }
    protected void loaded(    KernelExtension extension){
      if (extension instanceof IndexProvider) {
        indexManager.addProvider(extension.getKey(),(IndexProvider)extension);
      }
    }
  }
;
  extensions.startup(msgLog);
}

Fixed version (ground truth):
public void load(){
  extensions.loadAll(msgLog);
}
Program: 154734
Project: 154734
Buggy source:
@Override public Map<Object,Object> getConfigParams(){
  return params;
}

Fixed version (ground truth):
@Override public Map<Object,Object> getConfigParams(){
  return config.getParams();
}
Program: 154736
Project: 154736
Buggy source:
synchronized void shutdown(StringLogger msgLog){
  for (  KernelExtension loaded : state.keySet()) {
    try {
      loaded.unload(this);
    }
 catch (    Exception ex) {
      msgLog.logMessage("String_Node_Str" + loaded,ex);
    }
  }
  removeInstance(instanceId);
}

Fixed version (ground truth):
synchronized void shutdown(StringLogger msgLog){
  for (  KernelExtension loaded : loadedExtensions) {
    try {
      loaded.unload(this);
    }
 catch (    Exception ex) {
      msgLog.logMessage("String_Node_Str" + loaded,ex);
    }
  }
  removeInstance(instanceId);
}
Program: 154737
Project: 154737
Buggy source:
void load(Map<Object,Object> params);

Fixed version (ground truth):
void load();
Program: 154738
Project: 154738
Buggy source:
Query query(String keyOrNull,Object value,QueryContext contextOrNull){
  if (value instanceof Query) {
    return (Query)value;
  }
  QueryParser parser=new QueryParser(Version.LUCENE_30,keyOrNull,analyzer);
  parser.setAllowLeadingWildcard(true);
  parser.setLowercaseExpandedTerms(false);
  if (contextOrNull != null && contextOrNull.defaultOperator != null) {
    parser.setDefaultOperator(contextOrNull.defaultOperator);
  }
  try {
    return parser.parse(value.toString());
  }
 catch (  ParseException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
Query query(String keyOrNull,Object value,QueryContext contextOrNull){
  if (value instanceof Query) {
    return (Query)value;
  }
  QueryParser parser=new QueryParser(Version.LUCENE_30,keyOrNull,analyzer);
  parser.setAllowLeadingWildcard(true);
  parser.setLowercaseExpandedTerms(toLowerCase);
  if (contextOrNull != null && contextOrNull.defaultOperator != null) {
    parser.setDefaultOperator(contextOrNull.defaultOperator);
  }
  try {
    return parser.parse(value.toString());
  }
 catch (  ParseException e) {
    throw new RuntimeException(e);
  }
}
Program: 154739
Project: 154739
Buggy source:
private IndexType(Analyzer analyzer){
  this.analyzer=analyzer;
}

Fixed version (ground truth):
private IndexType(Analyzer analyzer,boolean toLowerCase){
  this.analyzer=analyzer;
  this.toLowerCase=toLowerCase;
}
Program: 154740
Project: 154740
Buggy source:
static IndexType getIndexType(IndexIdentifier identifier){
  Map<String,String> config=identifier.config;
  String type=config.get(configKey(identifier.indexName,"String_Node_Str"));
  IndexType result=null;
  if (type.equals("String_Node_Str")) {
    result=EXACT;
  }
 else   if (type.equals("String_Node_Str")) {
    result=new FulltextType(getAnalyzer(config,identifier.indexName));
  }
 else {
    throw new RuntimeException("String_Node_Str" + type + "String_Node_Str"+ identifier.indexName+ "String_Node_Str");
  }
  return result;
}

Fixed version (ground truth):
static IndexType getIndexType(IndexIdentifier identifier){
  Map<String,String> config=identifier.config;
  String type=config.get(configKey(identifier.indexName,"String_Node_Str"));
  IndexType result=null;
  boolean toLowerCase=parseBoolean(config.get(configKey(identifier.indexName,"String_Node_Str")),true);
  Analyzer customAnalyzer=getCustomAnalyzer(config,identifier.indexName);
  if (type != null) {
    if (type.equals("String_Node_Str")) {
      result=EXACT;
    }
 else     if (type.equals("String_Node_Str")) {
      Analyzer analyzer=customAnalyzer;
      if (analyzer == null) {
        analyzer=toLowerCase ? LuceneDataSource.LOWER_CASE_WHITESPACE_ANALYZER : LuceneDataSource.WHITESPACE_ANALYZER;
      }
      result=new CustomType(analyzer,toLowerCase);
    }
  }
 else {
    if (customAnalyzer == null) {
      throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + Analyzer.class.getName() + "String_Node_Str");
    }
    result=new CustomType(customAnalyzer,toLowerCase);
  }
  return result;
}
Program: 154741
Project: 154741
Buggy source:
/** 
 * Returns an algorithm which can find all paths of a certain length between two nodes. These returned paths can contain loops (i.e. a node could occur more than once in any returned path).
 * @see ShortestPath
 * @param expander the {@link RelationshipExpander} to use for expanding{@link Relationship}s for each   {@link Node}.
 * @param length the {@link Path#length()} returned paths are must have.
 * @return an algorithm which finds paths of a certain length between two nodes.
 */
public static PathFinder<Path> pathsWithLength(RelationshipExpander expander,int length){
  return new ShortestPath(length,expander,true);
}

Fixed version (ground truth):
/** 
 * Returns an algorithm which can find simple all paths of a certain length between two nodes. These returned paths cannot contain loops (i.e. a node could not occur more than once in any returned path).
 * @see ShortestPath
 * @param expander the {@link RelationshipExpander} to use for expanding{@link Relationship}s for each   {@link Node}.
 * @param length the {@link Path#length()} returned paths will have, if anypaths were found.
 * @return an algorithm which finds paths of a certain length between two nodes.
 */
public static PathFinder<Path> pathsWithLength(RelationshipExpander expander,int length){
  return new ShortestPath(length,expander,true);
}
Program: 154742
Project: 154742
Buggy source:
@Override protected Node fetchNextOrNull(){
  while (true) {
    Relationship nextRel=fetchNextRelOrNull();
    if (nextRel == null) {
      return null;
    }
    Node result=nextRel.getOtherNode(this.lastParentTraverserNode);
    LevelData levelData=this.visitedNodes.get(result);
    boolean createdLevelData=false;
    if (levelData == null) {
      levelData=new LevelData(nextRel,this.currentDepth);
      this.visitedNodes.put(result,levelData);
      createdLevelData=true;
    }
    if (this.currentDepth < levelData.depth) {
      throw new RuntimeException("String_Node_Str");
    }
 else     if (!this.stopAsap && this.currentDepth == levelData.depth && !createdLevelData) {
      levelData.addRel(nextRel);
    }
    if (!createdLevelData) {
      continue;
    }
    this.nextNodes.add(result);
    return result;
  }
}

Fixed version (ground truth):
@Override protected Node fetchNextOrNull(){
  while (true) {
    Relationship nextRel=fetchNextRelOrNull();
    if (nextRel == null) {
      return null;
    }
    if (!hitDecider.canVisitRelationship(sharedVisitedRels,nextRel)) {
      continue;
    }
    Node result=nextRel.getOtherNode(this.lastParentTraverserNode);
    LevelData levelData=this.visitedNodes.get(result);
    boolean createdLevelData=false;
    if (levelData == null) {
      levelData=new LevelData(nextRel,this.currentDepth);
      this.visitedNodes.put(result,levelData);
      createdLevelData=true;
    }
    if (this.currentDepth < levelData.depth) {
      throw new RuntimeException("String_Node_Str");
    }
 else     if (!this.stopAsap && this.currentDepth == levelData.depth && !createdLevelData) {
      levelData.addRel(nextRel);
    }
    if (!createdLevelData) {
      continue;
    }
    this.nextNodes.add(result);
    return result;
  }
}
Program: 154743
Project: 154743
Buggy source:
DirectionData(Node startNode,Collection<Long> sharedVisitedRels,MutableInteger sharedFrozenDepth,MutableBoolean sharedStop,MutableInteger sharedCurrentDepth,boolean stopAsap,RelationshipExpander expander){
  this.startNode=startNode;
  this.visitedNodes.put(startNode,new LevelData(null,0));
  this.nextNodes.add(startNode);
  this.sharedFrozenDepth=sharedFrozenDepth;
  this.sharedStop=sharedStop;
  this.sharedCurrentDepth=sharedCurrentDepth;
  this.stopAsap=stopAsap;
  this.expander=expander;
  prepareNextLevel();
}

Fixed version (ground truth):
DirectionData(Node startNode,Collection<Long> sharedVisitedRels,MutableInteger sharedFrozenDepth,MutableBoolean sharedStop,MutableInteger sharedCurrentDepth,boolean stopAsap,RelationshipExpander expander){
  this.startNode=startNode;
  this.visitedNodes.put(startNode,new LevelData(null,0));
  this.nextNodes.add(startNode);
  this.sharedFrozenDepth=sharedFrozenDepth;
  this.sharedStop=sharedStop;
  this.sharedCurrentDepth=sharedCurrentDepth;
  this.stopAsap=stopAsap;
  this.expander=expander;
  this.sharedVisitedRels=sharedVisitedRels;
  prepareNextLevel();
}
Program: 154744
Project: 154744
Buggy source:
private void read(){
  if (!file.exists()) {
    return;
  }
  FileChannel channel=null;
  try {
    channel=new RandomAccessFile(file,"String_Node_Str").getChannel();
    Integer version=tryToReadVersion(channel);
    if (version == null) {
      close(channel);
      channel=new RandomAccessFile(file,"String_Node_Str").getChannel();
      readMap(channel,nodeConfig,version);
      relConfig.putAll(nodeConfig);
    }
 else     if (version < VERSION) {
      throw new UnsupportedOperationException("String_Node_Str" + version);
    }
 else {
      readMap(channel,nodeConfig,readNextInt(channel));
      readMap(channel,relConfig,readNextInt(channel));
    }
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
 finally {
    close(channel);
  }
}

Fixed version (ground truth):
private void read(){
  File fileToReadFrom=file.exists() ? file : oldFile;
  if (!fileToReadFrom.exists()) {
    return;
  }
  FileChannel channel=null;
  try {
    channel=new RandomAccessFile(fileToReadFrom,"String_Node_Str").getChannel();
    Integer version=tryToReadVersion(channel);
    if (version == null) {
      close(channel);
      channel=new RandomAccessFile(fileToReadFrom,"String_Node_Str").getChannel();
      readMap(channel,nodeConfig,version);
      relConfig.putAll(nodeConfig);
    }
 else     if (version < VERSION) {
      throw new UnsupportedOperationException("String_Node_Str" + version);
    }
 else {
      readMap(channel,nodeConfig,readNextInt(channel));
      readMap(channel,relConfig,readNextInt(channel));
    }
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
 finally {
    close(channel);
  }
}
Program: 154745
Project: 154745
Buggy source:
public IndexStore(String graphDbStoreDir){
  this.file=new File(new File(graphDbStoreDir),"String_Node_Str");
  read();
}

Fixed version (ground truth):
public IndexStore(String graphDbStoreDir){
  this.file=new File(new File(graphDbStoreDir),"String_Node_Str");
  this.oldFile=new File(file.getParentFile(),file.getName() + "String_Node_Str");
  read();
}
Program: 154746
Project: 154746
Buggy source:
@Test public void testRecovery() throws Exception {
  final GraphDatabaseService graphDb=newGraphDbService();
  final IndexProvider provider=new LuceneIndexProvider(graphDb);
  final Index<Node> nodeIndex=provider.nodeIndex("String_Node_Str",LuceneIndexProvider.EXACT_CONFIG);
  final Index<Relationship> relIndex=provider.relationshipIndex("String_Node_Str",LuceneIndexProvider.EXACT_CONFIG);
  final RelationshipType relType=DynamicRelationshipType.withName("String_Node_Str");
  graphDb.beginTx();
  Random random=new Random();
  Thread stopper=new Thread(){
    @Override public void run(){
      sleepNice(1000);
      graphDb.shutdown();
    }
  }
;
  final String[] keys={"String_Node_Str","String_Node_Str","String_Node_Str"};
  try {
    stopper.start();
    for (int i=0; i < 50; i++) {
      Node node=graphDb.createNode();
      Node otherNode=graphDb.createNode();
      Relationship rel=node.createRelationshipTo(otherNode,relType);
      for (int ii=0; ii < 3; ii++) {
        nodeIndex.add(node,keys[random.nextInt(keys.length)],random.nextInt());
        relIndex.add(rel,keys[random.nextInt(keys.length)],random.nextInt());
      }
      sleepNice(10);
    }
  }
 catch (  Exception e) {
  }
  sleepNice(1000);
  final GraphDatabaseService newGraphDb=new EmbeddedGraphDatabase(getDbPath());
  final IndexProvider newProvider=new LuceneIndexProvider(newGraphDb);
  sleepNice(1000);
  newGraphDb.shutdown();
}

Fixed version (ground truth):
@Test public void testRecovery() throws Exception {
  final GraphDatabaseService graphDb=newGraphDbService();
  final IndexProvider provider=new LuceneIndexProvider(graphDb);
  final Index<Node> nodeIndex=provider.nodeIndex("String_Node_Str",LuceneIndexProvider.EXACT_CONFIG);
  final Index<Relationship> relIndex=provider.relationshipIndex("String_Node_Str",LuceneIndexProvider.EXACT_CONFIG);
  final RelationshipType relType=DynamicRelationshipType.withName("String_Node_Str");
  graphDb.beginTx();
  Random random=new Random();
  Thread stopper=new Thread(){
    @Override public void run(){
      sleepNice(1000);
      graphDb.shutdown();
    }
  }
;
  final String[] keys={"String_Node_Str","String_Node_Str","String_Node_Str"};
  try {
    stopper.start();
    for (int i=0; i < 50; i++) {
      Node node=graphDb.createNode();
      Node otherNode=graphDb.createNode();
      Relationship rel=node.createRelationshipTo(otherNode,relType);
      for (int ii=0; ii < 3; ii++) {
        nodeIndex.add(node,keys[random.nextInt(keys.length)],random.nextInt());
        relIndex.add(rel,keys[random.nextInt(keys.length)],random.nextInt());
      }
      sleepNice(10);
    }
  }
 catch (  Exception e) {
  }
  while (stopper.getState() != State.TERMINATED) {
    sleepNice(100);
  }
  final GraphDatabaseService newGraphDb=new EmbeddedGraphDatabase(getDbPath());
  final IndexProvider newProvider=new LuceneIndexProvider(newGraphDb);
  newGraphDb.shutdown();
}
Program: 154747
Project: 154747
Buggy source:
DeleteCommand(IndexIdentifier indexId){
  super(indexId,(byte)0,-1L,"String_Node_Str","String_Node_Str",DELETE_COMMAND);
}

Fixed version (ground truth):
DeleteCommand(IndexIdentifier indexId){
  super(indexId,indexId.entityTypeByte,-1L,"String_Node_Str","String_Node_Str",DELETE_COMMAND);
}
Program: 154748
Project: 154748
Buggy source:
@Override public void run(){
  CommandState state=new CommandState(index,graphDb);
  threadState.set(WorkThread.WAITING);
  while (state.alive) {
    try {
      latch=new CountDownLatch(1);
      log("String_Node_Str");
      latch.await();
      threadState.set(RUNNING);
      Command command=commands.poll();
      log("String_Node_Str" + command.getClass().getSimpleName());
      command.doWork(state);
      threadState.set(WorkThread.DONE);
    }
 catch (    InterruptedException e) {
      throw new RuntimeException(e);
    }
catch (    Exception exception) {
      this.exception=exception;
      threadState.set(WorkThread.DONE);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  CommandState state=new CommandState(index,graphDb);
  threadState.set(STARTING);
  while (state.alive) {
    try {
      latch=new CountDownLatch(1);
      log("String_Node_Str");
      latch.await();
      threadState.set(RUNNING);
      Command command=commands.poll();
      log("String_Node_Str" + command.getClass().getSimpleName());
      command.doWork(state);
      threadState.set(DONE);
    }
 catch (    InterruptedException e) {
      throw new RuntimeException(e);
    }
catch (    Exception exception) {
      this.exception=exception;
      threadState.set(DONE);
    }
  }
}
Program: 154749
Project: 154749
Buggy source:
private void waitFor(){
  while (!threadState.compareAndSet(DONE,WAITING)) {
    try {
      Thread.sleep(10);
    }
 catch (    InterruptedException e) {
      throw new RuntimeException(e);
    }
  }
}

Fixed version (ground truth):
private void waitFor(int expectedState,int newState){
  int retries=0;
  while (!threadState.compareAndSet(expectedState,newState) && retries++ < 100) {
    try {
      Thread.sleep(10);
    }
 catch (    InterruptedException e) {
      throw new RuntimeException(e);
    }
  }
  if (retries > 100) {
    throw new IllegalStateException("String_Node_Str");
  }
}
Program: 154750
Project: 154750
Buggy source:
public BaseWorker(Index<Node> index,GraphDatabaseService graphDb){
  this.index=index;
  this.graphDb=graphDb;
  start();
}

Fixed version (ground truth):
public BaseWorker(Index<Node> index,GraphDatabaseService graphDb){
  this.index=index;
  this.graphDb=graphDb;
  start();
  waitForWorkerToStart();
}
Program: 154751
Project: 154751
Buggy source:
protected void queueCommand(Command cmd){
  commands.add(cmd);
  log("String_Node_Str" + cmd.getClass().getSimpleName());
  latch.countDown();
  waitFor();
  threadState.set(WAITING);
}

Fixed version (ground truth):
protected void queueCommand(Command cmd){
  commands.add(cmd);
  log("String_Node_Str" + cmd.getClass().getSimpleName());
  latch.countDown();
  waitForCommandToComplete();
  threadState.set(WAITING);
}
Program: 154752
Project: 154752
Buggy source:
/** 
 * @param serverLocation the RMI location of the server to connect to.
 * @throws ShellException if no server was found at the RMI location.
 */
public RemoteClient(RmiLocation serverLocation) throws ShellException {
  this.serverLocation=serverLocation;
  this.server=findRemoteServer();
  this.session=new SessionImpl();
  this.out=RemoteOutput.newOutput();
}

Fixed version (ground truth):
/** 
 * @param serverLocation the RMI location of the server to connect to.
 * @throws ShellException if no server was found at the RMI location.
 */
public RemoteClient(RmiLocation serverLocation) throws ShellException {
  this.serverLocation=serverLocation;
  this.server=findRemoteServer();
  this.out=RemoteOutput.newOutput();
}
Program: 154753
Project: 154753
Buggy source:
public void shutdown(){
  this.tryUnexport(this.out);
  if (session.writer != null)   this.tryUnexport(session.writer);
}

Fixed version (ground truth):
public void shutdown(){
  super.shutdown();
  this.tryUnexport(this.out);
}
Program: 154754
Project: 154754
Buggy source:
public static void main(final String[] args){
  deleteFileOrDirectory(new File(DB_PATH));
  graphDb=new EmbeddedGraphDatabase(DB_PATH);
  indexService=new LuceneIndexService(graphDb);
  registerShutdownHook();
  Transaction tx=graphDb.beginTx();
  try {
    createChain("String_Node_Str","String_Node_Str");
    createChain("String_Node_Str","String_Node_Str","String_Node_Str");
    createChain("String_Node_Str","String_Node_Str","String_Node_Str");
    createChain("String_Node_Str","String_Node_Str");
    tx.success();
  }
  finally {
    tx.finish();
  }
  Node neo=getOrCreateNode("String_Node_Str");
  Node agentSmith=getOrCreateNode("String_Node_Str");
  PathFinder<Path> finder=GraphAlgoFactory.shortestPath(Traversal.expanderForTypes(KNOWS,Direction.BOTH),4);
  Path foundPath=finder.findSinglePath(neo,agentSmith);
  System.out.println("String_Node_Str" + Traversal.simplePathToString(foundPath,NAME_KEY));
  System.out.println("String_Node_Str");
  indexService.shutdown();
  graphDb.shutdown();
  System.exit(0);
}

Fixed version (ground truth):
public static void main(final String[] args){
  deleteFileOrDirectory(new File(DB_PATH));
  graphDb=new EmbeddedGraphDatabase(DB_PATH);
  indexService=new LuceneIndexService(graphDb);
  registerShutdownHook();
  Transaction tx=graphDb.beginTx();
  try {
    createChain("String_Node_Str","String_Node_Str");
    createChain("String_Node_Str","String_Node_Str","String_Node_Str");
    createChain("String_Node_Str","String_Node_Str","String_Node_Str");
    createChain("String_Node_Str","String_Node_Str");
    tx.success();
  }
  finally {
    tx.finish();
  }
  Node neo=getOrCreateNode("String_Node_Str");
  Node agentSmith=getOrCreateNode("String_Node_Str");
  PathFinder<Path> finder=GraphAlgoFactory.shortestPath(Traversal.expanderForTypes(KNOWS,Direction.BOTH),4);
  Path foundPath=finder.findSinglePath(neo,agentSmith);
  System.out.println("String_Node_Str" + Traversal.simplePathToString(foundPath,NAME_KEY));
  System.out.println("String_Node_Str");
  indexService.shutdown();
  graphDb.shutdown();
}
Program: 154755
Project: 154755
Buggy source:
public static void main(final String[] args){
  GraphDatabaseService graphDb=new EmbeddedGraphDatabase(DB_PATH);
  registerShutdownHook(graphDb);
  Transaction tx=graphDb.beginTx();
  try {
    Node firstNode=graphDb.createNode();
    firstNode.setProperty(NAME_KEY,"String_Node_Str");
    Node secondNode=graphDb.createNode();
    secondNode.setProperty(NAME_KEY,"String_Node_Str");
    firstNode.createRelationshipTo(secondNode,ExampleRelationshipTypes.EXAMPLE);
    String greeting=firstNode.getProperty(NAME_KEY) + "String_Node_Str" + secondNode.getProperty(NAME_KEY);
    System.out.println(greeting);
    firstNode.getSingleRelationship(ExampleRelationshipTypes.EXAMPLE,Direction.OUTGOING).delete();
    firstNode.delete();
    secondNode.delete();
    tx.success();
  }
  finally {
    tx.finish();
  }
  System.out.println("String_Node_Str");
  graphDb.shutdown();
  System.exit(0);
}

Fixed version (ground truth):
public static void main(final String[] args){
  GraphDatabaseService graphDb=new EmbeddedGraphDatabase(DB_PATH);
  registerShutdownHook(graphDb);
  Transaction tx=graphDb.beginTx();
  try {
    Node firstNode=graphDb.createNode();
    firstNode.setProperty(NAME_KEY,"String_Node_Str");
    Node secondNode=graphDb.createNode();
    secondNode.setProperty(NAME_KEY,"String_Node_Str");
    firstNode.createRelationshipTo(secondNode,ExampleRelationshipTypes.EXAMPLE);
    String greeting=firstNode.getProperty(NAME_KEY) + "String_Node_Str" + secondNode.getProperty(NAME_KEY);
    System.out.println(greeting);
    firstNode.getSingleRelationship(ExampleRelationshipTypes.EXAMPLE,Direction.OUTGOING).delete();
    firstNode.delete();
    secondNode.delete();
    tx.success();
  }
  finally {
    tx.finish();
  }
  System.out.println("String_Node_Str");
  graphDb.shutdown();
}