Mercurial > projects > dwt-addons
diff dwtx/jface/internal/text/revisions/Range.d @ 136:6dcb0baaa031
Regex removal of throws decls, some instanceof
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 02:20:40 +0200 |
parents | 7d818bd32d63 |
children | 1a5b8f8129df |
line wrap: on
line diff
--- a/dwtx/jface/internal/text/revisions/Range.d Sun Aug 24 01:52:31 2008 +0200 +++ b/dwtx/jface/internal/text/revisions/Range.d Sun Aug 24 02:20:40 2008 +0200 @@ -48,7 +48,7 @@ * @throws LineIndexOutOfBoundsException if the passed {@link ILineRange} does not adhere to the * contract of {@link Range} */ - public static Range copy(ILineRange range) throws LineIndexOutOfBoundsException { + public static Range copy(ILineRange range) { return createRelative(range.getStartLine(), range.getNumberOfLines()); } @@ -71,7 +71,7 @@ * @throws LineIndexOutOfBoundsException if the parameters violate the invariant of * {@link Range} */ - public static Range createRelative(int start, int length) throws LineIndexOutOfBoundsException { + public static Range createRelative(int start, int length) { return new Range(start, length); } @@ -146,7 +146,7 @@ * @param start the new start, must be >= 0 * @throws LineIndexOutOfBoundsException if <code>start</code> < 0 */ - public void moveTo(int start) throws LineIndexOutOfBoundsException { + public void moveTo(int start) { if (!(start >= 0)) throw new LineIndexOutOfBoundsException("Cannot set a negative start: " + start); //$NON-NLS-1$ fStart= start; @@ -159,7 +159,7 @@ * @param end the new end * @throws LineIndexOutOfBoundsException if <code>end</code> <= {@link #start()} */ - public void moveEndTo(int end) throws LineIndexOutOfBoundsException { + public void moveEndTo(int end) { moveTo(end - length()); } @@ -170,7 +170,7 @@ * @param delta the number of lines to shift the range * @throws LineIndexOutOfBoundsException if <code>-delta</code> > {@link #start()} */ - public void moveBy(int delta) throws LineIndexOutOfBoundsException { + public void moveBy(int delta) { moveTo(start() + delta); } @@ -180,7 +180,7 @@ * @param start the new start, must be >= 0 and < {@link #end()} * @throws LineIndexOutOfBoundsException if <code>start</code> < 0 or >= {@link #end()} */ - public void setStart(int start) throws LineIndexOutOfBoundsException { + public void setStart(int start) { int end= end(); if (!(start >= 0 && start < end)) throw new LineIndexOutOfBoundsException("Cannot set a negative start: " + start); //$NON-NLS-1$ @@ -194,7 +194,7 @@ * @param end the new end, must be > {@link #start()} * @throws LineIndexOutOfBoundsException if <code>end</code> <= {@link #start()} */ - public void setEnd(int end) throws LineIndexOutOfBoundsException { + public void setEnd(int end) { setLength(end - start()); } @@ -204,7 +204,7 @@ * @param length the new length, must be > 0 * @throws LineIndexOutOfBoundsException if <code>length</code> <= 0 */ - public void setLength(int length) throws LineIndexOutOfBoundsException { + public void setLength(int length) { if (!(length > 0)) throw new LineIndexOutOfBoundsException("Cannot set length <= 0: " + length); //$NON-NLS-1$ fLength= length; @@ -216,7 +216,7 @@ * @param length the new length, must be > 0 and <= {@link #end()} * @throws LineIndexOutOfBoundsException if <code>length</code> <= 0 */ - public void setLengthAndMove(int length) throws LineIndexOutOfBoundsException { + public void setLengthAndMove(int length) { setStart(end() - length); } @@ -226,7 +226,7 @@ * @param delta the number of lines to resize the range * @throws LineIndexOutOfBoundsException if <code>-delta</code> >= {@link #length()} */ - public void resizeBy(int delta) throws LineIndexOutOfBoundsException { + public void resizeBy(int delta) { setLength(length() + delta); } @@ -236,7 +236,7 @@ * @param delta the number of lines to resize the range * @throws LineIndexOutOfBoundsException if <code>-delta</code> >= {@link #length()} */ - public void resizeAndMoveBy(int delta) throws LineIndexOutOfBoundsException { + public void resizeAndMoveBy(int delta) { setStart(start() + delta); } @@ -248,7 +248,7 @@ * @return the split off range * @throws LineIndexOutOfBoundsException if <code>remaining</code>>= {@link #length()} or <code>remaining</code><t;= 0 */ - public Range split(int remaining) throws LineIndexOutOfBoundsException { + public Range split(int remaining) { if (!(remaining < length())) // assert before modification throw new LineIndexOutOfBoundsException("Remaining must be less than length: " + length()); //$NON-NLS-1$