Skip to content

Commit 36ea2ee

Browse files
committed
Merge branch '1.5.x'
2 parents 6d6abce + 846e642 commit 36ea2ee

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/java/org/springframework/boot/autoconfigureprocessor/AutoConfigureAnnotationProcessor.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,17 +166,24 @@ private List<Object> getValues(AnnotationMirror annotation) {
166166
Object value = entry.getValue().getValue();
167167
if (value instanceof List) {
168168
for (AnnotationValue annotationValue : (List<AnnotationValue>) value) {
169-
result.add(annotationValue.getValue());
169+
result.add(processValue(annotationValue.getValue()));
170170
}
171171
}
172172
else {
173-
result.add(value);
173+
result.add(processValue(value));
174174
}
175175
}
176176
}
177177
return result;
178178
}
179179

180+
private Object processValue(Object value) {
181+
if (value instanceof DeclaredType) {
182+
return getQualifiedName(((DeclaredType) value).asElement());
183+
}
184+
return value;
185+
}
186+
180187
private String getQualifiedName(Element element) {
181188
if (element != null) {
182189
TypeElement enclosingElement = getEnclosingTypeElement(element.asType());

spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/AutoConfigureAnnotationProcessorTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ public void createCompiler() throws IOException {
5050
@Test
5151
public void annotatedClass() throws Exception {
5252
Properties properties = compile(TestClassConfiguration.class);
53-
System.out.println(properties);
5453
assertThat(properties).hasSize(3);
5554
assertThat(properties).containsEntry(
5655
"org.springframework.boot.autoconfigureprocessor."
5756
+ "TestClassConfiguration.ConditionalOnClass",
58-
"java.io.InputStream,java.io.OutputStream");
57+
"java.io.InputStream,org.springframework.boot.autoconfigureprocessor."
58+
+ "TestClassConfiguration$Nested");
5959
assertThat(properties).containsKey(
6060
"org.springframework.boot.autoconfigureprocessor.TestClassConfiguration");
6161
assertThat(properties).containsKey(

spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestClassConfiguration.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@
1616

1717
package org.springframework.boot.autoconfigureprocessor;
1818

19-
import java.io.OutputStream;
20-
2119
/**
2220
* Test configuration with an annotated class.
2321
*
2422
* @author Madhura Bhave
2523
*/
2624
@TestConfiguration
27-
@TestConditionalOnClass(name = "java.io.InputStream", value = OutputStream.class)
25+
@TestConditionalOnClass(name = "java.io.InputStream", value = TestClassConfiguration.Nested.class)
2826
public class TestClassConfiguration {
2927

3028
@TestAutoConfigureOrder

0 commit comments

Comments
 (0)