/** * Compute a list of patches to turn text1 into text2. * A set of diffs will be computed. * * @param text1 Old text. * @param text2 New text. * @return LinkedList of Patch objects. */ public LinkedList<Patch> patchMake(String text1, String text2) { if (text1 == null || text2 == null) { throw new IllegalArgumentException("Null inputs. (patchMake)"); } // No diffs provided, compute our own. LinkedList<Diff> diffs = diffMain(text1, text2, true); if (diffs.size() > 2) { diff_cleanupSemantic(diffs); diffCleanupEfficiency(diffs); } return patchMake(text1, diffs); }