commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <>
Subject [jira] Updated: (IO-117) EndianUtils.readSwappedUnsignedInteger() may return a negative number
Date Tue, 01 May 2007 17:18:19 GMT


Henri Yandell updated IO-117:

    Attachment: IO-117.patch

Attaching a patch containing Hiroshi's test as a unit test and a proposed pair of fixes.

Opinions sought on my fix, I don't do a lot of bit shifting so it always feels clumsy.

> EndianUtils.readSwappedUnsignedInteger() may return a negative number
> ---------------------------------------------------------------------
>                 Key: IO-117
>                 URL:
>             Project: Commons IO
>          Issue Type: Bug
>    Affects Versions: 1.3.1
>            Reporter: Hiroshi Ikeda
>         Attachments:, IO-117.patch
> Methods about reading unsigned-integer in class EndianUtils may return a negative number,
due to casting int to long.
> Calculations with operator & etc. are under integer in these methods so its results
are integer,
> then implicit casting the results to long keeps its positive/negative sign.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message