LeonxLJX opened a new pull request, #19784: URL: https://github.com/apache/hudi/pull/19784
### Problem `ReflectionUtils#getTopLevelClassesInClasspath` is written as a verbose imperative loop and contains a latent bug: if `ClassLoader#getResources` throws an `IOException`, `resources` stays `null` and the subsequent `Objects.requireNonNull(resources)` throws an `NPE` instead of degrading gracefully. ### Changes - Rewrite the method as a stream pipeline over the package resources (`Collections.list` + `map`/`filter`/`flatMap`). - Return an empty stream on `IOException` instead of crashing with an NPE. - Extract a small private helper `toDirectory` to map a resource `URL` to a `File`, logging and skipping malformed URIs as before. ### Verification Behavior is unchanged for the normal path (verified with a local reproduction over a real `URLClassLoader` and a package directory tree: all classes in the package and subpackages are returned, and a missing/erroring package yields an empty stream). -- 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]
