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
f276ff4b
Commit
f276ff4b
authored
Jan 28, 2016
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
9065ddd8
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
57 additions
and
47 deletions
+57
-47
OpenTsdbGaugeWriter.java
...rk/boot/actuate/metrics/opentsdb/OpenTsdbGaugeWriter.java
+2
-2
JobLauncherCommandLineRunner.java
...oot/autoconfigure/batch/JobLauncherCommandLineRunner.java
+2
-1
ElasticsearchAutoConfiguration.java
...re/data/elasticsearch/ElasticsearchAutoConfiguration.java
+2
-1
DataSourceAutoConfiguration.java
.../boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java
+9
-8
DataSourceProperties.java
...amework/boot/autoconfigure/jdbc/DataSourceProperties.java
+0
-1
AutoConfigurationReportLoggingInitializer.java
...re/logging/AutoConfigurationReportLoggingInitializer.java
+1
-2
AuthenticationManagerConfiguration.java
...onfigure/security/AuthenticationManagerConfiguration.java
+2
-2
SendGridAutoConfiguration.java
...oot/autoconfigure/sendgrid/SendGridAutoConfiguration.java
+2
-5
JspTemplateAvailabilityProvider.java
...ot/autoconfigure/web/JspTemplateAvailabilityProvider.java
+14
-8
SendGridAutoConfigurationTests.java
...utoconfigure/sendgrid/SendGridAutoConfigurationTests.java
+2
-1
JspTemplateAvailabilityProviderTests.java
...toconfigure/web/JspTemplateAvailabilityProviderTests.java
+11
-10
DependencyManagementBomTransformation.java
...t/cli/compiler/DependencyManagementBomTransformation.java
+4
-2
FileEncodingApplicationListener.java
...amework/boot/context/FileEncodingApplicationListener.java
+2
-1
ServletListenerRegistrationBean.java
...oot/context/embedded/ServletListenerRegistrationBean.java
+2
-1
LogbackLoggingSystem.java
...gframework/boot/logging/logback/LogbackLoggingSystem.java
+2
-2
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/opentsdb/OpenTsdbGaugeWriter.java
View file @
f276ff4b
...
...
@@ -80,8 +80,8 @@ public class OpenTsdbGaugeWriter implements GaugeWriter {
private
OpenTsdbNamingStrategy
namingStrategy
=
new
DefaultOpenTsdbNamingStrategy
();
/**
* Creates a new {@code OpenTsdbGaugeWriter} with the default connect (10 seconds)
*
and
read (30 seconds) timeouts.
* Creates a new {@code OpenTsdbGaugeWriter} with the default connect (10 seconds)
and
* read (30 seconds) timeouts.
*/
public
OpenTsdbGaugeWriter
()
{
this
(
DEFAULT_CONNECT_TIMEOUT
,
DEFAULT_READ_TIMEOUT
);
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobLauncherCommandLineRunner.java
View file @
f276ff4b
...
...
@@ -66,7 +66,8 @@ import org.springframework.util.StringUtils;
public
class
JobLauncherCommandLineRunner
implements
CommandLineRunner
,
ApplicationEventPublisherAware
{
private
static
final
Log
logger
=
LogFactory
.
getLog
(
JobLauncherCommandLineRunner
.
class
);
private
static
final
Log
logger
=
LogFactory
.
getLog
(
JobLauncherCommandLineRunner
.
class
);
private
JobParametersConverter
converter
=
new
DefaultJobParametersConverter
();
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfiguration.java
View file @
f276ff4b
...
...
@@ -66,7 +66,8 @@ public class ElasticsearchAutoConfiguration implements DisposableBean {
DEFAULTS
=
Collections
.
unmodifiableMap
(
defaults
);
}
private
static
final
Log
logger
=
LogFactory
.
getLog
(
ElasticsearchAutoConfiguration
.
class
);
private
static
final
Log
logger
=
LogFactory
.
getLog
(
ElasticsearchAutoConfiguration
.
class
);
@Autowired
private
ElasticsearchProperties
properties
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java
View file @
f276ff4b
...
...
@@ -68,7 +68,8 @@ import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
@Import
({
Registrar
.
class
,
DataSourcePoolMetadataProvidersConfiguration
.
class
})
public
class
DataSourceAutoConfiguration
{
private
static
final
Log
logger
=
LogFactory
.
getLog
(
DataSourceAutoConfiguration
.
class
);
private
static
final
Log
logger
=
LogFactory
.
getLog
(
DataSourceAutoConfiguration
.
class
);
/**
* Determines if the {@code dataSource} being used by Spring was created from
...
...
@@ -119,7 +120,8 @@ public class DataSourceAutoConfiguration {
DataSourceBuilder
factory
=
DataSourceBuilder
.
create
(
this
.
properties
.
getClassLoader
())
.
driverClassName
(
this
.
properties
.
determineDriverClassName
())
.
url
(
this
.
properties
.
determineUrl
()).
username
(
this
.
properties
.
determineUsername
())
.
url
(
this
.
properties
.
determineUrl
())
.
username
(
this
.
properties
.
determineUsername
())
.
password
(
this
.
properties
.
determinePassword
());
if
(
this
.
properties
.
getType
()
!=
null
)
{
factory
.
type
(
this
.
properties
.
getType
());
...
...
@@ -200,9 +202,8 @@ public class DataSourceAutoConfiguration {
/**
* {@link Condition} to detect when an embedded {@link DataSource} type can be used.
* <p>
* If a pooled {@link DataSource} is available, it will always be preferred to
* an {@code EmbeddedDatabase}.
* If a pooled {@link DataSource} is available, it will always be preferred to an
* {@code EmbeddedDatabase}.
*/
static
class
EmbeddedDatabaseCondition
extends
SpringBootCondition
{
...
...
@@ -212,8 +213,7 @@ public class DataSourceAutoConfiguration {
public
ConditionOutcome
getMatchOutcome
(
ConditionContext
context
,
AnnotatedTypeMetadata
metadata
)
{
if
(
anyMatches
(
context
,
metadata
,
this
.
pooledCondition
))
{
return
ConditionOutcome
.
noMatch
(
"supported DataSource class found"
);
return
ConditionOutcome
.
noMatch
(
"supported DataSource class found"
);
}
EmbeddedDatabaseType
type
=
EmbeddedDatabaseConnection
.
get
(
context
.
getClassLoader
()).
getType
();
...
...
@@ -244,7 +244,8 @@ public class DataSourceAutoConfiguration {
return
ConditionOutcome
.
match
(
"existing bean configured database detected"
);
}
if
(
anyMatches
(
context
,
metadata
,
this
.
pooledCondition
,
this
.
embeddedCondition
))
{
if
(
anyMatches
(
context
,
metadata
,
this
.
pooledCondition
,
this
.
embeddedCondition
))
{
return
ConditionOutcome
.
match
(
"existing auto database detected"
);
}
return
ConditionOutcome
.
noMatch
(
"no existing bean configured database"
);
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceProperties.java
View file @
f276ff4b
...
...
@@ -286,7 +286,6 @@ public class DataSourceProperties
this
.
password
=
password
;
}
/**
* Determine the password to use based on this configuration and the environment.
* @return the password to use
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/AutoConfigurationReportLoggingInitializer.java
View file @
f276ff4b
...
...
@@ -188,8 +188,7 @@ public class AutoConfigurationReportLoggingInitializer
private
void
addLogMessage
(
StringBuilder
message
,
String
source
,
ConditionAndOutcomes
conditionAndOutcomes
)
{
message
.
append
(
String
.
format
(
"%n %s"
,
source
));
message
.
append
(
conditionAndOutcomes
.
isFullMatch
()
?
" matched"
:
" did not match"
)
message
.
append
(
conditionAndOutcomes
.
isFullMatch
()
?
" matched"
:
" did not match"
)
.
append
(
String
.
format
(
"%n"
));
for
(
ConditionAndOutcome
conditionAndOutcome
:
conditionAndOutcomes
)
{
message
.
append
(
" - "
);
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/AuthenticationManagerConfiguration.java
View file @
f276ff4b
...
...
@@ -167,8 +167,8 @@ public class AuthenticationManagerConfiguration {
}
User
user
=
this
.
securityProperties
.
getUser
();
if
(
user
.
isDefaultPassword
())
{
logger
.
info
(
String
.
format
(
"%n%nUsing default security password: %s%n"
,
user
.
getPassword
()));
logger
.
info
(
String
.
format
(
"%n%nUsing default security password: %s%n"
,
user
.
getPassword
()));
}
Set
<
String
>
roles
=
new
LinkedHashSet
<
String
>(
user
.
getRole
());
withUser
(
user
.
getName
()).
password
(
user
.
getPassword
())
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/sendgrid/SendGridAutoConfiguration.java
View file @
f276ff4b
...
...
@@ -64,12 +64,8 @@ public class SendGridAutoConfiguration {
if
(
this
.
properties
.
getApiKey
()
!=
null
)
{
return
new
SendGrid
(
this
.
properties
.
getApiKey
());
}
else
{
return
new
SendGrid
(
this
.
properties
.
getUsername
(),
this
.
properties
.
getPassword
());
return
new
SendGrid
(
this
.
properties
.
getUsername
(),
this
.
properties
.
getPassword
());
}
}
static
class
SendGridPropertyCondition
extends
AnyNestedCondition
{
...
...
@@ -84,5 +80,6 @@ public class SendGridAutoConfiguration {
@ConditionalOnProperty
(
prefix
=
"spring.sendgrid"
,
value
=
"api-key"
)
static
class
SendGridApiKeyProperty
{
}
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/JspTemplateAvailabilityProvider.java
View file @
f276ff4b
...
...
@@ -34,17 +34,23 @@ import org.springframework.util.ClassUtils;
public
class
JspTemplateAvailabilityProvider
implements
TemplateAvailabilityProvider
{
@Override
public
boolean
isTemplateAvailable
(
String
view
,
Environment
environment
,
ClassLoader
classLoader
,
ResourceLoader
resourceLoader
)
{
public
boolean
isTemplateAvailable
(
String
view
,
Environment
environment
,
ClassLoader
classLoader
,
ResourceLoader
resourceLoader
)
{
if
(
ClassUtils
.
isPresent
(
"org.apache.jasper.compiler.JspConfig"
,
classLoader
))
{
String
resourceName
=
getResourceName
(
view
,
environment
);
return
resourceLoader
.
getResource
(
resourceName
).
exists
();
}
return
false
;
}
private
String
getResourceName
(
String
view
,
Environment
environment
)
{
PropertyResolver
resolver
=
new
RelaxedPropertyResolver
(
environment
,
"spring.mvc.view."
);
String
prefix
=
resolver
.
getProperty
(
"prefix"
,
WebMvcAutoConfiguration
.
DEFAULT_PREFIX
);
String
suffix
=
resolver
.
getProperty
(
"suffix"
,
WebMvcAutoConfiguration
.
DEFAULT_SUFFIX
);
return
resourceLoader
.
getResource
(
prefix
+
view
+
suffix
).
exists
();
}
return
false
;
return
prefix
+
view
+
suffix
;
}
}
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/sendgrid/SendGridAutoConfigurationTests.java
View file @
f276ff4b
...
...
@@ -63,7 +63,8 @@ public class SendGridAutoConfigurationTests {
public
void
expectedSendGridBeanCreatedApiKey
()
{
loadContext
(
"spring.sendgrid.apiKey:SG.SECRET-API-KEY"
);
SendGrid
sendGrid
=
this
.
context
.
getBean
(
SendGrid
.
class
);
assertEquals
(
"SG.SECRET-API-KEY"
,
ReflectionTestUtils
.
getField
(
sendGrid
,
"password"
));
assertEquals
(
"SG.SECRET-API-KEY"
,
ReflectionTestUtils
.
getField
(
sendGrid
,
"password"
));
}
@Test
(
expected
=
NoSuchBeanDefinitionException
.
class
)
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/JspTemplateAvailabilityProviderTests.java
View file @
f276ff4b
...
...
@@ -22,8 +22,8 @@ import org.springframework.core.io.DefaultResourceLoader;
import
org.springframework.core.io.ResourceLoader
;
import
org.springframework.mock.env.MockEnvironment
;
import
static
org
.
junit
.
Assert
.
assertFalse
;
import
static
org
.
junit
.
Assert
.
assertT
rue
;
import
static
org
.
hamcrest
.
Matchers
.
equalTo
;
import
static
org
.
junit
.
Assert
.
assertT
hat
;
/**
* Tests for {@link JspTemplateAvailabilityProvider}.
...
...
@@ -40,26 +40,27 @@ public class JspTemplateAvailabilityProviderTests {
@Test
public
void
availabilityOfTemplateThatDoesNotExist
()
{
assertFalse
(
this
.
provider
.
isTemplateAvailable
(
"whatever"
,
this
.
environment
,
getClass
().
getClassLoader
(),
this
.
resourceLoader
));
assertThat
(
isTemplateAvailable
(
"whatever"
),
equalTo
(
false
));
}
@Test
public
void
availabilityOfTemplateWithCustomPrefix
()
{
this
.
environment
.
setProperty
(
"spring.mvc.view.prefix"
,
"classpath:/custom-templates/"
);
assertTrue
(
this
.
provider
.
isTemplateAvailable
(
"custom.jsp"
,
this
.
environment
,
getClass
().
getClassLoader
(),
this
.
resourceLoader
));
assertThat
(
isTemplateAvailable
(
"custom.jsp"
),
equalTo
(
true
));
}
@Test
public
void
availabilityOfTemplateWithCustomSuffix
()
{
this
.
environment
.
setProperty
(
"spring.mvc.view.prefix"
,
"classpath:/custom-templates/"
);
this
.
environment
.
setProperty
(
"spring.mvc.view.prefix"
,
"classpath:/custom-templates/"
);
this
.
environment
.
setProperty
(
"spring.mvc.view.suffix"
,
".jsp"
);
assertThat
(
isTemplateAvailable
(
"suffixed"
),
equalTo
(
true
));
}
assertTrue
(
this
.
provider
.
isTemplateAvailable
(
"suffixed"
,
this
.
environment
,
getClass
().
getClassLoader
(),
this
.
resourceLoader
));
private
boolean
isTemplateAvailable
(
String
view
)
{
return
this
.
provider
.
isTemplateAvailable
(
view
,
this
.
environment
,
getClass
().
getClassLoader
(),
this
.
resourceLoader
);
}
}
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/DependencyManagementBomTransformation.java
View file @
f276ff4b
...
...
@@ -159,8 +159,10 @@ public class DependencyManagementBomTransformation
}
private
void
handleMalformedDependency
(
Expression
expression
)
{
Message
message
=
createSyntaxErrorMessage
(
String
.
format
(
"The string must be of the form \"group:module:version\"%n"
),
expression
);
Message
message
=
createSyntaxErrorMessage
(
String
.
format
(
"The string must be of the form \"group:module:version\"%n"
),
expression
);
getSourceUnit
().
getErrorCollector
().
addErrorAndContinue
(
message
);
}
...
...
spring-boot/src/main/java/org/springframework/boot/context/FileEncodingApplicationListener.java
View file @
f276ff4b
...
...
@@ -46,7 +46,8 @@ import org.springframework.core.Ordered;
public
class
FileEncodingApplicationListener
implements
ApplicationListener
<
ApplicationEnvironmentPreparedEvent
>,
Ordered
{
private
static
final
Log
logger
=
LogFactory
.
getLog
(
FileEncodingApplicationListener
.
class
);
private
static
final
Log
logger
=
LogFactory
.
getLog
(
FileEncodingApplicationListener
.
class
);
@Override
public
int
getOrder
()
{
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/ServletListenerRegistrationBean.java
View file @
f276ff4b
...
...
@@ -59,7 +59,8 @@ import org.springframework.util.ClassUtils;
public
class
ServletListenerRegistrationBean
<
T
extends
EventListener
>
extends
RegistrationBean
{
private
static
final
Log
logger
=
LogFactory
.
getLog
(
ServletListenerRegistrationBean
.
class
);
private
static
final
Log
logger
=
LogFactory
.
getLog
(
ServletListenerRegistrationBean
.
class
);
private
static
final
Set
<
Class
<?>>
SUPPORTED_TYPES
;
...
...
spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystem.java
View file @
f276ff4b
...
...
@@ -150,8 +150,8 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem {
}
}
if
(
errors
.
length
()
>
0
)
{
throw
new
IllegalStateException
(
String
.
format
(
"Logback configuration error detected: %n%s"
,
errors
));
throw
new
IllegalStateException
(
String
.
format
(
"Logback configuration error detected: %n%s"
,
errors
));
}
}
...
...
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