/** * Adjusts the revision information to the given diff information. Any previous diff information * is discarded. * * @param hunks the diff hunks to adjust the revision information to * @since 3.3 */ final void applyDiff(Hunk[] hunks) { fRanges= null; // mark for recomputation for (ChangeRegion region : fChangeRegions) { region.clearDiff(); for (Hunk hunk : hunks) { region.adjustTo(hunk); } } }
/** * Adjusts the revision information to the given diff information. Any previous diff information * is discarded. * * @param hunks the diff hunks to adjust the revision information to * @since 3.3 */ final void applyDiff(Hunk[] hunks) { fRanges= null; // mark for recomputation for (Iterator<ChangeRegion> regions= fChangeRegions.iterator(); regions.hasNext();) { ChangeRegion region= regions.next(); region.clearDiff(); for (int i= 0; i < hunks.length; i++) { Hunk hunk= hunks[i]; region.adjustTo(hunk); } } }
/** * Creates a new change region for the given revision and line range. * * @param revision the revision of the new region * @param lines the line range of the new region * @throws IndexOutOfBoundsException if the line range is not well-formed */ public ChangeRegion(Revision revision, ILineRange lines) throws IndexOutOfBoundsException { Assert.isLegal(revision != null); Assert.isLegal(lines != null); fLines= Range.copy(lines); fRevision=revision; clearDiff(); }
/** * Creates a new change region for the given revision and line range. * * @param revision the revision of the new region * @param lines the line range of the new region * @throws IndexOutOfBoundsException if the line range is not well-formed */ public ChangeRegion(Revision revision, ILineRange lines) throws IndexOutOfBoundsException { Assert.isLegal(revision != null); Assert.isLegal(lines != null); fLines= Range.copy(lines); fRevision=revision; clearDiff(); }