Browse Source

Merge branch '5.3.x'

pull/28131/head
Sam Brannen 4 years ago
parent
commit
bb9cf7cce1
  1. 5
      spring-core/src/main/java/org/springframework/core/annotation/AnnotationsScanner.java
  2. 2
      spring-core/src/main/java/org/springframework/core/annotation/MergedAnnotations.java
  3. 5
      spring-core/src/test/java/org/springframework/core/annotation/AnnotationsScannerTests.java
  4. 2
      spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsTests.java

5
spring-core/src/main/java/org/springframework/core/annotation/AnnotationsScanner.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 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.
@ -92,7 +92,6 @@ abstract class AnnotationsScanner { @@ -92,7 +92,6 @@ abstract class AnnotationsScanner {
}
@Nullable
@SuppressWarnings("deprecation")
private static <C, R> R processClass(C context, Class<?> source,
SearchStrategy searchStrategy, AnnotationsProcessor<C, R> processor) {
@ -230,7 +229,6 @@ abstract class AnnotationsScanner { @@ -230,7 +229,6 @@ abstract class AnnotationsScanner {
}
@Nullable
@SuppressWarnings("deprecation")
private static <C, R> R processMethod(C context, Method source,
SearchStrategy searchStrategy, AnnotationsProcessor<C, R> processor) {
@ -501,7 +499,6 @@ abstract class AnnotationsScanner { @@ -501,7 +499,6 @@ abstract class AnnotationsScanner {
return (type.getName().startsWith("java.") || type == Ordered.class);
}
@SuppressWarnings("deprecation")
private static boolean isWithoutHierarchy(AnnotatedElement source, SearchStrategy searchStrategy) {
if (source == Object.class) {
return true;

2
spring-core/src/main/java/org/springframework/core/annotation/MergedAnnotations.java

@ -482,9 +482,7 @@ public interface MergedAnnotations extends Iterable<MergedAnnotation<Annotation> @@ -482,9 +482,7 @@ public interface MergedAnnotations extends Iterable<MergedAnnotation<Annotation>
* need to be meta-annotated with {@link Inherited @Inherited}. When
* searching a {@link Method} source, this strategy is identical to
* {@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
}

5
spring-core/src/test/java/org/springframework/core/annotation/AnnotationsScannerTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 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.
@ -421,7 +421,6 @@ class AnnotationsScannerTests { @@ -421,7 +421,6 @@ class AnnotationsScannerTests {
}
@Test
@SuppressWarnings("deprecation")
void typeHierarchyWithEnclosedStrategyOnEnclosedStaticClassScansAnnotations() {
Class<?> source = AnnotationEnclosingClassSample.EnclosedStatic.EnclosedStaticStatic.class;
assertThat(scan(source, SearchStrategy.TYPE_HIERARCHY_AND_ENCLOSING_CLASSES))
@ -429,7 +428,6 @@ class AnnotationsScannerTests { @@ -429,7 +428,6 @@ class AnnotationsScannerTests {
}
@Test
@SuppressWarnings("deprecation")
void typeHierarchyWithEnclosedStrategyOnEnclosedInnerClassScansAnnotations() {
Class<?> source = AnnotationEnclosingClassSample.EnclosedInner.EnclosedInnerInner.class;
assertThat(scan(source, SearchStrategy.TYPE_HIERARCHY_AND_ENCLOSING_CLASSES))
@ -437,7 +435,6 @@ class AnnotationsScannerTests { @@ -437,7 +435,6 @@ class AnnotationsScannerTests {
}
@Test
@SuppressWarnings("deprecation")
void typeHierarchyWithEnclosedStrategyOnMethodHierarchyUsesTypeHierarchyScan() {
Method source = methodFrom(WithHierarchy.class);
assertThat(scan(source, SearchStrategy.TYPE_HIERARCHY_AND_ENCLOSING_CLASSES)).containsExactly(

2
spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsTests.java

@ -711,7 +711,6 @@ class MergedAnnotationsTests { @@ -711,7 +711,6 @@ class MergedAnnotationsTests {
}
@Test
@SuppressWarnings("deprecation")
void streamTypeHierarchyAndEnclosingClassesFromNonAnnotatedInnerClassWithAnnotatedEnclosingClass() {
Stream<Class<?>> classes = MergedAnnotations.from(AnnotatedClass.NonAnnotatedInnerClass.class,
SearchStrategy.TYPE_HIERARCHY_AND_ENCLOSING_CLASSES).stream().map(MergedAnnotation::getType);
@ -719,7 +718,6 @@ class MergedAnnotationsTests { @@ -719,7 +718,6 @@ class MergedAnnotationsTests {
}
@Test
@SuppressWarnings("deprecation")
void streamTypeHierarchyAndEnclosingClassesFromNonAnnotatedStaticNestedClassWithAnnotatedEnclosingClass() {
Stream<Class<?>> classes = MergedAnnotations.from(AnnotatedClass.NonAnnotatedStaticNestedClass.class,
SearchStrategy.TYPE_HIERARCHY_AND_ENCLOSING_CLASSES).stream().map(MergedAnnotation::getType);

Loading…
Cancel
Save