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
6d93573d
Commit
6d93573d
authored
Jan 19, 2018
by
Phillip Webb
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.5.x'
parents
ba6be4f2
8e783cda
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
26 deletions
+25
-26
DuplicateJsonObjectContextCustomizerFactory.java
...est/json/DuplicateJsonObjectContextCustomizerFactory.java
+4
-3
TypeUtils.java
...pringframework/boot/configurationprocessor/TypeUtils.java
+6
-7
ConfigurationMetadataAnnotationProcessorTests.java
...cessor/ConfigurationMetadataAnnotationProcessorTests.java
+8
-8
SimpleCollectionProperties.java
...onfigurationsample/simple/SimpleCollectionProperties.java
+1
-0
pom.xml
...n-tests/spring-boot-configuration-processor-tests/pom.xml
+2
-4
ConfigurationProcessorIntegrationTests.java
...ocessor/tests/ConfigurationProcessorIntegrationTests.java
+4
-4
No files found.
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/DuplicateJsonObjectContextCustomizerFactory.java
View file @
6d93573d
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -75,8 +75,9 @@ class DuplicateJsonObjectContextCustomizerFactory implements ContextCustomizerFa
...
@@ -75,8 +75,9 @@ class DuplicateJsonObjectContextCustomizerFactory implements ContextCustomizerFa
}
}
private
void
logDuplicateJsonObjectsWarning
(
List
<
URL
>
jsonObjects
)
{
private
void
logDuplicateJsonObjectsWarning
(
List
<
URL
>
jsonObjects
)
{
StringBuilder
message
=
new
StringBuilder
(
String
.
format
(
"%n%nFound multiple occurrences of"
StringBuilder
message
=
new
StringBuilder
(
+
" org.json.JSONObject on the class path:%n%n"
));
String
.
format
(
"%n%nFound multiple occurrences of"
+
" org.json.JSONObject on the class path:%n%n"
));
for
(
URL
jsonObject
:
jsonObjects
)
{
for
(
URL
jsonObject
:
jsonObjects
)
{
message
.
append
(
String
.
format
(
"\t%s%n"
,
jsonObject
));
message
.
append
(
String
.
format
(
"\t%s%n"
,
jsonObject
));
}
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeUtils.java
View file @
6d93573d
...
@@ -19,7 +19,6 @@ package org.springframework.boot.configurationprocessor;
...
@@ -19,7 +19,6 @@ package org.springframework.boot.configurationprocessor;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -188,14 +187,14 @@ class TypeUtils {
...
@@ -188,14 +187,14 @@ class TypeUtils {
return
getQualifiedName
(
enclosingElement
)
+
"$"
return
getQualifiedName
(
enclosingElement
)
+
"$"
+
type
.
asElement
().
getSimpleName
().
toString
();
+
type
.
asElement
().
getSimpleName
().
toString
();
}
}
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
name
=
new
StringBuilder
();
sb
.
append
(
getQualifiedName
(
type
.
asElement
()));
name
.
append
(
getQualifiedName
(
type
.
asElement
()));
if
(!
type
.
getTypeArguments
().
isEmpty
())
{
if
(!
type
.
getTypeArguments
().
isEmpty
())
{
List
<
String
>
parameters
=
type
.
getTypeArguments
().
stream
()
name
.
append
(
.
map
(
TypeMirror:
:
toString
).
collect
(
Collectors
.
toList
());
"<"
+
type
.
getTypeArguments
().
stream
().
map
(
TypeMirror:
:
toString
)
sb
.
append
(
"<"
).
append
(
String
.
join
(
","
,
parameters
)).
append
(
">"
);
.
collect
(
Collectors
.
joining
(
","
))
+
">"
);
}
}
return
sb
.
toString
();
return
name
.
toString
();
}
}
@Override
@Override
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java
View file @
6d93573d
...
@@ -277,12 +277,12 @@ public class ConfigurationMetadataAnnotationProcessorTests {
...
@@ -277,12 +277,12 @@ public class ConfigurationMetadataAnnotationProcessorTests {
@Test
@Test
public
void
parseArrayConfig
()
throws
Exception
{
public
void
parseArrayConfig
()
throws
Exception
{
ConfigurationMetadata
metadata
=
compile
(
SimpleArrayProperties
.
class
);
ConfigurationMetadata
metadata
=
compile
(
SimpleArrayProperties
.
class
);
assertThat
(
metadata
)
.
has
(
Metadata
.
withGroup
(
"array"
)
assertThat
(
metadata
)
.
ofType
(
SimpleArrayProperties
.
class
));
.
has
(
Metadata
.
withGroup
(
"array"
).
ofType
(
SimpleArrayProperties
.
class
));
assertThat
(
metadata
)
.
has
(
Metadata
.
withProperty
(
"array.primitive"
,
assertThat
(
metadata
)
"java.lang.Integer[]"
));
.
has
(
Metadata
.
withProperty
(
"array.primitive"
,
"java.lang.Integer[]"
));
assertThat
(
metadata
)
.
has
(
Metadata
.
withProperty
(
"array.simple"
,
assertThat
(
metadata
)
"java.lang.String[]"
));
.
has
(
Metadata
.
withProperty
(
"array.simple"
,
"java.lang.String[]"
));
assertThat
(
metadata
).
has
(
Metadata
.
withProperty
(
"array.inner"
,
assertThat
(
metadata
).
has
(
Metadata
.
withProperty
(
"array.inner"
,
"org.springframework.boot.configurationsample.simple.SimpleArrayProperties$Holder[]"
));
"org.springframework.boot.configurationsample.simple.SimpleArrayProperties$Holder[]"
));
assertThat
(
metadata
).
has
(
Metadata
.
withProperty
(
"array.name-to-integer"
,
assertThat
(
metadata
).
has
(
Metadata
.
withProperty
(
"array.name-to-integer"
,
...
@@ -503,8 +503,8 @@ public class ConfigurationMetadataAnnotationProcessorTests {
...
@@ -503,8 +503,8 @@ public class ConfigurationMetadataAnnotationProcessorTests {
@Test
@Test
public
void
wildcardTypes
()
throws
IOException
{
public
void
wildcardTypes
()
throws
IOException
{
ConfigurationMetadata
metadata
=
compile
(
WildcardConfig
.
class
);
ConfigurationMetadata
metadata
=
compile
(
WildcardConfig
.
class
);
assertThat
(
metadata
)
.
has
(
Metadata
.
withGroup
(
"wildcard"
)
assertThat
(
metadata
)
.
ofType
(
WildcardConfig
.
class
));
.
has
(
Metadata
.
withGroup
(
"wildcard"
).
ofType
(
WildcardConfig
.
class
));
assertThat
(
metadata
).
has
(
Metadata
.
withProperty
(
"wildcard.string-to-number"
)
assertThat
(
metadata
).
has
(
Metadata
.
withProperty
(
"wildcard.string-to-number"
)
.
ofType
(
"java.util.Map<java.lang.String,? extends java.lang.Number>"
)
.
ofType
(
"java.util.Map<java.lang.String,? extends java.lang.Number>"
)
.
fromSource
(
WildcardConfig
.
class
));
.
fromSource
(
WildcardConfig
.
class
));
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/simple/SimpleCollectionProperties.java
View file @
6d93573d
...
@@ -89,6 +89,7 @@ public class SimpleCollectionProperties {
...
@@ -89,6 +89,7 @@ public class SimpleCollectionProperties {
public
static
class
Holder
<
T
>
{
public
static
class
Holder
<
T
>
{
@SuppressWarnings
(
"unused"
)
private
T
target
;
private
T
target
;
public
void
setTarget
(
T
target
)
{
public
void
setTarget
(
T
target
)
{
...
...
spring-boot-tests/spring-boot-integration-tests/spring-boot-configuration-processor-tests/pom.xml
View file @
6d93573d
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<parent>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
...
@@ -27,7 +26,6 @@
...
@@ -27,7 +26,6 @@
<groupId>
javax.validation
</groupId>
<groupId>
javax.validation
</groupId>
<artifactId>
validation-api
</artifactId>
<artifactId>
validation-api
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-configuration-processor
</artifactId>
<artifactId>
spring-boot-configuration-processor
</artifactId>
...
...
spring-boot-tests/spring-boot-integration-tests/spring-boot-configuration-processor-tests/src/test/java/org/springframework/boot/configurationprocessor/tests/ConfigurationProcessorIntegrationTests.java
View file @
6d93573d
...
@@ -44,8 +44,8 @@ public class ConfigurationProcessorIntegrationTests {
...
@@ -44,8 +44,8 @@ public class ConfigurationProcessorIntegrationTests {
"META-INF/spring-configuration-metadata.json"
);
"META-INF/spring-configuration-metadata.json"
);
assertThat
(
resource
.
exists
()).
isTrue
();
assertThat
(
resource
.
exists
()).
isTrue
();
// Make sure the right file is detected
// Make sure the right file is detected
assertThat
(
resource
.
getURL
().
toString
())
.
contains
(
assertThat
(
resource
.
getURL
().
toString
())
"spring-boot-configuration-processor-tests"
);
.
contains
(
"spring-boot-configuration-processor-tests"
);
repository
=
ConfigurationMetadataRepositoryJsonBuilder
repository
=
ConfigurationMetadataRepositoryJsonBuilder
.
create
(
resource
.
getInputStream
()).
build
();
.
create
(
resource
.
getInputStream
()).
build
();
...
@@ -53,8 +53,8 @@ public class ConfigurationProcessorIntegrationTests {
...
@@ -53,8 +53,8 @@ public class ConfigurationProcessorIntegrationTests {
@Test
@Test
public
void
extractTypeFromAnnotatedGetter
()
{
public
void
extractTypeFromAnnotatedGetter
()
{
ConfigurationMetadataProperty
property
=
repository
.
getAllProperties
()
.
get
(
ConfigurationMetadataProperty
property
=
repository
.
getAllProperties
()
"annotated.name"
);
.
get
(
"annotated.name"
);
assertThat
(
property
).
isNotNull
();
assertThat
(
property
).
isNotNull
();
assertThat
(
property
.
getType
()).
isEqualTo
(
"java.lang.String"
);
assertThat
(
property
.
getType
()).
isEqualTo
(
"java.lang.String"
);
}
}
...
...
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