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

Cannot read the array length because "<local3>" is null #3576

Closed
SkyLight1234 opened this issue May 8, 2024 · 6 comments
Closed

Cannot read the array length because "<local3>" is null #3576

SkyLight1234 opened this issue May 8, 2024 · 6 comments
Labels

Comments

@SkyLight1234
Copy link

版本情况

JDK版本: jdk21
hutool版本: 6.0.0-M12

问题描述(包括截图)

  1. 复现代码
java.lang.NullPointerException: Cannot read the array length because "<local3>" is null
	at org.dromara.hutool.core.annotation.elements.CombinationAnnotatedElement.parseDeclared(CombinationAnnotatedElement.java:149)
	at org.dromara.hutool.core.annotation.elements.CombinationAnnotatedElement.parseDeclared(CombinationAnnotatedElement.java:158)
	at org.dromara.hutool.core.annotation.elements.CombinationAnnotatedElement.init(CombinationAnnotatedElement.java:130)
	at org.dromara.hutool.core.annotation.elements.CombinationAnnotatedElement.<init>(CombinationAnnotatedElement.java:95)
	at org.dromara.hutool.core.annotation.elements.CombinationAnnotatedElement.<init>(CombinationAnnotatedElement.java:83)
	at org.dromara.hutool.core.annotation.AnnotationUtil.toCombination(AnnotationUtil.java:76)
	at org.dromara.hutool.core.annotation.AnnotationUtil.getAnnotation(AnnotationUtil.java:162)
	at org.dromara.hutool.core.annotation.AnnotationUtil.hasAnnotation(AnnotationUtil.java:174)
  1. 堆栈信息

  2. 测试涉及到的文件(注意脱密)
    org.dromara.hutool.core.annotation.elements.CombinationAnnotatedElement#parseDeclared

@Createsequence
Copy link
Contributor

这个问题似乎是递归解析注解的时候有一个注解数组为空导致的,可否有更具体的复现代码?

@looly
Copy link
Member

looly commented May 9, 2024

@Createsequence
image

是不是这个为null导致的?加个空判定?

@looly
Copy link
Member

looly commented May 9, 2024

@Createsequence 我加了空判断返回。

@SkyLight1234 6.0.0-M13修复此问题~~

@looly looly closed this as completed May 9, 2024
@SkyLight1234
Copy link
Author

好的

@SkyLight1234
Copy link
Author

还没提交maven么

@looly
Copy link
Member

looly commented May 9, 2024

@SkyLight1234 定期提交的,不是每改一个bug就提交。

你可以把v6-devpull下来本地install

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

3 participants