You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by jo...@apache.org on 2022/12/01 07:55:59 UTC

[incubator-eventmesh] branch master updated: remove deprecated methods (#2328)

This is an automated email from the ASF dual-hosted git repository.

jonyang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-eventmesh.git


The following commit(s) were added to refs/heads/master by this push:
     new 5b1a0e171 remove deprecated methods (#2328)
5b1a0e171 is described below

commit 5b1a0e171dbd0b074a924e7cc50121c37d76581c
Author: weihubeats <we...@163.com>
AuthorDate: Thu Dec 1 15:55:53 2022 +0800

    remove deprecated methods (#2328)
---
 .../java/org/apache/eventmesh/spi/EventMeshExtensionFactory.java | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/eventmesh-spi/src/main/java/org/apache/eventmesh/spi/EventMeshExtensionFactory.java b/eventmesh-spi/src/main/java/org/apache/eventmesh/spi/EventMeshExtensionFactory.java
index eb4de8aa8..ee4d745a4 100644
--- a/eventmesh-spi/src/main/java/org/apache/eventmesh/spi/EventMeshExtensionFactory.java
+++ b/eventmesh-spi/src/main/java/org/apache/eventmesh/spi/EventMeshExtensionFactory.java
@@ -23,6 +23,7 @@ import org.apache.eventmesh.spi.loader.MetaInfExtensionClassLoader;
 
 import org.apache.commons.lang3.StringUtils;
 
+import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -84,11 +85,11 @@ public class EventMeshExtensionFactory {
                 if (extensionInstanceClass == null) {
                     return null;
                 }
-                T extensionInstance = extensionInstanceClass.newInstance();
+                T extensionInstance =  extensionInstanceClass.getDeclaredConstructor().newInstance();
                 logger.info("initialize extension instance success, extensionType: {}, extensionInstanceName: {}",
                     extensionType, extensionInstanceName);
                 return extensionInstance;
-            } catch (InstantiationException | IllegalAccessException e) {
+            } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {
                 throw new ExtensionException("Extension initialize error", e);
             }
         });
@@ -100,11 +101,11 @@ public class EventMeshExtensionFactory {
             if (extensionInstanceClass == null) {
                 return null;
             }
-            T extensionInstance = extensionInstanceClass.newInstance();
+            T extensionInstance = extensionInstanceClass.getDeclaredConstructor().newInstance();
             logger.info("initialize extension instance success, extensionType: {}, extensionName: {}",
                 extensionType, extensionInstanceName);
             return extensionInstance;
-        } catch (InstantiationException | IllegalAccessException e) {
+        } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {
             throw new ExtensionException("Extension initialize error", e);
         }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org