Summary: | sign extension may cause error in BitField | ||
---|---|---|---|
Product: | POI | Reporter: | jingqi <jingqi.se> |
Component: | POI Overall | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | P2 | ||
Version: | 3.8-dev | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Attachments: | use cycle right shifting instead of just right shifting |
Created attachment 27233 [details] 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