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
78534a75
Commit
78534a75
authored
Mar 19, 2018
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Iterate map by using lambda function"
See gh-12528
parent
ffc883b0
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
26 additions
and
25 deletions
+26
-25
AbstractHealthAggregator.java
...amework/boot/actuate/health/AbstractHealthAggregator.java
+2
-2
CloudFoundryVcapEnvironmentPostProcessor.java
.../boot/cloud/CloudFoundryVcapEnvironmentPostProcessor.java
+11
-11
JettyServletWebServerFactory.java
...boot/web/embedded/jetty/JettyServletWebServerFactory.java
+2
-2
TomcatServletWebServerFactory.java
...ot/web/embedded/tomcat/TomcatServletWebServerFactory.java
+3
-2
FileSessionPersistence.java
...rk/boot/web/embedded/undertow/FileSessionPersistence.java
+3
-3
UndertowServletWebServerFactory.java
...eb/embedded/undertow/UndertowServletWebServerFactory.java
+2
-2
MimeMappings.java
...ava/org/springframework/boot/web/server/MimeMappings.java
+1
-1
ServletContextInitializerBeans.java
...work/boot/web/servlet/ServletContextInitializerBeans.java
+1
-1
SystemEnvironmentPropertySourceEnvironmentPostProcessorTests.java
...vironmentPropertySourceEnvironmentPostProcessorTests.java
+1
-1
No files found.
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AbstractHealthAggregator.java
View file @
78534a75
/*
* 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");
* you may not use this file except in compliance with the License.
...
...
@@ -34,7 +34,7 @@ public abstract class AbstractHealthAggregator implements HealthAggregator {
@Override
public
final
Health
aggregate
(
Map
<
String
,
Health
>
healths
)
{
List
<
Status
>
statusCandidates
=
new
ArrayList
<>();
healths
.
values
().
forEach
(
health
->
statusCandidates
.
add
(
health
.
getStatus
()));
healths
.
values
().
forEach
(
(
health
)
->
statusCandidates
.
add
(
health
.
getStatus
()));
Status
status
=
aggregateStatus
(
statusCandidates
);
Map
<
String
,
Object
>
details
=
aggregateDetails
(
healths
);
return
new
Health
.
Builder
(
status
,
details
).
build
();
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/cloud/CloudFoundryVcapEnvironmentPostProcessor.java
View file @
78534a75
/*
* 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");
* you may not use this file except in compliance with the License.
...
...
@@ -196,39 +196,39 @@ public class CloudFoundryVcapEnvironmentPostProcessor
@SuppressWarnings
(
"unchecked"
)
private
void
flatten
(
Properties
properties
,
Map
<
String
,
Object
>
input
,
String
path
)
{
input
.
forEach
((
entryK
ey
,
value
)
->
{
String
key
=
getFullKey
(
path
,
entryK
ey
);
input
.
forEach
((
k
ey
,
value
)
->
{
String
name
=
getPropertyName
(
path
,
k
ey
);
if
(
value
instanceof
Map
)
{
// Need a compound key
flatten
(
properties
,
(
Map
<
String
,
Object
>)
value
,
key
);
flatten
(
properties
,
(
Map
<
String
,
Object
>)
value
,
name
);
}
else
if
(
value
instanceof
Collection
)
{
// Need a compound key
Collection
<
Object
>
collection
=
(
Collection
<
Object
>)
value
;
properties
.
put
(
key
,
properties
.
put
(
name
,
StringUtils
.
collectionToCommaDelimitedString
(
collection
));
int
count
=
0
;
for
(
Object
item
:
collection
)
{
String
itemKey
=
"["
+
(
count
++)
+
"]"
;
flatten
(
properties
,
Collections
.
singletonMap
(
itemKey
,
item
),
key
);
flatten
(
properties
,
Collections
.
singletonMap
(
itemKey
,
item
),
name
);
}
}
else
if
(
value
instanceof
String
)
{
properties
.
put
(
key
,
value
);
properties
.
put
(
name
,
value
);
}
else
if
(
value
instanceof
Number
)
{
properties
.
put
(
key
,
value
.
toString
());
properties
.
put
(
name
,
value
.
toString
());
}
else
if
(
value
instanceof
Boolean
)
{
properties
.
put
(
key
,
value
.
toString
());
properties
.
put
(
name
,
value
.
toString
());
}
else
{
properties
.
put
(
key
,
value
==
null
?
""
:
value
);
properties
.
put
(
name
,
value
==
null
?
""
:
value
);
}
});
}
private
String
get
FullKey
(
String
path
,
String
key
)
{
private
String
get
PropertyName
(
String
path
,
String
key
)
{
if
(!
StringUtils
.
hasText
(
path
))
{
return
key
;
}
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactory.java
View file @
78534a75
...
...
@@ -246,8 +246,8 @@ public class JettyServletWebServerFactory extends AbstractServletWebServerFactor
}
private
void
addLocaleMappings
(
WebAppContext
context
)
{
getLocaleCharsetMappings
().
forEach
((
locale
,
charset
)
->
context
.
addLocaleEncoding
(
locale
.
toString
(),
charset
.
toString
()));
getLocaleCharsetMappings
().
forEach
((
locale
,
charset
)
->
context
.
addLocaleEncoding
(
locale
.
toString
(),
charset
.
toString
()));
}
private
File
getTempDirectory
()
{
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java
View file @
78534a75
...
...
@@ -232,8 +232,9 @@ public class TomcatServletWebServerFactory extends AbstractServletWebServerFacto
}
private
void
addLocaleMappings
(
TomcatEmbeddedContext
context
)
{
getLocaleCharsetMappings
().
forEach
((
locale
,
charset
)
->
context
.
addLocaleEncodingMappingParameter
(
locale
.
toString
(),
charset
.
toString
()));
getLocaleCharsetMappings
()
.
forEach
((
locale
,
charset
)
->
context
.
addLocaleEncodingMappingParameter
(
locale
.
toString
(),
charset
.
toString
()));
}
private
void
configureTldSkipPatterns
(
TomcatEmbeddedContext
context
)
{
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/FileSessionPersistence.java
View file @
78534a75
/*
* 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");
* you may not use this file except in compliance with the License.
...
...
@@ -69,8 +69,8 @@ class FileSessionPersistence implements SessionPersistenceManager {
private
void
save
(
Map
<
String
,
PersistentSession
>
sessionData
,
ObjectOutputStream
stream
)
throws
IOException
{
Map
<
String
,
Serializable
>
session
=
new
LinkedHashMap
<>();
sessionData
.
forEach
((
key
,
value
)
->
session
.
put
(
key
,
new
SerializablePersistentSession
(
value
)));
sessionData
.
forEach
((
key
,
value
)
->
session
.
put
(
key
,
new
SerializablePersistentSession
(
value
)));
stream
.
writeObject
(
session
);
}
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java
View file @
78534a75
...
...
@@ -328,8 +328,8 @@ public class UndertowServletWebServerFactory extends AbstractServletWebServerFac
}
private
void
addLocaleMappings
(
DeploymentInfo
deployment
)
{
getLocaleCharsetMappings
().
forEach
((
locale
,
charset
)
->
deployment
.
addLocaleCharsetMapping
(
locale
.
toString
(),
charset
.
toString
()));
getLocaleCharsetMappings
().
forEach
((
locale
,
charset
)
->
deployment
.
addLocaleCharsetMapping
(
locale
.
toString
(),
charset
.
toString
()));
}
private
void
registerServletContainerInitializerToDriveServletContextInitializers
(
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/MimeMappings.java
View file @
78534a75
/*
* 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");
* you may not use this file except in compliance with the License.
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java
View file @
78534a75
...
...
@@ -79,7 +79,7 @@ public class ServletContextInitializerBeans
addServletContextInitializerBeans
(
beanFactory
);
addAdaptableBeans
(
beanFactory
);
List
<
ServletContextInitializer
>
sortedInitializers
=
new
ArrayList
<>();
this
.
initializers
.
values
().
forEach
(
contextInitializers
->
{
this
.
initializers
.
values
().
forEach
(
(
contextInitializers
)
->
{
AnnotationAwareOrderComparator
.
sort
(
contextInitializers
);
sortedInitializers
.
addAll
(
contextInitializers
);
});
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/env/SystemEnvironmentPropertySourceEnvironmentPostProcessorTests.java
View file @
78534a75
/*
* 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");
* 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