reflections icon indicating copy to clipboard operation
reflections copied to clipboard

Method getTypesAnnotatedWith() throws StackOverflowError

Open volkovs opened this issue 8 years ago • 1 comments

Might be related to #137. Reproduced if annotation annotates itself (like here).

Example:

public static void main(String[] args) {
    Reflections reflections = new Reflections("");

    // this works just fine
    reflections.getTypesAnnotatedWith(Deprecated.class);

    // "recursive annotation" throws StackOverflowError in 0.9.10 (worked in 0.9.8)
    reflections.getTypesAnnotatedWith(MyDeprecated.class);
}

@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(value={CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE})
@MyDeprecated
public @interface MyDeprecated {
}

volkovs avatar Jun 17 '16 11:06 volkovs