Examples of Differ


Examples of aQute.bnd.service.diff.Differ

     * @return <code>true</code> if there is a difference, otherwise <code>false</code>
     * @throws Exception
     *             On failure
     */
    public static boolean jarsDiffer(File first, File second) throws Exception {
        Differ di = new DiffPluginImpl();
        Tree n = di.tree(new Jar(second));
        Tree o = di.tree(new Jar(first));
        Diff diff = n.diff(o);
        for (Diff child : diff.getChildren()) {
            for (Diff childc : child.getChildren()) {
                if (childc.getDelta() == Delta.UNCHANGED || childc.getDelta() == Delta.IGNORED) {
                    continue;
View Full Code Here

Examples of com.ibm.icu.dev.test.util.Differ

        out.println("<tr><td></td></tr>");
       
    }
   
    static String showDifference(String as, String bs) {
        Differ differ = new Differ(300, 3);
        StringBuffer out = new StringBuffer();
        int max = as.length();
        if (max < bs.length()) max = bs.length();
        for (int j = 0; j <= max; ++j) {
            if (j < as.length()) differ.addA(as.substring(j, j+1));
            if (j < bs.length()) differ.addB(bs.substring(j, j+1));
            differ.checkMatch(j == max);

            if (differ.getACount() != 0 || differ.getBCount() != 0) {
                out.append("...");
                if (differ.getACount() != 0) {
                    out.append("<span class='r'>");
                    for (int i = 0; i < differ.getACount(); ++i) {
                        out.append(differ.getA(i));
                    }
                    out.append("</span>");
                }
                if (differ.getBCount() != 0) {
                    out.append("<span class='d'>");
                    for (int i = 0; i < differ.getBCount(); ++i) {
                        out.append(differ.getB(i));
                    }
                    out.append("</span>");
                }
                out.append("...");
            }
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.