This is an automated email from the ASF dual-hosted git repository. garydgregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 04df64b765d5817c04454e343007cb4c091c5c20 Author: Gary Gregory <[email protected]> AuthorDate: Thu Jun 18 16:01:43 2026 +0000 Extract loop limit into a local final variable. --- src/test/java/org/apache/commons/lang3/BitFieldTest.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/apache/commons/lang3/BitFieldTest.java b/src/test/java/org/apache/commons/lang3/BitFieldTest.java index 59b32ec0f..c91f92530 100644 --- a/src/test/java/org/apache/commons/lang3/BitFieldTest.java +++ b/src/test/java/org/apache/commons/lang3/BitFieldTest.java @@ -241,11 +241,12 @@ void testSetShortBoolean() { */ @Test void testSetShortValue() { - for (int j = 0; j < 128; j++) { + final int limit = 128; + for (int j = 0; j < limit; j++) { assertEquals(BF_MULTI.getShortValue(BF_MULTI.setShortValue((short) 0, (short) j)), (short) j); assertEquals(BF_MULTI.setShortValue((short) 0, (short) j), (short) (j << 7)); } - for (int j = 0; j < 128; j++) { + for (int j = 0; j < limit; j++) { assertEquals(BF_ZERO.getShortValue(BF_ZERO.setShortValue((short) 0, (short) j)), (short) 0); assertEquals(BF_ZERO.setShortValue((short) 0, (short) j), (short) 0); } @@ -264,11 +265,12 @@ void testSetShortValue() { */ @Test void testSetValue() { - for (int j = 0; j < 128; j++) { + final int limit = 128; + for (int j = 0; j < limit; j++) { assertEquals(BF_MULTI.getValue(BF_MULTI.setValue(0, j)), j); assertEquals(BF_MULTI.setValue(0, j), j << 7); } - for (int j = 0; j < 128; j++) { + for (int j = 0; j < limit; j++) { assertEquals(BF_ZERO.getValue(BF_ZERO.setValue(0, j)), 0); assertEquals(BF_ZERO.setValue(0, j), 0); }
