|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2014 the original author or authors. |
| 2 | + * Copyright 2002-2015 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -126,25 +126,35 @@ public MultiValueMap<String, Object> getAllAnnotationAttributes(String annotatio
|
126 | 126 |
|
127 | 127 | @Override
|
128 | 128 | public boolean hasAnnotatedMethods(String annotationType) {
|
129 |
| - Method[] methods = getIntrospectedClass().getDeclaredMethods(); |
130 |
| - for (Method method : methods) { |
131 |
| - if (!method.isBridge() && AnnotatedElementUtils.isAnnotated(method, annotationType)) { |
132 |
| - return true; |
| 129 | + try { |
| 130 | + Method[] methods = getIntrospectedClass().getDeclaredMethods(); |
| 131 | + for (Method method : methods) { |
| 132 | + if (!method.isBridge() && AnnotatedElementUtils.isAnnotated(method, annotationType)) { |
| 133 | + return true; |
| 134 | + } |
133 | 135 | }
|
| 136 | + return false; |
| 137 | + } |
| 138 | + catch (Throwable ex) { |
| 139 | + throw new IllegalStateException("Failed to introspect annotated methods on " + getIntrospectedClass(), ex); |
134 | 140 | }
|
135 |
| - return false; |
136 | 141 | }
|
137 | 142 |
|
138 | 143 | @Override
|
139 | 144 | public Set<MethodMetadata> getAnnotatedMethods(String annotationType) {
|
140 |
| - Method[] methods = getIntrospectedClass().getDeclaredMethods(); |
141 |
| - Set<MethodMetadata> annotatedMethods = new LinkedHashSet<MethodMetadata>(); |
142 |
| - for (Method method : methods) { |
143 |
| - if (!method.isBridge() && AnnotatedElementUtils.isAnnotated(method, annotationType)) { |
144 |
| - annotatedMethods.add(new StandardMethodMetadata(method, this.nestedAnnotationsAsMap)); |
| 145 | + try { |
| 146 | + Method[] methods = getIntrospectedClass().getDeclaredMethods(); |
| 147 | + Set<MethodMetadata> annotatedMethods = new LinkedHashSet<MethodMetadata>(); |
| 148 | + for (Method method : methods) { |
| 149 | + if (!method.isBridge() && AnnotatedElementUtils.isAnnotated(method, annotationType)) { |
| 150 | + annotatedMethods.add(new StandardMethodMetadata(method, this.nestedAnnotationsAsMap)); |
| 151 | + } |
145 | 152 | }
|
| 153 | + return annotatedMethods; |
| 154 | + } |
| 155 | + catch (Throwable ex) { |
| 156 | + throw new IllegalStateException("Failed to introspect annotated methods on " + getIntrospectedClass(), ex); |
146 | 157 | }
|
147 |
| - return annotatedMethods; |
148 | 158 | }
|
149 | 159 |
|
150 | 160 | }
|
0 commit comments