-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
NEW
-
NEW
ProjectClassLoader.getResource*s*("org/foo") returns an enumeration with 0 elements. That should be 1 element (most of the time anyway, as we don't have split packages).
See screenshot to learn how a getResources(String) should behave
public class ClassLoaderGetResourcesExperiment { public static void main(String[] args) throws IOException { ClassLoader classLoader = ClassLoaderGetResourcesExperiment.class.getClassLoader(); printEnumeration(classLoader, "org/optaplanner/core/experiment"); printEnumeration(classLoader, "org/optaplanner/core/experiment/sub1"); printEnumeration(classLoader, "org/optaplanner/core/experiment/sub2"); printEnumeration(classLoader, "org/optaplanner/core/experiment/sub3"); } public static void printEnumeration(ClassLoader classLoader, String s) throws IOException { Enumeration<URL> enumeration = classLoader.getResources(s); System.out.println(s); System.out.println("================================"); while (enumeration.hasMoreElements()) { Object nextElement = enumeration.nextElement(); System.out.println(" " + nextElement); } } }
- blocks
-
PLANNER-522 scanAnnotatedClasses is not compatible with non-default ClassLoader or KieContainer because it doesn't take it into account
- Resolved