RFR: 8357798: ReverseOrderListView uses Boolean boxes after JDK-8356080 [v2]
Aleksey Shipilev
shade at openjdk.org
Mon Jun 2 13:26:36 UTC 2025
> SonarCloud complains that since [JDK-8356080](https://bugs.openjdk.org/browse/JDK-8356080) we are using `Boolean` boxes in `ReverseOrderListView`. This change `boolean` -> `Boolean` was made in [JDK-8356080](https://bugs.openjdk.org/browse/JDK-8356080) to allow `@Stable` folding of boolean field. But it is very awkward to trade in the existence of the boxed object to allow optional constant folding.
>
> We can flatten this field to `byte` and check the specific non-zero values. The field is final, so it is never actually in `0` state.
>
> Additional testing:
> - [x] Linux x86_64 server fastdebug, `java/util`
Aleksey Shipilev has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
- Just drop back to boolean
- Merge branch 'master' into JDK-8357798-reverse-order-list-boxes
- A bit better comment
- Better fix
- Fix
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/25456/files
- new: https://git.openjdk.org/jdk/pull/25456/files/288b13ee..842b8dea
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=25456&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=25456&range=00-01
Stats: 56428 lines in 840 files changed: 30803 ins; 15851 del; 9774 mod
Patch: https://git.openjdk.org/jdk/pull/25456.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/25456/head:pull/25456
PR: https://git.openjdk.org/jdk/pull/25456
More information about the core-libs-dev
mailing list