diff --git a/spring-core/src/main/java/org/springframework/core/annotation/TypeMappedAnnotation.java b/spring-core/src/main/java/org/springframework/core/annotation/TypeMappedAnnotation.java
index b2939c59dcdc..13400a41566e 100644
--- a/spring-core/src/main/java/org/springframework/core/annotation/TypeMappedAnnotation.java
+++ b/spring-core/src/main/java/org/springframework/core/annotation/TypeMappedAnnotation.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -671,10 +671,10 @@ private static TypeMappedAnnotation createIfPossible(
return new TypeMappedAnnotation<>(mapping, null, source, rootAttribute,
valueExtractor, aggregateIndex);
}
+ catch (AnnotationConfigurationException ex) {
+ throw ex;
+ }
catch (Exception ex) {
- if (ex instanceof AnnotationConfigurationException) {
- throw (AnnotationConfigurationException) ex;
- }
if (logger.isEnabled()) {
String type = mapping.getAnnotationType().getName();
String item = (mapping.getDistance() == 0 ? "annotation " + type :