duck: backport Java 9 compatibility fix
duck: backport Java 9 compatibility fix

Closes #19938.

Signed-off-by: ilovezfs <fbd54dbbcf9e596abad4ccdc4dfc17f80ebeaee2@icloud.com>

robohack/homebrew-core,robohack/homebrew-core