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
Thanks for spotting this, patch applied (along with your unit test) in r1141977.