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-bcel.git
commit b04a6b7e74528d1edab6b83509c9fbe693c800bb Author: Gary Gregory <[email protected]> AuthorDate: Fri Sep 4 10:29:38 2026 -0400 Sort members --- .../java/org/apache/bcel/generic/IINCTest.java | 24 +++++++++++----------- .../bcel/verifier/VerifierArrayAccessTest.java | 20 +++++++++--------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/test/java/org/apache/bcel/generic/IINCTest.java b/src/test/java/org/apache/bcel/generic/IINCTest.java index 63e37f05..21ce7b45 100644 --- a/src/test/java/org/apache/bcel/generic/IINCTest.java +++ b/src/test/java/org/apache/bcel/generic/IINCTest.java @@ -30,18 +30,6 @@ import org.junit.jupiter.api.Test; */ class IINCTest { - /** - * The increment of a wide {@code iinc} is a signed short, so a value inside that range must round-trip through - * {@code dump}. - */ - @Test - void testWideIncrementRoundTrips() throws Exception { - final IINC iinc = new IINC(0, 30000); - try (ByteSequence bytes = new ByteSequence(iinc.dumpToByteArray())) { - assertEquals(30000, ((IINC) Instruction.readInstruction(bytes)).getIncrement()); - } - } - /** * {@code dump} emits the wide-form increment with {@code writeShort}, so the constructor and {@link IINC#setIncrement} * must reject an increment outside the signed-short range instead of truncating it to a different value. @@ -63,4 +51,16 @@ class IINCTest { final IINC iinc = new IINC(0, 1); assertThrows(ClassGenException.class, () -> iinc.setIncrement(40000)); } + + /** + * The increment of a wide {@code iinc} is a signed short, so a value inside that range must round-trip through + * {@code dump}. + */ + @Test + void testWideIncrementRoundTrips() throws Exception { + final IINC iinc = new IINC(0, 30000); + try (ByteSequence bytes = new ByteSequence(iinc.dumpToByteArray())) { + assertEquals(30000, ((IINC) Instruction.readInstruction(bytes)).getIncrement()); + } + } } diff --git a/src/test/java/org/apache/bcel/verifier/VerifierArrayAccessTest.java b/src/test/java/org/apache/bcel/verifier/VerifierArrayAccessTest.java index 227ef29b..517b75de 100644 --- a/src/test/java/org/apache/bcel/verifier/VerifierArrayAccessTest.java +++ b/src/test/java/org/apache/bcel/verifier/VerifierArrayAccessTest.java @@ -70,16 +70,6 @@ class VerifierArrayAccessTest extends AbstractVerifierTest { // @formatter:on } - @ParameterizedTest - @MethodSource("invalidComponentTypeArrayAccess") - void testInvalidComponentTypeArrayAccess(final ArrayInstruction arrayInstruction, final Type arrayElementType) - throws IOException, ClassNotFoundException { - final TestArrayAccess07Creator creator = new TestArrayAccess07Creator(arrayInstruction, arrayElementType); - creator.create(); - assertVerifyRejected(creator.getSimpleClassName(), - "Verification of " + arrayInstruction.getName() + " applied to a " + arrayElementType + "[] must fail."); - } - @Test void testInvalidArrayAccess() throws IOException, ClassNotFoundException { new TestArrayAccess03Creator().create(); @@ -102,6 +92,16 @@ class VerifierArrayAccessTest extends AbstractVerifierTest { assertVerifyRejected("TestArrayAccess06", "Verification of caload applied to an int[] must fail."); } + @ParameterizedTest + @MethodSource("invalidComponentTypeArrayAccess") + void testInvalidComponentTypeArrayAccess(final ArrayInstruction arrayInstruction, final Type arrayElementType) + throws IOException, ClassNotFoundException { + final TestArrayAccess07Creator creator = new TestArrayAccess07Creator(arrayInstruction, arrayElementType); + creator.create(); + assertVerifyRejected(creator.getSimpleClassName(), + "Verification of " + arrayInstruction.getName() + " applied to a " + arrayElementType + "[] must fail."); + } + @Test void testValidArrayAccess() throws IOException, ClassNotFoundException { assertVerifyOK("TestArrayAccess01", "Verification of an arraystore instruction on an array that is not compatible with the stored element must pass.");
