-
-
Notifications
You must be signed in to change notification settings - Fork 710
Closed
Description
Hi
After updated to 0.10 or 0.10.1, Reflections library doesn't works correctly with .getMethodsAnnotatedWith() deprecated method.
Works well with the version 0.9.11
Bellow the code to reproduce it
Thanks a lot for all your works
Cheers
package my.test;
import java.lang.reflect.Method;
import org.reflections.Reflections;
import org.reflections.scanners.MethodAnnotationsScanner;
import org.reflections.util.ClasspathHelper;
import org.reflections.util.ConfigurationBuilder;
public class FailedReflection10OnAnnotatedMethod {
public static void main(String[] args) {
Reflections reflections = new Reflections(new ConfigurationBuilder().setUrls(ClasspathHelper.forPackage("my.test")).setScanners(new MethodAnnotationsScanner()));
for (Method method : reflections.getMethodsAnnotatedWith(AnAnnotation.class)) {
System.out.println("found " + method.getName());
}
}
}
package my.test;
public class ClassWithAnnotatedMethod {
@AnAnnotation
public void annotatedMethod() {
}
}
package my.test;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface AnAnnotation {
}