Examples of PatchConfiguration


Examples of org.eclipse.compare.patch.PatchConfiguration

   * @param lines the lines to be patched
   * @return whether the hunk could be applied
   */
  public boolean patch(List lines) {
    this.fMatches = false;
    PatchConfiguration configuration = getConfiguration();
    // if the fuzz is not set for the current hunk use the one from fDiffResult
    int fuzz = this.fFuzz != -1 ? this.fFuzz : configuration.getFuzz();
    if (isEnabled(configuration)) {
      if (this.fHunk.tryPatch(configuration, lines, this.fShift, fuzz)) {
        // it's a perfect match, no shifting is needed
        this.fShift += this.fHunk.doPatch(configuration, lines, this.fShift, fuzz);
        this.fMatches = true;
View Full Code Here

Examples of org.eclipse.compare.patch.PatchConfiguration

   *            a progress monitor
   * @return the fuzz factor or -1 if the hunk could not be matched
   */
  public int calculateFuzz(List lines, IProgressMonitor monitor) {
    this.fMatches = false;
    PatchConfiguration configuration = getConfiguration();
    int fuzz = 0;
    int maxFuzz = configuration.getFuzz() == -1 ? MAXIMUM_FUZZ_FACTOR
        : configuration.getFuzz();
    for (; fuzz <= maxFuzz; fuzz++) {
      // try to apply using lines coordinates from the patch
      if (this.fHunk.tryPatch(configuration, lines, this.fShift, fuzz)) {
        // it's a perfect match, no adjustment is needed
        this.fShift += this.fHunk.doPatch(configuration, lines, this.fShift, fuzz);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.