From 3b6cc65abdca70ca00f4b2fe5b7ef99fe640a9af Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Tue, 16 Dec 2014 20:40:08 +0100 Subject: [PATCH] revert "SegmentArrayWithData: fixed contradictory comparison in range check" (temp. solution to make test pass) --- .../intellij/openapi/editor/ex/util/SegmentArrayWithData.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/core-impl/src/com/intellij/openapi/editor/ex/util/SegmentArrayWithData.java b/platform/core-impl/src/com/intellij/openapi/editor/ex/util/SegmentArrayWithData.java index 27f65f9f1e88..14b0ea1e88e2 100644 --- a/platform/core-impl/src/com/intellij/openapi/editor/ex/util/SegmentArrayWithData.java +++ b/platform/core-impl/src/com/intellij/openapi/editor/ex/util/SegmentArrayWithData.java @@ -31,7 +31,9 @@ public class SegmentArrayWithData extends SegmentArray { } public void setElementAt(int i, int startOffset, int endOffset, int data) { - if (data < 0 || data > Short.MAX_VALUE) throw new IndexOutOfBoundsException("data out of short range" + data); + if (data < 0 && data > Short.MAX_VALUE) { + throw new IndexOutOfBoundsException("data out of short range: " + data); + } setElementAt(i, startOffset, endOffset); myData = reallocateArray(myData, i+1); myData[i] = (short)data;