Program: 9020
Project: 9020
Buggy source:
@Nonnull @Override public Map<String,Object> createOrUpdate(Collection collection,UpdateOp updateOp){
  log("String_Node_Str",updateOp);
  DBCollection dbCollection=getDBCollection(collection);
  BasicDBObject setUpdates=new BasicDBObject();
  BasicDBObject incUpdates=new BasicDBObject();
  BasicDBObject unsetUpdates=new BasicDBObject();
  for (  Entry<String,Operation> entry : updateOp.changes.entrySet()) {
    String k=entry.getKey();
    Operation op=entry.getValue();
switch (op.type) {
case SET:
{
        setUpdates.append(k,op.value);
        break;
      }
case INCREMENT:
{
      incUpdates.append(k,op.value);
      break;
    }
case ADD_MAP_ENTRY:
{
    setUpdates.append(k,op.value);
    break;
  }
case REMOVE_MAP_ENTRY:
{
  unsetUpdates.append(k,"String_Node_Str");
  break;
}
case SET_MAP_ENTRY:
{
String[] kv=k.split("String_Node_Str");
BasicDBObject sub=new BasicDBObject();
sub.put(kv[1],op.value);
setUpdates.append(kv[0],sub);
break;
}
}
}
DBObject query=getByPathQuery(updateOp.key);
BasicDBObject update=new BasicDBObject();
if (!setUpdates.isEmpty()) {
update.append("String_Node_Str",setUpdates);
}
if (!incUpdates.isEmpty()) {
update.append("String_Node_Str",incUpdates);
}
if (!unsetUpdates.isEmpty()) {
update.append("String_Node_Str",unsetUpdates);
}
long start=start();
try {
DBObject oldNode=dbCollection.findAndModify(query,null,null,false,update,false,true);
Map<String,Object> map=convertFromDBObject(oldNode);
Map<String,Object> newMap=Utils.newMap();
Utils.deepCopyMap(map,newMap);
String key=updateOp.getKey();
MemoryDocumentStore.applyChanges(newMap,updateOp);
cache.put(key,newMap);
log("String_Node_Str",map);
return map;
}
 catch (Exception e) {
throw new MicroKernelException(e);
}
 finally {
end(start);
}
}

Fixed version (ground truth):
@Nonnull @Override public Map<String,Object> createOrUpdate(Collection collection,UpdateOp updateOp){
  log("String_Node_Str",updateOp);
  DBCollection dbCollection=getDBCollection(collection);
  BasicDBObject setUpdates=new BasicDBObject();
  BasicDBObject incUpdates=new BasicDBObject();
  BasicDBObject unsetUpdates=new BasicDBObject();
  for (  Entry<String,Operation> entry : updateOp.changes.entrySet()) {
    String k=entry.getKey();
    if (k.equals(UpdateOp.ID)) {
      continue;
    }
    Operation op=entry.getValue();
switch (op.type) {
case SET:
{
        setUpdates.append(k,op.value);
        break;
      }
case INCREMENT:
{
      incUpdates.append(k,op.value);
      break;
    }
case ADD_MAP_ENTRY:
{
    setUpdates.append(k,op.value);
    break;
  }
case REMOVE_MAP_ENTRY:
{
  unsetUpdates.append(k,"String_Node_Str");
  break;
}
case SET_MAP_ENTRY:
{
String[] kv=k.split("String_Node_Str");
BasicDBObject sub=new BasicDBObject();
sub.put(kv[1],op.value);
setUpdates.append(kv[0],sub);
break;
}
}
}
DBObject query=getByPathQuery(updateOp.key);
BasicDBObject update=new BasicDBObject();
if (!setUpdates.isEmpty()) {
update.append("String_Node_Str",setUpdates);
}
if (!incUpdates.isEmpty()) {
update.append("String_Node_Str",incUpdates);
}
if (!unsetUpdates.isEmpty()) {
update.append("String_Node_Str",unsetUpdates);
}
long start=start();
try {
DBObject oldNode=dbCollection.findAndModify(query,null,null,false,update,false,true);
Map<String,Object> map=convertFromDBObject(oldNode);
Map<String,Object> newMap=Utils.newMap();
Utils.deepCopyMap(map,newMap);
String key=updateOp.getKey();
MemoryDocumentStore.applyChanges(newMap,updateOp);
cache.put(key,newMap);
log("String_Node_Str",map);
return map;
}
 catch (Exception e) {
throw new MicroKernelException(e);
}
 finally {
end(start);
}
}