"Invalid patch string: " + text.getFirst()); patch = new Patch(); patches.add(patch); patch.start1 = Integer.parseInt(m.group(1));
while (!bigpatch.diffs.isEmpty()) { patch = new Patch(); empty = true; patch.start1 = start1 - precontext.length();
/** * Given an array of patches, return another array that is identical. * * @param patches Array of Patch objects. * @return Array of Patch objects. */ public LinkedList<Patch> patch_deepCopy(LinkedList<Patch> patches) { LinkedList<Patch> patchesCopy = new LinkedList<Patch>(); for (Patch aPatch : patches) { Patch patchCopy = new Patch(); for (Diff aDiff : aPatch.diffs) { Diff diffCopy = new Diff(aDiff.operation, aDiff.text); patchCopy.diffs.add(diffCopy); } patchCopy.start1 = aPatch.start1; patchCopy.start2 = aPatch.start2; patchCopy.length1 = aPatch.length1; patchCopy.length2 = aPatch.length2; patchesCopy.add(patchCopy); } return patchesCopy; }