Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.4.0版本支持JDK20相关问题 #455

Open
ZhaiMo15 opened this issue Dec 7, 2023 · 5 comments
Open

1.4.0版本支持JDK20相关问题 #455

ZhaiMo15 opened this issue Dec 7, 2023 · 5 comments
Assignees
Labels

Comments

@ZhaiMo15
Copy link

ZhaiMo15 commented Dec 7, 2023

看commit log,在1.4.0的540da04cd2cb936f40626e11e0e90a50d616a9ae提到支撑最新版JDK(JDK20)
但在源码中,如sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/matcher/structure/ClassStructureImplByAsm.java中
还有多处ASM7的内容,如
accept(new ClassVisitor(ASM7)
这里是否都需要修改升级?

@z529192557
Copy link
Collaborator

z529192557 commented Feb 22, 2024

我印象中,这个是指 ASM API VERSION ,和支持的JDK没有关系,org.objectweb.asm.Opcodes 下的versions v1_8,vxx是支持的版本

@ZhaiMo15
Copy link
Author

但是应该是ASM9才支持的JDK11 这里限制了版本 在一些需要check的地方的检查用ASM9的话就会出错

@z529192557
Copy link
Collaborator

z529192557 commented Feb 23, 2024

ClassVisitor visitRecordComponent visitPermittedSubclass 这两个jdk15的特性,确实需要check ASM8和ASM9,
不过如果你使用的是jdk11+,且你需要增强的类,没有这两个特性(google: java-record permitted-subclass ),那理论上不会报错

@ZhaiMo15
Copy link
Author

确实是visitPermittedSubclass 用的是JDK17

@reducm
Copy link

reducm commented May 6, 2024

看commit log,在1.4.0的540da04cd2cb936f40626e11e0e90a50d616a9ae提到支撑最新版JDK(JDK20) 但在源码中,如sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/matcher/structure/ClassStructureImplByAsm.java中 还有多处ASM7的内容,如 accept(new ClassVisitor(ASM7) 这里是否都需要修改升级?

各种服务升级到sdk21后,asm版本是各种报错,目前暂时是在 ClassStructureImplByAsm.java做了个ugly patch, 原来的代码是写死了ASM7,改成ASM7有问题就换成ASM9,集中在permitted-subclass这个问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants