/** * Applies the series of deltas in this revision as patches to the given text. * * @param src * the text to patch, which the method doesn't change. * @return the resulting text after the patches have been applied. * @throws PatchFailedException * if any of the patches cannot be applied. */ public Object[] patch(final Object[] src) throws PatchFailedException { List<Object> target = new ArrayList<>(Arrays.asList(src)); applyTo(target); return target.toArray(); }
/** * Converts this delta into its RCS style string representation using the default line * separator. * * @return String */ public String toRCSString() { return toRCSString(Diff.NL); }
public boolean checkLicenseHeader(File file) { Revision revision = null; try { String header = extractLicenseHeader(file, 0, 16); revision = Diff.diff(getLicenseHeader().split(LINE_ENDING), header.split(LINE_ENDING)); } catch (Exception e) { Assert.fail(e.getMessage()); } return revision.size() == 0; }
Revision revision = new Revision(); if (path.isSnake()) revision.insertDelta(delta); if (path.isSnake())
/** * compute the difference between the original and a revision. * * @param rev * the revision to compare with the original. * @return a Revision describing the differences * @throws DifferentiationFailedException */ public Revision diff(Object[] rev) throws DifferentiationFailedException { if (orig.length == 0 && rev.length == 0) { return new Revision(); } else { return algorithm.diff(orig, rev); } }
System.out.println(r.toString());
public boolean checkLicenseHeader(File file) { Revision revision = null; try { String header = extractLicenseHeader(file, 0, 14); revision = Diff.diff(getLicenseHeader().split(LINE_ENDING), header.split(LINE_ENDING)); } catch (Exception e) { Assert.fail(e.getMessage()); } return revision.size() == 0; }
Revision revision = new Revision(); if (path.isSnake()) revision.insertDelta(delta); if (path.isSnake())
/** * compute the difference between the original and a revision. * * @param rev * the revision to compare with the original. * @return a Revision describing the differences * @throws DifferentiationFailedException */ public Revision diff(final Object[] rev) throws DifferentiationFailedException { if ((orig.length == 0) && (rev.length == 0)) { return new Revision(); } else { return algorithm.diff(orig, rev); } }
System.out.println(r.toString());
public boolean checkLicenseHeader(File file) { Revision revision = null; try { String header = extractLicenseHeader(file, 0, 16); revision = Diff.diff(getLicenseHeader().split(LINE_ENDING), header.split(LINE_ENDING)); } catch (Exception e) { Assert.fail(e.getMessage()); } return revision.size() == 0; }
Revision revision = new Revision(); if (path.isSnake()) revision.insertDelta(delta); if (path.isSnake())
/** * Converts this revision into its RCS style string representation. * * @param s * a {@link StringBuilder StringBuffer} to which the string representation will be * appended. */ public void toRCSString(final StringBuilder s) { toRCSString(s, Diff.NL); }
/** * Applies the series of deltas in this revision as patches to the given text. * * @param src * the text to patch, which the method doesn't change. * @return the resulting text after the patches have been applied. * @throws PatchFailedException * if any of the patches cannot be applied. */ public Object[] patch(Object[] src) throws PatchFailedException { List target = new ArrayList(Arrays.asList(src)); applyTo(target); return target.toArray(); }
/** * compute the difference between the original and a revision. * * @param rev * the revision to compare with the original. * @return a Revision describing the differences * @throws DifferentiationFailedException */ public Revision diff(Object[] rev) throws DifferentiationFailedException { if (orig.length == 0 && rev.length == 0) { return new Revision(); } else { return algorithm.diff(orig, rev); } }
public boolean checkLicenseHeader(File file) { Revision revision = null; try { String header = extractLicenseHeader(file, 0, 16); revision = Diff.diff(getLicenseHeader().split(LINE_ENDING), header.split(LINE_ENDING)); } catch (Exception e) { Assert.fail(e.getMessage()); } return revision.size() == 0; }
/** * Converts this revision into its RCS style string representation. * * @param s * a {@link StringBuffer StringBuffer} to which the string representation will be * appended. */ public void toRCSString(StringBuffer s) { toRCSString(s, Diff.NL); }
/** * Applies the series of deltas in this revision as patches to the given text. * * @param src * the text to patch, which the method doesn't change. * @return the resulting text after the patches have been applied. * @throws PatchFailedException * if any of the patches cannot be applied. */ public Object[] patch(Object[] src) throws PatchFailedException { List<Object> target = new ArrayList<Object>(Arrays.asList(src)); applyTo(target); return target.toArray(); }
public boolean checkLicenseHeader(File file) { Revision revision = null; try { String header = extractLicenseHeader(file, 0, 16); revision = Diff.diff(getLicenseHeader().split(LINE_ENDING), header.split(LINE_ENDING)); } catch (Exception e) { Assert.fail(e.getMessage()); } return revision.size() == 0; }
/** * Converts this delta into its RCS style string representation using the default line * separator. * * @return String */ public String toRCSString() { return toRCSString(Diff.NL); }