-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
JDK >= 9的环境中,ClassStructureImplByAsm.getResourceAsStream会返回null #385
Comments
嗯嗯,能否提交一个pull-request到develop-for-20220822的分支上来呢,这样能统计到你的贡献度。我每次copy你的代码过意不去 |
ok,随后我提交一下 |
DayJun
added a commit
to DayJun/jvm-sandbox
that referenced
this issue
Oct 16, 2022
oldmanpushcart
added a commit
that referenced
this issue
Oct 16, 2022
1.4.0已发布,多谢PR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
原代码:
在JDK 》= 9的情况下,java自己的基础类并不是全部位于同一个包内,而是分为了java.base、java.desktop等好多个模块。使用java.base中的Object.class是无法得到java.desktop等其他模块中类的Resource的URL的。
修改方法:
如果是BootStrapClassLoader加载的类,就先获取到这个类,然后用这个类取get自己的resource
另外,如果getResourceAsStream返回null,会导致UnsupportedMatcher中的isJavaMainBehavior抛出空指针异常
原代码:
修改后:
添加一个
null != behaviorStructure.getReturnTypeClassStructure()
的检测会比较好The text was updated successfully, but these errors were encountered: