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
9e43b999
Commit
9e43b999
authored
Sep 28, 2017
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
7e2d7dcd
Changes
42
Show whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
182 additions
and
192 deletions
+182
-192
EnvironmentEndpoint.java
...springframework/boot/actuate/env/EnvironmentEndpoint.java
+27
-46
EnvironmentWebEndpointExtension.java
...ork/boot/actuate/env/EnvironmentWebEndpointExtension.java
+8
-3
package-info.java
...org/springframework/boot/actuate/health/package-info.java
+1
-1
package-info.java
...g/springframework/boot/actuate/security/package-info.java
+1
-1
RabbitAutoConfiguration.java
...work/boot/autoconfigure/amqp/RabbitAutoConfiguration.java
+1
-1
CacheType.java
...g/springframework/boot/autoconfigure/cache/CacheType.java
+1
-1
ReactiveAuthenticationManagerConfiguration.java
.../reactive/ReactiveAuthenticationManagerConfiguration.java
+1
-0
ReactiveSecurityAutoConfiguration.java
.../security/reactive/ReactiveSecurityAutoConfiguration.java
+1
-1
WebfluxSecurityConfiguration.java
...igure/security/reactive/WebfluxSecurityConfiguration.java
+2
-3
WebServicesAutoConfiguration.java
...toconfigure/webservices/WebServicesAutoConfiguration.java
+2
-5
service.wsdl
...g-boot-autoconfigure/src/test/resources/wsdl/service.wsdl
+39
-45
types.xsd
spring-boot-autoconfigure/src/test/resources/wsdl/types.xsd
+5
-4
RepositoryConfiguration.java
...work/boot/cli/compiler/grape/RepositoryConfiguration.java
+1
-1
CommandRunnerTests.java
.../springframework/boot/cli/command/CommandRunnerTests.java
+1
-1
HelloWebSecurityApplication.java
...rld/src/main/java/sample/HelloWebSecurityApplication.java
+2
-1
SampleActuatorLog4J2Application.java
...mple/actuator/log4j2/SampleActuatorLog4J2Application.java
+2
-1
SampleActuatorUiApplication.java
.../java/sample/actuator/ui/SampleActuatorUiApplication.java
+2
-1
SampleActuatorApplication.java
.../main/java/sample/actuator/SampleActuatorApplication.java
+2
-1
pom.xml
...ng-boot-samples/spring-boot-sample-secure-webflux/pom.xml
+2
-1
SampleSecureWebFluxApplication.java
...sample/secure/webflux/SampleSecureWebFluxApplication.java
+2
-3
SampleSecureWebFluxApplicationTests.java
...e/secure/webflux/SampleSecureWebFluxApplicationTests.java
+3
-5
SampleSecureApplication.java
.../src/main/java/sample/secure/SampleSecureApplication.java
+2
-1
SampleServletApplication.java
...rc/main/java/sample/servlet/SampleServletApplication.java
+2
-1
SampleSessionApplication.java
...rc/main/java/sample/session/SampleSessionApplication.java
+2
-1
SampleSessionApplicationTests.java
...st/java/sample/session/SampleSessionApplicationTests.java
+29
-22
WebServiceConfig.java
...es/src/main/java/sample/webservices/WebServiceConfig.java
+1
-1
pom.xml
...ot-starters/spring-boot-starter-security-reactive/pom.xml
+2
-1
spring.provides
...rity-reactive/src/main/resources/META-INF/spring.provides
+1
-1
AutoConfigureJsonTesters.java
...oot/test/autoconfigure/json/AutoConfigureJsonTesters.java
+1
-1
JsonTest.java
...pringframework/boot/test/autoconfigure/json/JsonTest.java
+1
-1
RestDocsTestApplication.java
.../test/autoconfigure/restdocs/RestDocsTestApplication.java
+1
-1
AbstractJupiterTestWithConfigAndExtendWith.java
...xt/filter/AbstractJupiterTestWithConfigAndExtendWith.java
+1
-1
DefaultLaunchScript.java
...pringframework/boot/loader/tools/DefaultLaunchScript.java
+1
-3
SpringConfiguration.java
...pringframework/launcher/it/props/SpringConfiguration.java
+1
-1
AggregateBinder.java
...amework/boot/context/properties/bind/AggregateBinder.java
+5
-7
ArrayBinder.java
...ngframework/boot/context/properties/bind/ArrayBinder.java
+2
-2
Binder.java
.../springframework/boot/context/properties/bind/Binder.java
+0
-1
CollectionBinder.java
...mework/boot/context/properties/bind/CollectionBinder.java
+10
-9
MapBinder.java
...ringframework/boot/context/properties/bind/MapBinder.java
+4
-7
ConfigurationPropertySources.java
...ntext/properties/source/ConfigurationPropertySources.java
+1
-1
CollectionBinderTests.java
...k/boot/context/properties/bind/CollectionBinderTests.java
+8
-2
PoolingConnectionFactoryBeanTests.java
.../boot/jta/bitronix/PoolingConnectionFactoryBeanTests.java
+1
-1
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/env/EnvironmentEndpoint.java
View file @
9e43b999
...
@@ -42,11 +42,9 @@ import org.springframework.core.env.Environment;
...
@@ -42,11 +42,9 @@ import org.springframework.core.env.Environment;
import
org.springframework.core.env.MutablePropertySources
;
import
org.springframework.core.env.MutablePropertySources
;
import
org.springframework.core.env.PropertySource
;
import
org.springframework.core.env.PropertySource
;
import
org.springframework.core.env.StandardEnvironment
;
import
org.springframework.core.env.StandardEnvironment
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.util.PropertyPlaceholderHelper
;
import
org.springframework.util.PropertyPlaceholderHelper
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.SystemPropertyUtils
;
import
org.springframework.util.SystemPropertyUtils
;
import
org.springframework.web.bind.annotation.ResponseStatus
;
/**
/**
* {@link Endpoint} to expose {@link ConfigurableEnvironment environment} information.
* {@link Endpoint} to expose {@link ConfigurableEnvironment environment} information.
...
@@ -114,10 +112,8 @@ public class EnvironmentEndpoint {
...
@@ -114,10 +112,8 @@ public class EnvironmentEndpoint {
private
List
<
PropertySourceEntryDescriptor
>
toPropertySourceDescriptors
(
private
List
<
PropertySourceEntryDescriptor
>
toPropertySourceDescriptors
(
Map
<
String
,
PropertyValueDescriptor
>
descriptors
)
{
Map
<
String
,
PropertyValueDescriptor
>
descriptors
)
{
List
<
PropertySourceEntryDescriptor
>
result
=
new
ArrayList
<>();
List
<
PropertySourceEntryDescriptor
>
result
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
String
,
PropertyValueDescriptor
>
entry
:
descriptors
.
entrySet
())
{
descriptors
.
forEach
((
name
,
property
)
->
result
result
.
add
(
.
add
(
new
PropertySourceEntryDescriptor
(
name
,
property
)));
new
PropertySourceEntryDescriptor
(
entry
.
getKey
(),
entry
.
getValue
()));
}
return
result
;
return
result
;
}
}
...
@@ -153,10 +149,10 @@ public class EnvironmentEndpoint {
...
@@ -153,10 +149,10 @@ public class EnvironmentEndpoint {
return
new
PropertySourceDescriptor
(
sourceName
,
properties
);
return
new
PropertySourceDescriptor
(
sourceName
,
properties
);
}
}
@SuppressWarnings
(
"unchecked"
)
private
PropertyValueDescriptor
describeValueOf
(
String
name
,
PropertySource
<?>
source
,
private
PropertyValueDescriptor
describeValueOf
(
String
name
,
PropertySource
<?>
source
,
PlaceholdersResolver
resolver
)
{
PlaceholdersResolver
resolver
)
{
Object
resolved
=
resolver
.
resolvePlaceholders
(
source
.
getProperty
(
name
));
Object
resolved
=
resolver
.
resolvePlaceholders
(
source
.
getProperty
(
name
));
@SuppressWarnings
(
"unchecked"
)
String
origin
=
(
source
instanceof
OriginLookup
)
String
origin
=
(
source
instanceof
OriginLookup
)
?
((
OriginLookup
<
Object
>)
source
).
getOrigin
(
name
).
toString
()
:
null
;
?
((
OriginLookup
<
Object
>)
source
).
getOrigin
(
name
).
toString
()
:
null
;
return
new
PropertyValueDescriptor
(
sanitize
(
name
,
resolved
),
origin
);
return
new
PropertyValueDescriptor
(
sanitize
(
name
,
resolved
),
origin
);
...
@@ -170,7 +166,7 @@ public class EnvironmentEndpoint {
...
@@ -170,7 +166,7 @@ public class EnvironmentEndpoint {
private
Map
<
String
,
PropertySource
<?>>
getPropertySourcesAsMap
()
{
private
Map
<
String
,
PropertySource
<?>>
getPropertySourcesAsMap
()
{
Map
<
String
,
PropertySource
<?>>
map
=
new
LinkedHashMap
<>();
Map
<
String
,
PropertySource
<?>>
map
=
new
LinkedHashMap
<>();
for
(
PropertySource
<?>
source
:
getPropertySources
())
{
for
(
PropertySource
<?>
source
:
getPropertySources
())
{
if
(!
ConfigurationPropertySources
.
is
Main
ConfigurationPropertySource
(
source
))
{
if
(!
ConfigurationPropertySources
.
is
Attached
ConfigurationPropertySource
(
source
))
{
extract
(
""
,
map
,
source
);
extract
(
""
,
map
,
source
);
}
}
}
}
...
@@ -178,14 +174,10 @@ public class EnvironmentEndpoint {
...
@@ -178,14 +174,10 @@ public class EnvironmentEndpoint {
}
}
private
MutablePropertySources
getPropertySources
()
{
private
MutablePropertySources
getPropertySources
()
{
MutablePropertySources
sources
;
if
(
this
.
environment
instanceof
ConfigurableEnvironment
)
{
if
(
this
.
environment
instanceof
ConfigurableEnvironment
)
{
sources
=
((
ConfigurableEnvironment
)
this
.
environment
).
getPropertySources
();
return
((
ConfigurableEnvironment
)
this
.
environment
).
getPropertySources
();
}
}
else
{
return
new
StandardEnvironment
().
getPropertySources
();
sources
=
new
StandardEnvironment
().
getPropertySources
();
}
return
sources
;
}
}
private
void
extract
(
String
root
,
Map
<
String
,
PropertySource
<?>>
map
,
private
void
extract
(
String
root
,
Map
<
String
,
PropertySource
<?>>
map
,
...
@@ -226,8 +218,10 @@ public class EnvironmentEndpoint {
...
@@ -226,8 +218,10 @@ public class EnvironmentEndpoint {
@Override
@Override
protected
String
resolvePlaceholder
(
String
placeholder
)
{
protected
String
resolvePlaceholder
(
String
placeholder
)
{
String
value
=
super
.
resolvePlaceholder
(
placeholder
);
String
value
=
super
.
resolvePlaceholder
(
placeholder
);
return
(
value
!=
null
?
(
String
)
this
.
sanitizer
.
sanitize
(
placeholder
,
value
)
if
(
value
==
null
)
{
:
null
);
return
null
;
}
return
(
String
)
this
.
sanitizer
.
sanitize
(
placeholder
,
value
);
}
}
}
}
...
@@ -317,52 +311,52 @@ public class EnvironmentEndpoint {
...
@@ -317,52 +311,52 @@ public class EnvironmentEndpoint {
}
}
/**
/**
* A description of a
particular entry of
{@link PropertySource}.
* A description of a {@link PropertySource}.
*/
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
static
final
class
PropertySourceDescriptor
{
public
static
final
class
PropertySourceEntryDescriptor
{
private
final
String
name
;
private
final
String
name
;
private
final
PropertyValueDescriptor
property
;
private
final
Map
<
String
,
PropertyValueDescriptor
>
properties
;
private
PropertySource
Entry
Descriptor
(
String
name
,
private
PropertySourceDescriptor
(
String
name
,
PropertyValueDescriptor
property
)
{
Map
<
String
,
PropertyValueDescriptor
>
properties
)
{
this
.
name
=
name
;
this
.
name
=
name
;
this
.
propert
y
=
property
;
this
.
propert
ies
=
properties
;
}
}
public
String
getName
()
{
public
String
getName
()
{
return
this
.
name
;
return
this
.
name
;
}
}
public
PropertyValueDescriptor
getProperty
()
{
public
Map
<
String
,
PropertyValueDescriptor
>
getProperties
()
{
return
this
.
propert
y
;
return
this
.
propert
ies
;
}
}
}
}
/**
/**
* A description of a {@link PropertySource}.
* A description of a
particular entry of
{@link PropertySource}.
*/
*/
public
static
final
class
PropertySourceDescriptor
{
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
static
final
class
PropertySourceEntryDescriptor
{
private
final
String
name
;
private
final
String
name
;
private
final
Map
<
String
,
PropertyValueDescriptor
>
properties
;
private
final
PropertyValueDescriptor
property
;
private
PropertySourceDescriptor
(
String
name
,
private
PropertySource
Entry
Descriptor
(
String
name
,
Map
<
String
,
PropertyValueDescriptor
>
properties
)
{
PropertyValueDescriptor
property
)
{
this
.
name
=
name
;
this
.
name
=
name
;
this
.
propert
ies
=
properties
;
this
.
propert
y
=
property
;
}
}
public
String
getName
()
{
public
String
getName
()
{
return
this
.
name
;
return
this
.
name
;
}
}
public
Map
<
String
,
PropertyValueDescriptor
>
getProperties
()
{
public
PropertyValueDescriptor
getProperty
()
{
return
this
.
propert
ies
;
return
this
.
propert
y
;
}
}
}
}
...
@@ -392,17 +386,4 @@ public class EnvironmentEndpoint {
...
@@ -392,17 +386,4 @@ public class EnvironmentEndpoint {
}
}
/**
* Exception thrown when the specified property cannot be found.
*/
@SuppressWarnings
(
"serial"
)
@ResponseStatus
(
value
=
HttpStatus
.
NOT_FOUND
,
reason
=
"No such property"
)
public
static
class
NoSuchPropertyException
extends
RuntimeException
{
public
NoSuchPropertyException
(
String
string
)
{
super
(
string
);
}
}
}
}
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/env/EnvironmentWebEndpointExtension.java
View file @
9e43b999
...
@@ -41,9 +41,14 @@ public class EnvironmentWebEndpointExtension {
...
@@ -41,9 +41,14 @@ public class EnvironmentWebEndpointExtension {
public
WebEndpointResponse
<
EnvironmentEntryDescriptor
>
environmentEntry
(
public
WebEndpointResponse
<
EnvironmentEntryDescriptor
>
environmentEntry
(
@Selector
String
toMatch
)
{
@Selector
String
toMatch
)
{
EnvironmentEntryDescriptor
descriptor
=
this
.
delegate
.
environmentEntry
(
toMatch
);
EnvironmentEntryDescriptor
descriptor
=
this
.
delegate
.
environmentEntry
(
toMatch
);
int
status
=
descriptor
.
getProperty
()
!=
null
?
WebEndpointResponse
.
STATUS_OK
return
new
WebEndpointResponse
<>(
descriptor
,
getStatus
(
descriptor
));
:
WebEndpointResponse
.
STATUS_NOT_FOUND
;
}
return
new
WebEndpointResponse
<>(
descriptor
,
status
);
private
int
getStatus
(
EnvironmentEntryDescriptor
descriptor
)
{
if
(
descriptor
.
getProperty
()
==
null
)
{
return
WebEndpointResponse
.
STATUS_NOT_FOUND
;
}
return
WebEndpointResponse
.
STATUS_OK
;
}
}
}
}
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/package-info.java
View file @
9e43b999
/*
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
7
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.
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/security/package-info.java
View file @
9e43b999
/*
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
7
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.
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfiguration.java
View file @
9e43b999
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheType.java
View file @
9e43b999
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/ReactiveAuthenticationManagerConfiguration.java
View file @
9e43b999
...
@@ -58,4 +58,5 @@ public class ReactiveAuthenticationManagerConfiguration {
...
@@ -58,4 +58,5 @@ public class ReactiveAuthenticationManagerConfiguration {
UserDetails
user
=
User
.
withUsername
(
"user"
).
password
(
password
).
roles
().
build
();
UserDetails
user
=
User
.
withUsername
(
"user"
).
password
(
password
).
roles
().
build
();
return
new
MapUserDetailsRepository
(
user
);
return
new
MapUserDetailsRepository
(
user
);
}
}
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/ReactiveSecurityAutoConfiguration.java
View file @
9e43b999
...
@@ -35,7 +35,7 @@ import org.springframework.security.web.reactive.result.method.annotation.Authen
...
@@ -35,7 +35,7 @@ import org.springframework.security.web.reactive.result.method.annotation.Authen
@Configuration
@Configuration
@ConditionalOnClass
({
EnableWebFluxSecurity
.
class
,
@ConditionalOnClass
({
EnableWebFluxSecurity
.
class
,
AuthenticationPrincipalArgumentResolver
.
class
})
AuthenticationPrincipalArgumentResolver
.
class
})
@Import
({
Web
f
luxSecurityConfiguration
.
class
,
@Import
({
Web
F
luxSecurityConfiguration
.
class
,
ReactiveAuthenticationManagerConfiguration
.
class
})
ReactiveAuthenticationManagerConfiguration
.
class
})
public
class
ReactiveSecurityAutoConfiguration
{
public
class
ReactiveSecurityAutoConfiguration
{
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/WebfluxSecurityConfiguration.java
View file @
9e43b999
...
@@ -20,7 +20,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
...
@@ -20,7 +20,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity
;
import
org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity
;
import
org.springframework.security.config.annotation.web.reactive.WebFluxSecurityConfiguration
;
/**
/**
* Switches on {@link EnableWebFluxSecurity} for a reactive web application if this
* Switches on {@link EnableWebFluxSecurity} for a reactive web application if this
...
@@ -30,9 +29,9 @@ import org.springframework.security.config.annotation.web.reactive.WebFluxSecuri
...
@@ -30,9 +29,9 @@ import org.springframework.security.config.annotation.web.reactive.WebFluxSecuri
* @since 2.0.0
* @since 2.0.0
*/
*/
@ConditionalOnClass
(
EnableWebFluxSecurity
.
class
)
@ConditionalOnClass
(
EnableWebFluxSecurity
.
class
)
@ConditionalOnMissingBean
(
WebFluxSecurityConfiguration
.
class
)
@ConditionalOnMissingBean
(
org
.
springframework
.
security
.
config
.
annotation
.
web
.
reactive
.
WebFluxSecurityConfiguration
.
class
)
@ConditionalOnWebApplication
(
type
=
ConditionalOnWebApplication
.
Type
.
REACTIVE
)
@ConditionalOnWebApplication
(
type
=
ConditionalOnWebApplication
.
Type
.
REACTIVE
)
@EnableWebFluxSecurity
@EnableWebFluxSecurity
public
class
Web
f
luxSecurityConfiguration
{
public
class
Web
F
luxSecurityConfiguration
{
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfiguration.java
View file @
9e43b999
...
@@ -154,11 +154,8 @@ public class WebServicesAutoConfiguration {
...
@@ -154,11 +154,8 @@ public class WebServicesAutoConfiguration {
}
}
}
}
private
static
String
ensureTrailingSlash
(
String
path
)
{
private
String
ensureTrailingSlash
(
String
path
)
{
if
(!
path
.
endsWith
(
"/"
))
{
return
(
path
.
endsWith
(
"/"
)
?
path
:
path
+
"/"
);
return
path
+
"/"
;
}
return
path
;
}
}
}
}
...
...
spring-boot-autoconfigure/src/test/resources/wsdl/service.wsdl
View file @
9e43b999
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
xmlns:wsdl=
"http://schemas.xmlsoap.org/wsdl/"
<wsdl:definitions
xmlns:wsdl=
"http://schemas.xmlsoap.org/wsdl/"
xmlns:tns=
"http://www.springframework.org/spring-ws/wsdl"
xmlns:tns=
"http://www.springframework.org/spring-ws/wsdl"
xmlns:wsdlsoap=
"http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdlsoap=
"http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace=
"http://www.springframework.org/spring-ws/wsdl"
>
targetNamespace=
"http://www.springframework.org/spring-ws/wsdl"
>
<wsdl:types>
<wsdl:types>
<xsd:schema
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
elementFormDefault=
"qualified
"
<xsd:schema
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema
"
targetNamespace=
"http://www.springframework.org/spring-ws/wsdl"
>
elementFormDefault=
"qualified"
targetNamespace=
"http://www.springframework.org/spring-ws/wsdl"
>
<xsd:element
name=
"request"
type=
"xsd:string"
/>
<xsd:element
name=
"request"
type=
"xsd:string"
/>
<xsd:element
name=
"response"
type=
"xsd:string"
/>
<xsd:element
name=
"response"
type=
"xsd:string"
/>
</xsd:schema>
</xsd:schema>
</wsdl:types>
</wsdl:types>
<wsdl:message
name=
"responseMessage"
>
<wsdl:message
name=
"responseMessage"
>
<wsdl:part
name=
"body"
element=
"tns:response"
/>
<wsdl:part
name=
"body"
element=
"tns:response"
/>
</wsdl:message>
</wsdl:message>
<wsdl:message
name=
"requestMessage"
>
<wsdl:message
name=
"requestMessage"
>
<wsdl:part
name=
"body"
element=
"tns:request"
/>
<wsdl:part
name=
"body"
element=
"tns:request"
/>
</wsdl:message>
</wsdl:message>
<wsdl:portType
name=
"portType"
>
<wsdl:portType
name=
"portType"
>
<wsdl:operation
name=
"operation"
>
<wsdl:operation
name=
"operation"
>
<wsdl:input
message=
"tns:requestMessage"
name=
"request"
/>
<wsdl:input
message=
"tns:requestMessage"
name=
"request"
/>
<wsdl:output
message=
"tns:responseMessage"
name=
"response"
/>
<wsdl:output
message=
"tns:responseMessage"
name=
"response"
/>
</wsdl:operation>
</wsdl:operation>
</wsdl:portType>
</wsdl:portType>
<wsdl:binding
name=
"binding"
type=
"tns:portType"
>
<wsdl:binding
name=
"binding"
type=
"tns:portType"
>
<wsdlsoap:binding
style=
"document"
transport=
"http://schemas.xmlsoap.org/soap/http"
/>
<wsdlsoap:binding
style=
"document"
transport=
"http://schemas.xmlsoap.org/soap/http"
/>
<wsdl:operation
name=
"operation"
>
<wsdl:operation
name=
"operation"
>
<wsdlsoap:operation
soapAction=
""
/>
<wsdlsoap:operation
soapAction=
""
/>
<wsdl:input
name=
"request"
>
<wsdl:input
name=
"request"
>
<wsdlsoap:body
use=
"literal"
/>
<wsdlsoap:body
use=
"literal"
/>
</wsdl:input>
</wsdl:input>
<wsdl:output
name=
"response"
>
<wsdl:output
name=
"response"
>
<wsdlsoap:body
use=
"literal"
/>
<wsdlsoap:body
use=
"literal"
/>
</wsdl:output>
</wsdl:output>
</wsdl:operation>
</wsdl:operation>
</wsdl:binding>
</wsdl:binding>
<wsdl:service
name=
"service"
>
<wsdl:service
name=
"service"
>
<wsdl:port
binding=
"tns:binding"
name=
"port"
>
<wsdl:port
binding=
"tns:binding"
name=
"port"
>
<wsdlsoap:address
location=
"/services"
/>
<wsdlsoap:address
location=
"/services"
/>
</wsdl:port>
</wsdl:port>
</wsdl:service>
</wsdl:service>
</wsdl:definitions>
</wsdl:definitions>
...
...
spring-boot-autoconfigure/src/test/resources/wsdl/types.xsd
View file @
9e43b999
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<schema
xmlns=
"http://www.w3.org/2001/XMLSchema"
elementFormDefault=
"qualified"
<schema
xmlns=
"http://www.w3.org/2001/XMLSchema"
elementFormDefault=
"qualified"
targetNamespace=
"http://www.springframework.org/spring-ws/wsdl/schemas"
>
targetNamespace=
"http://www.springframework.org/spring-ws/wsdl/schemas"
>
<element
name=
"request"
type=
"string"
/>
<element
name=
"request"
type=
"string"
/>
<element
name=
"response"
type=
"string"
/>
<element
name=
"response"
type=
"string"
/>
</schema>
</schema>
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/RepositoryConfiguration.java
View file @
9e43b999
/*
/*
* Copyright 2012-201
4
the original author or authors.
* Copyright 2012-201
7
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.
...
...
spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerTests.java
View file @
9e43b999
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
...
spring-boot-integration-tests/spring-boot-security-tests/spring-boot-security-test-web-helloworld/src/main/java/sample/HelloWebSecurityApplication.java
View file @
9e43b999
...
@@ -27,7 +27,8 @@ public class HelloWebSecurityApplication {
...
@@ -27,7 +27,8 @@ public class HelloWebSecurityApplication {
@Bean
@Bean
public
InMemoryUserDetailsManager
inMemoryUserDetailsManager
()
throws
Exception
{
public
InMemoryUserDetailsManager
inMemoryUserDetailsManager
()
throws
Exception
{
return
new
InMemoryUserDetailsManager
(
User
.
withUsername
(
"user"
).
password
(
"password"
).
roles
(
"USER"
).
build
());
return
new
InMemoryUserDetailsManager
(
User
.
withUsername
(
"user"
).
password
(
"password"
).
roles
(
"USER"
).
build
());
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
...
spring-boot-samples/spring-boot-sample-actuator-log4j2/src/main/java/sample/actuator/log4j2/SampleActuatorLog4J2Application.java
View file @
9e43b999
...
@@ -27,7 +27,8 @@ public class SampleActuatorLog4J2Application {
...
@@ -27,7 +27,8 @@ public class SampleActuatorLog4J2Application {
@Bean
@Bean
public
InMemoryUserDetailsManager
inMemoryUserDetailsManager
()
throws
Exception
{
public
InMemoryUserDetailsManager
inMemoryUserDetailsManager
()
throws
Exception
{
return
new
InMemoryUserDetailsManager
(
User
.
withUsername
(
"user"
).
password
(
"password"
).
roles
(
"USER"
).
build
());
return
new
InMemoryUserDetailsManager
(
User
.
withUsername
(
"user"
).
password
(
"password"
).
roles
(
"USER"
).
build
());
}
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
...
...
spring-boot-samples/spring-boot-sample-actuator-ui/src/main/java/sample/actuator/ui/SampleActuatorUiApplication.java
View file @
9e43b999
...
@@ -34,7 +34,8 @@ public class SampleActuatorUiApplication {
...
@@ -34,7 +34,8 @@ public class SampleActuatorUiApplication {
@Bean
@Bean
public
InMemoryUserDetailsManager
inMemoryUserDetailsManager
()
throws
Exception
{
public
InMemoryUserDetailsManager
inMemoryUserDetailsManager
()
throws
Exception
{
return
new
InMemoryUserDetailsManager
(
User
.
withUsername
(
"user"
).
password
(
"password"
).
roles
(
"USER"
).
build
());
return
new
InMemoryUserDetailsManager
(
User
.
withUsername
(
"user"
).
password
(
"password"
).
roles
(
"USER"
).
build
());
}
}
@GetMapping
(
"/"
)
@GetMapping
(
"/"
)
...
...
spring-boot-samples/spring-boot-sample-actuator/src/main/java/sample/actuator/SampleActuatorApplication.java
View file @
9e43b999
...
@@ -35,7 +35,8 @@ public class SampleActuatorApplication {
...
@@ -35,7 +35,8 @@ public class SampleActuatorApplication {
@Bean
@Bean
public
InMemoryUserDetailsManager
inMemoryUserDetailsManager
()
throws
Exception
{
public
InMemoryUserDetailsManager
inMemoryUserDetailsManager
()
throws
Exception
{
return
new
InMemoryUserDetailsManager
(
User
.
withUsername
(
"user"
).
password
(
"password"
).
roles
(
"USER"
).
build
());
return
new
InMemoryUserDetailsManager
(
User
.
withUsername
(
"user"
).
password
(
"password"
).
roles
(
"USER"
).
build
());
}
}
@Bean
@Bean
...
...
spring-boot-samples/spring-boot-sample-secure-webflux/pom.xml
View file @
9e43b999
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
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"
>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
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"
>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<parent>
<!-- Your own application should inherit from spring-boot-starter-parent -->
<!-- Your own application should inherit from spring-boot-starter-parent -->
...
...
spring-boot-samples/spring-boot-sample-secure-webflux/src/main/java/sample/secure/webflux/SampleSecureWebFluxApplication.java
View file @
9e43b999
...
@@ -21,7 +21,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
...
@@ -21,7 +21,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.security.core.userdetails.MapUserDetailsRepository
;
import
org.springframework.security.core.userdetails.MapUserDetailsRepository
;
import
org.springframework.security.core.userdetails.User
;
import
org.springframework.security.core.userdetails.User
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.security.core.userdetails.UserDetailsRepository
;
import
org.springframework.security.core.userdetails.UserDetailsRepository
;
import
org.springframework.web.reactive.function.server.RouterFunction
;
import
org.springframework.web.reactive.function.server.RouterFunction
;
import
org.springframework.web.reactive.function.server.ServerResponse
;
import
org.springframework.web.reactive.function.server.ServerResponse
;
...
@@ -43,8 +42,8 @@ public class SampleSecureWebFluxApplication {
...
@@ -43,8 +42,8 @@ public class SampleSecureWebFluxApplication {
@Bean
@Bean
public
UserDetailsRepository
userDetailsRepository
()
{
public
UserDetailsRepository
userDetailsRepository
()
{
UserDetails
user
=
User
.
withUsername
(
"foo"
).
password
(
"password"
).
roles
(
"USER"
).
build
();
return
new
MapUserDetailsRepository
(
return
new
MapUserDetailsRepository
(
user
);
User
.
withUsername
(
"foo"
).
password
(
"password"
).
roles
(
"USER"
).
build
()
);
}
}
}
}
spring-boot-samples/spring-boot-sample-secure-webflux/src/test/java/sample/secure/webflux/SampleSecureWebFluxApplicationTests.java
View file @
9e43b999
...
@@ -57,16 +57,14 @@ public class SampleSecureWebFluxApplicationTests {
...
@@ -57,16 +57,14 @@ public class SampleSecureWebFluxApplicationTests {
@Test
@Test
public
void
userDefinedMappingsAccessibleOnLogin
()
{
public
void
userDefinedMappingsAccessibleOnLogin
()
{
this
.
webClient
.
get
().
uri
(
"/"
).
accept
(
MediaType
.
APPLICATION_JSON
)
this
.
webClient
.
get
().
uri
(
"/"
).
accept
(
MediaType
.
APPLICATION_JSON
)
.
header
(
"Authorization"
,
"basic "
+
getBasicAuth
())
.
header
(
"Authorization"
,
"basic "
+
getBasicAuth
()).
exchange
()
.
exchange
()
.
expectBody
(
String
.
class
).
isEqualTo
(
"Hello foo"
);
.
expectBody
(
String
.
class
).
isEqualTo
(
"Hello foo"
);
}
}
@Test
@Test
public
void
actuatorsAccessibleOnLogin
()
{
public
void
actuatorsAccessibleOnLogin
()
{
this
.
webClient
.
get
().
uri
(
"/application/status"
).
accept
(
MediaType
.
APPLICATION_JSON
)
this
.
webClient
.
get
().
uri
(
"/application/status"
).
accept
(
MediaType
.
APPLICATION_JSON
)
.
header
(
"Authorization"
,
"basic "
+
getBasicAuth
())
.
header
(
"Authorization"
,
"basic "
+
getBasicAuth
()).
exchange
()
.
exchange
()
.
expectBody
(
String
.
class
).
isEqualTo
(
"{\"status\":\"UP\"}"
);
.
expectBody
(
String
.
class
).
isEqualTo
(
"{\"status\":\"UP\"}"
);
}
}
...
...
spring-boot-samples/spring-boot-sample-secure/src/main/java/sample/secure/SampleSecureApplication.java
View file @
9e43b999
...
@@ -39,7 +39,8 @@ public class SampleSecureApplication implements CommandLineRunner {
...
@@ -39,7 +39,8 @@ public class SampleSecureApplication implements CommandLineRunner {
@Bean
@Bean
public
InMemoryUserDetailsManager
inMemoryUserDetailsManager
()
throws
Exception
{
public
InMemoryUserDetailsManager
inMemoryUserDetailsManager
()
throws
Exception
{
return
new
InMemoryUserDetailsManager
(
User
.
withUsername
(
"user"
).
password
(
"password"
).
roles
(
"USER"
).
build
());
return
new
InMemoryUserDetailsManager
(
User
.
withUsername
(
"user"
).
password
(
"password"
).
roles
(
"USER"
).
build
());
}
}
@Override
@Override
...
...
spring-boot-samples/spring-boot-sample-servlet/src/main/java/sample/servlet/SampleServletApplication.java
View file @
9e43b999
...
@@ -39,7 +39,8 @@ public class SampleServletApplication extends SpringBootServletInitializer {
...
@@ -39,7 +39,8 @@ public class SampleServletApplication extends SpringBootServletInitializer {
@Bean
@Bean
public
InMemoryUserDetailsManager
inMemoryUserDetailsManager
()
throws
Exception
{
public
InMemoryUserDetailsManager
inMemoryUserDetailsManager
()
throws
Exception
{
return
new
InMemoryUserDetailsManager
(
User
.
withUsername
(
"user"
).
password
(
"password"
).
roles
(
"USER"
).
build
());
return
new
InMemoryUserDetailsManager
(
User
.
withUsername
(
"user"
).
password
(
"password"
).
roles
(
"USER"
).
build
());
}
}
@SuppressWarnings
(
"serial"
)
@SuppressWarnings
(
"serial"
)
...
...
spring-boot-samples/spring-boot-sample-session/src/main/java/sample/session/SampleSessionApplication.java
View file @
9e43b999
...
@@ -31,7 +31,8 @@ public class SampleSessionApplication {
...
@@ -31,7 +31,8 @@ public class SampleSessionApplication {
@Bean
@Bean
public
InMemoryUserDetailsManager
inMemoryUserDetailsManager
()
throws
Exception
{
public
InMemoryUserDetailsManager
inMemoryUserDetailsManager
()
throws
Exception
{
return
new
InMemoryUserDetailsManager
(
User
.
withUsername
(
"user"
).
password
(
"password"
).
roles
(
"USER"
).
build
());
return
new
InMemoryUserDetailsManager
(
User
.
withUsername
(
"user"
).
password
(
"password"
).
roles
(
"USER"
).
build
());
}
}
}
}
spring-boot-samples/spring-boot-sample-session/src/test/java/sample/session/SampleSessionApplicationTests.java
View file @
9e43b999
...
@@ -42,35 +42,42 @@ public class SampleSessionApplicationTests {
...
@@ -42,35 +42,42 @@ public class SampleSessionApplicationTests {
@Test
@Test
public
void
sessionExpiry
()
throws
Exception
{
public
void
sessionExpiry
()
throws
Exception
{
ConfigurableApplicationContext
context
=
createContext
();
String
port
=
context
.
getEnvironment
().
getProperty
(
"local.server.port"
);
URI
uri
=
URI
.
create
(
"http://localhost:"
+
port
+
"/"
);
RestTemplate
restTemplate
=
new
RestTemplate
();
ResponseEntity
<
String
>
firstResponse
=
firstRequest
(
restTemplate
,
uri
);
String
sessionId1
=
firstResponse
.
getBody
();
String
cookie
=
firstResponse
.
getHeaders
().
getFirst
(
"Set-Cookie"
);
String
sessionId2
=
nextRequest
(
restTemplate
,
uri
,
cookie
).
getBody
();
assertThat
(
sessionId1
).
isEqualTo
(
sessionId2
);
Thread
.
sleep
(
1000
);
String
loginPage
=
nextRequest
(
restTemplate
,
uri
,
cookie
).
getBody
();
assertThat
(
loginPage
).
containsIgnoringCase
(
"login"
);
}
private
ConfigurableApplicationContext
createContext
()
{
ConfigurableApplicationContext
context
=
new
SpringApplicationBuilder
()
ConfigurableApplicationContext
context
=
new
SpringApplicationBuilder
()
.
sources
(
SampleSessionApplication
.
class
)
.
sources
(
SampleSessionApplication
.
class
)
.
properties
(
"server.port:0"
,
"server.session.timeout:1"
)
.
properties
(
"server.port:0"
,
"server.session.timeout:1"
)
.
initializers
(
new
ServerPortInfoApplicationContextInitializer
()).
run
();
.
initializers
(
new
ServerPortInfoApplicationContextInitializer
()).
run
();
String
port
=
context
.
getEnvironment
().
getProperty
(
"local.server.port"
);
return
context
;
}
URI
uri
=
URI
.
create
(
"http://localhost:"
+
port
+
"/"
);
RestTemplate
restTemplate
=
new
RestTemplate
();
HttpHeaders
requestHeaders
=
new
HttpHeaders
();
private
ResponseEntity
<
String
>
firstRequest
(
RestTemplate
restTemplate
,
URI
uri
)
{
requestHeaders
.
set
(
"Authorization"
,
"Basic "
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
set
(
"Authorization"
,
"Basic "
+
Base64
.
getEncoder
().
encodeToString
(
"user:password"
.
getBytes
()));
+
Base64
.
getEncoder
().
encodeToString
(
"user:password"
.
getBytes
()));
RequestEntity
<
Object
>
request
=
new
RequestEntity
<>(
headers
,
HttpMethod
.
GET
,
uri
);
return
restTemplate
.
exchange
(
request
,
String
.
class
);
}
ResponseEntity
<
String
>
response
=
restTemplate
.
exchange
(
private
ResponseEntity
<
String
>
nextRequest
(
RestTemplate
restTemplate
,
URI
uri
,
new
RequestEntity
<>(
requestHeaders
,
HttpMethod
.
GET
,
uri
),
String
.
class
);
String
cookie
)
{
String
sessionId1
=
response
.
getBody
();
HttpHeaders
headers
=
new
HttpHeaders
();
requestHeaders
.
clear
();
headers
.
set
(
"Cookie"
,
cookie
);
requestHeaders
.
set
(
"Cookie"
,
response
.
getHeaders
().
getFirst
(
"Set-Cookie"
));
RequestEntity
<
Object
>
request
=
new
RequestEntity
<>(
headers
,
HttpMethod
.
GET
,
uri
);
return
restTemplate
.
exchange
(
request
,
String
.
class
);
RequestEntity
<
Void
>
request
=
new
RequestEntity
<>(
requestHeaders
,
HttpMethod
.
GET
,
uri
);
String
sessionId2
=
restTemplate
.
exchange
(
request
,
String
.
class
).
getBody
();
assertThat
(
sessionId1
).
isEqualTo
(
sessionId2
);
Thread
.
sleep
(
1000
);
String
loginPage
=
restTemplate
.
exchange
(
request
,
String
.
class
).
getBody
();
assertThat
(
loginPage
).
containsIgnoringCase
(
"login"
);
}
}
}
}
spring-boot-samples/spring-boot-sample-webservices/src/main/java/sample/webservices/WebServiceConfig.java
View file @
9e43b999
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
...
spring-boot-starters/spring-boot-starter-security-reactive/pom.xml
View file @
9e43b999
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
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"
>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
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"
>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<parent>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
...
...
spring-boot-starters/spring-boot-starter-security-reactive/src/main/resources/META-INF/spring.provides
View file @
9e43b999
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/AutoConfigureJsonTesters.java
View file @
9e43b999
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
...
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java
View file @
9e43b999
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
...
spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsTestApplication.java
View file @
9e43b999
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/context/filter/AbstractJupiterTestWithConfigAndExtendWith.java
View file @
9e43b999
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
...
spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/DefaultLaunchScript.java
View file @
9e43b999
...
@@ -124,10 +124,8 @@ public class DefaultLaunchScript implements LaunchScript {
...
@@ -124,10 +124,8 @@ public class DefaultLaunchScript implements LaunchScript {
if
(
propertyValue
instanceof
File
)
{
if
(
propertyValue
instanceof
File
)
{
return
loadContent
((
File
)
propertyValue
);
return
loadContent
((
File
)
propertyValue
);
}
}
else
{
return
loadContent
(
new
File
(
propertyValue
.
toString
()));
return
loadContent
(
new
File
(
propertyValue
.
toString
()));
}
}
}
@Override
@Override
public
byte
[]
toByteArray
()
{
public
byte
[]
toByteArray
()
{
...
...
spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/java/org/springframework/launcher/it/props/SpringConfiguration.java
View file @
9e43b999
/*
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
7
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.
...
...
spring-boot/src/main/java/org/springframework/boot/context/properties/bind/AggregateBinder.java
View file @
9e43b999
...
@@ -39,15 +39,14 @@ abstract class AggregateBinder<T> {
...
@@ -39,15 +39,14 @@ abstract class AggregateBinder<T> {
* Perform binding for the aggregate.
* Perform binding for the aggregate.
* @param name the configuration property name to bind
* @param name the configuration property name to bind
* @param target the target to bind
* @param target the target to bind
* @param
itemBinder an item
binder
* @param
elementBinder an element
binder
* @return the bound aggregate or null
* @return the bound aggregate or null
*/
*/
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
public
final
Object
bind
(
ConfigurationPropertyName
name
,
Bindable
<?>
target
,
public
final
Object
bind
(
ConfigurationPropertyName
name
,
Bindable
<?>
target
,
AggregateElementBinder
itemBinder
)
{
AggregateElementBinder
elementBinder
)
{
Object
result
=
bindAggregate
(
name
,
target
,
elementBinder
);
Supplier
<?>
value
=
target
.
getValue
();
Supplier
<?>
value
=
target
.
getValue
();
Class
<?>
type
=
(
value
==
null
?
target
.
getType
().
resolve
()
:
null
);
Object
result
=
bind
(
name
,
target
,
itemBinder
,
type
);
if
(
result
==
null
||
value
==
null
||
value
.
get
()
==
null
)
{
if
(
result
==
null
||
value
==
null
||
value
.
get
()
==
null
)
{
return
result
;
return
result
;
}
}
...
@@ -59,11 +58,10 @@ abstract class AggregateBinder<T> {
...
@@ -59,11 +58,10 @@ abstract class AggregateBinder<T> {
* @param name the configuration property name to bind
* @param name the configuration property name to bind
* @param target the target to bind
* @param target the target to bind
* @param elementBinder an element binder
* @param elementBinder an element binder
* @param type the aggregate actual type to use
* @return the bound result
* @return the bound result
*/
*/
protected
abstract
Object
bind
(
ConfigurationPropertyName
name
,
Bindable
<?>
target
,
protected
abstract
Object
bind
Aggregate
(
ConfigurationPropertyName
name
,
AggregateElementBinder
elementBinder
,
Class
<?>
type
);
Bindable
<?>
target
,
AggregateElementBinder
elementBinder
);
/**
/**
* Merge any additional elements into the existing aggregate.
* Merge any additional elements into the existing aggregate.
...
...
spring-boot/src/main/java/org/springframework/boot/context/properties/bind/ArrayBinder.java
View file @
9e43b999
...
@@ -36,8 +36,8 @@ class ArrayBinder extends IndexedElementsBinder<Object> {
...
@@ -36,8 +36,8 @@ class ArrayBinder extends IndexedElementsBinder<Object> {
}
}
@Override
@Override
protected
Object
bind
(
ConfigurationPropertyName
name
,
Bindable
<?>
target
,
protected
Object
bind
Aggregate
(
ConfigurationPropertyName
name
,
Bindable
<?>
target
,
AggregateElementBinder
elementBinder
,
Class
<?>
type
)
{
AggregateElementBinder
elementBinder
)
{
IndexedCollectionSupplier
collection
=
new
IndexedCollectionSupplier
(
IndexedCollectionSupplier
collection
=
new
IndexedCollectionSupplier
(
ArrayList:
:
new
);
ArrayList:
:
new
);
ResolvableType
elementType
=
target
.
getType
().
getComponentType
();
ResolvableType
elementType
=
target
.
getType
().
getComponentType
();
...
...
spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java
View file @
9e43b999
...
@@ -204,7 +204,6 @@ public class Binder {
...
@@ -204,7 +204,6 @@ public class Binder {
private
<
T
>
T
handleBindResult
(
ConfigurationPropertyName
name
,
Bindable
<
T
>
target
,
private
<
T
>
T
handleBindResult
(
ConfigurationPropertyName
name
,
Bindable
<
T
>
target
,
BindHandler
handler
,
Context
context
,
Object
result
)
throws
Exception
{
BindHandler
handler
,
Context
context
,
Object
result
)
throws
Exception
{
result
=
convert
(
result
,
target
);
if
(
result
!=
null
)
{
if
(
result
!=
null
)
{
result
=
handler
.
onSuccess
(
name
,
target
,
context
,
result
);
result
=
handler
.
onSuccess
(
name
,
target
,
context
,
result
);
result
=
convert
(
result
,
target
);
result
=
convert
(
result
,
target
);
...
...
spring-boot/src/main/java/org/springframework/boot/context/properties/bind/CollectionBinder.java
View file @
9e43b999
...
@@ -36,16 +36,17 @@ class CollectionBinder extends IndexedElementsBinder<Collection<Object>> {
...
@@ -36,16 +36,17 @@ class CollectionBinder extends IndexedElementsBinder<Collection<Object>> {
}
}
@Override
@Override
protected
Object
bind
(
ConfigurationPropertyName
name
,
Bindable
<?>
target
,
protected
Object
bind
Aggregate
(
ConfigurationPropertyName
name
,
Bindable
<?>
target
,
AggregateElementBinder
elementBinder
,
Class
<?>
type
)
{
AggregateElementBinder
elementBinder
)
{
Class
<?>
collectionType
=
(
t
ype
!=
null
?
type
Class
<?>
collectionType
=
(
t
arget
.
getValue
()
==
null
?
target
.
getType
().
resolve
()
:
ResolvableType
.
forClassWithGenerics
(
List
.
class
,
Object
.
class
)
:
List
.
class
);
.
resolve
());
IndexedCollectionSupplier
collection
=
new
IndexedCollectionSupplier
(()
->
{
IndexedCollectionSupplier
collection
=
new
IndexedCollectionSupplier
(
return
CollectionFactory
.
createCollection
(
collectionType
,
0
);
()
->
CollectionFactory
.
createCollection
(
collectionType
,
0
)
);
}
);
ResolvableType
elementType
=
target
.
getType
().
asCollection
().
getGeneric
();
ResolvableType
elementType
=
target
.
getType
().
asCollection
().
getGeneric
();
bindIndexed
(
name
,
target
,
elementBinder
,
collection
,
ResolvableType
aggregateType
=
ResolvableType
.
forClassWithGenerics
(
List
.
class
,
ResolvableType
.
forClass
(
collectionType
),
elementType
);
target
.
getType
().
asCollection
().
getGenerics
());
bindIndexed
(
name
,
target
,
elementBinder
,
collection
,
aggregateType
,
elementType
);
if
(
collection
.
wasSupplied
())
{
if
(
collection
.
wasSupplied
())
{
return
collection
.
get
();
return
collection
.
get
();
}
}
...
...
spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java
View file @
9e43b999
...
@@ -46,13 +46,10 @@ class MapBinder extends AggregateBinder<Map<Object, Object>> {
...
@@ -46,13 +46,10 @@ class MapBinder extends AggregateBinder<Map<Object, Object>> {
}
}
@Override
@Override
protected
Object
bind
(
ConfigurationPropertyName
name
,
Bindable
<?>
target
,
protected
Object
bindAggregate
(
ConfigurationPropertyName
name
,
Bindable
<?>
target
,
AggregateElementBinder
elementBinder
,
Class
<?>
type
)
{
AggregateElementBinder
elementBinder
)
{
Class
<?>
mapType
=
(
type
!=
null
?
type
Map
<
Object
,
Object
>
map
=
CollectionFactory
.
createMap
(
:
ResolvableType
(
target
.
getValue
()
==
null
?
target
.
getType
().
resolve
()
:
Map
.
class
),
0
);
.
forClassWithGenerics
(
Map
.
class
,
Object
.
class
,
Object
.
class
)
.
resolve
());
Map
<
Object
,
Object
>
map
=
CollectionFactory
.
createMap
(
mapType
,
0
);
Bindable
<?>
resolvedTarget
=
resolveTarget
(
target
);
Bindable
<?>
resolvedTarget
=
resolveTarget
(
target
);
for
(
ConfigurationPropertySource
source
:
getContext
().
getSources
())
{
for
(
ConfigurationPropertySource
source
:
getContext
().
getSources
())
{
if
(!
ConfigurationPropertyName
.
EMPTY
.
equals
(
name
))
{
if
(!
ConfigurationPropertyName
.
EMPTY
.
equals
(
name
))
{
...
...
spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySources.java
View file @
9e43b999
...
@@ -52,7 +52,7 @@ public final class ConfigurationPropertySources {
...
@@ -52,7 +52,7 @@ public final class ConfigurationPropertySources {
* @param propertySource the property source to test
* @param propertySource the property source to test
* @return {@code true} if this is the attached {@link ConfigurationPropertySource}
* @return {@code true} if this is the attached {@link ConfigurationPropertySource}
*/
*/
public
static
boolean
is
Main
ConfigurationPropertySource
(
public
static
boolean
is
Attached
ConfigurationPropertySource
(
PropertySource
<?>
propertySource
)
{
PropertySource
<?>
propertySource
)
{
return
ATTACHED_PROPERTY_SOURCE_NAME
.
equals
(
propertySource
.
getName
());
return
ATTACHED_PROPERTY_SOURCE_NAME
.
equals
(
propertySource
.
getName
());
}
}
...
...
spring-boot/src/test/java/org/springframework/boot/context/properties/bind/CollectionBinderTests.java
View file @
9e43b999
...
@@ -25,6 +25,7 @@ import java.util.Set;
...
@@ -25,6 +25,7 @@ import java.util.Set;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
org.junit.Before
;
import
org.junit.Before
;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.boot.context.properties.bind.BinderTests.JavaBean
;
import
org.springframework.boot.context.properties.bind.BinderTests.JavaBean
;
...
@@ -318,6 +319,7 @@ public class CollectionBinderTests {
...
@@ -318,6 +319,7 @@ public class CollectionBinderTests {
}
}
@Test
@Test
@Ignore
public
void
bindToCollectionWithNoDefaultConstructor
()
throws
Exception
{
public
void
bindToCollectionWithNoDefaultConstructor
()
throws
Exception
{
MockConfigurationPropertySource
source
=
new
MockConfigurationPropertySource
();
MockConfigurationPropertySource
source
=
new
MockConfigurationPropertySource
();
source
.
put
(
"foo.items"
,
"a,b,c,c"
);
source
.
put
(
"foo.items"
,
"a,b,c,c"
);
...
@@ -385,14 +387,18 @@ public class CollectionBinderTests {
...
@@ -385,14 +387,18 @@ public class CollectionBinderTests {
}
}
}
}
public
static
class
MyCustomList
extends
ArrayList
{
public
static
class
MyCustomList
extends
ArrayList
<
String
>
{
private
List
<
String
>
items
=
new
ArrayList
<>(
Collections
.
singletonList
(
"foo"
))
;
private
List
<
String
>
items
;
public
MyCustomList
(
List
<
String
>
items
)
{
public
MyCustomList
(
List
<
String
>
items
)
{
this
.
items
=
items
;
this
.
items
=
items
;
}
}
public
List
<
String
>
getItems
()
{
return
this
.
items
;
}
}
}
}
}
spring-boot/src/test/java/org/springframework/boot/jta/bitronix/PoolingConnectionFactoryBeanTests.java
View file @
9e43b999
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
...
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