mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8266014: Regression brought by optimization done with JDK-4926314
Reviewed-by: alanb, naoto
This commit is contained in:
parent
6bb71d9e25
commit
2a03739530
2 changed files with 18 additions and 4 deletions
|
@ -188,9 +188,7 @@ public abstract class Reader implements Readable, Closeable {
|
|||
if (target.hasArray()) {
|
||||
char[] cbuf = target.array();
|
||||
int pos = target.position();
|
||||
int rem = target.limit() - pos;
|
||||
if (rem <= 0)
|
||||
return -1;
|
||||
int rem = Math.max(target.limit() - pos, 0);
|
||||
int off = target.arrayOffset() + pos;
|
||||
nread = this.read(cbuf, off, rem);
|
||||
if (nread > 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue