vaibhavk1992 commented on code in PR #843:
URL: https://github.com/apache/incubator-xtable/pull/843#discussion_r3572090276
##########
xtable-core/src/main/java/org/apache/xtable/conversion/ConversionTargetFactory.java:
##########
@@ -87,7 +90,21 @@ public ConversionTarget createConversionTargetForName(
TableFormat.DELTA.equalsIgnoreCase(tableFormatName)
&&
DeltaConversionTargetConfig.fromProperties(properties).isUseKernel();
ServiceLoader<ConversionTarget> loader =
ServiceLoader.load(ConversionTarget.class);
- for (ConversionTarget target : loader) {
+ Iterator<ConversionTarget> iterator = loader.iterator();
+ while (iterator.hasNext()) {
Review Comment:
The try-catch for ServiceConfigurationError | LinkageError is inside the
loop body, guarding only iterator.next(). Per the ServiceLoader contract,
Iterator.hasNext() can also throw ServiceConfigurationError when a
provider class fails to load. A broken provider discovered at hasNext() time
propagates uncaught out of createConversionTargetForName()
--
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]