Skip to content

Commit e773f63

Browse files
committed
review feedback
1 parent 1883906 commit e773f63

5 files changed

Lines changed: 9 additions & 7 deletions

File tree

common/src/main/java/org/apache/iceberg/common/DynClasses.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public Builder impl(String className) {
6767
try {
6868
this.foundClass = Class.forName(className, true, loader);
6969
} catch (ClassNotFoundException | NoClassDefFoundError | ExceptionInInitializerError e) {
70-
// not the right implementation
70+
// cannot load this implementation
7171
}
7272

7373
return this;

common/src/main/java/org/apache/iceberg/common/DynFields.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public Builder impl(String className, String fieldName) {
236236
Class<?> targetClass = Class.forName(className, true, loader);
237237
impl(targetClass, fieldName);
238238
} catch (ClassNotFoundException | NoClassDefFoundError | ExceptionInInitializerError e) {
239-
// not the right implementation
239+
// cannot load this implementation
240240
candidates.add(className + "." + fieldName);
241241
}
242242
return this;
@@ -285,7 +285,7 @@ public Builder hiddenImpl(String className, String fieldName) {
285285
Class<?> targetClass = Class.forName(className, true, loader);
286286
hiddenImpl(targetClass, fieldName);
287287
} catch (ClassNotFoundException | NoClassDefFoundError | ExceptionInInitializerError e) {
288-
// not the right implementation
288+
// cannot load this implementation
289289
candidates.add(className + "." + fieldName);
290290
}
291291
return this;

common/src/main/java/org/apache/iceberg/common/DynMethods.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public Builder impl(String className, String methodName, Class<?>... argClasses)
253253
Class<?> targetClass = Class.forName(className, true, loader);
254254
impl(targetClass, methodName, argClasses);
255255
} catch (ClassNotFoundException | NoClassDefFoundError | ExceptionInInitializerError e) {
256-
// not the right implementation
256+
// cannot load this implementation
257257
}
258258
return this;
259259
}
@@ -334,7 +334,7 @@ public Builder hiddenImpl(String className, String methodName, Class<?>... argCl
334334
Class<?> targetClass = Class.forName(className, true, loader);
335335
hiddenImpl(targetClass, methodName, argClasses);
336336
} catch (ClassNotFoundException | NoClassDefFoundError | ExceptionInInitializerError e) {
337-
// not the right implementation
337+
// cannot load this implementation
338338
}
339339
return this;
340340
}

core/src/main/java/org/apache/iceberg/InternalData.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ private static void registerSupportedFormats() {
6767

6868
} catch (NoSuchMethodException | NoClassDefFoundError | ExceptionInInitializerError e) {
6969
// failing to load Parquet is normal and does not require a stack trace
70-
LOG.info("Unable to register Parquet for metadata files: {}", e.getMessage());
70+
String message = e.getCause() != null ? e.getCause().getMessage() : e.getMessage();
71+
LOG.info("Unable to register Parquet for metadata files: {}", message);
7172
}
7273
}
7374

core/src/main/java/org/apache/iceberg/formats/FormatModelRegistry.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,11 @@ private static void registerSupportedFormats() {
207207
DynMethods.builder("register").impl(classToRegister).buildStaticChecked().invoke();
208208
} catch (NoSuchMethodException | NoClassDefFoundError | ExceptionInInitializerError e) {
209209
// failing to register a factory is normal and does not require a stack trace
210+
String message = e.getCause() != null ? e.getCause().getMessage() : e.getMessage();
210211
LOG.info(
211212
"Unable to call register for ({}). Check for missing jars on the classpath: {}",
212213
classToRegister,
213-
e.getMessage());
214+
message);
214215
}
215216
}
216217
}

0 commit comments

Comments
 (0)