Vicky
Vicky

Reputation: 17375

Reflections 0.10.1 and 0.10.2 broken for ClassLoaders?

I have some existing code which uses Reflections like this:

    ClassLoader myClassLoader = MyClassUtils.getMyClassLoader();
    // above call returns a URLClassLoader
    Reflections reflections = new Reflections(myClassLoader);

This code was working fine up until version 0.9.12

However, its breaking in versions 0.10.1 and 0.10.2.

On checking the sources, I found that in ConfigurationBuilder class of 0.9.12, there was this logic in build method of ConfigurationBuilder:

else if (param instanceof ClassLoader) { /* already taken care */ }

However, this has been removed in the future versions. Because of this, if the params are instance of ClassLoader it throws ReflectionsException.

Can anyone please guide if the way we use this has changed ?

Thanks!

Upvotes: 2

Views: 94

Answers (0)

Related Questions