@@ -131,27 +131,37 @@ public MultiValueMap<String, Object> getAllAnnotationAttributes(String annotatio
131
131
132
132
@ Override
133
133
public boolean hasAnnotatedMethods (String annotationName ) {
134
- Method [] methods = getIntrospectedClass ().getDeclaredMethods ();
135
- for (Method method : methods ) {
136
- if (!method .isBridge () && method .getAnnotations ().length > 0 &&
137
- AnnotatedElementUtils .isAnnotated (method , annotationName )) {
138
- return true ;
134
+ try {
135
+ Method [] methods = getIntrospectedClass ().getDeclaredMethods ();
136
+ for (Method method : methods ) {
137
+ if (!method .isBridge () && method .getAnnotations ().length > 0 &&
138
+ AnnotatedElementUtils .isAnnotated (method , annotationName )) {
139
+ return true ;
140
+ }
139
141
}
142
+ return false ;
143
+ }
144
+ catch (Throwable ex ) {
145
+ throw new IllegalStateException ("Failed to introspect annotated methods on " + getIntrospectedClass (), ex );
140
146
}
141
- return false ;
142
147
}
143
148
144
149
@ Override
145
150
public Set <MethodMetadata > getAnnotatedMethods (String annotationName ) {
146
- Method [] methods = getIntrospectedClass ().getDeclaredMethods ();
147
- Set <MethodMetadata > annotatedMethods = new LinkedHashSet <MethodMetadata >();
148
- for (Method method : methods ) {
149
- if (!method .isBridge () && method .getAnnotations ().length > 0 &&
150
- AnnotatedElementUtils .isAnnotated (method , annotationName )) {
151
- annotatedMethods .add (new StandardMethodMetadata (method , this .nestedAnnotationsAsMap ));
151
+ try {
152
+ Method [] methods = getIntrospectedClass ().getDeclaredMethods ();
153
+ Set <MethodMetadata > annotatedMethods = new LinkedHashSet <MethodMetadata >();
154
+ for (Method method : methods ) {
155
+ if (!method .isBridge () && method .getAnnotations ().length > 0 &&
156
+ AnnotatedElementUtils .isAnnotated (method , annotationName )) {
157
+ annotatedMethods .add (new StandardMethodMetadata (method , this .nestedAnnotationsAsMap ));
158
+ }
152
159
}
160
+ return annotatedMethods ;
161
+ }
162
+ catch (Throwable ex ) {
163
+ throw new IllegalStateException ("Failed to introspect annotated methods on " + getIntrospectedClass (), ex );
153
164
}
154
- return annotatedMethods ;
155
165
}
156
166
157
167
}
0 commit comments