hudi-agent commented on code in PR #19188:
URL: https://github.com/apache/hudi/pull/19188#discussion_r3523521843


##########
hudi-io/src/main/java/org/apache/hudi/common/util/ReflectionUtils.java:
##########
@@ -136,15 +136,15 @@ public static Stream<String> 
getTopLevelClassesInClasspath(Class<?> clazz) {
     try {
       resources = classLoader.getResources(path);
     } catch (IOException e) {
-      log.error("Unable to fetch Resources in package " + e.getMessage());
+      log.error("Unable to fetch Resources in package {}", e.getMessage());

Review Comment:
   🤖 nit: the `{}` placeholder reads as if it's interpolating the package name, 
but it's actually `e.getMessage()` — could you drop the placeholder and pass 
`e` directly instead, e.g. `log.error("Unable to fetch resources in package", 
e)`? SLF4J appends the full stack trace automatically when the last arg is a 
`Throwable`, which is much more useful for debugging.
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



##########
hudi-io/src/main/java/org/apache/hudi/common/util/ReflectionUtils.java:
##########
@@ -136,15 +136,15 @@ public static Stream<String> 
getTopLevelClassesInClasspath(Class<?> clazz) {
     try {
       resources = classLoader.getResources(path);
     } catch (IOException e) {
-      log.error("Unable to fetch Resources in package " + e.getMessage());
+      log.error("Unable to fetch Resources in package {}", e.getMessage());
     }
     List<File> directories = new ArrayList<>();
     while (Objects.requireNonNull(resources).hasMoreElements()) {
       URL resource = resources.nextElement();
       try {
         directories.add(new File(resource.toURI()));
       } catch (URISyntaxException e) {
-        log.error("Unable to get " + e.getMessage());
+        log.error("Unable to get {}", e.getMessage());

Review Comment:
   🤖 nit: same as above — could you pass `e` directly rather than 
`e.getMessage()`, e.g. `log.error("Unable to convert resource URL to URI", e)`, 
to keep the stack trace in the logs?
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



-- 
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]

Reply via email to