backported the fix for JDK-8042098
2 files changed