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

Duplicate bridge methods #4

Closed
timowest opened this issue May 6, 2014 · 11 comments · Fixed by #8
Closed

Duplicate bridge methods #4

timowest opened this issue May 6, 2014 · 11 comments · Fixed by #8

Comments

@timowest
Copy link
Contributor

timowest commented May 6, 2014

I get duplicate bridge methods generated by the bridge-method-injector when I compile with JDK 8 resulting in errors like these

[ERROR] java.lang.ClassFormatError: Duplicate method name&signature in class file com/mysema/query/sql/ProjectableSQLQuery

It appears JDK 8 copies annotations to bridge methods as well https://bugs.openjdk.java.net/browse/JDK-6695379

So in cases where the compiler generates a bridge methods for an annotated method there will be two bridge methods generated by this plugin, one delegating to the original method and one to the bridge method.

Would it be possible to add a duplicate filter or skip bridge method target methods?

@timowest
Copy link
Contributor Author

timowest commented May 9, 2014

I think the synthetic check should be done here https://github.com/infradna/bridge-method-injector/blob/master/injector/src/main/java/com/infradna/tool/bridge_method_injector/MethodInjector.java#L249

Synthetic methods should be skipped in processing.

@jglick
Copy link
Member

jglick commented May 9, 2014

A pull request with accompanying test (which fails on Java 8 without the fix) would be ideal.

@timowest
Copy link
Contributor Author

timowest commented May 9, 2014

Ok, I will give it a try.

@timowest
Copy link
Contributor Author

@jglick Do you have an ETA for the fix? This issue is an impediment for us in jdk8 adoption.

@jglick
Copy link
Member

jglick commented May 12, 2014

This is @kohsuke’s project, not mine.

@timowest
Copy link
Contributor Author

@kohsuke Do you have an estimate when a fix could be provided? It seems easy to fix and would make this project more usable for jdk8 based usage.

@timowest
Copy link
Contributor Author

@kohsuke Shall I also provide a pull request for the fix?

@timowest
Copy link
Contributor Author

I added now a pull request. Would it be possible to get a release or snapshot with this fix?

@timowest
Copy link
Contributor Author

I minimized now the changes in the pull request.

@irobertson
Copy link
Contributor

Timo,

Thanks for the fix! I've looked over the pull request; it looks good, and
I've merged it in. I believe only @kohsuke can cut (and deploy) a new
release.

  • Ian

On Tue, Jun 17, 2014 at 1:11 PM, Timo Westkämper notifications@github.com
wrote:

I minimized now the changes in the pull request.


Reply to this email directly or view it on GitHub
#4 (comment)
.

@timowest
Copy link
Contributor Author

@kohsuke Any chance to get a release including this fix in the near future?

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

Successfully merging a pull request may close this issue.

3 participants