Please consider this request to correct a minor problem with the optimization added for JDK-4926314. The change is to attempt to read the number of elements remaining in the target buffer unless that number is non-positive in which case read zero. The test addition fails without and passes with the implementation change.
------------- Commit messages: - 8266014: Regression brought by optimization done with JDK-4926314 Changes: https://git.openjdk.java.net/jdk/pull/3708/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3708&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8266014 Stats: 20 lines in 2 files changed: 16 ins; 2 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/3708.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3708/head:pull/3708 PR: https://git.openjdk.java.net/jdk/pull/3708