Bug JDK-8028111

Implementation of Workaround proposed by Joe Wang in bug JDK-8028111. …
Reference: https://bugs.openjdk.java.net/browse/JDK-8028111