From 76383a6f351d5492cb1b25d3ee74c421399e8588 Mon Sep 17 00:00:00 2001 From: "Gary David Gregory (Code signing key)" Date: Sat, 14 Oct 2023 10:59:46 -0400 Subject: [PATCH] Class "java.io.Bits" is not in Java 21 --- .../java/org/apache/bcel/generic/EmptyVisitorTestCase.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/java/org/apache/bcel/generic/EmptyVisitorTestCase.java b/src/test/java/org/apache/bcel/generic/EmptyVisitorTestCase.java index 36ffcd5d89..5159328f79 100644 --- a/src/test/java/org/apache/bcel/generic/EmptyVisitorTestCase.java +++ b/src/test/java/org/apache/bcel/generic/EmptyVisitorTestCase.java @@ -17,11 +17,14 @@ package org.apache.bcel.generic; import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.jupiter.api.Assumptions.assumeFalse; import org.apache.bcel.classfile.Code; import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.classfile.Method; import org.apache.bcel.util.SyntheticRepository; +import org.apache.commons.lang3.JavaVersion; +import org.apache.commons.lang3.SystemUtils; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -56,6 +59,8 @@ class EmptyVisitorTestCase { // @formatter:on }) public void test(final String className) throws ClassNotFoundException { + // "java.io.Bits" is not in Java 21. + assumeFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_21) && className.equals("java.io.Bits")); final JavaClass javaClass = SyntheticRepository.getInstance().loadClass(className); for (final Method method : javaClass.getMethods()) { final Code code = method.getCode();