Skip to content

Commit 47b371b

Browse files
marschalljbescos
andauthored
Make JsonArrayImpl implement RandomAccess (#135)
Co-authored-by: Jorge Bescos Gascon <[email protected]>
1 parent e9e85e5 commit 47b371b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

impl/src/main/java/org/eclipse/parsson/JsonArrayBuilderImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2024 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -26,6 +26,7 @@
2626
import java.util.Collections;
2727
import java.util.List;
2828
import java.util.Optional;
29+
import java.util.RandomAccess;
2930

3031
/**
3132
* JsonArrayBuilder implementation
@@ -355,7 +356,7 @@ private void validateValue(Object value) {
355356
}
356357
}
357358

358-
private static final class JsonArrayImpl extends AbstractList<JsonValue> implements JsonArray {
359+
private static final class JsonArrayImpl extends AbstractList<JsonValue> implements JsonArray, RandomAccess {
359360
private final List<JsonValue> valueList; // Unmodifiable
360361
private final JsonContext jsonContext;
361362
private int hashCode;

0 commit comments

Comments
 (0)