Skip to content

Commit 0c7f2dd

Browse files
committed
Support up to Java version 23
1 parent 7f9e183 commit 0c7f2dd

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

d2j-base-cmd/src/main/java/com/googlecode/dex2jar/tools/Constants.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ private Constants() {
88
throw new UnsupportedOperationException();
99
}
1010

11+
public static final int MAX_JAVA_VERSION = 23;
12+
1113
public static final int[] JAVA_VERSIONS = new int[]{
1214
0,
1315
Opcodes.V1_1,
@@ -31,6 +33,8 @@ private Constants() {
3133
Opcodes.V19,
3234
Opcodes.V20,
3335
Opcodes.V21,
36+
Opcodes.V22,
37+
Opcodes.V23,
3438
};
3539

3640
public static final int ASM_VERSION = Opcodes.ASM9;

d2j-jasmin/src/main/java/com/googlecode/d2j/jasmin/Jasmin2JarCmd.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public class Jasmin2JarCmd extends BaseCmd implements Opcodes {
3434
private boolean forceOverwrite = false;
3535

3636
@Opt(opt = "o", longOpt = "output", description = "output .jar file, default is "
37-
+ "$current_dir/[jar-name]-jasmin2jar.jar", argName = "out-jar-file")
37+
+ "$current_dir/[jar-name]-jasmin2jar.jar",
38+
argName = "out-jar-file")
3839
private Path output;
3940

4041
@Opt(opt = "e", longOpt = "encoding", description = "encoding for .j files, default is UTF-8", argName = "enc")
@@ -46,7 +47,8 @@ public class Jasmin2JarCmd extends BaseCmd implements Opcodes {
4647
@Opt(longOpt = "no-compute-max", description = "", hasArg = false)
4748
private boolean noComputeMax;
4849

49-
@Opt(opt = "cv", longOpt = "class-version", description = "default .class version, [1~21], default 8 for JAVA8")
50+
@Opt(opt = "cv", longOpt = "class-version", description = "default .class version, [1~" +
51+
Constants.MAX_JAVA_VERSION + "], default 8 for JAVA8")
5052
private int classVersion = 8;
5153

5254
public Jasmin2JarCmd() {
@@ -62,9 +64,9 @@ protected void doCommandLine() throws Exception {
6264
usage();
6365
return;
6466
}
65-
int maxClassVersion = Constants.JAVA_VERSIONS.length - 1;
66-
if (classVersion < 1 || classVersion > maxClassVersion) {
67-
throw new HelpException("-cv,--class-version out of range, 1-" + maxClassVersion + " is supported.");
67+
if (classVersion < 1 || classVersion > Constants.MAX_JAVA_VERSION) {
68+
throw new HelpException("-cv,--class-version out of range, 1-" + Constants.MAX_JAVA_VERSION +
69+
" is supported.");
6870
}
6971

7072
Path jar = new File(remainingArgs[0]).toPath().toAbsolutePath();

0 commit comments

Comments
 (0)