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
80f2336f
Commit
80f2336f
authored
Feb 06, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
65b6cf8b
Changes
59
Show whitespace changes
Inline
Side-by-side
Showing
59 changed files
with
160 additions
and
117 deletions
+160
-117
AuditEvent.java
...va/org/springframework/boot/actuate/audit/AuditEvent.java
+0
-1
RabbitAutoConfiguration.java
...work/boot/autoconfigure/amqp/RabbitAutoConfiguration.java
+9
-8
BatchDatabaseInitializer.java
...rk/boot/autoconfigure/batch/BatchDatabaseInitializer.java
+1
-0
ConditionalOnExpression.java
...boot/autoconfigure/condition/ConditionalOnExpression.java
+1
-0
ConditionalOnNotWebApplication.java
...toconfigure/condition/ConditionalOnNotWebApplication.java
+1
-0
ConditionalOnResource.java
...k/boot/autoconfigure/condition/ConditionalOnResource.java
+1
-0
OnBeanCondition.java
...amework/boot/autoconfigure/condition/OnBeanCondition.java
+2
-0
OnClassCondition.java
...mework/boot/autoconfigure/condition/OnClassCondition.java
+1
-0
OnWebApplicationCondition.java
...ot/autoconfigure/condition/OnWebApplicationCondition.java
+1
-0
MongoRepositoriesAutoConfigureRegistrar.java
...nfigure/data/MongoRepositoriesAutoConfigureRegistrar.java
+1
-0
MongoTemplateAutoConfiguration.java
...ot/autoconfigure/data/MongoTemplateAutoConfiguration.java
+2
-2
DataSourceAutoConfiguration.java
.../boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java
+8
-0
EmbeddedDatabaseConnection.java
...k/boot/autoconfigure/jdbc/EmbeddedDatabaseConnection.java
+1
-0
JmsTemplateAutoConfiguration.java
.../boot/autoconfigure/jms/JmsTemplateAutoConfiguration.java
+2
-2
JmxAutoConfiguration.java
...ramework/boot/autoconfigure/jmx/JmxAutoConfiguration.java
+1
-0
AutoConfigurationReportLoggingInitializer.java
...re/logging/AutoConfigurationReportLoggingInitializer.java
+2
-0
MongoAutoConfiguration.java
...work/boot/autoconfigure/mongo/MongoAutoConfiguration.java
+2
-2
RedisAutoConfiguration.java
...work/boot/autoconfigure/redis/RedisAutoConfiguration.java
+16
-13
SpringBootWebSecurityConfiguration.java
...onfigure/security/SpringBootWebSecurityConfiguration.java
+2
-1
ThymeleafAutoConfiguration.java
...t/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java
+3
-1
DispatcherServletAutoConfiguration.java
...autoconfigure/web/DispatcherServletAutoConfiguration.java
+1
-0
EmbeddedServletContainerAutoConfiguration.java
...figure/web/EmbeddedServletContainerAutoConfiguration.java
+1
-0
HttpMapperProperties.java
...ramework/boot/autoconfigure/web/HttpMapperProperties.java
+1
-0
ServerProperties.java
...ingframework/boot/autoconfigure/web/ServerProperties.java
+1
-0
WebSocketAutoConfiguration.java
...t/autoconfigure/websocket/WebSocketAutoConfiguration.java
+2
-0
RelaxedDataBinder.java
...java/org/springframework/boot/bind/RelaxedDataBinder.java
+43
-37
RelaxedNames.java
...main/java/org/springframework/boot/bind/RelaxedNames.java
+9
-1
YamlConfigurationFactory.java
...g/springframework/boot/bind/YamlConfigurationFactory.java
+1
-1
YamlJavaBeanPropertyConstructor.java
...gframework/boot/bind/YamlJavaBeanPropertyConstructor.java
+4
-5
PropertySourceLoader.java
...org/springframework/boot/config/PropertySourceLoader.java
+2
-2
FileEncodingApplicationListener.java
...amework/boot/context/FileEncodingApplicationListener.java
+4
-5
AnnotationConfigEmbeddedWebApplicationContext.java
...bedded/AnnotationConfigEmbeddedWebApplicationContext.java
+0
-1
EmbeddedServletContainer.java
...ework/boot/context/embedded/EmbeddedServletContainer.java
+0
-1
EmbeddedServletContainerCustomizer.java
.../context/embedded/EmbeddedServletContainerCustomizer.java
+0
-1
EmbeddedServletContainerInitializedEvent.java
...xt/embedded/EmbeddedServletContainerInitializedEvent.java
+1
-0
EmbeddedWebApplicationContext.java
.../boot/context/embedded/EmbeddedWebApplicationContext.java
+0
-4
FilterRegistrationBean.java
...amework/boot/context/embedded/FilterRegistrationBean.java
+1
-1
RegistrationBean.java
...ringframework/boot/context/embedded/RegistrationBean.java
+1
-0
ServletContextInitializer.java
...work/boot/context/embedded/ServletContextInitializer.java
+0
-2
ServletRegistrationBean.java
...mework/boot/context/embedded/ServletRegistrationBean.java
+1
-1
WebApplicationContextServletContextAwareProcessor.java
...ed/WebApplicationContextServletContextAwareProcessor.java
+1
-0
XmlEmbeddedWebApplicationContext.java
...ot/context/embedded/XmlEmbeddedWebApplicationContext.java
+0
-1
JettyEmbeddedServletContainer.java
...context/embedded/jetty/JettyEmbeddedServletContainer.java
+2
-0
JettyEmbeddedServletContainerFactory.java
.../embedded/jetty/JettyEmbeddedServletContainerFactory.java
+1
-1
TomcatEmbeddedServletContainerFactory.java
...mbedded/tomcat/TomcatEmbeddedServletContainerFactory.java
+0
-1
EnvironmentDelegateApplicationContextInitializer.java
...env/EnvironmentDelegateApplicationContextInitializer.java
+1
-0
EnvironmentDelegateApplicationListener.java
...t/context/env/EnvironmentDelegateApplicationListener.java
+1
-0
ServletContextApplicationContextInitializer.java
...text/web/ServletContextApplicationContextInitializer.java
+2
-1
JsonParserFactory.java
...java/org/springframework/boot/json/JsonParserFactory.java
+1
-0
ClasspathLoggingApplicationListener.java
...ork/boot/logging/ClasspathLoggingApplicationListener.java
+2
-3
LoggingApplicationListener.java
...ingframework/boot/logging/LoggingApplicationListener.java
+4
-10
JavaLoggingSystem.java
.../springframework/boot/logging/java/JavaLoggingSystem.java
+1
-0
ColorConverter.java
.../springframework/boot/logging/logback/ColorConverter.java
+1
-0
EntityScanRegistrar.java
...org/springframework/boot/orm/jpa/EntityScanRegistrar.java
+4
-2
OutputCapture.java
...ain/java/org/springframework/boot/test/OutputCapture.java
+3
-1
SpringBootServletInitializer.java
...pringframework/boot/web/SpringBootServletInitializer.java
+1
-3
ArrayDocumentMatcher.java
...a/org/springframework/boot/yaml/ArrayDocumentMatcher.java
+2
-1
DefaultProfileDocumentMatcher.java
...ingframework/boot/yaml/DefaultProfileDocumentMatcher.java
+2
-1
YamlPropertiesFactoryBean.java
.../springframework/boot/yaml/YamlPropertiesFactoryBean.java
+1
-0
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/AuditEvent.java
View file @
80f2336f
...
@@ -30,7 +30,6 @@ import org.springframework.util.Assert;
...
@@ -30,7 +30,6 @@ import org.springframework.util.Assert;
* A value object representing an audit event: at a particular time, a particular user or
* A value object representing an audit event: at a particular time, a particular user or
* agent carried out an action of a particular type. This object records the details of
* agent carried out an action of a particular type. This object records the details of
* such an event.
* such an event.
*
* <p>
* <p>
* Users can inject a {@link AuditEventRepository} to publish their own events or
* Users can inject a {@link AuditEventRepository} to publish their own events or
* alternatively use Springs {@link AuthenticationEventPublisher} (usually obtained by
* alternatively use Springs {@link AuthenticationEventPublisher} (usually obtained by
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfiguration.java
View file @
80f2336f
...
@@ -63,21 +63,22 @@ public class RabbitAutoConfiguration {
...
@@ -63,21 +63,22 @@ public class RabbitAutoConfiguration {
protected
static
class
RabbitConnectionFactoryCreator
{
protected
static
class
RabbitConnectionFactoryCreator
{
@Bean
@Bean
public
ConnectionFactory
rabbitConnectionFactory
(
public
ConnectionFactory
rabbitConnectionFactory
(
RabbitProperties
config
)
{
RabbitProperties
config
)
{
CachingConnectionFactory
factory
=
new
CachingConnectionFactory
(
CachingConnectionFactory
connectionFactory
=
new
CachingConnectionFactory
(
config
.
getHost
());
config
.
getHost
());
connectionF
actory
.
setPort
(
config
.
getPort
());
f
actory
.
setPort
(
config
.
getPort
());
if
(
config
.
getUsername
()
!=
null
)
{
if
(
config
.
getUsername
()
!=
null
)
{
connectionF
actory
.
setUsername
(
config
.
getUsername
());
f
actory
.
setUsername
(
config
.
getUsername
());
}
}
if
(
config
.
getPassword
()
!=
null
)
{
if
(
config
.
getPassword
()
!=
null
)
{
connectionF
actory
.
setPassword
(
config
.
getPassword
());
f
actory
.
setPassword
(
config
.
getPassword
());
}
}
if
(
config
.
getVirtualHost
()
!=
null
)
{
if
(
config
.
getVirtualHost
()
!=
null
)
{
connectionF
actory
.
setVirtualHost
(
config
.
getVirtualHost
());
f
actory
.
setVirtualHost
(
config
.
getVirtualHost
());
}
}
return
connectionF
actory
;
return
f
actory
;
}
}
}
}
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchDatabaseInitializer.java
View file @
80f2336f
...
@@ -77,4 +77,5 @@ public class BatchDatabaseInitializer implements EnvironmentAware {
...
@@ -77,4 +77,5 @@ public class BatchDatabaseInitializer implements EnvironmentAware {
DatabasePopulatorUtils
.
execute
(
populator
,
this
.
dataSource
);
DatabasePopulatorUtils
.
execute
(
populator
,
this
.
dataSource
);
}
}
}
}
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnExpression.java
View file @
80f2336f
...
@@ -39,4 +39,5 @@ public @interface ConditionalOnExpression {
...
@@ -39,4 +39,5 @@ public @interface ConditionalOnExpression {
* condition passes or {@code false} if it fails.
* condition passes or {@code false} if it fails.
*/
*/
String
value
()
default
"true"
;
String
value
()
default
"true"
;
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnNotWebApplication.java
View file @
80f2336f
...
@@ -35,4 +35,5 @@ import org.springframework.context.annotation.Conditional;
...
@@ -35,4 +35,5 @@ import org.springframework.context.annotation.Conditional;
@Documented
@Documented
@Conditional
(
OnWebApplicationCondition
.
class
)
@Conditional
(
OnWebApplicationCondition
.
class
)
public
@interface
ConditionalOnNotWebApplication
{
public
@interface
ConditionalOnNotWebApplication
{
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnResource.java
View file @
80f2336f
...
@@ -41,4 +41,5 @@ public @interface ConditionalOnResource {
...
@@ -41,4 +41,5 @@ public @interface ConditionalOnResource {
* @return the resource paths that must be present.
* @return the resource paths that must be present.
*/
*/
public
String
[]
resources
()
default
{};
public
String
[]
resources
()
default
{};
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.java
View file @
80f2336f
...
@@ -292,5 +292,7 @@ class OnBeanCondition extends SpringBootCondition implements ConfigurationCondit
...
@@ -292,5 +292,7 @@ class OnBeanCondition extends SpringBootCondition implements ConfigurationCondit
string
.
append
(
")"
);
string
.
append
(
")"
);
return
string
.
toString
();
return
string
.
toString
();
}
}
}
}
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnClassCondition.java
View file @
80f2336f
...
@@ -124,4 +124,5 @@ class OnClassCondition extends SpringBootCondition {
...
@@ -124,4 +124,5 @@ class OnClassCondition extends SpringBootCondition {
public
abstract
boolean
matches
(
String
className
,
ConditionContext
context
);
public
abstract
boolean
matches
(
String
className
,
ConditionContext
context
);
};
};
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnWebApplicationCondition.java
View file @
80f2336f
...
@@ -76,4 +76,5 @@ class OnWebApplicationCondition extends SpringBootCondition {
...
@@ -76,4 +76,5 @@ class OnWebApplicationCondition extends SpringBootCondition {
return
ConditionOutcome
.
noMatch
(
"not a web application"
);
return
ConditionOutcome
.
noMatch
(
"not a web application"
);
}
}
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/MongoRepositoriesAutoConfigureRegistrar.java
View file @
80f2336f
...
@@ -49,6 +49,7 @@ class MongoRepositoriesAutoConfigureRegistrar extends
...
@@ -49,6 +49,7 @@ class MongoRepositoriesAutoConfigureRegistrar extends
@EnableMongoRepositories
@EnableMongoRepositories
private
static
class
EnableMongoRepositoriesConfiguration
{
private
static
class
EnableMongoRepositoriesConfiguration
{
}
}
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/MongoTemplateAutoConfiguration.java
View file @
80f2336f
...
@@ -43,12 +43,12 @@ import com.mongodb.Mongo;
...
@@ -43,12 +43,12 @@ import com.mongodb.Mongo;
public
class
MongoTemplateAutoConfiguration
{
public
class
MongoTemplateAutoConfiguration
{
@Autowired
@Autowired
private
MongoProperties
config
;
private
MongoProperties
properties
;
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
public
MongoTemplate
mongoTemplate
(
Mongo
mongo
)
throws
UnknownHostException
{
public
MongoTemplate
mongoTemplate
(
Mongo
mongo
)
throws
UnknownHostException
{
return
new
MongoTemplate
(
mongo
,
this
.
config
.
getMongoClientDatabase
());
return
new
MongoTemplate
(
mongo
,
this
.
properties
.
getMongoClientDatabase
());
}
}
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java
View file @
80f2336f
...
@@ -142,18 +142,21 @@ public class DataSourceAutoConfiguration implements EnvironmentAware {
...
@@ -142,18 +142,21 @@ public class DataSourceAutoConfiguration implements EnvironmentAware {
@ConditionalOnMissingBean
(
DataSource
.
class
)
@ConditionalOnMissingBean
(
DataSource
.
class
)
@Import
(
EmbeddedDataSourceConfiguration
.
class
)
@Import
(
EmbeddedDataSourceConfiguration
.
class
)
protected
static
class
EmbeddedConfiguration
{
protected
static
class
EmbeddedConfiguration
{
}
}
@Conditional
(
DataSourceAutoConfiguration
.
TomcatDatabaseCondition
.
class
)
@Conditional
(
DataSourceAutoConfiguration
.
TomcatDatabaseCondition
.
class
)
@ConditionalOnMissingBean
(
DataSource
.
class
)
@ConditionalOnMissingBean
(
DataSource
.
class
)
@Import
(
TomcatDataSourceConfiguration
.
class
)
@Import
(
TomcatDataSourceConfiguration
.
class
)
protected
static
class
TomcatConfiguration
{
protected
static
class
TomcatConfiguration
{
}
}
@Conditional
(
DataSourceAutoConfiguration
.
BasicDatabaseCondition
.
class
)
@Conditional
(
DataSourceAutoConfiguration
.
BasicDatabaseCondition
.
class
)
@ConditionalOnMissingBean
(
DataSource
.
class
)
@ConditionalOnMissingBean
(
DataSource
.
class
)
@Import
(
CommonsDataSourceConfiguration
.
class
)
@Import
(
CommonsDataSourceConfiguration
.
class
)
protected
static
class
DbcpConfiguration
{
protected
static
class
DbcpConfiguration
{
}
}
@Configuration
@Configuration
...
@@ -244,6 +247,7 @@ public class DataSourceAutoConfiguration implements EnvironmentAware {
...
@@ -244,6 +247,7 @@ public class DataSourceAutoConfiguration implements EnvironmentAware {
}
}
return
url
;
return
url
;
}
}
}
}
/**
/**
...
@@ -267,6 +271,7 @@ public class DataSourceAutoConfiguration implements EnvironmentAware {
...
@@ -267,6 +271,7 @@ public class DataSourceAutoConfiguration implements EnvironmentAware {
}
}
return
super
.
getMatchOutcome
(
context
,
metadata
);
return
super
.
getMatchOutcome
(
context
,
metadata
);
}
}
}
}
/**
/**
...
@@ -304,6 +309,7 @@ public class DataSourceAutoConfiguration implements EnvironmentAware {
...
@@ -304,6 +309,7 @@ public class DataSourceAutoConfiguration implements EnvironmentAware {
}
}
return
ConditionOutcome
.
match
(
"embedded database "
+
type
+
" detected"
);
return
ConditionOutcome
.
match
(
"embedded database "
+
type
+
" detected"
);
}
}
}
}
/**
/**
...
@@ -334,5 +340,7 @@ public class DataSourceAutoConfiguration implements EnvironmentAware {
...
@@ -334,5 +340,7 @@ public class DataSourceAutoConfiguration implements EnvironmentAware {
return
ConditionOutcome
.
noMatch
(
"no existing bean configured database"
);
return
ConditionOutcome
.
noMatch
(
"no existing bean configured database"
);
}
}
}
}
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/EmbeddedDatabaseConnection.java
View file @
80f2336f
...
@@ -121,4 +121,5 @@ public enum EmbeddedDatabaseConnection {
...
@@ -121,4 +121,5 @@ public enum EmbeddedDatabaseConnection {
}
}
return
NONE
;
return
NONE
;
}
}
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsTemplateAutoConfiguration.java
View file @
80f2336f
...
@@ -42,7 +42,7 @@ import org.springframework.jms.core.JmsTemplate;
...
@@ -42,7 +42,7 @@ import org.springframework.jms.core.JmsTemplate;
public
class
JmsTemplateAutoConfiguration
{
public
class
JmsTemplateAutoConfiguration
{
@Autowired
@Autowired
private
JmsTemplateProperties
config
;
private
JmsTemplateProperties
properties
;
@Autowired
@Autowired
private
ConnectionFactory
connectionFactory
;
private
ConnectionFactory
connectionFactory
;
...
@@ -51,7 +51,7 @@ public class JmsTemplateAutoConfiguration {
...
@@ -51,7 +51,7 @@ public class JmsTemplateAutoConfiguration {
@ConditionalOnMissingBean
(
JmsTemplate
.
class
)
@ConditionalOnMissingBean
(
JmsTemplate
.
class
)
public
JmsTemplate
jmsTemplate
()
{
public
JmsTemplate
jmsTemplate
()
{
JmsTemplate
jmsTemplate
=
new
JmsTemplate
(
this
.
connectionFactory
);
JmsTemplate
jmsTemplate
=
new
JmsTemplate
(
this
.
connectionFactory
);
jmsTemplate
.
setPubSubDomain
(
this
.
config
.
isPubSubDomain
());
jmsTemplate
.
setPubSubDomain
(
this
.
properties
.
isPubSubDomain
());
return
jmsTemplate
;
return
jmsTemplate
;
}
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfiguration.java
View file @
80f2336f
...
@@ -41,6 +41,7 @@ public class JmxAutoConfiguration {
...
@@ -41,6 +41,7 @@ public class JmxAutoConfiguration {
@Configuration
@Configuration
@EnableMBeanExport
(
defaultDomain
=
"${spring.jmx.default_domain:}"
,
server
=
"${spring.jmx.server:}"
)
@EnableMBeanExport
(
defaultDomain
=
"${spring.jmx.default_domain:}"
,
server
=
"${spring.jmx.server:}"
)
public
static
class
MBeanExport
{
public
static
class
MBeanExport
{
}
}
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/AutoConfigurationReportLoggingInitializer.java
View file @
80f2336f
...
@@ -176,5 +176,7 @@ public class AutoConfigurationReportLoggingInitializer implements
...
@@ -176,5 +176,7 @@ public class AutoConfigurationReportLoggingInitializer implements
public
void
onApplicationEvent
(
ApplicationEvent
event
)
{
public
void
onApplicationEvent
(
ApplicationEvent
event
)
{
AutoConfigurationReportLoggingInitializer
.
this
.
onApplicationEvent
(
event
);
AutoConfigurationReportLoggingInitializer
.
this
.
onApplicationEvent
(
event
);
}
}
}
}
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoAutoConfiguration.java
View file @
80f2336f
...
@@ -43,7 +43,7 @@ import com.mongodb.Mongo;
...
@@ -43,7 +43,7 @@ import com.mongodb.Mongo;
public
class
MongoAutoConfiguration
{
public
class
MongoAutoConfiguration
{
@Autowired
@Autowired
private
MongoProperties
config
;
private
MongoProperties
properties
;
private
Mongo
mongo
;
private
Mongo
mongo
;
...
@@ -57,7 +57,7 @@ public class MongoAutoConfiguration {
...
@@ -57,7 +57,7 @@ public class MongoAutoConfiguration {
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
public
Mongo
mongo
()
throws
UnknownHostException
{
public
Mongo
mongo
()
throws
UnknownHostException
{
this
.
mongo
=
this
.
config
.
createMongoClient
();
this
.
mongo
=
this
.
properties
.
createMongoClient
();
return
this
.
mongo
;
return
this
.
mongo
;
}
}
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/redis/RedisAutoConfiguration.java
View file @
80f2336f
...
@@ -54,15 +54,15 @@ public class RedisAutoConfiguration {
...
@@ -54,15 +54,15 @@ public class RedisAutoConfiguration {
protected
static
class
RedisConnectionConfiguration
{
protected
static
class
RedisConnectionConfiguration
{
@Autowired
@Autowired
private
RedisProperties
config
;
private
RedisProperties
properties
;
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
RedisConnectionFactory
redisConnectionFactory
()
throws
UnknownHostException
{
RedisConnectionFactory
redisConnectionFactory
()
throws
UnknownHostException
{
LettuceConnectionFactory
factory
=
new
LettuceConnectionFactory
(
LettuceConnectionFactory
factory
=
new
LettuceConnectionFactory
(
this
.
config
.
getHost
(),
this
.
config
.
getPort
());
this
.
properties
.
getHost
(),
this
.
properties
.
getPort
());
if
(
this
.
config
.
getPassword
()
!=
null
)
{
if
(
this
.
properties
.
getPassword
()
!=
null
)
{
factory
.
setPassword
(
this
.
config
.
getPassword
());
factory
.
setPassword
(
this
.
properties
.
getPassword
());
}
}
return
factory
;
return
factory
;
}
}
...
@@ -74,20 +74,20 @@ public class RedisAutoConfiguration {
...
@@ -74,20 +74,20 @@ public class RedisAutoConfiguration {
protected
static
class
RedisPooledConnectionConfiguration
{
protected
static
class
RedisPooledConnectionConfiguration
{
@Autowired
@Autowired
private
RedisProperties
config
;
private
RedisProperties
properties
;
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
RedisConnectionFactory
redisConnectionFactory
()
throws
UnknownHostException
{
RedisConnectionFactory
redisConnectionFactory
()
throws
UnknownHostException
{
if
(
this
.
config
.
getPool
()
!=
null
)
{
if
(
this
.
properties
.
getPool
()
!=
null
)
{
LettuceConnectionFactory
factory
=
new
LettuceConnectionFactory
(
LettuceConnectionFactory
factory
=
new
LettuceConnectionFactory
(
lettucePool
());
lettucePool
());
return
factory
;
return
factory
;
}
}
LettuceConnectionFactory
factory
=
new
LettuceConnectionFactory
(
LettuceConnectionFactory
factory
=
new
LettuceConnectionFactory
(
this
.
config
.
getHost
(),
this
.
config
.
getPort
());
this
.
properties
.
getHost
(),
this
.
properties
.
getPort
());
if
(
this
.
config
.
getPassword
()
!=
null
)
{
if
(
this
.
properties
.
getPassword
()
!=
null
)
{
factory
.
setPassword
(
this
.
config
.
getPassword
());
factory
.
setPassword
(
this
.
properties
.
getPassword
());
}
}
return
factory
;
return
factory
;
}
}
...
@@ -95,13 +95,13 @@ public class RedisAutoConfiguration {
...
@@ -95,13 +95,13 @@ public class RedisAutoConfiguration {
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
public
LettucePool
lettucePool
()
{
public
LettucePool
lettucePool
()
{
return
new
DefaultLettucePool
(
this
.
config
.
getHost
(),
this
.
config
.
getPor
t
(),
return
new
DefaultLettucePool
(
this
.
properties
.
getHos
t
(),
poolConfig
());
this
.
properties
.
getPort
(),
poolConfig
());
}
}
private
PoolConfig
poolConfig
()
{
private
PoolConfig
poolConfig
()
{
PoolConfig
pool
=
new
PoolConfig
();
PoolConfig
pool
=
new
PoolConfig
();
RedisProperties
.
Pool
props
=
this
.
config
.
getPool
();
RedisProperties
.
Pool
props
=
this
.
properties
.
getPool
();
if
(
props
!=
null
)
{
if
(
props
!=
null
)
{
pool
.
setMaxActive
(
props
.
getMaxActive
());
pool
.
setMaxActive
(
props
.
getMaxActive
());
pool
.
setMaxIdle
(
props
.
getMaxIdle
());
pool
.
setMaxIdle
(
props
.
getMaxIdle
());
...
@@ -110,19 +110,22 @@ public class RedisAutoConfiguration {
...
@@ -110,19 +110,22 @@ public class RedisAutoConfiguration {
}
}
return
pool
;
return
pool
;
}
}
}
}
@Bean
(
name
=
"org.springframework.autoconfigure.redis.RedisProperties"
)
@Bean
(
name
=
"org.springframework.autoconfigure.redis.RedisProperties"
)
@ConditionalOnMissingBean
@ConditionalOnMissingBean
public
RedisProperties
redisProperties
()
{
public
RedisProperties
redisProperties
()
{
return
new
RedisProperties
();
return
new
RedisProperties
();
}
}
@Configuration
@Configuration
protected
static
class
RedisConfiguration
{
protected
static
class
RedisConfiguration
{
@Autowired
@Autowired
private
RedisProperties
config
;
private
RedisProperties
properties
;
@Bean
@Bean
@ConditionalOnMissingBean
(
name
=
"redisTemplate"
)
@ConditionalOnMissingBean
(
name
=
"redisTemplate"
)
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SpringBootWebSecurityConfiguration.java
View file @
80f2336f
...
@@ -66,7 +66,6 @@ import org.springframework.web.servlet.support.RequestDataValueProcessor;
...
@@ -66,7 +66,6 @@ import org.springframework.web.servlet.support.RequestDataValueProcessor;
* password=password)</code> but can easily be customized by providing a bean definition
* password=password)</code> but can easily be customized by providing a bean definition
* of type {@link AuthenticationManager}. Also provides audit logging of authentication
* of type {@link AuthenticationManager}. Also provides audit logging of authentication
* events.
* events.
*
* <p>
* <p>
* Some common simple customizations:
* Some common simple customizations:
* <ul>
* <ul>
...
@@ -168,6 +167,7 @@ public class SpringBootWebSecurityConfiguration {
...
@@ -168,6 +167,7 @@ public class SpringBootWebSecurityConfiguration {
@Configuration
@Configuration
@EnableWebMvcSecurity
@EnableWebMvcSecurity
protected
static
class
DefaultWebMvcSecurityConfiguration
{
protected
static
class
DefaultWebMvcSecurityConfiguration
{
}
}
}
}
...
@@ -179,6 +179,7 @@ public class SpringBootWebSecurityConfiguration {
...
@@ -179,6 +179,7 @@ public class SpringBootWebSecurityConfiguration {
@Configuration
@Configuration
@EnableWebSecurity
@EnableWebSecurity
protected
static
class
DefaultWebSecurityConfiguration
{
protected
static
class
DefaultWebSecurityConfiguration
{
}
}
@ConditionalOnExpression
(
"${security.basic.enabled:true}"
)
@ConditionalOnExpression
(
"${security.basic.enabled:true}"
)
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java
View file @
80f2336f
...
@@ -56,6 +56,7 @@ import org.thymeleaf.templateresolver.TemplateResolver;
...
@@ -56,6 +56,7 @@ import org.thymeleaf.templateresolver.TemplateResolver;
public
class
ThymeleafAutoConfiguration
{
public
class
ThymeleafAutoConfiguration
{
public
static
final
String
DEFAULT_PREFIX
=
"classpath:/templates/"
;
public
static
final
String
DEFAULT_PREFIX
=
"classpath:/templates/"
;
public
static
final
String
DEFAULT_SUFFIX
=
".html"
;
public
static
final
String
DEFAULT_SUFFIX
=
".html"
;
@Configuration
@Configuration
...
@@ -108,7 +109,8 @@ public class ThymeleafAutoConfiguration {
...
@@ -108,7 +109,8 @@ public class ThymeleafAutoConfiguration {
protected
static
class
ThymeleafDefaultConfiguration
{
protected
static
class
ThymeleafDefaultConfiguration
{
@Autowired
@Autowired
private
final
Collection
<
ITemplateResolver
>
templateResolvers
=
Collections
.
emptySet
();
private
final
Collection
<
ITemplateResolver
>
templateResolvers
=
Collections
.
emptySet
();
@Autowired
(
required
=
false
)
@Autowired
(
required
=
false
)
private
final
Collection
<
IDialect
>
dialects
=
Collections
.
emptySet
();
private
final
Collection
<
IDialect
>
dialects
=
Collections
.
emptySet
();
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/DispatcherServletAutoConfiguration.java
View file @
80f2336f
...
@@ -97,6 +97,7 @@ public class DispatcherServletAutoConfiguration {
...
@@ -97,6 +97,7 @@ public class DispatcherServletAutoConfiguration {
.
match
(
"one or more DispatcherServlets found and none is named "
.
match
(
"one or more DispatcherServlets found and none is named "
+
DEFAULT_DISPATCHER_SERVLET_BEAN_NAME
);
+
DEFAULT_DISPATCHER_SERVLET_BEAN_NAME
);
}
}
}
}
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration.java
View file @
80f2336f
...
@@ -120,6 +120,7 @@ public class EmbeddedServletContainerAutoConfiguration {
...
@@ -120,6 +120,7 @@ public class EmbeddedServletContainerAutoConfiguration {
}
}
}
}
}
}
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/HttpMapperProperties.java
View file @
80f2336f
...
@@ -34,4 +34,5 @@ public class HttpMapperProperties {
...
@@ -34,4 +34,5 @@ public class HttpMapperProperties {
public
boolean
isJsonPrettyPrint
()
{
public
boolean
isJsonPrettyPrint
()
{
return
this
.
jsonPrettyPrint
;
return
this
.
jsonPrettyPrint
;
}
}
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java
View file @
80f2336f
...
@@ -238,6 +238,7 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer {
...
@@ -238,6 +238,7 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer {
factory
.
addContextValves
(
valve
);
factory
.
addContextValves
(
valve
);
}
}
}
}
}
}
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/WebSocketAutoConfiguration.java
View file @
80f2336f
...
@@ -116,6 +116,7 @@ public class WebSocketAutoConfiguration {
...
@@ -116,6 +116,7 @@ public class WebSocketAutoConfiguration {
@Configuration
@Configuration
@ConditionalOnClass
(
name
=
"org.apache.tomcat.websocket.server.WsSci"
)
@ConditionalOnClass
(
name
=
"org.apache.tomcat.websocket.server.WsSci"
)
protected
static
class
TomcatWebSocketConfiguration
{
protected
static
class
TomcatWebSocketConfiguration
{
@Bean
@Bean
public
TomcatEmbeddedServletContainerFactory
tomcatEmbeddedServletContainerFactory
()
{
public
TomcatEmbeddedServletContainerFactory
tomcatEmbeddedServletContainerFactory
()
{
TomcatEmbeddedServletContainerFactory
factory
=
new
TomcatEmbeddedServletContainerFactory
()
{
TomcatEmbeddedServletContainerFactory
factory
=
new
TomcatEmbeddedServletContainerFactory
()
{
...
@@ -130,6 +131,7 @@ public class WebSocketAutoConfiguration {
...
@@ -130,6 +131,7 @@ public class WebSocketAutoConfiguration {
};
};
return
factory
;
return
factory
;
}
}
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/bind/RelaxedDataBinder.java
View file @
80f2336f
...
@@ -43,25 +43,18 @@ public class RelaxedDataBinder extends DataBinder {
...
@@ -43,25 +43,18 @@ public class RelaxedDataBinder extends DataBinder {
private
String
namePrefix
;
private
String
namePrefix
;
private
boolean
ignoreNestedProperties
=
false
;
private
boolean
ignoreNestedProperties
;
/**
/**
* Create a new {@link RelaxedDataBinder} instance.
* @param target the target into which properties are bound
* @param target the target into which properties are bound
*/
*/
public
RelaxedDataBinder
(
Object
target
)
{
public
RelaxedDataBinder
(
Object
target
)
{
super
(
wrapTarget
(
target
));
super
(
wrapTarget
(
target
));
}
}
private
static
Object
wrapTarget
(
Object
target
)
{
if
(
target
instanceof
Map
)
{
@SuppressWarnings
(
"unchecked"
)
Map
<
String
,
Object
>
map
=
(
Map
<
String
,
Object
>)
target
;
target
=
new
MapHolder
(
map
);
}
return
target
;
}
/**
/**
* Create a new {@link RelaxedDataBinder} instance.
* @param target the target into which properties are bound
* @param target the target into which properties are bound
* @param namePrefix An optional prefix to be used when reading properties
* @param namePrefix An optional prefix to be used when reading properties
*/
*/
...
@@ -131,13 +124,13 @@ public class RelaxedDataBinder extends DataBinder {
...
@@ -131,13 +124,13 @@ public class RelaxedDataBinder extends DataBinder {
return
propertyValues
;
return
propertyValues
;
}
}
MutablePropertyValues
rtn
=
new
MutablePropertyValues
();
MutablePropertyValues
rtn
=
new
MutablePropertyValues
();
for
(
PropertyValue
pv
:
propertyValues
.
getPropertyValues
())
{
for
(
PropertyValue
value
:
propertyValues
.
getPropertyValues
())
{
String
name
=
pv
.
getName
();
String
name
=
value
.
getName
();
for
(
String
candidate
:
new
RelaxedNames
(
this
.
namePrefix
))
{
for
(
String
candidate
:
new
RelaxedNames
(
this
.
namePrefix
))
{
if
(
name
.
startsWith
(
candidate
))
{
if
(
name
.
startsWith
(
candidate
))
{
name
=
name
.
substring
(
candidate
.
length
());
name
=
name
.
substring
(
candidate
.
length
());
if
(!(
this
.
ignoreNestedProperties
&&
name
.
contains
(
"."
)))
{
if
(!(
this
.
ignoreNestedProperties
&&
name
.
contains
(
"."
)))
{
rtn
.
add
(
name
,
pv
.
getValue
());
rtn
.
add
(
name
,
value
.
getValue
());
}
}
}
}
}
}
...
@@ -211,7 +204,6 @@ public class RelaxedDataBinder extends DataBinder {
...
@@ -211,7 +204,6 @@ public class RelaxedDataBinder extends DataBinder {
}
}
return
initializePath
(
wrapper
,
path
,
index
);
return
initializePath
(
wrapper
,
path
,
index
);
}
}
private
void
extendCollectionIfNecessary
(
BeanWrapper
wrapper
,
BeanPath
path
,
int
index
)
{
private
void
extendCollectionIfNecessary
(
BeanWrapper
wrapper
,
BeanPath
path
,
int
index
)
{
...
@@ -262,7 +254,20 @@ public class RelaxedDataBinder extends DataBinder {
...
@@ -262,7 +254,20 @@ public class RelaxedDataBinder extends DataBinder {
return
name
;
return
name
;
}
}
private
static
Object
wrapTarget
(
Object
target
)
{
if
(
target
instanceof
Map
)
{
@SuppressWarnings
(
"unchecked"
)
Map
<
String
,
Object
>
map
=
(
Map
<
String
,
Object
>)
target
;
target
=
new
MapHolder
(
map
);
}
return
target
;
}
/**
* Holder to allow Map targets to be bound.
*/
static
class
MapHolder
{
static
class
MapHolder
{
private
Map
<
String
,
Object
>
map
;
private
Map
<
String
,
Object
>
map
;
public
MapHolder
(
Map
<
String
,
Object
>
map
)
{
public
MapHolder
(
Map
<
String
,
Object
>
map
)
{
...
@@ -276,6 +281,7 @@ public class RelaxedDataBinder extends DataBinder {
...
@@ -276,6 +281,7 @@ public class RelaxedDataBinder extends DataBinder {
public
Map
<
String
,
Object
>
getMap
()
{
public
Map
<
String
,
Object
>
getMap
()
{
return
this
.
map
;
return
this
.
map
;
}
}
}
}
private
static
class
BeanPath
{
private
static
class
BeanPath
{
...
@@ -286,6 +292,29 @@ public class RelaxedDataBinder extends DataBinder {
...
@@ -286,6 +292,29 @@ public class RelaxedDataBinder extends DataBinder {
this
.
nodes
=
splitPath
(
path
);
this
.
nodes
=
splitPath
(
path
);
}
}
private
List
<
PathNode
>
splitPath
(
String
path
)
{
List
<
PathNode
>
nodes
=
new
ArrayList
<
PathNode
>();
for
(
String
name
:
StringUtils
.
delimitedListToStringArray
(
path
,
"."
))
{
for
(
String
sub
:
StringUtils
.
delimitedListToStringArray
(
name
,
"["
))
{
if
(
StringUtils
.
hasText
(
sub
))
{
if
(
sub
.
endsWith
(
"]"
))
{
sub
=
sub
.
substring
(
0
,
sub
.
length
()
-
1
);
if
(
sub
.
matches
(
"[0-9]+"
))
{
nodes
.
add
(
new
ArrayIndexNode
(
sub
));
}
else
{
nodes
.
add
(
new
MapIndexNode
(
sub
));
}
}
else
{
nodes
.
add
(
new
PropertyNode
(
sub
));
}
}
}
}
return
nodes
;
}
public
void
collapseKeys
(
int
index
)
{
public
void
collapseKeys
(
int
index
)
{
List
<
PathNode
>
revised
=
new
ArrayList
<
PathNode
>();
List
<
PathNode
>
revised
=
new
ArrayList
<
PathNode
>();
for
(
int
i
=
0
;
i
<
index
;
i
++)
{
for
(
int
i
=
0
;
i
<
index
;
i
++)
{
...
@@ -401,29 +430,6 @@ public class RelaxedDataBinder extends DataBinder {
...
@@ -401,29 +430,6 @@ public class RelaxedDataBinder extends DataBinder {
}
}
}
}
private
List
<
PathNode
>
splitPath
(
String
path
)
{
List
<
PathNode
>
nodes
=
new
ArrayList
<
PathNode
>();
for
(
String
name
:
StringUtils
.
delimitedListToStringArray
(
path
,
"."
))
{
for
(
String
sub
:
StringUtils
.
delimitedListToStringArray
(
name
,
"["
))
{
if
(
StringUtils
.
hasText
(
sub
))
{
if
(
sub
.
endsWith
(
"]"
))
{
sub
=
sub
.
substring
(
0
,
sub
.
length
()
-
1
);
if
(
sub
.
matches
(
"[0-9]+"
))
{
nodes
.
add
(
new
ArrayIndexNode
(
sub
));
}
else
{
nodes
.
add
(
new
MapIndexNode
(
sub
));
}
}
else
{
nodes
.
add
(
new
PropertyNode
(
sub
));
}
}
}
}
return
nodes
;
}
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/bind/RelaxedNames.java
View file @
80f2336f
...
@@ -38,7 +38,6 @@ public final class RelaxedNames implements Iterable<String> {
...
@@ -38,7 +38,6 @@ public final class RelaxedNames implements Iterable<String> {
/**
/**
* Create a new {@link RelaxedNames} instance.
* Create a new {@link RelaxedNames} instance.
*
* @param name the source name. For the maximum number of variations specify the name
* @param name the source name. For the maximum number of variations specify the name
* using dashed notation (e.g. {@literal my-property-name}
* using dashed notation (e.g. {@literal my-property-name}
*/
*/
...
@@ -68,18 +67,21 @@ public final class RelaxedNames implements Iterable<String> {
...
@@ -68,18 +67,21 @@ public final class RelaxedNames implements Iterable<String> {
}
}
static
enum
Variation
{
static
enum
Variation
{
NONE
{
NONE
{
@Override
@Override
public
String
apply
(
String
value
)
{
public
String
apply
(
String
value
)
{
return
value
;
return
value
;
}
}
},
},
LOWERCASE
{
LOWERCASE
{
@Override
@Override
public
String
apply
(
String
value
)
{
public
String
apply
(
String
value
)
{
return
value
.
toLowerCase
();
return
value
.
toLowerCase
();
}
}
},
},
UPPERCASE
{
UPPERCASE
{
@Override
@Override
public
String
apply
(
String
value
)
{
public
String
apply
(
String
value
)
{
...
@@ -91,30 +93,35 @@ public final class RelaxedNames implements Iterable<String> {
...
@@ -91,30 +93,35 @@ public final class RelaxedNames implements Iterable<String> {
}
}
static
enum
Manipulation
{
static
enum
Manipulation
{
NONE
{
NONE
{
@Override
@Override
public
String
apply
(
String
value
)
{
public
String
apply
(
String
value
)
{
return
value
;
return
value
;
}
}
},
},
HYPHEN_TO_UNDERSCORE
{
HYPHEN_TO_UNDERSCORE
{
@Override
@Override
public
String
apply
(
String
value
)
{
public
String
apply
(
String
value
)
{
return
value
.
replace
(
"-"
,
"_"
);
return
value
.
replace
(
"-"
,
"_"
);
}
}
},
},
UNDERSCORE_TO_PERIOD
{
UNDERSCORE_TO_PERIOD
{
@Override
@Override
public
String
apply
(
String
value
)
{
public
String
apply
(
String
value
)
{
return
value
.
replace
(
"_"
,
"."
);
return
value
.
replace
(
"_"
,
"."
);
}
}
},
},
PERIOD_TO_UNDERSCORE
{
PERIOD_TO_UNDERSCORE
{
@Override
@Override
public
String
apply
(
String
value
)
{
public
String
apply
(
String
value
)
{
return
value
.
replace
(
"."
,
"_"
);
return
value
.
replace
(
"."
,
"_"
);
}
}
},
},
CAMELCASE_TO_UNDERSCORE
{
CAMELCASE_TO_UNDERSCORE
{
@Override
@Override
public
String
apply
(
String
value
)
{
public
String
apply
(
String
value
)
{
...
@@ -131,6 +138,7 @@ public final class RelaxedNames implements Iterable<String> {
...
@@ -131,6 +138,7 @@ public final class RelaxedNames implements Iterable<String> {
return
builder
.
toString
();
return
builder
.
toString
();
}
}
},
},
SEPARATED_TO_CAMELCASE
{
SEPARATED_TO_CAMELCASE
{
@Override
@Override
public
String
apply
(
String
value
)
{
public
String
apply
(
String
value
)
{
...
...
spring-boot/src/main/java/org/springframework/boot/bind/YamlConfigurationFactory.java
View file @
80f2336f
...
@@ -135,7 +135,7 @@ public class YamlConfigurationFactory<T> implements FactoryBean<T>, MessageSourc
...
@@ -135,7 +135,7 @@ public class YamlConfigurationFactory<T> implements FactoryBean<T>, MessageSourc
if
(
this
.
logger
.
isTraceEnabled
())
{
if
(
this
.
logger
.
isTraceEnabled
())
{
this
.
logger
.
trace
(
"Yaml document is\n"
+
this
.
yaml
);
this
.
logger
.
trace
(
"Yaml document is\n"
+
this
.
yaml
);
}
}
Constructor
constructor
=
new
Custom
PropertyConstructor
(
this
.
type
,
Constructor
constructor
=
new
YamlJavaBean
PropertyConstructor
(
this
.
type
,
this
.
propertyAliases
);
this
.
propertyAliases
);
this
.
configuration
=
(
T
)
(
new
Yaml
(
constructor
)).
load
(
this
.
yaml
);
this
.
configuration
=
(
T
)
(
new
Yaml
(
constructor
)).
load
(
this
.
yaml
);
if
(
this
.
validator
!=
null
)
{
if
(
this
.
validator
!=
null
)
{
...
...
spring-boot/src/main/java/org/springframework/boot/bind/
Custom
PropertyConstructor.java
→
spring-boot/src/main/java/org/springframework/boot/bind/
YamlJavaBean
PropertyConstructor.java
View file @
80f2336f
...
@@ -31,22 +31,21 @@ import org.yaml.snakeyaml.nodes.NodeId;
...
@@ -31,22 +31,21 @@ import org.yaml.snakeyaml.nodes.NodeId;
*
*
* @author Luke Taylor
* @author Luke Taylor
*/
*/
public
class
Custom
PropertyConstructor
extends
Constructor
{
public
class
YamlJavaBean
PropertyConstructor
extends
Constructor
{
private
final
Map
<
Class
<?>,
Map
<
String
,
Property
>>
properties
=
new
HashMap
<
Class
<?>,
Map
<
String
,
Property
>>();
private
final
Map
<
Class
<?>,
Map
<
String
,
Property
>>
properties
=
new
HashMap
<
Class
<?>,
Map
<
String
,
Property
>>();
private
final
PropertyUtils
propertyUtils
=
new
PropertyUtils
();
private
final
PropertyUtils
propertyUtils
=
new
PropertyUtils
();
public
Custom
PropertyConstructor
(
Class
<?>
theRoot
)
{
public
YamlJavaBean
PropertyConstructor
(
Class
<?>
theRoot
)
{
super
(
theRoot
);
super
(
theRoot
);
this
.
yamlClassConstructors
.
put
(
NodeId
.
mapping
,
this
.
yamlClassConstructors
.
put
(
NodeId
.
mapping
,
new
CustomPropertyConstructMapping
());
new
CustomPropertyConstructMapping
());
}
}
public
Custom
PropertyConstructor
(
Class
<?>
theRoot
,
public
YamlJavaBean
PropertyConstructor
(
Class
<?>
theRoot
,
Map
<
Class
<?>,
Map
<
String
,
String
>>
propertyAliases
)
{
Map
<
Class
<?>,
Map
<
String
,
String
>>
propertyAliases
)
{
this
(
theRoot
);
this
(
theRoot
);
for
(
Class
<?>
key
:
propertyAliases
.
keySet
())
{
for
(
Class
<?>
key
:
propertyAliases
.
keySet
())
{
Map
<
String
,
String
>
map
=
propertyAliases
.
get
(
key
);
Map
<
String
,
String
>
map
=
propertyAliases
.
get
(
key
);
if
(
map
!=
null
)
{
if
(
map
!=
null
)
{
...
@@ -85,7 +84,7 @@ public class CustomPropertyConstructor extends Constructor {
...
@@ -85,7 +84,7 @@ public class CustomPropertyConstructor extends Constructor {
@Override
@Override
protected
Property
getProperty
(
Class
<?>
type
,
String
name
)
protected
Property
getProperty
(
Class
<?>
type
,
String
name
)
throws
IntrospectionException
{
throws
IntrospectionException
{
Map
<
String
,
Property
>
forType
=
Custom
PropertyConstructor
.
this
.
properties
Map
<
String
,
Property
>
forType
=
YamlJavaBean
PropertyConstructor
.
this
.
properties
.
get
(
type
);
.
get
(
type
);
Property
property
=
(
forType
==
null
?
null
:
forType
.
get
(
name
));
Property
property
=
(
forType
==
null
?
null
:
forType
.
get
(
name
));
return
(
property
==
null
?
super
.
getProperty
(
type
,
name
)
:
property
);
return
(
property
==
null
?
super
.
getProperty
(
type
,
name
)
:
property
);
...
...
spring-boot/src/main/java/org/springframework/boot/config/PropertySourceLoader.java
View file @
80f2336f
...
@@ -30,7 +30,7 @@ public interface PropertySourceLoader {
...
@@ -30,7 +30,7 @@ public interface PropertySourceLoader {
* Returns {@code true} if the {@link Resource} is supported.
* Returns {@code true} if the {@link Resource} is supported.
* @return if the resource is supported
* @return if the resource is supported
*/
*/
public
boolean
supports
(
Resource
resource
);
boolean
supports
(
Resource
resource
);
/**
/**
* Load the resource into a property source.
* Load the resource into a property source.
...
...
spring-boot/src/main/java/org/springframework/boot/context/FileEncodingApplicationListener.java
View file @
80f2336f
...
@@ -57,8 +57,8 @@ public class FileEncodingApplicationListener implements
...
@@ -57,8 +57,8 @@ public class FileEncodingApplicationListener implements
RelaxedPropertyResolver
resolver
=
new
RelaxedPropertyResolver
(
RelaxedPropertyResolver
resolver
=
new
RelaxedPropertyResolver
(
event
.
getEnvironment
(),
"spring."
);
event
.
getEnvironment
(),
"spring."
);
if
(
resolver
.
containsProperty
(
"mandatoryFileEncoding"
))
{
if
(
resolver
.
containsProperty
(
"mandatoryFileEncoding"
))
{
final
String
encoding
=
System
.
getProperty
(
"file.encoding"
);
String
encoding
=
System
.
getProperty
(
"file.encoding"
);
final
String
desired
=
resolver
.
getProperty
(
"mandatoryFileEncoding"
);
String
desired
=
resolver
.
getProperty
(
"mandatoryFileEncoding"
);
if
(
encoding
!=
null
&&
!
desired
.
equalsIgnoreCase
(
encoding
))
{
if
(
encoding
!=
null
&&
!
desired
.
equalsIgnoreCase
(
encoding
))
{
logger
.
error
(
"System property 'file.encoding' is currently '"
+
encoding
logger
.
error
(
"System property 'file.encoding' is currently '"
+
encoding
+
"'. It should be '"
+
desired
+
"'. It should be '"
+
desired
...
@@ -70,9 +70,8 @@ public class FileEncodingApplicationListener implements
...
@@ -70,9 +70,8 @@ public class FileEncodingApplicationListener implements
+
"'. You could use a locale setting that matches encoding='"
+
"'. You could use a locale setting that matches encoding='"
+
desired
+
"'."
);
+
desired
+
"'."
);
throw
new
IllegalStateException
(
throw
new
IllegalStateException
(
"The Java Virtual Machine has not "
"The Java Virtual Machine has not been configured to use the "
+
" been configured to use the desired default character encoding ("
+
"desired default character encoding ("
+
desired
+
")."
);
+
desired
+
")."
);
}
}
}
}
}
}
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/AnnotationConfigEmbeddedWebApplicationContext.java
View file @
80f2336f
...
@@ -36,7 +36,6 @@ import org.springframework.web.context.support.AnnotationConfigWebApplicationCon
...
@@ -36,7 +36,6 @@ import org.springframework.web.context.support.AnnotationConfigWebApplicationCon
* JSR-330 compliant classes using {@code javax.inject} annotations. Allows for
* JSR-330 compliant classes using {@code javax.inject} annotations. Allows for
* registering classes one by one (specifying class names as config location) as well as
* registering classes one by one (specifying class names as config location) as well as
* for classpath scanning (specifying base packages as config location).
* for classpath scanning (specifying base packages as config location).
*
* <p>
* <p>
* Note: In case of multiple {@code @Configuration} classes, later {@code @Bean}
* Note: In case of multiple {@code @Configuration} classes, later {@code @Bean}
* definitions will override ones defined in earlier loaded files. This can be leveraged
* definitions will override ones defined in earlier loaded files. This can be leveraged
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/EmbeddedServletContainer.java
View file @
80f2336f
...
@@ -19,7 +19,6 @@ package org.springframework.boot.context.embedded;
...
@@ -19,7 +19,6 @@ package org.springframework.boot.context.embedded;
/**
/**
* Simple interface that represents a fully configured embedded servlet container (for
* Simple interface that represents a fully configured embedded servlet container (for
* example Tomcat or Jetty). Allows the container to be {@link #stop() stopped}.
* example Tomcat or Jetty). Allows the container to be {@link #stop() stopped}.
*
* <p>
* <p>
* Instances of this class are usually obtained via a
* Instances of this class are usually obtained via a
* {@link EmbeddedServletContainerFactory}.
* {@link EmbeddedServletContainerFactory}.
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/EmbeddedServletContainerCustomizer.java
View file @
80f2336f
...
@@ -22,7 +22,6 @@ import org.springframework.beans.factory.config.BeanPostProcessor;
...
@@ -22,7 +22,6 @@ import org.springframework.beans.factory.config.BeanPostProcessor;
* Strategy interface for customizing auto-configured embedded servlet containers. Any
* Strategy interface for customizing auto-configured embedded servlet containers. Any
* beans of this type will get a callback with the container factory before the container
* beans of this type will get a callback with the container factory before the container
* itself is started, so you can set the port, address, error pages etc.
* itself is started, so you can set the port, address, error pages etc.
*
* <p>
* <p>
* Beware: calls to this interface are usually made from a
* Beware: calls to this interface are usually made from a
* {@link EmbeddedServletContainerCustomizerBeanPostProcessor} which is a
* {@link EmbeddedServletContainerCustomizerBeanPostProcessor} which is a
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/EmbeddedServletContainerInitializedEvent.java
View file @
80f2336f
...
@@ -63,4 +63,5 @@ public class EmbeddedServletContainerInitializedEvent extends ApplicationEvent {
...
@@ -63,4 +63,5 @@ public class EmbeddedServletContainerInitializedEvent extends ApplicationEvent {
public
ApplicationContext
getApplicationContext
()
{
public
ApplicationContext
getApplicationContext
()
{
return
this
.
applicationContext
;
return
this
.
applicationContext
;
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/context/embedded/EmbeddedWebApplicationContext.java
View file @
80f2336f
...
@@ -56,14 +56,12 @@ import org.springframework.web.context.support.WebApplicationContextUtils;
...
@@ -56,14 +56,12 @@ import org.springframework.web.context.support.WebApplicationContextUtils;
/**
/**
* A {@link WebApplicationContext} that can be used to bootstrap itself from a contained
* A {@link WebApplicationContext} that can be used to bootstrap itself from a contained
* {@link EmbeddedServletContainerFactory} bean.
* {@link EmbeddedServletContainerFactory} bean.
*
* <p>
* <p>
* This context will create, initialize and run an {@link EmbeddedServletContainer} by
* This context will create, initialize and run an {@link EmbeddedServletContainer} by
* searching for a single {@link EmbeddedServletContainerFactory} bean within the
* searching for a single {@link EmbeddedServletContainerFactory} bean within the
* {@link ApplicationContext} itself. The {@link EmbeddedServletContainerFactory} is free
* {@link ApplicationContext} itself. The {@link EmbeddedServletContainerFactory} is free
* to use standard Spring concepts (such as dependency injection, lifecycle callbacks and
* to use standard Spring concepts (such as dependency injection, lifecycle callbacks and
* property placeholder variables).
* property placeholder variables).
*
* <p>
* <p>
* In addition, any {@link Servlet} or {@link Filter} beans defined in the context will be
* In addition, any {@link Servlet} or {@link Filter} beans defined in the context will be
* automatically registered with the embedded Servlet container. In the case of a single
* automatically registered with the embedded Servlet container. In the case of a single
...
@@ -71,14 +69,12 @@ import org.springframework.web.context.support.WebApplicationContextUtils;
...
@@ -71,14 +69,12 @@ import org.springframework.web.context.support.WebApplicationContextUtils;
* the lowercase bean name will be used as a mapping prefix. Any Servlet named
* the lowercase bean name will be used as a mapping prefix. Any Servlet named
* 'dispatcherServlet' will always be mapped to '/'. Filter beans will be mapped to all
* 'dispatcherServlet' will always be mapped to '/'. Filter beans will be mapped to all
* URLs ('/*').
* URLs ('/*').
*
* <p>
* <p>
* For more advanced configuration, the context can instead define beans that implement
* For more advanced configuration, the context can instead define beans that implement
* the {@link ServletContextInitializer} interface (most often
* the {@link ServletContextInitializer} interface (most often
* {@link ServletRegistrationBean}s and/or {@link FilterRegistrationBean}s). To prevent
* {@link ServletRegistrationBean}s and/or {@link FilterRegistrationBean}s). To prevent
* double registration, the use of {@link ServletContextInitializer} beans will disable
* double registration, the use of {@link ServletContextInitializer} beans will disable
* automatic Servlet and Filter bean registration.
* automatic Servlet and Filter bean registration.
*
* <p>
* <p>
* Although this context can be used directly, most developers should consider using the
* Although this context can be used directly, most developers should consider using the
* {@link AnnotationConfigEmbeddedWebApplicationContext} or
* {@link AnnotationConfigEmbeddedWebApplicationContext} or
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/FilterRegistrationBean.java
View file @
80f2336f
...
@@ -34,7 +34,6 @@ import org.springframework.util.Assert;
...
@@ -34,7 +34,6 @@ import org.springframework.util.Assert;
* A {@link ServletContextInitializer} to register {@link Filter}s in a Servlet 3.0+
* A {@link ServletContextInitializer} to register {@link Filter}s in a Servlet 3.0+
* container. Similar to the {@link ServletContext#addFilter(String, Filter) registration}
* container. Similar to the {@link ServletContext#addFilter(String, Filter) registration}
* features provided by {@link ServletContext} but with a Spring Bean friendly design.
* features provided by {@link ServletContext} but with a Spring Bean friendly design.
*
* <p>
* <p>
* The {@link #setFilter(Filter) Filter} must be specified before calling
* The {@link #setFilter(Filter) Filter} must be specified before calling
* {@link #onStartup(ServletContext)}. Registrations can be associated with
* {@link #onStartup(ServletContext)}. Registrations can be associated with
...
@@ -263,4 +262,5 @@ public class FilterRegistrationBean extends RegistrationBean {
...
@@ -263,4 +262,5 @@ public class FilterRegistrationBean extends RegistrationBean {
}
}
}
}
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/context/embedded/RegistrationBean.java
View file @
80f2336f
...
@@ -112,4 +112,5 @@ public abstract class RegistrationBean implements ServletContextInitializer {
...
@@ -112,4 +112,5 @@ public abstract class RegistrationBean implements ServletContextInitializer {
registration
.
setInitParameters
(
this
.
initParameters
);
registration
.
setInitParameters
(
this
.
initParameters
);
}
}
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/context/embedded/ServletContextInitializer.java
View file @
80f2336f
...
@@ -28,11 +28,9 @@ import org.springframework.web.WebApplicationInitializer;
...
@@ -28,11 +28,9 @@ import org.springframework.web.WebApplicationInitializer;
* interface (and do not implement {@link WebApplicationInitializer}) will <b>not</b> be
* interface (and do not implement {@link WebApplicationInitializer}) will <b>not</b> be
* detected by {@link SpringServletContainerInitializer} and hence will not be
* detected by {@link SpringServletContainerInitializer} and hence will not be
* automatically bootstrapped by the Servlet container.
* automatically bootstrapped by the Servlet container.
*
* <p>
* <p>
* This interface is primarily designed to allow {@link ServletContextInitializer}s to be
* This interface is primarily designed to allow {@link ServletContextInitializer}s to be
* managed by Spring and not the Servlet container.
* managed by Spring and not the Servlet container.
*
* <p>
* <p>
* For configuration examples see {@link WebApplicationInitializer}.
* For configuration examples see {@link WebApplicationInitializer}.
*
*
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/ServletRegistrationBean.java
View file @
80f2336f
...
@@ -34,7 +34,6 @@ import org.springframework.util.Assert;
...
@@ -34,7 +34,6 @@ import org.springframework.util.Assert;
* container. Similar to the {@link ServletContext#addServlet(String, Servlet)
* container. Similar to the {@link ServletContext#addServlet(String, Servlet)
* registration} features provided by {@link ServletContext} but with a Spring Bean
* registration} features provided by {@link ServletContext} but with a Spring Bean
* friendly design.
* friendly design.
*
* <p>
* <p>
* The {@link #setServlet(Servlet) servlet} must be specified before calling
* The {@link #setServlet(Servlet) servlet} must be specified before calling
* {@link #onStartup}. URL mapping can be configured used {@link #setUrlMappings} or
* {@link #onStartup}. URL mapping can be configured used {@link #setUrlMappings} or
...
@@ -173,4 +172,5 @@ public class ServletRegistrationBean extends RegistrationBean {
...
@@ -173,4 +172,5 @@ public class ServletRegistrationBean extends RegistrationBean {
registration
.
setMultipartConfig
(
this
.
multipartConfig
);
registration
.
setMultipartConfig
(
this
.
multipartConfig
);
}
}
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/context/embedded/WebApplicationContextServletContextAwareProcessor.java
View file @
80f2336f
...
@@ -53,4 +53,5 @@ public class WebApplicationContextServletContextAwareProcessor extends
...
@@ -53,4 +53,5 @@ public class WebApplicationContextServletContextAwareProcessor extends
ServletConfig
servletConfig
=
this
.
webApplicationContext
.
getServletConfig
();
ServletConfig
servletConfig
=
this
.
webApplicationContext
.
getServletConfig
();
return
(
servletConfig
!=
null
?
servletConfig
:
super
.
getServletConfig
());
return
(
servletConfig
!=
null
?
servletConfig
:
super
.
getServletConfig
());
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/context/embedded/XmlEmbeddedWebApplicationContext.java
View file @
80f2336f
...
@@ -25,7 +25,6 @@ import org.springframework.web.context.support.XmlWebApplicationContext;
...
@@ -25,7 +25,6 @@ import org.springframework.web.context.support.XmlWebApplicationContext;
/**
/**
* {@link EmbeddedWebApplicationContext} which takes its configuration from XML documents,
* {@link EmbeddedWebApplicationContext} which takes its configuration from XML documents,
* understood by an {@link org.springframework.beans.factory.xml.XmlBeanDefinitionReader}.
* understood by an {@link org.springframework.beans.factory.xml.XmlBeanDefinitionReader}.
*
* <p>
* <p>
* Note: In case of multiple config locations, later bean definitions will override ones
* Note: In case of multiple config locations, later bean definitions will override ones
* defined in earlier loaded files. This can be leveraged to deliberately override certain
* defined in earlier loaded files. This can be leveraged to deliberately override certain
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainer.java
View file @
80f2336f
...
@@ -40,6 +40,7 @@ public class JettyEmbeddedServletContainer implements EmbeddedServletContainer {
...
@@ -40,6 +40,7 @@ public class JettyEmbeddedServletContainer implements EmbeddedServletContainer {
private
final
Log
logger
=
LogFactory
.
getLog
(
JettyEmbeddedServletContainer
.
class
);
private
final
Log
logger
=
LogFactory
.
getLog
(
JettyEmbeddedServletContainer
.
class
);
private
final
Server
server
;
private
final
Server
server
;
private
final
boolean
autoStart
;
private
final
boolean
autoStart
;
/**
/**
...
@@ -144,4 +145,5 @@ public class JettyEmbeddedServletContainer implements EmbeddedServletContainer {
...
@@ -144,4 +145,5 @@ public class JettyEmbeddedServletContainer implements EmbeddedServletContainer {
public
Server
getServer
()
{
public
Server
getServer
()
{
return
this
.
server
;
return
this
.
server
;
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainerFactory.java
View file @
80f2336f
...
@@ -49,7 +49,6 @@ import org.springframework.util.StringUtils;
...
@@ -49,7 +49,6 @@ import org.springframework.util.StringUtils;
* {@link EmbeddedServletContainerFactory} that can be used to create
* {@link EmbeddedServletContainerFactory} that can be used to create
* {@link JettyEmbeddedServletContainer}s. Can be initialized using Spring's
* {@link JettyEmbeddedServletContainer}s. Can be initialized using Spring's
* {@link ServletContextInitializer}s or Jetty {@link Configuration}s.
* {@link ServletContextInitializer}s or Jetty {@link Configuration}s.
*
* <p>
* <p>
* Unless explicitly configured otherwise this factory will created containers that
* Unless explicitly configured otherwise this factory will created containers that
* listens for HTTP requests on port 8080.
* listens for HTTP requests on port 8080.
...
@@ -302,4 +301,5 @@ public class JettyEmbeddedServletContainerFactory extends
...
@@ -302,4 +301,5 @@ public class JettyEmbeddedServletContainerFactory extends
}
}
}
}
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java
View file @
80f2336f
...
@@ -59,7 +59,6 @@ import org.springframework.util.StreamUtils;
...
@@ -59,7 +59,6 @@ import org.springframework.util.StreamUtils;
* {@link EmbeddedServletContainerFactory} that can be used to create
* {@link EmbeddedServletContainerFactory} that can be used to create
* {@link TomcatEmbeddedServletContainer}s. Can be initialized using Spring's
* {@link TomcatEmbeddedServletContainer}s. Can be initialized using Spring's
* {@link ServletContextInitializer}s or Tomcat {@link LifecycleListener}s.
* {@link ServletContextInitializer}s or Tomcat {@link LifecycleListener}s.
*
* <p>
* <p>
* Unless explicitly configured otherwise this factory will created containers that
* Unless explicitly configured otherwise this factory will created containers that
* listens for HTTP requests on port 8080.
* listens for HTTP requests on port 8080.
...
...
spring-boot/src/main/java/org/springframework/boot/context/env/EnvironmentDelegateApplicationContextInitializer.java
View file @
80f2336f
...
@@ -122,4 +122,5 @@ public class EnvironmentDelegateApplicationContextInitializer implements
...
@@ -122,4 +122,5 @@ public class EnvironmentDelegateApplicationContextInitializer implements
public
int
getOrder
()
{
public
int
getOrder
()
{
return
this
.
order
;
return
this
.
order
;
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/context/env/EnvironmentDelegateApplicationListener.java
View file @
80f2336f
...
@@ -102,4 +102,5 @@ public class EnvironmentDelegateApplicationListener implements
...
@@ -102,4 +102,5 @@ public class EnvironmentDelegateApplicationListener implements
public
int
getOrder
()
{
public
int
getOrder
()
{
return
this
.
order
;
return
this
.
order
;
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/context/web/ServletContextApplicationContextInitializer.java
View file @
80f2336f
...
@@ -35,7 +35,8 @@ public class ServletContextApplicationContextInitializer implements
...
@@ -35,7 +35,8 @@ public class ServletContextApplicationContextInitializer implements
private
final
ServletContext
servletContext
;
private
final
ServletContext
servletContext
;
/**
/**
* @param servletContext
* Create a new {@link ServletContextApplicationContextInitializer} instance
* @param servletContext the servlet that should be ultimately set.
*/
*/
public
ServletContextApplicationContextInitializer
(
ServletContext
servletContext
)
{
public
ServletContextApplicationContextInitializer
(
ServletContext
servletContext
)
{
this
.
servletContext
=
servletContext
;
this
.
servletContext
=
servletContext
;
...
...
spring-boot/src/main/java/org/springframework/boot/json/JsonParserFactory.java
View file @
80f2336f
...
@@ -42,4 +42,5 @@ public abstract class JsonParserFactory {
...
@@ -42,4 +42,5 @@ public abstract class JsonParserFactory {
}
}
return
new
SimpleJsonParser
();
return
new
SimpleJsonParser
();
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/logging/ClasspathLoggingApplicationListener.java
View file @
80f2336f
...
@@ -79,8 +79,7 @@ public final class ClasspathLoggingApplicationListener implements
...
@@ -79,8 +79,7 @@ public final class ClasspathLoggingApplicationListener implements
if
(
classLoader
instanceof
URLClassLoader
)
{
if
(
classLoader
instanceof
URLClassLoader
)
{
return
Arrays
.
toString
(((
URLClassLoader
)
classLoader
).
getURLs
());
return
Arrays
.
toString
(((
URLClassLoader
)
classLoader
).
getURLs
());
}
}
else
{
return
"unknown"
;
return
"unknown"
;
}
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java
View file @
80f2336f
...
@@ -17,8 +17,6 @@
...
@@ -17,8 +17,6 @@
package
org
.
springframework
.
boot
.
logging
;
package
org
.
springframework
.
boot
.
logging
;
import
java.lang.management.ManagementFactory
;
import
java.lang.management.ManagementFactory
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -46,7 +44,6 @@ import org.springframework.util.ResourceUtils;
...
@@ -46,7 +44,6 @@ import org.springframework.util.ResourceUtils;
* system, otherwise a default location is used. The classpath is probed for log4j and
* system, otherwise a default location is used. The classpath is probed for log4j and
* logback and if those are present they will be reconfigured, otherwise vanilla
* logback and if those are present they will be reconfigured, otherwise vanilla
* <code>java.util.logging</code> will be used. </p>
* <code>java.util.logging</code> will be used. </p>
*
* <p>
* <p>
* The default config locations are <code>classpath:log4j.properties</code> or
* The default config locations are <code>classpath:log4j.properties</code> or
* <code>classpath:log4j.xml</code> for log4j; <code>classpath:logback.xml</code> for
* <code>classpath:log4j.xml</code> for log4j; <code>classpath:logback.xml</code> for
...
@@ -54,8 +51,6 @@ import org.springframework.util.ResourceUtils;
...
@@ -54,8 +51,6 @@ import org.springframework.util.ResourceUtils;
* <code>java.util.logging</code>. If the correct one of those files is not found then
* <code>java.util.logging</code>. If the correct one of those files is not found then
* some sensible defaults are adopted from files of the same name but in the package
* some sensible defaults are adopted from files of the same name but in the package
* containing {@link LoggingApplicationListener}.
* containing {@link LoggingApplicationListener}.
* </p>
*
* <p>
* <p>
* Some system properties may be set as side effects, and these can be useful if the
* Some system properties may be set as side effects, and these can be useful if the
* logging configuration supports placeholders (i.e. log4j or logback):
* logging configuration supports placeholders (i.e. log4j or logback):
...
@@ -91,10 +86,8 @@ public class LoggingApplicationListener implements SmartApplicationListener {
...
@@ -91,10 +86,8 @@ public class LoggingApplicationListener implements SmartApplicationListener {
LOG_LEVEL_LOGGERS
.
add
(
LogLevel
.
TRACE
,
"org.hibernate.tool.hbm2ddl"
);
LOG_LEVEL_LOGGERS
.
add
(
LogLevel
.
TRACE
,
"org.hibernate.tool.hbm2ddl"
);
}
}
@SuppressWarnings
(
"unchecked"
)
private
static
Class
<?>[]
EVENT_TYPES
=
{
ApplicationStartedEvent
.
class
,
private
static
Collection
<
Class
<?
extends
ApplicationEvent
>>
EVENT_TYPES
=
Arrays
ApplicationEnvironmentPreparedEvent
.
class
};
.<
Class
<?
extends
ApplicationEvent
>>
asList
(
ApplicationStartedEvent
.
class
,
ApplicationEnvironmentPreparedEvent
.
class
);
private
final
Log
logger
=
LogFactory
.
getLog
(
getClass
());
private
final
Log
logger
=
LogFactory
.
getLog
(
getClass
());
...
@@ -106,7 +99,7 @@ public class LoggingApplicationListener implements SmartApplicationListener {
...
@@ -106,7 +99,7 @@ public class LoggingApplicationListener implements SmartApplicationListener {
@Override
@Override
public
boolean
supportsEventType
(
Class
<?
extends
ApplicationEvent
>
eventType
)
{
public
boolean
supportsEventType
(
Class
<?
extends
ApplicationEvent
>
eventType
)
{
for
(
Class
<?
extends
ApplicationEvent
>
type
:
EVENT_TYPES
)
{
for
(
Class
<?>
type
:
EVENT_TYPES
)
{
if
(
type
.
isAssignableFrom
(
eventType
))
{
if
(
type
.
isAssignableFrom
(
eventType
))
{
return
true
;
return
true
;
}
}
...
@@ -230,4 +223,5 @@ public class LoggingApplicationListener implements SmartApplicationListener {
...
@@ -230,4 +223,5 @@ public class LoggingApplicationListener implements SmartApplicationListener {
public
void
setParseArgs
(
boolean
parseArgs
)
{
public
void
setParseArgs
(
boolean
parseArgs
)
{
this
.
parseArgs
=
parseArgs
;
this
.
parseArgs
=
parseArgs
;
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/logging/java/JavaLoggingSystem.java
View file @
80f2336f
...
@@ -74,4 +74,5 @@ public class JavaLoggingSystem extends AbstractLoggingSystem {
...
@@ -74,4 +74,5 @@ public class JavaLoggingSystem extends AbstractLoggingSystem {
Logger
logger
=
Logger
.
getLogger
(
loggerName
==
null
?
""
:
loggerName
);
Logger
logger
=
Logger
.
getLogger
(
loggerName
==
null
?
""
:
loggerName
);
logger
.
setLevel
(
LEVELS
.
get
(
level
));
logger
.
setLevel
(
LEVELS
.
get
(
level
));
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/logging/logback/ColorConverter.java
View file @
80f2336f
...
@@ -71,4 +71,5 @@ public class ColorConverter extends CompositeConverter<ILoggingEvent> {
...
@@ -71,4 +71,5 @@ public class ColorConverter extends CompositeConverter<ILoggingEvent> {
protected
String
toAnsiString
(
String
in
,
AnsiElement
element
)
{
protected
String
toAnsiString
(
String
in
,
AnsiElement
element
)
{
return
AnsiOutput
.
toString
(
element
,
in
);
return
AnsiOutput
.
toString
(
element
,
in
);
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/orm/jpa/EntityScanRegistrar.java
View file @
80f2336f
...
@@ -22,8 +22,8 @@ import java.util.LinkedHashSet;
...
@@ -22,8 +22,8 @@ import java.util.LinkedHashSet;
import
java.util.Set
;
import
java.util.Set
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.factory.config.BeanDefinition
;
import
org.springframework.beans.factory.config.BeanPostProcessor
;
import
org.springframework.beans.factory.config.BeanPostProcessor
;
import
org.springframework.beans.factory.support.AbstractBeanDefinition
;
import
org.springframework.beans.factory.support.BeanDefinitionRegistry
;
import
org.springframework.beans.factory.support.BeanDefinitionRegistry
;
import
org.springframework.beans.factory.support.GenericBeanDefinition
;
import
org.springframework.beans.factory.support.GenericBeanDefinition
;
import
org.springframework.context.ApplicationListener
;
import
org.springframework.context.ApplicationListener
;
...
@@ -53,7 +53,7 @@ class EntityScanRegistrar implements ImportBeanDefinitionRegistrar {
...
@@ -53,7 +53,7 @@ class EntityScanRegistrar implements ImportBeanDefinitionRegistrar {
beanDefinition
.
setBeanClass
(
EntityScanBeanPostProcessor
.
class
);
beanDefinition
.
setBeanClass
(
EntityScanBeanPostProcessor
.
class
);
beanDefinition
.
getConstructorArgumentValues
().
addGenericArgumentValue
(
beanDefinition
.
getConstructorArgumentValues
().
addGenericArgumentValue
(
getPackagesToScan
(
importingClassMetadata
));
getPackagesToScan
(
importingClassMetadata
));
beanDefinition
.
setRole
(
Abstract
BeanDefinition
.
ROLE_INFRASTRUCTURE
);
beanDefinition
.
setRole
(
BeanDefinition
.
ROLE_INFRASTRUCTURE
);
registry
.
registerBeanDefinition
(
BEAN_NAME
,
beanDefinition
);
registry
.
registerBeanDefinition
(
BEAN_NAME
,
beanDefinition
);
}
}
}
}
...
@@ -122,5 +122,7 @@ class EntityScanRegistrar implements ImportBeanDefinitionRegistrar {
...
@@ -122,5 +122,7 @@ class EntityScanRegistrar implements ImportBeanDefinitionRegistrar {
+
"LocalContainerEntityManagerFactoryBean from @EntityScan, "
+
"LocalContainerEntityManagerFactoryBean from @EntityScan, "
+
"ensure an appropriate bean is registered."
);
+
"ensure an appropriate bean is registered."
);
}
}
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/test/OutputCapture.java
View file @
80f2336f
...
@@ -28,7 +28,7 @@ import org.springframework.boot.ansi.AnsiOutput;
...
@@ -28,7 +28,7 @@ import org.springframework.boot.ansi.AnsiOutput;
import
org.springframework.boot.ansi.AnsiOutput.Enabled
;
import
org.springframework.boot.ansi.AnsiOutput.Enabled
;
/**
/**
*
C
apture output from System.out and System.err.
*
JUnit {@code @Rule} to c
apture output from System.out and System.err.
*
*
* @author Phillip Webb
* @author Phillip Webb
*/
*/
...
@@ -126,6 +126,7 @@ public class OutputCapture implements TestRule {
...
@@ -126,6 +126,7 @@ public class OutputCapture implements TestRule {
this
.
copy
.
flush
();
this
.
copy
.
flush
();
this
.
original
.
flush
();
this
.
original
.
flush
();
}
}
}
}
/**
/**
...
@@ -148,6 +149,7 @@ public class OutputCapture implements TestRule {
...
@@ -148,6 +149,7 @@ public class OutputCapture implements TestRule {
return
new
AnsiOutputControl
();
return
new
AnsiOutputControl
();
}
}
}
}
}
}
private
static
class
AnsiPresentOutputControl
extends
AnsiOutputControl
{
private
static
class
AnsiPresentOutputControl
extends
AnsiOutputControl
{
...
...
spring-boot/src/main/java/org/springframework/boot/web/SpringBootServletInitializer.java
View file @
80f2336f
...
@@ -36,8 +36,7 @@ import org.springframework.web.context.WebApplicationContext;
...
@@ -36,8 +36,7 @@ import org.springframework.web.context.WebApplicationContext;
* one Spring servlet, and no more than a single filter (which itself is only enabled when
* one Spring servlet, and no more than a single filter (which itself is only enabled when
* Spring Security is detected). If your application is more complicated consider using
* Spring Security is detected). If your application is more complicated consider using
* one of the other WebApplicationInitializers.
* one of the other WebApplicationInitializers.
*
* <p>
* <p/>
* Note that a WebApplicationInitializer is only needed if you are building a war file and
* Note that a WebApplicationInitializer is only needed if you are building a war file and
* deploying it. If you prefer to run an embedded container (we do) then you won't need
* deploying it. If you prefer to run an embedded container (we do) then you won't need
* this at all.
* this at all.
...
@@ -95,7 +94,6 @@ public abstract class SpringBootServletInitializer implements WebApplicationInit
...
@@ -95,7 +94,6 @@ public abstract class SpringBootServletInitializer implements WebApplicationInit
* config classes) because other settings have sensible defaults. You might choose
* config classes) because other settings have sensible defaults. You might choose
* (for instance) to add default command line arguments, or set an active Spring
* (for instance) to add default command line arguments, or set an active Spring
* profile.
* profile.
*
* @param application a builder for the application context
* @param application a builder for the application context
* @see SpringApplicationBuilder
* @see SpringApplicationBuilder
*/
*/
...
...
spring-boot/src/main/java/org/springframework/boot/yaml/ArrayDocumentMatcher.java
View file @
80f2336f
...
@@ -58,4 +58,5 @@ public class ArrayDocumentMatcher implements DocumentMatcher {
...
@@ -58,4 +58,5 @@ public class ArrayDocumentMatcher implements DocumentMatcher {
}
}
return
MatchStatus
.
NOT_FOUND
;
return
MatchStatus
.
NOT_FOUND
;
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/yaml/DefaultProfileDocumentMatcher.java
View file @
80f2336f
...
@@ -38,4 +38,5 @@ public class DefaultProfileDocumentMatcher implements DocumentMatcher {
...
@@ -38,4 +38,5 @@ public class DefaultProfileDocumentMatcher implements DocumentMatcher {
return
MatchStatus
.
NOT_FOUND
;
return
MatchStatus
.
NOT_FOUND
;
}
}
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/yaml/YamlPropertiesFactoryBean.java
View file @
80f2336f
...
@@ -105,4 +105,5 @@ public class YamlPropertiesFactoryBean extends YamlProcessor implements
...
@@ -105,4 +105,5 @@ public class YamlPropertiesFactoryBean extends YamlProcessor implements
public
boolean
isSingleton
()
{
public
boolean
isSingleton
()
{
return
this
.
singleton
;
return
this
.
singleton
;
}
}
}
}
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