Browse Source

Consistent use of AnnotationUtils.rethrowAnnotationConfigurationException()

Closes gh-24379
pull/24380/head
Sam Brannen 6 years ago
parent
commit
daa30a9f0b
  1. 6
      spring-core/src/main/java/org/springframework/core/annotation/AnnotationTypeMappings.java
  2. 4
      spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java
  3. 6
      spring-core/src/main/java/org/springframework/core/annotation/TypeMappedAnnotation.java

6
spring-core/src/main/java/org/springframework/core/annotation/AnnotationTypeMappings.java

@ -1,5 +1,5 @@ @@ -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.
@ -116,9 +116,7 @@ final class AnnotationTypeMappings { @@ -116,9 +116,7 @@ final class AnnotationTypeMappings {
queue.addLast(new AnnotationTypeMapping(source, annotationType, ann));
}
catch (Exception ex) {
if (ex instanceof AnnotationConfigurationException) {
throw (AnnotationConfigurationException) ex;
}
AnnotationUtils.rethrowAnnotationConfigurationException(ex);
if (failureLogger.isEnabled()) {
failureLogger.log("Failed to introspect meta-annotation " + annotationType.getName(),
(source != null ? source.getAnnotationType() : null), ex);

4
spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java

@ -1,5 +1,5 @@ @@ -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.
@ -1076,7 +1076,7 @@ public abstract class AnnotationUtils { @@ -1076,7 +1076,7 @@ public abstract class AnnotationUtils {
* <p>Otherwise, this method does nothing.
* @param ex the throwable to inspect
*/
private static void rethrowAnnotationConfigurationException(Throwable ex) {
static void rethrowAnnotationConfigurationException(Throwable ex) {
if (ex instanceof AnnotationConfigurationException) {
throw (AnnotationConfigurationException) ex;
}

6
spring-core/src/main/java/org/springframework/core/annotation/TypeMappedAnnotation.java

@ -1,5 +1,5 @@ @@ -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.
@ -672,9 +672,7 @@ final class TypeMappedAnnotation<A extends Annotation> extends AbstractMergedAnn @@ -672,9 +672,7 @@ final class TypeMappedAnnotation<A extends Annotation> extends AbstractMergedAnn
valueExtractor, aggregateIndex);
}
catch (Exception ex) {
if (ex instanceof AnnotationConfigurationException) {
throw (AnnotationConfigurationException) ex;
}
AnnotationUtils.rethrowAnnotationConfigurationException(ex);
if (logger.isEnabled()) {
String type = mapping.getAnnotationType().getName();
String item = (mapping.getDistance() == 0 ? "annotation " + type :

Loading…
Cancel
Save