Patch the source with r1697228, r1697237, r1697247, r1697306, and
r1697312 from upstream trunk (with a few tweaks to compensate for
some other upstream changes not included here) to unbreak the build
with OpenJDK8.
Revert r399536 to unmark broken.
PR: 199591 (openjdk8 by default exp-run)