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
Hide 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;
* 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
* such an event.
*
* <p>
* Users can inject a {@link AuditEventRepository} to publish their own events or
* 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 {
protected
static
class
RabbitConnectionFactoryCreator
{
@Bean
public
ConnectionFactory
rabbitConnectionFactory
(
RabbitProperties
config
)
{
CachingConnectionFactory
connectionFactory
=
new
CachingConnectionFactory
(
public
ConnectionFactory
rabbitConnectionFactory
(
RabbitProperties
config
)
{
CachingConnectionFactory
factory
=
new
CachingConnectionFactory
(
config
.
getHost
());
connectionF
actory
.
setPort
(
config
.
getPort
());
f
actory
.
setPort
(
config
.
getPort
());
if
(
config
.
getUsername
()
!=
null
)
{
connectionF
actory
.
setUsername
(
config
.
getUsername
());
f
actory
.
setUsername
(
config
.
getUsername
());
}
if
(
config
.
getPassword
()
!=
null
)
{
connectionF
actory
.
setPassword
(
config
.
getPassword
());
f
actory
.
setPassword
(
config
.
getPassword
());
}
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 {
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 {
* condition passes or {@code false} if it fails.
*/
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;
@Documented
@Conditional
(
OnWebApplicationCondition
.
class
)
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 {
* @return the resource paths that must be present.
*/
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
string
.
append
(
")"
);
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 {
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 {
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
@EnableMongoRepositories
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;
public
class
MongoTemplateAutoConfiguration
{
@Autowired
private
MongoProperties
config
;
private
MongoProperties
properties
;
@Bean
@ConditionalOnMissingBean
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 {
@ConditionalOnMissingBean
(
DataSource
.
class
)
@Import
(
EmbeddedDataSourceConfiguration
.
class
)
protected
static
class
EmbeddedConfiguration
{
}
@Conditional
(
DataSourceAutoConfiguration
.
TomcatDatabaseCondition
.
class
)
@ConditionalOnMissingBean
(
DataSource
.
class
)
@Import
(
TomcatDataSourceConfiguration
.
class
)
protected
static
class
TomcatConfiguration
{
}
@Conditional
(
DataSourceAutoConfiguration
.
BasicDatabaseCondition
.
class
)
@ConditionalOnMissingBean
(
DataSource
.
class
)
@Import
(
CommonsDataSourceConfiguration
.
class
)
protected
static
class
DbcpConfiguration
{
}
@Configuration
...
...
@@ -244,6 +247,7 @@ public class DataSourceAutoConfiguration implements EnvironmentAware {
}
return
url
;
}
}
/**
...
...
@@ -267,6 +271,7 @@ public class DataSourceAutoConfiguration implements EnvironmentAware {
}
return
super
.
getMatchOutcome
(
context
,
metadata
);
}
}
/**
...
...
@@ -304,6 +309,7 @@ public class DataSourceAutoConfiguration implements EnvironmentAware {
}
return
ConditionOutcome
.
match
(
"embedded database "
+
type
+
" detected"
);
}
}
/**
...
...
@@ -334,5 +340,7 @@ public class DataSourceAutoConfiguration implements EnvironmentAware {
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 {
}
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;
public
class
JmsTemplateAutoConfiguration
{
@Autowired
private
JmsTemplateProperties
config
;
private
JmsTemplateProperties
properties
;
@Autowired
private
ConnectionFactory
connectionFactory
;
...
...
@@ -51,7 +51,7 @@ public class JmsTemplateAutoConfiguration {
@ConditionalOnMissingBean
(
JmsTemplate
.
class
)
public
JmsTemplate
jmsTemplate
()
{
JmsTemplate
jmsTemplate
=
new
JmsTemplate
(
this
.
connectionFactory
);
jmsTemplate
.
setPubSubDomain
(
this
.
config
.
isPubSubDomain
());
jmsTemplate
.
setPubSubDomain
(
this
.
properties
.
isPubSubDomain
());
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 {
@Configuration
@EnableMBeanExport
(
defaultDomain
=
"${spring.jmx.default_domain:}"
,
server
=
"${spring.jmx.server:}"
)
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
public
void
onApplicationEvent
(
ApplicationEvent
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;
public
class
MongoAutoConfiguration
{
@Autowired
private
MongoProperties
config
;
private
MongoProperties
properties
;
private
Mongo
mongo
;
...
...
@@ -57,7 +57,7 @@ public class MongoAutoConfiguration {
@Bean
@ConditionalOnMissingBean
public
Mongo
mongo
()
throws
UnknownHostException
{
this
.
mongo
=
this
.
config
.
createMongoClient
();
this
.
mongo
=
this
.
properties
.
createMongoClient
();
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 {
protected
static
class
RedisConnectionConfiguration
{
@Autowired
private
RedisProperties
config
;
private
RedisProperties
properties
;
@Bean
@ConditionalOnMissingBean
RedisConnectionFactory
redisConnectionFactory
()
throws
UnknownHostException
{
LettuceConnectionFactory
factory
=
new
LettuceConnectionFactory
(
this
.
config
.
getHost
(),
this
.
config
.
getPort
());
if
(
this
.
config
.
getPassword
()
!=
null
)
{
factory
.
setPassword
(
this
.
config
.
getPassword
());
this
.
properties
.
getHost
(),
this
.
properties
.
getPort
());
if
(
this
.
properties
.
getPassword
()
!=
null
)
{
factory
.
setPassword
(
this
.
properties
.
getPassword
());
}
return
factory
;
}
...
...
@@ -74,20 +74,20 @@ public class RedisAutoConfiguration {
protected
static
class
RedisPooledConnectionConfiguration
{
@Autowired
private
RedisProperties
config
;
private
RedisProperties
properties
;
@Bean
@ConditionalOnMissingBean
RedisConnectionFactory
redisConnectionFactory
()
throws
UnknownHostException
{
if
(
this
.
config
.
getPool
()
!=
null
)
{
if
(
this
.
properties
.
getPool
()
!=
null
)
{
LettuceConnectionFactory
factory
=
new
LettuceConnectionFactory
(
lettucePool
());
return
factory
;
}
LettuceConnectionFactory
factory
=
new
LettuceConnectionFactory
(
this
.
config
.
getHost
(),
this
.
config
.
getPort
());
if
(
this
.
config
.
getPassword
()
!=
null
)
{
factory
.
setPassword
(
this
.
config
.
getPassword
());
this
.
properties
.
getHost
(),
this
.
properties
.
getPort
());
if
(
this
.
properties
.
getPassword
()
!=
null
)
{
factory
.
setPassword
(
this
.
properties
.
getPassword
());
}
return
factory
;
}
...
...
@@ -95,13 +95,13 @@ public class RedisAutoConfiguration {
@Bean
@ConditionalOnMissingBean
public
LettucePool
lettucePool
()
{
return
new
DefaultLettucePool
(
this
.
config
.
getHost
(),
this
.
config
.
getPor
t
(),
poolConfig
());
return
new
DefaultLettucePool
(
this
.
properties
.
getHos
t
(),
this
.
properties
.
getPort
(),
poolConfig
());
}
private
PoolConfig
poolConfig
()
{
PoolConfig
pool
=
new
PoolConfig
();
RedisProperties
.
Pool
props
=
this
.
config
.
getPool
();
RedisProperties
.
Pool
props
=
this
.
properties
.
getPool
();
if
(
props
!=
null
)
{
pool
.
setMaxActive
(
props
.
getMaxActive
());
pool
.
setMaxIdle
(
props
.
getMaxIdle
());
...
...
@@ -110,19 +110,22 @@ public class RedisAutoConfiguration {
}
return
pool
;
}
}
@Bean
(
name
=
"org.springframework.autoconfigure.redis.RedisProperties"
)
@ConditionalOnMissingBean
public
RedisProperties
redisProperties
()
{
return
new
RedisProperties
();
}
@Configuration
protected
static
class
RedisConfiguration
{
@Autowired
private
RedisProperties
config
;
private
RedisProperties
properties
;
@Bean
@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;
* password=password)</code> but can easily be customized by providing a bean definition
* of type {@link AuthenticationManager}. Also provides audit logging of authentication
* events.
*
* <p>
* Some common simple customizations:
* <ul>
...
...
@@ -168,6 +167,7 @@ public class SpringBootWebSecurityConfiguration {
@Configuration
@EnableWebMvcSecurity
protected
static
class
DefaultWebMvcSecurityConfiguration
{
}
}
...
...
@@ -179,6 +179,7 @@ public class SpringBootWebSecurityConfiguration {
@Configuration
@EnableWebSecurity
protected
static
class
DefaultWebSecurityConfiguration
{
}
@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;
public
class
ThymeleafAutoConfiguration
{
public
static
final
String
DEFAULT_PREFIX
=
"classpath:/templates/"
;
public
static
final
String
DEFAULT_SUFFIX
=
".html"
;
@Configuration
...
...
@@ -108,7 +109,8 @@ public class ThymeleafAutoConfiguration {
protected
static
class
ThymeleafDefaultConfiguration
{
@Autowired
private
final
Collection
<
ITemplateResolver
>
templateResolvers
=
Collections
.
emptySet
();
private
final
Collection
<
ITemplateResolver
>
templateResolvers
=
Collections
.
emptySet
();
@Autowired
(
required
=
false
)
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 {
.
match
(
"one or more DispatcherServlets found and none is named "
+
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 {
}
}
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/HttpMapperProperties.java
View file @
80f2336f
...
...
@@ -34,4 +34,5 @@ public class HttpMapperProperties {
public
boolean
isJsonPrettyPrint
()
{
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 {
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 {
@Configuration
@ConditionalOnClass
(
name
=
"org.apache.tomcat.websocket.server.WsSci"
)
protected
static
class
TomcatWebSocketConfiguration
{
@Bean
public
TomcatEmbeddedServletContainerFactory
tomcatEmbeddedServletContainerFactory
()
{
TomcatEmbeddedServletContainerFactory
factory
=
new
TomcatEmbeddedServletContainerFactory
()
{
...
...
@@ -130,6 +131,7 @@ public class WebSocketAutoConfiguration {
};
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 {
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
*/
public
RelaxedDataBinder
(
Object
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 namePrefix An optional prefix to be used when reading properties
*/
...
...
@@ -131,13 +124,13 @@ public class RelaxedDataBinder extends DataBinder {
return
propertyValues
;
}
MutablePropertyValues
rtn
=
new
MutablePropertyValues
();
for
(
PropertyValue
pv
:
propertyValues
.
getPropertyValues
())
{
String
name
=
pv
.
getName
();
for
(
PropertyValue
value
:
propertyValues
.
getPropertyValues
())
{
String
name
=
value
.
getName
();
for
(
String
candidate
:
new
RelaxedNames
(
this
.
namePrefix
))
{
if
(
name
.
startsWith
(
candidate
))
{
name
=
name
.
substring
(
candidate
.
length
());
if
(!(
this
.
ignoreNestedProperties
&&
name
.
contains
(
"."
)))
{
rtn
.
add
(
name
,
pv
.
getValue
());
rtn
.
add
(
name
,
value
.
getValue
());
}
}
}
...
...
@@ -211,7 +204,6 @@ public class RelaxedDataBinder extends DataBinder {
}
return
initializePath
(
wrapper
,
path
,
index
);
}
private
void
extendCollectionIfNecessary
(
BeanWrapper
wrapper
,
BeanPath
path
,
int
index
)
{
...
...
@@ -262,7 +254,20 @@ public class RelaxedDataBinder extends DataBinder {
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
{
private
Map
<
String
,
Object
>
map
;
public
MapHolder
(
Map
<
String
,
Object
>
map
)
{
...
...
@@ -276,6 +281,7 @@ public class RelaxedDataBinder extends DataBinder {
public
Map
<
String
,
Object
>
getMap
()
{
return
this
.
map
;
}
}
private
static
class
BeanPath
{
...
...
@@ -286,6 +292,29 @@ public class RelaxedDataBinder extends DataBinder {
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
)
{
List
<
PathNode
>
revised
=
new
ArrayList
<
PathNode
>();
for
(
int
i
=
0
;
i
<
index
;
i
++)
{
...
...
@@ -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> {
/**
* Create a new {@link RelaxedNames} instance.
*
* @param name the source name. For the maximum number of variations specify the name
* using dashed notation (e.g. {@literal my-property-name}
*/
...
...
@@ -68,18 +67,21 @@ public final class RelaxedNames implements Iterable<String> {
}
static
enum
Variation
{
NONE
{
@Override
public
String
apply
(
String
value
)
{
return
value
;
}
},
LOWERCASE
{
@Override
public
String
apply
(
String
value
)
{
return
value
.
toLowerCase
();
}
},
UPPERCASE
{
@Override
public
String
apply
(
String
value
)
{
...
...
@@ -91,30 +93,35 @@ public final class RelaxedNames implements Iterable<String> {
}
static
enum
Manipulation
{
NONE
{
@Override
public
String
apply
(
String
value
)
{
return
value
;
}
},
HYPHEN_TO_UNDERSCORE
{
@Override
public
String
apply
(
String
value
)
{
return
value
.
replace
(
"-"
,
"_"
);
}
},
UNDERSCORE_TO_PERIOD
{
@Override
public
String
apply
(
String
value
)
{
return
value
.
replace
(
"_"
,
"."
);
}
},
PERIOD_TO_UNDERSCORE
{
@Override
public
String
apply
(
String
value
)
{
return
value
.
replace
(
"."
,
"_"
);
}
},
CAMELCASE_TO_UNDERSCORE
{
@Override
public
String
apply
(
String
value
)
{
...
...
@@ -131,6 +138,7 @@ public final class RelaxedNames implements Iterable<String> {
return
builder
.
toString
();
}
},
SEPARATED_TO_CAMELCASE
{
@Override
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
if
(
this
.
logger
.
isTraceEnabled
())
{
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
.
configuration
=
(
T
)
(
new
Yaml
(
constructor
)).
load
(
this
.
yaml
);
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;
*
* @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
PropertyUtils
propertyUtils
=
new
PropertyUtils
();
public
Custom
PropertyConstructor
(
Class
<?>
theRoot
)
{
public
YamlJavaBean
PropertyConstructor
(
Class
<?>
theRoot
)
{
super
(
theRoot
);
this
.
yamlClassConstructors
.
put
(
NodeId
.
mapping
,
new
CustomPropertyConstructMapping
());
}
public
Custom
PropertyConstructor
(
Class
<?>
theRoot
,
public
YamlJavaBean
PropertyConstructor
(
Class
<?>
theRoot
,
Map
<
Class
<?>,
Map
<
String
,
String
>>
propertyAliases
)
{
this
(
theRoot
);
for
(
Class
<?>
key
:
propertyAliases
.
keySet
())
{
Map
<
String
,
String
>
map
=
propertyAliases
.
get
(
key
);
if
(
map
!=
null
)
{
...
...
@@ -85,7 +84,7 @@ public class CustomPropertyConstructor extends Constructor {
@Override
protected
Property
getProperty
(
Class
<?>
type
,
String
name
)
throws
IntrospectionException
{
Map
<
String
,
Property
>
forType
=
Custom
PropertyConstructor
.
this
.
properties
Map
<
String
,
Property
>
forType
=
YamlJavaBean
PropertyConstructor
.
this
.
properties
.
get
(
type
);
Property
property
=
(
forType
==
null
?
null
:
forType
.
get
(
name
));
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 {
* Returns {@code true} if the {@link 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.
...
...
@@ -39,4 +39,4 @@ public interface PropertySourceLoader {
*/
PropertySource
<?>
load
(
String
name
,
Resource
resource
);
}
\ No newline at end of file
}
spring-boot/src/main/java/org/springframework/boot/context/FileEncodingApplicationListener.java
View file @
80f2336f
...
...
@@ -57,8 +57,8 @@ public class FileEncodingApplicationListener implements
RelaxedPropertyResolver
resolver
=
new
RelaxedPropertyResolver
(
event
.
getEnvironment
(),
"spring."
);
if
(
resolver
.
containsProperty
(
"mandatoryFileEncoding"
))
{
final
String
encoding
=
System
.
getProperty
(
"file.encoding"
);
final
String
desired
=
resolver
.
getProperty
(
"mandatoryFileEncoding"
);
String
encoding
=
System
.
getProperty
(
"file.encoding"
);
String
desired
=
resolver
.
getProperty
(
"mandatoryFileEncoding"
);
if
(
encoding
!=
null
&&
!
desired
.
equalsIgnoreCase
(
encoding
))
{
logger
.
error
(
"System property 'file.encoding' is currently '"
+
encoding
+
"'. It should be '"
+
desired
...
...
@@ -70,9 +70,8 @@ public class FileEncodingApplicationListener implements
+
"'. You could use a locale setting that matches encoding='"
+
desired
+
"'."
);
throw
new
IllegalStateException
(
"The Java Virtual Machine has not "
+
" been configured to use the desired default character encoding ("
+
desired
+
")."
);
"The Java Virtual Machine has not been configured to use the "
+
"desired default character encoding ("
+
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
* 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
* for classpath scanning (specifying base packages as config location).
*
* <p>
* Note: In case of multiple {@code @Configuration} classes, later {@code @Bean}
* 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;
/**
* Simple interface that represents a fully configured embedded servlet container (for
* example Tomcat or Jetty). Allows the container to be {@link #stop() stopped}.
*
* <p>
* Instances of this class are usually obtained via a
* {@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;
* 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
* itself is started, so you can set the port, address, error pages etc.
*
* <p>
* Beware: calls to this interface are usually made from 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 {
public
ApplicationContext
getApplicationContext
()
{
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;
/**
* A {@link WebApplicationContext} that can be used to bootstrap itself from a contained
* {@link EmbeddedServletContainerFactory} bean.
*
* <p>
* This context will create, initialize and run an {@link EmbeddedServletContainer} by
* searching for a single {@link EmbeddedServletContainerFactory} bean within the
* {@link ApplicationContext} itself. The {@link EmbeddedServletContainerFactory} is free
* to use standard Spring concepts (such as dependency injection, lifecycle callbacks and
* property placeholder variables).
*
* <p>
* 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
...
...
@@ -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
* 'dispatcherServlet' will always be mapped to '/'. Filter beans will be mapped to all
* URLs ('/*').
*
* <p>
* For more advanced configuration, the context can instead define beans that implement
* the {@link ServletContextInitializer} interface (most often
* {@link ServletRegistrationBean}s and/or {@link FilterRegistrationBean}s). To prevent
* double registration, the use of {@link ServletContextInitializer} beans will disable
* automatic Servlet and Filter bean registration.
*
* <p>
* Although this context can be used directly, most developers should consider using the
* {@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;
* A {@link ServletContextInitializer} to register {@link Filter}s in a Servlet 3.0+
* container. Similar to the {@link ServletContext#addFilter(String, Filter) registration}
* features provided by {@link ServletContext} but with a Spring Bean friendly design.
*
* <p>
* The {@link #setFilter(Filter) Filter} must be specified before calling
* {@link #onStartup(ServletContext)}. Registrations can be associated with
...
...
@@ -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 {
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;
* interface (and do not implement {@link WebApplicationInitializer}) will <b>not</b> be
* detected by {@link SpringServletContainerInitializer} and hence will not be
* automatically bootstrapped by the Servlet container.
*
* <p>
* This interface is primarily designed to allow {@link ServletContextInitializer}s to be
* managed by Spring and not the Servlet container.
*
* <p>
* 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;
* container. Similar to the {@link ServletContext#addServlet(String, Servlet)
* registration} features provided by {@link ServletContext} but with a Spring Bean
* friendly design.
*
* <p>
* The {@link #setServlet(Servlet) servlet} must be specified before calling
* {@link #onStartup}. URL mapping can be configured used {@link #setUrlMappings} or
...
...
@@ -173,4 +172,5 @@ public class ServletRegistrationBean extends RegistrationBean {
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
ServletConfig
servletConfig
=
this
.
webApplicationContext
.
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;
/**
* {@link EmbeddedWebApplicationContext} which takes its configuration from XML documents,
* understood by an {@link org.springframework.beans.factory.xml.XmlBeanDefinitionReader}.
*
* <p>
* 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
...
...
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 {
private
final
Log
logger
=
LogFactory
.
getLog
(
JettyEmbeddedServletContainer
.
class
);
private
final
Server
server
;
private
final
boolean
autoStart
;
/**
...
...
@@ -144,4 +145,5 @@ public class JettyEmbeddedServletContainer implements EmbeddedServletContainer {
public
Server
getServer
()
{
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;
* {@link EmbeddedServletContainerFactory} that can be used to create
* {@link JettyEmbeddedServletContainer}s. Can be initialized using Spring's
* {@link ServletContextInitializer}s or Jetty {@link Configuration}s.
*
* <p>
* Unless explicitly configured otherwise this factory will created containers that
* listens for HTTP requests on port 8080.
...
...
@@ -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;
* {@link EmbeddedServletContainerFactory} that can be used to create
* {@link TomcatEmbeddedServletContainer}s. Can be initialized using Spring's
* {@link ServletContextInitializer}s or Tomcat {@link LifecycleListener}s.
*
* <p>
* Unless explicitly configured otherwise this factory will created containers that
* 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
public
int
getOrder
()
{
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
public
int
getOrder
()
{
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
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
)
{
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 {
}
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
if
(
classLoader
instanceof
URLClassLoader
)
{
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 @@
package
org
.
springframework
.
boot
.
logging
;
import
java.lang.management.ManagementFactory
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -46,7 +44,6 @@ import org.springframework.util.ResourceUtils;
* 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
* <code>java.util.logging</code> will be used. </p>
*
* <p>
* The default config locations are <code>classpath:log4j.properties</code> or
* <code>classpath:log4j.xml</code> for log4j; <code>classpath:logback.xml</code> for
...
...
@@ -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
* some sensible defaults are adopted from files of the same name but in the package
* containing {@link LoggingApplicationListener}.
* </p>
*
* <p>
* 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):
...
...
@@ -91,10 +86,8 @@ public class LoggingApplicationListener implements SmartApplicationListener {
LOG_LEVEL_LOGGERS
.
add
(
LogLevel
.
TRACE
,
"org.hibernate.tool.hbm2ddl"
);
}
@SuppressWarnings
(
"unchecked"
)
private
static
Collection
<
Class
<?
extends
ApplicationEvent
>>
EVENT_TYPES
=
Arrays
.<
Class
<?
extends
ApplicationEvent
>>
asList
(
ApplicationStartedEvent
.
class
,
ApplicationEnvironmentPreparedEvent
.
class
);
private
static
Class
<?>[]
EVENT_TYPES
=
{
ApplicationStartedEvent
.
class
,
ApplicationEnvironmentPreparedEvent
.
class
};
private
final
Log
logger
=
LogFactory
.
getLog
(
getClass
());
...
...
@@ -106,7 +99,7 @@ public class LoggingApplicationListener implements SmartApplicationListener {
@Override
public
boolean
supportsEventType
(
Class
<?
extends
ApplicationEvent
>
eventType
)
{
for
(
Class
<?
extends
ApplicationEvent
>
type
:
EVENT_TYPES
)
{
for
(
Class
<?>
type
:
EVENT_TYPES
)
{
if
(
type
.
isAssignableFrom
(
eventType
))
{
return
true
;
}
...
...
@@ -230,4 +223,5 @@ public class LoggingApplicationListener implements SmartApplicationListener {
public
void
setParseArgs
(
boolean
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 {
Logger
logger
=
Logger
.
getLogger
(
loggerName
==
null
?
""
:
loggerName
);
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> {
protected
String
toAnsiString
(
String
in
,
AnsiElement
element
)
{
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;
import
java.util.Set
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.factory.config.BeanDefinition
;
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.GenericBeanDefinition
;
import
org.springframework.context.ApplicationListener
;
...
...
@@ -53,7 +53,7 @@ class EntityScanRegistrar implements ImportBeanDefinitionRegistrar {
beanDefinition
.
setBeanClass
(
EntityScanBeanPostProcessor
.
class
);
beanDefinition
.
getConstructorArgumentValues
().
addGenericArgumentValue
(
getPackagesToScan
(
importingClassMetadata
));
beanDefinition
.
setRole
(
Abstract
BeanDefinition
.
ROLE_INFRASTRUCTURE
);
beanDefinition
.
setRole
(
BeanDefinition
.
ROLE_INFRASTRUCTURE
);
registry
.
registerBeanDefinition
(
BEAN_NAME
,
beanDefinition
);
}
}
...
...
@@ -122,5 +122,7 @@ class EntityScanRegistrar implements ImportBeanDefinitionRegistrar {
+
"LocalContainerEntityManagerFactoryBean from @EntityScan, "
+
"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;
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
*/
...
...
@@ -126,6 +126,7 @@ public class OutputCapture implements TestRule {
this
.
copy
.
flush
();
this
.
original
.
flush
();
}
}
/**
...
...
@@ -148,6 +149,7 @@ public class OutputCapture implements TestRule {
return
new
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;
* 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
* one of the other WebApplicationInitializers.
*
* <p/>
* <p>
* 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
* this at all.
...
...
@@ -95,7 +94,6 @@ public abstract class SpringBootServletInitializer implements WebApplicationInit
* config classes) because other settings have sensible defaults. You might choose
* (for instance) to add default command line arguments, or set an active Spring
* profile.
*
* @param application a builder for the application context
* @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 {
}
return
MatchStatus
.
NOT_FOUND
;
}
}
\ No newline at end of file
}
spring-boot/src/main/java/org/springframework/boot/yaml/DefaultProfileDocumentMatcher.java
View file @
80f2336f
...
...
@@ -38,4 +38,5 @@ public class DefaultProfileDocumentMatcher implements DocumentMatcher {
return
MatchStatus
.
NOT_FOUND
;
}
}
}
\ No newline at end of file
}
spring-boot/src/main/java/org/springframework/boot/yaml/YamlPropertiesFactoryBean.java
View file @
80f2336f
...
...
@@ -105,4 +105,5 @@ public class YamlPropertiesFactoryBean extends YamlProcessor implements
public
boolean
isSingleton
()
{
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