fixing incorrect default upper bound for slice. Fixes #657
This commit is contained in:
1 parent
eac4eb0537
commit
f3f8c689a8
6 files changed
+10
-7
No files matched your search
@@ -334,11 +334,13 @@ public class ListValue extends AbstractListValue implements ContainerValueInterf
|
||||
}
|
||||
|
||||
@Override
|
||||
public Value slice(long fromDesc, long toDesc)
|
||||
public Value slice(long fromDesc, Long toDesc)
|
||||
{
|
||||
List<Value> items = getItems();
|
||||
int size = items.size();
|
||||
int from = normalizeIndex(fromDesc, size);
|
||||
if (toDesc == null)
|
||||
return new ListValue((Collection<? extends Value>) getItems().subList(from, size));
|
||||
int to = normalizeIndex(toDesc, size);
|
||||
if (from > to)
|
||||
return ListValue.of();
|
||||
|
||||
Reference in new issue
Block a user