File tree 2 files changed +5
-8
lines changed
main/java/org/springframework/data/mapping/model
test/java/org/springframework/data/mapping/model
2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -359,15 +359,14 @@ public void doWithAssociations(SimpleAssociationHandler handler) {
359
359
* @see org.springframework.data.mapping.PersistentEntity#findAnnotation(java.lang.Class)
360
360
*/
361
361
@ Override
362
+ @ SuppressWarnings ("unchecked" )
362
363
public <A extends Annotation > A findAnnotation (Class <A > annotationType ) {
363
364
364
- A annotation = annotationType .getAnnotation (annotationType );
365
-
366
- if (annotation != null ) {
367
- return annotation ;
365
+ if (annotationCache .containsKey (annotationType )) {
366
+ return (A ) annotationCache .get (annotationType );
368
367
}
369
368
370
- annotation = AnnotatedElementUtils .findMergedAnnotation (getType (), annotationType );
369
+ A annotation = AnnotatedElementUtils .findMergedAnnotation (getType (), annotationType );
371
370
annotationCache .put (annotationType , annotation );
372
371
373
372
return annotation ;
Original file line number Diff line number Diff line change @@ -274,9 +274,7 @@ public String getProperty() {
274
274
}
275
275
276
276
@ ComposedTypeAlias
277
- static class AliasEntityUsingComposedAnnotation {
278
-
279
- }
277
+ static class AliasEntityUsingComposedAnnotation {}
280
278
281
279
static class Subtype extends Entity {}
282
280
}
You can’t perform that action at this time.
0 commit comments