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
af50a18d
Commit
af50a18d
authored
Jan 29, 2018
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
488965bb
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
42 additions
and
43 deletions
+42
-43
LoggersEndpointAutoConfiguration.java
...toconfigure/logging/LoggersEndpointAutoConfiguration.java
+1
-1
ServletManagementChildContextConfiguration.java
...b/servlet/ServletManagementChildContextConfiguration.java
+7
-7
LoggersEndpointAutoConfigurationTests.java
...figure/logging/LoggersEndpointAutoConfigurationTests.java
+3
-4
WebMvcMetricsFilter.java
...boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java
+2
-2
RedisCacheConfiguration.java
...ork/boot/autoconfigure/cache/RedisCacheConfiguration.java
+4
-3
HttpEncodingAutoConfiguration.java
...oconfigure/web/servlet/HttpEncodingAutoConfiguration.java
+3
-3
ReactiveWebServerAutoConfigurationTests.java
...web/reactive/ReactiveWebServerAutoConfigurationTests.java
+1
-1
TomcatLegacyCookieProcessorExample.java
.../context/embedded/TomcatLegacyCookieProcessorExample.java
+2
-2
PropertiesMigrationReport.java
...ontext/properties/migrator/PropertiesMigrationReport.java
+3
-2
PropertiesMigrationReporter.java
...text/properties/migrator/PropertiesMigrationReporter.java
+7
-8
PropertiesMigrationReporterTests.java
...properties/migrator/PropertiesMigrationReporterTests.java
+1
-2
IncrementalEndpoint.java
...ationsample/endpoint/incremental/IncrementalEndpoint.java
+1
-1
WebServerFactoryCustomizer.java
...framework/boot/web/server/WebServerFactoryCustomizer.java
+3
-3
PropertyMapperTests.java
...ramework/boot/context/properties/PropertyMapperTests.java
+2
-2
WebServerFactoryCustomizerBeanPostProcessorTests.java
...ver/WebServerFactoryCustomizerBeanPostProcessorTests.java
+2
-2
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/logging/LoggersEndpointAutoConfiguration.java
View file @
af50a18d
...
@@ -49,7 +49,6 @@ public class LoggersEndpointAutoConfiguration {
...
@@ -49,7 +49,6 @@ public class LoggersEndpointAutoConfiguration {
return
new
LoggersEndpoint
(
loggingSystem
);
return
new
LoggersEndpoint
(
loggingSystem
);
}
}
static
class
OnEnabledLoggingSystemCondition
extends
SpringBootCondition
{
static
class
OnEnabledLoggingSystemCondition
extends
SpringBootCondition
{
@Override
@Override
...
@@ -66,4 +65,5 @@ public class LoggersEndpointAutoConfiguration {
...
@@ -66,4 +65,5 @@ public class LoggersEndpointAutoConfiguration {
}
}
}
}
}
}
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfiguration.java
View file @
af50a18d
...
@@ -126,8 +126,8 @@ class ServletManagementChildContextConfiguration {
...
@@ -126,8 +126,8 @@ class ServletManagementChildContextConfiguration {
implements
WebServerFactoryCustomizer
<
TomcatServletWebServerFactory
>
{
implements
WebServerFactoryCustomizer
<
TomcatServletWebServerFactory
>
{
@Override
@Override
public
void
customize
(
TomcatServletWebServerFactory
serverF
actory
)
{
public
void
customize
(
TomcatServletWebServerFactory
f
actory
)
{
AccessLogValve
accessLogValve
=
findAccessLogValve
(
serverF
actory
);
AccessLogValve
accessLogValve
=
findAccessLogValve
(
f
actory
);
if
(
accessLogValve
==
null
)
{
if
(
accessLogValve
==
null
)
{
return
;
return
;
}
}
...
@@ -135,8 +135,8 @@ class ServletManagementChildContextConfiguration {
...
@@ -135,8 +135,8 @@ class ServletManagementChildContextConfiguration {
}
}
private
AccessLogValve
findAccessLogValve
(
private
AccessLogValve
findAccessLogValve
(
TomcatServletWebServerFactory
serverF
actory
)
{
TomcatServletWebServerFactory
f
actory
)
{
for
(
Valve
engineValve
:
serverF
actory
.
getEngineValves
())
{
for
(
Valve
engineValve
:
f
actory
.
getEngineValves
())
{
if
(
engineValve
instanceof
AccessLogValve
)
{
if
(
engineValve
instanceof
AccessLogValve
)
{
return
(
AccessLogValve
)
engineValve
;
return
(
AccessLogValve
)
engineValve
;
}
}
...
@@ -150,9 +150,9 @@ class ServletManagementChildContextConfiguration {
...
@@ -150,9 +150,9 @@ class ServletManagementChildContextConfiguration {
implements
WebServerFactoryCustomizer
<
UndertowServletWebServerFactory
>
{
implements
WebServerFactoryCustomizer
<
UndertowServletWebServerFactory
>
{
@Override
@Override
public
void
customize
(
UndertowServletWebServerFactory
serverF
actory
)
{
public
void
customize
(
UndertowServletWebServerFactory
f
actory
)
{
serverF
actory
.
setAccessLogPrefix
(
f
actory
.
setAccessLogPrefix
(
customizePrefix
(
serverF
actory
.
getAccessLogPrefix
()));
customizePrefix
(
f
actory
.
getAccessLogPrefix
()));
}
}
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/logging/LoggersEndpointAutoConfigurationTests.java
View file @
af50a18d
...
@@ -56,11 +56,10 @@ public class LoggersEndpointAutoConfigurationTests {
...
@@ -56,11 +56,10 @@ public class LoggersEndpointAutoConfigurationTests {
@Test
@Test
public
void
runWithNoneLoggerEndpointShouldNotHaveEndpointBean
()
{
public
void
runWithNoneLoggerEndpointShouldNotHaveEndpointBean
()
{
this
.
contextRunner
this
.
contextRunner
.
withSystemProperties
(
"org.springframework.boot.logging.LoggingSystem=none"
)
.
withSystemProperties
(
"org.springframework.boot.logging.LoggingSystem=none"
)
.
run
((
context
)
->
{
.
run
((
context
)
->
{
System
.
out
.
println
(
context
.
getBean
(
LoggingSystem
.
class
));
assertThat
(
context
).
doesNotHaveBean
(
LoggersEndpoint
.
class
);
assertThat
(
context
)
.
doesNotHaveBean
(
LoggersEndpoint
.
class
);
});
});
}
}
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java
View file @
af50a18d
...
@@ -211,8 +211,8 @@ public class WebMvcMetricsFilter extends OncePerRequestFilter {
...
@@ -211,8 +211,8 @@ public class WebMvcMetricsFilter extends OncePerRequestFilter {
private
void
record
(
TimingContext
timingContext
,
HttpServletResponse
response
,
private
void
record
(
TimingContext
timingContext
,
HttpServletResponse
response
,
HttpServletRequest
request
,
Object
handlerObject
,
Throwable
exception
)
{
HttpServletRequest
request
,
Object
handlerObject
,
Throwable
exception
)
{
Timer
.
Sample
timerSample
=
timingContext
.
getTimerSample
();
Timer
.
Sample
timerSample
=
timingContext
.
getTimerSample
();
Supplier
<
Iterable
<
Tag
>>
tags
=
()
->
this
.
tagsProvider
.
getTags
(
request
,
Supplier
<
Iterable
<
Tag
>>
tags
=
()
->
this
.
tagsProvider
.
getTags
(
request
,
response
,
response
,
handlerObject
,
exception
);
handlerObject
,
exception
);
for
(
Timed
annotation
:
timingContext
.
getAnnotations
())
{
for
(
Timed
annotation
:
timingContext
.
getAnnotations
())
{
stop
(
timerSample
,
tags
,
Timer
.
builder
(
annotation
,
this
.
metricName
));
stop
(
timerSample
,
tags
,
Timer
.
builder
(
annotation
,
this
.
metricName
));
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheConfiguration.java
View file @
af50a18d
...
@@ -69,7 +69,8 @@ class RedisCacheConfiguration {
...
@@ -69,7 +69,8 @@ class RedisCacheConfiguration {
public
RedisCacheManager
cacheManager
(
RedisConnectionFactory
redisConnectionFactory
,
public
RedisCacheManager
cacheManager
(
RedisConnectionFactory
redisConnectionFactory
,
ResourceLoader
resourceLoader
)
{
ResourceLoader
resourceLoader
)
{
RedisCacheManagerBuilder
builder
=
RedisCacheManager
RedisCacheManagerBuilder
builder
=
RedisCacheManager
.
builder
(
redisConnectionFactory
).
cacheDefaults
(
determineConfiguration
(
resourceLoader
.
getClassLoader
()));
.
builder
(
redisConnectionFactory
)
.
cacheDefaults
(
determineConfiguration
(
resourceLoader
.
getClassLoader
()));
List
<
String
>
cacheNames
=
this
.
cacheProperties
.
getCacheNames
();
List
<
String
>
cacheNames
=
this
.
cacheProperties
.
getCacheNames
();
if
(!
cacheNames
.
isEmpty
())
{
if
(!
cacheNames
.
isEmpty
())
{
builder
.
initialCacheNames
(
new
LinkedHashSet
<>(
cacheNames
));
builder
.
initialCacheNames
(
new
LinkedHashSet
<>(
cacheNames
));
...
@@ -85,8 +86,8 @@ class RedisCacheConfiguration {
...
@@ -85,8 +86,8 @@ class RedisCacheConfiguration {
Redis
redisProperties
=
this
.
cacheProperties
.
getRedis
();
Redis
redisProperties
=
this
.
cacheProperties
.
getRedis
();
org
.
springframework
.
data
.
redis
.
cache
.
RedisCacheConfiguration
config
=
org
.
springframework
.
data
.
redis
.
cache
.
RedisCacheConfiguration
org
.
springframework
.
data
.
redis
.
cache
.
RedisCacheConfiguration
config
=
org
.
springframework
.
data
.
redis
.
cache
.
RedisCacheConfiguration
.
defaultCacheConfig
();
.
defaultCacheConfig
();
config
=
config
.
serializeValuesWith
(
SerializationPair
.
fromSerializer
(
config
=
config
.
serializeValuesWith
(
SerializationPair
new
JdkSerializationRedisSerializer
(
classLoader
)));
.
fromSerializer
(
new
JdkSerializationRedisSerializer
(
classLoader
)));
if
(
redisProperties
.
getTimeToLive
()
!=
null
)
{
if
(
redisProperties
.
getTimeToLive
()
!=
null
)
{
config
=
config
.
entryTtl
(
redisProperties
.
getTimeToLive
());
config
=
config
.
entryTtl
(
redisProperties
.
getTimeToLive
());
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfiguration.java
View file @
af50a18d
/*
/*
* 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");
* 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.
...
@@ -78,9 +78,9 @@ public class HttpEncodingAutoConfiguration {
...
@@ -78,9 +78,9 @@ public class HttpEncodingAutoConfiguration {
}
}
@Override
@Override
public
void
customize
(
ConfigurableServletWebServerFactory
webServerF
actory
)
{
public
void
customize
(
ConfigurableServletWebServerFactory
f
actory
)
{
if
(
this
.
properties
.
getMapping
()
!=
null
)
{
if
(
this
.
properties
.
getMapping
()
!=
null
)
{
webServerF
actory
.
setLocaleCharsetMappings
(
this
.
properties
.
getMapping
());
f
actory
.
setLocaleCharsetMappings
(
this
.
properties
.
getMapping
());
}
}
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerAutoConfigurationTests.java
View file @
af50a18d
...
@@ -119,7 +119,7 @@ public class ReactiveWebServerAutoConfigurationTests {
...
@@ -119,7 +119,7 @@ public class ReactiveWebServerAutoConfigurationTests {
@Bean
@Bean
public
WebServerFactoryCustomizer
<
ConfigurableReactiveWebServerFactory
>
reactiveWebServerCustomizer
()
{
public
WebServerFactoryCustomizer
<
ConfigurableReactiveWebServerFactory
>
reactiveWebServerCustomizer
()
{
return
(
server
)
->
server
.
setPort
(
9000
);
return
(
factory
)
->
factory
.
setPort
(
9000
);
}
}
}
}
...
...
spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/context/embedded/TomcatLegacyCookieProcessorExample.java
View file @
af50a18d
/*
/*
* 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");
* 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.
...
@@ -39,7 +39,7 @@ public class TomcatLegacyCookieProcessorExample {
...
@@ -39,7 +39,7 @@ public class TomcatLegacyCookieProcessorExample {
// tag::customizer[]
// tag::customizer[]
@Bean
@Bean
public
WebServerFactoryCustomizer
<
TomcatServletWebServerFactory
>
cookieProcessorCustomizer
()
{
public
WebServerFactoryCustomizer
<
TomcatServletWebServerFactory
>
cookieProcessorCustomizer
()
{
return
(
serverFactory
)
->
serverF
actory
.
addContextCustomizers
(
return
(
factory
)
->
f
actory
.
addContextCustomizers
(
(
context
)
->
context
.
setCookieProcessor
(
new
LegacyCookieProcessor
()));
(
context
)
->
context
.
setCookieProcessor
(
new
LegacyCookieProcessor
()));
}
}
// end::customizer[]
// end::customizer[]
...
...
spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReport.java
View file @
af50a18d
...
@@ -89,8 +89,9 @@ class PropertiesMigrationReport {
...
@@ -89,8 +89,9 @@ class PropertiesMigrationReport {
return
deprecation
.
getShortReason
();
return
deprecation
.
getShortReason
();
}
}
if
(
StringUtils
.
hasText
(
deprecation
.
getReplacement
()))
{
if
(
StringUtils
.
hasText
(
deprecation
.
getReplacement
()))
{
return
String
.
format
(
"Reason: Replacement key '%s' uses an incompatible "
return
String
.
format
(
+
"target type"
,
deprecation
.
getReplacement
());
"Reason: Replacement key '%s' uses an incompatible "
+
"target type"
,
deprecation
.
getReplacement
());
}
}
return
"none"
;
return
"none"
;
}
}
...
...
spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java
View file @
af50a18d
...
@@ -118,7 +118,7 @@ class PropertiesMigrationReporter {
...
@@ -118,7 +118,7 @@ class PropertiesMigrationReporter {
}
}
private
boolean
isCompatibleType
(
String
currentType
,
String
replacementType
)
{
private
boolean
isCompatibleType
(
String
currentType
,
String
replacementType
)
{
if
(
replacementType
==
null
||
currentType
==
null
)
{
if
(
replacementType
==
null
||
currentType
==
null
)
{
return
false
;
return
false
;
}
}
if
(
replacementType
.
equals
(
currentType
))
{
if
(
replacementType
.
equals
(
currentType
))
{
...
@@ -126,20 +126,19 @@ class PropertiesMigrationReporter {
...
@@ -126,20 +126,19 @@ class PropertiesMigrationReporter {
}
}
if
(
replacementType
.
equals
(
Duration
.
class
.
getName
())
if
(
replacementType
.
equals
(
Duration
.
class
.
getName
())
&&
(
currentType
.
equals
(
Long
.
class
.
getName
())
&&
(
currentType
.
equals
(
Long
.
class
.
getName
())
||
currentType
.
equals
(
Integer
.
class
.
getName
())))
{
||
currentType
.
equals
(
Integer
.
class
.
getName
())))
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
}
}
private
String
detectMapValueReplacementType
(
String
fullId
)
{
private
String
detectMapValueReplacementType
(
String
fullId
)
{
int
i
=
fullId
.
lastIndexOf
(
'.'
);
int
lastDot
=
fullId
.
lastIndexOf
(
'.'
);
if
(
i
!=
-
1
)
{
if
(
lastDot
!=
-
1
)
{
ConfigurationMetadataProperty
property
=
this
.
allProperties
.
get
(
ConfigurationMetadataProperty
property
=
this
.
allProperties
fullId
.
substring
(
0
,
i
));
.
get
(
fullId
.
substring
(
0
,
lastDot
));
String
type
=
property
.
getType
();
String
type
=
property
.
getType
();
if
(
type
!=
null
if
(
type
!=
null
&&
type
.
startsWith
(
Map
.
class
.
getName
()))
{
&&
type
.
startsWith
(
Map
.
class
.
getName
()))
{
int
lastComma
=
type
.
lastIndexOf
(
','
);
int
lastComma
=
type
.
lastIndexOf
(
','
);
if
(
lastComma
!=
-
1
)
{
if
(
lastComma
!=
-
1
)
{
return
type
.
substring
(
lastComma
+
1
,
type
.
length
()
-
1
).
trim
();
return
type
.
substring
(
lastComma
+
1
,
type
.
length
()
-
1
).
trim
();
...
...
spring-boot-project/spring-boot-properties-migrator/src/test/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporterTests.java
View file @
af50a18d
...
@@ -125,8 +125,7 @@ public class PropertiesMigrationReporterTests {
...
@@ -125,8 +125,7 @@ public class PropertiesMigrationReporterTests {
content
.
put
(
"test.cache-seconds"
,
50
);
content
.
put
(
"test.cache-seconds"
,
50
);
content
.
put
(
"test.time-to-live-ms"
,
1234L
);
content
.
put
(
"test.time-to-live-ms"
,
1234L
);
content
.
put
(
"test.ttl"
,
5678L
);
content
.
put
(
"test.ttl"
,
5678L
);
propertySources
.
addFirst
(
propertySources
.
addFirst
(
new
MapPropertySource
(
"test"
,
content
));
new
MapPropertySource
(
"test"
,
content
));
assertThat
(
propertySources
).
hasSize
(
2
);
assertThat
(
propertySources
).
hasSize
(
2
);
String
report
=
createWarningReport
(
String
report
=
createWarningReport
(
loadRepository
(
"metadata/type-conversion-metadata.json"
));
loadRepository
(
"metadata/type-conversion-metadata.json"
));
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/endpoint/incremental/IncrementalEndpoint.java
View file @
af50a18d
/*
/*
* 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");
* 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-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizer.java
View file @
af50a18d
/*
/*
* 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");
* 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.
...
@@ -41,8 +41,8 @@ public interface WebServerFactoryCustomizer<T extends WebServerFactory> {
...
@@ -41,8 +41,8 @@ public interface WebServerFactoryCustomizer<T extends WebServerFactory> {
/**
/**
* Customize the specified {@link WebServerFactory}.
* Customize the specified {@link WebServerFactory}.
* @param
server the server
to customize
* @param
factory the web server factory
to customize
*/
*/
void
customize
(
T
server
);
void
customize
(
T
factory
);
}
}
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/PropertyMapperTests.java
View file @
af50a18d
...
@@ -151,8 +151,8 @@ public class PropertyMapperTests {
...
@@ -151,8 +151,8 @@ public class PropertyMapperTests {
@Test
@Test
public
void
whenInstanceOfWhenValueIsNotTargetTypeShouldNotMatch
()
{
public
void
whenInstanceOfWhenValueIsNotTargetTypeShouldNotMatch
()
{
this
.
map
.
from
(()
->
(
Number
)
123L
).
whenInstanceOf
(
Double
.
class
)
Supplier
<
Number
>
supplier
=
()
->
123L
;
.
toCall
(
Assert:
:
fail
);
this
.
map
.
from
(
supplier
).
whenInstanceOf
(
Double
.
class
)
.
toCall
(
Assert:
:
fail
);
}
}
@Test
@Test
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.java
View file @
af50a18d
/*
/*
* 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");
* 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.
...
@@ -185,7 +185,7 @@ public class WebServerFactoryCustomizerBeanPostProcessorTests {
...
@@ -185,7 +185,7 @@ public class WebServerFactoryCustomizerBeanPostProcessorTests {
private
boolean
called
;
private
boolean
called
;
@Override
@Override
public
void
customize
(
T
server
)
{
public
void
customize
(
T
factory
)
{
this
.
called
=
true
;
this
.
called
=
true
;
}
}
...
...
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