(String original, String modified)
| 18 | } |
| 19 | |
| 20 | public static String diffLines(String original, String modified) { |
| 21 | if (original.length() > 20000 || modified.length() > 20000) { |
| 22 | return "Input too large, cannot generate diff."; |
| 23 | } else { |
| 24 | diff_match_patch differ = new diff_match_patch(); |
| 25 | diff_match_patch.LinesToCharsResult linesTochars = differ |
| 26 | .diff_linesToChars(original, modified); |
| 27 | LinkedList<diff_match_patch.Diff> diff = differ |
| 28 | .diff_main(linesTochars.chars1, linesTochars.chars2, false); |
| 29 | differ.diff_charsToLines(diff, linesTochars.lineArray); |
| 30 | //differ.diff_cleanupSemantic(diff); |
| 31 | return diffToHtml(diff); |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | private static String diffToHtml(LinkedList<diff_match_patch.Diff> diff) { |
| 36 | StringBuilder html = new StringBuilder(); |
no test coverage detected