Merge branch '5.3.x'
This commit is contained in:
commit
ad3095f197
|
@ -92,6 +92,7 @@ abstract class AnnotationsScanner {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
private static <C, R> R processClass(C context, Class<?> source,
|
private static <C, R> R processClass(C context, Class<?> source,
|
||||||
SearchStrategy searchStrategy, AnnotationsProcessor<C, R> processor) {
|
SearchStrategy searchStrategy, AnnotationsProcessor<C, R> processor) {
|
||||||
|
|
||||||
|
@ -229,6 +230,7 @@ abstract class AnnotationsScanner {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
private static <C, R> R processMethod(C context, Method source,
|
private static <C, R> R processMethod(C context, Method source,
|
||||||
SearchStrategy searchStrategy, AnnotationsProcessor<C, R> processor) {
|
SearchStrategy searchStrategy, AnnotationsProcessor<C, R> processor) {
|
||||||
|
|
||||||
|
@ -499,6 +501,7 @@ abstract class AnnotationsScanner {
|
||||||
return (type.getName().startsWith("java.") || type == Ordered.class);
|
return (type.getName().startsWith("java.") || type == Ordered.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
private static boolean isWithoutHierarchy(AnnotatedElement source, SearchStrategy searchStrategy) {
|
private static boolean isWithoutHierarchy(AnnotatedElement source, SearchStrategy searchStrategy) {
|
||||||
if (source == Object.class) {
|
if (source == Object.class) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -482,7 +482,9 @@ public interface MergedAnnotations extends Iterable<MergedAnnotation<Annotation>
|
||||||
* need to be meta-annotated with {@link Inherited @Inherited}. When
|
* need to be meta-annotated with {@link Inherited @Inherited}. When
|
||||||
* searching a {@link Method} source, this strategy is identical to
|
* searching a {@link Method} source, this strategy is identical to
|
||||||
* {@link #TYPE_HIERARCHY}.
|
* {@link #TYPE_HIERARCHY}.
|
||||||
|
* @deprecated as of Spring Framework 5.3.17; to be removed in Spring Framework 6.0
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
TYPE_HIERARCHY_AND_ENCLOSING_CLASSES
|
TYPE_HIERARCHY_AND_ENCLOSING_CLASSES
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2020 the original author or authors.
|
* Copyright 2002-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -421,6 +421,7 @@ class AnnotationsScannerTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
void typeHierarchyWithEnclosedStrategyOnEnclosedStaticClassScansAnnotations() {
|
void typeHierarchyWithEnclosedStrategyOnEnclosedStaticClassScansAnnotations() {
|
||||||
Class<?> source = AnnotationEnclosingClassSample.EnclosedStatic.EnclosedStaticStatic.class;
|
Class<?> source = AnnotationEnclosingClassSample.EnclosedStatic.EnclosedStaticStatic.class;
|
||||||
assertThat(scan(source, SearchStrategy.TYPE_HIERARCHY_AND_ENCLOSING_CLASSES))
|
assertThat(scan(source, SearchStrategy.TYPE_HIERARCHY_AND_ENCLOSING_CLASSES))
|
||||||
|
@ -428,6 +429,7 @@ class AnnotationsScannerTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
void typeHierarchyWithEnclosedStrategyOnEnclosedInnerClassScansAnnotations() {
|
void typeHierarchyWithEnclosedStrategyOnEnclosedInnerClassScansAnnotations() {
|
||||||
Class<?> source = AnnotationEnclosingClassSample.EnclosedInner.EnclosedInnerInner.class;
|
Class<?> source = AnnotationEnclosingClassSample.EnclosedInner.EnclosedInnerInner.class;
|
||||||
assertThat(scan(source, SearchStrategy.TYPE_HIERARCHY_AND_ENCLOSING_CLASSES))
|
assertThat(scan(source, SearchStrategy.TYPE_HIERARCHY_AND_ENCLOSING_CLASSES))
|
||||||
|
@ -435,6 +437,7 @@ class AnnotationsScannerTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
void typeHierarchyWithEnclosedStrategyOnMethodHierarchyUsesTypeHierarchyScan() {
|
void typeHierarchyWithEnclosedStrategyOnMethodHierarchyUsesTypeHierarchyScan() {
|
||||||
Method source = methodFrom(WithHierarchy.class);
|
Method source = methodFrom(WithHierarchy.class);
|
||||||
assertThat(scan(source, SearchStrategy.TYPE_HIERARCHY_AND_ENCLOSING_CLASSES)).containsExactly(
|
assertThat(scan(source, SearchStrategy.TYPE_HIERARCHY_AND_ENCLOSING_CLASSES)).containsExactly(
|
||||||
|
|
|
@ -711,6 +711,7 @@ class MergedAnnotationsTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
void streamTypeHierarchyAndEnclosingClassesFromNonAnnotatedInnerClassWithAnnotatedEnclosingClass() {
|
void streamTypeHierarchyAndEnclosingClassesFromNonAnnotatedInnerClassWithAnnotatedEnclosingClass() {
|
||||||
Stream<Class<?>> classes = MergedAnnotations.from(AnnotatedClass.NonAnnotatedInnerClass.class,
|
Stream<Class<?>> classes = MergedAnnotations.from(AnnotatedClass.NonAnnotatedInnerClass.class,
|
||||||
SearchStrategy.TYPE_HIERARCHY_AND_ENCLOSING_CLASSES).stream().map(MergedAnnotation::getType);
|
SearchStrategy.TYPE_HIERARCHY_AND_ENCLOSING_CLASSES).stream().map(MergedAnnotation::getType);
|
||||||
|
@ -718,6 +719,7 @@ class MergedAnnotationsTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
void streamTypeHierarchyAndEnclosingClassesFromNonAnnotatedStaticNestedClassWithAnnotatedEnclosingClass() {
|
void streamTypeHierarchyAndEnclosingClassesFromNonAnnotatedStaticNestedClassWithAnnotatedEnclosingClass() {
|
||||||
Stream<Class<?>> classes = MergedAnnotations.from(AnnotatedClass.NonAnnotatedStaticNestedClass.class,
|
Stream<Class<?>> classes = MergedAnnotations.from(AnnotatedClass.NonAnnotatedStaticNestedClass.class,
|
||||||
SearchStrategy.TYPE_HIERARCHY_AND_ENCLOSING_CLASSES).stream().map(MergedAnnotation::getType);
|
SearchStrategy.TYPE_HIERARCHY_AND_ENCLOSING_CLASSES).stream().map(MergedAnnotation::getType);
|
||||||
|
|
|
@ -258,7 +258,7 @@ public enum SpelMessage {
|
||||||
FLAWED_PATTERN(Kind.ERROR, 1073,
|
FLAWED_PATTERN(Kind.ERROR, 1073,
|
||||||
"Failed to efficiently evaluate pattern ''{0}'': consider redesigning it"),
|
"Failed to efficiently evaluate pattern ''{0}'': consider redesigning it"),
|
||||||
|
|
||||||
/** @since 5.3.16 */
|
/** @since 5.3.17 */
|
||||||
EXCEPTION_COMPILING_EXPRESSION(Kind.ERROR, 1074,
|
EXCEPTION_COMPILING_EXPRESSION(Kind.ERROR, 1074,
|
||||||
"An exception occurred while compiling an expression");
|
"An exception occurred while compiling an expression");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue