Skip to content

Commit

Permalink
[release] Release new version.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Mar 28, 2023
1 parent 389e408 commit 57e32d7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
11 changes: 10 additions & 1 deletion byte-buddy-dep/src/main/java/net/bytebuddy/ClassFileVersion.java
Expand Up @@ -145,6 +145,11 @@ public class ClassFileVersion implements Comparable<ClassFileVersion>, Serializa
*/
public static final ClassFileVersion JAVA_V20 = new ClassFileVersion(Opcodes.V20);

/**
* The class file version of Java 21.
*/
public static final ClassFileVersion JAVA_V21 = new ClassFileVersion(Opcodes.V21);

/**
* A version locator for the executing JVM.
*/
Expand Down Expand Up @@ -237,6 +242,8 @@ public static ClassFileVersion ofJavaVersionString(String javaVersionString) {
return JAVA_V19;
} else if (javaVersionString.equals("1.20") || javaVersionString.equals("20")) {
return JAVA_V20;
} else if (javaVersionString.equals("1.21") || javaVersionString.equals("21")) {
return JAVA_V21;
} else {
if (OpenedClassReader.EXPERIMENTAL) {
try {
Expand Down Expand Up @@ -302,6 +309,8 @@ public static ClassFileVersion ofJavaVersion(int javaVersion) {
return JAVA_V19;
case 20:
return JAVA_V20;
case 21:
return JAVA_V21;
default:
if (OpenedClassReader.EXPERIMENTAL && javaVersion > 0) {
return new ClassFileVersion(BASE_VERSION + javaVersion);
Expand All @@ -317,7 +326,7 @@ public static ClassFileVersion ofJavaVersion(int javaVersion) {
* @return The latest officially supported Java version.
*/
public static ClassFileVersion latest() {
return ClassFileVersion.JAVA_V20;
return ClassFileVersion.JAVA_V21;
}

/**
Expand Down
Expand Up @@ -77,7 +77,8 @@ public static Collection<Object[]> data() {
{17, 17, Arrays.asList("1.17", "17"), Opcodes.V17, (short) 61, (short) 0, true, true, true},
{18, 18, Arrays.asList("1.18", "18"), Opcodes.V18, (short) 62, (short) 0, true, true, true},
{19, 19, Arrays.asList("1.19", "19"), Opcodes.V19, (short) 63, (short) 0, true, true, true},
{20, 20, Arrays.asList("1.20", "20"), Opcodes.V20, (short) 64, (short) 0, true, true, true}
{20, 20, Arrays.asList("1.20", "20"), Opcodes.V20, (short) 64, (short) 0, true, true, true},
{21, 21, Arrays.asList("1.21", "21"), Opcodes.V21, (short) 65, (short) 0, true, true, true}
});
}

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -68,7 +68,7 @@
<bytecode.test.version>1.6</bytecode.test.version>
<pitest.target>net.bytebuddy</pitest.target>
<nexus.url>https://s01.oss.sonatype.org</nexus.url>
<version.asm>9.4</version.asm>
<version.asm>9.5</version.asm>
<version.jna>5.12.1</version.jna>
<version.junit>4.13.2</version.junit>
<version.mockito>2.28.2</version.mockito>
Expand Down

0 comments on commit 57e32d7

Please sign in to comment.