You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Input parameters are in params
Lines 71-76 - a new list parameters is created, where the normalized parameters are supposed to go, anything iterable or any arrays in params are expanded as individual items into parameters, everything else is copied as is.
Then, lines 78-79, all class loaders found in params are added with addClassLoaders() to the builder. Why "params", and not "parameters"?, AFAIU, this should go over "parameters".
Then, lines 84-101, the individual parameters are processed for usage. Anything that is not recognized causes a ReflectionsException to be thrown. ClassLoaders are not recognized as parameters at this point, so if any found in parameters, the method throws. Since nothing cleaned the class loaders from the parameters adding an instance of a classLoader to the parameters just throws.
IMHO, classloaders should be checked in the "if" chain that's on lines 84-101, and plainly ignored.
The text was updated successfully, but these errors were encountered:
will throw org.reflections.ReflectionsException: could not use param
This is due to the fact, that the implementation of the ConfigurationBuilder.build() method in org.reflections 0.10.2 correctly identifies the classloader param and adds it to the internal list of classloaders, but does not remove them from the internal list of parameters; as a consequence, the subsequent if-else instanceof cascade runs into the final fallback branch that throws a ReflectionException.
Mind that this is a rather annoying bug since it breaks code that worked flawlessly in org.reflections 0.9.12.
ConfigurationBuilder.java:
Input parameters are in
params
Lines 71-76 - a new list
parameters
is created, where the normalized parameters are supposed to go, anything iterable or any arrays inparams
are expanded as individual items intoparameters
, everything else is copied as is.Then, lines 78-79, all class loaders found in
params
are added withaddClassLoaders()
to the builder. Why "params", and not "parameters"?, AFAIU, this should go over "parameters".Then, lines 84-101, the individual parameters are processed for usage. Anything that is not recognized causes a
ReflectionsException
to be thrown. ClassLoaders are not recognized as parameters at this point, so if any found inparameters
, the method throws. Since nothing cleaned the class loaders from the parameters adding an instance of a classLoader to the parameters just throws.IMHO, classloaders should be checked in the "if" chain that's on lines 84-101, and plainly ignored.
The text was updated successfully, but these errors were encountered: