VahidRamezaniDB commented on code in PR #17675:
URL: https://github.com/apache/hudi/pull/17675#discussion_r2643284040
##########
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:
Sure.
I added the unit tests at b1c30cb2531cf116d29eb3775d0c2bb05cb28cb5
I have also made a small change to make the original method safe against NPE
at adde5394b54575ae73631ea3d9bf710039cf77ea
--
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]