nus-yam/ex-repair huggingface dataset:
Program: 154642
Project: 154642
Buggy source:
public MasterClient(Machine machine,String storeDir,ResponseReceiver receiver){
  this(machine.getServer().first(),machine.getServer().other(),storeDir,receiver);
}

Fixed version (ground truth):
public MasterClient(Machine machine,String storeDir){
  this(machine.getServer().first(),machine.getServer().other(),storeDir);
}
Program: 154644
Project: 154644
Buggy source:
@Override public long getFileChannelPosition() throws IOException {
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
public long getFileChannelPosition() throws IOException {
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 154645
Project: 154645
Buggy source:
@Override public LogBuffer putFloat(float f) throws IOException {
  byteBuffer.putFloat(f);
  return checkFlush();
}

Fixed version (ground truth):
public LogBuffer putFloat(float f) throws IOException {
  byteBuffer.putFloat(f);
  return checkFlush();
}
Program: 154646
Project: 154646
Buggy source:
@Override public LogBuffer putInt(int i) throws IOException {
  byteBuffer.putInt(i);
  return checkFlush();
}

Fixed version (ground truth):
public LogBuffer putInt(int i) throws IOException {
  byteBuffer.putInt(i);
  return checkFlush();
}
Program: 154647
Project: 154647
Buggy source:
@Override public LogBuffer putDouble(double d) throws IOException {
  byteBuffer.putDouble(d);
  return checkFlush();
}

Fixed version (ground truth):
public LogBuffer putDouble(double d) throws IOException {
  byteBuffer.putDouble(d);
  return checkFlush();
}
Program: 154648
Project: 154648
Buggy source:
@Override public void force() throws IOException {
}

Fixed version (ground truth):
public void force() throws IOException {
}
Program: 154649
Project: 154649
Buggy source:
private LogBuffer checkFlush(){
  if (byteBuffer.position() > MAX_SIZE) {
    target.writeBytes(byteArray,0,MAX_SIZE);
    int pos=byteBuffer.position();
    clearInternalBuffer();
    byteBuffer.put(byteArray,MAX_SIZE,MAX_SIZE - pos);
  }
  return this;
}

Fixed version (ground truth):
private LogBuffer checkFlush(){
  if (byteBuffer.position() > MAX_SIZE) {
    target.writeBytes(byteArray,0,MAX_SIZE);
    int pos=byteBuffer.position();
    clearInternalBuffer();
    byteBuffer.put(byteArray,MAX_SIZE,pos - MAX_SIZE);
  }
  return this;
}
Program: 154650
Project: 154650
Buggy source:
@Override public LogBuffer putLong(long l) throws IOException {
  byteBuffer.putLong(l);
  return checkFlush();
}

Fixed version (ground truth):
public LogBuffer putLong(long l) throws IOException {
  byteBuffer.putLong(l);
  return checkFlush();
}
Program: 154651
Project: 154651
Buggy source:
@Override public LogBuffer put(char[] chars) throws IOException {
  for (int bytePos=0; bytePos < chars.length * 2; ) {
    int bytesToWrite=Math.min(byteBuffer.remaining(),chars.length * 2 - bytePos);
    bytesToWrite-=(bytesToWrite % 2);
    for (int i=0; i < bytesToWrite / 2; i++) {
      byteBuffer.putChar(chars[(bytePos / 2) + i]);
    }
    checkFlush();
    bytePos+=bytesToWrite;
  }
  return this;
}

Fixed version (ground truth):
public LogBuffer put(char[] chars) throws IOException {
  for (int bytePos=0; bytePos < chars.length * 2; ) {
    int bytesToWrite=Math.min(byteBuffer.remaining(),chars.length * 2 - bytePos);
    bytesToWrite-=(bytesToWrite % 2);
    for (int i=0; i < bytesToWrite / 2; i++) {
      byteBuffer.putChar(chars[(bytePos / 2) + i]);
    }
    checkFlush();
    bytePos+=bytesToWrite;
  }
  return this;
}
Program: 154652
Project: 154652
Buggy source:
@Override public FileChannel getFileChannel(){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
public FileChannel getFileChannel(){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 154653
Project: 154653
Buggy source:
@Override public void describeTo(Description descr){
  descr.appendText(String.format("String_Node_Str",toString(expected),toString(actual)));
}

Fixed version (ground truth):
public void describeTo(Description descr){
  descr.appendText(String.format("String_Node_Str",toString(expected),toString(actual)));
}
Program: 154654
Project: 154654
Buggy source:
private String toString(Object value){
  if (value instanceof byte[]) {
    return Arrays.toString((byte[])value);
  }
  if (value instanceof char[]) {
    return Arrays.toString((char[])value);
  }
  return "String_Node_Str" + value;
}

Fixed version (ground truth):
private String toString(Object value){
  if (value instanceof byte[]) {
    return Arrays.toString((byte[])value) + "String_Node_Str" + ((byte[])value).length;
  }
  if (value instanceof char[]) {
    return Arrays.toString((char[])value) + "String_Node_Str" + ((char[])value).length;
  }
  return "String_Node_Str" + value;
}
Program: 154655
Project: 154655
Buggy source:
@Override public boolean matches(Object actual){
  this.actual=actual;
  if (expected instanceof byte[] && actual instanceof byte[]) {
    return Arrays.equals((byte[])actual,(byte[])expected);
  }
 else   if (expected instanceof char[] && actual instanceof char[]) {
    return Arrays.equals((char[])actual,(char[])expected);
  }
  return false;
}

Fixed version (ground truth):
public boolean matches(Object actual){
  this.actual=actual;
  if (expected instanceof byte[] && actual instanceof byte[]) {
    return Arrays.equals((byte[])actual,(byte[])expected);
  }
 else   if (expected instanceof char[] && actual instanceof char[]) {
    return Arrays.equals((char[])actual,(char[])expected);
  }
  return false;
}
Program: 154656
Project: 154656
Buggy source:
public CombiningIterator(Iterable<? extends Iterator<T>> iterators){
  this.iterators=iterators.iterator();
}

Fixed version (ground truth):
public CombiningIterator(T first,Iterator<T> rest){
  this(Collections.<Iterator<T>>emptyList());
  this.hasFetchedNext=true;
  this.nextObject=first;
  this.currentIterator=rest;
}
Program: 154657
Project: 154657
Buggy source:
public Iterable<Relationship> relationships(){
  return new IterableWrapper<Relationship,Path>(this){
    @Override public Iterator<Relationship> iterator(){
      Iterator<Relationship> iter=super.iterator();
      iter.next();
      return iter;
    }
    @Override protected Relationship underlyingObjectToObject(    Path position){
      return position.lastRelationship();
    }
  }
;
}

Fixed version (ground truth):
public Iterable<Relationship> relationships(){
  return new IterableWrapper<Relationship,Path>(this){
    @Override public Iterator<Relationship> iterator(){
      Iterator<Relationship> iter=super.iterator();
      Relationship first=iter.next();
      if (first == null)       return iter;
      return new CombiningIterator<Relationship>(first,iter);
    }
    @Override protected Relationship underlyingObjectToObject(    Path position){
      return position.lastRelationship();
    }
  }
;
}
Program: 154658
Project: 154658
Buggy source:
@Override public Iterator<Relationship> iterator(){
  Iterator<Relationship> iter=super.iterator();
  iter.next();
  return iter;
}

Fixed version (ground truth):
@Override public Iterator<Relationship> iterator(){
  Iterator<Relationship> iter=super.iterator();
  Relationship first=iter.next();
  if (first == null)   return iter;
  return new CombiningIterator<Relationship>(first,iter);
}
Program: 154659
Project: 154659
Buggy source:
public Iterable<Relationship> relationships(){
  return new IterableWrapper<Relationship,Path>(this){
    @Override public Iterator<Relationship> iterator(){
      Iterator<Relationship> iter=super.iterator();
      Relationship first=iter.next();
      if (first == null)       return iter;
      return new CombiningIterator<Relationship>(first,iter);
    }
    @Override protected Relationship underlyingObjectToObject(    Path position){
      return position.lastRelationship();
    }
  }
;
}

Fixed version (ground truth):
public Iterable<Relationship> relationships(){
  return new IterableWrapper<Relationship,Path>(this){
    @Override public Iterator<Relationship> iterator(){
      Iterator<Relationship> iter=super.iterator();
      if (iter.hasNext()) {
        Relationship first=iter.next();
        if (first == null)         return iter;
        return new CombiningIterator<Relationship>(first,iter);
      }
 else {
        return iter;
      }
    }
    @Override protected Relationship underlyingObjectToObject(    Path position){
      return position.lastRelationship();
    }
  }
;
}
Program: 154660
Project: 154660
Buggy source:
@Override public Iterator<Relationship> iterator(){
  Iterator<Relationship> iter=super.iterator();
  Relationship first=iter.next();
  if (first == null)   return iter;
  return new CombiningIterator<Relationship>(first,iter);
}

Fixed version (ground truth):
@Override public Iterator<Relationship> iterator(){
  Iterator<Relationship> iter=super.iterator();
  if (iter.hasNext()) {
    Relationship first=iter.next();
    if (first == null)     return iter;
    return new CombiningIterator<Relationship>(first,iter);
  }
 else {
    return iter;
  }
}
Program: 154662
Project: 154662
Buggy source:
public InstanceInfo[] getInstancesInCluster(){
  ConnectionInformation[] connections=db.getBroker().getConnectionInformation();
  InstanceInfo[] result=new InstanceInfo[connections.length];
  for (int i=0; i < result.length; i++) {
    ConnectionInformation connection=connections[i];
    result[i]=new InstanceInfo(connection.getJMXServiceURL(),connection.getInstanceId(),connection.getMachineId(),connection.isMaster(),connection.getLastCommitedTransactionId());
  }
  return result;
}

Fixed version (ground truth):
public InstanceInfo[] getInstancesInCluster(){
  ConnectionInformation[] connections=db.getBroker().getConnectionInformation();
  InstanceInfo[] result=new InstanceInfo[connections.length];
  for (int i=0; i < result.length; i++) {
    ConnectionInformation connection=connections[i];
    result[i]=new InstanceInfo(connection.getJMXServiceURL().toString(),connection.getInstanceId(),connection.getMachineId(),connection.isMaster(),connection.getLastCommitedTransactionId());
  }
  return result;
}
Program: 154663
Project: 154663
Buggy source:
private SlaveInfo slaveInfo(int machineId,Collection<SlaveContext> contexts){
  List<SlaveTransaction> txInfo=new ArrayList<SlaveTransaction>();
  for (  SlaveContext context : contexts) {
    Map<String,Long> lastTransactions=new HashMap<String,Long>();
    for (    Pair<String,Long> tx : context.lastAppliedTransactions()) {
      lastTransactions.put(tx.first(),tx.other());
    }
    txInfo.add(new SlaveTransaction(context.getEventIdentifier(),lastTransactions));
  }
  ConnectionInformation connection=db.getBroker().getConnectionInformation(machineId);
  return new SlaveInfo(connection.getJMXServiceURL(),connection.getInstanceId(),machineId,false,connection.getLastCommitedTransactionId(),txInfo.toArray(new SlaveTransaction[txInfo.size()]));
}

Fixed version (ground truth):
private SlaveInfo slaveInfo(int machineId,Collection<SlaveContext> contexts){
  List<SlaveTransaction> txInfo=new ArrayList<SlaveTransaction>();
  for (  SlaveContext context : contexts) {
    Map<String,Long> lastTransactions=new HashMap<String,Long>();
    for (    Pair<String,Long> tx : context.lastAppliedTransactions()) {
      lastTransactions.put(tx.first(),tx.other());
    }
    txInfo.add(new SlaveTransaction(context.getEventIdentifier(),lastTransactions));
  }
  ConnectionInformation connection=db.getBroker().getConnectionInformation(machineId);
  return new SlaveInfo(connection.getJMXServiceURL().toString(),connection.getInstanceId(),machineId,false,connection.getLastCommitedTransactionId(),txInfo.toArray(new SlaveTransaction[txInfo.size()]));
}
Program: 154664
Project: 154664
Buggy source:
public synchronized void setJmxConnectionData(JMXServiceURL jmxUrl,String instanceId){
  String path=rootPath + "String_Node_Str" + HA_SERVERS_CHILD+ "String_Node_Str"+ machineId+ "String_Node_Str";
  String url=jmxUrl.toString();
  byte[] data=new byte[(url.length() + instanceId.length()) * 2 + 4];
  ByteBuffer buffer=ByteBuffer.wrap(data);
  buffer.putShort((short)url.length());
  buffer.asCharBuffer().put(url.toCharArray());
  buffer.putShort((short)instanceId.length());
  buffer.asCharBuffer().put(url.toCharArray());
  if (buffer.limit() != data.length) {
    byte[] array=new byte[buffer.limit()];
    System.arraycopy(data,0,array,0,array.length);
    data=array;
  }
  try {
    zooKeeper.setData(path,data,-1);
  }
 catch (  KeeperException e) {
    msgLog.logMessage("String_Node_Str",e);
  }
catch (  InterruptedException e) {
    Thread.interrupted();
    msgLog.logMessage("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public synchronized void setJmxConnectionData(JMXServiceURL jmxUrl,String instanceId){
  String path=rootPath + "String_Node_Str" + HA_SERVERS_CHILD+ "String_Node_Str"+ machineId+ "String_Node_Str";
  String url=jmxUrl.toString();
  byte[] data=new byte[(url.length() + instanceId.length()) * 2 + 4];
  ByteBuffer buffer=ByteBuffer.wrap(data);
  buffer.putShort((short)url.length());
  buffer.asCharBuffer().put(url.toCharArray());
  buffer.position(buffer.position() + url.length() * 2);
  buffer.putShort((short)instanceId.length());
  buffer.asCharBuffer().put(instanceId.toCharArray());
  if (buffer.limit() != data.length) {
    byte[] array=new byte[buffer.limit()];
    System.arraycopy(data,0,array,0,array.length);
    data=array;
  }
  try {
    try {
      zooKeeper.setData(path,data,-1);
    }
 catch (    KeeperException e) {
      if (e.code() == KeeperException.Code.NONODE) {
        zooKeeper.create(path,data,ZooDefs.Ids.OPEN_ACL_UNSAFE,CreateMode.EPHEMERAL);
      }
 else {
        msgLog.logMessage("String_Node_Str",e);
      }
    }
  }
 catch (  KeeperException e) {
    msgLog.logMessage("String_Node_Str",e);
  }
catch (  InterruptedException e) {
    Thread.interrupted();
    msgLog.logMessage("String_Node_Str",e);
  }
}
Program: 154665
Project: 154665
Buggy source:
public void getJmxConnectionData(ConnectionInformation connection){
  String path=rootPath + "String_Node_Str" + HA_SERVERS_CHILD+ "String_Node_Str"+ machineId+ "String_Node_Str";
  byte[] data;
  try {
    data=zooKeeper.getData(path,false,null);
  }
 catch (  KeeperException e) {
    return;
  }
catch (  InterruptedException e) {
    Thread.interrupted();
    return;
  }
  if (data == null || data.length == 0)   return;
  ByteBuffer buffer=ByteBuffer.wrap(data);
  char[] url, instanceId;
  try {
    url=new char[buffer.getShort()];
    buffer.asCharBuffer().get(url);
    instanceId=new char[buffer.getShort()];
    buffer.asCharBuffer().get(instanceId);
  }
 catch (  BufferUnderflowException e) {
    return;
  }
  connection.setJMXConnectionData(new String(url),new String(instanceId));
}

Fixed version (ground truth):
public void getJmxConnectionData(ConnectionInformation connection){
  String path=rootPath + "String_Node_Str" + HA_SERVERS_CHILD+ "String_Node_Str"+ machineId+ "String_Node_Str";
  byte[] data;
  try {
    data=zooKeeper.getData(path,false,null);
  }
 catch (  KeeperException e) {
    return;
  }
catch (  InterruptedException e) {
    Thread.interrupted();
    return;
  }
  if (data == null || data.length == 0)   return;
  ByteBuffer buffer=ByteBuffer.wrap(data);
  char[] url, instanceId;
  try {
    url=new char[buffer.getShort()];
    buffer.asCharBuffer().get(url);
    buffer.position(buffer.position() + url.length * 2);
    instanceId=new char[buffer.getShort()];
    buffer.asCharBuffer().get(instanceId);
  }
 catch (  BufferUnderflowException e) {
    return;
  }
  connection.setJMXConnectionData(new String(url),new String(instanceId));
}
Program: 154666
Project: 154666
Buggy source:
public JMXServiceURL getAddress(){
  return address;
}

Fixed version (ground truth):
public String getAddress(){
  return address;
}
Program: 154667
Project: 154667
Buggy source:
@ConstructorProperties({"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}) public InstanceInfo(JMXServiceURL address,String instanceId,int machineId,boolean master,long lastTxId){
  this.address=address;
  this.instanceId=instanceId;
  this.machineId=machineId;
  this.master=master;
  this.lastTxId=lastTxId;
}

Fixed version (ground truth):
@ConstructorProperties({"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}) public InstanceInfo(String address,String instanceId,int machineId,boolean master,long lastTxId){
  this.address=address;
  this.instanceId=instanceId;
  this.machineId=machineId;
  this.master=master;
  this.lastTxId=lastTxId;
}
Program: 154668
Project: 154668
Buggy source:
public Pair<Neo4jManager,HighAvailability> connect(String username,String password){
  if (address == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  Neo4jManager manager=Neo4jManager.get(address,username,password,instanceId);
  return Pair.of(manager,manager.getBean(HighAvailability.class));
}

Fixed version (ground truth):
public Pair<Neo4jManager,HighAvailability> connect(String username,String password){
  if (address == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  Neo4jManager manager=Neo4jManager.get(url(),username,password,instanceId);
  return Pair.of(manager,manager.getBean(HighAvailability.class));
}
Program: 154669
Project: 154669
Buggy source:
@ConstructorProperties({"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}) public SlaveInfo(JMXServiceURL address,String instanceId,int machineId,boolean master,long lastTxId,SlaveTransaction... txInfo){
  super(address,instanceId,machineId,master,lastTxId);
  this.txInfo=txInfo;
}

Fixed version (ground truth):
@ConstructorProperties({"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}) public SlaveInfo(String address,String instanceId,int machineId,boolean master,long lastTxId,SlaveTransaction... txInfo){
  super(address,instanceId,machineId,master,lastTxId);
  this.txInfo=txInfo;
}
Program: 154671
Project: 154671
Buggy source:
@Test @Ignore("String_Node_Str") public void shouldBeAbleToInvokePluginWithLotsOfParams() throws Exception {
  String methodUri=getPluginMethodUri(functionalTestHelper.dataUri(),"String_Node_Str");
  String a="String_Node_Str";
  byte b=(byte)0xff;
  char c='c';
  short d=(short)4;
  int e=365;
  long f=(long)4;
  float g=(float)4.5;
  double h=Math.PI;
  boolean i=false;
  Map<String,Object> params=MapUtil.map("String_Node_Str",a,"String_Node_Str",b,"String_Node_Str",c,"String_Node_Str",d,"String_Node_Str",e,"String_Node_Str",f,"String_Node_Str",g,"String_Node_Str",h,"String_Node_Str",i);
  makePostMap(methodUri,params);
  assertThat(Plugin._string,is(a));
  assertThat(Plugin._byte,is(b));
  assertThat(Plugin._character,is(c));
  assertThat(Plugin._short,is(d));
  assertThat(Plugin._integer,is(e));
  assertThat(Plugin._long,is(f));
  assertThat(Plugin._float,is(g));
  assertThat(Plugin._double,is(h));
  assertThat(Plugin._boolean,is(i));
}

Fixed version (ground truth):
@Test public void shouldBeAbleToInvokePluginWithLotsOfParams() throws Exception {
  String methodUri=getPluginMethodUri(functionalTestHelper.dataUri(),"String_Node_Str");
  String a="String_Node_Str";
  byte b=(byte)0xff;
  char c='c';
  short d=(short)4;
  int e=365;
  long f=(long)4;
  float g=(float)4.5;
  double h=Math.PI;
  boolean i=false;
  Map<String,Object> params=MapUtil.map("String_Node_Str",a,"String_Node_Str",b,"String_Node_Str",c,"String_Node_Str",d,"String_Node_Str",e,"String_Node_Str",f,"String_Node_Str",g,"String_Node_Str",h,"String_Node_Str",i);
  makePostMap(methodUri,params);
  assertThat(Plugin._string,is(a));
  assertThat(Plugin._byte,is(b));
  assertThat(Plugin._character,is(c));
  assertThat(Plugin._short,is(d));
  assertThat(Plugin._integer,is(e));
  assertThat(Plugin._long,is(f));
  assertThat(Plugin._float,is(g));
  assertThat(Plugin._double,is(h));
  assertThat(Plugin._boolean,is(i));
}
Program: 154672
Project: 154672
Buggy source:
@Test public void canListExtensionMethodsForServerExtension() throws Exception {
  ClientResponse response=Client.create().resource(functionalTestHelper.extensionUri()).accept(MediaType.APPLICATION_JSON_TYPE).get(ClientResponse.class);
  assertThat(response.getStatus(),equalTo(200));
  Map<String,Object> json=JsonHelper.jsonToMap(response.getEntity(String.class));
  String refNodeService=(String)json.get(ReferenceNode.class.getSimpleName());
  response=Client.create().resource(refNodeService).accept(MediaType.APPLICATION_JSON_TYPE).get(ClientResponse.class);
  assertThat(response.getStatus(),equalTo(200));
  json=JsonHelper.jsonToMap(response.getEntity(String.class));
  System.out.println(json);
  json=(Map<String,Object>)json.get("String_Node_Str");
  assertThat(json,hasKey(ReferenceNode.GET_REFERENCE_NODE));
}

Fixed version (ground truth):
@Test public void canListExtensionMethodsForServerExtension() throws Exception {
  ClientResponse response=Client.create().resource(functionalTestHelper.extensionUri()).accept(MediaType.APPLICATION_JSON_TYPE).get(ClientResponse.class);
  assertThat(response.getStatus(),equalTo(200));
  Map<String,Object> json=JsonHelper.jsonToMap(response.getEntity(String.class));
  String refNodeService=(String)json.get(Plugin.class.getSimpleName());
  response=Client.create().resource(refNodeService).accept(MediaType.APPLICATION_JSON_TYPE).get(ClientResponse.class);
  String result=response.getEntity(String.class);
  System.out.println(result);
  assertThat(response.getStatus(),equalTo(200));
  json=JsonHelper.jsonToMap(result);
  System.out.println(json);
  json=(Map<String,Object>)json.get("String_Node_Str");
  assertThat(json,hasKey(Plugin.GET_REFERENCE_NODE));
}
Program: 154673
Project: 154673
Buggy source:
String relationshipUri(long id){
  return relationshipUri() + "String_Node_Str" + id;
}

Fixed version (ground truth):
public String relationshipUri(long id){
  return relationshipUri() + "String_Node_Str" + id;
}
Program: 154674
Project: 154674
Buggy source:
@Test public void canGetUrisForNode() throws Exception {
  Map<String,List<String>> extensions=manager.getExensionsFor(GraphDatabaseService.class);
  List<String> methods=extensions.get(ReferenceNode.class.getSimpleName());
  assertNotNull(methods);
  assertThat(methods,hasItem(ReferenceNode.GET_REFERENCE_NODE));
}

Fixed version (ground truth):
@Test public void canGetUrisForNode() throws Exception {
  Map<String,List<String>> extensions=manager.getExensionsFor(GraphDatabaseService.class);
  List<String> methods=extensions.get(Plugin.class.getSimpleName());
  assertNotNull(methods);
  assertThat(methods,hasItem(Plugin.GET_REFERENCE_NODE));
}
Program: 154675
Project: 154675
Buggy source:
@Test public void canInvokeExtension() throws Exception {
  manager.invoke(graphDb,ReferenceNode.class.getSimpleName(),GraphDatabaseService.class,ReferenceNode.GET_REFERENCE_NODE,graphDb,new NullFormat(null,(MediaType[])null).readParameterList("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void canInvokeExtension() throws Exception {
  manager.invoke(graphDb,Plugin.class.getSimpleName(),GraphDatabaseService.class,Plugin.GET_REFERENCE_NODE,graphDb,new NullFormat(null,(MediaType[])null).readParameterList("String_Node_Str"));
}
Program: 154676
Project: 154676
Buggy source:
protected void endReached(){
  if (this.searcherOrNull != null) {
    this.searcherOrNull.closeStrict();
  }
}

Fixed version (ground truth):
protected void endReached(){
  close();
}
Program: 154677
Project: 154677
Buggy source:
@Override protected Long fetchNextOrNullFromSource(Iterator<Long> source){
  while (source.hasNext()) {
    Long id=source.next();
    if (alreadyReturned.add(id)) {
      return id;
    }
  }
  isExhausted=true;
  return null;
}

Fixed version (ground truth):
@Override protected Long fetchNextOrNullFromSource(Iterator<Long> source){
  while (source.hasNext()) {
    Long id=source.next();
    if (alreadyReturned.add(id)) {
      return id;
    }
  }
  return null;
}
Program: 154678
Project: 154678
Buggy source:
public IdToEntityIterator(IndexHits<Long> ids,IndexSearcherRef searcher){
  super(ids);
  this.ids=ids;
  this.searcher=searcher;
}

Fixed version (ground truth):
public IdToEntityIterator(IndexHits<Long> ids){
  super(ids);
  this.ids=ids;
}
Program: 154679
Project: 154679
Buggy source:
public void close(){
  if (searcher != null && !isExhausted) {
    searcher.closeStrict();
    searcher=null;
  }
}

Fixed version (ground truth):
public void close(){
  ids.close();
}
Program: 154680
Project: 154680
Buggy source:
@Override public void stop(){
  super.stop();
  recursiveDelete(dir);
  lastOpened=null;
}

Fixed version (ground truth):
@Override public void stop(){
  super.stop();
  recursiveDelete(dir);
  lastStarted=null;
}
Program: 154681
Project: 154681
Buggy source:
private String originatingTestClass(){
  try {
    throw new RuntimeException();
  }
 catch (  RuntimeException e) {
    for (    StackTraceElement el : Arrays.asList(e.getStackTrace())) {
      String className=el.getClassName();
      if (className.contains("String_Node_Str")) {
        return className;
      }
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
private String originatingTestClass(){
  for (  StackTraceElement el : Thread.currentThread().getStackTrace()) {
    String className=el.getClassName();
    if (className.contains("String_Node_Str")) {
      return className;
    }
  }
  return "String_Node_Str";
}
Program: 154682
Project: 154682
Buggy source:
public CleaningNeoServer(final AddressResolver addressResolver,final StartupHealthCheck startupHealthCheck,final File configFile,final Jetty6WebServer jetty6WebServer,final String dir){
  super(addressResolver,startupHealthCheck,configFile,jetty6WebServer);
  this.dir=dir;
  if (lastOpened != null) {
    String message=lastOpened + "String_Node_Str";
    lastOpened=null;
    System.out.println(message);
  }
  lastOpened=originatingTestClass();
}

Fixed version (ground truth):
public CleaningNeoServer(final AddressResolver addressResolver,final StartupHealthCheck startupHealthCheck,final File configFile,final Jetty6WebServer jetty6WebServer,final String dir){
  super(addressResolver,startupHealthCheck,configFile,jetty6WebServer);
  this.dir=dir;
  if (lastStarted != null) {
    try {
      throw lastStarted;
    }
  finally {
      lastStarted=null;
    }
  }
}
Program: 154683
Project: 154683
Buggy source:
public NeoServer build() throws IOException {
  File f=createPropertyFile();
  return new CleaningNeoServer(addressResolver,startupHealthCheck,f,new Jetty6WebServer(),dbDir);
}

Fixed version (ground truth):
public NeoServer build() throws IOException {
  if (dbDir == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  File f=createPropertyFile();
  return new CleaningNeoServer(addressResolver,startupHealthCheck,f,new Jetty6WebServer(),dbDir);
}
Program: 154684
Project: 154684
Buggy source:
@Test public void shouldPickUpPortFromConfig() throws Exception {
  NeoServer server=server().withPassingStartupHealthcheck().onPort(NON_DEFAULT_PORT).build();
  server.start();
  assertEquals(NON_DEFAULT_PORT,server.getWebServerPort());
  Client client=Client.create();
  ClientResponse response=client.resource(server.baseUri()).get(ClientResponse.class);
  assertThat(response.getStatus(),is(200));
  server.stop();
}

Fixed version (ground truth):
@Test public void shouldPickUpPortFromConfig() throws Exception {
  NeoServer server=server().withRandomDatabaseDir().withPassingStartupHealthcheck().onPort(NON_DEFAULT_PORT).build();
  server.start();
  assertEquals(NON_DEFAULT_PORT,server.getWebServerPort());
  Client client=Client.create();
  ClientResponse response=client.resource(server.baseUri()).get(ClientResponse.class);
  assertThat(response.getStatus(),is(200));
  server.stop();
}
Program: 154685
Project: 154685
Buggy source:
@Test public void shouldRespondWithTheWebAdminClientSettings() throws Exception {
  String url=functionalTestHelper.mangementUri() + "String_Node_Str";
  ClientResponse resp=Client.create().resource(url).accept(MediaType.APPLICATION_JSON_TYPE).get(ClientResponse.class);
  String json=resp.getEntity(String.class);
  assertEquals(200,resp.getStatus());
  assertThat(json,containsString("String_Node_Str"));
  assertThat(json,containsString("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void shouldRespondWithTheWebAdminClientSettings() throws Exception {
  String url=functionalTestHelper.mangementUri() + "String_Node_Str";
  ClientResponse resp=Client.create().resource(url).accept(MediaType.APPLICATION_JSON_TYPE).get(ClientResponse.class);
  String json=resp.getEntity(String.class);
  assertEquals(json,200,resp.getStatus());
  assertThat(json,containsString("String_Node_Str"));
  assertThat(json,containsString("String_Node_Str"));
}
Program: 154686
Project: 154686
Buggy source:
@Override public List<Object> readList(String input){
  if (empty(input)) {
    return Collections.emptyList();
  }
  throw new WebApplicationException(noInputType());
}

Fixed version (ground truth):
@Override public List<Object> readList(String input){
  if (empty(input)) {
    return Collections.emptyList();
  }
  throw new MediaTypeNotSupportedException(Response.Status.UNSUPPORTED_MEDIA_TYPE,supported,requested);
}
Program: 154687
Project: 154687
Buggy source:
@Override public URI readUri(String input){
  if (empty(input)) {
    return null;
  }
  throw new WebApplicationException(noInputType());
}

Fixed version (ground truth):
@Override public URI readUri(String input){
  if (empty(input)) {
    return null;
  }
  throw new MediaTypeNotSupportedException(Response.Status.UNSUPPORTED_MEDIA_TYPE,supported,requested);
}
Program: 154688
Project: 154688
Buggy source:
@Override public Map<String,Object> readMap(String input){
  if (empty(input)) {
    return Collections.emptyMap();
  }
  throw new WebApplicationException(noInputType());
}

Fixed version (ground truth):
@Override public Map<String,Object> readMap(String input){
  if (empty(input)) {
    return Collections.emptyMap();
  }
  throw new MediaTypeNotSupportedException(Response.Status.UNSUPPORTED_MEDIA_TYPE,supported,requested);
}
Program: 154689
Project: 154689
Buggy source:
@Override protected String serializeValue(final String type,final Object value){
  throw new WebApplicationException(noOutputType());
}

Fixed version (ground truth):
@Override protected String serializeValue(final String type,final Object value){
  throw new MediaTypeNotSupportedException(Response.Status.NOT_ACCEPTABLE,supported,requested);
}
Program: 154690
Project: 154690
Buggy source:
@Override protected MappingWriter serializeMapping(final String type){
  throw new WebApplicationException(noOutputType());
}

Fixed version (ground truth):
@Override protected MappingWriter serializeMapping(final String type){
  throw new MediaTypeNotSupportedException(Response.Status.NOT_ACCEPTABLE,supported,requested);
}
Program: 154691
Project: 154691
Buggy source:
@Override protected ListWriter serializeList(final String type){
  throw new WebApplicationException(noOutputType());
}

Fixed version (ground truth):
@Override protected ListWriter serializeList(final String type){
  throw new MediaTypeNotSupportedException(Response.Status.NOT_ACCEPTABLE,supported,requested);
}
Program: 154692
Project: 154692
Buggy source:
@Override protected String complete(final MappingWriter serializer){
  throw new WebApplicationException(noOutputType());
}

Fixed version (ground truth):
@Override protected String complete(final MappingWriter serializer){
  throw new MediaTypeNotSupportedException(Response.Status.NOT_ACCEPTABLE,supported,requested);
}
Program: 154693
Project: 154693
Buggy source:
@Override protected void unload(KernelData kernel){
  getServer(kernel).shutdown();
}

Fixed version (ground truth):
@Override protected void unload(KernelData kernel){
  GraphDatabaseShellServer server=getServer(kernel);
  if (server != null) {
    server.shutdown();
  }
}
Program: 154694
Project: 154694
Buggy source:
public static void main(String[] args) throws URISyntaxException {
  checkDatabaseIsRunning();
  URI firstNode=createNode();
  addProperty(firstNode,"String_Node_Str","String_Node_Str");
  URI secondNode=createNode();
  addProperty(firstNode,"String_Node_Str","String_Node_Str");
  URI relationshipUri=addRelationship(firstNode,secondNode,"String_Node_Str","String_Node_Str");
  addMetadataToProperty(relationshipUri,"String_Node_Str","String_Node_Str");
  findSingersInBands(firstNode);
}

Fixed version (ground truth):
public static void main(String[] args) throws URISyntaxException {
  checkDatabaseIsRunning();
  URI firstNode=createNode();
  addProperty(firstNode,"String_Node_Str","String_Node_Str");
  URI secondNode=createNode();
  addProperty(secondNode,"String_Node_Str","String_Node_Str");
  URI relationshipUri=addRelationship(firstNode,secondNode,"String_Node_Str","String_Node_Str");
  addMetadataToProperty(relationshipUri,"String_Node_Str","String_Node_Str");
  findSingersInBands(firstNode);
}
Program: 154695
Project: 154695
Buggy source:
public void start(){
  startupHealthCheck();
  validateConfiguration();
  startDatabase();
  startWebServer();
  try {
    startRoundRobinDB();
    startOgsiContainer();
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public void start(){
  startupHealthCheck();
  validateConfiguration();
  startDatabase();
  try {
    startRoundRobinDB();
    startOsgiContainer();
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  startWebServer();
}
Program: 154696
Project: 154696
Buggy source:
public long getValue(){
  try {
    long used=(Long)((CompositeDataSupport)mbeanServer.getAttribute(memoryName,"String_Node_Str")).get("String_Node_Str");
    long max=100 * (Long)((CompositeDataSupport)mbeanServer.getAttribute(memoryName,"String_Node_Str")).get("String_Node_Str");
    return used / max;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public long getValue(){
  try {
    long used=(Long)((CompositeDataSupport)mbeanServer.getAttribute(memoryName,"String_Node_Str")).get("String_Node_Str");
    long max=(Long)((CompositeDataSupport)mbeanServer.getAttribute(memoryName,"String_Node_Str")).get("String_Node_Str");
    return Math.round((used / (double)max) * 100);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 154697
Project: 154697
Buggy source:
private RelTypeElement(String type,NodeImpl node,IntArray src,IntArray add,IntArray remove){
  super(type,node);
  this.src=src;
  if (src == null) {
    src=IntArray.EMPTY;
    srcTraversed=true;
  }
  if (add == null) {
    addTraversed=true;
  }
  this.add=add;
  if (remove != null) {
    for (int i=0; i < remove.length(); i++) {
      this.remove.add(remove.get(i));
    }
  }
}

Fixed version (ground truth):
private RelTypeElement(String type,NodeImpl node,IntArray src,IntArray add,IntArray remove){
  super(type,node);
  if (src == null) {
    src=IntArray.EMPTY;
    srcTraversed=true;
  }
  this.src=src;
  if (add == null) {
    addTraversed=true;
  }
  this.add=add;
  if (remove != null) {
    for (int i=0; i < remove.length(); i++) {
      this.remove.add(remove.get(i));
    }
  }
}
Program: 154698
Project: 154698
Buggy source:
static IndexProviderStore newIndexStore(String dbStoreDir){
  return new IndexProviderStore(getStoreDir(dbStoreDir) + "String_Node_Str");
}

Fixed version (ground truth):
static IndexProviderStore newIndexStore(String dbStoreDir){
  return new IndexProviderStore(getStoreDir(dbStoreDir).first() + "String_Node_Str");
}
Program: 154699
Project: 154699
Buggy source:
public LuceneBatchInserterIndexProvider(final BatchInserter inserter){
  this.inserter=inserter;
  this.indexStore=((BatchInserterImpl)inserter).getIndexStore();
  this.nodeEntityType=new EntityType(){
    public Document newDocument(    Object entityId){
      return IndexType.newBaseDocument((Long)entityId);
    }
    public Class<? extends PropertyContainer> getType(){
      return Node.class;
    }
  }
;
  this.relationshipEntityType=new EntityType(){
    public Document newDocument(    Object entityId){
      RelationshipId relId=(RelationshipId)entityId;
      Document doc=IndexType.newBaseDocument(relId.id);
      doc.add(new Field(LuceneIndex.KEY_START_NODE_ID,"String_Node_Str" + relId.startNode,Store.YES,org.apache.lucene.document.Field.Index.NOT_ANALYZED));
      doc.add(new Field(LuceneIndex.KEY_END_NODE_ID,"String_Node_Str" + relId.endNode,Store.YES,org.apache.lucene.document.Field.Index.NOT_ANALYZED));
      return doc;
    }
    public Class<? extends PropertyContainer> getType(){
      return Relationship.class;
    }
  }
;
}

Fixed version (ground truth):
public LuceneBatchInserterIndexProvider(final BatchInserter inserter){
  this.inserter=inserter;
  this.indexStore=((BatchInserterImpl)inserter).getIndexStore();
  this.nodeEntityType=new EntityType(){
    public Document newDocument(    Object entityId){
      return IndexType.newBaseDocument((Long)entityId);
    }
    public Class<? extends PropertyContainer> getType(){
      return Node.class;
    }
  }
;
  this.relationshipEntityType=new EntityType(){
    public Document newDocument(    Object entityId){
      RelationshipId relId=null;
      if (entityId instanceof Long) {
        SimpleRelationship relationship=inserter.getRelationshipById((Long)entityId);
        relId=new RelationshipId(relationship.getId(),relationship.getStartNode(),relationship.getEndNode());
      }
 else       if (entityId instanceof RelationshipId) {
        relId=(RelationshipId)entityId;
      }
      Document doc=IndexType.newBaseDocument(relId.id);
      doc.add(new Field(LuceneIndex.KEY_START_NODE_ID,"String_Node_Str" + relId.startNode,Store.YES,org.apache.lucene.document.Field.Index.NOT_ANALYZED));
      doc.add(new Field(LuceneIndex.KEY_END_NODE_ID,"String_Node_Str" + relId.endNode,Store.YES,org.apache.lucene.document.Field.Index.NOT_ANALYZED));
      return doc;
    }
    public Class<? extends PropertyContainer> getType(){
      return Relationship.class;
    }
  }
;
}
Program: 154700
Project: 154700
Buggy source:
public Document newDocument(Object entityId){
  RelationshipId relId=(RelationshipId)entityId;
  Document doc=IndexType.newBaseDocument(relId.id);
  doc.add(new Field(LuceneIndex.KEY_START_NODE_ID,"String_Node_Str" + relId.startNode,Store.YES,org.apache.lucene.document.Field.Index.NOT_ANALYZED));
  doc.add(new Field(LuceneIndex.KEY_END_NODE_ID,"String_Node_Str" + relId.endNode,Store.YES,org.apache.lucene.document.Field.Index.NOT_ANALYZED));
  return doc;
}

Fixed version (ground truth):
public Document newDocument(Object entityId){
  RelationshipId relId=null;
  if (entityId instanceof Long) {
    SimpleRelationship relationship=inserter.getRelationshipById((Long)entityId);
    relId=new RelationshipId(relationship.getId(),relationship.getStartNode(),relationship.getEndNode());
  }
 else   if (entityId instanceof RelationshipId) {
    relId=(RelationshipId)entityId;
  }
  Document doc=IndexType.newBaseDocument(relId.id);
  doc.add(new Field(LuceneIndex.KEY_START_NODE_ID,"String_Node_Str" + relId.startNode,Store.YES,org.apache.lucene.document.Field.Index.NOT_ANALYZED));
  doc.add(new Field(LuceneIndex.KEY_END_NODE_ID,"String_Node_Str" + relId.endNode,Store.YES,org.apache.lucene.document.Field.Index.NOT_ANALYZED));
  return doc;
}
Program: 154701
Project: 154701
Buggy source:
public void setHighId(long id){
  this.highestIdInUse=id;
  this.localIdGenerator.setHighId(id);
}

Fixed version (ground truth):
public void setHighId(long id){
  this.localIdGenerator.setHighId(id);
}
Program: 154702
Project: 154702
Buggy source:
public long getHighId(){
  return this.highestIdInUse;
}

Fixed version (ground truth):
public long getHighId(){
  return Math.max(this.localIdGenerator.getHighId(),highestIdInUse);
}
Program: 154703
Project: 154703
Buggy source:
public SlaveIdGenerator(IdType idType,long highestIdInUse,Broker broker,ResponseReceiver receiver,IdGenerator localIdGenerator){
  this.idType=idType;
  this.highestIdInUse=highestIdInUse;
  this.broker=broker;
  this.receiver=receiver;
  this.localIdGenerator=localIdGenerator;
}

Fixed version (ground truth):
public SlaveIdGenerator(IdType idType,long highestIdInUse,Broker broker,ResponseReceiver receiver,IdGenerator localIdGenerator){
  this.idType=idType;
  this.broker=broker;
  this.receiver=receiver;
  this.localIdGenerator=localIdGenerator;
}
Program: 154704
Project: 154704
Buggy source:
public long getNumberOfIdsInUse(){
  return this.highestIdInUse - this.defragCount;
}

Fixed version (ground truth):
public long getNumberOfIdsInUse(){
  return Math.max(this.localIdGenerator.getNumberOfIdsInUse(),highestIdInUse - defragCount);
}
Program: 154705
Project: 154705
Buggy source:
@Override protected LuceneCommand newRemoveCommand(PropertyContainer entity,String key,Object value){
  Relationship rel=(Relationship)entity;
  return new LuceneCommand.RemoveCommand(getIdentifier(),LuceneCommand.RELATIONSHIP,rel.getId(),key,value);
}

Fixed version (ground truth):
@Override protected LuceneCommand newRemoveCommand(PropertyContainer entity,String key,Object value){
  Relationship rel=(Relationship)entity;
  return new LuceneCommand.RemoveCommand(getIdentifier(),LuceneCommand.RELATIONSHIP,RelationshipId.of(rel),key,value);
}
Program: 154706
Project: 154706
Buggy source:
public synchronized void setLastCommittedTx(long txId){
  long current=getRecord(3);
  if ((current + 1) != txId && !isInRecoveryMode()) {
    throw new InvalidRecordException("String_Node_Str" + txId + "String_Node_Str"+ current+ "String_Node_Str");
  }
  setRecord(3,txId);
  if (isStarted && lastCommittedTxIdSetter != null && txId != lastCommittedTx) {
    lastCommittedTxIdSetter.setLastCommittedTxId(txId);
  }
  lastCommittedTx=txId;
}

Fixed version (ground truth):
public synchronized void setLastCommittedTx(long txId){
  long current=getRecord(3);
  if ((current + 1) != txId && !isInRecoveryMode()) {
    throw new InvalidRecordException("String_Node_Str" + txId + "String_Node_Str"+ current+ "String_Node_Str");
  }
  setRecord(3,txId);
  if (isStarted && lastCommittedTxIdSetter != null && txId != lastCommittedTx) {
    try {
      lastCommittedTxIdSetter.setLastCommittedTxId(txId);
    }
 catch (    RuntimeException e) {
      e.printStackTrace();
    }
  }
  lastCommittedTx=txId;
}
Program: 154707
Project: 154707
Buggy source:
private void tryToEnsureIAmNotABrokenMachine(Pair<Master,Machine> master){
  try {
    if (master.other().getMachineId() == machineId) {
      return;
    }
    XaDataSource nioneoDataSource=this.localGraph.getConfig().getTxModule().getXaDataSourceManager().getXaDataSource(Config.DEFAULT_DATA_SOURCE_NAME);
    long myLastCommittedTx=nioneoDataSource.getLastCommittedTxId();
    long highestCommonTxId=Math.min(myLastCommittedTx,master.other().getLastCommittedTxId());
    int masterForMyHighestCommonTxId=nioneoDataSource.getMasterForCommittedTx(highestCommonTxId);
    int masterForMastersHighestCommonTxId=master.first().getMasterIdForCommittedTx(highestCommonTxId);
    if (masterForMyHighestCommonTxId == masterForMastersHighestCommonTxId) {
      return;
    }
 else {
      String msg="String_Node_Str" + myLastCommittedTx + "String_Node_Str"+ masterForMyHighestCommonTxId+ "String_Node_Str"+ masterForMastersHighestCommonTxId;
      msgLog.logMessage(msg);
      shutdown();
      throw new RuntimeException(msg);
    }
  }
 catch (  IOException e) {
    shutdown();
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private void tryToEnsureIAmNotABrokenMachine(Pair<Master,Machine> master){
  try {
    if (master.other().getMachineId() == machineId) {
      return;
    }
    XaDataSource nioneoDataSource=this.localGraph.getConfig().getTxModule().getXaDataSourceManager().getXaDataSource(Config.DEFAULT_DATA_SOURCE_NAME);
    long myLastCommittedTx=nioneoDataSource.getLastCommittedTxId();
    long highestCommonTxId=Math.min(myLastCommittedTx,master.other().getLastCommittedTxId());
    int masterForMyHighestCommonTxId=nioneoDataSource.getMasterForCommittedTx(highestCommonTxId);
    int masterForMastersHighestCommonTxId=master.first().getMasterIdForCommittedTx(highestCommonTxId);
    if (masterForMyHighestCommonTxId == masterForMastersHighestCommonTxId) {
      msgLog.logMessage("String_Node_Str" + highestCommonTxId + "String_Node_Str"+ masterForMyHighestCommonTxId,true);
      return;
    }
 else {
      String msg="String_Node_Str" + myLastCommittedTx + "String_Node_Str"+ masterForMyHighestCommonTxId+ "String_Node_Str"+ masterForMastersHighestCommonTxId;
      msgLog.logMessage(msg,true);
      shutdown();
      throw new RuntimeException(msg);
    }
  }
 catch (  IOException e) {
    shutdown();
    throw new RuntimeException(e);
  }
}
Program: 154708
Project: 154708
Buggy source:
public synchronized void internalShutdown(){
  msgLog.logMessage("String_Node_Str" + machineId + "String_Node_Str"+ this);
  if (this.updatePuller != null) {
    msgLog.logMessage("String_Node_Str");
    this.updatePuller.shutdown();
    msgLog.logMessage("String_Node_Str");
    this.updatePuller=null;
  }
  if (this.masterServer != null) {
    msgLog.logMessage("String_Node_Str");
    this.masterServer.shutdown();
    msgLog.logMessage("String_Node_Str");
    this.masterServer=null;
  }
  if (this.localGraph != null) {
    msgLog.logMessage("String_Node_Str");
    this.localGraph.shutdown();
    msgLog.logMessage("String_Node_Str");
    this.localGraph=null;
    this.localDataSourceManager=null;
  }
}

Fixed version (ground truth):
public synchronized void internalShutdown(){
  msgLog.logMessage("String_Node_Str" + machineId + "String_Node_Str"+ this,true);
  if (this.updatePuller != null) {
    msgLog.logMessage("String_Node_Str",true);
    this.updatePuller.shutdown();
    msgLog.logMessage("String_Node_Str",true);
    this.updatePuller=null;
  }
  if (this.masterServer != null) {
    msgLog.logMessage("String_Node_Str",true);
    this.masterServer.shutdown();
    msgLog.logMessage("String_Node_Str",true);
    this.masterServer=null;
  }
  if (this.localGraph != null) {
    msgLog.logMessage("String_Node_Str",true);
    this.localGraph.shutdown();
    msgLog.logMessage("String_Node_Str",true);
    this.localGraph=null;
  }
}
Program: 154709
Project: 154709
Buggy source:
public void newMaster(Pair<Master,Machine> master,Exception e){
  try {
    msgLog.logMessage("String_Node_Str" + master + "String_Node_Str",e);
    reevaluateMyself(master);
  }
 catch (  ZooKeeperException ee) {
    ee.printStackTrace();
  }
catch (  HaCommunicationException ee) {
    ee.printStackTrace();
  }
catch (  Throwable t) {
    t.printStackTrace();
    msgLog.logMessage("String_Node_Str" + t + "String_Node_Str");
    shutdown();
  }
}

Fixed version (ground truth):
public void newMaster(Pair<Master,Machine> master,Exception e){
  try {
    msgLog.logMessage("String_Node_Str" + master + "String_Node_Str",e,true);
    reevaluateMyself(master);
  }
 catch (  ZooKeeperException ee) {
    ee.printStackTrace();
  }
catch (  HaCommunicationException ee) {
    ee.printStackTrace();
  }
catch (  Throwable t) {
    t.printStackTrace();
    msgLog.logMessage("String_Node_Str" + t + "String_Node_Str",true);
    shutdown();
  }
}