File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
here-naksha-lib-base/src/jvmMain/java/naksha/base Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -392,6 +392,9 @@ public int lastIndexOf(@Nullable Object o) {
392392
393393 @ Override
394394 public @ NotNull ListIterator <@ Nullable Object > listIterator (final int fromIndex ) {
395+ if (fromIndex < 0 || fromIndex > length ) {
396+ throw new IndexOutOfBoundsException ("Index: " +fromIndex +", JsonArray size: " +size ());
397+ }
395398 return new ListIterator <>() {
396399 private int index = fromIndex ;
397400 private boolean canRemove = false ;
@@ -446,7 +449,7 @@ public void remove() {
446449
447450 @ Override
448451 public void set (Object o ) {
449- if (!lastMoveWasNext && index == 0 ) {
452+ if (!canRemove ) {
450453 throw new IllegalStateException ();
451454 }
452455 if (lastMoveWasNext ) {
You can’t perform that action at this time.
0 commit comments