Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8284780: Need methods to create pre-sized HashSet and LinkedHashSet #8302

Closed
wants to merge 28 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
436273e
8284780: Need methods to create pre-sized HashSet and LinkedHashSet
XenoAmess Apr 19, 2022
b139366
fix LinkedHashSet constructor
XenoAmess Apr 19, 2022
a64ccc1
migrate LinkedHashSet usage
XenoAmess Apr 19, 2022
f051c1f
migrate HashSet usages
XenoAmess Apr 19, 2022
26bb579
add apiNote s
XenoAmess Apr 20, 2022
931e504
add more replaces
XenoAmess Apr 20, 2022
53fdb7c
add more replaces
XenoAmess Apr 20, 2022
704e895
add more replaces
XenoAmess Apr 20, 2022
363fcc5
add more replaces
XenoAmess Apr 20, 2022
07e9b8b
revert much too changes for newHashSet
XenoAmess May 24, 2022
56d029f
add test for newHashSet and newLinkedHashSet
XenoAmess May 24, 2022
4ec6ba9
rename items to elements
XenoAmess May 26, 2022
37fa460
redo the tests
XenoAmess May 26, 2022
df5a851
add 8284780 to test
XenoAmess May 26, 2022
59caa1f
Merge remote-tracking branch 'openjdk/master' into fix_8284780
XenoAmess May 26, 2022
117918f
Merge branch 'master' of https://git.openjdk.java.net/jdk into fix_82…
XenoAmess May 26, 2022
583ad88
Minor terminology fixes: change "item" and "key" to element; remove
stuart-marks May 27, 2022
71e3077
Update src/java.base/share/classes/java/util/HashSet.java
XenoAmess May 27, 2022
f1478a8
Update src/java.base/share/classes/java/util/HashSet.java
XenoAmess May 27, 2022
e8b173c
Update src/java.base/share/classes/java/util/HashSet.java
XenoAmess May 27, 2022
1f09970
Update src/java.base/share/classes/java/util/LinkedHashSet.java
XenoAmess May 27, 2022
0344a91
Update src/java.base/share/classes/java/util/LinkedHashSet.java
XenoAmess May 27, 2022
42fba93
Update src/java.base/share/classes/java/util/LinkedHashSet.java
XenoAmess May 27, 2022
230a767
Merge remote-tracking branch 'stuart-marks/pull/8302' into fix_8284780
XenoAmess May 27, 2022
98bfb0e
do it as naotoj said
XenoAmess May 27, 2022
a194484
Rename type variable per CSR request; minor spec wording change.
stuart-marks Jun 1, 2022
bacc9ca
remove null check for Capacitiable in WhiteBoxResizeTest
XenoAmess Jun 8, 2022
95d59b9
clean up Calendar
XenoAmess Jun 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion test/jdk/java/util/HashMap/WhiteBoxResizeTest.java
Original file line number Diff line number Diff line change
@@ -29,13 +29,16 @@
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.invoke.VarHandle;
import java.lang.reflect.Field;
import java.util.AbstractMap;
import java.util.AbstractSet;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -336,7 +339,25 @@ List<Object[]> genRequestedSizeCases(int size, int cap) {
return Arrays.asList(
rsc("rshm", size, cap, () -> HashMap.newHashMap(size)),
rsc("rslm", size, cap, () -> LinkedHashMap.newLinkedHashMap(size)),
rsc("rswm", size, cap, () -> WeakHashMap.newWeakHashMap(size))
rsc("rswm", size, cap, () -> WeakHashMap.newWeakHashMap(size)),
rsc("rshs", size, cap, () -> {
try {
Field mapField = HashSet.class.getDeclaredField("map");
HashSet<String> set = HashSet.newHashSet(size);
return (Map<String, String>) mapField.get(set);
} catch (Exception e) {
throw new RuntimeException(e);
}
}),
rsc("rsls", size, cap, () -> {
try {
Field mapField = HashSet.class.getDeclaredField("map");
LinkedHashSet<String> set = LinkedHashSet.newLinkedHashSet(size);
return (Map<String, String>) mapField.get(set);
} catch (Exception e) {
throw new RuntimeException(e);
}
})
);
}