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
00883a4e
Commit
00883a4e
authored
Jul 09, 2018
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13616 from izeye:polish-20180630
* pr/13616: Polish
parents
809e3050
ab6adc82
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
16 deletions
+16
-16
ServletEndpointRegistrar.java
...k/boot/actuate/endpoint/web/ServletEndpointRegistrar.java
+6
-5
OnExpressionCondition.java
...k/boot/autoconfigure/condition/OnExpressionCondition.java
+2
-3
ConditionalOnExpressionTests.java
...autoconfigure/condition/ConditionalOnExpressionTests.java
+3
-6
SpringIterableConfigurationPropertySource.java
...ies/source/SpringIterableConfigurationPropertySource.java
+1
-1
SpringProfileAction.java
...ngframework/boot/logging/logback/SpringProfileAction.java
+4
-1
No files found.
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java
View file @
00883a4e
...
...
@@ -81,11 +81,12 @@ public class ServletEndpointRegistrar implements ServletContextInitializer {
}
private
String
[]
getUrlMappings
(
String
endpointPath
,
String
name
)
{
return
this
.
basePaths
.
stream
()
.
map
((
bp
)
->
(
bp
!=
null
?
bp
+
"/"
+
endpointPath
:
"/"
+
endpointPath
))
.
distinct
().
map
((
p
)
->
{
logger
.
info
(
"Registered '"
+
p
+
"' to "
+
name
);
return
(
p
.
endsWith
(
"/"
)
?
p
+
"*"
:
p
+
"/*"
);
return
this
.
basePaths
.
stream
().
map
((
basePath
)
->
(
basePath
!=
null
?
basePath
+
"/"
+
endpointPath
:
"/"
+
endpointPath
))
.
distinct
().
map
((
path
)
->
{
logger
.
info
(
"Registered '"
+
path
+
"' to "
+
name
);
return
(
path
.
endsWith
(
"/"
)
?
path
+
"*"
:
path
+
"/*"
);
}).
toArray
(
String
[]::
new
);
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnExpressionCondition.java
View file @
00883a4e
...
...
@@ -42,10 +42,9 @@ class OnExpressionCondition extends SpringBootCondition {
.
getAnnotationAttributes
(
ConditionalOnExpression
.
class
.
getName
())
.
get
(
"value"
);
expression
=
wrapIfNecessary
(
expression
);
String
rawExpression
=
expression
;
expression
=
context
.
getEnvironment
().
resolvePlaceholders
(
expression
);
ConditionMessage
.
Builder
messageBuilder
=
ConditionMessage
.
forCondition
(
ConditionalOnExpression
.
class
,
"("
+
rawExpression
+
")"
);
.
forCondition
(
ConditionalOnExpression
.
class
,
"("
+
expression
+
")"
);
expression
=
context
.
getEnvironment
().
resolvePlaceholders
(
expression
);
ConfigurableListableBeanFactory
beanFactory
=
context
.
getBeanFactory
();
if
(
beanFactory
!=
null
)
{
boolean
result
=
evaluateExpression
(
beanFactory
,
expression
);
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnExpressionTests.java
View file @
00883a4e
...
...
@@ -16,8 +16,7 @@
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Collections
;
import
org.junit.Test
;
...
...
@@ -49,7 +48,7 @@ public class ConditionalOnExpressionTests {
}
@Test
public
void
expressionEvaluatesToTrueRegisterBean
()
{
public
void
expressionEvaluatesToTrueRegister
s
Bean
()
{
this
.
contextRunner
.
withUserConfiguration
(
MissingConfiguration
.
class
)
.
run
((
context
)
->
assertThat
(
context
).
doesNotHaveBean
(
"foo"
));
}
...
...
@@ -75,10 +74,8 @@ public class ConditionalOnExpressionTests {
private
AnnotatedTypeMetadata
mockMetaData
(
String
value
)
{
AnnotatedTypeMetadata
metadata
=
mock
(
AnnotatedTypeMetadata
.
class
);
Map
<
String
,
Object
>
attributes
=
new
HashMap
<>();
attributes
.
put
(
"value"
,
value
);
given
(
metadata
.
getAnnotationAttributes
(
ConditionalOnExpression
.
class
.
getName
()))
.
willReturn
(
attributes
);
.
willReturn
(
Collections
.
singletonMap
(
"value"
,
value
)
);
return
metadata
;
}
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringIterableConfigurationPropertySource.java
View file @
00883a4e
...
...
@@ -174,7 +174,7 @@ class SpringIterableConfigurationPropertySource extends SpringConfigurationPrope
private
static
final
class
CacheKey
{
private
Object
key
;
private
final
Object
key
;
private
CacheKey
(
Object
key
)
{
this
.
key
=
key
;
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/SpringProfileAction.java
View file @
00883a4e
...
...
@@ -67,9 +67,12 @@ class SpringProfileAction extends Action implements InPlayListener {
}
private
boolean
acceptsProfiles
(
InterpretationContext
ic
,
Attributes
attributes
)
{
if
(
this
.
environment
==
null
)
{
return
false
;
}
String
[]
profileNames
=
StringUtils
.
trimArrayElements
(
StringUtils
.
commaDelimitedListToStringArray
(
attributes
.
getValue
(
NAME_ATTRIBUTE
)));
if
(
this
.
environment
==
null
||
profileNames
.
length
==
0
)
{
if
(
profileNames
.
length
==
0
)
{
return
false
;
}
for
(
int
i
=
0
;
i
<
profileNames
.
length
;
i
++)
{
...
...
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