-
Notifications
You must be signed in to change notification settings - Fork 227
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
Populate default methods, when interfaces are in classpath and not in input directory #101
Conversation
Hi, i suppose that PR try to mitigate the known limitation of: "Also, backporting default methods won't work across module or dependency boundaries." I'm trying to use retrolamnda with this project: https://code.onehippo.org/cms-community/hippo-cms I add this (inside build tag) in parent pom.xml
after compile your fork (notice 2.3.1-SNAPSHOT) but [ERROR] /home/jose/git/hippocms/hippo-cms/perspectives/src/main/java/org/hippoecm/frontend/plugins/cms/browse/service/IBrowserSection.java:[30,7] error: cannot access IconProvider IBrowserSection it's inside hippo-cms-perspectives and IconProvider insede hippo-cms-api, a
for the first module.. when you talk "classpath" talk about "maven dependency"? To solve my issue i was going to try the maven resources plugin: copy-resources, but i saw your PR and i thought it could solve my problem... maybe not for maven pluging, only command line? Thanks. |
I have tried it as a maven plugin and works fine (actually this is the way I use it). |
Hi, thanks for answer. The first problem was i didn't read the logs... WARNING: The interface org/hippoecm/frontend/skin/IconProvider has a default method "getIcon" but backporting default methods is not enabled and the second was i don't understood, that the problem was in compilation phase (because the previous backporting of the default method) [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ hippo-cms-perspectives --- But when i "enable defafult method backport in configuration of maven"
The error changed [ERROR] /home/jose/git/hippocms/hippo-cms/perspectives/src/main/java/org/hippoecm/frontend/plugins/cms/browse/section/BrowsingSectionPlugin.java:[38,7] error: BrowsingSectionPlugin is not abstract and does not override abstract method getIcon(String,IconSize) in IconProvider because decompiling IconProvider... public abstract interface IconProvider extends IClusterable { from original source public interface IconProvider extends IClusterable { and
and
What do you think... i think my problem isn't with classpath and it's about how default methods are backported... Did you succed compile the hole proyect? |
You mean the retrolambda project? |
Nop, i refer to compile https://code.onehippo.org/cms-community/hippo-cms with retrolambda and default method activated. i could compiled your PR without problem... And now, i thing my problem never was about classloading, and yes about this #58 If you wanna talk about this, send me a mail (it's in my github profile)... maybe this issue isn't the best place for now.. |
I'd suggest to try to compile it with the classfiles unzipped first. Then try with this patch. |
Hi @teras can you tell me some public proyect where you use this PR? Thx |
I don't have any public, sorry. |
Hi, could you try with my code repo (hippocms) to ser what happen to me? Thanks in advance. |
@teras here is a full history of my problem... i'm going to try to reproduce with a small mutliproject.. but do you think that could be possible if the name of the default method exist (with another arguments) the retrolambda library not implemente, because think that exists? And thats my problem? Because your PR could search in the maven classpath and solve multimodule problem... but not for my... @orfjackal what do you think about this? Thanks to all. |
Hi @teras can you try defaultproject.zip this simple project? is it supposed to works? defaultproject/module2/src/main/java/com/test/retrolambda/module2/ChildClass.java:[5,8] com.test.retrolambda.module2.ChildClass is not abstract and does not override abstract method getIcon(java.lang.String,java.lang.String) in com.test.retrolambda.module1.ParentClass Please, could you try it? Could be great that improve this PR to make it work "multimodule" integration via "classpath of maven" ;) |
Here is a proposal. I tried to be as lees intrusive as possible. If you wish we can discuss the patch.