This is a direct forward port (including a minor change for 7147066) of the fix to jdk8. Bug: http://bugs.sun.com/view_bug.do?bug_id=7124337 Webrev: http://cr.openjdk.java.net/~dcherepanov/7124337/8/webrev.0/ Thanks, Dmitry