alexeykudinkin commented on code in PR #5378:
URL: https://github.com/apache/hudi/pull/5378#discussion_r854785088
##########
hudi-common/src/main/java/org/apache/hudi/common/util/ReflectionUtils.java:
##########
@@ -85,11 +87,14 @@ public static <T extends HoodieRecordPayload> T
loadPayload(String recordPayload
* Creates an instance of the given class. Use this version when dealing
with interface types as constructor args.
*/
public static Object loadClass(String clazz, Class<?>[] constructorArgTypes,
Object... constructorArgs) {
- try {
- return
getClass(clazz).getConstructor(constructorArgTypes).newInstance(constructorArgs);
- } catch (InstantiationException | IllegalAccessException |
InvocationTargetException | NoSuchMethodException e) {
- throw new HoodieException("Unable to instantiate class " + clazz, e);
- }
+ return newInstanceUnchecked(getClass(clazz), constructorArgTypes,
constructorArgs);
+ }
+
+ /**
+ * Creates an instance of the given class. Constructor arg types are
inferred.
+ */
+ public static Object loadClass(String clazz, Object... constructorArgs) {
+ return newInstanceUnchecked(getClass(clazz), constructorArgs);
Review Comment:
On a second thought, it's a fair point that there's no reason to keep it in
this PR, since it's not used in it. Removed from it.
--
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]