nus-yam/ex-repair huggingface dataset:
Program: 9013
Project: 9013
Buggy source:
private SolrServer createSolrServer() throws Exception {
  String solrHomePath=oakSolrConfiguration.getSolrHomePath();
  String coreName=oakSolrConfiguration.getCoreName();
  String solrConfigPath=oakSolrConfiguration.getSolrConfigPath();
  checkSolrConfiguration(solrHomePath,solrConfigPath,coreName);
  CoreContainer coreContainer=new CoreContainer(solrHomePath);
  coreContainer.load(solrHomePath,new File(solrConfigPath));
  return new EmbeddedSolrServer(coreContainer,coreName);
}

Fixed version (ground truth):
private SolrServer createSolrServer() throws Exception {
  String solrHomePath=oakSolrConfiguration.getSolrHomePath();
  String coreName=oakSolrConfiguration.getCoreName();
  String solrConfigPath=oakSolrConfiguration.getSolrConfigPath();
  checkSolrConfiguration(solrHomePath,solrConfigPath,coreName);
  ClassLoader classLoader=Thread.currentThread().getContextClassLoader();
  Thread.currentThread().setContextClassLoader(CoreContainer.class.getClassLoader());
  CoreContainer coreContainer=new CoreContainer(solrHomePath);
  try {
    coreContainer.load(solrHomePath,new File(solrConfigPath));
  }
  finally {
    Thread.currentThread().setContextClassLoader(classLoader);
  }
  return new EmbeddedSolrServer(coreContainer,coreName);
}
Program: 9014
Project: 9014
Buggy source:
/** 
 * Try to create or update the node. If there was a conflict, this method throws an exception, even thought the change is still applied.
 * @param store the store
 * @param op the operation
 */
private void createOrUpdateNode(DocumentStore store,UpdateOp op){
  Map<String,Object> map=store.createOrUpdate(Collection.NODES,op);
  if (baseRevision != null) {
    Revision newestRev=mk.getNewestRevision(map,revision,true);
    if (newestRev != null) {
      if (op.isNew) {
        throw new MicroKernelException("String_Node_Str" + op.path + "String_Node_Str"+ newestRev+ "String_Node_Str"+ revision+ "String_Node_Str"+ map);
      }
      if (mk.isRevisionNewer(newestRev,baseRevision)) {
        throw new MicroKernelException("String_Node_Str" + op.path + "String_Node_Str"+ newestRev+ "String_Node_Str"+ baseRevision+ "String_Node_Str"+ revision+ "String_Node_Str"+ map);
      }
    }
  }
  int size=Utils.estimateMemoryUsage(map);
  if (size > MAX_DOCUMENT_SIZE) {
    UpdateOp[] split=splitDocument(map);
    UpdateOp old=split[0];
    if (old != null) {
      store.createOrUpdate(Collection.NODES,old);
    }
    UpdateOp main=split[1];
    if (main != null) {
      store.createOrUpdate(Collection.NODES,main);
    }
  }
}

Fixed version (ground truth):
/** 
 * Try to create or update the node. If there was a conflict, this method throws an exception, even thought the change is still applied.
 * @param store the store
 * @param op the operation
 */
private void createOrUpdateNode(DocumentStore store,UpdateOp op){
  Map<String,Object> map=store.createOrUpdate(Collection.NODES,op);
  if (baseRevision != null) {
    Revision newestRev=mk.getNewestRevision(map,revision,true);
    if (newestRev == null) {
      if (op.isDelete || !op.isNew) {
        throw new MicroKernelException("String_Node_Str" + op.path + "String_Node_Str"+ "String_Node_Str"+ revision+ "String_Node_Str"+ map);
      }
    }
 else {
      if (op.isNew) {
        throw new MicroKernelException("String_Node_Str" + op.path + "String_Node_Str"+ newestRev+ "String_Node_Str"+ revision+ "String_Node_Str"+ map);
      }
      if (mk.isRevisionNewer(newestRev,baseRevision)) {
        throw new MicroKernelException("String_Node_Str" + op.path + "String_Node_Str"+ newestRev+ "String_Node_Str"+ baseRevision+ "String_Node_Str"+ revision+ "String_Node_Str"+ map);
      }
    }
  }
  int size=Utils.estimateMemoryUsage(map);
  if (size > MAX_DOCUMENT_SIZE) {
    UpdateOp[] split=splitDocument(map);
    UpdateOp old=split[0];
    if (old != null) {
      store.createOrUpdate(Collection.NODES,old);
    }
    UpdateOp main=split[1];
    if (main != null) {
      store.createOrUpdate(Collection.NODES,main);
    }
  }
}
Program: 9015
Project: 9015
Buggy source:
@Nonnull public Map<String,Object> createOrUpdate(Collection collection,UpdateOp update){
  ConcurrentSkipListMap<String,Map<String,Object>> map=getMap(collection);
  Map<String,Object> n;
  Map<String,Object> oldNode;
  oldNode=n=map.get(update.key);
  if (n == null) {
    n=Utils.newMap();
    oldNode=map.putIfAbsent(update.key,n);
    if (oldNode != null) {
      n=oldNode;
    }
  }
synchronized (n) {
    if (oldNode != null) {
      Map<String,Object> oldNode2=Utils.newMap();
      Utils.deepCopyMap(oldNode,oldNode2);
      oldNode=oldNode2;
    }
    applyChanges(n,update);
  }
  return oldNode;
}

Fixed version (ground truth):
@Nonnull public Map<String,Object> createOrUpdate(Collection collection,UpdateOp update){
  ConcurrentSkipListMap<String,Map<String,Object>> map=getMap(collection);
  Map<String,Object> n;
  Map<String,Object> oldNode;
  oldNode=n=map.get(update.key);
  if (n == null) {
    if (!update.isNew) {
      throw new MicroKernelException("String_Node_Str" + update.key);
    }
    n=Utils.newMap();
    oldNode=map.putIfAbsent(update.key,n);
    if (oldNode != null) {
      n=oldNode;
    }
  }
synchronized (n) {
    if (oldNode != null) {
      Map<String,Object> oldNode2=Utils.newMap();
      Utils.deepCopyMap(oldNode,oldNode2);
      oldNode=oldNode2;
    }
    applyChanges(n,update);
  }
  return oldNode;
}
Program: 9017
Project: 9017
Buggy source:
private void commit(String diff){
  boolean ok=false;
  try {
    mkGold.commit("String_Node_Str",diff,null,null);
    ok=true;
  }
 catch (  MicroKernelException e) {
    try {
      mk.commit("String_Node_Str",diff,null,null);
      fail("String_Node_Str" + diff + "String_Node_Str"+ e);
    }
 catch (    MicroKernelException e2) {
    }
  }
  if (ok) {
    mk.commit("String_Node_Str",diff,null,null);
  }
}

Fixed version (ground truth):
private boolean commit(String diff){
  boolean ok=false;
  try {
    mkGold.commit("String_Node_Str",diff,null,null);
    ok=true;
  }
 catch (  MicroKernelException e) {
    try {
      mk.commit("String_Node_Str",diff,null,null);
      fail("String_Node_Str" + diff + "String_Node_Str"+ e);
    }
 catch (    MicroKernelException e2) {
    }
  }
  if (ok) {
    mk.commit("String_Node_Str",diff,null,null);
  }
  return ok;
}
Program: 9018
Project: 9018
Buggy source:
/** 
 * Try to create or update the node. If there was a conflict, this method throws an exception, even thought the change is still applied.
 * @param store the store
 * @param op the operation
 */
private void createOrUpdateNode(DocumentStore store,UpdateOp op){
  Map<String,Object> map=store.createOrUpdate(Collection.NODES,op);
  if (baseRevision != null) {
    Revision newestRev=mk.getNewestRevision(map,revision,true);
    if (newestRev != null) {
      if (op.isNew) {
        throw new MicroKernelException("String_Node_Str" + op.path + "String_Node_Str"+ newestRev);
      }
      if (mk.isRevisionNewer(newestRev,baseRevision)) {
        throw new MicroKernelException("String_Node_Str" + op.path + "String_Node_Str"+ newestRev+ "String_Node_Str"+ baseRevision);
      }
    }
  }
  int size=Utils.estimateMemoryUsage(map);
  if (size > MAX_DOCUMENT_SIZE) {
    UpdateOp[] split=splitDocument(map);
    UpdateOp old=split[0];
    if (old != null) {
      store.createOrUpdate(Collection.NODES,old);
    }
    UpdateOp main=split[1];
    if (main != null) {
      store.createOrUpdate(Collection.NODES,main);
    }
  }
}

Fixed version (ground truth):
/** 
 * Try to create or update the node. If there was a conflict, this method throws an exception, even thought the change is still applied.
 * @param store the store
 * @param op the operation
 */
private void createOrUpdateNode(DocumentStore store,UpdateOp op){
  Map<String,Object> map=store.createOrUpdate(Collection.NODES,op);
  if (baseRevision != null) {
    Revision newestRev=mk.getNewestRevision(map,revision,true);
    if (newestRev != null) {
      if (op.isNew) {
        throw new MicroKernelException("String_Node_Str" + op.path + "String_Node_Str"+ newestRev+ "String_Node_Str"+ revision+ "String_Node_Str"+ map);
      }
      if (mk.isRevisionNewer(newestRev,baseRevision)) {
        throw new MicroKernelException("String_Node_Str" + op.path + "String_Node_Str"+ newestRev+ "String_Node_Str"+ baseRevision+ "String_Node_Str"+ revision+ "String_Node_Str"+ map);
      }
    }
  }
  int size=Utils.estimateMemoryUsage(map);
  if (size > MAX_DOCUMENT_SIZE) {
    UpdateOp[] split=splitDocument(map);
    UpdateOp old=split[0];
    if (old != null) {
      store.createOrUpdate(Collection.NODES,old);
    }
    UpdateOp main=split[1];
    if (main != null) {
      store.createOrUpdate(Collection.NODES,main);
    }
  }
}
Program: 9021
Project: 9021
Buggy source:
/** 
 * Get the revision of the latest change made to this node.
 * @param nodeMap the document
 * @param before the returned value is guaranteed to be older than this revision
 * @param onlyCommitted whether only committed changes should be considered
 * @return the revision, or null if deleted
 */
@Nullable Revision getNewestRevision(Map<String,Object> nodeMap,Revision before,boolean onlyCommitted){
  if (nodeMap == null) {
    return null;
  }
  @SuppressWarnings("String_Node_Str") Map<String,String> valueMap=(Map<String,String>)nodeMap.get(UpdateOp.DELETED);
  if (valueMap == null) {
    return null;
  }
  Revision newestRev=null;
  String newestValue=null;
  for (  String r : valueMap.keySet()) {
    Revision propRev=Revision.fromString(r);
    if (newestRev == null || isRevisionNewer(propRev,newestRev)) {
      if (isRevisionNewer(before,propRev)) {
        if (!onlyCommitted || isValidRevision(propRev,before,nodeMap)) {
          newestRev=propRev;
        }
        newestValue=valueMap.get(r);
      }
    }
  }
  if ("String_Node_Str".equals(newestValue)) {
    return null;
  }
  return newestRev;
}

Fixed version (ground truth):
/** 
 * Get the revision of the latest change made to this node.
 * @param nodeMap the document
 * @param before the returned value is guaranteed to be older than this revision
 * @param onlyCommitted whether only committed changes should be considered
 * @return the revision, or null if deleted
 */
@Nullable Revision getNewestRevision(Map<String,Object> nodeMap,Revision before,boolean onlyCommitted){
  if (nodeMap == null) {
    return null;
  }
  @SuppressWarnings("String_Node_Str") Map<String,String> valueMap=(Map<String,String>)nodeMap.get(UpdateOp.DELETED);
  if (valueMap == null) {
    return null;
  }
  Revision newestRev=null;
  String newestValue=null;
  for (  String r : valueMap.keySet()) {
    Revision propRev=Revision.fromString(r);
    if (newestRev == null || isRevisionNewer(propRev,newestRev)) {
      if (isRevisionNewer(before,propRev)) {
        if (!onlyCommitted || isValidRevision(propRev,before,nodeMap)) {
          newestRev=propRev;
          newestValue=valueMap.get(r);
        }
      }
    }
  }
  if ("String_Node_Str".equals(newestValue)) {
    return null;
  }
  return newestRev;
}
Program: 9022
Project: 9022
Buggy source:
@Test public void reAddDeleted2(){
  MongoMK mk=createMK();
  String rev=mk.commit("String_Node_Str","String_Node_Str",null,null);
  rev=mk.commit("String_Node_Str","String_Node_Str",rev,null);
  rev=mk.commit("String_Node_Str","String_Node_Str",null,null);
  String test=mk.getNodes("String_Node_Str",rev,0,0,Integer.MAX_VALUE,null);
  assertEquals("String_Node_Str",test);
  mk.dispose();
}

Fixed version (ground truth):
@Test public void reAddDeleted2(){
  MongoMK mk=createMK();
  String rev=mk.commit("String_Node_Str","String_Node_Str",null,null);
  rev=mk.commit("String_Node_Str","String_Node_Str",rev,null);
  rev=mk.commit("String_Node_Str","String_Node_Str",null,null);
  String test=mk.getNodes("String_Node_Str",rev,0,0,Integer.MAX_VALUE,null);
  assertEquals("String_Node_Str",test);
  String test2=mk.getNodes("String_Node_Str",rev,0,0,Integer.MAX_VALUE,null);
  assertEquals("String_Node_Str",test2);
  mk.dispose();
}
Program: 9023
Project: 9023
Buggy source:
public Node.Children readChildren(String path,String nodeId,Revision rev,int limit){
  Node.Children c;
  c=nodeChildrenCache.get(nodeId);
  if (c != null) {
    return c;
  }
  String from=PathUtils.concat(path,"String_Node_Str");
  from=Utils.getIdFromPath(from);
  from=from.substring(0,from.length() - 1);
  String to=PathUtils.concat(path,"String_Node_Str");
  to=Utils.getIdFromPath(to);
  to=to.substring(0,to.length() - 2) + "String_Node_Str";
  List<Map<String,Object>> list=store.query(DocumentStore.Collection.NODES,from,to,limit);
  c=new Node.Children(path,nodeId,rev);
  for (  Map<String,Object> e : list) {
    if (isDeleted(e,rev)) {
      continue;
    }
    String id=e.get(UpdateOp.ID).toString();
    String p=Utils.getPathFromId(id);
    c.children.add(p);
  }
  nodeChildrenCache.put(nodeId,c);
  return c;
}

Fixed version (ground truth):
public Node.Children readChildren(String path,String nodeId,Revision rev,int limit){
  Node.Children c;
  c=nodeChildrenCache.get(nodeId);
  if (c != null) {
    return c;
  }
  String from=PathUtils.concat(path,"String_Node_Str");
  from=Utils.getIdFromPath(from);
  from=from.substring(0,from.length() - 1);
  String to=PathUtils.concat(path,"String_Node_Str");
  to=Utils.getIdFromPath(to);
  to=to.substring(0,to.length() - 2) + "String_Node_Str";
  List<Map<String,Object>> list=store.query(DocumentStore.Collection.NODES,from,to,limit);
  c=new Node.Children(path,nodeId,rev);
  for (  Map<String,Object> e : list) {
    if (getLiveRevision(e,rev) == null) {
      continue;
    }
    String id=e.get(UpdateOp.ID).toString();
    String p=Utils.getPathFromId(id);
    c.children.add(p);
  }
  nodeChildrenCache.put(nodeId,c);
  return c;
}
Program: 9024
Project: 9024
Buggy source:
@Override public String diff(String fromRevisionId,String toRevisionId,String path,int depth) throws MicroKernelException {
  if (fromRevisionId.equals(toRevisionId)) {
    return "String_Node_Str";
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String diff(String fromRevisionId,String toRevisionId,String path,int depth) throws MicroKernelException {
  if (fromRevisionId.equals(toRevisionId)) {
    return "String_Node_Str";
  }
  if (true) {
    return "String_Node_Str";
  }
  if (depth != 0) {
    throw new MicroKernelException("String_Node_Str" + depth);
  }
  fromRevisionId=stripBranchRevMarker(fromRevisionId);
  toRevisionId=stripBranchRevMarker(toRevisionId);
  Node from=getNode(path,Revision.fromString(fromRevisionId));
  Node to=getNode(path,Revision.fromString(toRevisionId));
  if (from == null || to == null) {
    throw new MicroKernelException("String_Node_Str");
  }
  JsopWriter w=new JsopStream();
  for (  String p : from.getPropertyNames()) {
    String fromValue=from.getProperty(p);
    String toValue=to.getProperty(p);
    if (!fromValue.equals(toValue)) {
      w.tag('^').key(p).value(toValue).newline();
    }
  }
  for (  String p : to.getPropertyNames()) {
    if (from.getProperty(p) == null) {
      w.tag('^').key(p).value(to.getProperty(p)).newline();
    }
  }
  Revision fromRev=Revision.fromString(fromRevisionId);
  Revision toRev=Revision.fromString(toRevisionId);
  Children fromChildren=readChildren(path,from.getId(),fromRev,Integer.MAX_VALUE);
  Children toChildren=readChildren(path,to.getId(),toRev,Integer.MAX_VALUE);
  Set<String> childrenSet=new HashSet<String>(toChildren.children);
  for (  String n : fromChildren.children) {
    if (!childrenSet.contains(n)) {
      w.tag('-').key(n).object().endObject().newline();
    }
 else {
      w.tag('^').key(n).object().endObject().newline();
    }
  }
  childrenSet=new HashSet<String>(fromChildren.children);
  for (  String n : toChildren.children) {
    if (!childrenSet.contains(n)) {
      w.tag('+').key(n).object().endObject().newline();
    }
  }
  return w.toString();
}
Program: 9025
Project: 9025
Buggy source:
private String getLatestValue(Map<String,String> valueMap,Revision rev){
  String value=null;
  Revision latestRev=null;
  for (  String r : valueMap.keySet()) {
    Revision propRev=Revision.fromString(r);
    if (includeRevision(propRev,rev)) {
      if (latestRev == null || isRevisionNewer(propRev,latestRev)) {
        latestRev=propRev;
        value=valueMap.get(r);
      }
    }
  }
  return value;
}

Fixed version (ground truth):
/** 
 * Get the latest property value that is larger or equal the min revision, and smaller or equal the max revision.
 * @param valueMap the revision-value map
 * @param min the minimum revision (null meaning unlimited)
 * @param max the maximum revision
 * @return the value, or null if not found
 */
private String getLatestValue(Map<String,String> valueMap,Revision min,Revision max){
  String value=null;
  Revision latestRev=null;
  for (  String r : valueMap.keySet()) {
    Revision propRev=Revision.fromString(r);
    if (min != null) {
      if (isRevisionNewer(min,propRev)) {
        continue;
      }
    }
    if (includeRevision(propRev,max)) {
      if (latestRev == null || isRevisionNewer(propRev,latestRev)) {
        latestRev=propRev;
        value=valueMap.get(r);
      }
    }
  }
  return value;
}
Program: 9026
Project: 9026
Buggy source:
boolean isRevisionNewer(Revision x,Revision previous){
  return x.compareRevisionTime(previous) >= 0;
}

Fixed version (ground truth):
boolean isRevisionNewer(Revision x,Revision previous){
  return x.compareRevisionTime(previous) > 0;
}
Program: 9027
Project: 9027
Buggy source:
private Node readNode(String path,Revision rev){
  String id=Utils.getIdFromPath(path);
  Map<String,Object> map=store.find(DocumentStore.Collection.NODES,id);
  if (map == null) {
    return null;
  }
  if (isDeleted(map,rev)) {
    return null;
  }
  Node n=new Node(path,rev);
  Long w=writeCountIncrements.get(path);
  long writeCount=w == null ? 0 : w;
  for (  String key : map.keySet()) {
    if (key.equals(UpdateOp.WRITE_COUNT)) {
      writeCount+=(Long)map.get(key);
    }
    if (!Utils.isPropertyName(key)) {
      continue;
    }
    Object v=map.get(key);
    @SuppressWarnings("String_Node_Str") Map<String,String> valueMap=(Map<String,String>)v;
    if (valueMap != null) {
      String value=getLatestValue(valueMap,rev);
      String propertyName=Utils.unescapePropertyName(key);
      n.setProperty(propertyName,value);
    }
  }
  n.setWriteCount(writeCount);
  return n;
}

Fixed version (ground truth):
private Node readNode(String path,Revision rev){
  String id=Utils.getIdFromPath(path);
  Map<String,Object> map=store.find(DocumentStore.Collection.NODES,id);
  if (map == null) {
    return null;
  }
  Revision min=getLiveRevision(map,rev);
  if (min == null) {
    return null;
  }
  Node n=new Node(path,rev);
  Long w=writeCountIncrements.get(path);
  long writeCount=w == null ? 0 : w;
  for (  String key : map.keySet()) {
    if (key.equals(UpdateOp.WRITE_COUNT)) {
      writeCount+=(Long)map.get(key);
    }
    if (!Utils.isPropertyName(key)) {
      continue;
    }
    Object v=map.get(key);
    @SuppressWarnings("String_Node_Str") Map<String,String> valueMap=(Map<String,String>)v;
    if (valueMap != null) {
      String value=getLatestValue(valueMap,min,rev);
      String propertyName=Utils.unescapePropertyName(key);
      n.setProperty(propertyName,value);
    }
  }
  n.setWriteCount(writeCount);
  return n;
}
Program: 9028
Project: 9028
Buggy source:
AuthorizableImpl(@Nonnull String id,@Nonnull Tree tree,@Nonnull UserManagerImpl userManager) throws RepositoryException {
  checkValidTree(tree);
  this.id=id;
  this.userManager=userManager;
  PropertyState pNameProp=tree.getProperty(REP_PRINCIPAL_NAME);
  if (pNameProp != null) {
    principalName=pNameProp.getValue(STRING);
  }
 else {
    String msg="String_Node_Str" + id;
    log.warn(msg);
    throw new RepositoryException(msg);
  }
}

Fixed version (ground truth):
AuthorizableImpl(@Nonnull String id,@Nonnull Tree tree,@Nonnull UserManagerImpl userManager) throws RepositoryException {
  checkValidTree(tree);
  this.id=id;
  this.userManager=userManager;
  PropertyState pNameProp=tree.getProperty(REP_PRINCIPAL_NAME);
  if (pNameProp != null) {
    principalName=pNameProp.getValue(STRING);
  }
 else {
    String msg="String_Node_Str" + id;
    log.warn(msg);
    principalName=id;
  }
}
Program: 9029
Project: 9029
Buggy source:
private UpdateOp getUpdateOperationForNode(String path){
  UpdateOp op=operations.get(path);
  if (op == null) {
    String id=Node.convertPathToDocumentId(path);
    op=new UpdateOp(path,id,false);
    operations.put(path,op);
  }
  return op;
}

Fixed version (ground truth):
private UpdateOp getUpdateOperationForNode(String path){
  UpdateOp op=operations.get(path);
  if (op == null) {
    String id=Utils.getIdFromPath(path);
    op=new UpdateOp(path,id,false);
    operations.put(path,op);
  }
  return op;
}
Program: 9031
Project: 9031
Buggy source:
private void markChanged(String path){
  while (true) {
    changedNodes.add(path);
    if (PathUtils.denotesRoot(path)) {
      break;
    }
    path=PathUtils.getParentPath(path);
  }
}

Fixed version (ground truth):
private void markChanged(String path){
  if (!PathUtils.denotesRoot(path) && !PathUtils.isAbsolute(path)) {
    throw new IllegalArgumentException("String_Node_Str" + path);
  }
  while (true) {
    changedNodes.add(path);
    if (PathUtils.denotesRoot(path)) {
      break;
    }
    path=PathUtils.getParentPath(path);
  }
}
Program: 9032
Project: 9032
Buggy source:
void updateProperty(String path,String propertyName,String value){
  UpdateOp op=getUpdateOperationForNode(path);
  op.addMapEntry(propertyName + "String_Node_Str" + revision.toString(),value);
  long increment=mk.getWriteCountIncrement(path);
  op.increment(UpdateOp.WRITE_COUNT,1 + increment);
}

Fixed version (ground truth):
void updateProperty(String path,String propertyName,String value){
  UpdateOp op=getUpdateOperationForNode(path);
  String key=Utils.escapePropertyName(propertyName);
  op.addMapEntry(key + "String_Node_Str" + revision.toString(),value);
  long increment=mk.getWriteCountIncrement(path);
  op.increment(UpdateOp.WRITE_COUNT,1 + increment);
}
Program: 9033
Project: 9033
Buggy source:
private UpdateOp[] splitDocument(Map<String,Object> map){
  String id=(String)map.get(UpdateOp.ID);
  String path=id.substring(1);
  Long previous=(Long)map.get(UpdateOp.PREVIOUS);
  if (previous == null) {
    previous=0L;
  }
 else {
    previous++;
  }
  UpdateOp old=new UpdateOp(path,id + "String_Node_Str" + previous,true);
  UpdateOp main=new UpdateOp(path,id,false);
  main.set(UpdateOp.PREVIOUS,previous);
  for (  Entry<String,Object> e : map.entrySet()) {
    String key=e.getKey();
    if (key.equals(UpdateOp.ID)) {
    }
 else     if (key.equals(UpdateOp.PREVIOUS)) {
    }
 else     if (key.equals(UpdateOp.WRITE_COUNT)) {
      main.set(UpdateOp.WRITE_COUNT,e.getValue());
    }
 else {
      @SuppressWarnings("String_Node_Str") Map<String,Object> valueMap=(Map<String,Object>)e.getValue();
      Revision latestRev=null;
      for (      String r : valueMap.keySet()) {
        Revision propRev=Revision.fromString(r);
        if (latestRev == null || mk.isRevisionNewer(propRev,latestRev)) {
          latestRev=propRev;
        }
      }
      for (      String r : valueMap.keySet()) {
        Revision propRev=Revision.fromString(r);
        Object v=valueMap.get(r);
        if (propRev.equals(latestRev)) {
          main.setMapEntry(key + "String_Node_Str" + propRev.toString(),v);
        }
 else {
          old.addMapEntry(key + "String_Node_Str" + propRev.toString(),v);
        }
      }
    }
  }
  if (PURGE_OLD_REVISIONS) {
    old=null;
  }
  return new UpdateOp[]{old,main};
}

Fixed version (ground truth):
private UpdateOp[] splitDocument(Map<String,Object> map){
  String id=(String)map.get(UpdateOp.ID);
  String path=Utils.getPathFromId(id);
  Long previous=(Long)map.get(UpdateOp.PREVIOUS);
  if (previous == null) {
    previous=0L;
  }
 else {
    previous++;
  }
  UpdateOp old=new UpdateOp(path,id + "String_Node_Str" + previous,true);
  UpdateOp main=new UpdateOp(path,id,false);
  main.set(UpdateOp.PREVIOUS,previous);
  for (  Entry<String,Object> e : map.entrySet()) {
    String key=e.getKey();
    if (key.equals(UpdateOp.ID)) {
    }
 else     if (key.equals(UpdateOp.PREVIOUS)) {
    }
 else     if (key.equals(UpdateOp.WRITE_COUNT)) {
      main.set(UpdateOp.WRITE_COUNT,e.getValue());
    }
 else {
      @SuppressWarnings("String_Node_Str") Map<String,Object> valueMap=(Map<String,Object>)e.getValue();
      Revision latestRev=null;
      for (      String r : valueMap.keySet()) {
        Revision propRev=Revision.fromString(r);
        if (latestRev == null || mk.isRevisionNewer(propRev,latestRev)) {
          latestRev=propRev;
        }
      }
      for (      String r : valueMap.keySet()) {
        Revision propRev=Revision.fromString(r);
        Object v=valueMap.get(r);
        if (propRev.equals(latestRev)) {
          main.setMapEntry(key + "String_Node_Str" + propRev.toString(),v);
        }
 else {
          old.addMapEntry(key + "String_Node_Str" + propRev.toString(),v);
        }
      }
    }
  }
  if (PURGE_OLD_REVISIONS) {
    old=null;
  }
  return new UpdateOp[]{old,main};
}
Program: 9034
Project: 9034
Buggy source:
@Override public Map<String,Object> find(Collection collection,String path){
  Map<String,Object> result;
synchronized (cache) {
    result=cache.get(path);
  }
  if (result != null) {
    return result;
  }
  log("String_Node_Str",path);
  DBCollection dbCollection=getDBCollection(collection);
  long start=start();
  try {
    DBObject doc=dbCollection.findOne(getByPathQuery(path));
    if (doc == null) {
      return null;
    }
    result=convertFromDBObject(doc);
synchronized (cache) {
      cache.put(path,result);
    }
    return result;
  }
  finally {
    end(start);
  }
}

Fixed version (ground truth):
@Override public Map<String,Object> find(Collection collection,String path){
synchronized (cache) {
    if (cache.containsKey(path)) {
      return cache.get(path);
    }
  }
  log("String_Node_Str",path);
  DBCollection dbCollection=getDBCollection(collection);
  long start=start();
  try {
    DBObject doc=dbCollection.findOne(getByPathQuery(path));
    Map<String,Object> result;
    if (doc == null) {
      result=null;
    }
 else {
      result=convertFromDBObject(doc);
    }
synchronized (cache) {
      cache.put(path,result);
    }
    return result;
  }
  finally {
    end(start);
  }
}
Program: 9035
Project: 9035
Buggy source:
public Node.Children readChildren(String path,String nodeId,Revision rev,int limit){
  Node.Children c;
  c=nodeChildrenCache.get(nodeId);
  if (c != null) {
    return c;
  }
  String from=PathUtils.concat(path,"String_Node_Str");
  from=Node.convertPathToDocumentId(from);
  from=from.substring(0,from.length() - 1);
  String to=PathUtils.concat(path,"String_Node_Str");
  to=Node.convertPathToDocumentId(to);
  to=to.substring(0,to.length() - 2) + "String_Node_Str";
  List<Map<String,Object>> list=store.query(DocumentStore.Collection.NODES,from,to,limit);
  c=new Node.Children(path,nodeId,rev);
  for (  Map<String,Object> e : list) {
    if (isDeleted(e,rev)) {
      continue;
    }
    String id=e.get(UpdateOp.ID).toString();
    String p=id.substring(2);
    c.children.add(p);
  }
  nodeChildrenCache.put(nodeId,c);
  return c;
}

Fixed version (ground truth):
public Node.Children readChildren(String path,String nodeId,Revision rev,int limit){
  Node.Children c;
  c=nodeChildrenCache.get(nodeId);
  if (c != null) {
    return c;
  }
  String from=PathUtils.concat(path,"String_Node_Str");
  from=Utils.getIdFromPath(from);
  from=from.substring(0,from.length() - 1);
  String to=PathUtils.concat(path,"String_Node_Str");
  to=Utils.getIdFromPath(to);
  to=to.substring(0,to.length() - 2) + "String_Node_Str";
  List<Map<String,Object>> list=store.query(DocumentStore.Collection.NODES,from,to,limit);
  c=new Node.Children(path,nodeId,rev);
  for (  Map<String,Object> e : list) {
    if (isDeleted(e,rev)) {
      continue;
    }
    String id=e.get(UpdateOp.ID).toString();
    String p=Utils.getPathFromId(id);
    c.children.add(p);
  }
  nodeChildrenCache.put(nodeId,c);
  return c;
}
Program: 9036
Project: 9036
Buggy source:
private void markAsDeleted(String path,Commit commit,boolean subTreeAlso){
  Revision rev=commit.getRevision();
  commit.removeNode(path);
  if (subTreeAlso) {
    Node n=getNode(path,rev);
    nodeCache.remove(path + "String_Node_Str" + rev);
    Node.Children c=readChildren(path,n.getId(),rev,Integer.MAX_VALUE);
    for (    String childPath : c.children) {
      markAsDeleted(childPath,commit,true);
    }
  }
  nodeCache.remove(path + "String_Node_Str" + rev);
}

Fixed version (ground truth):
private void markAsDeleted(String path,Commit commit,boolean subTreeAlso){
  Revision rev=commit.getRevision();
  commit.removeNode(path);
  if (subTreeAlso) {
    Node n=getNode(path,rev);
    nodeCache.remove(path + "String_Node_Str" + rev);
    if (n != null) {
      Node.Children c=readChildren(path,n.getId(),rev,Integer.MAX_VALUE);
      for (      String childPath : c.children) {
        markAsDeleted(childPath,commit,true);
      }
    }
  }
  nodeCache.remove(path + "String_Node_Str" + rev);
}
Program: 9037
Project: 9037
Buggy source:
private Node readNode(String path,Revision rev){
  String id=Node.convertPathToDocumentId(path);
  Map<String,Object> map=store.find(DocumentStore.Collection.NODES,id);
  if (map == null) {
    return null;
  }
  if (isDeleted(map,rev)) {
    return null;
  }
  Node n=new Node(path,rev);
  Long w=writeCountIncrements.get(path);
  long writeCount=w == null ? 0 : w;
  for (  String key : map.keySet()) {
    if (key.equals(UpdateOp.WRITE_COUNT)) {
      writeCount+=(Long)map.get(key);
    }
    if (!Utils.isPropertyName(key)) {
      continue;
    }
    Object v=map.get(key);
    @SuppressWarnings("String_Node_Str") Map<String,String> valueMap=(Map<String,String>)v;
    if (valueMap != null) {
      String value=getLatestValue(valueMap,rev);
      String propertyName=Utils.unescapePropertyName(key);
      n.setProperty(propertyName,value);
    }
  }
  n.setWriteCount(writeCount);
  return n;
}

Fixed version (ground truth):
private Node readNode(String path,Revision rev){
  String id=Utils.getIdFromPath(path);
  Map<String,Object> map=store.find(DocumentStore.Collection.NODES,id);
  if (map == null) {
    return null;
  }
  if (isDeleted(map,rev)) {
    return null;
  }
  Node n=new Node(path,rev);
  Long w=writeCountIncrements.get(path);
  long writeCount=w == null ? 0 : w;
  for (  String key : map.keySet()) {
    if (key.equals(UpdateOp.WRITE_COUNT)) {
      writeCount+=(Long)map.get(key);
    }
    if (!Utils.isPropertyName(key)) {
      continue;
    }
    Object v=map.get(key);
    @SuppressWarnings("String_Node_Str") Map<String,String> valueMap=(Map<String,String>)v;
    if (valueMap != null) {
      String value=getLatestValue(valueMap,rev);
      String propertyName=Utils.unescapePropertyName(key);
      n.setProperty(propertyName,value);
    }
  }
  n.setWriteCount(writeCount);
  return n;
}
Program: 9038
Project: 9038
Buggy source:
/** 
 * Create an add node operation for this node.
 */
UpdateOp asOperation(boolean isNew){
  String id=convertPathToDocumentId(path);
  UpdateOp op=new UpdateOp(path,id,isNew);
  op.set(UpdateOp.ID,id);
  for (  String p : properties.keySet()) {
    String key=Utils.escapePropertyName(p);
    op.addMapEntry(key + "String_Node_Str" + rev.toString(),properties.get(p));
  }
  return op;
}

Fixed version (ground truth):
/** 
 * Create an add node operation for this node.
 */
UpdateOp asOperation(boolean isNew){
  String id=Utils.getIdFromPath(path);
  UpdateOp op=new UpdateOp(path,id,isNew);
  op.set(UpdateOp.ID,id);
  for (  String p : properties.keySet()) {
    String key=Utils.escapePropertyName(p);
    op.addMapEntry(key + "String_Node_Str" + rev.toString(),properties.get(p));
  }
  return op;
}
Program: 9039
Project: 9039
Buggy source:
static int pathDepth(String path){
  return path.equals("String_Node_Str") ? 0 : path.replaceAll("String_Node_Str","String_Node_Str").length();
}

Fixed version (ground truth):
static int pathDepth(String path){
  if (path.equals("String_Node_Str")) {
    return 0;
  }
  int depth=0;
  for (int i=0; i < path.length(); i++) {
    if (path.charAt(i) == '/') {
      depth++;
    }
  }
  return depth;
}
Program: 9041
Project: 9041
Buggy source:
protected boolean removeEldestEntry(Map.Entry<K,V> eldest){
  return size() > size;
}

Fixed version (ground truth):
protected synchronized boolean removeEldestEntry(Map.Entry<K,V> eldest){
  boolean remove=size() > size;
  if (remove) {
    Object k=eldest.getKey();
    if (k != null) {
      keySet.remove(k);
    }
  }
  return remove;
}
Program: 9042
Project: 9042
Buggy source:
public void applyChanges(Revision rev,String path,boolean isNew,boolean isDelete,boolean isWritten,long oldWriteCount,long writeCountInc,ArrayList<String> added,ArrayList<String> removed){
  if (!isWritten) {
    if (writeCountInc == 0) {
      writeCountIncrements.remove(path);
    }
 else {
      writeCountIncrements.put(path,writeCountInc);
    }
  }
 else {
    writeCountIncrements.remove(path);
  }
  long newWriteCount=oldWriteCount + writeCountInc;
  Children c=nodeChildrenCache.get(path + "String_Node_Str" + (newWriteCount - 1));
  if (isNew || (!isDelete && c != null)) {
    String id=path + "String_Node_Str" + newWriteCount;
    Children c2=new Children(path,id,rev);
    TreeSet<String> set=new TreeSet<String>();
    if (c != null) {
      set.addAll(c.children);
    }
    set.removeAll(removed);
    set.addAll(added);
    c2.children.addAll(set);
    if (nodeChildrenCache.get(id) != null) {
      throw new AssertionError("String_Node_Str");
    }
    nodeChildrenCache.put(id,c2);
  }
}

Fixed version (ground truth):
public void applyChanges(Revision rev,String path,boolean isNew,boolean isDelete,boolean isWritten,long oldWriteCount,long writeCountInc,ArrayList<String> added,ArrayList<String> removed){
  if (!isWritten) {
    if (writeCountInc == 0) {
      writeCountIncrements.remove(path);
    }
 else {
      writeCountIncrements.put(path,writeCountInc);
    }
  }
 else {
    writeCountIncrements.remove(path);
  }
  long newWriteCount=oldWriteCount + writeCountInc;
  Children c=nodeChildrenCache.get(path + "String_Node_Str" + (newWriteCount - 1));
  if (isNew || (!isDelete && c != null)) {
    String id=path + "String_Node_Str" + newWriteCount;
    Children c2=new Children(path,id,rev);
    TreeSet<String> set=new TreeSet<String>();
    if (c != null) {
      set.addAll(c.children);
    }
    set.removeAll(removed);
    set.addAll(added);
    c2.children.addAll(set);
    if (nodeChildrenCache.get(id) != null) {
      MicroKernelException e=new MicroKernelException("String_Node_Str" + id);
      LOG.error("String_Node_Str",e);
    }
    nodeChildrenCache.put(id,c2);
  }
}
Program: 9043
Project: 9043
Buggy source:
void addNode(Node n){
  if (operations.containsKey(n.path)) {
    throw new MicroKernelException("String_Node_Str" + n.path);
  }
  operations.put(n.path,n.asOperation(true));
  addedNodes.add(n.path);
}

Fixed version (ground truth):
void addNode(Node n){
  if (operations.containsKey(n.path)) {
    String msg="String_Node_Str" + n.path;
    LOG.error(msg);
    throw new MicroKernelException(msg);
  }
  operations.put(n.path,n.asOperation(true));
  addedNodes.add(n.path);
}
Program: 9046
Project: 9046
Buggy source:
private UpdateOp[] splitDocument(Map<String,Object> map){
  String path=(String)map.get(UpdateOp.PATH);
  String id=(String)map.get(UpdateOp.ID);
  Long previous=(Long)map.get(UpdateOp.PREVIOUS);
  if (previous == null) {
    previous=0L;
  }
 else {
    previous++;
  }
  UpdateOp old=new UpdateOp(path,id + "String_Node_Str" + previous,true);
  UpdateOp main=new UpdateOp(path,id,false);
  main.set(UpdateOp.PREVIOUS,previous);
  for (  Entry<String,Object> e : map.entrySet()) {
    String key=e.getKey();
    if (key.equals(UpdateOp.PATH)) {
    }
 else     if (key.equals(UpdateOp.ID)) {
    }
 else     if (key.equals(UpdateOp.PREVIOUS)) {
    }
 else     if (key.equals(UpdateOp.WRITE_COUNT)) {
      main.set(UpdateOp.WRITE_COUNT,e.getValue());
    }
 else {
      @SuppressWarnings("String_Node_Str") Map<String,Object> valueMap=(Map<String,Object>)e.getValue();
      Revision latestRev=null;
      for (      String r : valueMap.keySet()) {
        Revision propRev=Revision.fromString(r);
        if (latestRev == null || mk.isRevisionNewer(propRev,latestRev)) {
          latestRev=propRev;
        }
      }
      for (      String r : valueMap.keySet()) {
        Revision propRev=Revision.fromString(r);
        Object v=valueMap.get(r);
        if (propRev.equals(latestRev)) {
          main.setMapEntry(key + "String_Node_Str" + propRev.toString(),v);
        }
 else {
          old.addMapEntry(key + "String_Node_Str" + propRev.toString(),v);
        }
      }
    }
  }
  if (PURGE_OLD_REVISIONS) {
    old=null;
  }
  return new UpdateOp[]{old,main};
}

Fixed version (ground truth):
private UpdateOp[] splitDocument(Map<String,Object> map){
  String id=(String)map.get(UpdateOp.ID);
  String path=id.substring(1);
  Long previous=(Long)map.get(UpdateOp.PREVIOUS);
  if (previous == null) {
    previous=0L;
  }
 else {
    previous++;
  }
  UpdateOp old=new UpdateOp(path,id + "String_Node_Str" + previous,true);
  UpdateOp main=new UpdateOp(path,id,false);
  main.set(UpdateOp.PREVIOUS,previous);
  for (  Entry<String,Object> e : map.entrySet()) {
    String key=e.getKey();
    if (key.equals(UpdateOp.ID)) {
    }
 else     if (key.equals(UpdateOp.PREVIOUS)) {
    }
 else     if (key.equals(UpdateOp.WRITE_COUNT)) {
      main.set(UpdateOp.WRITE_COUNT,e.getValue());
    }
 else {
      @SuppressWarnings("String_Node_Str") Map<String,Object> valueMap=(Map<String,Object>)e.getValue();
      Revision latestRev=null;
      for (      String r : valueMap.keySet()) {
        Revision propRev=Revision.fromString(r);
        if (latestRev == null || mk.isRevisionNewer(propRev,latestRev)) {
          latestRev=propRev;
        }
      }
      for (      String r : valueMap.keySet()) {
        Revision propRev=Revision.fromString(r);
        Object v=valueMap.get(r);
        if (propRev.equals(latestRev)) {
          main.setMapEntry(key + "String_Node_Str" + propRev.toString(),v);
        }
 else {
          old.addMapEntry(key + "String_Node_Str" + propRev.toString(),v);
        }
      }
    }
  }
  if (PURGE_OLD_REVISIONS) {
    old=null;
  }
  return new UpdateOp[]{old,main};
}
Program: 9047
Project: 9047
Buggy source:
public void removeNode(String path){
  removedNodes.add(path);
  UpdateOp op=getUpdateOperationForNode(path);
  op.addMapEntry(UpdateOp.DELETED + "String_Node_Str" + revision.toString(),"String_Node_Str");
  long increment=mk.getWriteCountIncrement(path);
  op.increment(UpdateOp.WRITE_COUNT,1 + increment);
}

Fixed version (ground truth):
public void removeNode(String path){
  removedNodes.add(path);
  UpdateOp op=getUpdateOperationForNode(path);
  op.setDelete(true);
  op.addMapEntry(UpdateOp.DELETED + "String_Node_Str" + revision.toString(),"String_Node_Str");
  long increment=mk.getWriteCountIncrement(path);
  op.increment(UpdateOp.WRITE_COUNT,1 + increment);
}
Program: 9048
Project: 9048
Buggy source:
void create(Collection collection,List<UpdateOp> updateOps);

Fixed version (ground truth):
/** 
 * Try to create a list of documents.
 * @param collection the collection
 * @param updateOps the list of documents to add
 * @return true if this worked (if none of the documents already existed)
 */
boolean create(Collection collection,List<UpdateOp> updateOps);
Program: 9049
Project: 9049
Buggy source:
@Override public void create(Collection collection,List<UpdateOp> updateOps){
  for (  UpdateOp op : updateOps) {
    createOrUpdate(collection,op);
  }
}

Fixed version (ground truth):
@Override public boolean create(Collection collection,List<UpdateOp> updateOps){
  ConcurrentSkipListMap<String,Map<String,Object>> map=getMap(collection);
  for (  UpdateOp op : updateOps) {
    if (map.containsKey(op.key)) {
      return false;
    }
  }
  for (  UpdateOp op : updateOps) {
    createOrUpdate(collection,op);
  }
  return true;
}
Program: 9050
Project: 9050
Buggy source:
private static void log(Object... args){
  if (LOG) {
    String msg=Arrays.toString(args);
    if (msg.length() > 10000) {
      msg=msg.length() + "String_Node_Str" + msg;
    }
    System.out.println(msg);
  }
}

Fixed version (ground truth):
private static void log(String message,Object... args){
  if (LOG.isDebugEnabled()) {
    String argList=Arrays.toString(args);
    if (argList.length() > 10000) {
      argList=argList.length() + "String_Node_Str" + argList;
    }
    LOG.debug(message + argList);
  }
}
Program: 9051
Project: 9051
Buggy source:
@Override public void create(Collection collection,List<UpdateOp> updateOps){
  log("String_Node_Str",updateOps);
  ArrayList<Map<String,Object>> maps=new ArrayList<Map<String,Object>>();
  DBObject[] inserts=new DBObject[updateOps.size()];
  for (int i=0; i < updateOps.size(); i++) {
    inserts[i]=new BasicDBObject();
    UpdateOp update=updateOps.get(i);
    Map<String,Object> target=Utils.newMap();
    MemoryDocumentStore.applyChanges(target,update);
    maps.add(target);
    for (    Entry<String,Operation> entry : update.changes.entrySet()) {
      String k=entry.getKey();
      Operation op=entry.getValue();
switch (op.type) {
case SET:
{
          inserts[i].put(k,op.value);
          break;
        }
case INCREMENT:
{
        inserts[i].put(k,op.value);
        break;
      }
case SET_MAP_ENTRY:
case ADD_MAP_ENTRY:
{
      String[] kv=k.split("String_Node_Str");
      DBObject value=new BasicDBObject(kv[1],op.value.toString());
      inserts[i].put(kv[0],value);
      break;
    }
case REMOVE_MAP_ENTRY:
{
  }
}
}
}
DBCollection dbCollection=getDBCollection(collection);
long start=start();
try {
try {
WriteResult writeResult=dbCollection.insert(inserts,WriteConcern.SAFE);
if (writeResult.getError() != null) {
throw new MicroKernelException("String_Node_Str" + writeResult.getError());
}
synchronized (cache) {
for (Map<String,Object> map : maps) {
  String path=(String)map.get(UpdateOp.ID);
synchronized (cache) {
    cache.put(path,map);
  }
}
}
}
 catch (MongoException e) {
throw new MicroKernelException("String_Node_Str",e);
}
}
  finally {
end(start);
}
}

Fixed version (ground truth):
@Override public boolean create(Collection collection,List<UpdateOp> updateOps){
  log("String_Node_Str",updateOps);
  ArrayList<Map<String,Object>> maps=new ArrayList<Map<String,Object>>();
  DBObject[] inserts=new DBObject[updateOps.size()];
  for (int i=0; i < updateOps.size(); i++) {
    inserts[i]=new BasicDBObject();
    UpdateOp update=updateOps.get(i);
    Map<String,Object> target=Utils.newMap();
    MemoryDocumentStore.applyChanges(target,update);
    maps.add(target);
    for (    Entry<String,Operation> entry : update.changes.entrySet()) {
      String k=entry.getKey();
      Operation op=entry.getValue();
switch (op.type) {
case SET:
{
          inserts[i].put(k,op.value);
          break;
        }
case INCREMENT:
{
        inserts[i].put(k,op.value);
        break;
      }
case SET_MAP_ENTRY:
case ADD_MAP_ENTRY:
{
      String[] kv=k.split("String_Node_Str");
      DBObject value=new BasicDBObject(kv[1],op.value.toString());
      inserts[i].put(kv[0],value);
      break;
    }
case REMOVE_MAP_ENTRY:
{
  }
}
}
}
DBCollection dbCollection=getDBCollection(collection);
long start=start();
try {
try {
WriteResult writeResult=dbCollection.insert(inserts,WriteConcern.SAFE);
if (writeResult.getError() != null) {
return false;
}
synchronized (cache) {
for (Map<String,Object> map : maps) {
  String path=(String)map.get(UpdateOp.ID);
synchronized (cache) {
    cache.put(path,map);
  }
}
}
return true;
}
 catch (MongoException e) {
return false;
}
}
  finally {
end(start);
}
}
Program: 9052
Project: 9052
Buggy source:
@Override public void dispose(){
  if (LOG_TIME) {
    System.out.println("String_Node_Str" + time);
  }
  nodesCollection.getDB().getMongo().close();
}

Fixed version (ground truth):
@Override public void dispose(){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + time);
  }
  nodesCollection.getDB().getMongo().close();
}
Program: 9053
Project: 9053
Buggy source:
private boolean isDeleted(Map<String,Object> nodeProps,Revision rev){
  @SuppressWarnings("String_Node_Str") Map<String,String> valueMap=(Map<String,String>)nodeProps.get(UpdateOp.DELETED);
  if (valueMap != null) {
    for (    Map.Entry<String,String> e : valueMap.entrySet()) {
      Revision propRev=Revision.fromString(e.getKey());
      if (includeRevision(propRev,rev)) {
        if ("String_Node_Str".equals(e.getValue())) {
          return true;
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isDeleted(Map<String,Object> nodeProps,Revision rev){
  @SuppressWarnings("String_Node_Str") Map<String,String> valueMap=(Map<String,String>)nodeProps.get(UpdateOp.DELETED);
  if (valueMap != null) {
    String value=getLatestValue(valueMap,rev);
    if ("String_Node_Str".equals(value)) {
      return true;
    }
  }
  return false;
}
Program: 9054
Project: 9054
Buggy source:
public void applyChanges(Revision rev,String path,boolean isNew,boolean isWritten,long oldWriteCount,long writeCountInc,ArrayList<String> added,ArrayList<String> removed){
  if (!isWritten) {
    if (writeCountInc == 0) {
      writeCountIncrements.remove(path);
    }
 else {
      writeCountIncrements.put(path,writeCountInc);
    }
  }
 else {
    writeCountIncrements.remove(path);
  }
  long newWriteCount=oldWriteCount + writeCountInc;
  Children c=nodeChildrenCache.get(path + "String_Node_Str" + (newWriteCount - 1));
  if (isNew || c != null) {
    String id=path + "String_Node_Str" + newWriteCount;
    Children c2=new Children(path,id,rev);
    TreeSet<String> set=new TreeSet<String>();
    if (c != null) {
      set.addAll(c.children);
    }
    set.removeAll(removed);
    set.addAll(added);
    c2.children.addAll(set);
    if (nodeChildrenCache.get(id) != null) {
      throw new AssertionError("String_Node_Str");
    }
    nodeChildrenCache.put(id,c2);
  }
}

Fixed version (ground truth):
public void applyChanges(Revision rev,String path,boolean isNew,boolean isDelete,boolean isWritten,long oldWriteCount,long writeCountInc,ArrayList<String> added,ArrayList<String> removed){
  if (!isWritten) {
    if (writeCountInc == 0) {
      writeCountIncrements.remove(path);
    }
 else {
      writeCountIncrements.put(path,writeCountInc);
    }
  }
 else {
    writeCountIncrements.remove(path);
  }
  long newWriteCount=oldWriteCount + writeCountInc;
  Children c=nodeChildrenCache.get(path + "String_Node_Str" + (newWriteCount - 1));
  if (isNew || (!isDelete && c != null)) {
    String id=path + "String_Node_Str" + newWriteCount;
    Children c2=new Children(path,id,rev);
    TreeSet<String> set=new TreeSet<String>();
    if (c != null) {
      set.addAll(c.children);
    }
    set.removeAll(removed);
    set.addAll(added);
    c2.children.addAll(set);
    if (nodeChildrenCache.get(id) != null) {
      throw new AssertionError("String_Node_Str");
    }
    nodeChildrenCache.put(id,c2);
  }
}