-
Bug
-
Resolution: Fixed
-
P4
-
17, 21, 22
-
b21
SonarCloud reports a problem in PumpReader here:
https://github.com/openjdk/jdk/blob/354c6605e32790ca421869636d8bf5456fc51717/src/jdk.internal.le/share/classes/jdk/internal/org/jline/utils/PumpReader.java#L417
@Override
public int read() throws IOException {
if (!buffer.hasRemaining() && !readUsingBuffer()) {
return EOF;
}
return buffer.get(); // <---- here
}
InputStream returns -1 as EOF, but that might be as well the value of signed byte from get(). We need cast to `& 0xFF` here.
https://github.com/openjdk/jdk/blob/354c6605e32790ca421869636d8bf5456fc51717/src/jdk.internal.le/share/classes/jdk/internal/org/jline/utils/PumpReader.java#L417
@Override
public int read() throws IOException {
if (!buffer.hasRemaining() && !readUsingBuffer()) {
return EOF;
}
return buffer.get(); // <---- here
}
InputStream returns -1 as EOF, but that might be as well the value of signed byte from get(). We need cast to `& 0xFF` here.