Returns an UndoManager with an unlimited history that can undo/redo {@link PlainTextChange}s. New changes
emitted from the stream will not be merged with the previous change
after {@link #DEFAULT_PREVENT_MERGE_DELAY}
341509
public static <PS, SEG, S> UndoManager<List<PlainTextChange>> plainTextUndoManager(
            GenericStyledArea<PS, SEG, S> area) {
        return plainTextUndoManager(area, DEFAULT_PREVENT_MERGE_DELAY);
    }
786222
public DTMIterator cloneWithReset() throws CloneNotSupportedException
  {

    OneStepIterator clone = (OneStepIterator) super.cloneWithReset();
    clone.m_iterator = m_iterator;

    return clone;
  }
998459
protected CmsSitemapChange getChangeForEdit(
        CmsClientSitemapEntry entry,
        List<CmsPropertyModification> propertyChanges) {

        CmsSitemapChange change = new CmsSitemapChange(entry.getId(), entry.getSitePath(), ChangeType.modify);
        change.setDefaultFileId(entry.getDefaultFileId());
        change.setLeafType(entry.isLeafType());
        List<CmsPropertyModification> propertyChangeData = new ArrayList<CmsPropertyModification>();
        for (CmsPropertyModification propChange : propertyChanges) {
            propertyChangeData.add(propChange);
        }
        change.setPropertyChanges(propertyChangeData);

        CmsSitemapClipboardData data = getData().getClipboardData().copy();
        data.addModified(entry);
        change.setClipBoardData(data);
        return change;
    }
260884
public PlainDate getGregorianCutOverDate() {

        long start = this.events.get(this.events.size() - 1).start;

        if (start == Long.MIN_VALUE) {
            throw new UnsupportedOperationException("Proleptic history without any gregorian reform date.");
        }

        return PlainDate.of(start, EpochDays.MODIFIED_JULIAN_DATE);

    }
431753
@Override
    public java.util.concurrent.Future<ChangeMessageVisibilityBatchResult> changeMessageVisibilityBatchAsync(String queueUrl,
            java.util.List<ChangeMessageVisibilityBatchRequestEntry> entries,
            com.amazonaws.handlers.AsyncHandler<ChangeMessageVisibilityBatchRequest, ChangeMessageVisibilityBatchResult> asyncHandler) {

        return changeMessageVisibilityBatchAsync(new ChangeMessageVisibilityBatchRequest().withQueueUrl(queueUrl).withEntries(entries), asyncHandler);
    }
574246
function() {
    this.commit();
    if (this.redoHistory.length) {
      // The inverse of undo, basically.
      var item = this.redoHistory.pop();
      this.addUndoLevel(this.updateTo(item, "applyChain"));
      this.notifyEnvironment();
      return this.chainNode(item);
    }
  }
410906
public static <PS, SEG, S> UndoManager<List<RichTextChange<PS, SEG, S>>> richTextUndoManager(
            GenericStyledArea<PS, SEG, S> area, UndoManagerFactory factory) {
        return richTextUndoManager(area, factory, DEFAULT_PREVENT_MERGE_DELAY);
    }
612708
function(self) {
  if (self.resumeToken) {
    self.options.resumeAfter = self.resumeToken;
  }

  var changeStreamCursor = buildChangeStreamAggregationCommand(self);

  /**
   * Fired for each new matching change in the specified namespace. Attaching a `change`
   * event listener to a Change Stream will switch the stream into flowing mode. Data will
   * then be passed as soon as it is available.
   *
   * @event ChangeStream#change
   * @type {object}
   */
  if (self.listenerCount('change') > 0) {
    changeStreamCursor.on('data', function(change) {
      processNewChange({ changeStream: self, change, eventEmitter: true });
    });
  }

  /**
   * Change stream close event
   *
   * @event ChangeStream#close
   * @type {null}
   */
  changeStreamCursor.on('close', function() {
    self.emit('close');
  });

  /**
   * Change stream end event
   *
   * @event ChangeStream#end
   * @type {null}
   */
  changeStreamCursor.on('end', function() {
    self.emit('end');
  });

  /**
   * Fired when the stream encounters an error.
   *
   * @event ChangeStream#error
   * @type {Error}
   */
  changeStreamCursor.on('error', function(error) {
    processNewChange({ changeStream: self, error, eventEmitter: true });
  });

  if (self.pipeDestinations) {
    const cursorStream = changeStreamCursor.stream(self.streamOptions);
    for (let pipeDestination in self.pipeDestinations) {
      cursorStream.pipe(pipeDestination);
    }
  }

  return changeStreamCursor;
}
161595
public PoolAddHeaders withLastModified(DateTime lastModified) {
        if (lastModified == null) {
            this.lastModified = null;
        } else {
            this.lastModified = new DateTimeRfc1123(lastModified);
        }
        return this;
    }
785516
public CompactChangeEvent<DocumentT> withoutUncommittedWrites() {
    return new CompactChangeEvent<>(
        this.getOperationType(),
        this.getFullDocument(),
        this.getDocumentKey(),
        this.getUpdateDescription(),
        this.getStitchDocumentVersion(),
        this.getStitchDocumentHash(),
        false);
  }
806772
public History[] refreshHistory(int limit, int offset) throws Exception {
        BasicNameValuePair[] params = {
            new BasicNameValuePair("limit", String.valueOf(limit)),
            new BasicNameValuePair("offset", String.valueOf(offset))
        };
        return constructHistory(params);
    }
488979
protected List<ItemState> reindexSameNameSiblings(NodeData cause, ItemDataConsumer dataManager)
      throws RepositoryException
   {
      List<ItemState> changes = new ArrayList<ItemState>();

      NodeData parentNodeData = (NodeData)dataManager.getItemData(cause.getParentIdentifier());

      NodeData nextSibling =
         (NodeData)dataManager.getItemData(parentNodeData, new QPathEntry(cause.getQPath().getName(), cause.getQPath()
            .getIndex() + 1), ItemType.NODE);

      String reindexedId = null;
      // repeat till next sibling exists and it's not a caused Node (deleted or moved to) or just
      // reindexed
      while (nextSibling != null && !nextSibling.getIdentifier().equals(cause.getIdentifier())
         && !nextSibling.getIdentifier().equals(reindexedId))
      {
         QPath siblingOldPath =
            QPath.makeChildPath(nextSibling.getQPath().makeParentPath(), nextSibling.getQPath().getName(), nextSibling
               .getQPath().getIndex());

         // update with new index
         QPath siblingPath =
            QPath.makeChildPath(nextSibling.getQPath().makeParentPath(), nextSibling.getQPath().getName(), nextSibling
               .getQPath().getIndex() - 1);

         NodeData reindexed =
            new TransientNodeData(siblingPath, nextSibling.getIdentifier(), nextSibling.getPersistedVersion(),
               nextSibling.getPrimaryTypeName(), nextSibling.getMixinTypeNames(), nextSibling.getOrderNumber(),
               nextSibling.getParentIdentifier(), nextSibling.getACL());

         reindexedId = reindexed.getIdentifier();

         ItemState reindexedState = ItemState.createUpdatedState(reindexed);
         changes.add(reindexedState);

         itemsPool.reload(reindexed);

         reloadDescendants(siblingOldPath, siblingPath);

         // next...
         nextSibling =
            (NodeData)dataManager.getItemData(parentNodeData, new QPathEntry(nextSibling.getQPath().getName(),
               nextSibling.getQPath().getIndex() + 1), ItemType.NODE);
      }

      return changes;
   }
775979
public static <PS, SEG, S> Consumer<List<RichTextChange<PS, SEG, S>>> applyMultiRichTextChange(
            GenericStyledArea<PS, SEG, S> area) {
        return changeList -> {
            MultiChangeBuilder<PS, SEG, S> builder = area.createMultiChange(changeList.size());
            for (RichTextChange<PS, SEG, S> c : changeList) {
                builder.replaceAbsolutely(c.getPosition(), c.getRemovalEnd(), c.getInserted());
            }
            builder.commit();
        };
    }
389198
public static String getDiffSimple(String old, String newData) {

        StringComparator stringComparator = new StringComparator(old, newData);
        try {
            return stringComparator.getChangesFromOriginal().toString();
        } catch (IOException e) {
            LOG.warn(e.toString());
            return "";
        }
    }
1206856
function (binding) {
    var historyBinding = getHistoryBinding(binding);
    var listenerId = historyBinding.get('listenerId');
    var undoBinding = historyBinding.sub('undo');
    var redoBinding = historyBinding.sub('redo');
    return revert(binding, undoBinding, redoBinding, listenerId, 'oldValue');
  }
483313
public PersistenceManager getPersistenceManager() {
        if (persistenceManager == null) {
            try {
                persistenceManager = getPresentationManager().newPersistenceManager();
            } catch (Exception ex) {
                getPresentationManager().error(ex);
                throw new ConnectionNotFoundException();
            }
        }
        return persistenceManager;
    }
1180675
public LongStreamEx reverseSorted() {
        LongUnaryOperator inv = x -> ~x;
        return new LongStreamEx(stream().map(inv).sorted().map(inv), context);
    }