Replacing org.openjdk.jmh.util.Optional with java.util.Optional

Andrei Rybak rybak.a.v at gmail.com
Tue Jan 10 09:42:00 UTC 2023


Hello,

Since JHM dropped support for JDK 7 recently [1], it means that JMH
source code can now use APIs from JDK 8.  For example, class
java.util.Optional could be used instead of JMH's own class
org.openjdk.jmh.util.Optional.

Will a pull request to do such a replacement throughout the codebase
be welcome, or would it be considered unnecessary code churn?

I've poked around the code a bit and it seems that the only obstacle
to a simple drop-in replacement (modulo renaming) is method
`orAnother`, usages of which could be easily refactored out.

[1] https://mail.openjdk.org/pipermail/jmh-dev/2022-November/003553.html

--
Best regards,
Andrei R.


More information about the jmh-dev mailing list