This is an automated email from the ASF dual-hosted git repository.
yzhao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mnemonic.git
The following commit(s) were added to refs/heads/master by this push:
new 0ef0a74 MNEMONIC-683: Remove deprecation warning during gradle build
0ef0a74 is described below
commit 0ef0a74eafc1a13c5993a2e6e68fb5d7931c6c22
Author: Xiaojin Jiao <[email protected]>
AuthorDate: Thu Sep 2 22:56:35 2021 -0700
MNEMONIC-683: Remove deprecation warning during gradle build
Signed-off-by: Xiaojin Jiao <[email protected]>
---
mnemonic-core/src/main/java/org/apache/mnemonic/Utils.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mnemonic-core/src/main/java/org/apache/mnemonic/Utils.java
b/mnemonic-core/src/main/java/org/apache/mnemonic/Utils.java
index 45f07ee..53dc03c 100644
--- a/mnemonic-core/src/main/java/org/apache/mnemonic/Utils.java
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/Utils.java
@@ -36,6 +36,7 @@ import java.util.List;
import java.util.Random;
import java.util.ServiceLoader;
import java.util.UUID;
+import java.lang.reflect.InvocationTargetException;
/**
* <p>
@@ -492,12 +493,12 @@ public class Utils {
try {
for (Class<?> itm : proxyclses) {
if (EntityFactoryProxy.class.isAssignableFrom(itm)) {
- ret.add((EntityFactoryProxy)itm.newInstance());
+
ret.add((EntityFactoryProxy)itm.getDeclaredConstructor().newInstance());
} else {
throw new ConfigurationException(String.format("%s is not
EntityFactoryProxy", itm.getName()));
}
}
- } catch (InstantiationException | IllegalAccessException e) {
+ } catch (InstantiationException | IllegalAccessException |
NoSuchMethodException | InvocationTargetException e) {
throw new IllegalArgumentException("Failed to instantiate assigned
EntityFactoryProxy classes.", e);
}
return ret.toArray(new EntityFactoryProxy[0]);