Skip to content

8356080: Address post-integration comments for Stable Values #25004

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

Open
wants to merge 384 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
384 commits
Select commit Hold shift + click to select a range
671dd08
Add test for recursive invocation
minborg Aug 12, 2024
7cdf6ba
Merge branch 'master' into stable-value-mini4
minborg Aug 12, 2024
db77d00
Update JEP
minborg Aug 15, 2024
973dc33
Merge branch 'master' into stable-value-ciu
minborg Sep 4, 2024
47a1a77
Refactor stable value
minborg Sep 4, 2024
7633973
Clean up and add overload
minborg Sep 4, 2024
9c83228
Synchronize on this
minborg Sep 5, 2024
b5108bb
Simplify
minborg Sep 9, 2024
a9ff934
Merge branch 'master' into stable-value-ciu-small
minborg Sep 9, 2024
ba22e20
Make arrays of SV trusted
minborg Sep 9, 2024
65c83ea
Add support for a special CachingEnumFunction
minborg Sep 10, 2024
1aad10b
Improve test
minborg Sep 10, 2024
131cfa9
Require less inline space
minborg Sep 30, 2024
1fcc70b
Merge branch 'master' into stable-value-ciu-small
minborg Sep 30, 2024
1932d07
Rename methods and classes
minborg Sep 30, 2024
ee33733
Merge branch 'master' into stable-value-ciu-small
minborg Oct 14, 2024
dadc3d1
Update docs and rename field
minborg Oct 14, 2024
eaf3fe2
Rename stable functions and tests
minborg Oct 14, 2024
017af0d
Improve docs
minborg Oct 16, 2024
765ed48
Improve docs
minborg Oct 21, 2024
58b808a
Update docs
minborg Oct 21, 2024
53e2356
Merge branch 'master' into stable-value-ciu-small
minborg Oct 24, 2024
d929bc4
Improve javadocs
minborg Oct 25, 2024
ebe151b
Make small updates to doc
minborg Oct 25, 2024
58d314a
Merge branch 'master' into stable-value-ciu-small
minborg Oct 28, 2024
b6e445e
Review documentation after comments
minborg Oct 28, 2024
05c99bf
Make minor doc updates
minborg Oct 28, 2024
f53ad45
Merge branch 'openjdk:master' into stable-value-ciu-small
minborg Oct 29, 2024
1b5db2a
Merge branch 'master' into stable-value-ciu-small
minborg Oct 31, 2024
6059fa4
Merge branch 'master' into stable-value-ciu-small
minborg Nov 6, 2024
d82e37d
Add methods to StableValueFactories
minborg Nov 6, 2024
3a6d84c
Merge branch 'master' into stable-value-ciu-small
minborg Nov 6, 2024
053ffcb
Update docs
minborg Nov 8, 2024
575740d
Merge branch 'master' into stable-value-ciu-small
minborg Nov 8, 2024
b0cfe88
Merge branch 'master' into stable-value-ciu-small
minborg Nov 8, 2024
d47dc94
Merge branch 'master' into stable-value-ciu-small
minborg Nov 12, 2024
1a6514c
Rework docs
minborg Nov 12, 2024
5a9c5ce
Add missing character
minborg Nov 12, 2024
6cf2ee0
Merge branch 'master' into stable-value-ciu-small
minborg Nov 12, 2024
35192ce
Move constant folding section
minborg Nov 12, 2024
e463a63
Reduce docs
minborg Nov 12, 2024
3c01c26
Rename and add factory methods
minborg Nov 13, 2024
4c31beb
Update docs slightly
minborg Nov 13, 2024
db754f1
Change docs after comments
minborg Nov 13, 2024
6aa9775
Make factory method link contain class name
minborg Nov 13, 2024
905af97
Improve JavaDocs
minborg Nov 14, 2024
09ae146
Update StableValue.java
mcimadamore Nov 14, 2024
42ebfc0
Merge pull request #6 from mcimadamore/patch-1
minborg Nov 14, 2024
a4e926d
Update lazy list example
minborg Nov 14, 2024
4b3bc85
Merge branch 'stable-value-ciu-small' of https://github.com/minborg/j…
minborg Nov 14, 2024
77b7826
Merge branch 'master' into stable-value-ciu-small
minborg Nov 14, 2024
da0c8d1
Update happens-before text
minborg Nov 14, 2024
1221686
Update minor doc issue
minborg Nov 15, 2024
e71a4a1
Update docs and rename benchmarks
minborg Nov 18, 2024
882cfa5
Merge branch 'master' into stable-value-ciu-small
minborg Nov 18, 2024
e1194ce
Update docs after comments
minborg Nov 18, 2024
1321b43
Merge branch 'master' into stable-value-ciu-small
minborg Nov 25, 2024
6ca7ec0
Merge branch 'master' into stable-value-ciu-small
minborg Nov 28, 2024
aaddb21
Merge master
minborg Dec 4, 2024
7eb2f99
Update after CSR comments
minborg Dec 4, 2024
d89ed13
Merge branch 'master' into stable-value-ciu-small
minborg Dec 5, 2024
6a5e2a0
Add section on composition
minborg Dec 5, 2024
f02aa98
Fix typo
minborg Dec 5, 2024
447a589
Improve docs
minborg Dec 5, 2024
58d9758
Improve text on circulatities
minborg Dec 6, 2024
62d33e3
Add internal stable heterogenious container
minborg Dec 6, 2024
44dc46b
Improve StableHeterogeneousContainer
minborg Dec 6, 2024
26a91da
Improve docs slightly
minborg Dec 10, 2024
8223cc7
Merge branch 'master' into stable-value-ciu-small
minborg Dec 10, 2024
e6a8dcd
Improve SHC
minborg Dec 10, 2024
2c2382f
Improve test
minborg Dec 10, 2024
d056c12
Improve wording in doc
minborg Dec 10, 2024
250f23e
Merge branch 'master' into stable-value-ciu-small
minborg Jan 20, 2025
dc3817a
Update the specs from JEP and CSR comments
minborg Jan 20, 2025
8721ca5
Merge branch 'master' into stable-value-ciu-small
minborg Jan 20, 2025
e59083a
Update typos in docs
minborg Jan 20, 2025
bc3a1a6
Further improve docs
minborg Jan 20, 2025
93c671d
Merge master
minborg Feb 4, 2025
c4322b0
Remove VM impl note
minborg Feb 4, 2025
5242640
Update docs
minborg Feb 4, 2025
a30540b
Update docs and factory method name
minborg Feb 4, 2025
ee97236
Call renames factories
minborg Feb 4, 2025
d255b58
Fix typos
minborg Feb 9, 2025
6dc1741
Merge branch 'master' into stable-value-ciu-small
minborg Feb 9, 2025
158c5c4
Add some tests
minborg Feb 10, 2025
e3ebcd7
Merge branch 'master' into stable-value-ciu-small
minborg Feb 10, 2025
493973d
Rename methods and improve test coverage
minborg Feb 10, 2025
f0cc9a7
Revert changes to method names in StableHeterogeneousContainer
minborg Feb 11, 2025
9abefb3
Improve the custom stable benchmarks
minborg Feb 11, 2025
789caa2
Merge branch 'master' into stable-value-ciu-small
minborg Feb 14, 2025
14ace5d
Add a test
minborg Feb 14, 2025
82076f2
Update docs after CSR review
minborg Feb 14, 2025
442b47a
Revert unintended change
minborg Feb 14, 2025
c2addf5
Merge branch 'master' into stable-value-ciu-small
minborg Feb 27, 2025
64b620d
Simplify link in JavaDoc
minborg Mar 10, 2025
4223817
Merge branch 'master' into stable-value-ciu-small
minborg Mar 10, 2025
b12e9c5
Remove unused classes
minborg Mar 10, 2025
aff8846
Update JEP number
minborg Mar 10, 2025
f92ca11
Fix copyright issues
minborg Mar 10, 2025
3e7d749
Revert change
minborg Mar 10, 2025
7a83937
Merge branch 'master' into implement-jep502
minborg Mar 11, 2025
16c50ab
Address some comments in the PR
minborg Mar 11, 2025
44c5219
Fix members in StableEnumFunction
minborg Mar 11, 2025
a05717d
Fix JavaDoc issues
minborg Mar 12, 2025
5a59f7d
Simplify handling of sentinel, wrap, and unwrap
minborg Mar 13, 2025
2633edd
Add missing null check
minborg Mar 13, 2025
09ca44e
Use acquire semantics for reading rather than volatile semantics
minborg Mar 13, 2025
1cd1cdb
Rework reenterant logic
minborg Mar 13, 2025
8f6d6bc
Rename method and fix comment
minborg Mar 13, 2025
c648ea2
Rename field
minborg Mar 13, 2025
2fe5b0f
Clean up exception messages and fix comments
minborg Mar 13, 2025
d6e1573
Merge branch 'master' into implement-jep502
minborg Mar 13, 2025
bc7a9a7
Merge branch 'master' into implement-jep502
minborg Mar 19, 2025
60cf209
Create separate reentry prevention method and add tests
minborg Mar 19, 2025
4c0dadf
Fix comments on doc issues
minborg Mar 20, 2025
42d4dcf
Revamp toString() methods
minborg Mar 25, 2025
6968884
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Mar 26, 2025
3581485
Add partial equality test
minborg Mar 26, 2025
8b4113f
Remove snippet for orElseSet
minborg Mar 26, 2025
f90557b
Remove empty instances
minborg Mar 26, 2025
168622c
Improve exception checking
minborg Mar 31, 2025
668c884
Merge branch 'master' into implement-jep502
minborg Mar 31, 2025
7fe2c36
Remove link
minborg Mar 31, 2025
2d5bc50
Improve StableMapEntrySet::toString
minborg Mar 31, 2025
5bdb558
Fix issue with StableMap and null values
minborg Mar 31, 2025
8c0ea1a
Add test and comments about null keys
minborg Mar 31, 2025
94b835f
Fix issue with wrapped exception
minborg Mar 31, 2025
fe021b5
Fix issue in StableIntFunction related to wrapped exceptions
minborg Mar 31, 2025
766d907
Rename factory method
minborg Mar 31, 2025
09122d4
Remove VM optimizations for StableValue fields
minborg Mar 31, 2025
6fd5653
Revert changes in s.m.Unsafe
minborg Mar 31, 2025
f952179
Remove StableValueFactories
minborg Mar 31, 2025
7fb8cb4
Finish and clean up benchmarks
minborg Mar 31, 2025
df4ef35
Add MethodHandle benchmark
minborg Mar 31, 2025
f7f10fa
Add benchmarks and update copyright years
minborg Apr 1, 2025
dfb940b
Add additional benchmarks with maps holding method handles
minborg Apr 1, 2025
1cc2032
Make toString for reversed and sublist lazy
minborg Apr 1, 2025
be84045
Add lazy toSting for StableMap::values
minborg Apr 1, 2025
34fd718
Add stable collections to MOAT tests
minborg Apr 2, 2025
62cbc59
Update StableValue main description
minborg Apr 2, 2025
0e4ebba
Use static final SV in the snippets
minborg Apr 2, 2025
ab84278
Improve examples
minborg Apr 2, 2025
a1214f0
Use @enablePreview in MOAT
minborg Apr 2, 2025
769eda3
Wip on condy
minborg Apr 2, 2025
de3d561
Add a dependency layout image snippet
minborg Apr 2, 2025
d69d7c3
Specify what is a successful read/write operation
minborg Apr 2, 2025
55f2c90
Rename variable and clarify get operations
minborg Apr 2, 2025
260086d
Address various comments
minborg Apr 2, 2025
b8d5243
Mention the impact of toString and equals
minborg Apr 2, 2025
5dbcd4d
Add info that Map#values and Map#entrySet are stable
minborg Apr 2, 2025
56d9b3c
Address doc comments
minborg Apr 3, 2025
96a90d0
Address comments
minborg Apr 3, 2025
63f8854
Move Serializable specs to @implNote
minborg Apr 3, 2025
596bc13
Break out and move performance related text
minborg Apr 3, 2025
8ec7ac0
Clean up StableValue docs
minborg Apr 3, 2025
a83ec0e
Specify that an exception is thrown for illegal inputs
minborg Apr 3, 2025
c80452c
Make the sqrt example different
minborg Apr 3, 2025
35ced19
Address comments on docs
minborg Apr 4, 2025
85d687a
Merge branch 'master' into implement-jep502
minborg Apr 4, 2025
725afe3
Merge branch 'master' into implement-jep502
minborg Apr 7, 2025
f1d9644
Update doces
minborg Apr 7, 2025
365d946
Fix doc issue with NULL_SENTINEL
minborg Apr 7, 2025
0f11342
Add comment about stable fun/coll and fix typos
minborg Apr 7, 2025
5003dce
Add note an partial and total functions
minborg Apr 7, 2025
26b84e8
Fix typo
minborg Apr 7, 2025
7e15e49
Only use partial functions
minborg Apr 7, 2025
95f1b3d
Remove parantheses
minborg Apr 7, 2025
f1f188b
Update examples
minborg Apr 7, 2025
0a0e520
Fix typo
minborg Apr 7, 2025
111f4d0
Change double to int
minborg Apr 7, 2025
5bb5e48
Fix typo in return type
minborg Apr 7, 2025
ad63abd
Merge branch 'master' into implement-jep502
minborg Apr 10, 2025
9c7b48b
Fix typo
minborg Apr 10, 2025
6a6dd4b
Improve docs as per comments
minborg Apr 10, 2025
70a1581
Remove support function and clean up benchmark
minborg Apr 10, 2025
53837e4
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 10, 2025
934a890
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 10, 2025
e74a2f1
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 10, 2025
3c0a9b9
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 10, 2025
0d26979
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 10, 2025
7d417d2
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 10, 2025
4acda49
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 10, 2025
a724a4b
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 10, 2025
4c1c898
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 10, 2025
525f464
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 10, 2025
a393f2c
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 10, 2025
94a3445
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 10, 2025
d28607b
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 10, 2025
8e3178d
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 10, 2025
9c4c6ed
Update test/jdk/java/lang/StableValue/StableListTest.java
minborg Apr 10, 2025
cc57b32
Update test/jdk/java/lang/StableValue/StableIntFunctionTest.java
minborg Apr 10, 2025
9448a3a
Update test/jdk/java/lang/StableValue/StableFunctionTest.java
minborg Apr 10, 2025
dc01634
Update test/jdk/java/lang/StableValue/StableMapTest.java
minborg Apr 10, 2025
cdc1282
Update test/jdk/java/lang/StableValue/StableSupplierTest.java
minborg Apr 10, 2025
2a36bb3
Update test/jdk/java/lang/StableValue/StableValueFactoriesTest.java
minborg Apr 10, 2025
cd654b2
Address comments on original vs underlying
minborg Apr 10, 2025
ea405b1
Merge branch 'master' into implement-jep502
minborg Apr 22, 2025
b68f77a
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 22, 2025
e25ee03
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 22, 2025
9602fbf
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 22, 2025
7b80b03
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 22, 2025
38956e6
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 22, 2025
58a58ca
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 22, 2025
1ae6f2d
Merge branch 'implement-jep502' of https://github.com/minborg/jdk int…
minborg Apr 22, 2025
433537b
Update test/jdk/java/lang/StableValue/StableMapTest.java
minborg Apr 22, 2025
c6d27c6
Update test/jdk/java/lang/StableValue/StableMapTest.java
minborg Apr 22, 2025
fa77523
Update test/jdk/java/lang/StableValue/StableMapTest.java
minborg Apr 22, 2025
e1b5d14
Update test/jdk/java/lang/StableValue/StableMapTest.java
minborg Apr 22, 2025
c3fabd6
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 22, 2025
5952f9e
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 22, 2025
99be781
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 22, 2025
db70080
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 22, 2025
828cae7
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 22, 2025
848843e
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 22, 2025
561801f
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 22, 2025
af1ca2b
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 22, 2025
68e2aeb
Update src/java.base/share/classes/java/lang/StableValue.java
minborg Apr 22, 2025
f97235f
Update src/java.base/share/classes/java/util/ImmutableCollections.java
minborg Apr 22, 2025
444188a
Update src/java.base/share/classes/jdk/internal/lang/stable/StableVal…
minborg Apr 22, 2025
0040f4b
Merge branch 'implement-jep502' of https://github.com/minborg/jdk int…
minborg Apr 22, 2025
63f3d1c
Address comments in PR
minborg Apr 22, 2025
82f3924
Resolve merge problem
minborg Apr 22, 2025
06585e6
Fix build problem
minborg Apr 22, 2025
3f71da0
Fix rawtype problem
minborg Apr 22, 2025
397750f
Fix copyright related issues
minborg Apr 22, 2025
b7ba735
Rework relayed to rethrown
minborg Apr 22, 2025
1670cfd
Fix failing test (exception message)
minborg Apr 22, 2025
f9d423d
Reformat docs
minborg Apr 22, 2025
1a25b86
Remove section on fun/coll sync
minborg Apr 23, 2025
11eac9e
Merge branch 'master' into implement-jep502
minborg Apr 23, 2025
ac6accd
Replace 'content' with 'contents' and doc updates
minborg Apr 23, 2025
596b5d0
Rephrase happens-before clause
minborg Apr 23, 2025
538daf4
Replace 'contents' with 'result' in the docs
minborg Apr 23, 2025
8788713
Address comments
minborg Apr 24, 2025
1740928
Merge branch 'master' into implement-jep502
minborg Apr 24, 2025
bcc022f
Revert unwanted changes
minborg Apr 24, 2025
4839d18
Make public constuctor private
minborg Apr 24, 2025
b712a6e
Address comment from the first PR
minborg Apr 28, 2025
25a8de2
Remove forgotten line
minborg Apr 28, 2025
6d9de0c
Update link in docs
minborg Apr 29, 2025
f151752
Merge branch 'master' into jep502-followup
minborg Apr 30, 2025
a543675
Address comments
minborg Apr 30, 2025
e3edbf2
Remove unused method and add comment
minborg Apr 30, 2025
28bfb5c
Merge master
minborg May 2, 2025
4962482
Address comments in PR
minborg May 5, 2025
cc9a7dc
Simplify furhter
minborg May 5, 2025
0a5009d
Update src/java.base/share/classes/java/lang/StableValue.java
minborg May 5, 2025
116ce16
Merge branch 'master' into jep502-followup
minborg May 5, 2025
61e2fc3
Merge branch 'master' into jep502-followup
minborg May 9, 2025
3eebd50
Fix an issue with toString on nested constructs
minborg May 9, 2025
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
25 changes: 12 additions & 13 deletions src/java.base/share/classes/java/lang/StableValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@
* <p>
* The method {@link #orElseSet(Supplier)} guarantees that the provided
* {@linkplain Supplier} is invoked successfully at most once, even under race.
* Invocations of {@link #setOrThrow(Object)} form a total order of zero or more
* exceptional invocations followed by zero (if the contents were already set) or one
* Invocations of {@link #orElseSet(Supplier)} form a total order of zero or
* more exceptional invocations followed by zero (if the contents were already set) or one
* successful invocation. Since stable functions and stable collections are built on top
* of the same principles as {@linkplain StableValue#orElseSet(Supplier) orElseSet()} they
* too are thread safe and guarantee at-most-once-per-input invocation.
Expand Down Expand Up @@ -444,8 +444,6 @@
public sealed interface StableValue<T>
permits StableValueImpl {

// Principal methods

/**
* Tries to set the contents of this StableValue to the provided {@code contents}.
* The contents of this StableValue can only be set once, implying this method only
Expand Down Expand Up @@ -509,8 +507,6 @@ public sealed interface StableValue<T>
*/
T orElseSet(Supplier<? extends T> supplier);

// Convenience methods

/**
* Sets the contents of this StableValue to the provided {@code contents}, or, if
* already set, throws {@code IllegalStateException}.
Expand All @@ -519,6 +515,9 @@ public sealed interface StableValue<T>
*
* @param contents to set
* @throws IllegalStateException if the contents was already set
* @throws IllegalStateException if a supplier invoked by {@link #orElseSet(Supplier)}
* recursively attempts to set this stable value by calling this method
* directly or indirectly.
*/
void setOrThrow(T contents);

Expand Down Expand Up @@ -573,8 +572,8 @@ static <T> StableValue<T> of(T contents) {
* at most once even in a multi-threaded environment. Competing threads invoking the
* returned supplier's {@linkplain Supplier#get() get()} method when a value is
* already under computation will block until a value is computed or an exception is
* thrown by the computing thread. The computing threads will then observe the newly
* computed value (if any) and will then never execute.
* thrown by the computing thread. The competing threads will then observe the newly
* computed value (if any) and will then never execute the {@code underlying} supplier.
* <p>
* If the provided {@code underlying} supplier throws an exception, it is rethrown
* to the initial caller and no contents is recorded.
Expand Down Expand Up @@ -614,9 +613,9 @@ static <T> Supplier<T> supplier(Supplier<? extends T> underlying) {
* function for the same input, an {@linkplain IllegalStateException} will
* be thrown.
*
* @param size the size of the allowed inputs in the continuous
* interval {@code [0, size)}
* @param underlying IntFunction used to compute cached values
* @param size the upper bound of the range {@code [0, size)} indicating
* the allowed inputs
* @param underlying {@code IntFunction} used to compute cached values
* @param <R> the type of results delivered by the returned IntFunction
* @throws IllegalArgumentException if the provided {@code size} is negative.
*/
Expand Down Expand Up @@ -727,8 +726,8 @@ static <E> List<E> list(int size,
* is rethrown to the initial caller and no value associated with the provided key
* is recorded.
* <p>
* Any direct {@link Map#values()} or {@link Map#entrySet()} views
* of the returned map are also stable.
* Any {@link Map#values()} or {@link Map#entrySet()} views of the returned map are
* also stable.
* <p>
* The returned map is unmodifiable and does not implement the
* {@linkplain Collection##optional-operations optional operations} in the
Expand Down
Loading