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

Problems with method references (ClasNotFoundException) #49

Closed
rjahn opened this issue Apr 8, 2015 · 5 comments
Closed

Problems with method references (ClasNotFoundException) #49

rjahn opened this issue Apr 8, 2015 · 5 comments

Comments

@rjahn
Copy link

rjahn commented Apr 8, 2015

It's a little bit tricky:

We have following code in one of our JavaFX classes:
(Complete source code: http://sourceforge.net/p/jvxfx/code/919/tree/branches/dev2015/java/src/com/sibvisions/rad/ui/javafx/ext/FXButton.java)

@Override
protected void layoutChildren()
{
  LayoutUtil.layoutContent(this, this, null, super::layoutChildren, 
                           super::computePrefWidth, super::computePrefHeight);
}

and the utility method:

public static void layoutContent(Region pContainer, IFXContentAlignable pContentAlignable, 
                                 String pContentSelector, Runnable pDoLayout, 
                                 DoubleUnaryOperator pDefaultPrefWidth, 
                                 DoubleUnaryOperator pDefaultPrefHeight)
{
  ...
}

javac doesn't like the code and throws errors -> great.
JDT (Luna version) compiles the code without warnings and errors.

retrolambda converts the class with above code without problems but after installing the whole application with JavaFX and javafxports on an Android tablet, a ClassNotFoundException occurs. But the class is available and was created from retrolambda.

If you have an idea about the problem, it would be great because it's complicated to send you the whole application.

We fixed javac problems in our current revision, but maybe this problem could help to improve retrolambda?

@luontola
Copy link
Owner

luontola commented Apr 8, 2015

Which Retrolambda version are you using? Please try both versions 1.8.1 and 2.0.1.

Please post the full stack trace, the output from Retrolambda and a link to a ZIP containing the following .class files:

  • The class mentioned in the ClassNotFoundException's message
  • The class which tried using that class, i.e. the class at the top of the stack trace
  • For all of the above, all classes that were generated from the same .java file, including the top-level class and all its inner classes
  • For all of the above, both the "before" and "after" versions of processing the classes with Retrolambda

@rjahn
Copy link
Author

rjahn commented Apr 9, 2015

Zip Archive: http://www.sibvisions.com/files/download/issue_49_classes.zip

The 'button' folder contains relevant classes and 'all' folder contains the whole lib (if I forgot something)

Retrolambda version: 2.0.1

I'll try 1.8.1 today.

@rjahn
Copy link
Author

rjahn commented Apr 9, 2015

Same problem with 1.8.1

@luontola
Copy link
Owner

The lambda class giving the error implements java.util.function.DoubleUnaryOperator which was added in Java 8 and probably won't exist on Android. Can you change the layoutContent method to not use Java 8 APIs?

@rjahn
Copy link
Author

rjahn commented Apr 15, 2015

Clear and sure. We solved the problem with a helper interface.

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

No branches or pull requests

2 participants