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
9af6b342
Commit
9af6b342
authored
Sep 04, 2018
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
45613f8c
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
27 additions
and
26 deletions
+27
-26
ConfigurationPropertiesReportEndpoint.java
...ext/properties/ConfigurationPropertiesReportEndpoint.java
+1
-3
ConditionalOnProperty.java
...k/boot/autoconfigure/condition/ConditionalOnProperty.java
+0
-3
OnPropertyListCondition.java
...boot/autoconfigure/condition/OnPropertyListCondition.java
+2
-2
OnWebApplicationCondition.java
...ot/autoconfigure/condition/OnWebApplicationCondition.java
+0
-2
MvcRequestMatcherProvider.java
...configure/security/servlet/MvcRequestMatcherProvider.java
+1
-0
RequestMatcherProvider.java
...utoconfigure/security/servlet/RequestMatcherProvider.java
+5
-0
JavaPluginAction.java
.../springframework/boot/gradle/plugin/JavaPluginAction.java
+5
-0
EnvironmentConverter.java
...n/java/org/springframework/boot/EnvironmentConverter.java
+9
-9
ConfigFileApplicationListener.java
...rk/boot/context/config/ConfigFileApplicationListener.java
+4
-7
No files found.
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java
View file @
9af6b342
...
@@ -398,9 +398,7 @@ public class ConfigurationPropertiesReportEndpoint implements ApplicationContext
...
@@ -398,9 +398,7 @@ public class ConfigurationPropertiesReportEndpoint implements ApplicationContext
&&
Character
.
isUpperCase
(
propertyName
.
charAt
(
1
)))
{
&&
Character
.
isUpperCase
(
propertyName
.
charAt
(
1
)))
{
return
propertyName
;
return
propertyName
;
}
}
else
{
return
StringUtils
.
capitalize
(
propertyName
);
return
StringUtils
.
capitalize
(
propertyName
);
}
}
}
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnProperty.java
View file @
9af6b342
...
@@ -30,7 +30,6 @@ import org.springframework.core.env.Environment;
...
@@ -30,7 +30,6 @@ import org.springframework.core.env.Environment;
* default the properties must be present in the {@link Environment} and
* default the properties must be present in the {@link Environment} and
* <strong>not</strong> equal to {@code false}. The {@link #havingValue()} and
* <strong>not</strong> equal to {@code false}. The {@link #havingValue()} and
* {@link #matchIfMissing()} attributes allow further customizations.
* {@link #matchIfMissing()} attributes allow further customizations.
*
* <p>
* <p>
* The {@link #havingValue} attribute can be used to specify the value that the property
* The {@link #havingValue} attribute can be used to specify the value that the property
* should have. The table below shows when a condition matches according to the property
* should have. The table below shows when a condition matches according to the property
...
@@ -66,12 +65,10 @@ import org.springframework.core.env.Environment;
...
@@ -66,12 +65,10 @@ import org.springframework.core.env.Environment;
* <td>yes</td>
* <td>yes</td>
* </tr>
* </tr>
* </table>
* </table>
*
* <p>
* <p>
* If the property is not contained in the {@link Environment} at all, the
* If the property is not contained in the {@link Environment} at all, the
* {@link #matchIfMissing()} attribute is consulted. By default missing attributes do not
* {@link #matchIfMissing()} attribute is consulted. By default missing attributes do not
* match.
* match.
*
* <p>
* <p>
* This condition cannot be reliably used for matching collection properties. For example,
* This condition cannot be reliably used for matching collection properties. For example,
* in the following configuration, the condition matches if {@code spring.example.values}
* in the following configuration, the condition matches if {@code spring.example.values}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnPropertyListCondition.java
View file @
9af6b342
...
@@ -36,7 +36,7 @@ import org.springframework.core.type.AnnotatedTypeMetadata;
...
@@ -36,7 +36,7 @@ import org.springframework.core.type.AnnotatedTypeMetadata;
*/
*/
public
class
OnPropertyListCondition
extends
SpringBootCondition
{
public
class
OnPropertyListCondition
extends
SpringBootCondition
{
private
static
final
Bindable
<
List
<
String
>>
S
IMPLE
_LIST
=
Bindable
private
static
final
Bindable
<
List
<
String
>>
S
TRING
_LIST
=
Bindable
.
listOf
(
String
.
class
);
.
listOf
(
String
.
class
);
private
final
String
propertyName
;
private
final
String
propertyName
;
...
@@ -59,7 +59,7 @@ public class OnPropertyListCondition extends SpringBootCondition {
...
@@ -59,7 +59,7 @@ public class OnPropertyListCondition extends SpringBootCondition {
public
ConditionOutcome
getMatchOutcome
(
ConditionContext
context
,
public
ConditionOutcome
getMatchOutcome
(
ConditionContext
context
,
AnnotatedTypeMetadata
metadata
)
{
AnnotatedTypeMetadata
metadata
)
{
BindResult
<?>
property
=
Binder
.
get
(
context
.
getEnvironment
())
BindResult
<?>
property
=
Binder
.
get
(
context
.
getEnvironment
())
.
bind
(
this
.
propertyName
,
S
IMPLE
_LIST
);
.
bind
(
this
.
propertyName
,
S
TRING
_LIST
);
ConditionMessage
.
Builder
messageBuilder
=
this
.
messageBuilder
.
get
();
ConditionMessage
.
Builder
messageBuilder
=
this
.
messageBuilder
.
get
();
if
(
property
.
isBound
())
{
if
(
property
.
isBound
())
{
return
ConditionOutcome
return
ConditionOutcome
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnWebApplicationCondition.java
View file @
9af6b342
...
@@ -65,10 +65,8 @@ class OnWebApplicationCondition extends SpringBootCondition {
...
@@ -65,10 +65,8 @@ class OnWebApplicationCondition extends SpringBootCondition {
switch
(
deduceType
(
metadata
))
{
switch
(
deduceType
(
metadata
))
{
case
SERVLET:
case
SERVLET:
return
isServletWebApplication
(
context
);
return
isServletWebApplication
(
context
);
case
REACTIVE:
case
REACTIVE:
return
isReactiveWebApplication
(
context
);
return
isReactiveWebApplication
(
context
);
default
:
default
:
return
isAnyWebApplication
(
context
,
required
);
return
isAnyWebApplication
(
context
,
required
);
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/MvcRequestMatcherProvider.java
View file @
9af6b342
...
@@ -24,6 +24,7 @@ import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
...
@@ -24,6 +24,7 @@ import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
* used for Spring MVC applications.
* used for Spring MVC applications.
*
*
* @author Madhura Bhave
* @author Madhura Bhave
* @since 2.0.5
*/
*/
public
class
MvcRequestMatcherProvider
implements
RequestMatcherProvider
{
public
class
MvcRequestMatcherProvider
implements
RequestMatcherProvider
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/RequestMatcherProvider.java
View file @
9af6b342
...
@@ -27,6 +27,11 @@ import org.springframework.security.web.util.matcher.RequestMatcher;
...
@@ -27,6 +27,11 @@ import org.springframework.security.web.util.matcher.RequestMatcher;
@FunctionalInterface
@FunctionalInterface
public
interface
RequestMatcherProvider
{
public
interface
RequestMatcherProvider
{
/**
* Return the {@link RequestMatcher} to be used for the specified pattern.
* @param pattern the request pattern
* @return a request matcher
*/
RequestMatcher
getRequestMatcher
(
String
pattern
);
RequestMatcher
getRequestMatcher
(
String
pattern
);
}
}
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java
View file @
9af6b342
...
@@ -149,6 +149,11 @@ final class JavaPluginAction implements PluginApplicationAction {
...
@@ -149,6 +149,11 @@ final class JavaPluginAction implements PluginApplicationAction {
compile
.
doFirst
(
new
AdditionalMetadataLocationsConfigurer
());
compile
.
doFirst
(
new
AdditionalMetadataLocationsConfigurer
());
}
}
/**
* Task {@link Action} to add additional meta-data locations. We need to use an
* inner-class rather than a lambda due to
* https://github.com/gradle/gradle/issues/5510.
*/
private
static
class
AdditionalMetadataLocationsConfigurer
implements
Action
<
Task
>
{
private
static
class
AdditionalMetadataLocationsConfigurer
implements
Action
<
Task
>
{
@Override
@Override
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/EnvironmentConverter.java
View file @
9af6b342
...
@@ -42,7 +42,7 @@ final class EnvironmentConverter {
...
@@ -42,7 +42,7 @@ final class EnvironmentConverter {
private
static
final
Set
<
String
>
SERVLET_ENVIRONMENT_SOURCE_NAMES
;
private
static
final
Set
<
String
>
SERVLET_ENVIRONMENT_SOURCE_NAMES
;
static
{
static
{
final
Set
<
String
>
names
=
new
HashSet
<>();
Set
<
String
>
names
=
new
HashSet
<>();
names
.
add
(
StandardServletEnvironment
.
SERVLET_CONTEXT_PROPERTY_SOURCE_NAME
);
names
.
add
(
StandardServletEnvironment
.
SERVLET_CONTEXT_PROPERTY_SOURCE_NAME
);
names
.
add
(
StandardServletEnvironment
.
SERVLET_CONFIG_PROPERTY_SOURCE_NAME
);
names
.
add
(
StandardServletEnvironment
.
SERVLET_CONFIG_PROPERTY_SOURCE_NAME
);
names
.
add
(
StandardServletEnvironment
.
JNDI_PROPERTY_SOURCE_NAME
);
names
.
add
(
StandardServletEnvironment
.
JNDI_PROPERTY_SOURCE_NAME
);
...
@@ -65,20 +65,20 @@ final class EnvironmentConverter {
...
@@ -65,20 +65,20 @@ final class EnvironmentConverter {
* type. If the environment is already of the same type, no conversion is performed
* type. If the environment is already of the same type, no conversion is performed
* and it is returned unchanged.
* and it is returned unchanged.
* @param environment the Environment to convert
* @param environment the Environment to convert
* @param
conversionT
ype the type to convert the Environment to
* @param
t
ype the type to convert the Environment to
* @return the converted Environment
* @return the converted Environment
*/
*/
StandardEnvironment
convertEnvironmentIfNecessary
(
ConfigurableEnvironment
environment
,
StandardEnvironment
convertEnvironmentIfNecessary
(
ConfigurableEnvironment
environment
,
Class
<?
extends
StandardEnvironment
>
conversionT
ype
)
{
Class
<?
extends
StandardEnvironment
>
t
ype
)
{
if
(
conversionT
ype
.
equals
(
environment
.
getClass
()))
{
if
(
t
ype
.
equals
(
environment
.
getClass
()))
{
return
(
StandardEnvironment
)
environment
;
return
(
StandardEnvironment
)
environment
;
}
}
return
convertEnvironment
(
environment
,
conversionT
ype
);
return
convertEnvironment
(
environment
,
t
ype
);
}
}
private
StandardEnvironment
convertEnvironment
(
ConfigurableEnvironment
environment
,
private
StandardEnvironment
convertEnvironment
(
ConfigurableEnvironment
environment
,
Class
<?
extends
StandardEnvironment
>
conversionT
ype
)
{
Class
<?
extends
StandardEnvironment
>
t
ype
)
{
StandardEnvironment
result
=
createEnvironment
(
conversionT
ype
);
StandardEnvironment
result
=
createEnvironment
(
t
ype
);
result
.
setActiveProfiles
(
environment
.
getActiveProfiles
());
result
.
setActiveProfiles
(
environment
.
getActiveProfiles
());
result
.
setConversionService
(
environment
.
getConversionService
());
result
.
setConversionService
(
environment
.
getConversionService
());
copyPropertySources
(
environment
,
result
);
copyPropertySources
(
environment
,
result
);
...
@@ -86,9 +86,9 @@ final class EnvironmentConverter {
...
@@ -86,9 +86,9 @@ final class EnvironmentConverter {
}
}
private
StandardEnvironment
createEnvironment
(
private
StandardEnvironment
createEnvironment
(
Class
<?
extends
StandardEnvironment
>
conversionT
ype
)
{
Class
<?
extends
StandardEnvironment
>
t
ype
)
{
try
{
try
{
return
conversionT
ype
.
newInstance
();
return
t
ype
.
newInstance
();
}
}
catch
(
Exception
ex
)
{
catch
(
Exception
ex
)
{
return
new
StandardEnvironment
();
return
new
StandardEnvironment
();
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java
View file @
9af6b342
...
@@ -463,15 +463,12 @@ public class ConfigFileApplicationListener
...
@@ -463,15 +463,12 @@ public class ConfigFileApplicationListener
}
}
}
}
}
}
Set
<
String
>
processed
Extensions
=
new
HashSet
<>();
Set
<
String
>
processed
=
new
HashSet
<>();
for
(
PropertySourceLoader
loader
:
this
.
propertySourceLoaders
)
{
for
(
PropertySourceLoader
loader
:
this
.
propertySourceLoaders
)
{
for
(
String
fileExtension
:
loader
.
getFileExtensions
())
{
for
(
String
fileExtension
:
loader
.
getFileExtensions
())
{
if
(!
processedExtensions
.
contains
(
fileExtension
))
{
if
(
processed
.
add
(
fileExtension
))
{
processedExtensions
.
add
(
fileExtension
);
loadForFileExtension
(
loader
,
location
+
name
,
"."
+
fileExtension
,
String
prefix
=
location
+
name
;
profile
,
filterFactory
,
consumer
);
fileExtension
=
"."
+
fileExtension
;
loadForFileExtension
(
loader
,
prefix
,
fileExtension
,
profile
,
filterFactory
,
consumer
);
}
}
}
}
}
}
...
...
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