Copilot commented on code in PR #30184:
URL: https://github.com/apache/flink/pull/30184#discussion_r4723821821


##########
flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/fs/hdfs/HadoopFsFactory.java:
##########
@@ -113,7 +113,8 @@ public FileSystem create(URI fsUri) throws IOException {
                     scheme,
                     fsClass.getName());
 
-            final org.apache.hadoop.fs.FileSystem hadoopFs = 
fsClass.newInstance();
+            final org.apache.hadoop.fs.FileSystem hadoopFs =
+                    fsClass.getDeclaredConstructor().newInstance();

Review Comment:
   If a configured Hadoop filesystem constructor throws an `IOException`, this 
call wraps it in `InvocationTargetException`, so the outer 
`ReflectiveOperationException` catch reports missing Hadoop classes instead of 
propagating the I/O failure. This misclassifies the failure as an unsupported 
scheme and can hide the original cause. Unwrap constructor failures before the 
outer catches to preserve the existing error handling.



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