VahidRamezaniDB commented on code in PR #17675:
URL: https://github.com/apache/hudi/pull/17675#discussion_r2644368860
##########
hudi-io/src/main/java/org/apache/hudi/common/util/ReflectionUtils.java:
##########
@@ -134,26 +133,23 @@ public static Stream<String>
getTopLevelClassesInClasspath(Class<?> clazz) {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
String packageName = clazz.getPackage().getName();
String path = packageName.replace('.', '/');
- Enumeration<URL> resources = null;
+
try {
- resources = classLoader.getResources(path);
+ return Collections.list(classLoader.getResources(path)).stream()
Review Comment:
Actually I have found out that when running tests with maven the classes are
typically loaded from a JAR. The URLs for resources inside a JAR have the "jar"
protocol (e.g.,
`jar:file:/path/to/your-project/target/test-classes.jar!/com/example/package`)
and their URIs are not "hierarchical" in the way `File` expects. So this is why
the CI fails with test failures. I'm currently working on the solution and will
change the ReflectionUtil method in a way to handle both "file" and "jar"
protocols. If you have any other solutions or workarounds or you think the code
is good enough the way it is (since the prev version also would have this
problem), please tell me.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]