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
2c1e81ad
Commit
2c1e81ad
authored
Dec 26, 2019
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
1e38dd55
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
65 additions
and
78 deletions
+65
-78
OnEndpointElementCondition.java
...oot/actuate/autoconfigure/OnEndpointElementCondition.java
+2
-1
ConfigurationPropertiesReportEndpoint.java
...ext/properties/ConfigurationPropertiesReportEndpoint.java
+1
-1
PathMappedEndpoints.java
...mework/boot/actuate/endpoint/web/PathMappedEndpoints.java
+5
-7
HealthWebEndpointResponseMapper.java
.../boot/actuate/health/HealthWebEndpointResponseMapper.java
+1
-1
RabbitProperties.java
...ngframework/boot/autoconfigure/amqp/RabbitProperties.java
+1
-1
RedisConnectionConfiguration.java
...utoconfigure/data/redis/RedisConnectionConfiguration.java
+1
-1
HttpMessageConverters.java
...mework/boot/autoconfigure/http/HttpMessageConverters.java
+2
-2
ArtemisConnectionFactoryFactory.java
...onfigure/jms/artemis/ArtemisConnectionFactoryFactory.java
+5
-5
LdapProperties.java
...ringframework/boot/autoconfigure/ldap/LdapProperties.java
+1
-1
TomcatWebServerFactoryCustomizer.java
...figure/web/embedded/TomcatWebServerFactoryCustomizer.java
+8
-10
UndertowWebServerFactoryCustomizer.java
...gure/web/embedded/UndertowWebServerFactoryCustomizer.java
+6
-9
ArchiveCommand.java
...ingframework/boot/cli/command/archive/ArchiveCommand.java
+1
-2
HintCommand.java
...rg/springframework/boot/cli/command/core/HintCommand.java
+2
-3
LiveReloadServer.java
...gframework/boot/devtools/livereload/LiveReloadServer.java
+1
-1
PropertiesMigrationReporter.java
...text/properties/migrator/PropertiesMigrationReporter.java
+8
-10
AbstractApplicationContextRunner.java
...test/context/runner/AbstractApplicationContextRunner.java
+6
-9
MockitoPostProcessor.java
...ramework/boot/test/mock/mockito/MockitoPostProcessor.java
+2
-1
ConfigurationMetadataAnnotationProcessor.java
...onprocessor/ConfigurationMetadataAnnotationProcessor.java
+2
-2
ExecutableArchiveLauncher.java
...pringframework/boot/loader/ExecutableArchiveLauncher.java
+1
-1
PropertiesLauncher.java
...a/org/springframework/boot/loader/PropertiesLauncher.java
+3
-3
ModifiedClassPathClassLoader.java
...t/testsupport/classpath/ModifiedClassPathClassLoader.java
+1
-2
ModifiedClassPathExtension.java
...oot/testsupport/classpath/ModifiedClassPathExtension.java
+2
-3
TestCompiler.java
...ringframework/boot/testsupport/compiler/TestCompiler.java
+2
-1
JettyServletWebServerFactory.java
...boot/web/embedded/jetty/JettyServletWebServerFactory.java
+1
-1
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/OnEndpointElementCondition.java
View file @
2c1e81ad
...
@@ -69,7 +69,8 @@ public abstract class OnEndpointElementCondition extends SpringBootCondition {
...
@@ -69,7 +69,8 @@ public abstract class OnEndpointElementCondition extends SpringBootCondition {
}
}
protected
ConditionOutcome
getDefaultEndpointsOutcome
(
ConditionContext
context
)
{
protected
ConditionOutcome
getDefaultEndpointsOutcome
(
ConditionContext
context
)
{
boolean
match
=
Boolean
.
valueOf
(
context
.
getEnvironment
().
getProperty
(
this
.
prefix
+
"defaults.enabled"
,
"true"
));
boolean
match
=
Boolean
.
parseBoolean
(
context
.
getEnvironment
().
getProperty
(
this
.
prefix
+
"defaults.enabled"
,
"true"
));
return
new
ConditionOutcome
(
match
,
ConditionMessage
.
forCondition
(
this
.
annotationType
)
return
new
ConditionOutcome
(
match
,
ConditionMessage
.
forCondition
(
this
.
annotationType
)
.
because
(
this
.
prefix
+
"defaults.enabled is considered "
+
match
));
.
because
(
this
.
prefix
+
"defaults.enabled is considered "
+
match
));
}
}
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java
View file @
2c1e81ad
...
@@ -186,7 +186,7 @@ public class ConfigurationPropertiesReportEndpoint implements ApplicationContext
...
@@ -186,7 +186,7 @@ public class ConfigurationPropertiesReportEndpoint implements ApplicationContext
* @param prefix the prefix
* @param prefix the prefix
* @return the serialized instance
* @return the serialized instance
*/
*/
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
{
"unchecked"
,
"rawtypes"
}
)
private
Map
<
String
,
Object
>
safeSerialize
(
ObjectMapper
mapper
,
Object
bean
,
String
prefix
)
{
private
Map
<
String
,
Object
>
safeSerialize
(
ObjectMapper
mapper
,
Object
bean
,
String
prefix
)
{
try
{
try
{
return
new
HashMap
<>(
mapper
.
convertValue
(
bean
,
Map
.
class
));
return
new
HashMap
<>(
mapper
.
convertValue
(
bean
,
Map
.
class
));
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/PathMappedEndpoints.java
View file @
2c1e81ad
...
@@ -65,13 +65,11 @@ public class PathMappedEndpoints implements Iterable<PathMappedEndpoint> {
...
@@ -65,13 +65,11 @@ public class PathMappedEndpoints implements Iterable<PathMappedEndpoint> {
private
Map
<
EndpointId
,
PathMappedEndpoint
>
getEndpoints
(
Collection
<
EndpointsSupplier
<?>>
suppliers
)
{
private
Map
<
EndpointId
,
PathMappedEndpoint
>
getEndpoints
(
Collection
<
EndpointsSupplier
<?>>
suppliers
)
{
Map
<
EndpointId
,
PathMappedEndpoint
>
endpoints
=
new
LinkedHashMap
<>();
Map
<
EndpointId
,
PathMappedEndpoint
>
endpoints
=
new
LinkedHashMap
<>();
suppliers
.
forEach
((
supplier
)
->
{
suppliers
.
forEach
((
supplier
)
->
supplier
.
getEndpoints
().
forEach
((
endpoint
)
->
{
supplier
.
getEndpoints
().
forEach
((
endpoint
)
->
{
if
(
endpoint
instanceof
PathMappedEndpoint
)
{
if
(
endpoint
instanceof
PathMappedEndpoint
)
{
endpoints
.
put
(
endpoint
.
getEndpointId
(),
(
PathMappedEndpoint
)
endpoint
);
endpoints
.
put
(
endpoint
.
getEndpointId
(),
(
PathMappedEndpoint
)
endpoint
);
}
}
}));
});
});
return
Collections
.
unmodifiableMap
(
endpoints
);
return
Collections
.
unmodifiableMap
(
endpoints
);
}
}
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthWebEndpointResponseMapper.java
View file @
2c1e81ad
...
@@ -99,7 +99,7 @@ public class HealthWebEndpointResponseMapper {
...
@@ -99,7 +99,7 @@ public class HealthWebEndpointResponseMapper {
}
}
private
WebEndpointResponse
<
Health
>
createWebEndpointResponse
(
Health
health
)
{
private
WebEndpointResponse
<
Health
>
createWebEndpointResponse
(
Health
health
)
{
Integer
status
=
this
.
statusHttpMapper
.
mapStatus
(
health
.
getStatus
());
int
status
=
this
.
statusHttpMapper
.
mapStatus
(
health
.
getStatus
());
return
new
WebEndpointResponse
<>(
health
,
status
);
return
new
WebEndpointResponse
<>(
health
,
status
);
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java
View file @
2c1e81ad
...
@@ -1059,7 +1059,7 @@ public class RabbitProperties {
...
@@ -1059,7 +1059,7 @@ public class RabbitProperties {
}
}
else
{
else
{
this
.
host
=
input
.
substring
(
0
,
portIndex
);
this
.
host
=
input
.
substring
(
0
,
portIndex
);
this
.
port
=
Integer
.
valueOf
(
input
.
substring
(
portIndex
+
1
));
this
.
port
=
Integer
.
parseInt
(
input
.
substring
(
portIndex
+
1
));
}
}
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisConnectionConfiguration.java
View file @
2c1e81ad
...
@@ -120,7 +120,7 @@ abstract class RedisConnectionConfiguration {
...
@@ -120,7 +120,7 @@ abstract class RedisConnectionConfiguration {
try
{
try
{
String
[]
parts
=
StringUtils
.
split
(
node
,
":"
);
String
[]
parts
=
StringUtils
.
split
(
node
,
":"
);
Assert
.
state
(
parts
.
length
==
2
,
"Must be defined as 'host:port'"
);
Assert
.
state
(
parts
.
length
==
2
,
"Must be defined as 'host:port'"
);
nodes
.
add
(
new
RedisNode
(
parts
[
0
],
Integer
.
valueOf
(
parts
[
1
])));
nodes
.
add
(
new
RedisNode
(
parts
[
0
],
Integer
.
parseInt
(
parts
[
1
])));
}
}
catch
(
RuntimeException
ex
)
{
catch
(
RuntimeException
ex
)
{
throw
new
IllegalStateException
(
"Invalid redis sentinel property '"
+
node
+
"'"
,
ex
);
throw
new
IllegalStateException
(
"Invalid redis sentinel property '"
+
node
+
"'"
,
ex
);
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConverters.java
View file @
2c1e81ad
...
@@ -44,8 +44,8 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupp
...
@@ -44,8 +44,8 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupp
* needed, otherwise default converters will be used.
* needed, otherwise default converters will be used.
* <p>
* <p>
* NOTE: The default converters used are the same as standard Spring MVC (see
* NOTE: The default converters used are the same as standard Spring MVC (see
* {@link WebMvcConfigurationSupport
#getMessageConverters} with some slight re-ordering to
* {@link WebMvcConfigurationSupport
}) with some slight re-ordering to put XML converters
*
put XML converters
at the back of the list.
* at the back of the list.
*
*
* @author Dave Syer
* @author Dave Syer
* @author Phillip Webb
* @author Phillip Webb
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisConnectionFactoryFactory.java
View file @
2c1e81ad
...
@@ -68,10 +68,10 @@ class ArtemisConnectionFactoryFactory {
...
@@ -68,10 +68,10 @@ class ArtemisConnectionFactoryFactory {
}
}
private
void
startEmbeddedJms
()
{
private
void
startEmbeddedJms
()
{
for
(
int
i
=
0
;
i
<
EMBEDDED_JMS_CLASSES
.
length
;
i
++
)
{
for
(
String
embeddedJmsClass
:
EMBEDDED_JMS_CLASSES
)
{
if
(
ClassUtils
.
isPresent
(
EMBEDDED_JMS_CLASSES
[
i
]
,
null
))
{
if
(
ClassUtils
.
isPresent
(
embeddedJmsClass
,
null
))
{
try
{
try
{
this
.
beanFactory
.
getBeansOfType
(
Class
.
forName
(
EMBEDDED_JMS_CLASSES
[
i
]
));
this
.
beanFactory
.
getBeansOfType
(
Class
.
forName
(
embeddedJmsClass
));
}
}
catch
(
Exception
ex
)
{
catch
(
Exception
ex
)
{
// Ignore
// Ignore
...
@@ -103,8 +103,8 @@ class ArtemisConnectionFactoryFactory {
...
@@ -103,8 +103,8 @@ class ArtemisConnectionFactoryFactory {
}
}
private
boolean
isEmbeddedJmsClassPresent
()
{
private
boolean
isEmbeddedJmsClassPresent
()
{
for
(
int
i
=
0
;
i
<
EMBEDDED_JMS_CLASSES
.
length
;
i
++
)
{
for
(
String
embeddedJmsClass
:
EMBEDDED_JMS_CLASSES
)
{
if
(
ClassUtils
.
isPresent
(
EMBEDDED_JMS_CLASSES
[
i
]
,
null
))
{
if
(
ClassUtils
.
isPresent
(
embeddedJmsClass
,
null
))
{
return
true
;
return
true
;
}
}
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapProperties.java
View file @
2c1e81ad
...
@@ -120,7 +120,7 @@ public class LdapProperties {
...
@@ -120,7 +120,7 @@ public class LdapProperties {
Assert
.
notNull
(
environment
,
"Environment must not be null"
);
Assert
.
notNull
(
environment
,
"Environment must not be null"
);
String
localPort
=
environment
.
getProperty
(
"local.ldap.port"
);
String
localPort
=
environment
.
getProperty
(
"local.ldap.port"
);
if
(
localPort
!=
null
)
{
if
(
localPort
!=
null
)
{
return
Integer
.
valueOf
(
localPort
);
return
Integer
.
parseInt
(
localPort
);
}
}
return
DEFAULT_PORT
;
return
DEFAULT_PORT
;
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizer.java
View file @
2c1e81ad
...
@@ -282,17 +282,15 @@ public class TomcatWebServerFactoryCustomizer
...
@@ -282,17 +282,15 @@ public class TomcatWebServerFactoryCustomizer
private
void
customizeStaticResources
(
ConfigurableTomcatWebServerFactory
factory
)
{
private
void
customizeStaticResources
(
ConfigurableTomcatWebServerFactory
factory
)
{
ServerProperties
.
Tomcat
.
Resource
resource
=
this
.
serverProperties
.
getTomcat
().
getResource
();
ServerProperties
.
Tomcat
.
Resource
resource
=
this
.
serverProperties
.
getTomcat
().
getResource
();
factory
.
addContextCustomizers
((
context
)
->
{
factory
.
addContextCustomizers
((
context
)
->
context
.
addLifecycleListener
((
event
)
->
{
context
.
addLifecycleListener
((
event
)
->
{
if
(
event
.
getType
().
equals
(
Lifecycle
.
CONFIGURE_START_EVENT
))
{
if
(
event
.
getType
().
equals
(
Lifecycle
.
CONFIGURE_START_EVENT
))
{
context
.
getResources
().
setCachingAllowed
(
resource
.
isAllowCaching
());
context
.
getResources
().
setCachingAllowed
(
resource
.
isAllowCaching
());
if
(
resource
.
getCacheTtl
()
!=
null
)
{
if
(
resource
.
getCacheTtl
()
!=
null
)
{
long
ttl
=
resource
.
getCacheTtl
().
toMillis
();
long
ttl
=
resource
.
getCacheTtl
().
toMillis
();
context
.
getResources
().
setCacheTtl
(
ttl
);
context
.
getResources
().
setCacheTtl
(
ttl
);
}
}
}
}
);
}
});
})
)
;
}
}
private
void
customizeErrorReportValve
(
ErrorProperties
error
,
ConfigurableTomcatWebServerFactory
factory
)
{
private
void
customizeErrorReportValve
(
ErrorProperties
error
,
ConfigurableTomcatWebServerFactory
factory
)
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/UndertowWebServerFactoryCustomizer.java
View file @
2c1e81ad
...
@@ -168,16 +168,13 @@ public class UndertowWebServerFactoryCustomizer
...
@@ -168,16 +168,13 @@ public class UndertowWebServerFactoryCustomizer
return
(
value
)
->
this
.
factory
.
addBuilderCustomizers
((
builder
)
->
builder
.
setSocketOption
(
option
,
value
));
return
(
value
)
->
this
.
factory
.
addBuilderCustomizers
((
builder
)
->
builder
.
setSocketOption
(
option
,
value
));
}
}
@SuppressWarnings
(
"unchecked"
)
<
T
>
Consumer
<
Map
<
String
,
String
>>
forEach
(
Function
<
Option
<
T
>,
Consumer
<
T
>>
function
)
{
<
T
>
Consumer
<
Map
<
String
,
String
>>
forEach
(
Function
<
Option
<
T
>,
Consumer
<
T
>>
function
)
{
return
(
map
)
->
{
return
(
map
)
->
map
.
forEach
((
key
,
value
)
->
{
map
.
forEach
((
key
,
value
)
->
{
Option
<
T
>
option
=
(
Option
<
T
>)
NAME_LOOKUP
.
get
(
getCanonicalName
(
key
));
Option
<
T
>
option
=
(
Option
<
T
>)
NAME_LOOKUP
.
get
(
getCanonicalName
(
key
));
Assert
.
state
(
option
!=
null
,
"Unable to find '"
+
key
+
"' in UndertowOptions"
);
Assert
.
state
(
option
!=
null
,
"Unable to find '"
+
key
+
"' in UndertowOptions"
);
T
parsed
=
option
.
parseValue
(
value
,
getClass
().
getClassLoader
());
T
parsed
=
option
.
parseValue
(
value
,
getClass
().
getClassLoader
());
function
.
apply
(
option
).
accept
(
parsed
);
function
.
apply
(
option
).
accept
(
parsed
);
});
});
};
}
}
private
static
String
getCanonicalName
(
String
name
)
{
private
static
String
getCanonicalName
(
String
name
)
{
...
...
spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/archive/ArchiveCommand.java
View file @
2c1e81ad
...
@@ -18,7 +18,6 @@ package org.springframework.boot.cli.command.archive;
...
@@ -18,7 +18,6 @@ package org.springframework.boot.cli.command.archive;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.net.URI
;
import
java.net.URI
;
...
@@ -175,7 +174,7 @@ abstract class ArchiveCommand extends OptionParsingCommand {
...
@@ -175,7 +174,7 @@ abstract class ArchiveCommand extends OptionParsingCommand {
}
}
private
void
writeJar
(
File
file
,
Class
<?>[]
compiledClasses
,
List
<
MatchedResource
>
classpathEntries
,
private
void
writeJar
(
File
file
,
Class
<?>[]
compiledClasses
,
List
<
MatchedResource
>
classpathEntries
,
List
<
URL
>
dependencies
)
throws
FileNotFoundException
,
IOException
,
URISyntaxException
{
List
<
URL
>
dependencies
)
throws
IOException
,
URISyntaxException
{
final
List
<
Library
>
libraries
;
final
List
<
Library
>
libraries
;
try
(
JarWriter
writer
=
new
JarWriter
(
file
))
{
try
(
JarWriter
writer
=
new
JarWriter
(
file
))
{
addManifest
(
writer
,
compiledClasses
);
addManifest
(
writer
,
compiledClasses
);
...
...
spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/core/HintCommand.java
View file @
2c1e81ad
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
package
org
.
springframework
.
boot
.
cli
.
command
.
core
;
package
org
.
springframework
.
boot
.
cli
.
command
.
core
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
...
@@ -48,9 +49,7 @@ public class HintCommand extends AbstractCommand {
...
@@ -48,9 +49,7 @@ public class HintCommand extends AbstractCommand {
try
{
try
{
int
index
=
(
args
.
length
!=
0
)
?
Integer
.
parseInt
(
args
[
0
])
-
1
:
0
;
int
index
=
(
args
.
length
!=
0
)
?
Integer
.
parseInt
(
args
[
0
])
-
1
:
0
;
List
<
String
>
arguments
=
new
ArrayList
<>(
args
.
length
);
List
<
String
>
arguments
=
new
ArrayList
<>(
args
.
length
);
for
(
int
i
=
2
;
i
<
args
.
length
;
i
++)
{
arguments
.
addAll
(
Arrays
.
asList
(
args
).
subList
(
2
,
args
.
length
));
arguments
.
add
(
args
[
i
]);
}
String
starting
=
""
;
String
starting
=
""
;
if
(
index
<
arguments
.
size
())
{
if
(
index
<
arguments
.
size
())
{
starting
=
arguments
.
remove
(
index
);
starting
=
arguments
.
remove
(
index
);
...
...
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/LiveReloadServer.java
View file @
2c1e81ad
...
@@ -283,7 +283,7 @@ public class LiveReloadServer {
...
@@ -283,7 +283,7 @@ public class LiveReloadServer {
}
}
}
}
private
void
runConnection
(
Connection
connection
)
throws
IOException
,
Exception
{
private
void
runConnection
(
Connection
connection
)
throws
Exception
{
try
{
try
{
addConnection
(
connection
);
addConnection
(
connection
);
connection
.
run
();
connection
.
run
();
...
...
spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java
View file @
2c1e81ad
...
@@ -98,16 +98,14 @@ class PropertiesMigrationReporter {
...
@@ -98,16 +98,14 @@ class PropertiesMigrationReporter {
MultiValueMap
<
String
,
PropertyMigration
>
result
=
new
LinkedMultiValueMap
<>();
MultiValueMap
<
String
,
PropertyMigration
>
result
=
new
LinkedMultiValueMap
<>();
List
<
ConfigurationMetadataProperty
>
candidates
=
this
.
allProperties
.
values
().
stream
().
filter
(
filter
)
List
<
ConfigurationMetadataProperty
>
candidates
=
this
.
allProperties
.
values
().
stream
().
filter
(
filter
)
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
getPropertySourcesAsMap
().
forEach
((
name
,
source
)
->
{
getPropertySourcesAsMap
().
forEach
((
name
,
source
)
->
candidates
.
forEach
((
metadata
)
->
{
candidates
.
forEach
((
metadata
)
->
{
ConfigurationProperty
configurationProperty
=
source
ConfigurationProperty
configurationProperty
=
source
.
getConfigurationProperty
(
ConfigurationPropertyName
.
of
(
metadata
.
getId
()));
.
getConfigurationProperty
(
ConfigurationPropertyName
.
of
(
metadata
.
getId
()));
if
(
configurationProperty
!=
null
)
{
if
(
configurationProperty
!=
null
)
{
result
.
add
(
name
,
result
.
add
(
name
,
new
PropertyMigration
(
configurationProperty
,
metadata
,
new
PropertyMigration
(
configurationProperty
,
metadata
,
determineReplacementMetadata
(
metadata
)));
determineReplacementMetadata
(
metadata
)));
}
}
}));
});
});
return
result
;
return
result
;
}
}
...
...
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/AbstractApplicationContextRunner.java
View file @
2c1e81ad
...
@@ -351,16 +351,13 @@ public abstract class AbstractApplicationContextRunner<SELF extends AbstractAppl
...
@@ -351,16 +351,13 @@ public abstract class AbstractApplicationContextRunner<SELF extends AbstractAppl
* @param consumer the consumer of the created {@link ApplicationContext}
* @param consumer the consumer of the created {@link ApplicationContext}
* @return this instance
* @return this instance
*/
*/
@SuppressWarnings
(
"unchecked"
)
public
SELF
run
(
ContextConsumer
<?
super
A
>
consumer
)
{
public
SELF
run
(
ContextConsumer
<?
super
A
>
consumer
)
{
withContextClassLoader
(
this
.
classLoader
,
()
->
{
withContextClassLoader
(
this
.
classLoader
,
()
->
this
.
systemProperties
.
applyToSystemProperties
(()
->
{
this
.
systemProperties
.
applyToSystemProperties
(()
->
{
try
(
A
context
=
createAssertableContext
())
{
try
(
A
context
=
createAssertableContext
())
{
accept
(
consumer
,
context
);
accept
(
consumer
,
context
);
}
}
return
null
;
return
null
;
}));
});
});
return
(
SELF
)
this
;
return
(
SELF
)
this
;
}
}
...
...
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoPostProcessor.java
View file @
2c1e81ad
...
@@ -20,6 +20,7 @@ import java.beans.PropertyDescriptor;
...
@@ -20,6 +20,7 @@ import java.beans.PropertyDescriptor;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashSet
;
import
java.util.LinkedHashSet
;
...
@@ -307,7 +308,7 @@ public class MockitoPostProcessor extends InstantiationAwareBeanPostProcessorAda
...
@@ -307,7 +308,7 @@ public class MockitoPostProcessor extends InstantiationAwareBeanPostProcessorAda
if
(
primaryBeanName
!=
null
)
{
if
(
primaryBeanName
!=
null
)
{
throw
new
NoUniqueBeanDefinitionException
(
type
.
resolve
(),
candidateBeanNames
.
size
(),
throw
new
NoUniqueBeanDefinitionException
(
type
.
resolve
(),
candidateBeanNames
.
size
(),
"more than one 'primary' bean found among candidates: "
"more than one 'primary' bean found among candidates: "
+
Arrays
.
as
List
(
candidateBeanNames
));
+
Collections
.
singleton
List
(
candidateBeanNames
));
}
}
primaryBeanName
=
candidateBeanName
;
primaryBeanName
=
candidateBeanName
;
}
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessor.java
View file @
2c1e81ad
...
@@ -181,10 +181,10 @@ public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor
...
@@ -181,10 +181,10 @@ public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor
if
(
annotation
!=
null
)
{
if
(
annotation
!=
null
)
{
String
prefix
=
getPrefix
(
annotation
);
String
prefix
=
getPrefix
(
annotation
);
if
(
element
instanceof
TypeElement
)
{
if
(
element
instanceof
TypeElement
)
{
processAnnotatedTypeElement
(
prefix
,
(
TypeElement
)
element
,
new
Stack
<
TypeElement
>());
processAnnotatedTypeElement
(
prefix
,
(
TypeElement
)
element
,
new
Stack
<>());
}
}
else
if
(
element
instanceof
ExecutableElement
)
{
else
if
(
element
instanceof
ExecutableElement
)
{
processExecutableElement
(
prefix
,
(
ExecutableElement
)
element
,
new
Stack
<
TypeElement
>());
processExecutableElement
(
prefix
,
(
ExecutableElement
)
element
,
new
Stack
<>());
}
}
}
}
}
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/ExecutableArchiveLauncher.java
View file @
2c1e81ad
...
@@ -74,7 +74,7 @@ public abstract class ExecutableArchiveLauncher extends Launcher {
...
@@ -74,7 +74,7 @@ public abstract class ExecutableArchiveLauncher extends Launcher {
}
}
private
Iterator
<
Archive
>
applyClassPathArchivePostProcessing
(
Iterator
<
Archive
>
archives
)
throws
Exception
{
private
Iterator
<
Archive
>
applyClassPathArchivePostProcessing
(
Iterator
<
Archive
>
archives
)
throws
Exception
{
List
<
Archive
>
list
=
new
ArrayList
<
Archive
>();
List
<
Archive
>
list
=
new
ArrayList
<>();
while
(
archives
.
hasNext
())
{
while
(
archives
.
hasNext
())
{
list
.
add
(
archives
.
next
());
list
.
add
(
archives
.
next
());
}
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java
View file @
2c1e81ad
...
@@ -167,7 +167,7 @@ public class PropertiesLauncher extends Launcher {
...
@@ -167,7 +167,7 @@ public class PropertiesLauncher extends Launcher {
}
}
}
}
private
void
initializeProperties
()
throws
Exception
,
IOException
{
private
void
initializeProperties
()
throws
Exception
{
List
<
String
>
configs
=
new
ArrayList
<>();
List
<
String
>
configs
=
new
ArrayList
<>();
if
(
getProperty
(
CONFIG_LOCATION
)
!=
null
)
{
if
(
getProperty
(
CONFIG_LOCATION
)
!=
null
)
{
configs
.
add
(
getProperty
(
CONFIG_LOCATION
));
configs
.
add
(
getProperty
(
CONFIG_LOCATION
));
...
@@ -195,7 +195,7 @@ public class PropertiesLauncher extends Launcher {
...
@@ -195,7 +195,7 @@ public class PropertiesLauncher extends Launcher {
}
}
}
}
private
void
loadResource
(
InputStream
resource
)
throws
IOException
,
Exception
{
private
void
loadResource
(
InputStream
resource
)
throws
Exception
{
this
.
properties
.
load
(
resource
);
this
.
properties
.
load
(
resource
);
for
(
Object
key
:
Collections
.
list
(
this
.
properties
.
propertyNames
()))
{
for
(
Object
key
:
Collections
.
list
(
this
.
properties
.
propertyNames
()))
{
String
text
=
this
.
properties
.
getProperty
((
String
)
key
);
String
text
=
this
.
properties
.
getProperty
((
String
)
key
);
...
@@ -591,7 +591,7 @@ public class PropertiesLauncher extends Launcher {
...
@@ -591,7 +591,7 @@ public class PropertiesLauncher extends Launcher {
}
}
private
List
<
Archive
>
asList
(
Iterator
<
Archive
>
iterator
)
{
private
List
<
Archive
>
asList
(
Iterator
<
Archive
>
iterator
)
{
List
<
Archive
>
list
=
new
ArrayList
<
Archive
>();
List
<
Archive
>
list
=
new
ArrayList
<>();
while
(
iterator
.
hasNext
())
{
while
(
iterator
.
hasNext
())
{
list
.
add
(
iterator
.
next
());
list
.
add
(
iterator
.
next
());
}
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathClassLoader.java
View file @
2c1e81ad
...
@@ -172,9 +172,8 @@ final class ModifiedClassPathClassLoader extends URLClassLoader {
...
@@ -172,9 +172,8 @@ final class ModifiedClassPathClassLoader extends URLClassLoader {
MergedAnnotations
annotations
=
MergedAnnotations
.
from
(
testClass
,
MergedAnnotations
annotations
=
MergedAnnotations
.
from
(
testClass
,
MergedAnnotations
.
SearchStrategy
.
TYPE_HIERARCHY
);
MergedAnnotations
.
SearchStrategy
.
TYPE_HIERARCHY
);
ClassPathEntryFilter
filter
=
new
ClassPathEntryFilter
(
annotations
.
get
(
ClassPathExclusions
.
class
));
ClassPathEntryFilter
filter
=
new
ClassPathEntryFilter
(
annotations
.
get
(
ClassPathExclusions
.
class
));
List
<
URL
>
processedUrls
=
new
ArrayList
<>();
List
<
URL
>
additionalUrls
=
getAdditionalUrls
(
annotations
.
get
(
ClassPathOverrides
.
class
));
List
<
URL
>
additionalUrls
=
getAdditionalUrls
(
annotations
.
get
(
ClassPathOverrides
.
class
));
processedUrls
.
addAll
(
additionalUrls
);
List
<
URL
>
processedUrls
=
new
ArrayList
<>
(
additionalUrls
);
for
(
URL
url
:
urls
)
{
for
(
URL
url
:
urls
)
{
if
(!
filter
.
isExcluded
(
url
))
{
if
(!
filter
.
isExcluded
(
url
))
{
processedUrls
.
add
(
url
);
processedUrls
.
add
(
url
);
...
...
spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtension.java
View file @
2c1e81ad
...
@@ -81,7 +81,7 @@ class ModifiedClassPathExtension implements InvocationInterceptor {
...
@@ -81,7 +81,7 @@ class ModifiedClassPathExtension implements InvocationInterceptor {
}
}
private
void
runTestWithModifiedClassPath
(
ReflectiveInvocationContext
<
Method
>
invocationContext
,
private
void
runTestWithModifiedClassPath
(
ReflectiveInvocationContext
<
Method
>
invocationContext
,
ExtensionContext
extensionContext
)
throws
ClassNotFoundException
,
Throwable
{
ExtensionContext
extensionContext
)
throws
Throwable
{
Class
<?>
testClass
=
extensionContext
.
getRequiredTestClass
();
Class
<?>
testClass
=
extensionContext
.
getRequiredTestClass
();
Method
testMethod
=
invocationContext
.
getExecutable
();
Method
testMethod
=
invocationContext
.
getExecutable
();
ClassLoader
originalClassLoader
=
Thread
.
currentThread
().
getContextClassLoader
();
ClassLoader
originalClassLoader
=
Thread
.
currentThread
().
getContextClassLoader
();
...
@@ -95,8 +95,7 @@ class ModifiedClassPathExtension implements InvocationInterceptor {
...
@@ -95,8 +95,7 @@ class ModifiedClassPathExtension implements InvocationInterceptor {
}
}
}
}
private
void
runTest
(
ClassLoader
classLoader
,
String
testClassName
,
String
testMethodName
)
private
void
runTest
(
ClassLoader
classLoader
,
String
testClassName
,
String
testMethodName
)
throws
Throwable
{
throws
ClassNotFoundException
,
Throwable
{
Class
<?>
testClass
=
classLoader
.
loadClass
(
testClassName
);
Class
<?>
testClass
=
classLoader
.
loadClass
(
testClassName
);
Method
testMethod
=
findMethod
(
testClass
,
testMethodName
);
Method
testMethod
=
findMethod
(
testClass
,
testMethodName
);
LauncherDiscoveryRequest
request
=
new
LauncherDiscoveryRequestBuilder
(
classLoader
)
LauncherDiscoveryRequest
request
=
new
LauncherDiscoveryRequestBuilder
(
classLoader
)
...
...
spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/compiler/TestCompiler.java
View file @
2c1e81ad
...
@@ -20,6 +20,7 @@ import java.io.File;
...
@@ -20,6 +20,7 @@ import java.io.File;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.Collections
;
import
javax.annotation.processing.Processor
;
import
javax.annotation.processing.Processor
;
import
javax.tools.JavaCompiler
;
import
javax.tools.JavaCompiler
;
...
@@ -59,7 +60,7 @@ public class TestCompiler {
...
@@ -59,7 +60,7 @@ public class TestCompiler {
this
.
fileManager
=
compiler
.
getStandardFileManager
(
null
,
null
,
null
);
this
.
fileManager
=
compiler
.
getStandardFileManager
(
null
,
null
,
null
);
this
.
outputLocation
=
outputLocation
;
this
.
outputLocation
=
outputLocation
;
this
.
outputLocation
.
mkdirs
();
this
.
outputLocation
.
mkdirs
();
Iterable
<?
extends
File
>
temp
=
Arrays
.
as
List
(
this
.
outputLocation
);
Iterable
<?
extends
File
>
temp
=
Collections
.
singleton
List
(
this
.
outputLocation
);
this
.
fileManager
.
setLocation
(
StandardLocation
.
CLASS_OUTPUT
,
temp
);
this
.
fileManager
.
setLocation
(
StandardLocation
.
CLASS_OUTPUT
,
temp
);
this
.
fileManager
.
setLocation
(
StandardLocation
.
SOURCE_OUTPUT
,
temp
);
this
.
fileManager
.
setLocation
(
StandardLocation
.
SOURCE_OUTPUT
,
temp
);
}
}
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactory.java
View file @
2c1e81ad
...
@@ -521,7 +521,7 @@ public class JettyServletWebServerFactory extends AbstractServletWebServerFactor
...
@@ -521,7 +521,7 @@ public class JettyServletWebServerFactory extends AbstractServletWebServerFactor
}
}
@Override
@Override
public
Resource
addPath
(
String
path
)
throws
IOException
,
MalformedURLException
{
public
Resource
addPath
(
String
path
)
throws
IOException
{
if
(
path
.
startsWith
(
"/org/springframework/boot"
))
{
if
(
path
.
startsWith
(
"/org/springframework/boot"
))
{
return
null
;
return
null
;
}
}
...
...
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