diff --git a/src/changes/changes.xml b/src/changes/changes.xml index a2306bc3ce..4bc182ee05 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -75,6 +75,8 @@ The type attribute can be add,update,fix,remove. Deprecate TransitiveHull.INGORED in favor of TransitiveHull.getIgnored(). Add accessors to model and unit tests, Javadoc #183. + Add Const.MAJOR_22. + Add Const.MINOR_22. Bump tests from org.assertj:assertj-core 3.25.3 to 3.26.3 #322, #332. Bump tests from org.jetbrains.kotlin:kotlin-stdlib 1.9.23 to 2.0.0 #309, #318. diff --git a/src/main/java/org/apache/bcel/Const.java b/src/main/java/org/apache/bcel/Const.java index fd554493fd..80614c579c 100644 --- a/src/main/java/org/apache/bcel/Const.java +++ b/src/main/java/org/apache/bcel/Const.java @@ -292,6 +292,14 @@ public final class Const { */ public static final short MINOR_21 = 0; + /** + * Minor version number of class files for Java 22: {@value}. + * + * @see #MAJOR_22 + * @since 6.10.0 + */ + public static final short MINOR_22 = 0; + /** * Major version number of class files for Java 14: {@value}. * @@ -356,6 +364,14 @@ public final class Const { */ public static final short MAJOR_21 = 65; + /** + * Major version number of class files for Java 22: {@value}. + * + * @see #MINOR_22 + * @since 6.10.0 + */ + public static final short MAJOR_22 = 66; + /** * Default major version number. Class file is for Java 1.1: {@value}. * diff --git a/src/test/java/org/apache/bcel/ConstTest.java b/src/test/java/org/apache/bcel/ConstTest.java new file mode 100644 index 0000000000..feb6307ca5 --- /dev/null +++ b/src/test/java/org/apache/bcel/ConstTest.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.bcel; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +/** + * Tests {@link Const}. + */ +public class ConstTest { + + @Test + public void testJava22() throws Exception { + assertEquals(66, Const.MAJOR_22); + assertEquals(0, Const.MINOR_22); + } +}