Skip to content

Commit fbf3807

Browse files
committed
Polishing
(cherry picked from commit 5db4495)
1 parent 703c37e commit fbf3807

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

spring-context/src/test/java/org/springframework/context/annotation/AbstractCircularImportDetectionTests.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -72,58 +72,71 @@ public void complexCircularImportIsDetected() throws Exception {
7272
@Configuration
7373
@Import(B.class)
7474
static class A {
75+
7576
@Bean
7677
TestBean b1() {
7778
return new TestBean();
7879
}
7980
}
8081

82+
8183
@Configuration
8284
@Import(A.class)
8385
static class B {
86+
8487
@Bean
8588
TestBean b2() {
8689
return new TestBean();
8790
}
8891
}
8992

93+
9094
@Configuration
91-
@Import( { Y.class, Z.class })
95+
@Import({Y.class, Z.class})
9296
class X {
97+
9398
@Bean
9499
TestBean x() {
95100
return new TestBean();
96101
}
97102
}
98103

104+
99105
@Configuration
100106
class Y {
107+
101108
@Bean
102109
TestBean y() {
103110
return new TestBean();
104111
}
105112
}
106113

114+
107115
@Configuration
108-
@Import( { Z1.class, Z2.class })
116+
@Import({Z1.class, Z2.class})
109117
class Z {
118+
110119
@Bean
111120
TestBean z() {
112121
return new TestBean();
113122
}
114123
}
115124

125+
116126
@Configuration
117127
class Z1 {
128+
118129
@Bean
119130
TestBean z1() {
120131
return new TestBean();
121132
}
122133
}
123134

135+
124136
@Configuration
125137
@Import(Z.class)
126138
class Z2 {
139+
127140
@Bean
128141
TestBean z2() {
129142
return new TestBean();

spring-context/src/test/java/org/springframework/context/annotation/AsmCircularImportDetectionTests.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,12 +23,8 @@
2323
import org.springframework.core.type.classreading.CachingMetadataReaderFactory;
2424

2525
/**
26-
* Unit test proving that ASM-based {@link ConfigurationClassParser} correctly detects circular
27-
* use of the {@link Import @Import} annotation.
28-
*
29-
* <p>While this test is the only subclass of {@link AbstractCircularImportDetectionTests},
30-
* the hierarchy remains in place in case a JDT-based ConfigurationParser implementation
31-
* needs to be developed.
26+
* Unit test proving that ASM-based {@link ConfigurationClassParser} correctly detects
27+
* circular use of the {@link Import @Import} annotation.
3228
*
3329
* @author Chris Beams
3430
*/

0 commit comments

Comments
 (0)