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

Java 8 bridge method handling can lead to false positive detection of autowired annotations [SPR-12187] #16801

Closed
spring-projects-issues opened this issue Sep 12, 2014 · 1 comment
Assignees
Labels
in: core status: backported type: bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Sep 12, 2014

Anton Ermolenko opened SPR-12187 and commented

Not actually false, but due to https://bugs.openjdk.java.net/browse/JDK-6695379 spring tries in inject dependencies into bridge methods in Java 8.

Test for annotations - http://pastebin.com/FRVmNmm1
Results - http://pastebin.com/k9zNpTh4

Due to this spring tries to inject dependencies into bridge methods.

Test app - for Spring - https://gist.github.com/DiKeert/1144549572771a1e3f36 - works great on Java 7, fails on Java 8.


Affects: 3.2.11, 4.0.7, 4.1 GA

Reference URL: https://gist.github.com/DiKeert/1144549572771a1e3f36

Issue Links:

  • #13302 Bridged method detection leads to false positive detection of autowired annotations
  • #17053 Java 8 introspection causes breakage with FreeMarker Configuration bean
  • #17096 @Resource injection broken under spring-framework > 4.1.0
  • #17101 Consistent bridge method handling in annotation post-processors

Referenced from: commits ec3967a, f4219ca, 354c3e0, 29abca5

Backported to: 4.0.8, 3.2.13

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Sep 18, 2014

Juergen Hoeller commented

As of 4.1.1, we're consistently excluding bridge methods in Spring's annotation post-processors now, not relying on bridge method resolution attempts like before.

I'm going to backport a minimal fix for the immediate problem to 4.0.8 as well.

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core status: backported type: bug
Projects
None yet
Development

No branches or pull requests

2 participants