[jdk17u-dev] Withdrawn: 8312475: org.jline.util.PumpReader signed byte problem

Bara' Hasheesh duke at openjdk.org
Thu Jun 5 13:57:52 UTC 2025


On Tue, 29 Apr 2025 07:10:57 GMT, Bara' Hasheesh <duke at openjdk.org> wrote:

> Clean Backport JDK-8312475: SonarCloud reports a possible issue in `read` method
> 
> * `buffer.get()` reads a signed byte so it has a range of -128-127
> * When end of file is reached the read method returns -1 signed integer
> 
> When the `buffer.get()` reads -1 => it returns 0xFF as a signed byte value, this causes the SonarCloud to confuse the possibility that the -1 byte value (0xFF), equals the -1 EOF value (0xFFFFFFFF)
> 
> This simply added a casting to & 0xFF to avoid this confusion.

This pull request has been closed without being integrated.

-------------

PR: https://git.openjdk.org/jdk17u-dev/pull/3536


More information about the jdk-updates-dev mailing list