-
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
Can not populate default methods, when interfaces are in classpath and not in input directory #98
Comments
This is one of the limitations of backporting default methods. It requires the interface and all classes that implement it to be together in the same inputdir. https://github.com/orfjackal/retrolambda#known-limitations |
Ideas of how to implement the backporting reliably without that limitation are welcome. Pull requests even more so. One option might be to tag all backported interfaces and if Retrolambda finds that tag in an implemented interface, it would add the necessary method implementations. Or it could check if an |
On the restrictions this wasn't clear. It is said only "in one go", which makes sense and in this exemple is "in one go". I'll be happy to help coding, although not proficient with Retrolambda. Ideas now. I was thinking something like
An alternate pipeline, depending on Retrolambda own pipeline could be:
I am not general in favour of keeping the Interface.class files, since these will appear in the original classpath anyway, and for someone to use it, there is a need to transform the original library to Java 7 anyway. Thus, deleting will leave a cleaner code IMHO. PS: I am thinking to do the second option in my own project anyway, since I can't right now update retrolambda. |
Hello again. Any comments on the pull request I proposed to solve this issue? |
Let's have an interface in a stand alone project. The compiled classes can be found (let's say) under target/lib . The source is as follows:
Then, let's assume that we have another class, where the compiled classes could be found under target/classes, and the code is as follows:
If we execute retrolambda like this,
java -Dretrolambda.inputDir=target/classes -Dretrolambda.classpath=target/classes:target/lib -Dretrolambda.defaultMethods=true -jar retrolambda-2.3.0.jar
then javap produces the next output:If I move the interface to the inputdir folder, then I get this output:
I would expect that, no matter where the interface is, the "produced" Main class to have the missing method injected, as well as the produced test/AnInterface$.class to appear in the output folder. But this is not the case.
Am I missing something?
Is this a feature request?
The text was updated successfully, but these errors were encountered: