|
41 | 41 | import org.springframework.core.annotation.MergedAnnotationPredicates;
|
42 | 42 | import org.springframework.core.annotation.MergedAnnotations;
|
43 | 43 | import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
44 |
| -import org.springframework.core.annotation.RepeatableContainers; |
45 | 44 | import org.springframework.jmx.export.metadata.InvalidMetadataException;
|
46 | 45 | import org.springframework.jmx.export.metadata.JmxAttributeSource;
|
47 | 46 | import org.springframework.util.StringUtils;
|
@@ -152,29 +151,23 @@ public void setBeanFactory(BeanFactory beanFactory) {
|
152 | 151 | public org.springframework.jmx.export.metadata.@Nullable ManagedOperationParameter[] getManagedOperationParameters(
|
153 | 152 | Method method) throws InvalidMetadataException {
|
154 | 153 |
|
155 |
| - List<MergedAnnotation<? extends Annotation>> anns = getRepeatableAnnotations( |
156 |
| - method, ManagedOperationParameter.class, ManagedOperationParameters.class); |
157 |
| - |
| 154 | + List<MergedAnnotation<? extends Annotation>> anns = getRepeatableAnnotations(method, ManagedOperationParameter.class); |
158 | 155 | return copyPropertiesToBeanArray(anns, org.springframework.jmx.export.metadata.ManagedOperationParameter.class);
|
159 | 156 | }
|
160 | 157 |
|
161 | 158 | @Override
|
162 | 159 | public org.springframework.jmx.export.metadata.@Nullable ManagedNotification[] getManagedNotifications(Class<?> clazz)
|
163 | 160 | throws InvalidMetadataException {
|
164 | 161 |
|
165 |
| - List<MergedAnnotation<? extends Annotation>> anns = getRepeatableAnnotations( |
166 |
| - clazz, ManagedNotification.class, ManagedNotifications.class); |
167 |
| - |
| 162 | + List<MergedAnnotation<? extends Annotation>> anns = getRepeatableAnnotations(clazz, ManagedNotification.class); |
168 | 163 | return copyPropertiesToBeanArray(anns, org.springframework.jmx.export.metadata.ManagedNotification.class);
|
169 | 164 | }
|
170 | 165 |
|
171 | 166 |
|
172 | 167 | private static List<MergedAnnotation<? extends Annotation>> getRepeatableAnnotations(
|
173 |
| - AnnotatedElement annotatedElement, Class<? extends Annotation> annotationType, |
174 |
| - Class<? extends Annotation> containerAnnotationType) { |
| 168 | + AnnotatedElement annotatedElement, Class<? extends Annotation> annotationType) { |
175 | 169 |
|
176 |
| - return MergedAnnotations.from(annotatedElement, SearchStrategy.TYPE_HIERARCHY, |
177 |
| - RepeatableContainers.of(annotationType, containerAnnotationType)) |
| 170 | + return MergedAnnotations.from(annotatedElement, SearchStrategy.TYPE_HIERARCHY) |
178 | 171 | .stream(annotationType)
|
179 | 172 | .filter(MergedAnnotationPredicates.firstRunOf(MergedAnnotation::getAggregateIndex))
|
180 | 173 | .map(MergedAnnotation::withNonMergedAttributes)
|
|
0 commit comments