Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
36ea2ee8
Commit
36ea2ee8
authored
Dec 07, 2017
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.5.x'
parents
6d6abce5
846e6426
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
AutoConfigureAnnotationProcessor.java
...oconfigureprocessor/AutoConfigureAnnotationProcessor.java
+9
-2
AutoConfigureAnnotationProcessorTests.java
...igureprocessor/AutoConfigureAnnotationProcessorTests.java
+2
-2
TestClassConfiguration.java
...k/boot/autoconfigureprocessor/TestClassConfiguration.java
+1
-3
No files found.
spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/java/org/springframework/boot/autoconfigureprocessor/AutoConfigureAnnotationProcessor.java
View file @
36ea2ee8
...
@@ -166,17 +166,24 @@ public class AutoConfigureAnnotationProcessor extends AbstractProcessor {
...
@@ -166,17 +166,24 @@ public class AutoConfigureAnnotationProcessor extends AbstractProcessor {
Object
value
=
entry
.
getValue
().
getValue
();
Object
value
=
entry
.
getValue
().
getValue
();
if
(
value
instanceof
List
)
{
if
(
value
instanceof
List
)
{
for
(
AnnotationValue
annotationValue
:
(
List
<
AnnotationValue
>)
value
)
{
for
(
AnnotationValue
annotationValue
:
(
List
<
AnnotationValue
>)
value
)
{
result
.
add
(
annotationValue
.
getValue
(
));
result
.
add
(
processValue
(
annotationValue
.
getValue
()
));
}
}
}
}
else
{
else
{
result
.
add
(
value
);
result
.
add
(
processValue
(
value
)
);
}
}
}
}
}
}
return
result
;
return
result
;
}
}
private
Object
processValue
(
Object
value
)
{
if
(
value
instanceof
DeclaredType
)
{
return
getQualifiedName
(((
DeclaredType
)
value
).
asElement
());
}
return
value
;
}
private
String
getQualifiedName
(
Element
element
)
{
private
String
getQualifiedName
(
Element
element
)
{
if
(
element
!=
null
)
{
if
(
element
!=
null
)
{
TypeElement
enclosingElement
=
getEnclosingTypeElement
(
element
.
asType
());
TypeElement
enclosingElement
=
getEnclosingTypeElement
(
element
.
asType
());
...
...
spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/AutoConfigureAnnotationProcessorTests.java
View file @
36ea2ee8
...
@@ -50,12 +50,12 @@ public class AutoConfigureAnnotationProcessorTests {
...
@@ -50,12 +50,12 @@ public class AutoConfigureAnnotationProcessorTests {
@Test
@Test
public
void
annotatedClass
()
throws
Exception
{
public
void
annotatedClass
()
throws
Exception
{
Properties
properties
=
compile
(
TestClassConfiguration
.
class
);
Properties
properties
=
compile
(
TestClassConfiguration
.
class
);
System
.
out
.
println
(
properties
);
assertThat
(
properties
).
hasSize
(
3
);
assertThat
(
properties
).
hasSize
(
3
);
assertThat
(
properties
).
containsEntry
(
assertThat
(
properties
).
containsEntry
(
"org.springframework.boot.autoconfigureprocessor."
"org.springframework.boot.autoconfigureprocessor."
+
"TestClassConfiguration.ConditionalOnClass"
,
+
"TestClassConfiguration.ConditionalOnClass"
,
"java.io.InputStream,java.io.OutputStream"
);
"java.io.InputStream,org.springframework.boot.autoconfigureprocessor."
+
"TestClassConfiguration$Nested"
);
assertThat
(
properties
).
containsKey
(
assertThat
(
properties
).
containsKey
(
"org.springframework.boot.autoconfigureprocessor.TestClassConfiguration"
);
"org.springframework.boot.autoconfigureprocessor.TestClassConfiguration"
);
assertThat
(
properties
).
containsKey
(
assertThat
(
properties
).
containsKey
(
...
...
spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestClassConfiguration.java
View file @
36ea2ee8
...
@@ -16,15 +16,13 @@
...
@@ -16,15 +16,13 @@
package
org
.
springframework
.
boot
.
autoconfigureprocessor
;
package
org
.
springframework
.
boot
.
autoconfigureprocessor
;
import
java.io.OutputStream
;
/**
/**
* Test configuration with an annotated class.
* Test configuration with an annotated class.
*
*
* @author Madhura Bhave
* @author Madhura Bhave
*/
*/
@TestConfiguration
@TestConfiguration
@TestConditionalOnClass
(
name
=
"java.io.InputStream"
,
value
=
OutputStream
.
class
)
@TestConditionalOnClass
(
name
=
"java.io.InputStream"
,
value
=
TestClassConfiguration
.
Nested
.
class
)
public
class
TestClassConfiguration
{
public
class
TestClassConfiguration
{
@TestAutoConfigureOrder
@TestAutoConfigureOrder
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment