Skip to content

Commit 4ce70ae

Browse files
zbynektbroyer
andcommitted
Apply suggestions from code review
Co-authored-by: Thomas Broyer <[email protected]>
1 parent cfd11b6 commit 4ce70ae

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

user/super/com/google/gwt/emul/java/util/Objects.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -139,22 +139,22 @@ public static <T> T requireNonNullElseGet(T obj, Supplier<? extends T> supplier)
139139

140140
public static int checkIndex(int index, int length) {
141141
if (index < 0 || index >= length) {
142-
new IndexOutOfBoundsException("Index " + index + " out of bounds for length " + length);
142+
throw new IndexOutOfBoundsException("Index " + index + " out of bounds for length " + length);
143143
}
144144
return index;
145145
}
146146

147147
public static int checkFromToIndex(int fromIndex, int toIndex, int length) {
148148
if (fromIndex < 0 || fromIndex > toIndex || toIndex > length) {
149-
new IndexOutOfBoundsException("Range [" + fromIndex + ", " + toIndex
149+
throw new IndexOutOfBoundsException("Range [" + fromIndex + ", " + toIndex
150150
+ ") out of bounds for length " + length);
151151
}
152152
return fromIndex;
153153
}
154154

155-
public static int checkFromIndexSize(long fromIndex, long size, long length) {
155+
public static int checkFromIndexSize(int fromIndex, int size, int length) {
156156
if (fromIndex < 0 || size < 0 || fromIndex + size > length) {
157-
new IndexOutOfBoundsException("Range [" + fromIndex + ", " + (fromIndex + size)
157+
throw new IndexOutOfBoundsException("Range [" + fromIndex + ", " + (fromIndex + size)
158158
+ ") out of bounds for length " + length);
159159
}
160160
return fromIndex;

0 commit comments

Comments
 (0)