diff --git a/classlib/src/main/java/org/teavm/classlib/java/util/TArrays.java b/classlib/src/main/java/org/teavm/classlib/java/util/TArrays.java index c73a90d0e..43dba5512 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/util/TArrays.java +++ b/classlib/src/main/java/org/teavm/classlib/java/util/TArrays.java @@ -977,6 +977,9 @@ public class TArrays extends TObject { if (fromIndex > toIndex) { throw new TIllegalArgumentException(); } + if (fromIndex == toIndex) { + return -1; + } int l = fromIndex; int u = toIndex - 1; while (true) { @@ -1006,6 +1009,9 @@ public class TArrays extends TObject { if (fromIndex > toIndex) { throw new TIllegalArgumentException(); } + if (fromIndex == toIndex) { + return -1; + } int l = fromIndex; int u = toIndex - 1; while (true) { @@ -1035,6 +1041,9 @@ public class TArrays extends TObject { if (fromIndex > toIndex) { throw new TIllegalArgumentException(); } + if (fromIndex == toIndex) { + return -1; + } int l = fromIndex; int u = toIndex - 1; while (true) { @@ -1064,6 +1073,9 @@ public class TArrays extends TObject { if (fromIndex > toIndex) { throw new TIllegalArgumentException(); } + if (fromIndex == toIndex) { + return -1; + } int l = fromIndex; int u = toIndex - 1; while (true) { @@ -1093,6 +1105,9 @@ public class TArrays extends TObject { if (fromIndex > toIndex) { throw new TIllegalArgumentException(); } + if (fromIndex == toIndex) { + return -1; + } int l = fromIndex; int u = toIndex - 1; while (true) { @@ -1122,6 +1137,9 @@ public class TArrays extends TObject { if (fromIndex > toIndex) { throw new TIllegalArgumentException(); } + if (fromIndex == toIndex) { + return -1; + } int l = fromIndex; int u = toIndex - 1; while (true) { @@ -1151,6 +1169,9 @@ public class TArrays extends TObject { if (fromIndex > toIndex) { throw new TIllegalArgumentException(); } + if (fromIndex == toIndex) { + return -1; + } int l = fromIndex; int u = toIndex - 1; while (true) { @@ -1188,6 +1209,9 @@ public class TArrays extends TObject { if (fromIndex > toIndex) { throw new TIllegalArgumentException(); } + if (fromIndex == toIndex) { + return -1; + } int l = fromIndex; int u = toIndex - 1; while (true) {