Examples of Diff


Examples of aQute.bnd.service.diff.Diff

                        reporter.error( "%s: %s; detected %s, suggested %s",
                                        info.packageName, diffMessage, info.newerVersion, info.suggestedVersion );
                    }
                }

                Diff packageDiff = info.packageDiff;

                Delta delta = packageDiff.getDelta();

                switch ( delta )
                {
                    case UNCHANGED:
                        if ( ( suggestedVersion.getMajor() != newerVersion.getMajor() )
View Full Code Here

Examples of bmsi.util.Diff

            // read Lines from
            Object[] oldContent = readLinesAndEscapeNewlines(oldStream);
            Object[] newContent = readLinesAndEscapeNewlines(newStream);

            // Calculate diff of the two files
            Diff diff = new Diff(oldContent, newContent);
            Diff.Change script = diff.diff_2(false);

            // log diff
            DiffPrint.UnifiedPrint print = new DiffPrint.UnifiedPrint(
                oldContent, newContent);
            Writer writer = new StringWriter();
View Full Code Here

Examples of com.cloudbees.diff.Diff

        // We have to cache the bytes because diff reads the stream twice.. why.. who knows.
        byte[] oData = ByteStreams.toByteArray(original);
        byte[] cData = ByteStreams.toByteArray(changed);

        Diff diff = Diff.diff(new InputStreamReader(new ByteArrayInputStream(oData), Charsets.UTF_8), new InputStreamReader(new ByteArrayInputStream(cData), Charsets.UTF_8), false);

        if (!relative.startsWith("/"))
            relative = "/" + relative;

        if (!diff.isEmpty())
        {
            String unidiff = diff.toUnifiedDiff(originalPrefix + relative, changedPrefix + relative,
                    new InputStreamReader(new ByteArrayInputStream(oData), Charsets.UTF_8),
                    new InputStreamReader(new ByteArrayInputStream(cData), Charsets.UTF_8), 3);
            unidiff = unidiff.replace("\r\n", "\n"); //Normalize lines
            unidiff = unidiff.replace("\n" + Hunk.ENDING_NEWLINE + "\n", "\n"); //We give 0 shits about this.
View Full Code Here

Examples of de.anomic.data.Diff

                if (nentry == null) {
                    nentry = entry;
                }
                if (post.containsKey("compare") && oentry != null && nentry != null) {
                    // TODO: split into paragraphs and compare them with the same diff-algo
                    final Diff diff = new Diff(
                            UTF8.String(oentry.page()),
                            UTF8.String(nentry.page()), 3);
                    prop.put("mode_versioning_diff", de.anomic.data.Diff.toHTML(new Diff[] { diff }));
                    prop.put("mode_versioning", "1");
                } else if (post.containsKey("viewold") && oentry != null) {
View Full Code Here

Examples of name.fraser.neil.plaintext.DiffMatchPatch.Diff

    assertLinesToCharsResultEquals("diff_linesToChars: More than 256.", new LinesToCharsResult(chars, "", tmpVector), dmp.diff_linesToChars(lines, ""));
  }

  public void testDiffCharsToLines() {
    // First check that Diff equality works.
    assertTrue("diff_charsToLines: Equality #1.", new Diff(EQUAL, "a").equals(new Diff(EQUAL, "a")));

    assertEquals("diff_charsToLines: Equality #2.", new Diff(EQUAL, "a"), new Diff(EQUAL, "a"));

    // Convert chars up to lines.
    LinkedList<Diff> diffs = diffList(new Diff(EQUAL, "\u0001\u0002\u0001"), new Diff(INSERT, "\u0002\u0001\u0002"));
    final ArrayList<String> tmpVector = new ArrayList<String>();
    tmpVector.add("");
    tmpVector.add("alpha\n");
    tmpVector.add("beta\n");
    dmp.diff_charsToLines(diffs, tmpVector);
    assertEquals("diff_charsToLines: Shared lines.", diffList(new Diff(EQUAL, "alpha\nbeta\nalpha\n"), new Diff(INSERT, "beta\nalpha\nbeta\n")), diffs);

    // More than 256 to reveal any 8-bit limitations.
    final int n = 300;
    tmpVector.clear();
    final StringBuilder lineList = new StringBuilder();
    final StringBuilder charList = new StringBuilder();
    for (int x = 1; x < n + 1; x++) {
      tmpVector.add(x + "\n");
      lineList.append(x + "\n");
      charList.append(String.valueOf((char) x));
    }
    assertEquals(n, tmpVector.size());
    final String lines = lineList.toString();
    final String chars = charList.toString();
    assertEquals(n, chars.length());
    tmpVector.add(0, "");
    diffs = diffList(new Diff(DELETE, chars));
    dmp.diff_charsToLines(diffs, tmpVector);
    assertEquals("diff_charsToLines: More than 256.", diffList(new Diff(DELETE, lines)), diffs);
  }
View Full Code Here

Examples of name.fraser.neil.plaintext.diff_match_patch.Diff

    // Compute the diff of expected vs. serialized, and disregard constructs that we don't
    // care about, such as whitespace deltas and differently-computed escape sequences.
    diff_match_patch dmp = new diff_match_patch();
    LinkedList<Diff> diffs = dmp.diff_main(expected, serialized);
    while (diffs.size() > 0) {
      Diff cur = diffs.removeFirst();
      switch (cur.operation) {
      case DELETE:
        if (StringUtils.isBlank(cur.text) || "amp;".equalsIgnoreCase(cur.text)) {
          continue;
        }
        if (diffs.size() == 0) {
          // End of the set: assert known failure.
          assertEquals(expected, serialized);
        }
        Diff next = diffs.removeFirst();
        if (next.operation != Operation.INSERT) {
          // Next operation isn't a paired insert: assert known failure.
          assertEquals(expected, serialized);
        }
        if (!equivalentEntities(cur.text, next.text) &&
View Full Code Here

Examples of net.javacrumbs.jsonunit.core.internal.Diff

            super(path);
            this.expected = expected;
        }

        public boolean matches(Object item) {
            Diff diff = create(expected, item, "fullJson", path, configuration);
            if (!diff.similar()) {
                differences = diff.differences();
            }
            return diff.similar();
        }
View Full Code Here

Examples of net.sourceforge.align.comparator.Diff

   * configured reference alignment (set intersection between alignment lists).
   * @param leftAlignmentList Input alignment list.
   * @return List containing selected alignments.
   */
  public List<Alignment> apply(List<Alignment> leftAlignmentList) {
    Diff diff = Comparator.compare(leftAlignmentList, rightAlignmentList);
    return diff.getCommonList()
  }
View Full Code Here

Examples of net.sourceforge.processdash.util.Diff

    /** Count up all the differences between the files. */
    protected void performCount() {

        // Compute the differences between the two files.
        setIgnoreComments(true);
        Diff diff = new Diff(linesA, linesB);
        Diff.change change = diff.diff_2(false);

        // Begin by counting Base LOC and Total LOC
        int signifDeleted, signifAdded;
        base  = countSignificantLines(filter, linesA, 0, linesA.length);
        total = countSignificantLines(filter, linesB, 0, linesB.length);
View Full Code Here

Examples of org.apache.commons.jrcs.diff.Diff

        else
        {
            Object[] orig = loadFile(argv[0]);
            Object[] rev = loadFile(argv[1]);

            Diff df = new Diff(orig);
            Revision r = df.diff(rev);

            System.err.println("------");
            System.out.print(r.toString());
            System.err.println("------" + new Date());
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.