backported the fix for JDK-8028618
2 files changed