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
661fd848
Commit
661fd848
authored
Jan 25, 2017
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.5.x'
parents
50c1e363
505e7f75
Changes
28
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
56 additions
and
56 deletions
+56
-56
ConfigurationPropertiesReportEndpoint.java
...tuate/endpoint/ConfigurationPropertiesReportEndpoint.java
+2
-2
AbstractMvcEndpoint.java
...mework/boot/actuate/endpoint/mvc/AbstractMvcEndpoint.java
+1
-1
HealthMvcEndpoint.java
...ramework/boot/actuate/endpoint/mvc/HealthMvcEndpoint.java
+1
-1
RabbitProperties.java
...ngframework/boot/autoconfigure/amqp/RabbitProperties.java
+2
-2
CacheCondition.java
...ingframework/boot/autoconfigure/cache/CacheCondition.java
+2
-2
H2ConsoleProperties.java
...gframework/boot/autoconfigure/h2/H2ConsoleProperties.java
+1
-1
SessionCondition.java
...ramework/boot/autoconfigure/session/SessionCondition.java
+1
-1
WebServicesProperties.java
...boot/autoconfigure/webservices/WebServicesProperties.java
+1
-1
DefaultErrorViewResolverTests.java
...boot/autoconfigure/web/DefaultErrorViewResolverTests.java
+2
-2
ArchiveCommand.java
...ingframework/boot/cli/command/archive/ArchiveCommand.java
+2
-2
ExtendedGroovyClassLoader.java
...ramework/boot/cli/compiler/ExtendedGroovyClassLoader.java
+2
-2
RestartClassLoaderTests.java
...devtools/restart/classloader/RestartClassLoaderTests.java
+2
-2
DevToolsSettingsTests.java
...amework/boot/devtools/settings/DevToolsSettingsTests.java
+2
-2
appendix-application-properties.adoc
...cs/src/main/asciidoc/appendix-application-properties.adoc
+3
-3
TestCompiler.java
...org/springframework/boot/junit/compiler/TestCompiler.java
+1
-1
AbstractConfigurationClassTests.java
...k/boot/test/testutil/AbstractConfigurationClassTests.java
+2
-2
MainClassFinder.java
...rg/springframework/boot/loader/tools/MainClassFinder.java
+2
-2
TestJarFile.java
...va/org/springframework/boot/loader/tools/TestJarFile.java
+2
-2
LaunchedURLClassLoader.java
...g/springframework/boot/loader/LaunchedURLClassLoader.java
+3
-3
PropertiesLauncher.java
...a/org/springframework/boot/loader/PropertiesLauncher.java
+2
-2
AsciiBytes.java
.../java/org/springframework/boot/loader/jar/AsciiBytes.java
+1
-1
JarURLConnection.java
...org/springframework/boot/loader/jar/JarURLConnection.java
+3
-3
SystemPropertyUtils.java
...springframework/boot/loader/util/SystemPropertyUtils.java
+3
-3
RelaxedConversionService.java
...g/springframework/boot/bind/RelaxedConversionService.java
+3
-3
RelaxedNames.java
...main/java/org/springframework/boot/bind/RelaxedNames.java
+3
-3
ConfigurationWarningsApplicationContextInitializer.java
...t/ConfigurationWarningsApplicationContextInitializer.java
+3
-3
AbstractLoggingSystem.java
...g/springframework/boot/logging/AbstractLoggingSystem.java
+2
-2
XmlEmbeddedWebApplicationContextTests.java
...ntext/embedded/XmlEmbeddedWebApplicationContextTests.java
+2
-2
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpoint.java
View file @
661fd848
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -234,7 +234,7 @@ public class ConfigurationPropertiesReportEndpoint
...
@@ -234,7 +234,7 @@ public class ConfigurationPropertiesReportEndpoint
private
Map
<
String
,
Object
>
sanitize
(
String
prefix
,
Map
<
String
,
Object
>
map
)
{
private
Map
<
String
,
Object
>
sanitize
(
String
prefix
,
Map
<
String
,
Object
>
map
)
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
map
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
map
.
entrySet
())
{
String
key
=
entry
.
getKey
();
String
key
=
entry
.
getKey
();
String
qualifiedKey
=
(
prefix
.
length
()
==
0
?
prefix
:
prefix
+
"."
)
+
key
;
String
qualifiedKey
=
(
prefix
.
isEmpty
()
?
prefix
:
prefix
+
"."
)
+
key
;
Object
value
=
entry
.
getValue
();
Object
value
=
entry
.
getValue
();
if
(
value
instanceof
Map
)
{
if
(
value
instanceof
Map
)
{
map
.
put
(
key
,
sanitize
(
qualifiedKey
,
(
Map
<
String
,
Object
>)
value
));
map
.
put
(
key
,
sanitize
(
qualifiedKey
,
(
Map
<
String
,
Object
>)
value
));
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/AbstractMvcEndpoint.java
View file @
661fd848
...
@@ -69,7 +69,7 @@ public abstract class AbstractMvcEndpoint extends WebMvcConfigurerAdapter
...
@@ -69,7 +69,7 @@ public abstract class AbstractMvcEndpoint extends WebMvcConfigurerAdapter
@PostConstruct
@PostConstruct
private
void
validate
()
{
private
void
validate
()
{
Assert
.
notNull
(
this
.
path
,
"Path must not be null"
);
Assert
.
notNull
(
this
.
path
,
"Path must not be null"
);
Assert
.
isTrue
(
this
.
path
.
length
()
==
0
||
this
.
path
.
startsWith
(
"/"
),
Assert
.
isTrue
(
this
.
path
.
isEmpty
()
||
this
.
path
.
startsWith
(
"/"
),
"Path must start with / or be empty"
);
"Path must start with / or be empty"
);
}
}
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/HealthMvcEndpoint.java
View file @
661fd848
...
@@ -139,7 +139,7 @@ public class HealthMvcEndpoint extends AbstractEndpointMvcAdapter<HealthEndpoint
...
@@ -139,7 +139,7 @@ public class HealthMvcEndpoint extends AbstractEndpointMvcAdapter<HealthEndpoint
private
HttpStatus
getStatus
(
Health
health
)
{
private
HttpStatus
getStatus
(
Health
health
)
{
String
code
=
health
.
getStatus
().
getCode
();
String
code
=
health
.
getStatus
().
getCode
();
if
(
code
!=
null
)
{
if
(
code
!=
null
)
{
code
=
code
.
toLowerCase
().
replace
(
"_"
,
"-"
);
code
=
code
.
toLowerCase
().
replace
(
'_'
,
'-'
);
for
(
String
candidate
:
RelaxedNames
.
forCamelCase
(
code
))
{
for
(
String
candidate
:
RelaxedNames
.
forCamelCase
(
code
))
{
HttpStatus
status
=
this
.
statusMapping
.
get
(
candidate
);
HttpStatus
status
=
this
.
statusMapping
.
get
(
candidate
);
if
(
status
!=
null
)
{
if
(
status
!=
null
)
{
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java
View file @
661fd848
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -770,7 +770,7 @@ public class RabbitProperties {
...
@@ -770,7 +770,7 @@ public class RabbitProperties {
int
hostIndex
=
input
.
indexOf
(
"/"
);
int
hostIndex
=
input
.
indexOf
(
"/"
);
if
(
hostIndex
>=
0
)
{
if
(
hostIndex
>=
0
)
{
this
.
virtualHost
=
input
.
substring
(
hostIndex
+
1
);
this
.
virtualHost
=
input
.
substring
(
hostIndex
+
1
);
if
(
this
.
virtualHost
.
length
()
==
0
)
{
if
(
this
.
virtualHost
.
isEmpty
()
)
{
this
.
virtualHost
=
"/"
;
this
.
virtualHost
=
"/"
;
}
}
input
=
input
.
substring
(
0
,
hostIndex
);
input
=
input
.
substring
(
0
,
hostIndex
);
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheCondition.java
View file @
661fd848
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -50,7 +50,7 @@ class CacheCondition extends SpringBootCondition {
...
@@ -50,7 +50,7 @@ class CacheCondition extends SpringBootCondition {
}
}
CacheType
cacheType
=
CacheConfigurations
CacheType
cacheType
=
CacheConfigurations
.
getType
(((
AnnotationMetadata
)
metadata
).
getClassName
());
.
getType
(((
AnnotationMetadata
)
metadata
).
getClassName
());
String
value
=
resolver
.
getProperty
(
"type"
).
replace
(
"-"
,
"_"
).
toUpperCase
();
String
value
=
resolver
.
getProperty
(
"type"
).
replace
(
'-'
,
'_'
).
toUpperCase
();
if
(
value
.
equals
(
cacheType
.
name
()))
{
if
(
value
.
equals
(
cacheType
.
name
()))
{
return
ConditionOutcome
.
match
(
message
.
because
(
value
+
" cache type"
));
return
ConditionOutcome
.
match
(
message
.
because
(
value
+
" cache type"
));
}
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/h2/H2ConsoleProperties.java
View file @
661fd848
...
@@ -47,7 +47,7 @@ public class H2ConsoleProperties {
...
@@ -47,7 +47,7 @@ public class H2ConsoleProperties {
@PostConstruct
@PostConstruct
private
void
validate
()
{
private
void
validate
()
{
Assert
.
notNull
(
this
.
path
,
"Path must not be null"
);
Assert
.
notNull
(
this
.
path
,
"Path must not be null"
);
Assert
.
isTrue
(
this
.
path
.
length
()
==
0
||
this
.
path
.
startsWith
(
"/"
),
Assert
.
isTrue
(
this
.
path
.
isEmpty
()
||
this
.
path
.
startsWith
(
"/"
),
"Path must start with / or be empty"
);
"Path must start with / or be empty"
);
}
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionCondition.java
View file @
661fd848
...
@@ -45,7 +45,7 @@ class SessionCondition extends SpringBootCondition {
...
@@ -45,7 +45,7 @@ class SessionCondition extends SpringBootCondition {
return
ConditionOutcome
.
noMatch
(
return
ConditionOutcome
.
noMatch
(
message
.
didNotFind
(
"spring.session.store-type property"
).
atAll
());
message
.
didNotFind
(
"spring.session.store-type property"
).
atAll
());
}
}
String
value
=
resolver
.
getProperty
(
"store-type"
).
replace
(
"-"
,
"_"
).
toUpperCase
();
String
value
=
resolver
.
getProperty
(
"store-type"
).
replace
(
'-'
,
'_'
).
toUpperCase
();
if
(
value
.
equals
(
sessionStoreType
.
name
()))
{
if
(
value
.
equals
(
sessionStoreType
.
name
()))
{
return
ConditionOutcome
.
match
(
message
return
ConditionOutcome
.
match
(
message
.
found
(
"spring.session.store-type property"
).
items
(
sessionStoreType
));
.
found
(
"spring.session.store-type property"
).
items
(
sessionStoreType
));
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesProperties.java
View file @
661fd848
...
@@ -44,7 +44,7 @@ public class WebServicesProperties {
...
@@ -44,7 +44,7 @@ public class WebServicesProperties {
@PostConstruct
@PostConstruct
private
void
validate
()
{
private
void
validate
()
{
Assert
.
notNull
(
this
.
path
,
"Path must not be null"
);
Assert
.
notNull
(
this
.
path
,
"Path must not be null"
);
Assert
.
isTrue
(
this
.
path
.
length
()
==
0
||
this
.
path
.
startsWith
(
"/"
),
Assert
.
isTrue
(
this
.
path
.
isEmpty
()
||
this
.
path
.
startsWith
(
"/"
),
"Path must start with / or be empty"
);
"Path must start with / or be empty"
);
}
}
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/DefaultErrorViewResolverTests.java
View file @
661fd848
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -212,7 +212,7 @@ public class DefaultErrorViewResolverTests {
...
@@ -212,7 +212,7 @@ public class DefaultErrorViewResolverTests {
private
void
setResourceLocation
(
String
path
)
{
private
void
setResourceLocation
(
String
path
)
{
String
packageName
=
getClass
().
getPackage
().
getName
();
String
packageName
=
getClass
().
getPackage
().
getName
();
this
.
resourceProperties
.
setStaticLocations
(
new
String
[]
{
this
.
resourceProperties
.
setStaticLocations
(
new
String
[]
{
"classpath:"
+
packageName
.
replace
(
"."
,
"/"
)
+
path
+
"/"
});
"classpath:"
+
packageName
.
replace
(
'.'
,
'/'
)
+
path
+
"/"
});
}
}
private
MockHttpServletResponse
render
(
ModelAndView
modelAndView
)
throws
Exception
{
private
MockHttpServletResponse
render
(
ModelAndView
modelAndView
)
throws
Exception
{
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/archive/ArchiveCommand.java
View file @
661fd848
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -264,7 +264,7 @@ abstract class ArchiveCommand extends OptionParsingCommand {
...
@@ -264,7 +264,7 @@ abstract class ArchiveCommand extends OptionParsingCommand {
if
(
classLoader
==
null
)
{
if
(
classLoader
==
null
)
{
classLoader
=
Thread
.
currentThread
().
getContextClassLoader
();
classLoader
=
Thread
.
currentThread
().
getContextClassLoader
();
}
}
String
name
=
sourceClass
.
replace
(
"."
,
"/"
)
+
".class"
;
String
name
=
sourceClass
.
replace
(
'.'
,
'/'
)
+
".class"
;
InputStream
stream
=
classLoader
.
getResourceAsStream
(
name
);
InputStream
stream
=
classLoader
.
getResourceAsStream
(
name
);
writer
.
writeEntry
(
this
.
layout
.
getClassesLocation
()
+
name
,
stream
);
writer
.
writeEntry
(
this
.
layout
.
getClassesLocation
()
+
name
,
stream
);
}
}
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/ExtendedGroovyClassLoader.java
View file @
661fd848
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -161,7 +161,7 @@ public class ExtendedGroovyClassLoader extends GroovyClassLoader {
...
@@ -161,7 +161,7 @@ public class ExtendedGroovyClassLoader extends GroovyClassLoader {
protected
Class
<?>
createClass
(
byte
[]
code
,
ClassNode
classNode
)
{
protected
Class
<?>
createClass
(
byte
[]
code
,
ClassNode
classNode
)
{
Class
<?>
createdClass
=
super
.
createClass
(
code
,
classNode
);
Class
<?>
createdClass
=
super
.
createClass
(
code
,
classNode
);
ExtendedGroovyClassLoader
.
this
.
classResources
ExtendedGroovyClassLoader
.
this
.
classResources
.
put
(
classNode
.
getName
().
replace
(
"."
,
"/"
)
+
".class"
,
code
);
.
put
(
classNode
.
getName
().
replace
(
'.'
,
'/'
)
+
".class"
,
code
);
return
createdClass
;
return
createdClass
;
}
}
...
...
spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/RestartClassLoaderTests.java
View file @
661fd848
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -52,7 +52,7 @@ public class RestartClassLoaderTests {
...
@@ -52,7 +52,7 @@ public class RestartClassLoaderTests {
private
static
final
String
PACKAGE
=
RestartClassLoaderTests
.
class
.
getPackage
()
private
static
final
String
PACKAGE
=
RestartClassLoaderTests
.
class
.
getPackage
()
.
getName
();
.
getName
();
private
static
final
String
PACKAGE_PATH
=
PACKAGE
.
replace
(
"."
,
"/"
);
private
static
final
String
PACKAGE_PATH
=
PACKAGE
.
replace
(
'.'
,
'/'
);
private
static
final
Charset
UTF_8
=
Charset
.
forName
(
"UTF-8"
);
private
static
final
Charset
UTF_8
=
Charset
.
forName
(
"UTF-8"
);
...
...
spring-boot-devtools/src/test/java/org/springframework/boot/devtools/settings/DevToolsSettingsTests.java
View file @
661fd848
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -37,7 +37,7 @@ public class DevToolsSettingsTests {
...
@@ -37,7 +37,7 @@ public class DevToolsSettingsTests {
public
TemporaryFolder
temporaryFolder
=
new
TemporaryFolder
();
public
TemporaryFolder
temporaryFolder
=
new
TemporaryFolder
();
private
static
final
String
ROOT
=
DevToolsSettingsTests
.
class
.
getPackage
().
getName
()
private
static
final
String
ROOT
=
DevToolsSettingsTests
.
class
.
getPackage
().
getName
()
.
replace
(
"."
,
"/"
)
+
"/"
;
.
replace
(
'.'
,
'/'
)
+
"/"
;
@Test
@Test
public
void
includePatterns
()
throws
Exception
{
public
void
includePatterns
()
throws
Exception
{
...
...
spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc
View file @
661fd848
...
@@ -803,9 +803,9 @@ content into your application; rather pick only the properties that you need.
...
@@ -803,9 +803,9 @@ content into your application; rather pick only the properties that you need.
# EMBEDDED MONGODB ({sc-spring-boot-autoconfigure}/mongo/embedded/EmbeddedMongoProperties.{sc-ext}[EmbeddedMongoProperties])
# EMBEDDED MONGODB ({sc-spring-boot-autoconfigure}/mongo/embedded/EmbeddedMongoProperties.{sc-ext}[EmbeddedMongoProperties])
spring.mongodb.embedded.features=SYNC_DELAY # Comma-separated list of features to enable.
spring.mongodb.embedded.features=SYNC_DELAY # Comma-separated list of features to enable.
spring.mongodb.embedded.storage.database
D
ir= # Directory used for data storage.
spring.mongodb.embedded.storage.database
-d
ir= # Directory used for data storage.
spring.mongodb.embedded.storage.oplog
S
ize= # Maximum size of the oplog in megabytes.
spring.mongodb.embedded.storage.oplog
-s
ize= # Maximum size of the oplog in megabytes.
spring.mongodb.embedded.storage.repl
SetN
ame= # Name of the replica set.
spring.mongodb.embedded.storage.repl
-set-n
ame= # Name of the replica set.
spring.mongodb.embedded.version=2.6.10 # Version of Mongo to use.
spring.mongodb.embedded.version=2.6.10 # Version of Mongo to use.
# REDIS ({sc-spring-boot-autoconfigure}/data/redis/RedisProperties.{sc-ext}[RedisProperties])
# REDIS ({sc-spring-boot-autoconfigure}/data/redis/RedisProperties.{sc-ext}[RedisProperties])
...
...
spring-boot-test-support/src/main/java/org/springframework/boot/junit/compiler/TestCompiler.java
View file @
661fd848
...
@@ -99,7 +99,7 @@ public class TestCompiler {
...
@@ -99,7 +99,7 @@ public class TestCompiler {
}
}
public
static
String
sourcePathFor
(
Class
<?>
type
)
{
public
static
String
sourcePathFor
(
Class
<?>
type
)
{
return
type
.
getName
().
replace
(
"."
,
"/"
)
+
".java"
;
return
type
.
getName
().
replace
(
'.'
,
'/'
)
+
".java"
;
}
}
protected
File
getSourceFolder
()
{
protected
File
getSourceFolder
()
{
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/testutil/AbstractConfigurationClassTests.java
View file @
661fd848
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -65,7 +65,7 @@ public abstract class AbstractConfigurationClassTests {
...
@@ -65,7 +65,7 @@ public abstract class AbstractConfigurationClassTests {
private
Set
<
AnnotationMetadata
>
findConfigurationClasses
()
throws
IOException
{
private
Set
<
AnnotationMetadata
>
findConfigurationClasses
()
throws
IOException
{
Set
<
AnnotationMetadata
>
configurationClasses
=
new
HashSet
<
AnnotationMetadata
>();
Set
<
AnnotationMetadata
>
configurationClasses
=
new
HashSet
<
AnnotationMetadata
>();
Resource
[]
resources
=
this
.
resolver
.
getResources
(
"classpath*:"
Resource
[]
resources
=
this
.
resolver
.
getResources
(
"classpath*:"
+
getClass
().
getPackage
().
getName
().
replace
(
"."
,
"/"
)
+
"/**/*.class"
);
+
getClass
().
getPackage
().
getName
().
replace
(
'.'
,
'/'
)
+
"/**/*.class"
);
for
(
Resource
resource
:
resources
)
{
for
(
Resource
resource
:
resources
)
{
if
(!
isTestClass
(
resource
))
{
if
(!
isTestClass
(
resource
))
{
MetadataReader
metadataReader
=
new
SimpleMetadataReaderFactory
()
MetadataReader
metadataReader
=
new
SimpleMetadataReaderFactory
()
...
...
spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/MainClassFinder.java
View file @
661fd848
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -262,7 +262,7 @@ public abstract class MainClassFinder {
...
@@ -262,7 +262,7 @@ public abstract class MainClassFinder {
}
}
private
static
String
convertToClassName
(
String
name
,
String
prefix
)
{
private
static
String
convertToClassName
(
String
name
,
String
prefix
)
{
name
=
name
.
replace
(
"/"
,
"."
);
name
=
name
.
replace
(
'/'
,
'.'
);
name
=
name
.
replace
(
'\\'
,
'.'
);
name
=
name
.
replace
(
'\\'
,
'.'
);
name
=
name
.
substring
(
0
,
name
.
length
()
-
DOT_CLASS
.
length
());
name
=
name
.
substring
(
0
,
name
.
length
()
-
DOT_CLASS
.
length
());
if
(
prefix
!=
null
)
{
if
(
prefix
!=
null
)
{
...
...
spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/TestJarFile.java
View file @
661fd848
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -55,7 +55,7 @@ public class TestJarFile {
...
@@ -55,7 +55,7 @@ public class TestJarFile {
File
file
=
getFilePath
(
filename
);
File
file
=
getFilePath
(
filename
);
file
.
getParentFile
().
mkdirs
();
file
.
getParentFile
().
mkdirs
();
InputStream
inputStream
=
getClass
().
getResourceAsStream
(
InputStream
inputStream
=
getClass
().
getResourceAsStream
(
"/"
+
classToCopy
.
getName
().
replace
(
"."
,
"/"
)
+
".class"
);
"/"
+
classToCopy
.
getName
().
replace
(
'.'
,
'/'
)
+
".class"
);
copyToFile
(
inputStream
,
file
);
copyToFile
(
inputStream
,
file
);
if
(
time
!=
null
)
{
if
(
time
!=
null
)
{
file
.
setLastModified
(
time
);
file
.
setLastModified
(
time
);
...
...
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/LaunchedURLClassLoader.java
View file @
661fd848
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -131,8 +131,8 @@ public class LaunchedURLClassLoader extends URLClassLoader {
...
@@ -131,8 +131,8 @@ public class LaunchedURLClassLoader extends URLClassLoader {
AccessController
.
doPrivileged
(
new
PrivilegedExceptionAction
<
Object
>()
{
AccessController
.
doPrivileged
(
new
PrivilegedExceptionAction
<
Object
>()
{
@Override
@Override
public
Object
run
()
throws
ClassNotFoundException
{
public
Object
run
()
throws
ClassNotFoundException
{
String
packageEntryName
=
packageName
.
replace
(
"."
,
"/"
)
+
"/"
;
String
packageEntryName
=
packageName
.
replace
(
'.'
,
'/'
)
+
"/"
;
String
classEntryName
=
className
.
replace
(
"."
,
"/"
)
+
".class"
;
String
classEntryName
=
className
.
replace
(
'.'
,
'/'
)
+
".class"
;
for
(
URL
url
:
getURLs
())
{
for
(
URL
url
:
getURLs
())
{
try
{
try
{
URLConnection
connection
=
url
.
openConnection
();
URLConnection
connection
=
url
.
openConnection
();
...
...
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java
View file @
661fd848
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -359,7 +359,7 @@ public class PropertiesLauncher extends Launcher {
...
@@ -359,7 +359,7 @@ public class PropertiesLauncher extends Launcher {
private
String
getProperty
(
String
propertyKey
,
String
manifestKey
)
throws
Exception
{
private
String
getProperty
(
String
propertyKey
,
String
manifestKey
)
throws
Exception
{
if
(
manifestKey
==
null
)
{
if
(
manifestKey
==
null
)
{
manifestKey
=
propertyKey
.
replace
(
"."
,
"-"
);
manifestKey
=
propertyKey
.
replace
(
'.'
,
'-'
);
manifestKey
=
toCamelCase
(
manifestKey
);
manifestKey
=
toCamelCase
(
manifestKey
);
}
}
String
property
=
SystemPropertyUtils
.
getProperty
(
propertyKey
);
String
property
=
SystemPropertyUtils
.
getProperty
(
propertyKey
);
...
...
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/AsciiBytes.java
View file @
661fd848
...
@@ -121,7 +121,7 @@ final class AsciiBytes {
...
@@ -121,7 +121,7 @@ final class AsciiBytes {
}
}
public
AsciiBytes
append
(
String
string
)
{
public
AsciiBytes
append
(
String
string
)
{
if
(
string
==
null
||
string
.
length
()
==
0
)
{
if
(
string
==
null
||
string
.
isEmpty
()
)
{
return
this
;
return
this
;
}
}
return
append
(
string
.
getBytes
(
UTF_8
));
return
append
(
string
.
getBytes
(
UTF_8
));
...
...
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarURLConnection.java
View file @
661fd848
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -293,7 +293,7 @@ final class JarURLConnection extends java.net.JarURLConnection {
...
@@ -293,7 +293,7 @@ final class JarURLConnection extends java.net.JarURLConnection {
}
}
private
String
decode
(
String
source
)
{
private
String
decode
(
String
source
)
{
if
(
source
.
length
()
==
0
||
(
source
.
indexOf
(
'%'
)
<
0
))
{
if
(
source
.
isEmpty
()
||
(
source
.
indexOf
(
'%'
)
<
0
))
{
return
source
;
return
source
;
}
}
ByteArrayOutputStream
bos
=
new
ByteArrayOutputStream
(
source
.
length
());
ByteArrayOutputStream
bos
=
new
ByteArrayOutputStream
(
source
.
length
());
...
@@ -347,7 +347,7 @@ final class JarURLConnection extends java.net.JarURLConnection {
...
@@ -347,7 +347,7 @@ final class JarURLConnection extends java.net.JarURLConnection {
}
}
public
boolean
isEmpty
()
{
public
boolean
isEmpty
()
{
return
this
.
name
.
length
()
==
0
;
return
this
.
name
.
isEmpty
()
;
}
}
public
String
getContentType
()
{
public
String
getContentType
()
{
...
...
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/util/SystemPropertyUtils.java
View file @
661fd848
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -184,11 +184,11 @@ public abstract class SystemPropertyUtils {
...
@@ -184,11 +184,11 @@ public abstract class SystemPropertyUtils {
}
}
if
(
propVal
==
null
)
{
if
(
propVal
==
null
)
{
// Try with underscores.
// Try with underscores.
propVal
=
System
.
getenv
(
key
.
replace
(
"."
,
"_"
));
propVal
=
System
.
getenv
(
key
.
replace
(
'.'
,
'_'
));
}
}
if
(
propVal
==
null
)
{
if
(
propVal
==
null
)
{
// Try uppercase with underscores as well.
// Try uppercase with underscores as well.
propVal
=
System
.
getenv
(
key
.
toUpperCase
().
replace
(
"."
,
"_"
));
propVal
=
System
.
getenv
(
key
.
toUpperCase
().
replace
(
'.'
,
'_'
));
}
}
if
(
propVal
!=
null
)
{
if
(
propVal
!=
null
)
{
return
propVal
;
return
propVal
;
...
...
spring-boot/src/main/java/org/springframework/boot/bind/RelaxedConversionService.java
View file @
661fd848
/*
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -120,14 +120,14 @@ class RelaxedConversionService implements ConversionService {
...
@@ -120,14 +120,14 @@ class RelaxedConversionService implements ConversionService {
@Override
@Override
public
T
convert
(
String
source
)
{
public
T
convert
(
String
source
)
{
if
(
source
.
length
()
==
0
)
{
if
(
source
.
isEmpty
()
)
{
// It's an empty enum identifier: reset the enum value to null.
// It's an empty enum identifier: reset the enum value to null.
return
null
;
return
null
;
}
}
source
=
source
.
trim
();
source
=
source
.
trim
();
for
(
T
candidate
:
(
Set
<
T
>)
EnumSet
.
allOf
(
this
.
enumType
))
{
for
(
T
candidate
:
(
Set
<
T
>)
EnumSet
.
allOf
(
this
.
enumType
))
{
RelaxedNames
names
=
new
RelaxedNames
(
RelaxedNames
names
=
new
RelaxedNames
(
candidate
.
name
().
replace
(
"_"
,
"-"
).
toLowerCase
());
candidate
.
name
().
replace
(
'_'
,
'-'
).
toLowerCase
());
for
(
String
name
:
names
)
{
for
(
String
name
:
names
)
{
if
(
name
.
equals
(
source
))
{
if
(
name
.
equals
(
source
))
{
return
candidate
;
return
candidate
;
...
...
spring-boot/src/main/java/org/springframework/boot/bind/RelaxedNames.java
View file @
661fd848
...
@@ -127,7 +127,7 @@ public final class RelaxedNames implements Iterable<String> {
...
@@ -127,7 +127,7 @@ public final class RelaxedNames implements Iterable<String> {
@Override
@Override
public
String
apply
(
String
value
)
{
public
String
apply
(
String
value
)
{
return
value
.
indexOf
(
'-'
)
!=
-
1
?
value
.
replace
(
"-"
,
"_"
)
:
value
;
return
value
.
indexOf
(
'-'
)
!=
-
1
?
value
.
replace
(
'-'
,
'_'
)
:
value
;
}
}
},
},
...
@@ -136,7 +136,7 @@ public final class RelaxedNames implements Iterable<String> {
...
@@ -136,7 +136,7 @@ public final class RelaxedNames implements Iterable<String> {
@Override
@Override
public
String
apply
(
String
value
)
{
public
String
apply
(
String
value
)
{
return
value
.
indexOf
(
'_'
)
!=
-
1
?
value
.
replace
(
"_"
,
"."
)
:
value
;
return
value
.
indexOf
(
'_'
)
!=
-
1
?
value
.
replace
(
'_'
,
'.'
)
:
value
;
}
}
},
},
...
@@ -145,7 +145,7 @@ public final class RelaxedNames implements Iterable<String> {
...
@@ -145,7 +145,7 @@ public final class RelaxedNames implements Iterable<String> {
@Override
@Override
public
String
apply
(
String
value
)
{
public
String
apply
(
String
value
)
{
return
value
.
indexOf
(
'.'
)
!=
-
1
?
value
.
replace
(
"."
,
"_"
)
:
value
;
return
value
.
indexOf
(
'.'
)
!=
-
1
?
value
.
replace
(
'.'
,
'_'
)
:
value
;
}
}
},
},
...
...
spring-boot/src/main/java/org/springframework/boot/context/ConfigurationWarningsApplicationContextInitializer.java
View file @
661fd848
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -206,14 +206,14 @@ public class ConfigurationWarningsApplicationContextInitializer
...
@@ -206,14 +206,14 @@ public class ConfigurationWarningsApplicationContextInitializer
}
}
private
boolean
isProblematicPackage
(
String
scannedPackage
)
{
private
boolean
isProblematicPackage
(
String
scannedPackage
)
{
if
(
scannedPackage
==
null
||
scannedPackage
.
length
()
==
0
)
{
if
(
scannedPackage
==
null
||
scannedPackage
.
isEmpty
()
)
{
return
true
;
return
true
;
}
}
return
PROBLEM_PACKAGES
.
contains
(
scannedPackage
);
return
PROBLEM_PACKAGES
.
contains
(
scannedPackage
);
}
}
private
String
getDisplayName
(
String
scannedPackage
)
{
private
String
getDisplayName
(
String
scannedPackage
)
{
if
(
scannedPackage
==
null
||
scannedPackage
.
length
()
==
0
)
{
if
(
scannedPackage
==
null
||
scannedPackage
.
isEmpty
()
)
{
return
"the default package"
;
return
"the default package"
;
}
}
return
"'"
+
scannedPackage
+
"'"
;
return
"'"
+
scannedPackage
+
"'"
;
...
...
spring-boot/src/main/java/org/springframework/boot/logging/AbstractLoggingSystem.java
View file @
661fd848
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -172,7 +172,7 @@ public abstract class AbstractLoggingSystem extends LoggingSystem {
...
@@ -172,7 +172,7 @@ public abstract class AbstractLoggingSystem extends LoggingSystem {
protected
final
String
getPackagedConfigFile
(
String
fileName
)
{
protected
final
String
getPackagedConfigFile
(
String
fileName
)
{
String
defaultPath
=
ClassUtils
.
getPackageName
(
getClass
());
String
defaultPath
=
ClassUtils
.
getPackageName
(
getClass
());
defaultPath
=
defaultPath
.
replace
(
"."
,
"/"
);
defaultPath
=
defaultPath
.
replace
(
'.'
,
'/'
);
defaultPath
=
defaultPath
+
"/"
+
fileName
;
defaultPath
=
defaultPath
+
"/"
+
fileName
;
defaultPath
=
"classpath:"
+
defaultPath
;
defaultPath
=
"classpath:"
+
defaultPath
;
return
defaultPath
;
return
defaultPath
;
...
...
spring-boot/src/test/java/org/springframework/boot/context/embedded/XmlEmbeddedWebApplicationContextTests.java
View file @
661fd848
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -32,7 +32,7 @@ import static org.mockito.Mockito.verify;
...
@@ -32,7 +32,7 @@ import static org.mockito.Mockito.verify;
public
class
XmlEmbeddedWebApplicationContextTests
{
public
class
XmlEmbeddedWebApplicationContextTests
{
private
static
final
String
PATH
=
XmlEmbeddedWebApplicationContextTests
.
class
private
static
final
String
PATH
=
XmlEmbeddedWebApplicationContextTests
.
class
.
getPackage
().
getName
().
replace
(
"."
,
"/"
)
+
"/"
;
.
getPackage
().
getName
().
replace
(
'.'
,
'/'
)
+
"/"
;
private
static
final
String
FILE
=
"exampleEmbeddedWebApplicationConfiguration.xml"
;
private
static
final
String
FILE
=
"exampleEmbeddedWebApplicationConfiguration.xml"
;
...
...
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