Package net.sourceforge.processdash.util

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



    public void displayHTMLRedlines(PrintWriter out) {
        // Compute the differences between the two files.
        setIgnoreComments(false);
        Diff diff = new Diff(linesA, linesB);
        Diff.change c = diff.diff_2(false);

        // print a table header
        out.println("<table class='locDiff' cellpadding=0 cellspacing=0 border=0>");

        int bLineNumber = 0;
View Full Code Here

    }

    private void applyDiffs(RedlinedDocument<WhitespaceCompareString> redlines,
            WhitespaceCompareString[] a, WhitespaceCompareString[] b,
            boolean trackChange) {
        Diff diff = new Diff(a, b);
        Diff.change change = diff.diff_2(true);
        while (change != null) {
            redlines.applyChange(change.line0, change.deleted, b, change.line1,
                change.inserted, trackChange);
            change = change.link;
        }
View Full Code Here

            // comment, we don't want that to count toward our counts for
            // added/deleted/modified LOC.  To detect this scenario, we will
            // perform a second-pass comparison that ignores comments.  Then,
            // we will use the diff blocks in that comparison to compute the
            // added, deleted, and modified LOC counts.
            Diff d = new Diff(deleted, added);
            Diff.change chg = d.diff_2(false);
            while (chg != null) {
                int del = countLines(deleted, chg.line0, chg.deleted, filter);
                int add = countLines(added, chg.line1, chg.inserted, filter);
                int mod = Math.min(del, add);
                add -= mod;
View Full Code Here

TOP

Related Classes of net.sourceforge.processdash.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.