-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Conversation
src/java.base/share/classes/java/util/ImmutableCollections.java
Outdated
Show resolved
Hide resolved
mcimadamore
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StableAPI javadoc changes look good!
liach
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, some bikeshedding
src/java.base/share/classes/java/util/ImmutableCollections.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/util/ImmutableCollections.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/util/ImmutableCollections.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/util/ImmutableCollections.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/util/ReverseOrderListView.java
Outdated
Show resolved
Hide resolved
liach
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
src/java.base/share/classes/jdk/internal/lang/stable/StableEnumFunction.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/jdk/internal/lang/stable/StableValueImpl.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/util/ImmutableCollections.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/util/ImmutableCollections.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/util/ImmutableCollections.java
Outdated
Show resolved
Hide resolved
|
I noticed that this code will throw StableValue
.list(42, _ -> {throw new IndexOutOfBoundsException("important message");})
.listIterator(5)
.next(); // same for previous() |
|
Do you plan to implement this suggestion: #23972 (comment)? |
We will take a look at this under a separate issue: https://bugs.openjdk.org/browse/JDK-8356842 |
liach
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latest change set looks fine.
|
/integrate Thank you all reviewers for reviewing this PR! |
|
Going to push as commit 066477d.
Your commit was automatically rebased without conflicts. |
| return o instanceof Map.Entry<?, ?> e | ||
| && Objects.equals(getKey(), e.getKey()) | ||
| // Invoke `getValue()` as late as possible to avoid evaluation | ||
| && Objects.equals(getValue(), e.getValue()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| && Objects.equals(getValue(), e.getValue()); | |
| && Objects.equals(e.getValue(), getValue()); |
You already integrated and it's probably not that important, but this would additionally avoid evaluation if e.getValue() throws.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in the realms of microoptimization now...
This PR proposes to address comments in the initial PR for Stable Values, which were deferred until after integration.
Most of the efforts in this PR are to retain "stability" as long as possible so that views of stable collections remain stable and do not evaluate on
toString()for example.Unfortunately, this PR shows the total commit history for stable values.
Progress
Issues
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25004/head:pull/25004$ git checkout pull/25004Update a local copy of the PR:
$ git checkout pull/25004$ git pull https://git.openjdk.org/jdk.git pull/25004/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25004View PR using the GUI difftool:
$ git pr show -t 25004Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25004.diff
Using Webrev
Link to Webrev Comment