Package bmsi.util

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


                debugNodes(nodesA);
                LOG.trace("Modified:");
                debugNodes(nodesB);
            }

            Diff diff = new Diff(nodesA, nodesB);
            Diff.change script = diff.diff_2(false);
            changes = getChanges(script, docA, docB, nodesA, nodesB);
        } catch (XMLStreamException e) {
            throw new DiffException(e.getMessage(), e);
        } catch (IOException e) {
            throw new DiffException(e.getMessage(), e);
View Full Code Here

  public static void main(String[] argv) throws IOException {
    String filea = argv[argv.length - 2];
    String fileb = argv[argv.length - 1];
    String[] a = slurp(filea);
    String[] b = slurp(fileb);
    Diff d = new Diff(a,b);
    char style = 'n';
    d.heuristic = false;
    for (int i = 0; i < argv.length - 2; ++i) {
      String f = argv[i];
      if (f.startsWith("-")) {
        for (int j = 1; j < f.length(); ++j) {
    switch (f.charAt(j)) {
    case 'H'// heuristic on
      d.heuristic = true; break;
    case 'e'// Ed style
      style = 'e'; break;
    case 'c'// Context diff
      style = 'c'; break;
    case 'u':
      style = 'u'; break;
    }
  }
      }
    }
    boolean reverse = style == 'e';
    Diff.change script = d.diff_2(reverse);
    if (script == null)
      System.err.println("No differences");
    else {
      Base p;
      switch (style) {
View Full Code Here

TOP

Related Classes of bmsi.util.Diff

Copyright © 2018 www.massapicom. 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.