https://issues.apache.org/bugzilla/show_bug.cgi?id=51458
Bug #: 51458
Summary: sign extension may cause error in BitField
Product: POI
Version: 3.8-dev
Platform: All
OS/Version: All
Status: NEW
Severity: major
Priority: P2
Component: POI Overall
AssignedTo: [email protected]
ReportedBy: [email protected]
Classification: Unclassified
Created attachment 27233
--> https://issues.apache.org/bugzilla/attachment.cgi?id=27233
use cycle right shifting instead of just right shifting
the following junit test will fail,
final BitField bf1 = new BitField(0xF), bf2 = new BitField(0xF0000000);
int a = 0;
a = bf1.setValue(a, 9);
a = bf2.setValue(a, 9);
assertEquals(9, bf1.getValue(a));
assertEquals(9, bf2.getValue(a)); // fails, actually get -7
this bug haven't affected POI, just may cause error in future
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]