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
6121208c
Commit
6121208c
authored
Dec 19, 2016
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish formatting
parent
4b9cba35
Changes
46
Hide whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
110 additions
and
88 deletions
+110
-88
ManagementWebSecurityAutoConfiguration.java
...autoconfigure/ManagementWebSecurityAutoConfiguration.java
+1
-0
JolokiaMvcEndpoint.java
...amework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java
+2
-2
AuthorizationAuditListener.java
...ork/boot/actuate/security/AuthorizationAuditListener.java
+2
-2
CrshAutoConfigurationTests.java
...oot/actuate/autoconfigure/CrshAutoConfigurationTests.java
+2
-2
EndpointMBeanExporterTests.java
...boot/actuate/endpoint/jmx/EndpointMBeanExporterTests.java
+5
-6
MvcEndpointsTests.java
...ramework/boot/actuate/endpoint/mvc/MvcEndpointsTests.java
+2
-0
AuthenticationAuditListenerTests.java
...ot/actuate/security/AuthenticationAuditListenerTests.java
+6
-6
AuthorizationAuditListenerTests.java
...oot/actuate/security/AuthorizationAuditListenerTests.java
+6
-3
SearchStrategy.java
...ramework/boot/autoconfigure/condition/SearchStrategy.java
+0
-1
DataSourceConfiguration.java
...work/boot/autoconfigure/jdbc/DataSourceConfiguration.java
+1
-0
DataSourceInitializer.java
...mework/boot/autoconfigure/jdbc/DataSourceInitializer.java
+4
-4
JmsProperties.java
...springframework/boot/autoconfigure/jms/JmsProperties.java
+1
-0
JooqExceptionTranslator.java
...work/boot/autoconfigure/jooq/JooqExceptionTranslator.java
+2
-2
ValidationAutoConfiguration.java
...autoconfigure/validation/ValidationAutoConfiguration.java
+2
-1
ServerProperties.java
...ingframework/boot/autoconfigure/web/ServerProperties.java
+1
-0
DataSourceInitializerTests.java
...k/boot/autoconfigure/jdbc/DataSourceInitializerTests.java
+2
-3
ValidationAutoConfigurationTests.java
...onfigure/validation/ValidationAutoConfigurationTests.java
+5
-4
DependencyResolutionContextTests.java
.../cli/compiler/grape/DependencyResolutionContextTests.java
+2
-1
SampleHypermediaGsonApplicationTests.java
...hypermedia/gson/SampleHypermediaGsonApplicationTests.java
+2
-1
SampleMethodSecurityApplication.java
...mple/security/method/SampleMethodSecurityApplication.java
+2
-2
AutoConfigureJdbc.java
...ework/boot/test/autoconfigure/jdbc/AutoConfigureJdbc.java
+4
-3
JdbcTypeExcludeFilter.java
...k/boot/test/autoconfigure/jdbc/JdbcTypeExcludeFilter.java
+4
-4
AutoConfigureTestDatabase.java
...test/autoconfigure/orm/jpa/AutoConfigureTestDatabase.java
+2
-1
AutoConfigureTestDatabaseWithMultipleDatasourcesIntegrationTests.java
...eTestDatabaseWithMultipleDatasourcesIntegrationTests.java
+2
-4
ExampleJdbcApplication.java
.../boot/test/autoconfigure/jdbc/ExampleJdbcApplication.java
+1
-2
ExampleRepository.java
...ework/boot/test/autoconfigure/jdbc/ExampleRepository.java
+4
-2
JdbcTestWithAutoConfigureTestDatabaseReplaceExplicitIntegrationTests.java
...ConfigureTestDatabaseReplaceExplicitIntegrationTests.java
+1
-2
JdbcTestWithAutoConfigureTestDatabaseReplacePropertyAnyIntegrationTests.java
...figureTestDatabaseReplacePropertyAnyIntegrationTests.java
+1
-2
TestDatabaseAutoConfigurationTests.java
...utoconfigure/jdbc/TestDatabaseAutoConfigurationTests.java
+1
-2
DataJpaTestWithAutoConfigureTestDatabaseReplaceExplicitIntegrationTests.java
...ConfigureTestDatabaseReplaceExplicitIntegrationTests.java
+1
-2
ExampleDataJpaApplication.java
...test/autoconfigure/orm/jpa/ExampleDataJpaApplication.java
+1
-2
WebMvcTestAllControllersIntegrationTests.java
...web/servlet/WebMvcTestAllControllersIntegrationTests.java
+1
-2
TypeElementMembers.java
...ework/boot/configurationprocessor/TypeElementMembers.java
+2
-1
ConfigurationMetadataAnnotationProcessorTests.java
...cessor/ConfigurationMetadataAnnotationProcessorTests.java
+12
-4
DeprecatedMethodConfig.java
...ot/configurationsample/method/DeprecatedMethodConfig.java
+1
-0
ClassWithNestedProperties.java
...configurationsample/simple/ClassWithNestedProperties.java
+3
-0
MainClassFinder.java
...rg/springframework/boot/loader/tools/MainClassFinder.java
+0
-1
ExplodedArchive.java
.../springframework/boot/loader/archive/ExplodedArchive.java
+2
-1
UndertowEmbeddedServletContainerFactory.java
...ded/undertow/UndertowEmbeddedServletContainerFactory.java
+2
-2
DatabaseDriver.java
...in/java/org/springframework/boot/jdbc/DatabaseDriver.java
+1
-1
AbstractLoggingSystem.java
...g/springframework/boot/logging/AbstractLoggingSystem.java
+1
-0
LoggingSystem.java
.../java/org/springframework/boot/logging/LoggingSystem.java
+3
-3
SpringPhysicalNamingStrategy.java
.../boot/orm/jpa/hibernate/SpringPhysicalNamingStrategy.java
+3
-4
EnableConfigurationPropertiesTests.java
...ontext/properties/EnableConfigurationPropertiesTests.java
+1
-0
JavaLoggingSystemTests.java
...ngframework/boot/logging/java/JavaLoggingSystemTests.java
+2
-1
SpringPhysicalNamingStrategyTests.java
.../orm/jpa/hibernate/SpringPhysicalNamingStrategyTests.java
+4
-2
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementWebSecurityAutoConfiguration.java
View file @
6121208c
...
@@ -126,6 +126,7 @@ public class ManagementWebSecurityAutoConfiguration {
...
@@ -126,6 +126,7 @@ public class ManagementWebSecurityAutoConfiguration {
}
}
}
}
}
}
@Configuration
@Configuration
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java
View file @
6121208c
...
@@ -45,8 +45,8 @@ import org.springframework.web.util.UrlPathHelper;
...
@@ -45,8 +45,8 @@ import org.springframework.web.util.UrlPathHelper;
*/
*/
@ConfigurationProperties
(
prefix
=
"endpoints.jolokia"
,
ignoreUnknownFields
=
false
)
@ConfigurationProperties
(
prefix
=
"endpoints.jolokia"
,
ignoreUnknownFields
=
false
)
@HypermediaDisabled
@HypermediaDisabled
public
class
JolokiaMvcEndpoint
extends
AbstractNamedMvcEndpoint
public
class
JolokiaMvcEndpoint
extends
AbstractNamedMvcEndpoint
implements
implements
InitializingBean
,
ApplicationContextAware
,
ServletContextAware
,
DisposableBean
{
InitializingBean
,
ApplicationContextAware
,
ServletContextAware
,
DisposableBean
{
private
final
ServletWrappingController
controller
=
new
ServletWrappingController
();
private
final
ServletWrappingController
controller
=
new
ServletWrappingController
();
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/security/AuthorizationAuditListener.java
View file @
6121208c
...
@@ -64,8 +64,8 @@ public class AuthorizationAuditListener extends AbstractAuthorizationAuditListen
...
@@ -64,8 +64,8 @@ public class AuthorizationAuditListener extends AbstractAuthorizationAuditListen
if
(
event
.
getAuthentication
().
getDetails
()
!=
null
)
{
if
(
event
.
getAuthentication
().
getDetails
()
!=
null
)
{
data
.
put
(
"details"
,
event
.
getAuthentication
().
getDetails
());
data
.
put
(
"details"
,
event
.
getAuthentication
().
getDetails
());
}
}
publish
(
new
AuditEvent
(
event
.
getAuthentication
().
getName
(),
publish
(
new
AuditEvent
(
event
.
getAuthentication
().
getName
(),
AUTHORIZATION_FAILURE
,
AUTHORIZATION_FAILURE
,
data
));
data
));
}
}
}
}
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfigurationTests.java
View file @
6121208c
...
@@ -346,8 +346,8 @@ public class CrshAutoConfigurationTests {
...
@@ -346,8 +346,8 @@ public class CrshAutoConfigurationTests {
&&
authentication
.
getCredentials
().
equals
(
PASSWORD
))
{
&&
authentication
.
getCredentials
().
equals
(
PASSWORD
))
{
authentication
=
new
UsernamePasswordAuthenticationToken
(
authentication
=
new
UsernamePasswordAuthenticationToken
(
authentication
.
getPrincipal
(),
authentication
.
getPrincipal
(),
authentication
.
getCredentials
(),
Collections
authentication
.
getCredentials
(),
Collections
.
singleton
(
.
singleton
(
new
SimpleGrantedAuthority
(
"ACTUATOR"
)));
new
SimpleGrantedAuthority
(
"ACTUATOR"
)));
}
}
else
{
else
{
throw
new
BadCredentialsException
(
throw
new
BadCredentialsException
(
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanExporterTests.java
View file @
6121208c
...
@@ -269,8 +269,8 @@ public class EndpointMBeanExporterTests {
...
@@ -269,8 +269,8 @@ public class EndpointMBeanExporterTests {
MBeanExporter
mbeanExporter
=
registerLoggersEndpoint
();
MBeanExporter
mbeanExporter
=
registerLoggersEndpoint
();
Object
response
=
mbeanExporter
.
getServer
().
invoke
(
Object
response
=
mbeanExporter
.
getServer
().
invoke
(
getObjectName
(
"loggersEndpoint"
,
this
.
context
),
"setLogLevel"
,
getObjectName
(
"loggersEndpoint"
,
this
.
context
),
"setLogLevel"
,
new
Object
[]
{
"com.example"
,
"trace"
},
new
Object
[]
{
"com.example"
,
"trace"
},
new
String
[]
{
String
.
class
.
getName
(),
String
.
class
.
getName
()
});
new
String
[]
{
String
.
class
.
getName
(),
String
.
class
.
getName
()
});
assertThat
(
response
).
isNull
();
assertThat
(
response
).
isNull
();
}
}
...
@@ -280,10 +280,9 @@ public class EndpointMBeanExporterTests {
...
@@ -280,10 +280,9 @@ public class EndpointMBeanExporterTests {
this
.
thrown
.
expect
(
MBeanException
.
class
);
this
.
thrown
.
expect
(
MBeanException
.
class
);
this
.
thrown
.
expectCause
(
hasMessage
(
containsString
(
"No enum constant"
)));
this
.
thrown
.
expectCause
(
hasMessage
(
containsString
(
"No enum constant"
)));
this
.
thrown
.
expectCause
(
hasMessage
(
containsString
(
"LogLevel.INVALID"
)));
this
.
thrown
.
expectCause
(
hasMessage
(
containsString
(
"LogLevel.INVALID"
)));
mbeanExporter
.
getServer
().
invoke
(
mbeanExporter
.
getServer
().
invoke
(
getObjectName
(
"loggersEndpoint"
,
this
.
context
),
getObjectName
(
"loggersEndpoint"
,
this
.
context
),
"setLogLevel"
,
"setLogLevel"
,
new
Object
[]
{
"com.example"
,
"invalid"
},
new
Object
[]{
"com.example"
,
"invalid"
},
new
String
[]
{
String
.
class
.
getName
(),
String
.
class
.
getName
()
});
new
String
[]{
String
.
class
.
getName
(),
String
.
class
.
getName
()});
}
}
private
MBeanExporter
registerLoggersEndpoint
()
{
private
MBeanExporter
registerLoggersEndpoint
()
{
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpointsTests.java
View file @
6121208c
...
@@ -109,6 +109,7 @@ public class MvcEndpointsTests {
...
@@ -109,6 +109,7 @@ public class MvcEndpointsTests {
TestMvcEndpoint
(
Endpoint
<?>
delegate
)
{
TestMvcEndpoint
(
Endpoint
<?>
delegate
)
{
super
(
delegate
);
super
(
delegate
);
}
}
}
}
private
static
class
OtherTestMvcEndpoint
extends
EndpointMvcAdapter
{
private
static
class
OtherTestMvcEndpoint
extends
EndpointMvcAdapter
{
...
@@ -116,6 +117,7 @@ public class MvcEndpointsTests {
...
@@ -116,6 +117,7 @@ public class MvcEndpointsTests {
OtherTestMvcEndpoint
(
Endpoint
<?>
delegate
)
{
OtherTestMvcEndpoint
(
Endpoint
<?>
delegate
)
{
super
(
delegate
);
super
(
delegate
);
}
}
}
}
}
}
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/security/AuthenticationAuditListenerTests.java
View file @
6121208c
...
@@ -86,8 +86,8 @@ public class AuthenticationAuditListenerTests {
...
@@ -86,8 +86,8 @@ public class AuthenticationAuditListenerTests {
AuditApplicationEvent
event
=
handleAuthenticationEvent
(
AuditApplicationEvent
event
=
handleAuthenticationEvent
(
new
AuthenticationSwitchUserEvent
(
new
AuthenticationSwitchUserEvent
(
new
UsernamePasswordAuthenticationToken
(
"user"
,
"password"
),
new
UsernamePasswordAuthenticationToken
(
"user"
,
"password"
),
new
User
(
"user"
,
"password"
,
new
User
(
"user"
,
"password"
,
AuthorityUtils
AuthorityUtils
.
commaSeparatedStringToAuthorityList
(
"USER"
))));
.
commaSeparatedStringToAuthorityList
(
"USER"
))));
assertThat
(
event
.
getAuditEvent
().
getType
())
assertThat
(
event
.
getAuditEvent
().
getType
())
.
isEqualTo
(
AuthenticationAuditListener
.
AUTHENTICATION_SWITCH
);
.
isEqualTo
(
AuthenticationAuditListener
.
AUTHENTICATION_SWITCH
);
}
}
...
@@ -98,12 +98,12 @@ public class AuthenticationAuditListenerTests {
...
@@ -98,12 +98,12 @@ public class AuthenticationAuditListenerTests {
UsernamePasswordAuthenticationToken
authentication
=
new
UsernamePasswordAuthenticationToken
(
UsernamePasswordAuthenticationToken
authentication
=
new
UsernamePasswordAuthenticationToken
(
"user"
,
"password"
);
"user"
,
"password"
);
authentication
.
setDetails
(
details
);
authentication
.
setDetails
(
details
);
AuditApplicationEvent
event
=
handleAuthenticationEvent
(
new
AuthenticationFailureExpiredEvent
(
AuditApplicationEvent
event
=
handleAuthenticationEvent
(
authentication
,
new
BadCredentialsException
(
"Bad user"
)));
new
AuthenticationFailureExpiredEvent
(
authentication
,
new
BadCredentialsException
(
"Bad user"
)));
assertThat
(
event
.
getAuditEvent
().
getType
())
assertThat
(
event
.
getAuditEvent
().
getType
())
.
isEqualTo
(
AuthenticationAuditListener
.
AUTHENTICATION_FAILURE
);
.
isEqualTo
(
AuthenticationAuditListener
.
AUTHENTICATION_FAILURE
);
assertThat
(
event
.
getAuditEvent
().
getData
())
assertThat
(
event
.
getAuditEvent
().
getData
()).
containsEntry
(
"details"
,
details
);
.
containsEntry
(
"details"
,
details
);
}
}
private
AuditApplicationEvent
handleAuthenticationEvent
(
private
AuditApplicationEvent
handleAuthenticationEvent
(
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/security/AuthorizationAuditListenerTests.java
View file @
6121208c
...
@@ -56,7 +56,8 @@ public class AuthorizationAuditListenerTests {
...
@@ -56,7 +56,8 @@ public class AuthorizationAuditListenerTests {
public
void
testAuthenticationCredentialsNotFound
()
{
public
void
testAuthenticationCredentialsNotFound
()
{
AuditApplicationEvent
event
=
handleAuthorizationEvent
(
AuditApplicationEvent
event
=
handleAuthorizationEvent
(
new
AuthenticationCredentialsNotFoundEvent
(
this
,
new
AuthenticationCredentialsNotFoundEvent
(
this
,
Collections
.<
ConfigAttribute
>
singletonList
(
new
SecurityConfig
(
"USER"
)),
Collections
.<
ConfigAttribute
>
singletonList
(
new
SecurityConfig
(
"USER"
)),
new
AuthenticationCredentialsNotFoundException
(
"Bad user"
)));
new
AuthenticationCredentialsNotFoundException
(
"Bad user"
)));
assertThat
(
event
.
getAuditEvent
().
getType
())
assertThat
(
event
.
getAuditEvent
().
getType
())
.
isEqualTo
(
AuthenticationAuditListener
.
AUTHENTICATION_FAILURE
);
.
isEqualTo
(
AuthenticationAuditListener
.
AUTHENTICATION_FAILURE
);
...
@@ -66,7 +67,8 @@ public class AuthorizationAuditListenerTests {
...
@@ -66,7 +67,8 @@ public class AuthorizationAuditListenerTests {
public
void
testAuthorizationFailure
()
{
public
void
testAuthorizationFailure
()
{
AuditApplicationEvent
event
=
handleAuthorizationEvent
(
AuditApplicationEvent
event
=
handleAuthorizationEvent
(
new
AuthorizationFailureEvent
(
this
,
new
AuthorizationFailureEvent
(
this
,
Collections
.<
ConfigAttribute
>
singletonList
(
new
SecurityConfig
(
"USER"
)),
Collections
.<
ConfigAttribute
>
singletonList
(
new
SecurityConfig
(
"USER"
)),
new
UsernamePasswordAuthenticationToken
(
"user"
,
"password"
),
new
UsernamePasswordAuthenticationToken
(
"user"
,
"password"
),
new
AccessDeniedException
(
"Bad user"
)));
new
AccessDeniedException
(
"Bad user"
)));
assertThat
(
event
.
getAuditEvent
().
getType
())
assertThat
(
event
.
getAuditEvent
().
getType
())
...
@@ -81,7 +83,8 @@ public class AuthorizationAuditListenerTests {
...
@@ -81,7 +83,8 @@ public class AuthorizationAuditListenerTests {
authentication
.
setDetails
(
details
);
authentication
.
setDetails
(
details
);
AuditApplicationEvent
event
=
handleAuthorizationEvent
(
AuditApplicationEvent
event
=
handleAuthorizationEvent
(
new
AuthorizationFailureEvent
(
this
,
new
AuthorizationFailureEvent
(
this
,
Collections
.<
ConfigAttribute
>
singletonList
(
new
SecurityConfig
(
"USER"
)),
Collections
.<
ConfigAttribute
>
singletonList
(
new
SecurityConfig
(
"USER"
)),
authentication
,
new
AccessDeniedException
(
"Bad user"
)));
authentication
,
new
AccessDeniedException
(
"Bad user"
)));
assertThat
(
event
.
getAuditEvent
().
getType
())
assertThat
(
event
.
getAuditEvent
().
getType
())
.
isEqualTo
(
AuthorizationAuditListener
.
AUTHORIZATION_FAILURE
);
.
isEqualTo
(
AuthorizationAuditListener
.
AUTHORIZATION_FAILURE
);
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/SearchStrategy.java
View file @
6121208c
...
@@ -30,7 +30,6 @@ public enum SearchStrategy {
...
@@ -30,7 +30,6 @@ public enum SearchStrategy {
/**
/**
* Search all parents and ancestors, but not the current context.
* Search all parents and ancestors, but not the current context.
*
* @deprecated since 1.5 in favor of {@link SearchStrategy#ANCESTORS}
* @deprecated since 1.5 in favor of {@link SearchStrategy#ANCESTORS}
*/
*/
@Deprecated
PARENTS
,
@Deprecated
PARENTS
,
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration.java
View file @
6121208c
...
@@ -84,6 +84,7 @@ abstract class DataSourceConfiguration {
...
@@ -84,6 +84,7 @@ abstract class DataSourceConfiguration {
/**
/**
* DBCP DataSource configuration.
* DBCP DataSource configuration.
*
* @deprecated as of Spring Boot 1.5 in favor of DBCP2
* @deprecated as of Spring Boot 1.5 in favor of DBCP2
*/
*/
@ConditionalOnClass
(
org
.
apache
.
commons
.
dbcp
.
BasicDataSource
.
class
)
@ConditionalOnClass
(
org
.
apache
.
commons
.
dbcp
.
BasicDataSource
.
class
)
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceInitializer.java
View file @
6121208c
...
@@ -124,8 +124,8 @@ class DataSourceInitializer implements ApplicationListener<DataSourceInitialized
...
@@ -124,8 +124,8 @@ class DataSourceInitializer implements ApplicationListener<DataSourceInitialized
runScripts
(
scripts
,
username
,
password
);
runScripts
(
scripts
,
username
,
password
);
}
}
private
List
<
Resource
>
getScripts
(
String
propertyName
,
private
List
<
Resource
>
getScripts
(
String
propertyName
,
List
<
String
>
resources
,
List
<
String
>
resources
,
String
fallback
)
{
String
fallback
)
{
if
(
resources
!=
null
)
{
if
(
resources
!=
null
)
{
return
getResources
(
propertyName
,
resources
,
true
);
return
getResources
(
propertyName
,
resources
,
true
);
}
}
...
@@ -136,8 +136,8 @@ class DataSourceInitializer implements ApplicationListener<DataSourceInitialized
...
@@ -136,8 +136,8 @@ class DataSourceInitializer implements ApplicationListener<DataSourceInitialized
return
getResources
(
propertyName
,
fallbackResources
,
false
);
return
getResources
(
propertyName
,
fallbackResources
,
false
);
}
}
private
List
<
Resource
>
getResources
(
String
propertyName
,
private
List
<
Resource
>
getResources
(
String
propertyName
,
List
<
String
>
locations
,
List
<
String
>
locations
,
boolean
validate
)
{
boolean
validate
)
{
List
<
Resource
>
resources
=
new
ArrayList
<
Resource
>();
List
<
Resource
>
resources
=
new
ArrayList
<
Resource
>();
for
(
String
location
:
locations
)
{
for
(
String
location
:
locations
)
{
for
(
Resource
resource
:
doGetResources
(
location
))
{
for
(
Resource
resource
:
doGetResources
(
location
))
{
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsProperties.java
View file @
6121208c
...
@@ -130,6 +130,7 @@ public class JmsProperties {
...
@@ -130,6 +130,7 @@ public class JmsProperties {
?
this
.
concurrency
+
"-"
+
this
.
maxConcurrency
?
this
.
concurrency
+
"-"
+
this
.
maxConcurrency
:
String
.
valueOf
(
this
.
concurrency
));
:
String
.
valueOf
(
this
.
concurrency
));
}
}
}
}
public
static
class
Template
{
public
static
class
Template
{
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jooq/JooqExceptionTranslator.java
View file @
6121208c
...
@@ -30,8 +30,8 @@ import org.springframework.jdbc.support.SQLExceptionTranslator;
...
@@ -30,8 +30,8 @@ import org.springframework.jdbc.support.SQLExceptionTranslator;
import
org.springframework.jdbc.support.SQLStateSQLExceptionTranslator
;
import
org.springframework.jdbc.support.SQLStateSQLExceptionTranslator
;
/**
/**
* Transforms {@link java.sql.SQLException} into a Spring-specific
{@link
* Transforms {@link java.sql.SQLException} into a Spring-specific
* DataAccessException}.
*
{@link
DataAccessException}.
*
*
* @author Lukas Eder
* @author Lukas Eder
* @author Andreas Ahlenstorf
* @author Andreas Ahlenstorf
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.java
View file @
6121208c
...
@@ -56,7 +56,8 @@ public class ValidationAutoConfiguration {
...
@@ -56,7 +56,8 @@ public class ValidationAutoConfiguration {
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
public
MethodValidationPostProcessor
methodValidationPostProcessor
(
Validator
validator
)
{
public
MethodValidationPostProcessor
methodValidationPostProcessor
(
Validator
validator
)
{
MethodValidationPostProcessor
processor
=
new
MethodValidationPostProcessor
();
MethodValidationPostProcessor
processor
=
new
MethodValidationPostProcessor
();
processor
.
setValidator
(
validator
);
processor
.
setValidator
(
validator
);
return
processor
;
return
processor
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java
View file @
6121208c
...
@@ -1554,6 +1554,7 @@ public class ServerProperties
...
@@ -1554,6 +1554,7 @@ public class ServerProperties
public
void
setRotate
(
boolean
rotate
)
{
public
void
setRotate
(
boolean
rotate
)
{
this
.
rotate
=
rotate
;
this
.
rotate
=
rotate
;
}
}
}
}
}
}
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceInitializerTests.java
View file @
6121208c
...
@@ -297,9 +297,8 @@ public class DataSourceInitializerTests {
...
@@ -297,9 +297,8 @@ public class DataSourceInitializerTests {
PropertyPlaceholderAutoConfiguration
.
class
);
PropertyPlaceholderAutoConfiguration
.
class
);
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"spring.datasource.initialize:true"
,
"spring.datasource.initialize:true"
,
"spring.datasource.schema:"
"spring.datasource.schema:"
+
ClassUtils
+
ClassUtils
.
addResourcePathToPackagePath
(
getClass
(),
.
addResourcePathToPackagePath
(
getClass
(),
"schema.sql"
),
"schema.sql"
),
"spring.datasource.data:classpath:does/not/exist.sql"
);
"spring.datasource.data:classpath:does/not/exist.sql"
);
this
.
thrown
.
expect
(
BeanCreationException
.
class
);
this
.
thrown
.
expect
(
BeanCreationException
.
class
);
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationTests.java
View file @
6121208c
...
@@ -67,14 +67,15 @@ public class ValidationAutoConfigurationTests {
...
@@ -67,14 +67,15 @@ public class ValidationAutoConfigurationTests {
public
void
userDefinedMethodValidationPostProcessorTakesPrecedence
()
{
public
void
userDefinedMethodValidationPostProcessorTakesPrecedence
()
{
load
(
SampleConfiguration
.
class
);
load
(
SampleConfiguration
.
class
);
assertThat
(
this
.
context
.
getBeansOfType
(
Validator
.
class
)).
hasSize
(
1
);
assertThat
(
this
.
context
.
getBeansOfType
(
Validator
.
class
)).
hasSize
(
1
);
Object
userMethodValidationPostProcessor
=
Object
userMethodValidationPostProcessor
=
this
.
context
this
.
context
.
getBean
(
"testMethodValidationPostProcessor"
);
.
getBean
(
"testMethodValidationPostProcessor"
);
assertThat
(
this
.
context
.
getBean
(
MethodValidationPostProcessor
.
class
))
assertThat
(
this
.
context
.
getBean
(
MethodValidationPostProcessor
.
class
))
.
isSameAs
(
userMethodValidationPostProcessor
);
.
isSameAs
(
userMethodValidationPostProcessor
);
assertThat
(
this
.
context
.
getBeansOfType
(
MethodValidationPostProcessor
.
class
))
assertThat
(
this
.
context
.
getBeansOfType
(
MethodValidationPostProcessor
.
class
))
.
hasSize
(
1
);
.
hasSize
(
1
);
assertThat
(
this
.
context
.
getBean
(
Validator
.
class
)).
isNotSameAs
(
assertThat
(
this
.
context
.
getBean
(
Validator
.
class
))
new
DirectFieldAccessor
(
userMethodValidationPostProcessor
).
getPropertyValue
(
"validator"
));
.
isNotSameAs
(
new
DirectFieldAccessor
(
userMethodValidationPostProcessor
)
.
getPropertyValue
(
"validator"
));
}
}
public
void
load
(
Class
<?>
config
)
{
public
void
load
(
Class
<?>
config
)
{
...
...
spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/DependencyResolutionContextTests.java
View file @
6121208c
...
@@ -36,7 +36,8 @@ public class DependencyResolutionContextTests {
...
@@ -36,7 +36,8 @@ public class DependencyResolutionContextTests {
@Test
@Test
public
void
canAddSpringBootDependencies
()
{
public
void
canAddSpringBootDependencies
()
{
DependencyResolutionContext
dependencyResolutionContext
=
new
DependencyResolutionContext
();
DependencyResolutionContext
dependencyResolutionContext
=
new
DependencyResolutionContext
();
dependencyResolutionContext
.
addDependencyManagement
(
new
SpringBootDependenciesDependencyManagement
());
dependencyResolutionContext
.
addDependencyManagement
(
new
SpringBootDependenciesDependencyManagement
());
assertThat
(
dependencyResolutionContext
.
getManagedDependencies
()).
isNotEmpty
();
assertThat
(
dependencyResolutionContext
.
getManagedDependencies
()).
isNotEmpty
();
}
}
...
...
spring-boot-samples/spring-boot-sample-hypermedia-gson/src/test/java/sample/hypermedia/gson/SampleHypermediaGsonApplicationTests.java
View file @
6121208c
...
@@ -35,7 +35,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
...
@@ -35,7 +35,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
@SpringBootTest
@TestPropertySource
(
properties
=
{
"endpoints.hypermedia.enabled: true"
,
"management.security.enabled: false"
})
@TestPropertySource
(
properties
=
{
"endpoints.hypermedia.enabled: true"
,
"management.security.enabled: false"
})
public
class
SampleHypermediaGsonApplicationTests
{
public
class
SampleHypermediaGsonApplicationTests
{
@Autowired
@Autowired
...
...
spring-boot-samples/spring-boot-sample-web-method-security/src/main/java/sample/security/method/SampleMethodSecurityApplication.java
View file @
6121208c
...
@@ -73,8 +73,8 @@ public class SampleMethodSecurityApplication extends WebMvcConfigurerAdapter {
...
@@ -73,8 +73,8 @@ public class SampleMethodSecurityApplication extends WebMvcConfigurerAdapter {
@Override
@Override
public
void
init
(
AuthenticationManagerBuilder
auth
)
throws
Exception
{
public
void
init
(
AuthenticationManagerBuilder
auth
)
throws
Exception
{
auth
.
inMemoryAuthentication
().
withUser
(
"admin"
).
password
(
"admin"
)
auth
.
inMemoryAuthentication
().
withUser
(
"admin"
).
password
(
"admin"
)
.
roles
(
"ADMIN"
,
"USER"
,
"ACTUATOR"
).
and
().
withUser
(
"user"
)
.
password
(
"user"
)
.
roles
(
"ADMIN"
,
"USER"
,
"ACTUATOR"
).
and
().
withUser
(
"user"
)
.
roles
(
"USER"
);
.
password
(
"user"
).
roles
(
"USER"
);
}
}
}
}
...
...
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/AutoConfigureJdbc.java
View file @
6121208c
...
@@ -25,9 +25,9 @@ import java.lang.annotation.Target;
...
@@ -25,9 +25,9 @@ import java.lang.annotation.Target;
import
org.springframework.boot.autoconfigure.ImportAutoConfiguration
;
import
org.springframework.boot.autoconfigure.ImportAutoConfiguration
;
/**
/**
* {@link ImportAutoConfiguration Auto-configuration imports} for typical jdbc tests.
* {@link ImportAutoConfiguration Auto-configuration imports} for typical jdbc tests.
Most
*
Most tests should consider using {@link JdbcTest @JdbcTest} rather than using
*
tests should consider using {@link JdbcTest @JdbcTest} rather than using this
*
this
annotation directly.
* annotation directly.
*
*
* @author Stephane Nicoll
* @author Stephane Nicoll
* @since 1.5.0
* @since 1.5.0
...
@@ -38,4 +38,5 @@ import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
...
@@ -38,4 +38,5 @@ import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
@Documented
@Documented
@ImportAutoConfiguration
@ImportAutoConfiguration
public
@interface
AutoConfigureJdbc
{
public
@interface
AutoConfigureJdbc
{
}
}
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTypeExcludeFilter.java
View file @
6121208c
...
@@ -49,10 +49,10 @@ class JdbcTypeExcludeFilter extends AnnotationCustomizableTypeExcludeFilter {
...
@@ -49,10 +49,10 @@ class JdbcTypeExcludeFilter extends AnnotationCustomizableTypeExcludeFilter {
@Override
@Override
protected
ComponentScan
.
Filter
[]
getFilters
(
FilterType
type
)
{
protected
ComponentScan
.
Filter
[]
getFilters
(
FilterType
type
)
{
switch
(
type
)
{
switch
(
type
)
{
case
INCLUDE:
case
INCLUDE:
return
this
.
annotation
.
includeFilters
();
return
this
.
annotation
.
includeFilters
();
case
EXCLUDE:
case
EXCLUDE:
return
this
.
annotation
.
excludeFilters
();
return
this
.
annotation
.
excludeFilters
();
}
}
throw
new
IllegalStateException
(
"Unsupported type "
+
type
);
throw
new
IllegalStateException
(
"Unsupported type "
+
type
);
}
}
...
...
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/AutoConfigureTestDatabase.java
View file @
6121208c
...
@@ -34,7 +34,8 @@ import org.springframework.boot.test.autoconfigure.properties.PropertyMapping;
...
@@ -34,7 +34,8 @@ import org.springframework.boot.test.autoconfigure.properties.PropertyMapping;
* instead of any application defined or auto-configured {@link DataSource}.
* instead of any application defined or auto-configured {@link DataSource}.
*
*
* @author Stephane Nicoll
* @author Stephane Nicoll
* @deprecated since 1.5 in favour of {@link org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase}
* @deprecated since 1.5 in favour of
* {@link org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase}
*/
*/
@Target
({
ElementType
.
TYPE
,
ElementType
.
METHOD
})
@Target
({
ElementType
.
TYPE
,
ElementType
.
METHOD
})
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
...
...
spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/AutoConfigureTestDatabaseWithMultipleDatasourcesIntegrationTests.java
View file @
6121208c
...
@@ -62,16 +62,14 @@ public class AutoConfigureTestDatabaseWithMultipleDatasourcesIntegrationTests {
...
@@ -62,16 +62,14 @@ public class AutoConfigureTestDatabaseWithMultipleDatasourcesIntegrationTests {
@Primary
@Primary
public
DataSource
dataSource
()
{
public
DataSource
dataSource
()
{
EmbeddedDatabaseBuilder
builder
=
new
EmbeddedDatabaseBuilder
()
EmbeddedDatabaseBuilder
builder
=
new
EmbeddedDatabaseBuilder
()
.
generateUniqueName
(
true
)
.
generateUniqueName
(
true
).
setType
(
EmbeddedDatabaseType
.
HSQL
);
.
setType
(
EmbeddedDatabaseType
.
HSQL
);
return
builder
.
build
();
return
builder
.
build
();
}
}
@Bean
@Bean
public
DataSource
secondaryDataSource
()
{
public
DataSource
secondaryDataSource
()
{
EmbeddedDatabaseBuilder
builder
=
new
EmbeddedDatabaseBuilder
()
EmbeddedDatabaseBuilder
builder
=
new
EmbeddedDatabaseBuilder
()
.
generateUniqueName
(
true
)
.
generateUniqueName
(
true
).
setType
(
EmbeddedDatabaseType
.
HSQL
);
.
setType
(
EmbeddedDatabaseType
.
HSQL
);
return
builder
.
build
();
return
builder
.
build
();
}
}
...
...
spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/ExampleJdbcApplication.java
View file @
6121208c
...
@@ -34,8 +34,7 @@ public class ExampleJdbcApplication {
...
@@ -34,8 +34,7 @@ public class ExampleJdbcApplication {
@Bean
@Bean
public
DataSource
dataSource
()
{
public
DataSource
dataSource
()
{
EmbeddedDatabaseBuilder
builder
=
new
EmbeddedDatabaseBuilder
()
EmbeddedDatabaseBuilder
builder
=
new
EmbeddedDatabaseBuilder
()
.
generateUniqueName
(
true
)
.
generateUniqueName
(
true
).
setType
(
EmbeddedDatabaseType
.
HSQL
);
.
setType
(
EmbeddedDatabaseType
.
HSQL
);
return
builder
.
build
();
return
builder
.
build
();
}
}
...
...
spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/ExampleRepository.java
View file @
6121208c
...
@@ -49,8 +49,9 @@ public class ExampleRepository {
...
@@ -49,8 +49,9 @@ public class ExampleRepository {
}
}
public
ExampleEntity
findById
(
int
id
)
{
public
ExampleEntity
findById
(
int
id
)
{
return
this
.
jdbcTemplate
.
queryForObject
(
"select id, name from example where id =?"
,
return
this
.
jdbcTemplate
.
queryForObject
(
new
Object
[]
{
id
},
ROW_MAPPER
);
"select id, name from example where id =?"
,
new
Object
[]
{
id
},
ROW_MAPPER
);
}
}
public
Collection
<
ExampleEntity
>
findAll
()
{
public
Collection
<
ExampleEntity
>
findAll
()
{
...
@@ -65,6 +66,7 @@ public class ExampleRepository {
...
@@ -65,6 +66,7 @@ public class ExampleRepository {
String
name
=
rs
.
getString
(
"name"
);
String
name
=
rs
.
getString
(
"name"
);
return
new
ExampleEntity
(
id
,
name
);
return
new
ExampleEntity
(
id
,
name
);
}
}
}
}
}
}
spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTestWithAutoConfigureTestDatabaseReplaceExplicitIntegrationTests.java
View file @
6121208c
...
@@ -61,8 +61,7 @@ public class JdbcTestWithAutoConfigureTestDatabaseReplaceExplicitIntegrationTest
...
@@ -61,8 +61,7 @@ public class JdbcTestWithAutoConfigureTestDatabaseReplaceExplicitIntegrationTest
@Bean
@Bean
public
DataSource
dataSource
()
{
public
DataSource
dataSource
()
{
EmbeddedDatabaseBuilder
builder
=
new
EmbeddedDatabaseBuilder
()
EmbeddedDatabaseBuilder
builder
=
new
EmbeddedDatabaseBuilder
()
.
generateUniqueName
(
true
)
.
generateUniqueName
(
true
).
setType
(
EmbeddedDatabaseType
.
H2
);
.
setType
(
EmbeddedDatabaseType
.
H2
);
return
builder
.
build
();
return
builder
.
build
();
}
}
...
...
spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTestWithAutoConfigureTestDatabaseReplacePropertyAnyIntegrationTests.java
View file @
6121208c
...
@@ -63,8 +63,7 @@ public class JdbcTestWithAutoConfigureTestDatabaseReplacePropertyAnyIntegrationT
...
@@ -63,8 +63,7 @@ public class JdbcTestWithAutoConfigureTestDatabaseReplacePropertyAnyIntegrationT
@Bean
@Bean
public
DataSource
dataSource
()
{
public
DataSource
dataSource
()
{
EmbeddedDatabaseBuilder
builder
=
new
EmbeddedDatabaseBuilder
()
EmbeddedDatabaseBuilder
builder
=
new
EmbeddedDatabaseBuilder
()
.
generateUniqueName
(
true
)
.
generateUniqueName
(
true
).
setType
(
EmbeddedDatabaseType
.
H2
);
.
setType
(
EmbeddedDatabaseType
.
H2
);
return
builder
.
build
();
return
builder
.
build
();
}
}
...
...
spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/TestDatabaseAutoConfigurationTests.java
View file @
6121208c
...
@@ -93,8 +93,7 @@ public class TestDatabaseAutoConfigurationTests {
...
@@ -93,8 +93,7 @@ public class TestDatabaseAutoConfigurationTests {
@Bean
@Bean
public
DataSource
dataSource
()
{
public
DataSource
dataSource
()
{
EmbeddedDatabaseBuilder
builder
=
new
EmbeddedDatabaseBuilder
()
EmbeddedDatabaseBuilder
builder
=
new
EmbeddedDatabaseBuilder
()
.
generateUniqueName
(
true
)
.
generateUniqueName
(
true
).
setType
(
EmbeddedDatabaseType
.
HSQL
);
.
setType
(
EmbeddedDatabaseType
.
HSQL
);
return
builder
.
build
();
return
builder
.
build
();
}
}
...
...
spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTestWithAutoConfigureTestDatabaseReplaceExplicitIntegrationTests.java
View file @
6121208c
...
@@ -76,8 +76,7 @@ public class DataJpaTestWithAutoConfigureTestDatabaseReplaceExplicitIntegrationT
...
@@ -76,8 +76,7 @@ public class DataJpaTestWithAutoConfigureTestDatabaseReplaceExplicitIntegrationT
@Bean
@Bean
public
DataSource
dataSource
()
{
public
DataSource
dataSource
()
{
EmbeddedDatabaseBuilder
builder
=
new
EmbeddedDatabaseBuilder
()
EmbeddedDatabaseBuilder
builder
=
new
EmbeddedDatabaseBuilder
()
.
generateUniqueName
(
true
)
.
generateUniqueName
(
true
).
setType
(
EmbeddedDatabaseType
.
H2
);
.
setType
(
EmbeddedDatabaseType
.
H2
);
return
builder
.
build
();
return
builder
.
build
();
}
}
...
...
spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/ExampleDataJpaApplication.java
View file @
6121208c
...
@@ -34,8 +34,7 @@ public class ExampleDataJpaApplication {
...
@@ -34,8 +34,7 @@ public class ExampleDataJpaApplication {
@Bean
@Bean
public
DataSource
dataSource
()
{
public
DataSource
dataSource
()
{
EmbeddedDatabaseBuilder
builder
=
new
EmbeddedDatabaseBuilder
()
EmbeddedDatabaseBuilder
builder
=
new
EmbeddedDatabaseBuilder
()
.
generateUniqueName
(
true
)
.
generateUniqueName
(
true
).
setType
(
EmbeddedDatabaseType
.
HSQL
);
.
setType
(
EmbeddedDatabaseType
.
HSQL
);
return
builder
.
build
();
return
builder
.
build
();
}
}
...
...
spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTestAllControllersIntegrationTests.java
View file @
6121208c
...
@@ -68,8 +68,7 @@ public class WebMvcTestAllControllersIntegrationTests {
...
@@ -68,8 +68,7 @@ public class WebMvcTestAllControllersIntegrationTests {
@Test
@Test
public
void
shouldRunValidationSuccess
()
throws
Exception
{
public
void
shouldRunValidationSuccess
()
throws
Exception
{
this
.
mvc
.
perform
(
get
(
"/three/OK"
))
this
.
mvc
.
perform
(
get
(
"/three/OK"
)).
andExpect
(
status
().
isOk
())
.
andExpect
(
status
().
isOk
())
.
andExpect
(
content
().
string
(
"Hello OK"
));
.
andExpect
(
content
().
string
(
"Hello OK"
));
}
}
...
...
spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeElementMembers.java
View file @
6121208c
...
@@ -59,7 +59,8 @@ class TypeElementMembers {
...
@@ -59,7 +59,8 @@ class TypeElementMembers {
private
final
FieldValuesParser
fieldValuesParser
;
private
final
FieldValuesParser
fieldValuesParser
;
TypeElementMembers
(
ProcessingEnvironment
env
,
FieldValuesParser
fieldValuesParser
,
TypeElement
element
)
{
TypeElementMembers
(
ProcessingEnvironment
env
,
FieldValuesParser
fieldValuesParser
,
TypeElement
element
)
{
this
.
env
=
env
;
this
.
env
=
env
;
this
.
typeUtils
=
new
TypeUtils
(
this
.
env
);
this
.
typeUtils
=
new
TypeUtils
(
this
.
env
);
this
.
fieldValuesParser
=
fieldValuesParser
;
this
.
fieldValuesParser
=
fieldValuesParser
;
...
...
spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java
View file @
6121208c
...
@@ -357,10 +357,18 @@ public class ConfigurationMetadataAnnotationProcessorTests {
...
@@ -357,10 +357,18 @@ public class ConfigurationMetadataAnnotationProcessorTests {
ConfigurationMetadata
metadata
=
compile
(
ClassWithNestedProperties
.
class
);
ConfigurationMetadata
metadata
=
compile
(
ClassWithNestedProperties
.
class
);
assertThat
(
metadata
).
has
(
Metadata
.
withGroup
(
"nestedChildProps"
)
assertThat
(
metadata
).
has
(
Metadata
.
withGroup
(
"nestedChildProps"
)
.
fromSource
(
ClassWithNestedProperties
.
NestedChildClass
.
class
));
.
fromSource
(
ClassWithNestedProperties
.
NestedChildClass
.
class
));
assertThat
(
metadata
).
has
(
Metadata
.
withProperty
(
"nestedChildProps.child-class-property"
,
Integer
.
class
)
assertThat
(
metadata
)
.
fromSource
(
ClassWithNestedProperties
.
NestedChildClass
.
class
).
withDefaultValue
(
20
));
.
has
(
Metadata
assertThat
(
metadata
).
has
(
Metadata
.
withProperty
(
"nestedChildProps.parent-class-property"
,
Integer
.
class
)
.
withProperty
(
"nestedChildProps.child-class-property"
,
.
fromSource
(
ClassWithNestedProperties
.
NestedChildClass
.
class
).
withDefaultValue
(
10
));
Integer
.
class
)
.
fromSource
(
ClassWithNestedProperties
.
NestedChildClass
.
class
)
.
withDefaultValue
(
20
));
assertThat
(
metadata
)
.
has
(
Metadata
.
withProperty
(
"nestedChildProps.parent-class-property"
,
Integer
.
class
)
.
fromSource
(
ClassWithNestedProperties
.
NestedChildClass
.
class
)
.
withDefaultValue
(
10
));
}
}
@Test
@Test
...
...
spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/method/DeprecatedMethodConfig.java
View file @
6121208c
...
@@ -52,6 +52,7 @@ public class DeprecatedMethodConfig {
...
@@ -52,6 +52,7 @@ public class DeprecatedMethodConfig {
public
void
setFlag
(
boolean
flag
)
{
public
void
setFlag
(
boolean
flag
)
{
this
.
flag
=
flag
;
this
.
flag
=
flag
;
}
}
}
}
}
}
spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/simple/ClassWithNestedProperties.java
View file @
6121208c
...
@@ -36,6 +36,7 @@ public class ClassWithNestedProperties {
...
@@ -36,6 +36,7 @@ public class ClassWithNestedProperties {
public
void
setParentClassProperty
(
int
parentClassProperty
)
{
public
void
setParentClassProperty
(
int
parentClassProperty
)
{
this
.
parentClassProperty
=
parentClassProperty
;
this
.
parentClassProperty
=
parentClassProperty
;
}
}
}
}
@ConfigurationProperties
(
prefix
=
"nestedChildProps"
)
@ConfigurationProperties
(
prefix
=
"nestedChildProps"
)
...
@@ -50,5 +51,7 @@ public class ClassWithNestedProperties {
...
@@ -50,5 +51,7 @@ public class ClassWithNestedProperties {
public
void
setChildClassProperty
(
int
childClassProperty
)
{
public
void
setChildClassProperty
(
int
childClassProperty
)
{
this
.
childClassProperty
=
childClassProperty
;
this
.
childClassProperty
=
childClassProperty
;
}
}
}
}
}
}
spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/MainClassFinder.java
View file @
6121208c
...
@@ -392,7 +392,6 @@ public abstract class MainClassFinder {
...
@@ -392,7 +392,6 @@ public abstract class MainClassFinder {
* Creates a new {@code MainClass} rather represents the main class with the given
* Creates a new {@code MainClass} rather represents the main class with the given
* {@code name}. The class is annotated with the annotations with the given
* {@code name}. The class is annotated with the annotations with the given
* {@code annotationNames}.
* {@code annotationNames}.
*
* @param name the name of the class
* @param name the name of the class
* @param annotationNames the names of the annotations on the class
* @param annotationNames the names of the annotations on the class
*/
*/
...
...
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/ExplodedArchive.java
View file @
6121208c
...
@@ -65,7 +65,8 @@ public class ExplodedArchive implements Archive {
...
@@ -65,7 +65,8 @@ public class ExplodedArchive implements Archive {
* Create a new {@link ExplodedArchive} instance.
* Create a new {@link ExplodedArchive} instance.
* @param root the root folder
* @param root the root folder
* @param recursive if recursive searching should be used to locate the manifest.
* @param recursive if recursive searching should be used to locate the manifest.
* Defaults to {@code true}, folders with a large tree might want to set this to {@code
* Defaults to {@code true}, folders with a large tree might want to set this to
* {@code
* false}.
* false}.
*/
*/
public
ExplodedArchive
(
File
root
,
boolean
recursive
)
{
public
ExplodedArchive
(
File
root
,
boolean
recursive
)
{
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactory.java
View file @
6121208c
...
@@ -412,8 +412,8 @@ public class UndertowEmbeddedServletContainerFactory
...
@@ -412,8 +412,8 @@ public class UndertowEmbeddedServletContainerFactory
String
prefix
=
(
this
.
accessLogPrefix
!=
null
?
this
.
accessLogPrefix
String
prefix
=
(
this
.
accessLogPrefix
!=
null
?
this
.
accessLogPrefix
:
"access_log."
);
:
"access_log."
);
AccessLogReceiver
accessLogReceiver
=
new
DefaultAccessLogReceiver
(
AccessLogReceiver
accessLogReceiver
=
new
DefaultAccessLogReceiver
(
createWorker
(),
this
.
accessLogDirectory
,
prefix
,
createWorker
(),
this
.
accessLogDirectory
,
prefix
,
this
.
accessLogSuffix
,
this
.
accessLog
Suffix
,
this
.
accessLog
Rotate
);
this
.
accessLogRotate
);
String
formatString
=
(
this
.
accessLogPattern
!=
null
)
?
this
.
accessLogPattern
String
formatString
=
(
this
.
accessLogPattern
!=
null
)
?
this
.
accessLogPattern
:
"common"
;
:
"common"
;
return
new
AccessLogHandler
(
handler
,
accessLogReceiver
,
formatString
,
return
new
AccessLogHandler
(
handler
,
accessLogReceiver
,
formatString
,
...
...
spring-boot/src/main/java/org/springframework/boot/jdbc/DatabaseDriver.java
View file @
6121208c
...
@@ -164,7 +164,7 @@ public enum DatabaseDriver {
...
@@ -164,7 +164,7 @@ public enum DatabaseDriver {
* Informix.
* Informix.
*/
*/
INFORMIX
(
"informix"
,
"Informix Dynamic Server"
,
"com.informix.jdbc.IfxDriver"
,
null
,
INFORMIX
(
"informix"
,
"Informix Dynamic Server"
,
"com.informix.jdbc.IfxDriver"
,
null
,
"select count(*) from systables"
)
{
"select count(*) from systables"
)
{
@Override
@Override
protected
Collection
<
String
>
getUrlPrefixes
()
{
protected
Collection
<
String
>
getUrlPrefixes
()
{
...
...
spring-boot/src/main/java/org/springframework/boot/logging/AbstractLoggingSystem.java
View file @
6121208c
...
@@ -184,6 +184,7 @@ public abstract class AbstractLoggingSystem extends LoggingSystem {
...
@@ -184,6 +184,7 @@ public abstract class AbstractLoggingSystem extends LoggingSystem {
/**
/**
* Maintains a mapping between native levels and {@link LogLevel}.
* Maintains a mapping between native levels and {@link LogLevel}.
*
* @param <T> The native level type
* @param <T> The native level type
*/
*/
protected
static
class
LogLevels
<
T
>
{
protected
static
class
LogLevels
<
T
>
{
...
...
spring-boot/src/main/java/org/springframework/boot/logging/LoggingSystem.java
View file @
6121208c
...
@@ -48,9 +48,9 @@ public abstract class LoggingSystem {
...
@@ -48,9 +48,9 @@ public abstract class LoggingSystem {
public
static
final
String
NONE
=
"none"
;
public
static
final
String
NONE
=
"none"
;
/**
/**
* The name used for the root logger. LoggingSystem implementations should ensure
* The name used for the root logger. LoggingSystem implementations should ensure
that
* th
at this is the name used to represent the root logger, regardless of the
* th
is is the name used to represent the root logger, regardless of the underlying
*
underlying
implementation.
* implementation.
*/
*/
public
static
final
String
ROOT_LOGGER_NAME
=
"ROOT"
;
public
static
final
String
ROOT_LOGGER_NAME
=
"ROOT"
;
...
...
spring-boot/src/main/java/org/springframework/boot/orm/jpa/hibernate/SpringPhysicalNamingStrategy.java
View file @
6121208c
...
@@ -75,16 +75,15 @@ public class SpringPhysicalNamingStrategy implements PhysicalNamingStrategy {
...
@@ -75,16 +75,15 @@ public class SpringPhysicalNamingStrategy implements PhysicalNamingStrategy {
}
}
String
text
=
builder
.
toString
();
String
text
=
builder
.
toString
();
String
finalText
=
isCaseInsensitive
(
jdbcEnvironment
)
?
text
.
toLowerCase
(
Locale
.
ROOT
)
String
finalText
=
isCaseInsensitive
(
jdbcEnvironment
)
:
text
;
?
text
.
toLowerCase
(
Locale
.
ROOT
)
:
text
;
return
new
Identifier
(
finalText
,
name
.
isQuoted
());
return
new
Identifier
(
finalText
,
name
.
isQuoted
());
}
}
/**
/**
* Specify whether the database is case sensitive.
* Specify whether the database is case sensitive.
* @param jdbcEnvironment The JDBC environment which can be used to determine case
* @param jdbcEnvironment The JDBC environment which can be used to determine case
* @return true if the database is case insensitive
* @return true if the database is case insensitive sensitivity
* sensitivity
*/
*/
protected
boolean
isCaseInsensitive
(
JdbcEnvironment
jdbcEnvironment
)
{
protected
boolean
isCaseInsensitive
(
JdbcEnvironment
jdbcEnvironment
)
{
return
true
;
return
true
;
...
...
spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesTests.java
View file @
6121208c
...
@@ -699,6 +699,7 @@ public class EnableConfigurationPropertiesTests {
...
@@ -699,6 +699,7 @@ public class EnableConfigurationPropertiesTests {
}
}
// No getter - you should be able to bind to a write-only bean
// No getter - you should be able to bind to a write-only bean
}
}
// No annotation
// No annotation
...
...
spring-boot/src/test/java/org/springframework/boot/logging/java/JavaLoggingSystemTests.java
View file @
6121208c
...
@@ -176,7 +176,8 @@ public class JavaLoggingSystemTests extends AbstractLoggingSystemTests {
...
@@ -176,7 +176,8 @@ public class JavaLoggingSystemTests extends AbstractLoggingSystemTests {
List
<
LoggerConfiguration
>
configurations
=
this
.
loggingSystem
List
<
LoggerConfiguration
>
configurations
=
this
.
loggingSystem
.
getLoggerConfigurations
();
.
getLoggerConfigurations
();
assertThat
(
configurations
).
isNotEmpty
();
assertThat
(
configurations
).
isNotEmpty
();
assertThat
(
configurations
.
get
(
0
).
getName
()).
isEqualTo
(
LoggingSystem
.
ROOT_LOGGER_NAME
);
assertThat
(
configurations
.
get
(
0
).
getName
())
.
isEqualTo
(
LoggingSystem
.
ROOT_LOGGER_NAME
);
}
}
@Test
@Test
...
...
spring-boot/src/test/java/org/springframework/boot/orm/jpa/hibernate/SpringPhysicalNamingStrategyTests.java
View file @
6121208c
...
@@ -70,13 +70,14 @@ public class SpringPhysicalNamingStrategyTests {
...
@@ -70,13 +70,14 @@ public class SpringPhysicalNamingStrategyTests {
@Test
@Test
public
void
tableNameShouldNotBeLowerCaseIfCaseSensitive
()
throws
Exception
{
public
void
tableNameShouldNotBeLowerCaseIfCaseSensitive
()
throws
Exception
{
this
.
metadata
=
this
.
metadataSources
.
getMetadataBuilder
(
this
.
serviceRegistry
)
this
.
metadata
=
this
.
metadataSources
.
getMetadataBuilder
(
this
.
serviceRegistry
)
.
applyPhysicalNamingStrategy
(
new
TestSpringPhysicalNamingStrategy
()).
build
();
.
applyPhysicalNamingStrategy
(
new
TestSpringPhysicalNamingStrategy
())
.
build
();
PersistentClass
binding
=
this
.
metadata
PersistentClass
binding
=
this
.
metadata
.
getEntityBinding
(
TelephoneNumber
.
class
.
getName
());
.
getEntityBinding
(
TelephoneNumber
.
class
.
getName
());
assertThat
(
binding
.
getTable
().
getQuotedName
()).
isEqualTo
(
"Telephone_Number"
);
assertThat
(
binding
.
getTable
().
getQuotedName
()).
isEqualTo
(
"Telephone_Number"
);
}
}
private
class
TestSpringPhysicalNamingStrategy
extends
SpringPhysicalNamingStrategy
{
private
class
TestSpringPhysicalNamingStrategy
extends
SpringPhysicalNamingStrategy
{
@Override
@Override
protected
boolean
isCaseInsensitive
(
JdbcEnvironment
jdbcEnvironment
)
{
protected
boolean
isCaseInsensitive
(
JdbcEnvironment
jdbcEnvironment
)
{
...
@@ -84,4 +85,5 @@ public class SpringPhysicalNamingStrategyTests {
...
@@ -84,4 +85,5 @@ public class SpringPhysicalNamingStrategyTests {
}
}
}
}
}
}
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