Skip to content

Commit

Permalink
fix: fix the signature error when using reflection to access the org.…
Browse files Browse the repository at this point in the history
…springframework.core.annotation.AnnotatedElementUtils#getMergedAnnotation method

Fix the problem,the method
org.apache.dubbo.config.spring.util.AnnotationUtils#tryGetMergedAnnotation
utilizes reflection to access
org.springframework.core.annotation.AnnotatedElementUtils#getMergedAnnotation.
However, there is a signature mismatch in the method's input parameters,
which leads to an inability to retrieve the correct method.
Consequently, this results in the failure to obtain the
mergedAnnotation.
  • Loading branch information
jkoChen committed May 6, 2024
1 parent 20f252d commit 50760c4
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,14 @@ public static Annotation tryGetMergedAnnotation(
annotationType,
classValuesAsString,
nestedAnnotationsAsMap);
} else {
//fix getMergedAnnotation method signature error
getMergedAnnotationMethod = findMethod(
annotatedElementUtilsClass, "getMergedAnnotation", AnnotatedElement.class, Class.class);
if (getMergedAnnotationMethod != null) {
mergedAnnotation = (Annotation)
invokeMethod(getMergedAnnotationMethod, null, annotatedElement, annotationType);
}
}
}

Expand Down

0 comments on commit 50760c4

Please sign in to comment.