RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation [v3]
ExE Boss
duke at openjdk.org
Sun Jul 20 06:40:03 UTC 2025
On Thu, 17 Jul 2025 21:40:13 GMT, Joe Darcy <darcy at openjdk.org> wrote:
>> Add `@Stable` to the static final arrays used in the Java port of FDLIBM.
>
> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision:
>
> Implement review feedback.
src/java.base/share/classes/java/lang/FdLibm.java line 459:
> 457: @Stable
> 458: private static final double
> 459: T[] = {
The legacy **C**‑like array field syntax is confusing in **Java**, and it’s not used for the `@Stable int[]` arrays below.
Suggestion:
@Stable
private static final double[] T = {
--------------------------------------------------------------------------------
Or at least put the `T[]` on the same line so that it’s clear why this field has `@Stable`, since regular `static final double`s are already constant folded and @wenshao’s comment[^1] confused me on the “**Conversation**” tab, since it was missing the `T[]` there.
Suggestion:
@Stable
private static final double T[] = {
[^1]: https://github.com/openjdk/jdk/pull/26341#discussion_r2213012163
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26341#discussion_r2217624377
More information about the core-libs-dev
mailing list