Skip to content

Commit

Permalink
asm 升为 9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
noear committed Sep 20, 2023
1 parent 52a49ff commit 90afd2b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 deletions.
5 changes: 4 additions & 1 deletion UPDATE_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* 提醒1:之前没有使用弃用接口的,可以直接升级 <br>
* 提醒2:有使用弃用接口的。建议先升级到 1.12.4;替换弃用代码后,再升级到 2.0.0

### 2.5.6
### 2.5.7
* 新增 solon.boot.vertx 插件?
* 新增 seata-solon-plugin 插件
* 新增 graphql-solon-plugin 插件
Expand All @@ -18,6 +18,9 @@
* 调整 solon.config.add 与 solon.config.load 合并,规范格式(同时支持内部与外部) ???
* 调整 简化 SocketD ???

### 2.5.6
* asm 升为 9.5

### 2.5.5
* 完成 JDK21 编译测试,功能单元测试
* 添加 HttpServerConfigure::setExecutor 接口,用于支持虚拟线程池(for JDK21)
Expand Down
16 changes: 0 additions & 16 deletions __test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -486,20 +486,4 @@

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler.version}</version>
<configuration>
<compilerArgument>-parameters</compilerArgument>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>

</project>
2 changes: 1 addition & 1 deletion solon-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<okhttp.version>3.14.9</okhttp.version>
<hutool.version>5.8.20</hutool.version>

<asm.version>9.4</asm.version>
<asm.version>9.5</asm.version>

<servlet.version>4.0.1</servlet.version>
<servlet.jakarta.version>5.0.0</servlet.jakarta.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.noear.solon.proxy.asm;

import org.noear.solon.core.util.JavaUtil;
import org.objectweb.asm.*;

import java.io.InputStream;
Expand All @@ -14,7 +15,17 @@
* @since 2.2
*/
public class ClassCodeBuilder {
public static final int ASM_JDK_VERSION = Opcodes.V1_8;
public static final int ASM_JDK_VERSION() {
if (JavaUtil.JAVA_MAJOR_VERSION < 11) {
return Opcodes.V1_8;
} else if (JavaUtil.JAVA_MAJOR_VERSION < 17) {
return Opcodes.V11;
} else if (JavaUtil.JAVA_MAJOR_VERSION < 21) {
return Opcodes.V17;
} else {
return Opcodes.V21;
}
}

// 字段名
private static final String FIELD_INVOCATIONHANDLER = "invocationHandler";
Expand Down Expand Up @@ -101,7 +112,7 @@ private static String generateProxyClassName(Class<?> targetClass) {
private static void newClass(ClassWriter writer, String newClassName, String targetClassName) throws Exception {
int access = Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL;

writer.visit(ASM_JDK_VERSION, access, newClassName, null, targetClassName, null);
writer.visit(ASM_JDK_VERSION(), access, newClassName, null, targetClassName, null);
}

/**
Expand Down

0 comments on commit 90afd2b

Please sign in to comment.