Skip to content

Commit 376434e

Browse files
committed
Polishing
1 parent f42955c commit 376434e

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

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

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ void streamTypeHierarchyAndEnclosingClassesFromNonAnnotatedStaticNestedClassWith
702702
SearchStrategy.TYPE_HIERARCHY_AND_ENCLOSING_CLASSES).stream().map(MergedAnnotation::getType);
703703
assertThat(classes).containsExactly(Component.class, Indexed.class);
704704
}
705+
705706
@Test
706707
void getFromMethodWithMethodAnnotationOnLeaf() throws Exception {
707708
Method method = Leaf.class.getMethod("annotatedOnLeaf");
@@ -776,24 +777,19 @@ void getFromMethodWithNotAnnotated() throws Exception {
776777

777778
@Test
778779
void getFromMethodWithBridgeMethod() throws Exception {
779-
Method method = TransactionalStringGeneric.class.getMethod("something",
780-
Object.class);
780+
Method method = TransactionalStringGeneric.class.getMethod("something", Object.class);
781781
assertThat(method.isBridge()).isTrue();
782782
assertThat(method.getAnnotation(Order.class)).isNull();
783-
assertThat(MergedAnnotations.from(method).get(Order.class).getDistance()).isEqualTo(
784-
-1);
783+
assertThat(MergedAnnotations.from(method).get(Order.class).getDistance()).isEqualTo(-1);
785784
assertThat(MergedAnnotations.from(method, SearchStrategy.TYPE_HIERARCHY).get(
786785
Order.class).getDistance()).isEqualTo(0);
787786
boolean runningInEclipse = Arrays.stream(
788787
new Exception().getStackTrace()).anyMatch(
789788
element -> element.getClassName().startsWith("org.eclipse.jdt"));
790-
// As of JDK 8, invoking getAnnotation() on a bridge method actually
791-
// finds an
789+
// As of JDK 8, invoking getAnnotation() on a bridge method actually finds an
792790
// annotation on its 'bridged' method [1]; however, the Eclipse compiler
793-
// will not
794-
// support this until Eclipse 4.9 [2]. Thus, we effectively ignore the
795-
// following
796-
// assertion if the test is currently executing within the Eclipse IDE.
791+
// will not support this until Eclipse 4.9 [2]. Thus, we effectively ignore the
792+
// following assertion if the test is currently executing within the Eclipse IDE.
797793
// [1] https://bugs.openjdk.java.net/browse/JDK-6695379
798794
// [2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=495396
799795
if (!runningInEclipse) {
@@ -843,8 +839,7 @@ void getFromMethodWithGenericSuperclass() throws Exception {
843839

844840
@Test
845841
void getFromMethodWithInterfaceOnSuper() throws Exception {
846-
Method method = SubOfImplementsInterfaceWithAnnotatedMethod.class.getMethod(
847-
"foo");
842+
Method method = SubOfImplementsInterfaceWithAnnotatedMethod.class.getMethod("foo");
848843
assertThat(MergedAnnotations.from(method, SearchStrategy.TYPE_HIERARCHY).get(
849844
Order.class).getDistance()).isEqualTo(0);
850845
}
@@ -1369,8 +1364,10 @@ void synthesizeAlreadySynthesized() throws Exception {
13691364
Method method = WebController.class.getMethod("handleMappedWithValueAttribute");
13701365
RequestMapping webMapping = method.getAnnotation(RequestMapping.class);
13711366
assertThat(webMapping).isNotNull();
1367+
13721368
RequestMapping synthesizedWebMapping = MergedAnnotation.from(webMapping).synthesize();
13731369
RequestMapping synthesizedAgainWebMapping = MergedAnnotation.from(synthesizedWebMapping).synthesize();
1370+
13741371
assertThat(synthesizedWebMapping).isInstanceOf(SynthesizedAnnotation.class);
13751372
assertThat(synthesizedAgainWebMapping).isInstanceOf(SynthesizedAnnotation.class);
13761373
assertThat(synthesizedWebMapping).isEqualTo(synthesizedAgainWebMapping);

0 commit comments

Comments
 (0)