Skip to content

Commit df37e33

Browse files
committed
Revert "Ensure fix for gh-28012 is actually tested"
This reverts commit 3188c0f.
1 parent 1881e48 commit df37e33

File tree

6 files changed

+9
-166
lines changed

6 files changed

+9
-166
lines changed

spring-core/src/test/kotlin/org/springframework/core/annotation/Filter.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@ package org.springframework.core.annotation
2424
@Retention(AnnotationRetention.RUNTIME)
2525
public annotation class Filter(
2626

27+
@get:AliasFor("name")
2728
val value: String = "",
2829

30+
@get:AliasFor("value")
31+
val name: String = "",
32+
2933
val and: Filters = Filters()
3034

3135
)

spring-core/src/test/kotlin/org/springframework/core/annotation/KotlinMergedAnnotationsTests.kt

Lines changed: 1 addition & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -41,34 +41,6 @@ class KotlinMergedAnnotationsTests {
4141
val mergedAnnotation = MergedAnnotation.from(method.getAnnotation(Person::class.java))
4242
assertThat(mergedAnnotation).isNotNull();
4343

44-
// NON-Synthesized Annotations
45-
val jane = mergedAnnotation.synthesize()
46-
assertThat(jane).isNotInstanceOf(SynthesizedAnnotation::class.java)
47-
assertThat(jane.name).isEqualTo("jane")
48-
val synthesizedFriends = jane.friends
49-
assertThat(synthesizedFriends).hasSize(2)
50-
51-
val john = synthesizedFriends[0]
52-
assertThat(john).isNotInstanceOf(SynthesizedAnnotation::class.java)
53-
assertThat(john.name).isEqualTo("john")
54-
55-
val sally = synthesizedFriends[1]
56-
assertThat(sally).isNotInstanceOf(SynthesizedAnnotation::class.java)
57-
assertThat(sally.name).isEqualTo("sally")
58-
}
59-
60-
@Test // gh-28012
61-
fun recursiveAnnotationWithAttributeAliases() {
62-
val method = javaClass.getMethod("synthesizablePersonMethod")
63-
64-
// MergedAnnotations
65-
val mergedAnnotations = MergedAnnotations.from(method)
66-
assertThat(mergedAnnotations.isPresent(SynthesizablePerson::class.java)).isTrue();
67-
68-
// MergedAnnotation
69-
val mergedAnnotation = MergedAnnotation.from(method.getAnnotation(SynthesizablePerson::class.java))
70-
assertThat(mergedAnnotation).isNotNull();
71-
7244
// Synthesized Annotations
7345
val jane = mergedAnnotation.synthesize()
7446
assertThat(jane).isInstanceOf(SynthesizedAnnotation::class.java)
@@ -100,36 +72,6 @@ class KotlinMergedAnnotationsTests {
10072
val mergedAnnotation = MergedAnnotation.from(method.getAnnotation(Filter::class.java))
10173
assertThat(mergedAnnotation).isNotNull();
10274

103-
// NON-Synthesized Annotations
104-
val fooFilter = mergedAnnotation.synthesize()
105-
assertThat(fooFilter).isNotInstanceOf(SynthesizedAnnotation::class.java)
106-
assertThat(fooFilter.value).isEqualTo("foo")
107-
val filters = fooFilter.and
108-
assertThat(filters.value).hasSize(2)
109-
110-
val barFilter = filters.value[0]
111-
assertThat(barFilter).isNotInstanceOf(SynthesizedAnnotation::class.java)
112-
assertThat(barFilter.value).isEqualTo("bar")
113-
assertThat(barFilter.and.value).isEmpty()
114-
115-
val bazFilter = filters.value[1]
116-
assertThat(bazFilter).isNotInstanceOf(SynthesizedAnnotation::class.java)
117-
assertThat(bazFilter.value).isEqualTo("baz")
118-
assertThat(bazFilter.and.value).isEmpty()
119-
}
120-
121-
@Test // gh-28012
122-
fun recursiveNestedAnnotationWithAttributeAliases() {
123-
val method = javaClass.getMethod("synthesizableFilterMethod")
124-
125-
// MergedAnnotations
126-
val mergedAnnotations = MergedAnnotations.from(method)
127-
assertThat(mergedAnnotations.isPresent(SynthesizableFilter::class.java)).isTrue();
128-
129-
// MergedAnnotation
130-
val mergedAnnotation = MergedAnnotation.from(method.getAnnotation(SynthesizableFilter::class.java))
131-
assertThat(mergedAnnotation).isNotNull();
132-
13375
// Synthesized Annotations
13476
val fooFilter = mergedAnnotation.synthesize()
13577
assertThat(fooFilter).isInstanceOf(SynthesizedAnnotation::class.java)
@@ -152,20 +94,12 @@ class KotlinMergedAnnotationsTests {
15294
}
15395

15496

155-
@Person(name = "jane", friends = [Person(name = "john"), Person(name = "sally")])
97+
@Person("jane", friends = [Person("john"), Person("sally")])
15698
fun personMethod() {
15799
}
158100

159-
@SynthesizablePerson(name = "jane", friends = [SynthesizablePerson(name = "john"), SynthesizablePerson(name = "sally")])
160-
fun synthesizablePersonMethod() {
161-
}
162-
163101
@Filter("foo", and = Filters(Filter("bar"), Filter("baz")))
164102
fun filterMethod() {
165103
}
166104

167-
@SynthesizableFilter("foo", and = SynthesizableFilters(SynthesizableFilter("bar"), SynthesizableFilter("baz")))
168-
fun synthesizableFilterMethod() {
169-
}
170-
171105
}

spring-core/src/test/kotlin/org/springframework/core/annotation/Person.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ package org.springframework.core.annotation
2424
@Retention(AnnotationRetention.RUNTIME)
2525
public annotation class Person(
2626

27+
@get:AliasFor("name")
28+
val value: String = "",
29+
30+
@get:AliasFor("value")
2731
val name: String = "",
2832

2933
vararg val friends: Person = []

spring-core/src/test/kotlin/org/springframework/core/annotation/SynthesizableFilter.kt

Lines changed: 0 additions & 35 deletions
This file was deleted.

spring-core/src/test/kotlin/org/springframework/core/annotation/SynthesizableFilters.kt

Lines changed: 0 additions & 29 deletions
This file was deleted.

spring-core/src/test/kotlin/org/springframework/core/annotation/SynthesizablePerson.kt

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)