Skip to content

Commit a431046

Browse files
committed
8350518: org.openjdk.bench.java.util.TreeMapUpdate.compute fails with "java.lang.IllegalArgumentException: key out of range"
Reviewed-by: liach, skuksenko
1 parent a70eba8 commit a431046

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/micro/org/openjdk/bench/java/util/TreeMapUpdate.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,7 @@
5656
@Fork(3)
5757
@State(Scope.Thread)
5858
public class TreeMapUpdate {
59-
@Param({"TreeMap", "descendingMap", "tailMap"})
59+
@Param({"TreeMap", "descendingMap", "subMap"})
6060
public String mode;
6161

6262
@Param({"10", "1000", "100000"})
@@ -86,8 +86,8 @@ public void setUp() {
8686
case "descendingMap":
8787
transformer = map -> map.descendingMap();
8888
break;
89-
case "tailMap":
90-
transformer = map -> map.tailMap(0, true);
89+
case "subMap":
90+
transformer = comparator ? map -> map.headMap(0, true) : map -> map.tailMap(0, true);
9191
break;
9292
default:
9393
throw new IllegalStateException(mode);

0 commit comments

Comments
 (0)