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
bf1619e8
Commit
bf1619e8
authored
Dec 15, 2020
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #24477 from izeye
* pr/24477: Use BindResult.orElseGet() where beneficial Closes gh-24477
parents
d1f2aab1
8e69a821
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
AbstractSessionCondition.java
.../boot/autoconfigure/session/AbstractSessionCondition.java
+2
-1
Profiles.java
...ava/org/springframework/boot/context/config/Profiles.java
+1
-1
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/AbstractSessionCondition.java
View file @
bf1619e8
...
@@ -58,7 +58,8 @@ abstract class AbstractSessionCondition extends SpringBootCondition {
...
@@ -58,7 +58,8 @@ abstract class AbstractSessionCondition extends SpringBootCondition {
return
binder
.
bind
(
"spring.session.store-type"
,
StoreType
.
class
)
return
binder
.
bind
(
"spring.session.store-type"
,
StoreType
.
class
)
.
map
((
t
)
->
new
ConditionOutcome
(
t
==
required
,
.
map
((
t
)
->
new
ConditionOutcome
(
t
==
required
,
message
.
found
(
"spring.session.store-type property"
).
items
(
t
)))
message
.
found
(
"spring.session.store-type property"
).
items
(
t
)))
.
orElse
(
ConditionOutcome
.
noMatch
(
message
.
didNotFind
(
"spring.session.store-type property"
).
atAll
()));
.
orElseGet
(()
->
ConditionOutcome
.
noMatch
(
message
.
didNotFind
(
"spring.session.store-type property"
).
atAll
()));
}
}
catch
(
BindException
ex
)
{
catch
(
BindException
ex
)
{
return
ConditionOutcome
.
noMatch
(
message
.
found
(
"invalid spring.session.store-type property"
).
atAll
());
return
ConditionOutcome
.
noMatch
(
message
.
found
(
"invalid spring.session.store-type property"
).
atAll
());
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/Profiles.java
View file @
bf1619e8
...
@@ -97,7 +97,7 @@ public class Profiles implements Iterable<String> {
...
@@ -97,7 +97,7 @@ public class Profiles implements Iterable<String> {
if
(
hasExplicit
(
supplier
,
propertyValue
,
unset
))
{
if
(
hasExplicit
(
supplier
,
propertyValue
,
unset
))
{
return
supplier
.
get
();
return
supplier
.
get
();
}
}
return
binder
.
bind
(
propertyName
,
String
[].
class
).
orElse
(
StringUtils
.
toStringArray
(
unset
));
return
binder
.
bind
(
propertyName
,
String
[].
class
).
orElse
Get
(()
->
StringUtils
.
toStringArray
(
unset
));
}
}
private
boolean
hasExplicit
(
Supplier
<
String
[]>
supplier
,
String
propertyValue
,
Set
<
String
>
unset
)
{
private
boolean
hasExplicit
(
Supplier
<
String
[]>
supplier
,
String
propertyValue
,
Set
<
String
>
unset
)
{
...
...
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