nus-yam/ex-repair huggingface dataset:
Program: 154925
Project: 154925
Buggy source:
/** 
 * Returns a quite simple string representation of a   {@link Path}. It doesn't print relationship types or ids, just directions. it uses the  {@code nodePropertyKey} to try to display that property value as in thenode representation instead of the node id. If that property doesn't exist, the id is used.
 * @param path the {@link Path} to build a string representation of.
 * @return a quite simple representation of a {@link Path}.
 */
public static String simplePathToString(Path path,final String nodePropertyKey){
  return pathToString(path,new DefaultPathDescriptor<Path>(){
    public String nodeRepresentation(    Path path,    Node node){
      return "String_Node_Str" + node.getProperty(nodePropertyKey,node.getId()) + "String_Node_Str";
    }
    public String relationshipRepresentation(    Path path,    Node from,    Relationship relationship){
      return relationship.getStartNode().equals(from) ? "String_Node_Str" : "String_Node_Str";
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Returns a quite simple string representation of a   {@link Path}. It doesn't print relationship types or ids, just directions. it uses the  {@code nodePropertyKey} to try to display that property value as in thenode representation instead of the node id. If that property doesn't exist, the id is used.
 * @param path the {@link Path} to build a string representation of.
 * @return a quite simple representation of a {@link Path}.
 */
public static String simplePathToString(Path path,final String nodePropertyKey){
  return pathToString(path,new DefaultPathDescriptor<Path>(){
    @Override public String nodeRepresentation(    Path path,    Node node){
      return "String_Node_Str" + node.getProperty(nodePropertyKey,node.getId()) + "String_Node_Str";
    }
    @Override public String relationshipRepresentation(    Path path,    Node from,    Relationship relationship){
      return relationship.getStartNode().equals(from) ? "String_Node_Str" : "String_Node_Str";
    }
  }
);
}
Program: 154926
Project: 154926
Buggy source:
public String nodeRepresentation(Path path,Node node){
  return "String_Node_Str" + node.getProperty(nodePropertyKey,node.getId()) + "String_Node_Str";
}

Fixed version (ground truth):
@Override public String nodeRepresentation(Path path,Node node){
  return "String_Node_Str" + node.getProperty(nodePropertyKey,node.getId()) + "String_Node_Str";
}
Program: 154927
Project: 154927
Buggy source:
private static <T>T[] extract(Class<T[]> type,T obj1,T obj2,Object[] more,boolean odd){
  if (more.length % 2 != 0) {
    throw new IllegalArgumentException();
  }
  Object[] target=(Object[])Array.newInstance(type,(more.length / 2) + 2);
  try {
    target[0]=obj1;
    target[1]=obj2;
    for (int i=2; i < target.length; i++) {
      target[i]=more[(i - 2) * 2 + (odd ? 1 : 0)];
    }
  }
 catch (  ArrayStoreException cast) {
    throw new IllegalArgumentException(cast);
  }
  return type.cast(target);
}

Fixed version (ground truth):
private static <T>T[] extract(Class<T[]> type,T obj1,T obj2,Object[] more,boolean odd){
  if (more.length % 2 != 0) {
    throw new IllegalArgumentException();
  }
  Object[] target=(Object[])Array.newInstance(type.getComponentType(),(more.length / 2) + 2);
  try {
    target[0]=obj1;
    target[1]=obj2;
    for (int i=2; i < target.length; i++) {
      target[i]=more[(i - 2) * 2 + (odd ? 1 : 0)];
    }
  }
 catch (  ArrayStoreException cast) {
    throw new IllegalArgumentException(cast);
  }
  return type.cast(target);
}
Program: 154928
Project: 154928
Buggy source:
public Path findSinglePath(Node start,Node end){
  Collection<Path> paths=internalPaths(start,end,true);
  return IteratorUtil.singleValueOrNull(paths.iterator());
}

Fixed version (ground truth):
public Path findSinglePath(Node start,Node end){
  Collection<Path> paths=internalPaths(start,end,true);
  return paths.isEmpty() ? null : paths.iterator().next();
}
Program: 154929
Project: 154929
Buggy source:
private RelationshipExpander toExpander(Direction direction,Map<String,Object> filterMap,boolean caseInsensitiveFilters,boolean looseFilters){
  DefaultExpander expander=new DefaultExpander();
  for (  RelationshipType type : getServer().getDb().getRelationshipTypes()) {
    boolean matches=false;
    if (filterMap == null || filterMap.isEmpty()) {
      matches=true;
    }
 else {
      for (      String filter : filterMap.keySet()) {
        if (matches(newPattern(filter,caseInsensitiveFilters),type.name(),caseInsensitiveFilters,looseFilters)) {
          matches=true;
          break;
        }
      }
    }
    if (matches) {
      expander=expander.add(type,direction);
    }
  }
  return expander;
}

Fixed version (ground truth):
private RelationshipExpander toExpander(Direction direction,Map<String,Object> filterMap,boolean caseInsensitiveFilters,boolean looseFilters){
  Expander expander=TraversalFactory.emptyExpander();
  for (  RelationshipType type : getServer().getDb().getRelationshipTypes()) {
    boolean matches=false;
    if (filterMap == null || filterMap.isEmpty()) {
      matches=true;
    }
 else {
      for (      String filter : filterMap.keySet()) {
        if (matches(newPattern(filter,caseInsensitiveFilters),type.name(),caseInsensitiveFilters,looseFilters)) {
          matches=true;
          break;
        }
      }
    }
    if (matches) {
      expander=expander.add(type,direction);
    }
  }
  return expander;
}
Program: 154930
Project: 154930
Buggy source:
public void close(){
  neoStore.flushAll();
  xaContainer.close();
  if (logApplied) {
    neoStore.rebuildIdGenerators();
    logApplied=false;
  }
  neoStore.close();
  logger.fine("String_Node_Str");
}

Fixed version (ground truth):
public void close(){
  if (!readOnly) {
    neoStore.flushAll();
  }
  xaContainer.close();
  if (logApplied) {
    neoStore.rebuildIdGenerators();
    logApplied=false;
  }
  neoStore.close();
  logger.fine("String_Node_Str");
}
Program: 154931
Project: 154931
Buggy source:
private void fixCleanKill(String fileName) throws IOException {
  File file=new File(fileName);
  if (!keepLogs && !file.delete()) {
    throw new IllegalStateException("String_Node_Str" + fileName);
  }
 else {
    renameCurrentLogFileAndIncrementVersion(fileName,file.length());
  }
}

Fixed version (ground truth):
private void fixCleanKill(String fileName) throws IOException {
  File file=new File(fileName);
  if (!keepLogs) {
    if (!file.delete()) {
      throw new IllegalStateException("String_Node_Str" + fileName);
    }
  }
 else {
    renameCurrentLogFileAndIncrementVersion(fileName,file.length());
  }
}
Program: 154932
Project: 154932
Buggy source:
AutoConfigurator(String dbPath,boolean useMemoryMapped){
  this.dbPath=dbPath;
  this.useMemoryMapped=useMemoryMapped;
  OperatingSystemMXBean osBean=ManagementFactory.getOperatingSystemMXBean();
  long mem=-1;
  try {
    Class<?> beanClass=Class.forName("String_Node_Str");
    Method method=beanClass.getMethod("String_Node_Str");
    mem=(Long)method.invoke(osBean,new Object[0]);
  }
 catch (  Exception e) {
  }
  if (mem != -1) {
    totalPhysicalMemMb=(int)(mem / 1024 / 1024);
  }
 else {
    totalPhysicalMemMb=-1;
  }
  mem=Runtime.getRuntime().maxMemory();
  maxVmUsageMb=(int)(mem / 1024 / 1024);
}

Fixed version (ground truth):
public AutoConfigurator(String dbPath,boolean useMemoryMapped,boolean dump){
  this.dbPath=dbPath;
  this.useMemoryMapped=useMemoryMapped;
  OperatingSystemMXBean osBean=ManagementFactory.getOperatingSystemMXBean();
  long mem=-1;
  try {
    Class<?> beanClass=Class.forName("String_Node_Str");
    Method method=beanClass.getMethod("String_Node_Str");
    mem=(Long)method.invoke(osBean,new Object[0]);
  }
 catch (  Exception e) {
  }
  if (mem != -1) {
    totalPhysicalMemMb=(int)(mem / 1024 / 1024);
  }
 else {
    totalPhysicalMemMb=-1;
  }
  mem=Runtime.getRuntime().maxMemory();
  maxVmUsageMb=(int)(mem / 1024 / 1024);
  if (dump) {
    System.out.println("String_Node_Str" + totalPhysicalMemMb + "String_Node_Str");
    System.out.println("String_Node_Str" + maxVmUsageMb + "String_Node_Str");
  }
}
Program: 154933
Project: 154933
Buggy source:
void configure(Map<Object,Object> config){
  if (totalPhysicalMemMb > 0) {
    if (useMemoryMapped) {
      int availableMem=(totalPhysicalMemMb - maxVmUsageMb);
      availableMem-=(int)(availableMem * 0.15f);
      assignMemory(config,availableMem);
    }
 else {
      assignMemory(config,maxVmUsageMb / 2);
    }
  }
}

Fixed version (ground truth):
public void configure(Map<Object,Object> config){
  if (totalPhysicalMemMb > 0) {
    if (useMemoryMapped) {
      int availableMem=(totalPhysicalMemMb - maxVmUsageMb);
      availableMem-=(int)(availableMem * 0.15f);
      assignMemory(config,availableMem);
    }
 else {
      assignMemory(config,maxVmUsageMb / 2);
    }
  }
}
Program: 154934
Project: 154934
Buggy source:
private Map<Object,Object> getDefaultParams(){
  Map<Object,Object> params=new HashMap<Object,Object>();
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str");
  String nameOs=System.getProperty("String_Node_Str");
  if (nameOs.startsWith("String_Node_Str")) {
    params.put("String_Node_Str","String_Node_Str");
  }
  return params;
}

Fixed version (ground truth):
private Map<Object,Object> getDefaultParams(){
  Map<Object,Object> params=new HashMap<Object,Object>();
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str");
  String nameOs=System.getProperty("String_Node_Str");
  if (nameOs.startsWith("String_Node_Str")) {
    params.put(Config.USE_MEMORY_MAPPED_BUFFERS,"String_Node_Str");
  }
  return params;
}
Program: 154936
Project: 154936
Buggy source:
public BatchInserterImpl(String storeDir,Map<String,String> stringParams){
  Map<Object,Object> params=getDefaultParams();
  params.put("String_Node_Str","String_Node_Str");
  for (  Map.Entry<String,String> entry : stringParams.entrySet()) {
    params.put(entry.getKey(),entry.getValue());
  }
  this.storeDir=storeDir;
  String store=fixPath(storeDir);
  params.put("String_Node_Str",store);
  neoStore=new NeoStore(params);
  neoStore.makeStoreOk();
  PropertyIndexData[] indexes=getPropertyIndexStore().getPropertyIndexes(10000);
  indexHolder=new PropertyIndexHolder(indexes);
  RelationshipTypeData[] types=getRelationshipTypeStore().getRelationshipTypes();
  typeHolder=new RelationshipTypeHolder(types);
  graphDbService=new BatchGraphDatabaseImpl(this);
}

Fixed version (ground truth):
public BatchInserterImpl(String storeDir,Map<String,String> stringParams){
  Map<Object,Object> params=getDefaultParams();
  params.put(Config.USE_MEMORY_MAPPED_BUFFERS,"String_Node_Str");
  boolean dump=false;
  if ("String_Node_Str".equals(stringParams.get(Config.DUMP_CONFIGURATION))) {
    dump=true;
  }
  new AutoConfigurator(storeDir,false,dump).configure(params);
  for (  Map.Entry<String,String> entry : stringParams.entrySet()) {
    params.put(entry.getKey(),entry.getValue());
  }
  this.storeDir=storeDir;
  String store=fixPath(storeDir);
  params.put("String_Node_Str",store);
  if ("String_Node_Str".equals(params.get(Config.DUMP_CONFIGURATION))) {
    for (    Object key : params.keySet()) {
      if (key instanceof String) {
        Object value=params.get(key);
        if (value instanceof String) {
          System.out.println(key + "String_Node_Str" + value);
        }
      }
    }
  }
  neoStore=new NeoStore(params);
  neoStore.makeStoreOk();
  PropertyIndexData[] indexes=getPropertyIndexStore().getPropertyIndexes(10000);
  indexHolder=new PropertyIndexHolder(indexes);
  RelationshipTypeData[] types=getRelationshipTypeStore().getRelationshipTypes();
  typeHolder=new RelationshipTypeHolder(types);
  graphDbService=new BatchGraphDatabaseImpl(this);
}
Program: 154937
Project: 154937
Buggy source:
protected boolean getIfMemoryMapped(){
  if (getConfig() != null) {
    String useMemMapped=(String)getConfig().get("String_Node_Str");
    if (useMemMapped != null && useMemMapped.toLowerCase().equals("String_Node_Str")) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
protected boolean getIfMemoryMapped(){
  if (getConfig() != null) {
    String useMemMapped=(String)getConfig().get(Config.USE_MEMORY_MAPPED_BUFFERS);
    if (useMemMapped != null && useMemMapped.toLowerCase().equals("String_Node_Str")) {
      return false;
    }
  }
  return true;
}
Program: 154938
Project: 154938
Buggy source:
private boolean getMemoryMapped(Map<Object,Object> config){
  if (config != null) {
    String value=(String)config.get("String_Node_Str");
    if (value != null && value.toLowerCase().equals("String_Node_Str")) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean getMemoryMapped(Map<Object,Object> config){
  if (config != null) {
    String value=(String)config.get(Config.USE_MEMORY_MAPPED_BUFFERS);
    if (value != null && value.toLowerCase().equals("String_Node_Str")) {
      return false;
    }
  }
  return true;
}
Program: 154939
Project: 154939
Buggy source:
@Test public void testIt(){
  PriorityMap<Integer,Integer,Double> map=PriorityMap.withSelfKeyNaturalOrder();
  int start=0, a=1, b=2, c=3, d=4, e=6, f=7, y=8, x=9;
  map.put(start,0d);
  map.put(a,1d);
  map.put(x,10d);
  map.put(b,2d);
  map.put(x,9d);
  map.put(c,3d);
  map.put(x,8d);
  map.put(x,6d);
  map.put(d,4d);
  map.put(x,7d);
  map.put(e,5d);
  map.put(x,6d);
  map.put(f,7d);
  map.put(y,8d);
}

Fixed version (ground truth):
@Test public void testIt(){
  PriorityMap<Integer,Integer,Double> map=PriorityMap.<Integer,Double>withSelfKeyNaturalOrder();
  int start=0, a=1, b=2, c=3, d=4, e=6, f=7, y=8, x=9;
  map.put(start,0d);
  map.put(a,1d);
  map.put(x,10d);
  map.put(b,2d);
  map.put(x,9d);
  map.put(c,3d);
  map.put(x,8d);
  map.put(x,6d);
  map.put(d,4d);
  map.put(x,7d);
  map.put(e,5d);
  map.put(x,6d);
  map.put(f,7d);
  map.put(y,8d);
}
Program: 154940
Project: 154940
Buggy source:
public void createMemoryMappingMBean(XaDataSourceManager datasourceMananger){
  NeoStoreXaDataSource datasource=(NeoStoreXaDataSource)datasourceMananger.getXaDataSource("String_Node_Str");
  if (!register(new MemoryMappingMonitor.MXBeanImplementation(instance.id,datasource))) {
    if (!register(new MemoryMappingMonitor.MemoryMapping(instance.id,datasource)))     failedToRegister("String_Node_Str");
  }
}

Fixed version (ground truth):
public void createMemoryMappingMBean(XaDataSourceManager datasourceMananger){
  NeoStoreXaDataSource datasource=(NeoStoreXaDataSource)datasourceMananger.getXaDataSource("String_Node_Str");
  if (!register(new MemoryMapping.AsMxBean(instance.id,datasource))) {
    if (!register(new MemoryMapping(instance.id,datasource)))     failedToRegister("String_Node_Str");
  }
}
Program: 154941
Project: 154941
Buggy source:
public void createXaManagerMBean(XaDataSourceManager datasourceMananger){
  if (!register(new XaMonitor.MXBeanImplementation(instance.id,datasourceMananger))) {
    if (!register(new XaMonitor.XaManager(instance.id,datasourceMananger)))     failedToRegister("String_Node_Str");
  }
}

Fixed version (ground truth):
public void createXaManagerMBean(XaDataSourceManager datasourceMananger){
  if (!register(new XaManager.AsMXBean(instance.id,datasourceMananger))) {
    if (!register(new XaManager(instance.id,datasourceMananger)))     failedToRegister("String_Node_Str");
  }
}
Program: 154943
Project: 154943
Buggy source:
private void populateRelationshipPropertyEvents(PrimitiveElement element,TransactionDataImpl result){
  for (  int relId : element.relationships.keySet()) {
    CowRelElement relElement=element.relationships.get(relId);
    RelationshipProxy rel=new RelationshipProxy(relId,nodeManager);
    RelationshipImpl relImpl=nodeManager.getRelForProxy(relId);
    if (relElement.deleted) {
      if (nodeManager.relCreated(relId)) {
        continue;
      }
      List<PropertyEventData> props=relImpl.getAllCommittedProperties();
      for (      PropertyEventData data : props) {
        result.removedProperty(rel,data.getKey(),data.getValue());
      }
    }
 else {
      if (relElement.propertyAddMap != null) {
        for (        PropertyData data : relElement.propertyAddMap.values()) {
          String key=nodeManager.getKeyForProperty(data.getId());
          Object oldValue=relImpl.getCommittedPropertyValue(key);
          Object newValue=data.getValue();
          result.assignedProperty(rel,key,newValue,oldValue);
        }
      }
      if (relElement.propertyRemoveMap != null) {
        for (        PropertyData data : relElement.propertyRemoveMap.values()) {
          String key=nodeManager.getKeyForProperty(data.getId());
          Object oldValue=relImpl.getCommittedPropertyValue(key);
          result.removedProperty(rel,key,oldValue);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void populateRelationshipPropertyEvents(PrimitiveElement element,TransactionDataImpl result){
  for (  int relId : element.relationships.keySet()) {
    CowRelElement relElement=element.relationships.get(relId);
    RelationshipProxy rel=new RelationshipProxy(relId,nodeManager);
    RelationshipImpl relImpl=nodeManager.getRelForProxy(relId);
    if (relElement.deleted) {
      if (nodeManager.relCreated(relId)) {
        continue;
      }
    }
    if (relElement.propertyAddMap != null && !relElement.deleted) {
      for (      PropertyData data : relElement.propertyAddMap.values()) {
        String key=nodeManager.getKeyForProperty(data.getId());
        Object oldValue=relImpl.getCommittedPropertyValue(key);
        Object newValue=data.getValue();
        result.assignedProperty(rel,key,newValue,oldValue);
      }
    }
    if (relElement.propertyRemoveMap != null) {
      for (      PropertyData data : relElement.propertyRemoveMap.values()) {
        String key=nodeManager.getKeyForProperty(data.getId());
        Object oldValue=data.getValue();
        if (oldValue != null && !relElement.deleted) {
          relImpl.getCommittedPropertyValue(key);
        }
        result.removedProperty(rel,key,oldValue);
      }
    }
  }
}
Program: 154944
Project: 154944
Buggy source:
public void delete(){
  nodeManager.acquireLock(this,LockType.WRITE);
  boolean success=false;
  try {
    nodeManager.deleteNode(this);
    success=true;
  }
  finally {
    nodeManager.releaseLock(this,LockType.WRITE);
    if (!success) {
      setRollbackOnly();
    }
  }
}

Fixed version (ground truth):
public void delete(){
  nodeManager.acquireLock(this,LockType.WRITE);
  boolean success=false;
  try {
    ArrayMap<Integer,PropertyData> skipMap=nodeManager.getCowPropertyRemoveMap(this,true);
    ArrayMap<Integer,PropertyData> removedProps=nodeManager.deleteNode(this);
    if (removedProps.size() > 0) {
      for (      int index : removedProps.keySet()) {
        skipMap.put(index,removedProps.get(index));
      }
    }
    success=true;
  }
  finally {
    nodeManager.releaseLock(this,LockType.WRITE);
    if (!success) {
      setRollbackOnly();
    }
  }
}
Program: 154945
Project: 154945
Buggy source:
void deleteNode(NodeImpl node){
  int nodeId=(int)node.getId();
  deletePrimitive(node);
  persistenceManager.nodeDelete(nodeId);
}

Fixed version (ground truth):
ArrayMap<Integer,PropertyData> deleteNode(NodeImpl node){
  int nodeId=(int)node.getId();
  deletePrimitive(node);
  return persistenceManager.nodeDelete(nodeId);
}
Program: 154946
Project: 154946
Buggy source:
void deleteRelationship(RelationshipImpl rel){
  int relId=(int)rel.getId();
  deletePrimitive(rel);
  persistenceManager.relDelete(relId);
}

Fixed version (ground truth):
ArrayMap<Integer,PropertyData> deleteRelationship(RelationshipImpl rel){
  int relId=(int)rel.getId();
  deletePrimitive(rel);
  return persistenceManager.relDelete(relId);
}
Program: 154947
Project: 154947
Buggy source:
@Override void deleteNode(NodeImpl node){
  throw new ReadOnlyDbException();
}

Fixed version (ground truth):
@Override ArrayMap<Integer,PropertyData> deleteNode(NodeImpl node){
  throw new ReadOnlyDbException();
}
Program: 154948
Project: 154948
Buggy source:
@Override void deleteRelationship(RelationshipImpl rel){
  throw new ReadOnlyDbException();
}

Fixed version (ground truth):
@Override ArrayMap<Integer,PropertyData> deleteRelationship(RelationshipImpl rel){
  throw new ReadOnlyDbException();
}
Program: 154950
Project: 154950
Buggy source:
public Object getStringFor(PropertyRecord propRecord){
  int recordToFind=(int)propRecord.getPropBlock();
  Iterator<DynamicRecord> records=propRecord.getValueRecords().iterator();
  List<char[]> charList=new LinkedList<char[]>();
  int totalSize=0;
  while (recordToFind != Record.NO_NEXT_BLOCK.intValue() && records.hasNext()) {
    DynamicRecord record=records.next();
    if (record.getId() == recordToFind) {
      if (record.isLight()) {
        stringPropertyStore.makeHeavy(record);
      }
      if (!record.isCharData()) {
        ByteBuffer buf=ByteBuffer.wrap(record.getData());
        char[] chars=new char[record.getData().length / 2];
        totalSize+=chars.length;
        buf.asCharBuffer().get(chars);
        charList.add(chars);
      }
 else {
        charList.add(record.getDataAsChar());
      }
      recordToFind=record.getNextBlock();
      records=propRecord.getValueRecords().iterator();
    }
  }
  StringBuffer buf=new StringBuffer();
  for (  char[] str : charList) {
    buf.append(str);
  }
  return buf.toString();
}

Fixed version (ground truth):
public Object getStringFor(PropertyRecord propRecord){
  int recordToFind=(int)propRecord.getPropBlock();
  Map<Integer,DynamicRecord> recordsMap=new HashMap<Integer,DynamicRecord>();
  for (  DynamicRecord record : propRecord.getValueRecords()) {
    recordsMap.put(record.getId(),record);
  }
  List<char[]> charList=new LinkedList<char[]>();
  int totalSize=0;
  while (recordToFind != Record.NO_NEXT_BLOCK.intValue()) {
    DynamicRecord record=recordsMap.get(recordToFind);
    if (record.isLight()) {
      stringPropertyStore.makeHeavy(record);
    }
    if (!record.isCharData()) {
      ByteBuffer buf=ByteBuffer.wrap(record.getData());
      char[] chars=new char[record.getData().length / 2];
      totalSize+=chars.length;
      buf.asCharBuffer().get(chars);
      charList.add(chars);
    }
 else {
      charList.add(record.getDataAsChar());
    }
    recordToFind=record.getNextBlock();
  }
  StringBuffer buf=new StringBuffer();
  for (  char[] str : charList) {
    buf.append(str);
  }
  return buf.toString();
}
Program: 154951
Project: 154951
Buggy source:
public Object getArrayFor(PropertyRecord propertyRecord){
  int recordToFind=(int)propertyRecord.getPropBlock();
  Iterator<DynamicRecord> records=propertyRecord.getValueRecords().iterator();
  List<byte[]> byteList=new LinkedList<byte[]>();
  int totalSize=0;
  while (recordToFind != Record.NO_NEXT_BLOCK.intValue() && records.hasNext()) {
    DynamicRecord record=records.next();
    if (record.getId() == recordToFind) {
      if (record.isLight()) {
        arrayPropertyStore.makeHeavy(record);
      }
      if (!record.isCharData()) {
        ByteBuffer buf=ByteBuffer.wrap(record.getData());
        byte[] bytes=new byte[record.getData().length];
        totalSize+=bytes.length;
        buf.get(bytes);
        byteList.add(bytes);
      }
 else {
        throw new InvalidRecordException("String_Node_Str" + record);
      }
      recordToFind=record.getNextBlock();
      records=propertyRecord.getValueRecords().iterator();
    }
  }
  byte[] bArray=new byte[totalSize];
  int offset=0;
  for (  byte[] currentArray : byteList) {
    System.arraycopy(currentArray,0,bArray,offset,currentArray.length);
    offset+=currentArray.length;
  }
  return arrayPropertyStore.getRightArray(bArray);
}

Fixed version (ground truth):
public Object getArrayFor(PropertyRecord propertyRecord){
  int recordToFind=(int)propertyRecord.getPropBlock();
  Map<Integer,DynamicRecord> recordsMap=new HashMap<Integer,DynamicRecord>();
  for (  DynamicRecord record : propertyRecord.getValueRecords()) {
    recordsMap.put(record.getId(),record);
  }
  List<byte[]> byteList=new LinkedList<byte[]>();
  int totalSize=0;
  while (recordToFind != Record.NO_NEXT_BLOCK.intValue()) {
    DynamicRecord record=recordsMap.get(recordToFind);
    if (record.isLight()) {
      arrayPropertyStore.makeHeavy(record);
    }
    if (!record.isCharData()) {
      ByteBuffer buf=ByteBuffer.wrap(record.getData());
      byte[] bytes=new byte[record.getData().length];
      totalSize+=bytes.length;
      buf.get(bytes);
      byteList.add(bytes);
    }
 else {
      throw new InvalidRecordException("String_Node_Str" + record);
    }
    recordToFind=record.getNextBlock();
  }
  byte[] bArray=new byte[totalSize];
  int offset=0;
  for (  byte[] currentArray : byteList) {
    System.arraycopy(currentArray,0,bArray,offset,currentArray.length);
    offset+=currentArray.length;
  }
  return arrayPropertyStore.getRightArray(bArray);
}
Program: 154952
Project: 154952
Buggy source:
@SuppressWarnings("String_Node_Str") public void afterCompletion(int status){
  if (status == Status.STATUS_COMMITTED) {
    for (    HandlerAndState state : this.states) {
      state.handler.afterCommit(this.transactionData,state.state);
    }
  }
 else   if (status == Status.STATUS_ROLLEDBACK) {
    for (    HandlerAndState state : this.states) {
      state.handler.afterRollback(this.transactionData,state.state);
    }
  }
 else {
    throw new RuntimeException("String_Node_Str" + status);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void afterCompletion(int status){
  if (status == Status.STATUS_COMMITTED) {
    for (    HandlerAndState state : this.states) {
      state.handler.afterCommit(this.transactionData,state.state);
    }
  }
 else   if (status == Status.STATUS_ROLLEDBACK) {
    if (this.states == null) {
      return;
    }
    for (    HandlerAndState state : this.states) {
      state.handler.afterRollback(this.transactionData,state.state);
    }
  }
 else {
    throw new RuntimeException("String_Node_Str" + status);
  }
}
Program: 154953
Project: 154953
Buggy source:
public ExperimentalAStar(RelationshipExpander expander,CostEvaluator<Double> costEvaluator,EstimateEvaluator<Double> estimateEvaluator){
  this.traversalDescription=TraversalFactory.createTraversalDescription().uniqueness(Uniqueness.RELATIONSHIP_GLOBAL).expand(expander);
  this.costEvaluator=costEvaluator;
  this.estimateEvaluator=estimateEvaluator;
}

Fixed version (ground truth):
public ExperimentalAStar(RelationshipExpander expander,CostEvaluator<Double> costEvaluator,EstimateEvaluator<Double> estimateEvaluator){
  this.traversalDescription=TraversalFactory.createTraversalDescription().uniqueness(Uniqueness.NONE).expand(expander);
  this.costEvaluator=costEvaluator;
  this.estimateEvaluator=estimateEvaluator;
}
Program: 154954
Project: 154954
Buggy source:
public ExpansionSource nextPosition(){
  while (true) {
    ExpansionSource next=current.next();
    if (next != null) {
      P newPriority=addPriority(next,currentAggregatedValue,calculateValue(next));
      queue.put(next,newPriority);
    }
 else {
      break;
    }
  }
  Entry<ExpansionSource,P> entry=queue.pop();
  if (entry != null) {
    current=entry.getEntity();
    currentAggregatedValue=entry.getPriority();
    return current;
  }
  return null;
}

Fixed version (ground truth):
public ExpansionSource nextPosition(){
  while (true) {
    ExpansionSource next=current.next();
    if (next != null) {
      if (!visitedNodes.contains(next.node().getId())) {
        P newPriority=addPriority(next,currentAggregatedValue,calculateValue(next));
        queue.put(next,newPriority);
        System.out.println("String_Node_Str" + newPriority + "String_Node_Str"+ next.node().getProperty(SimpleGraphBuilder.KEY_ID));
      }
    }
 else {
      break;
    }
  }
  Entry<ExpansionSource,P> entry=queue.pop();
  if (entry != null) {
    current=entry.getEntity();
    currentAggregatedValue=entry.getPriority();
    visitedNodes.add(current.node().getId());
    System.out.println("String_Node_Str" + currentAggregatedValue + "String_Node_Str"+ current.node().getProperty(SimpleGraphBuilder.KEY_ID));
    return current;
  }
  return null;
}
Program: 154955
Project: 154955
Buggy source:
/** 
 * Add an entity to the priority map.
 * @param entity the entity to add.
 * @param priority the priority of the entity.
 */
public void put(E entity,P priority){
  K key=keyFunction.convert(entity);
  Node<E,P> node=map.get(key);
  if (node != null && priority.equals(node.priority)) {
    node.head=new Link<E>(entity,node.head);
  }
 else {
    node=new Node<E,P>(entity,priority);
    map.put(key,node);
    queue.add(node);
  }
}

Fixed version (ground truth):
private void put(E entity,P priority,K key){
  Node<E,P> node=new Node<E,P>(entity,priority);
  map.put(key,node);
  queue.add(node);
}
Program: 154956
Project: 154956
Buggy source:
/** 
 * Remove and return the entry with the highest priority.
 * @return the entry with the highest priority.
 */
public Entry<E,P> pop(){
  Node<E,P> node=queue.peek();
  if (node == null) {
    return null;
  }
 else   if (node.head.next == null) {
    node=queue.poll();
    map.remove(keyFunction.convert(node.head.entity));
  }
 else {
    node.head=node.head.next;
  }
  return new Entry<E,P>(node);
}

Fixed version (ground truth):
/** 
 * Remove and return the entry with the highest priority.
 * @return the entry with the highest priority.
 */
public Entry<E,P> pop(){
  Node<E,P> node=queue.peek();
  Entry<E,P> result=null;
  if (node == null) {
    return null;
  }
 else   if (node.head.next == null) {
    node=queue.poll();
    map.remove(keyFunction.convert(node.head.entity));
    result=new Entry<E,P>(node);
  }
 else {
    result=new Entry<E,P>(node);
    node.head=node.head.next;
  }
  return result;
}
Program: 154957
Project: 154957
Buggy source:
@Override protected WeightedPath fetchNextOrNull(){
  if (!paths.hasNext()) {
    return null;
  }
  WeightedPath path=new WeightedPathImpl(costEvaluator,paths.next());
  if (foundWeight != null && path.weight() > foundWeight) {
    return null;
  }
  foundWeight=path.weight();
  return path;
}

Fixed version (ground truth):
@Override protected WeightedPath fetchNextOrNull(){
  if (!paths.hasNext()) {
    System.out.println("String_Node_Str");
    return null;
  }
  WeightedPath path=new WeightedPathImpl(costEvaluator,paths.next());
  System.out.println("String_Node_Str" + path);
  if (foundWeight != null && path.weight() > foundWeight) {
    System.out.println("String_Node_Str");
    return null;
  }
  foundWeight=path.weight();
  return path;
}
Program: 154959
Project: 154959
Buggy source:
@Test public void testSimplest(){
  Node nodeA=graph.makeNode("String_Node_Str","String_Node_Str",0d,"String_Node_Str",0d);
  Node nodeB=graph.makeNode("String_Node_Str","String_Node_Str",2d,"String_Node_Str",1d);
  Node nodeC=graph.makeNode("String_Node_Str","String_Node_Str",7d,"String_Node_Str",0d);
  Relationship relAB=graph.makeEdge("String_Node_Str","String_Node_Str","String_Node_Str",2d);
  Relationship relBC=graph.makeEdge("String_Node_Str","String_Node_Str","String_Node_Str",3d);
  Relationship relAC=graph.makeEdge("String_Node_Str","String_Node_Str","String_Node_Str",10d);
  AStar astar=new AStar(graphDb,TraversalFactory.expanderForAllTypes(),new DoubleEvaluator("String_Node_Str"),ESTIMATE_EVALUATOR);
  WeightedPath path=astar.findSinglePath(nodeA,nodeC);
  assertEquals((Double)5d,(Double)path.weight());
  assertPath(path,nodeA,nodeB,nodeC);
}

Fixed version (ground truth):
@Test public void testSimplest(){
  Node nodeA=graph.makeNode("String_Node_Str","String_Node_Str",0d,"String_Node_Str",0d);
  Node nodeB=graph.makeNode("String_Node_Str","String_Node_Str",2d,"String_Node_Str",1d);
  Node nodeC=graph.makeNode("String_Node_Str","String_Node_Str",7d,"String_Node_Str",0d);
  Relationship relAB=graph.makeEdge("String_Node_Str","String_Node_Str","String_Node_Str",2d);
  Relationship relAB2=graph.makeEdge("String_Node_Str","String_Node_Str","String_Node_Str",2d);
  Relationship relBC=graph.makeEdge("String_Node_Str","String_Node_Str","String_Node_Str",3d);
  Relationship relAC=graph.makeEdge("String_Node_Str","String_Node_Str","String_Node_Str",10d);
  PathFinder<WeightedPath> astar=newFinder();
  int counter=0;
  for (  WeightedPath path : astar.findAllPaths(nodeA,nodeC)) {
    assertEquals((Double)5d,(Double)path.weight());
    assertPath(path,nodeA,nodeB,nodeC);
    counter++;
  }
}
Program: 154960
Project: 154960
Buggy source:
@Ignore @Test public void canGetMultiplePathsInTriangleGraph() throws Exception {
  Node nodeA=graph.makeNode("String_Node_Str","String_Node_Str",0d,"String_Node_Str",0d);
  Node nodeB=graph.makeNode("String_Node_Str","String_Node_Str",2d,"String_Node_Str",1d);
  Node nodeC=graph.makeNode("String_Node_Str","String_Node_Str",7d,"String_Node_Str",0d);
  Set<Relationship> expectedFirsts=new HashSet<Relationship>();
  expectedFirsts.add(graph.makeEdge("String_Node_Str","String_Node_Str","String_Node_Str",1d));
  expectedFirsts.add(graph.makeEdge("String_Node_Str","String_Node_Str","String_Node_Str",1d));
  Relationship expectedSecond=graph.makeEdge("String_Node_Str","String_Node_Str","String_Node_Str",2d);
  graph.makeEdge("String_Node_Str","String_Node_Str","String_Node_Str",5d);
  AStar algo=new AStar(graphDb,TraversalFactory.expanderForAllTypes(),new DoubleEvaluator("String_Node_Str"),ESTIMATE_EVALUATOR);
  Iterator<WeightedPath> paths=algo.findAllPaths(nodeA,nodeC).iterator();
  for (int i=0; i < 2; i++) {
    assertTrue("String_Node_Str",paths.hasNext());
    Path path=paths.next();
    assertPath(path,nodeA,nodeB,nodeC);
    Iterator<Relationship> relationships=path.relationships().iterator();
    assertTrue("String_Node_Str",relationships.hasNext());
    assertTrue("String_Node_Str",expectedFirsts.remove(relationships.next()));
    assertTrue("String_Node_Str",relationships.hasNext());
    assertEquals(expectedSecond,relationships.next());
    assertFalse("String_Node_Str",relationships.hasNext());
  }
  assertFalse("String_Node_Str",paths.hasNext());
}

Fixed version (ground truth):
@Ignore @Test public void canGetMultiplePathsInTriangleGraph() throws Exception {
  Node nodeA=graph.makeNode("String_Node_Str","String_Node_Str",0d,"String_Node_Str",0d);
  Node nodeB=graph.makeNode("String_Node_Str","String_Node_Str",2d,"String_Node_Str",1d);
  Node nodeC=graph.makeNode("String_Node_Str","String_Node_Str",7d,"String_Node_Str",0d);
  Set<Relationship> expectedFirsts=new HashSet<Relationship>();
  expectedFirsts.add(graph.makeEdge("String_Node_Str","String_Node_Str","String_Node_Str",1d));
  expectedFirsts.add(graph.makeEdge("String_Node_Str","String_Node_Str","String_Node_Str",1d));
  Relationship expectedSecond=graph.makeEdge("String_Node_Str","String_Node_Str","String_Node_Str",2d);
  graph.makeEdge("String_Node_Str","String_Node_Str","String_Node_Str",5d);
  PathFinder<WeightedPath> algo=newFinder();
  Iterator<WeightedPath> paths=algo.findAllPaths(nodeA,nodeC).iterator();
  for (int i=0; i < 2; i++) {
    assertTrue("String_Node_Str" + i + "String_Node_Str",paths.hasNext());
    Path path=paths.next();
    assertPath(path,nodeA,nodeB,nodeC);
    Iterator<Relationship> relationships=path.relationships().iterator();
    assertTrue("String_Node_Str",relationships.hasNext());
    assertTrue("String_Node_Str",expectedFirsts.remove(relationships.next()));
    assertTrue("String_Node_Str",relationships.hasNext());
    assertEquals(expectedSecond,relationships.next());
    assertFalse("String_Node_Str",relationships.hasNext());
  }
  assertFalse("String_Node_Str",paths.hasNext());
}
Program: 154961
Project: 154961
Buggy source:
public static String templateString(String templateString,String variablePrefix,Map<String,? extends Object> data){
  Map<Integer,List<String>> lengthMap=new HashMap<Integer,List<String>>();
  int longest=0;
  for (  String key : data.keySet()) {
    int length=key.length();
    if (length > longest) {
      longest=length;
    }
    List<String> innerList=null;
    Integer innerKey=Integer.valueOf(length);
    if (lengthMap.containsKey(innerKey)) {
      innerList=lengthMap.get(innerKey);
    }
 else {
      innerList=new ArrayList<String>();
      lengthMap.put(innerKey,innerList);
    }
    innerList.add(key);
  }
  String result=templateString;
  for (int i=longest; i >= 0; i--) {
    Integer lengthKey=Integer.valueOf(i);
    if (!lengthMap.containsKey(lengthKey)) {
      continue;
    }
    List<String> list=lengthMap.get(lengthKey);
    for (    String key : list) {
      String replacement=data.get(key).toString();
      String regExpMatchString=variablePrefix + key;
      result=result.replaceAll(regExpMatchString,replacement);
    }
  }
  return result;
}

Fixed version (ground truth):
public static String templateString(String templateString,String variablePrefix,Map<String,? extends Object> data){
  Map<Integer,List<String>> lengthMap=new HashMap<Integer,List<String>>();
  int longest=0;
  for (  String key : data.keySet()) {
    int length=key.length();
    if (length > longest) {
      longest=length;
    }
    List<String> innerList=null;
    Integer innerKey=Integer.valueOf(length);
    if (lengthMap.containsKey(innerKey)) {
      innerList=lengthMap.get(innerKey);
    }
 else {
      innerList=new ArrayList<String>();
      lengthMap.put(innerKey,innerList);
    }
    innerList.add(key);
  }
  String result=templateString;
  for (int i=longest; i >= 0; i--) {
    Integer lengthKey=Integer.valueOf(i);
    if (!lengthMap.containsKey(lengthKey)) {
      continue;
    }
    List<String> list=lengthMap.get(lengthKey);
    for (    String key : list) {
      Object value=data.get(key);
      if (value != null) {
        String replacement=data.get(key).toString();
        String regExpMatchString=variablePrefix + key;
        result=result.replaceAll(regExpMatchString,replacement);
      }
    }
  }
  return result;
}
Program: 154962
Project: 154962
Buggy source:
public void grabPrompt(){
  this.init();
  while (true) {
    try {
      String line=this.readLine(tryGetProperPromptString());
      if (EXIT_COMMANDS.contains(line)) {
        break;
      }
      line=expandLine(line);
      String result=this.getServer().interpretLine(line,this.session(),this.getOutput());
      if (result == null || result.trim().length() == 0) {
        continue;
      }
      if (result.contains("String_Node_Str")) {
        break;
      }
    }
 catch (    Exception e) {
      if (this.shouldPrintStackTraces()) {
        e.printStackTrace();
      }
      this.console.format(getShortExceptionMessage(e) + "String_Node_Str");
    }
  }
  this.shutdown();
}

Fixed version (ground truth):
public void grabPrompt(){
  this.init();
  while (true) {
    try {
      String line=this.readLine(tryGetProperPromptString());
      if (EXIT_COMMANDS.contains(line)) {
        break;
      }
      line=expandLine(line);
      String result=this.getServer().interpretLine(line,this.session(),this.getOutput());
      if (result == null || result.trim().length() == 0) {
        continue;
      }
      if (result.contains("String_Node_Str")) {
        break;
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
      this.console.format(getShortExceptionMessage(e) + "String_Node_Str");
    }
  }
  this.shutdown();
}
Program: 154963
Project: 154963
Buggy source:
public int complete(String buffer,int cursor,List candidates){
  if (buffer == null || buffer.length() == 0) {
    return cursor;
  }
  try {
    if (buffer.contains("String_Node_Str")) {
      AppCommandParser parser=new AppCommandParser((AppShellServer)client.getServer(),buffer.toString());
      App app=parser.app();
      List<String> appCandidates=app.completionCandidates(buffer,client.session());
      appCandidates=quote(appCandidates);
      if (appCandidates.size() == 1) {
        appCandidates.set(0,appCandidates.get(0) + "String_Node_Str");
      }
      candidates.addAll(appCandidates);
      return buffer.length() - TextUtil.lastWordOrQuoteOf(buffer,true).length();
    }
 else {
      return this.appNameCompletor.complete(buffer,cursor,candidates);
    }
  }
 catch (  ShellException e) {
    e.printStackTrace();
  }
  return cursor;
}

Fixed version (ground truth):
public int complete(String buffer,int cursor,List candidates){
  if (buffer == null || buffer.length() == 0) {
    return cursor;
  }
  try {
    if (buffer.contains("String_Node_Str")) {
      TabCompletion completion=client.getServer().tabComplete(buffer.trim(),client.session());
      cursor=completion.getCursor();
      candidates.addAll(completion.getCandidates());
    }
 else {
      return this.appNameCompletor.complete(buffer,cursor,candidates);
    }
  }
 catch (  RemoteException e) {
    e.printStackTrace();
  }
catch (  ShellException e) {
    e.printStackTrace();
  }
  return cursor;
}
Program: 154964
Project: 154964
Buggy source:
@Override public List<String> completionCandidates(String partOfLine,Session session){
  String lastWord=TextUtil.lastWordOrQuoteOf(partOfLine,false);
  if (lastWord.startsWith("String_Node_Str")) {
    return super.completionCandidates(partOfLine,session);
  }
  Transaction tx=getServer().getDb().beginTx();
  try {
    TreeSet<String> result=new TreeSet<String>();
    NodeOrRelationship current=getCurrent(session);
    if (current.isNode()) {
      Node node=current.asNode();
      for (      Relationship rel : node.getRelationships()) {
        Node otherNode=rel.getOtherNode(node);
        long otherNodeId=otherNode.getId();
        String title=findTitle(getServer(),session,otherNode);
        if (title != null) {
          if (!result.contains(title)) {
            maybeAddCompletionCandidate(result,title + "String_Node_Str" + otherNodeId,lastWord);
          }
        }
        maybeAddCompletionCandidate(result,"String_Node_Str" + otherNodeId,lastWord);
      }
    }
 else {
      maybeAddCompletionCandidate(result,START_ALIAS,lastWord);
      maybeAddCompletionCandidate(result,END_ALIAS,lastWord);
      Relationship rel=current.asRelationship();
      maybeAddCompletionCandidate(result,"String_Node_Str" + rel.getStartNode().getId(),lastWord);
      maybeAddCompletionCandidate(result,"String_Node_Str" + rel.getEndNode().getId(),lastWord);
    }
    tx.success();
    return new ArrayList<String>(result);
  }
 catch (  ShellException e) {
    e.printStackTrace();
    return super.completionCandidates(partOfLine,session);
  }
 finally {
    tx.finish();
  }
}

Fixed version (ground truth):
@Override public List<String> completionCandidates(String partOfLine,Session session){
  String lastWord=TextUtil.lastWordOrQuoteOf(partOfLine,false);
  if (lastWord.startsWith("String_Node_Str")) {
    return super.completionCandidates(partOfLine,session);
  }
  try {
    TreeSet<String> result=new TreeSet<String>();
    NodeOrRelationship current=getCurrent(session);
    if (current.isNode()) {
      Node node=current.asNode();
      for (      Relationship rel : node.getRelationships()) {
        Node otherNode=rel.getOtherNode(node);
        long otherNodeId=otherNode.getId();
        String title=findTitle(getServer(),session,otherNode);
        if (title != null) {
          if (!result.contains(title)) {
            maybeAddCompletionCandidate(result,title + "String_Node_Str" + otherNodeId,lastWord);
          }
        }
        maybeAddCompletionCandidate(result,"String_Node_Str" + otherNodeId,lastWord);
      }
    }
 else {
      maybeAddCompletionCandidate(result,START_ALIAS,lastWord);
      maybeAddCompletionCandidate(result,END_ALIAS,lastWord);
      Relationship rel=current.asRelationship();
      maybeAddCompletionCandidate(result,"String_Node_Str" + rel.getStartNode().getId(),lastWord);
      maybeAddCompletionCandidate(result,"String_Node_Str" + rel.getEndNode().getId(),lastWord);
    }
    return new ArrayList<String>(result);
  }
 catch (  ShellException e) {
    e.printStackTrace();
    return super.completionCandidates(partOfLine,session);
  }
}
Program: 154966
Project: 154966
Buggy source:
protected PathFinder<Path> instantiatePathFinder(int maxDepth){
  return new TraversalShortestPath(TraversalFactory.expanderForAllTypes());
}

Fixed version (ground truth):
protected PathFinder<Path> instantiatePathFinder(int maxDepth){
  return new ShortestPath(graphDb,maxDepth,TraversalFactory.expanderForTypes(MyRelTypes.R1,Direction.BOTH));
}
Program: 154967
Project: 154967
Buggy source:
public void beforeCompletion(){
  TransactionData data=null;
  data=nodeManager.getTransactionData();
  states=new ArrayList<HandlerAndState>();
  for (  TransactionEventHandler<T> handler : this.handlers) {
    try {
      T state=handler.beforeCommit(data);
      states.add(new HandlerAndState(handler,state));
    }
 catch (    Throwable t) {
      transaction.failure();
      throw new RuntimeException(t);
    }
  }
}

Fixed version (ground truth):
public void beforeCompletion(){
  this.transactionData=nodeManager.getTransactionData();
  states=new ArrayList<HandlerAndState>();
  for (  TransactionEventHandler<T> handler : this.handlers) {
    try {
      T state=handler.beforeCommit(transactionData);
      states.add(new HandlerAndState(handler,state));
    }
 catch (    Throwable t) {
      transaction.failure();
      throw new RuntimeException(t);
    }
  }
}
Program: 154968
Project: 154968
Buggy source:
public void flushAll(){
  relTypeStore.flushAll();
  propStore.flushAll();
  relStore.flushAll();
  nodeStore.flushAll();
}

Fixed version (ground truth):
public void flushAll(){
  if (relTypeStore == null || propStore == null || relStore == null || nodeStore == null) {
    return;
  }
  relTypeStore.flushAll();
  propStore.flushAll();
  relStore.flushAll();
  nodeStore.flushAll();
}
Program: 154969
Project: 154969
Buggy source:
public void close(){
  xaContainer.close();
  if (logApplied) {
    neoStore.rebuildIdGenerators();
    logApplied=false;
  }
  neoStore.close();
  logger.fine("String_Node_Str");
}

Fixed version (ground truth):
public void close(){
  neoStore.flushAll();
  xaContainer.close();
  if (logApplied) {
    neoStore.rebuildIdGenerators();
    logApplied=false;
  }
  neoStore.close();
  logger.fine("String_Node_Str");
}
Program: 154970
Project: 154970
Buggy source:
public boolean shouldExpandBeyond(ExpansionSource source){
  return !this.pruning.pruneAfter(source.position()) && this.uniquness.check(source,false);
}

Fixed version (ground truth):
public boolean shouldExpandBeyond(ExpansionSource source){
  return this.uniquness.check(source,false) && !this.pruning.pruneAfter(source.position());
}