Do a change similar to #1339 but for JDK 22.
Do a change similar to #1339 but for JDK 22.