backported the fix for JDK-8041924
2 files changed