You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/10/08 03:13:11 UTC

[dubbo] branch 3.0 updated: recover some reflection utils (#8968)

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

albumenj pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new 42a04c2  recover some reflection utils (#8968)
42a04c2 is described below

commit 42a04c219096297cffba8d183af78e6ecfd03b41
Author: yangzan0816 <84...@qq.com>
AuthorDate: Fri Oct 8 11:12:54 2021 +0800

    recover some reflection utils (#8968)
    
    Co-authored-by: yangzan <ya...@gmail.com>
---
 .../java/org/apache/dubbo/common/utils/ReflectUtils.java    | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/ReflectUtils.java b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/ReflectUtils.java
index af3c627..8f7339b 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/ReflectUtils.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/ReflectUtils.java
@@ -1330,6 +1330,19 @@ public final class ReflectUtils {
         return types;
     }
 
+    public static boolean checkZeroArgConstructor(Class clazz) {
+        try {
+            clazz.getDeclaredConstructor();
+            return true;
+        } catch (NoSuchMethodException e) {
+            return false;
+        }
+    }
+
+    public static boolean isJdk(Class clazz) {
+        return clazz.getName().startsWith("java.") || clazz.getName().startsWith("javax.");
+    }
+
     /**
      * Copy from org.springframework.util.ReflectionUtils.
      * Make the given method accessible, explicitly setting it accessible if