whaon commented on code in PR #7794:
URL: https://github.com/apache/incubator-seata/pull/7794#discussion_r2558335735
##########
common/src/main/java/org/apache/seata/common/util/ReflectionUtil.java:
##########
@@ -705,6 +705,45 @@ public static Map<String, Object>
getAnnotationValues(Annotation annotation) thr
return getFieldValue(h, "memberValues");
}
+ /**
+ *
+ * @param targetClass the target class
+ * @param methodName the method name
+ * @param paramTypes the param types
+ * @param annotationClass the annotation class
+ * @return the annotation
+ * @param <A>
+ */
+ public static <A extends Annotation> A findAnnotationInHierarchy(
Review Comment:
you are right! the invoker will check the actual class first just as you wish
code is here:
```java
private <A extends Annotation> A findAnnotation(Method method, Class<?>
targetClass, Class<A> annotationClass) {
A anno = getAnnotation(method, targetClass, annotationClass);
if (anno == null) {
anno = ReflectionUtil.findAnnotationInHierarchy(
targetClass, method.getName(),
method.getParameterTypes(), annotationClass);
}
return anno;
}
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]