aibar / reflections

Automatically exported from code.google.com/p/reflections
Do What The F*ck You Want To Public License
0 stars 0 forks source link

Possible incompatibility to java 8 #169

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create Java 8 Project
2. Create Class that use some Java 8 Feature (i used lambda)
3. Try to reflect the class in a way that reflections have.

What is the expected output? What do you see instead?
In my case i wanted a list of 3 classes that implements an interface.
If i remove the lambda, then i get it, in other case i don´t

What version of the product are you using? On what operating system?
0.9.9-RC1

Please provide any additional information below.
public class a/b/c implements interfaceA

reflections.getSubTypeOf(interfaceA.class); >> Empty Set

I tried all ways i found in wiki and other websites to create the Reflections 
class.

Best Regards,
Maik Brockhaus

Original issue reported on code.google.com by maik.bro...@gmail.com on 6 Feb 2014 at 12:42

GoogleCodeExporter commented 9 years ago
I see the same issue using Reflections 0.9.8

Original comment by ursreu...@gmail.com on 4 May 2014 at 8:33

GoogleCodeExporter commented 9 years ago
Looking through the code, I surmise that this is actually an issue with the 
version of the Javassist-library used in Reflections
Java 8 lambdas use the "invokeDynamic" facility available since Java 7, which 
is yet unsupported by the version of Javassist included in Reflections. To the 
version used, classes using lambdas and method references look illegal, since 
they contain unknown elements.

As far as I can see, Javassist has had support for "invokeDynamic" for a while 
now, and there are two newer versions of the library available. 

Updating Reflections to use the most recent Javassist 3.18.1-GA should fix this 
issue.

Original comment by ursreu...@gmail.com on 4 May 2014 at 9:08

GoogleCodeExporter commented 9 years ago
I have tested with a local build and can confirm that updating the dependency 
to the latest version fixes the issue.

Since ronmamo already made that change on Github, I will ask for a fresh 
snapshot there.

Original comment by ursreu...@gmail.com on 4 May 2014 at 9:51

GoogleCodeExporter commented 9 years ago
Thanks for the feedback, ursrepue. release is on the way...

Original comment by ronm...@gmail.com on 5 Jun 2014 at 6:53