wombatu-kun commented on code in PR #15912:
URL: https://github.com/apache/iceberg/pull/15912#discussion_r3361618998


##########
core/src/main/java/org/apache/iceberg/CatalogUtil.java:
##########
@@ -407,14 +407,7 @@ public static FileIO loadFileIO(
           String.format("Cannot initialize FileIO implementation %s: %s", 
impl, e.getMessage()), e);
     }
 
-    FileIO fileIO;
-    try {
-      fileIO = ctor.newInstance();
-    } catch (ClassCastException e) {
-      throw new IllegalArgumentException(
-          String.format("Cannot initialize FileIO, %s does not implement 
FileIO.", impl), e);
-    }
-
+    FileIO fileIO = ctor.newInstance();

Review Comment:
   DynConstructors now throws IllegalArgumentException in impl()/hiddenImpl() 
before newInstance() runs, so this ClassCastException branch is unreachable - 
and so are the identical catches left in the sibling loaders: loadCatalog (line 
288) and loadMetricsReporter (line 538) in this file, plus 
LocationProviders.java:63, rest/HTTPClient.java:461, and azure 
AdlsTokenCredentialProviders.java:74, all paths whose tests this PR already 
updated to the new message. The same now-dead pattern also exists in other 
builder(base) callers (AwsClientFactories, S3FileIOAwsClientFactories, 
AuthManagers, LockManagers, EncryptionUtil, Dell/Aliyun factories). Consider 
removing them here for consistency.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to