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

Type annotations and generic types causing ArrayIndexOutOfBoundsException [SPR-17467] #21999

Closed
spring-issuemaster opened this Issue Nov 5, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

spring-issuemaster commented Nov 5, 2018

aprantl opened SPR-17467 and commented

We just tried upgrading our project to from Spring Framework 5.0.8 to 5.1.2 but unfortunately we hit a blocker which seems to be some kind of regression. At least my Google search yielded a two year old ASM bug report which also have been fixed shortly after .

We are getting an ArrayIndexOutOfBoundException when initialising the ApplicationContext or when calling certain methods that make use of type annotations in the method body. Additionally, it seem to be necessary that the affected class inherits from a generic type.

I've attached a small test project that should help reproducing the bug. If you execute the test you should see the error. Downgrading the dependency to Spring Framework 5.0.8 solves the issue.

Our test systems use MacOs und CentOs with JDK 1.8.0_181.


Affects: 5.1.2

Attachments:

Issue Links:

  • #22029 ArrayIndexOutOfBoundsException when reading metadata for a class that uses javax.validation.NotNull on a local variable ("is duplicated by")
  • #18661 Type annotations cause ArrayIndexOutOfBoundsException in ASM ClassReader

Referenced from: commits 2ac4355

1 votes, 3 watchers

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Nov 5, 2018

Juergen Hoeller commented

This seems to be #18661 coming back indeed since we upgraded to ASM 7.0 for Spring Framework 5.1, with a heavily refactored ClassReader where we did not re-apply that old patch of ours. Since ASM refused to fix this itself (which I unfortunately haven't noticed), I've reintroduced a defensive patch to our ASM 7.0 fork for the Spring Framework 5.1.3 release.

This will be available in the upcoming 5.1.3.BUILD-SNAPSHOT. Feel free to give it an early try...

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Nov 6, 2018

aprantl commented

Thanks, that was quick. I successfully tested the fix with the 5.1.3.BUILD-SNAPSHOT. Looking forward to using the 5.1.3.RELEASE with Java 11.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Nov 6, 2018

Juergen Hoeller commented

Good to hear! FYI, Spring Framework 5.1.3 is scheduled for release on Nov 26, with the Spring Boot 2.1.1 release following a day later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.