diff options
author | Lars Vogel | 2020-03-19 10:07:05 +0000 |
---|---|---|
committer | Lars Vogel | 2020-03-20 08:23:59 +0000 |
commit | 53950877a43dcaa4b7fc9fab8880acd47231c329 (patch) | |
tree | 01874f3fea5946155dd07746ce02f7ac01fa8cb1 | |
parent | 2619fb4e18c333733171f051e12c442d7be4dbf6 (diff) | |
download | eclipse.platform.text-53950877a43dcaa4b7fc9fab8880acd47231c329.tar.gz eclipse.platform.text-53950877a43dcaa4b7fc9fab8880acd47231c329.tar.xz eclipse.platform.text-53950877a43dcaa4b7fc9fab8880acd47231c329.zip |
Push down negation in Range.java
Using the new JDT refactoring uses < instead of ! and >= which is easier
to read
Change-Id: Ie1579e5a989fcd0c2f5372491f292bbcb619dc40
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r-- | org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/Range.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/Range.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/Range.java index 386e01fa75e..22158d26efb 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/Range.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/Range.java @@ -133,7 +133,7 @@ public final class Range implements ILineRange, Cloneable { * @throws LineIndexOutOfBoundsException if <code>start</code> < 0 */ public void moveTo(int start) throws LineIndexOutOfBoundsException { - if (!(start >= 0)) + if ((start < 0)) throw new LineIndexOutOfBoundsException("Cannot set a negative start: " + start); //$NON-NLS-1$ fStart= start; } @@ -168,7 +168,7 @@ public final class Range implements ILineRange, Cloneable { */ public void setStart(int start) throws LineIndexOutOfBoundsException { int end= end(); - if (!(start >= 0 && start < end)) + if (((start < 0) || (start >= end))) throw new LineIndexOutOfBoundsException("Cannot set a negative start: " + start); //$NON-NLS-1$ moveTo(start); setEnd(end); @@ -191,7 +191,7 @@ public final class Range implements ILineRange, Cloneable { * @throws LineIndexOutOfBoundsException if <code>length</code> <= 0 */ public void setLength(int length) throws LineIndexOutOfBoundsException { - if (!(length > 0)) + if ((length <= 0)) throw new LineIndexOutOfBoundsException("Cannot set length <= 0: " + length); //$NON-NLS-1$ fLength= length; } @@ -235,7 +235,7 @@ public final class Range implements ILineRange, Cloneable { * @throws LineIndexOutOfBoundsException if <code>remaining</code>>= {@link #length()} or <code>remaining</code><= 0 */ public Range split(int remaining) throws LineIndexOutOfBoundsException { - if (!(remaining < length())) // assert before modification + if ((remaining >= length())) // assert before modification throw new LineIndexOutOfBoundsException("Remaining must be less than length: " + length()); //$NON-NLS-1$ int splitLength= length() - remaining; |