Skip to content

Commit

Permalink
优化: DC 逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
HChenX authored Jun 11, 2024
1 parent 1eef3ea commit 47661c5
Showing 1 changed file with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -510,22 +510,24 @@ private static Class<?> getClass(@Nullable String name, ClassLoader classLoader)
String old = name;
name = name.replace("[", "");
int i = old.length() - name.length();
c = switch (name.charAt(0)) {
case 'Z' -> boolean.class;
case 'B' -> byte.class;
case 'C' -> char.class;
case 'S' -> short.class;
case 'I' -> int.class;
case 'J' -> long.class;
case 'F' -> float.class;
case 'D' -> double.class;
default -> null;
};
if (c != null) {
if (i != 0) {
c = switch (name.charAt(0)) {
case 'Z' -> boolean.class;
case 'B' -> byte.class;
case 'C' -> char.class;
case 'S' -> short.class;
case 'I' -> int.class;
case 'J' -> long.class;
case 'F' -> float.class;
case 'D' -> double.class;
default -> null;
};
if (c != null) {
return Array.newInstance(c, new int[i]).getClass();
} else if (i != 0) {
} else {
name = name.replace(";", "").substring(1);
return Array.newInstance(classLoader.loadClass(name), new int[i]).getClass();
}
}
return switch (name.trim()) {
case "int" -> int.class;
Expand Down

0 comments on commit 47661c5

Please sign in to comment.