Program: 8993
Project: 8993
Buggy source:
@CheckForNull private <T extends Document>void internalUpdate(Collection<T> collection,List<String> ids,UpdateOp update){
  if (isAppendableUpdate(update) && !requiresPreviousState(update)) {
    long modified=getModifiedFromUpdate(update);
    String appendData=SR.asString(update);
    for (    List<String> chunkedIds : Lists.partition(ids,CHUNKSIZE)) {
      Map<String,NodeDocument> cachedDocs=Collections.emptyMap();
      if (collection == Collection.NODES) {
        cachedDocs=new HashMap<String,NodeDocument>();
        for (        String key : chunkedIds) {
          cachedDocs.put(key,nodesCache.getIfPresent(new StringValue(key)));
        }
      }
      Connection connection=null;
      String tableName=getTable(collection);
      boolean success=false;
      try {
        connection=this.ch.getRWConnection();
        success=dbBatchedAppendingUpdate(connection,tableName,chunkedIds,modified,appendData);
        connection.commit();
      }
 catch (      SQLException ex) {
        success=false;
        this.ch.rollbackConnection(connection);
      }
 finally {
        this.ch.closeConnection(connection);
      }
      if (success) {
        for (        Entry<String,NodeDocument> entry : cachedDocs.entrySet()) {
          if (entry.getValue() == null) {
            nodesCache.invalidate(new StringValue(entry.getKey()));
          }
 else {
            T oldDoc=(T)(entry.getValue());
            T newDoc=applyChanges(collection,(T)(entry.getValue()),update,true);
            applyToCache((NodeDocument)oldDoc,(NodeDocument)newDoc);
          }
        }
      }
 else {
        for (        String id : chunkedIds) {
          UpdateOp up=update.copy();
          up=up.shallowCopy(id);
          internalCreateOrUpdate(collection,up,false,true);
        }
      }
    }
  }
 else {
    for (    String id : ids) {
      UpdateOp up=update.copy();
      up=up.shallowCopy(id);
      internalCreateOrUpdate(collection,up,false,true);
    }
  }
}

Fixed version (ground truth):
@CheckForNull private <T extends Document>void internalUpdate(Collection<T> collection,List<String> ids,UpdateOp update){
  if (isAppendableUpdate(update) && !requiresPreviousState(update)) {
    long modified=getModifiedFromUpdate(update);
    String appendData=SR.asString(update);
    for (    List<String> chunkedIds : Lists.partition(ids,CHUNKSIZE)) {
      Map<String,NodeDocument> cachedDocs=Collections.emptyMap();
      if (collection == Collection.NODES) {
        cachedDocs=new HashMap<String,NodeDocument>();
        for (        String key : chunkedIds) {
          cachedDocs.put(key,nodesCache.getIfPresent(new StringValue(key)));
        }
      }
      Connection connection=null;
      String tableName=getTable(collection);
      boolean success=false;
      try {
        connection=this.ch.getRWConnection();
        success=dbBatchedAppendingUpdate(connection,tableName,chunkedIds,modified,appendData);
        connection.commit();
      }
 catch (      SQLException ex) {
        success=false;
        this.ch.rollbackConnection(connection);
      }
 finally {
        this.ch.closeConnection(connection);
      }
      if (success) {
        for (        Entry<String,NodeDocument> entry : cachedDocs.entrySet()) {
          T oldDoc=(T)(entry.getValue());
          if (oldDoc == null) {
            nodesCache.invalidate(new StringValue(entry.getKey()));
          }
 else {
            T newDoc=applyChanges(collection,oldDoc,update,true);
            if (newDoc != null) {
              applyToCache((NodeDocument)oldDoc,(NodeDocument)newDoc);
            }
          }
        }
      }
 else {
        for (        String id : chunkedIds) {
          UpdateOp up=update.copy();
          up=up.shallowCopy(id);
          internalCreateOrUpdate(collection,up,false,true);
        }
      }
    }
  }
 else {
    for (    String id : ids) {
      UpdateOp up=update.copy();
      up=up.shallowCopy(id);
      internalCreateOrUpdate(collection,up,false,true);
    }
  }
}