SegmentArrayWithData: assertion range extended to allow negative shorts

This commit is contained in:
Roman Shevchenko
2014-12-16 20:58:35 +01:00
parent 3b6cc65abd
commit 34b3f0b8b3
@@ -31,7 +31,7 @@ public class SegmentArrayWithData extends SegmentArray {
}
public void setElementAt(int i, int startOffset, int endOffset, int data) {
if (data < 0 && data > Short.MAX_VALUE) {
if (data < Short.MIN_VALUE || data > Short.MAX_VALUE) {
throw new IndexOutOfBoundsException("data out of short range: " + data);
}
setElementAt(i, startOffset, endOffset);