This is a follow up to #123708 which does the similar patch but for OpenJDK11. Please see the linked issue for more detailed rationale.