ericparshall / 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

Classes with methods returning lambdas don't show up with getTypesAnnotatedWith #188

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
To Reproduce:

1 Create a simple annotation class:
@Retention(RetentionPolicy.RUNTIME)
public @interface MyAnnotation {
    String someValue();
}

2. Create some class that uses this annotation, with a method that returns a 
functional interface 
@MyAnnotation(someValue = "a")
public class FooBar extends BaseClass {

    @Override
    public Consumer<Integer> doSomething() {
        return (x) -> { return; };
    }
}

3. Try to find the classes using the annotation:
Set<Class<?>> clazzes  = reflections.getTypesAnnotatedWith(MyAnnotation.class);

The set clazzes will be empty if one method in the FooBar class returns a 
lambda. However if it returns null or an anonymous implementation of 
Consumer<Integer> instead, it will show up in the set.

Version used is 0.9.9-RC1

Original issue reported on code.google.com by jacob.id...@twobotechnologies.com on 3 Mar 2015 at 11:41

GoogleCodeExporter commented 9 years ago
Seems like version 0.9.9 does not have this issue only RC1 so it can be closed.

Original comment by jacob.id...@twobotechnologies.com on 3 Mar 2015 at 1:07