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
aeb88519
Commit
aeb88519
authored
Jul 29, 2018
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish ternary expressions
parent
b24bb688
Changes
49
Hide whitespace changes
Inline
Side-by-side
Showing
49 changed files
with
59 additions
and
60 deletions
+59
-60
ConditionsReportEndpoint.java
...ate/autoconfigure/condition/ConditionsReportEndpoint.java
+1
-1
PropertiesMeterFilter.java
.../actuate/autoconfigure/metrics/PropertiesMeterFilter.java
+1
-1
EndpointDiscoverer.java
.../boot/actuate/endpoint/annotation/EndpointDiscoverer.java
+1
-1
ServletEndpointRegistrar.java
...k/boot/actuate/endpoint/web/ServletEndpointRegistrar.java
+1
-1
JerseyEndpointResourceFactory.java
...te/endpoint/web/jersey/JerseyEndpointResourceFactory.java
+1
-1
MetricsEndpoint.java
...springframework/boot/actuate/metrics/MetricsEndpoint.java
+1
-1
WebMvcTags.java
...ramework/boot/actuate/metrics/web/servlet/WebMvcTags.java
+1
-1
HttpExchangeTracer.java
...framework/boot/actuate/trace/http/HttpExchangeTracer.java
+1
-1
RabbitProperties.java
...ngframework/boot/autoconfigure/amqp/RabbitProperties.java
+1
-1
ConditionMessage.java
...mework/boot/autoconfigure/condition/ConditionMessage.java
+1
-1
ConditionOutcome.java
...mework/boot/autoconfigure/condition/ConditionOutcome.java
+1
-1
H2ConsoleAutoConfiguration.java
...ork/boot/autoconfigure/h2/H2ConsoleAutoConfiguration.java
+1
-1
ProjectInfoAutoConfiguration.java
...boot/autoconfigure/info/ProjectInfoAutoConfiguration.java
+1
-1
JerseyAutoConfiguration.java
...rk/boot/autoconfigure/jersey/JerseyAutoConfiguration.java
+1
-1
ResourceProperties.java
...gframework/boot/autoconfigure/web/ResourceProperties.java
+1
-1
WebConversionService.java
...k/boot/autoconfigure/web/format/WebConversionService.java
+1
-1
WebServicesAutoConfiguration.java
...toconfigure/webservices/WebServicesAutoConfiguration.java
+2
-2
CommandRunner.java
...a/org/springframework/boot/cli/command/CommandRunner.java
+1
-1
InitializrServiceMetadata.java
...work/boot/cli/command/init/InitializrServiceMetadata.java
+1
-1
ShellPrompts.java
.../springframework/boot/cli/command/shell/ShellPrompts.java
+1
-1
GroovyCompiler.java
...org/springframework/boot/cli/compiler/GroovyCompiler.java
+1
-1
CliTester.java
...src/test/java/org/springframework/boot/cli/CliTester.java
+1
-1
HttpTunnelConnection.java
...ork/boot/devtools/tunnel/client/HttpTunnelConnection.java
+1
-1
HttpTunnelConnectionTests.java
...oot/devtools/tunnel/client/HttpTunnelConnectionTests.java
+1
-2
AnnotationsPropertySource.java
...t/autoconfigure/properties/AnnotationsPropertySource.java
+1
-1
JsonContentAssert.java
...org/springframework/boot/test/json/JsonContentAssert.java
+3
-3
JsonReader.java
...pringframework/boot/configurationmetadata/JsonReader.java
+1
-1
ConfigurationMetadataAnnotationProcessor.java
...onprocessor/ConfigurationMetadataAnnotationProcessor.java
+2
-2
JsonMarshaller.java
.../boot/configurationprocessor/metadata/JsonMarshaller.java
+1
-1
JavaExecutable.java
...org/springframework/boot/loader/tools/JavaExecutable.java
+1
-1
PropertiesLauncher.java
...a/org/springframework/boot/loader/PropertiesLauncher.java
+1
-1
Handler.java
...ain/java/org/springframework/boot/loader/jar/Handler.java
+2
-2
JarURLConnection.java
...org/springframework/boot/loader/jar/JarURLConnection.java
+2
-2
ImageBanner.java
...t/src/main/java/org/springframework/boot/ImageBanner.java
+1
-1
ResourceBanner.java
...rc/main/java/org/springframework/boot/ResourceBanner.java
+1
-1
SpringApplicationBannerPrinter.java
.../springframework/boot/SpringApplicationBannerPrinter.java
+1
-1
ContextIdApplicationContextInitializer.java
.../boot/context/ContextIdApplicationContextInitializer.java
+1
-1
ConfigFileApplicationListener.java
...rk/boot/context/config/ConfigFileApplicationListener.java
+1
-1
LoggingApplicationListener.java
...work/boot/context/logging/LoggingApplicationListener.java
+1
-1
MapBinder.java
...ringframework/boot/context/properties/bind/MapBinder.java
+1
-1
ConfigurationPropertyName.java
.../context/properties/source/ConfigurationPropertyName.java
+5
-5
FilteredConfigurationPropertiesSource.java
...perties/source/FilteredConfigurationPropertiesSource.java
+1
-1
SystemEnvironmentPropertyMapper.java
...xt/properties/source/SystemEnvironmentPropertyMapper.java
+1
-1
ApplicationHome.java
...java/org/springframework/boot/system/ApplicationHome.java
+1
-1
ServerPortInfoApplicationContextInitializer.java
.../context/ServerPortInfoApplicationContextInitializer.java
+1
-1
TomcatWebServer.java
...ngframework/boot/web/embedded/tomcat/TomcatWebServer.java
+1
-1
ServletContextInitializerBeans.java
...work/boot/web/servlet/ServletContextInitializerBeans.java
+1
-1
AbstractServletWebServerFactoryTests.java
.../servlet/server/AbstractServletWebServerFactoryTests.java
+1
-1
ChatService.java
...mosphere/src/main/java/sample/atmosphere/ChatService.java
+1
-1
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpoint.java
View file @
aeb88519
...
@@ -209,7 +209,7 @@ public class ConditionsReportEndpoint {
...
@@ -209,7 +209,7 @@ public class ConditionsReportEndpoint {
this
.
message
=
outcome
.
getMessage
();
this
.
message
=
outcome
.
getMessage
();
}
}
else
{
else
{
this
.
message
=
(
outcome
.
isMatch
()
?
"matched"
:
"did not match"
)
;
this
.
message
=
outcome
.
isMatch
()
?
"matched"
:
"did not match"
;
}
}
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilter.java
View file @
aeb88519
...
@@ -51,7 +51,7 @@ public class PropertiesMeterFilter implements MeterFilter {
...
@@ -51,7 +51,7 @@ public class PropertiesMeterFilter implements MeterFilter {
@Override
@Override
public
MeterFilterReply
accept
(
Meter
.
Id
id
)
{
public
MeterFilterReply
accept
(
Meter
.
Id
id
)
{
boolean
enabled
=
lookup
(
this
.
properties
.
getEnable
(),
id
,
true
);
boolean
enabled
=
lookup
(
this
.
properties
.
getEnable
(),
id
,
true
);
return
(
enabled
?
MeterFilterReply
.
NEUTRAL
:
MeterFilterReply
.
DENY
)
;
return
enabled
?
MeterFilterReply
.
NEUTRAL
:
MeterFilterReply
.
DENY
;
}
}
@Override
@Override
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscoverer.java
View file @
aeb88519
...
@@ -224,7 +224,7 @@ public abstract class EndpointDiscoverer<E extends ExposableEndpoint<O>, O exten
...
@@ -224,7 +224,7 @@ public abstract class EndpointDiscoverer<E extends ExposableEndpoint<O>, O exten
}
}
private
<
T
>
T
getLast
(
List
<
T
>
list
)
{
private
<
T
>
T
getLast
(
List
<
T
>
list
)
{
return
(
CollectionUtils
.
isEmpty
(
list
)
?
null
:
list
.
get
(
list
.
size
()
-
1
)
);
return
CollectionUtils
.
isEmpty
(
list
)
?
null
:
list
.
get
(
list
.
size
()
-
1
);
}
}
private
void
assertNoDuplicateOperations
(
EndpointBean
endpointBean
,
private
void
assertNoDuplicateOperations
(
EndpointBean
endpointBean
,
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java
View file @
aeb88519
...
@@ -61,7 +61,7 @@ public class ServletEndpointRegistrar implements ServletContextInitializer {
...
@@ -61,7 +61,7 @@ public class ServletEndpointRegistrar implements ServletContextInitializer {
ExposableServletEndpoint
endpoint
)
{
ExposableServletEndpoint
endpoint
)
{
String
name
=
endpoint
.
getId
()
+
"-actuator-endpoint"
;
String
name
=
endpoint
.
getId
()
+
"-actuator-endpoint"
;
String
path
=
this
.
basePath
+
"/"
+
endpoint
.
getRootPath
();
String
path
=
this
.
basePath
+
"/"
+
endpoint
.
getRootPath
();
String
urlMapping
=
(
path
.
endsWith
(
"/"
)
?
path
+
"*"
:
path
+
"/*"
)
;
String
urlMapping
=
path
.
endsWith
(
"/"
)
?
path
+
"*"
:
path
+
"/*"
;
EndpointServlet
endpointServlet
=
endpoint
.
getEndpointServlet
();
EndpointServlet
endpointServlet
=
endpoint
.
getEndpointServlet
();
Dynamic
registration
=
servletContext
.
addServlet
(
name
,
Dynamic
registration
=
servletContext
.
addServlet
(
name
,
endpointServlet
.
getServlet
());
endpointServlet
.
getServlet
());
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/jersey/JerseyEndpointResourceFactory.java
View file @
aeb88519
...
@@ -188,7 +188,7 @@ public class JerseyEndpointResourceFactory {
...
@@ -188,7 +188,7 @@ public class JerseyEndpointResourceFactory {
private
Response
convertToJaxRsResponse
(
Object
response
,
String
httpMethod
)
{
private
Response
convertToJaxRsResponse
(
Object
response
,
String
httpMethod
)
{
if
(
response
==
null
)
{
if
(
response
==
null
)
{
boolean
isGet
=
HttpMethod
.
GET
.
equals
(
httpMethod
);
boolean
isGet
=
HttpMethod
.
GET
.
equals
(
httpMethod
);
Status
status
=
(
isGet
?
Status
.
NOT_FOUND
:
Status
.
NO_CONTENT
)
;
Status
status
=
isGet
?
Status
.
NOT_FOUND
:
Status
.
NO_CONTENT
;
return
Response
.
status
(
status
).
build
();
return
Response
.
status
(
status
).
build
();
}
}
try
{
try
{
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/MetricsEndpoint.java
View file @
aeb88519
...
@@ -132,7 +132,7 @@ public class MetricsEndpoint {
...
@@ -132,7 +132,7 @@ public class MetricsEndpoint {
}
}
private
BiFunction
<
Double
,
Double
,
Double
>
mergeFunction
(
Statistic
statistic
)
{
private
BiFunction
<
Double
,
Double
,
Double
>
mergeFunction
(
Statistic
statistic
)
{
return
(
Statistic
.
MAX
.
equals
(
statistic
)
?
Double:
:
max
:
Double:
:
sum
)
;
return
Statistic
.
MAX
.
equals
(
statistic
)
?
Double:
:
max
:
Double:
:
sum
;
}
}
private
Map
<
String
,
Set
<
String
>>
getAvailableTags
(
List
<
Meter
>
meters
)
{
private
Map
<
String
,
Set
<
String
>>
getAvailableTags
(
List
<
Meter
>
meters
)
{
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcTags.java
View file @
aeb88519
...
@@ -123,7 +123,7 @@ public final class WebMvcTags {
...
@@ -123,7 +123,7 @@ public final class WebMvcTags {
private
static
String
getPathInfo
(
HttpServletRequest
request
)
{
private
static
String
getPathInfo
(
HttpServletRequest
request
)
{
String
pathInfo
=
request
.
getPathInfo
();
String
pathInfo
=
request
.
getPathInfo
();
String
uri
=
(
StringUtils
.
hasText
(
pathInfo
)
?
pathInfo
:
"/"
)
;
String
uri
=
StringUtils
.
hasText
(
pathInfo
)
?
pathInfo
:
"/"
;
return
uri
.
replaceAll
(
"//+"
,
"/"
).
replaceAll
(
"/$"
,
""
);
return
uri
.
replaceAll
(
"//+"
,
"/"
).
replaceAll
(
"/$"
,
""
);
}
}
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/http/HttpExchangeTracer.java
View file @
aeb88519
...
@@ -86,7 +86,7 @@ public class HttpExchangeTracer {
...
@@ -86,7 +86,7 @@ public class HttpExchangeTracer {
}
}
private
<
T
>
T
getIfIncluded
(
Include
include
,
Supplier
<
T
>
valueSupplier
)
{
private
<
T
>
T
getIfIncluded
(
Include
include
,
Supplier
<
T
>
valueSupplier
)
{
return
(
this
.
includes
.
contains
(
include
)
?
valueSupplier
.
get
()
:
null
)
;
return
this
.
includes
.
contains
(
include
)
?
valueSupplier
.
get
()
:
null
;
}
}
private
<
T
>
void
setIfIncluded
(
Include
include
,
Supplier
<
T
>
supplier
,
private
<
T
>
void
setIfIncluded
(
Include
include
,
Supplier
<
T
>
supplier
,
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java
View file @
aeb88519
...
@@ -260,7 +260,7 @@ public class RabbitProperties {
...
@@ -260,7 +260,7 @@ public class RabbitProperties {
}
}
public
void
setVirtualHost
(
String
virtualHost
)
{
public
void
setVirtualHost
(
String
virtualHost
)
{
this
.
virtualHost
=
(
""
.
equals
(
virtualHost
)
?
"/"
:
virtualHost
)
;
this
.
virtualHost
=
""
.
equals
(
virtualHost
)
?
"/"
:
virtualHost
;
}
}
public
Duration
getRequestedHeartbeat
()
{
public
Duration
getRequestedHeartbeat
()
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java
View file @
aeb88519
...
@@ -48,7 +48,7 @@ public final class ConditionMessage {
...
@@ -48,7 +48,7 @@ public final class ConditionMessage {
}
}
private
ConditionMessage
(
ConditionMessage
prior
,
String
message
)
{
private
ConditionMessage
(
ConditionMessage
prior
,
String
message
)
{
this
.
message
=
(
prior
.
isEmpty
()
?
message
:
prior
+
"; "
+
message
)
;
this
.
message
=
prior
.
isEmpty
()
?
message
:
prior
+
"; "
+
message
;
}
}
/**
/**
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionOutcome.java
View file @
aeb88519
...
@@ -111,7 +111,7 @@ public class ConditionOutcome {
...
@@ -111,7 +111,7 @@ public class ConditionOutcome {
* @return the message or {@code null}
* @return the message or {@code null}
*/
*/
public
String
getMessage
()
{
public
String
getMessage
()
{
return
(
this
.
message
.
isEmpty
()
?
null
:
this
.
message
.
toString
()
);
return
this
.
message
.
isEmpty
()
?
null
:
this
.
message
.
toString
(
);
}
}
/**
/**
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/h2/H2ConsoleAutoConfiguration.java
View file @
aeb88519
...
@@ -52,7 +52,7 @@ public class H2ConsoleAutoConfiguration {
...
@@ -52,7 +52,7 @@ public class H2ConsoleAutoConfiguration {
@Bean
@Bean
public
ServletRegistrationBean
<
WebServlet
>
h2Console
()
{
public
ServletRegistrationBean
<
WebServlet
>
h2Console
()
{
String
path
=
this
.
properties
.
getPath
();
String
path
=
this
.
properties
.
getPath
();
String
urlMapping
=
(
path
.
endsWith
(
"/"
)
?
path
+
"*"
:
path
+
"/*"
)
;
String
urlMapping
=
path
.
endsWith
(
"/"
)
?
path
+
"*"
:
path
+
"/*"
;
ServletRegistrationBean
<
WebServlet
>
registration
=
new
ServletRegistrationBean
<>(
ServletRegistrationBean
<
WebServlet
>
registration
=
new
ServletRegistrationBean
<>(
new
WebServlet
(),
urlMapping
);
new
WebServlet
(),
urlMapping
);
H2ConsoleProperties
.
Settings
settings
=
this
.
properties
.
getSettings
();
H2ConsoleProperties
.
Settings
settings
=
this
.
properties
.
getSettings
();
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfiguration.java
View file @
aeb88519
...
@@ -72,7 +72,7 @@ public class ProjectInfoAutoConfiguration {
...
@@ -72,7 +72,7 @@ public class ProjectInfoAutoConfiguration {
}
}
protected
Properties
loadFrom
(
Resource
location
,
String
prefix
)
throws
IOException
{
protected
Properties
loadFrom
(
Resource
location
,
String
prefix
)
throws
IOException
{
String
p
=
(
prefix
.
endsWith
(
"."
)
?
prefix
:
prefix
+
"."
)
;
String
p
=
prefix
.
endsWith
(
"."
)
?
prefix
:
prefix
+
"."
;
Properties
source
=
PropertiesLoaderUtils
.
loadProperties
(
location
);
Properties
source
=
PropertiesLoaderUtils
.
loadProperties
(
location
);
Properties
target
=
new
Properties
();
Properties
target
=
new
Properties
();
for
(
String
key
:
source
.
stringPropertyNames
())
{
for
(
String
key
:
source
.
stringPropertyNames
())
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfiguration.java
View file @
aeb88519
...
@@ -195,7 +195,7 @@ public class JerseyAutoConfiguration implements ServletContextAware {
...
@@ -195,7 +195,7 @@ public class JerseyAutoConfiguration implements ServletContextAware {
if
(!
applicationPath
.
startsWith
(
"/"
))
{
if
(!
applicationPath
.
startsWith
(
"/"
))
{
applicationPath
=
"/"
+
applicationPath
;
applicationPath
=
"/"
+
applicationPath
;
}
}
return
(
applicationPath
.
equals
(
"/"
)
?
"/*"
:
applicationPath
+
"/*"
)
;
return
applicationPath
.
equals
(
"/"
)
?
"/*"
:
applicationPath
+
"/*"
;
}
}
@Override
@Override
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ResourceProperties.java
View file @
aeb88519
...
@@ -69,7 +69,7 @@ public class ResourceProperties {
...
@@ -69,7 +69,7 @@ public class ResourceProperties {
String
[]
normalized
=
new
String
[
staticLocations
.
length
];
String
[]
normalized
=
new
String
[
staticLocations
.
length
];
for
(
int
i
=
0
;
i
<
staticLocations
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
staticLocations
.
length
;
i
++)
{
String
location
=
staticLocations
[
i
];
String
location
=
staticLocations
[
i
];
normalized
[
i
]
=
(
location
.
endsWith
(
"/"
)
?
location
:
location
+
"/"
)
;
normalized
[
i
]
=
location
.
endsWith
(
"/"
)
?
location
:
location
+
"/"
;
}
}
return
normalized
;
return
normalized
;
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/format/WebConversionService.java
View file @
aeb88519
...
@@ -61,7 +61,7 @@ public class WebConversionService extends DefaultFormattingConversionService {
...
@@ -61,7 +61,7 @@ public class WebConversionService extends DefaultFormattingConversionService {
*/
*/
public
WebConversionService
(
String
dateFormat
)
{
public
WebConversionService
(
String
dateFormat
)
{
super
(
false
);
super
(
false
);
this
.
dateFormat
=
(
StringUtils
.
hasText
(
dateFormat
)
?
dateFormat
:
null
)
;
this
.
dateFormat
=
StringUtils
.
hasText
(
dateFormat
)
?
dateFormat
:
null
;
if
(
this
.
dateFormat
!=
null
)
{
if
(
this
.
dateFormat
!=
null
)
{
addFormatters
();
addFormatters
();
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfiguration.java
View file @
aeb88519
...
@@ -77,7 +77,7 @@ public class WebServicesAutoConfiguration {
...
@@ -77,7 +77,7 @@ public class WebServicesAutoConfiguration {
MessageDispatcherServlet
servlet
=
new
MessageDispatcherServlet
();
MessageDispatcherServlet
servlet
=
new
MessageDispatcherServlet
();
servlet
.
setApplicationContext
(
applicationContext
);
servlet
.
setApplicationContext
(
applicationContext
);
String
path
=
this
.
properties
.
getPath
();
String
path
=
this
.
properties
.
getPath
();
String
urlMapping
=
(
path
.
endsWith
(
"/"
)
?
path
+
"*"
:
path
+
"/*"
)
;
String
urlMapping
=
path
.
endsWith
(
"/"
)
?
path
+
"*"
:
path
+
"/*"
;
ServletRegistrationBean
<
MessageDispatcherServlet
>
registration
=
new
ServletRegistrationBean
<>(
ServletRegistrationBean
<
MessageDispatcherServlet
>
registration
=
new
ServletRegistrationBean
<>(
servlet
,
urlMapping
);
servlet
,
urlMapping
);
WebServicesProperties
.
Servlet
servletProperties
=
this
.
properties
.
getServlet
();
WebServicesProperties
.
Servlet
servletProperties
=
this
.
properties
.
getServlet
();
...
@@ -152,7 +152,7 @@ public class WebServicesAutoConfiguration {
...
@@ -152,7 +152,7 @@ public class WebServicesAutoConfiguration {
}
}
private
String
ensureTrailingSlash
(
String
path
)
{
private
String
ensureTrailingSlash
(
String
path
)
{
return
(
path
.
endsWith
(
"/"
)
?
path
:
path
+
"/"
)
;
return
path
.
endsWith
(
"/"
)
?
path
:
path
+
"/"
;
}
}
}
}
...
...
spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java
View file @
aeb88519
...
@@ -54,7 +54,7 @@ public class CommandRunner implements Iterable<Command> {
...
@@ -54,7 +54,7 @@ public class CommandRunner implements Iterable<Command> {
* @param name the name of the runner or {@code null}
* @param name the name of the runner or {@code null}
*/
*/
public
CommandRunner
(
String
name
)
{
public
CommandRunner
(
String
name
)
{
this
.
name
=
(
StringUtils
.
hasLength
(
name
)
?
name
+
" "
:
""
)
;
this
.
name
=
StringUtils
.
hasLength
(
name
)
?
name
+
" "
:
""
;
}
}
/**
/**
...
...
spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/InitializrServiceMetadata.java
View file @
aeb88519
...
@@ -212,7 +212,7 @@ class InitializrServiceMetadata {
...
@@ -212,7 +212,7 @@ class InitializrServiceMetadata {
private
String
getStringValue
(
JSONObject
object
,
String
name
,
String
defaultValue
)
private
String
getStringValue
(
JSONObject
object
,
String
name
,
String
defaultValue
)
throws
JSONException
{
throws
JSONException
{
return
(
object
.
has
(
name
)
?
object
.
getString
(
name
)
:
defaultValue
)
;
return
object
.
has
(
name
)
?
object
.
getString
(
name
)
:
defaultValue
;
}
}
private
Map
<
String
,
String
>
parseStringItems
(
JSONObject
json
)
throws
JSONException
{
private
Map
<
String
,
String
>
parseStringItems
(
JSONObject
json
)
throws
JSONException
{
...
...
spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/ShellPrompts.java
View file @
aeb88519
...
@@ -54,7 +54,7 @@ public class ShellPrompts {
...
@@ -54,7 +54,7 @@ public class ShellPrompts {
* @return the current prompt
* @return the current prompt
*/
*/
public
String
getPrompt
()
{
public
String
getPrompt
()
{
return
(
this
.
prompts
.
isEmpty
()
?
DEFAULT_PROMPT
:
this
.
prompts
.
peek
()
);
return
this
.
prompts
.
isEmpty
()
?
DEFAULT_PROMPT
:
this
.
prompts
.
peek
(
);
}
}
}
}
spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java
View file @
aeb88519
...
@@ -322,7 +322,7 @@ public class GroovyCompiler {
...
@@ -322,7 +322,7 @@ public class GroovyCompiler {
return
node
;
return
node
;
}
}
}
}
return
(
classes
.
isEmpty
()
?
null
:
classes
.
get
(
0
)
);
return
classes
.
isEmpty
()
?
null
:
classes
.
get
(
0
);
}
}
}
}
...
...
spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/CliTester.java
View file @
aeb88519
...
@@ -154,7 +154,7 @@ public class CliTester implements TestRule {
...
@@ -154,7 +154,7 @@ public class CliTester implements TestRule {
}
}
}
}
else
{
else
{
sources
[
i
]
=
(
new
File
(
arg
).
isAbsolute
()
?
arg
:
this
.
prefix
+
arg
)
;
sources
[
i
]
=
new
File
(
arg
).
isAbsolute
()
?
arg
:
this
.
prefix
+
arg
;
}
}
}
}
return
sources
;
return
sources
;
...
...
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/tunnel/client/HttpTunnelConnection.java
View file @
aeb88519
...
@@ -101,7 +101,7 @@ public class HttpTunnelConnection implements TunnelConnection {
...
@@ -101,7 +101,7 @@ public class HttpTunnelConnection implements TunnelConnection {
protected
final
ClientHttpRequest
createRequest
(
boolean
hasPayload
)
protected
final
ClientHttpRequest
createRequest
(
boolean
hasPayload
)
throws
IOException
{
throws
IOException
{
HttpMethod
method
=
(
hasPayload
?
HttpMethod
.
POST
:
HttpMethod
.
GET
)
;
HttpMethod
method
=
hasPayload
?
HttpMethod
.
POST
:
HttpMethod
.
GET
;
return
this
.
requestFactory
.
createRequest
(
this
.
uri
,
method
);
return
this
.
requestFactory
.
createRequest
(
this
.
uri
,
method
);
}
}
...
...
spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/client/HttpTunnelConnectionTests.java
View file @
aeb88519
...
@@ -161,8 +161,7 @@ public class HttpTunnelConnectionTests {
...
@@ -161,8 +161,7 @@ public class HttpTunnelConnectionTests {
private
TunnelChannel
openTunnel
(
boolean
singleThreaded
)
throws
Exception
{
private
TunnelChannel
openTunnel
(
boolean
singleThreaded
)
throws
Exception
{
HttpTunnelConnection
connection
=
new
HttpTunnelConnection
(
this
.
url
,
HttpTunnelConnection
connection
=
new
HttpTunnelConnection
(
this
.
url
,
this
.
requestFactory
,
this
.
requestFactory
,
singleThreaded
?
new
CurrentThreadExecutor
()
:
null
);
(
singleThreaded
?
new
CurrentThreadExecutor
()
:
null
));
return
connection
.
open
(
this
.
incomingChannel
,
this
.
closeable
);
return
connection
.
open
(
this
.
incomingChannel
,
this
.
closeable
);
}
}
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySource.java
View file @
aeb88519
...
@@ -164,7 +164,7 @@ public class AnnotationsPropertySource extends EnumerablePropertySource<Class<?>
...
@@ -164,7 +164,7 @@ public class AnnotationsPropertySource extends EnumerablePropertySource<Class<?>
private
String
dotAppend
(
String
prefix
,
String
postfix
)
{
private
String
dotAppend
(
String
prefix
,
String
postfix
)
{
if
(
StringUtils
.
hasText
(
prefix
))
{
if
(
StringUtils
.
hasText
(
prefix
))
{
return
(
prefix
.
endsWith
(
"."
)
?
prefix
+
postfix
:
prefix
+
"."
+
postfix
)
;
return
prefix
.
endsWith
(
"."
)
?
prefix
+
postfix
:
prefix
+
"."
+
postfix
;
}
}
return
postfix
;
return
postfix
;
}
}
...
...
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContentAssert.java
View file @
aeb88519
...
@@ -991,7 +991,7 @@ public class JsonContentAssert extends AbstractAssert<JsonContentAssert, CharSeq
...
@@ -991,7 +991,7 @@ public class JsonContentAssert extends AbstractAssert<JsonContentAssert, CharSeq
}
}
try
{
try
{
return
JSONCompare
.
compareJSON
(
return
JSONCompare
.
compareJSON
(
(
(
expectedJson
!=
null
)
?
expectedJson
.
toString
()
:
null
)
,
(
expectedJson
!=
null
)
?
expectedJson
.
toString
()
:
null
,
this
.
actual
.
toString
(),
compareMode
);
this
.
actual
.
toString
(),
compareMode
);
}
}
catch
(
Exception
ex
)
{
catch
(
Exception
ex
)
{
...
@@ -1009,7 +1009,7 @@ public class JsonContentAssert extends AbstractAssert<JsonContentAssert, CharSeq
...
@@ -1009,7 +1009,7 @@ public class JsonContentAssert extends AbstractAssert<JsonContentAssert, CharSeq
}
}
try
{
try
{
return
JSONCompare
.
compareJSON
(
return
JSONCompare
.
compareJSON
(
(
(
expectedJson
!=
null
)
?
expectedJson
.
toString
()
:
null
)
,
(
expectedJson
!=
null
)
?
expectedJson
.
toString
()
:
null
,
this
.
actual
.
toString
(),
comparator
);
this
.
actual
.
toString
(),
comparator
);
}
}
catch
(
Exception
ex
)
{
catch
(
Exception
ex
)
{
...
@@ -1054,7 +1054,7 @@ public class JsonContentAssert extends AbstractAssert<JsonContentAssert, CharSeq
...
@@ -1054,7 +1054,7 @@ public class JsonContentAssert extends AbstractAssert<JsonContentAssert, CharSeq
JsonPathValue
(
CharSequence
expression
,
Object
...
args
)
{
JsonPathValue
(
CharSequence
expression
,
Object
...
args
)
{
org
.
springframework
.
util
.
Assert
.
hasText
(
org
.
springframework
.
util
.
Assert
.
hasText
(
(
(
expression
!=
null
)
?
expression
.
toString
()
:
null
)
,
(
expression
!=
null
)
?
expression
.
toString
()
:
null
,
"expression must not be null or empty"
);
"expression must not be null or empty"
);
this
.
expression
=
String
.
format
(
expression
.
toString
(),
args
);
this
.
expression
=
String
.
format
(
expression
.
toString
(),
args
);
this
.
jsonPath
=
JsonPath
.
compile
(
this
.
expression
);
this
.
jsonPath
=
JsonPath
.
compile
(
this
.
expression
);
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/src/main/java/org/springframework/boot/configurationmetadata/JsonReader.java
View file @
aeb88519
...
@@ -178,7 +178,7 @@ class JsonReader {
...
@@ -178,7 +178,7 @@ class JsonReader {
.
setReplacement
(
deprecationJsonObject
.
optString
(
"replacement"
,
null
));
.
setReplacement
(
deprecationJsonObject
.
optString
(
"replacement"
,
null
));
return
deprecation
;
return
deprecation
;
}
}
return
(
object
.
optBoolean
(
"deprecated"
)
?
new
Deprecation
()
:
null
)
;
return
object
.
optBoolean
(
"deprecated"
)
?
new
Deprecation
()
:
null
;
}
}
private
Deprecation
.
Level
parseDeprecationLevel
(
String
value
)
{
private
Deprecation
.
Level
parseDeprecationLevel
(
String
value
)
{
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessor.java
View file @
aeb88519
...
@@ -302,7 +302,7 @@ public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor
...
@@ -302,7 +302,7 @@ public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor
||
isDeprecated
(
source
);
||
isDeprecated
(
source
);
this
.
metadataCollector
.
add
(
ItemMetadata
.
newProperty
(
prefix
,
name
,
this
.
metadataCollector
.
add
(
ItemMetadata
.
newProperty
(
prefix
,
name
,
dataType
,
sourceType
,
null
,
description
,
defaultValue
,
dataType
,
sourceType
,
null
,
description
,
defaultValue
,
(
deprecated
?
getItemDeprecation
(
getter
)
:
null
)
));
deprecated
?
getItemDeprecation
(
getter
)
:
null
));
}
}
});
});
}
}
...
@@ -344,7 +344,7 @@ public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor
...
@@ -344,7 +344,7 @@ public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor
boolean
deprecated
=
isDeprecated
(
field
)
||
isDeprecated
(
source
);
boolean
deprecated
=
isDeprecated
(
field
)
||
isDeprecated
(
source
);
this
.
metadataCollector
.
add
(
ItemMetadata
.
newProperty
(
prefix
,
name
,
this
.
metadataCollector
.
add
(
ItemMetadata
.
newProperty
(
prefix
,
name
,
dataType
,
sourceType
,
null
,
description
,
defaultValue
,
dataType
,
sourceType
,
null
,
description
,
defaultValue
,
(
deprecated
?
new
ItemDeprecation
()
:
null
)
));
deprecated
?
new
ItemDeprecation
()
:
null
));
}
}
});
});
}
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshaller.java
View file @
aeb88519
...
@@ -111,7 +111,7 @@ public class JsonMarshaller {
...
@@ -111,7 +111,7 @@ public class JsonMarshaller {
.
setReplacement
(
deprecationJsonObject
.
optString
(
"replacement"
,
null
));
.
setReplacement
(
deprecationJsonObject
.
optString
(
"replacement"
,
null
));
return
deprecation
;
return
deprecation
;
}
}
return
(
object
.
optBoolean
(
"deprecated"
)
?
new
ItemDeprecation
()
:
null
)
;
return
object
.
optBoolean
(
"deprecated"
)
?
new
ItemDeprecation
()
:
null
;
}
}
private
ItemHint
toItemHint
(
JSONObject
object
)
throws
Exception
{
private
ItemHint
toItemHint
(
JSONObject
object
)
throws
Exception
{
...
...
spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JavaExecutable.java
View file @
aeb88519
...
@@ -43,7 +43,7 @@ public class JavaExecutable {
...
@@ -43,7 +43,7 @@ public class JavaExecutable {
private
File
findInJavaHome
(
String
javaHome
)
{
private
File
findInJavaHome
(
String
javaHome
)
{
File
bin
=
new
File
(
new
File
(
javaHome
),
"bin"
);
File
bin
=
new
File
(
new
File
(
javaHome
),
"bin"
);
File
command
=
new
File
(
bin
,
"java.exe"
);
File
command
=
new
File
(
bin
,
"java.exe"
);
command
=
(
command
.
exists
()
?
command
:
new
File
(
bin
,
"java"
)
);
command
=
command
.
exists
()
?
command
:
new
File
(
bin
,
"java"
);
Assert
.
state
(
command
.
exists
(),
()
->
"Unable to find java in "
+
javaHome
);
Assert
.
state
(
command
.
exists
(),
()
->
"Unable to find java in "
+
javaHome
);
return
command
;
return
command
;
}
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java
View file @
aeb88519
...
@@ -304,7 +304,7 @@ public class PropertiesLauncher extends Launcher {
...
@@ -304,7 +304,7 @@ public class PropertiesLauncher extends Launcher {
for
(
String
path
:
commaSeparatedPaths
.
split
(
","
))
{
for
(
String
path
:
commaSeparatedPaths
.
split
(
","
))
{
path
=
cleanupPath
(
path
);
path
=
cleanupPath
(
path
);
// "" means the user wants root of archive but not current directory
// "" means the user wants root of archive but not current directory
path
=
(
""
.
equals
(
path
)
?
"/"
:
path
)
;
path
=
""
.
equals
(
path
)
?
"/"
:
path
;
paths
.
add
(
path
);
paths
.
add
(
path
);
}
}
if
(
paths
.
isEmpty
())
{
if
(
paths
.
isEmpty
())
{
...
...
spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/Handler.java
View file @
aeb88519
...
@@ -124,8 +124,8 @@ public class Handler extends URLStreamHandler {
...
@@ -124,8 +124,8 @@ public class Handler extends URLStreamHandler {
private
void
log
(
boolean
warning
,
String
message
,
Exception
cause
)
{
private
void
log
(
boolean
warning
,
String
message
,
Exception
cause
)
{
try
{
try
{
L
ogger
.
getLogger
(
getClass
().
getName
())
L
evel
level
=
warning
?
Level
.
WARNING
:
Level
.
FINEST
;
.
log
((
warning
?
Level
.
WARNING
:
Level
.
FINEST
)
,
message
,
cause
);
Logger
.
getLogger
(
getClass
().
getName
()).
log
(
level
,
message
,
cause
);
}
}
catch
(
Exception
ex
)
{
catch
(
Exception
ex
)
{
if
(
warning
)
{
if
(
warning
)
{
...
...
spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarURLConnection.java
View file @
aeb88519
...
@@ -214,7 +214,7 @@ final class JarURLConnection extends java.net.JarURLConnection {
...
@@ -214,7 +214,7 @@ final class JarURLConnection extends java.net.JarURLConnection {
@Override
@Override
public
Object
getContent
()
throws
IOException
{
public
Object
getContent
()
throws
IOException
{
connect
();
connect
();
return
(
this
.
jarEntryName
.
isEmpty
()
?
this
.
jarFile
:
super
.
getContent
()
);
return
this
.
jarEntryName
.
isEmpty
()
?
this
.
jarFile
:
super
.
getContent
(
);
}
}
@Override
@Override
...
@@ -386,7 +386,7 @@ final class JarURLConnection extends java.net.JarURLConnection {
...
@@ -386,7 +386,7 @@ final class JarURLConnection extends java.net.JarURLConnection {
private
String
deduceContentType
()
{
private
String
deduceContentType
()
{
// Guess the content type, don't bother with streams as mark is not supported
// Guess the content type, don't bother with streams as mark is not supported
String
type
=
(
isEmpty
()
?
"x-java/jar"
:
null
)
;
String
type
=
isEmpty
()
?
"x-java/jar"
:
null
;
type
=
(
type
!=
null
)
?
type
:
guessContentTypeFromName
(
toString
());
type
=
(
type
!=
null
)
?
type
:
guessContentTypeFromName
(
toString
());
type
=
(
type
!=
null
)
?
type
:
"content/unknown"
;
type
=
(
type
!=
null
)
?
type
:
"content/unknown"
;
return
type
;
return
type
;
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ImageBanner.java
View file @
aeb88519
...
@@ -200,7 +200,7 @@ public class ImageBanner implements Banner {
...
@@ -200,7 +200,7 @@ public class ImageBanner implements Banner {
private
void
printBanner
(
BufferedImage
image
,
int
margin
,
boolean
invert
,
private
void
printBanner
(
BufferedImage
image
,
int
margin
,
boolean
invert
,
PrintStream
out
)
{
PrintStream
out
)
{
AnsiElement
background
=
(
invert
?
AnsiBackground
.
BLACK
:
AnsiBackground
.
DEFAULT
)
;
AnsiElement
background
=
invert
?
AnsiBackground
.
BLACK
:
AnsiBackground
.
DEFAULT
;
out
.
print
(
AnsiOutput
.
encode
(
AnsiColor
.
DEFAULT
));
out
.
print
(
AnsiOutput
.
encode
(
AnsiColor
.
DEFAULT
));
out
.
print
(
AnsiOutput
.
encode
(
background
));
out
.
print
(
AnsiOutput
.
encode
(
background
));
out
.
println
();
out
.
println
();
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ResourceBanner.java
View file @
aeb88519
...
@@ -119,7 +119,7 @@ public class ResourceBanner implements Banner {
...
@@ -119,7 +119,7 @@ public class ResourceBanner implements Banner {
if
(
version
==
null
)
{
if
(
version
==
null
)
{
return
""
;
return
""
;
}
}
return
(
format
?
" (v"
+
version
+
")"
:
version
)
;
return
format
?
" (v"
+
version
+
")"
:
version
;
}
}
private
PropertyResolver
getAnsiResolver
()
{
private
PropertyResolver
getAnsiResolver
()
{
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplicationBannerPrinter.java
View file @
aeb88519
...
@@ -99,7 +99,7 @@ class SpringApplicationBannerPrinter {
...
@@ -99,7 +99,7 @@ class SpringApplicationBannerPrinter {
String
location
=
environment
.
getProperty
(
BANNER_IMAGE_LOCATION_PROPERTY
);
String
location
=
environment
.
getProperty
(
BANNER_IMAGE_LOCATION_PROPERTY
);
if
(
StringUtils
.
hasLength
(
location
))
{
if
(
StringUtils
.
hasLength
(
location
))
{
Resource
resource
=
this
.
resourceLoader
.
getResource
(
location
);
Resource
resource
=
this
.
resourceLoader
.
getResource
(
location
);
return
(
resource
.
exists
()
?
new
ImageBanner
(
resource
)
:
null
)
;
return
resource
.
exists
()
?
new
ImageBanner
(
resource
)
:
null
;
}
}
for
(
String
ext
:
IMAGE_EXTENSION
)
{
for
(
String
ext
:
IMAGE_EXTENSION
)
{
Resource
resource
=
this
.
resourceLoader
.
getResource
(
"banner."
+
ext
);
Resource
resource
=
this
.
resourceLoader
.
getResource
(
"banner."
+
ext
);
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/ContextIdApplicationContextInitializer.java
View file @
aeb88519
...
@@ -66,7 +66,7 @@ public class ContextIdApplicationContextInitializer implements
...
@@ -66,7 +66,7 @@ public class ContextIdApplicationContextInitializer implements
private
String
getApplicationId
(
ConfigurableEnvironment
environment
)
{
private
String
getApplicationId
(
ConfigurableEnvironment
environment
)
{
String
name
=
environment
.
getProperty
(
"spring.application.name"
);
String
name
=
environment
.
getProperty
(
"spring.application.name"
);
return
(
StringUtils
.
hasText
(
name
)
?
name
:
"application"
)
;
return
StringUtils
.
hasText
(
name
)
?
name
:
"application"
;
}
}
/**
/**
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java
View file @
aeb88519
...
@@ -445,7 +445,7 @@ public class ConfigFileApplicationListener
...
@@ -445,7 +445,7 @@ public class ConfigFileApplicationListener
DocumentConsumer
consumer
)
{
DocumentConsumer
consumer
)
{
getSearchLocations
().
forEach
((
location
)
->
{
getSearchLocations
().
forEach
((
location
)
->
{
boolean
isFolder
=
location
.
endsWith
(
"/"
);
boolean
isFolder
=
location
.
endsWith
(
"/"
);
Set
<
String
>
names
=
(
isFolder
?
getSearchNames
()
:
NO_SEARCH_NAMES
)
;
Set
<
String
>
names
=
isFolder
?
getSearchNames
()
:
NO_SEARCH_NAMES
;
names
.
forEach
(
names
.
forEach
(
(
name
)
->
load
(
location
,
name
,
profile
,
filterFactory
,
consumer
));
(
name
)
->
load
(
location
,
name
,
profile
,
filterFactory
,
consumer
));
});
});
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java
View file @
aeb88519
...
@@ -310,7 +310,7 @@ public class LoggingApplicationListener implements GenericApplicationListener {
...
@@ -310,7 +310,7 @@ public class LoggingApplicationListener implements GenericApplicationListener {
private
void
setLogLevel
(
LoggingSystem
system
,
String
name
,
String
level
)
{
private
void
setLogLevel
(
LoggingSystem
system
,
String
name
,
String
level
)
{
try
{
try
{
name
=
(
name
.
equalsIgnoreCase
(
LoggingSystem
.
ROOT_LOGGER_NAME
)
?
null
:
name
)
;
name
=
name
.
equalsIgnoreCase
(
LoggingSystem
.
ROOT_LOGGER_NAME
)
?
null
:
name
;
system
.
setLogLevel
(
name
,
coerceLogLevel
(
level
));
system
.
setLogLevel
(
name
,
coerceLogLevel
(
level
));
}
}
catch
(
RuntimeException
ex
)
{
catch
(
RuntimeException
ex
)
{
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java
View file @
aeb88519
...
@@ -71,7 +71,7 @@ class MapBinder extends AggregateBinder<Map<Object, Object>> {
...
@@ -71,7 +71,7 @@ class MapBinder extends AggregateBinder<Map<Object, Object>> {
}
}
new
EntryBinder
(
name
,
resolvedTarget
,
elementBinder
).
bindEntries
(
source
,
map
);
new
EntryBinder
(
name
,
resolvedTarget
,
elementBinder
).
bindEntries
(
source
,
map
);
}
}
return
(
map
.
isEmpty
()
?
null
:
map
)
;
return
map
.
isEmpty
()
?
null
:
map
;
}
}
private
Bindable
<?>
resolveTarget
(
Bindable
<?>
target
)
{
private
Bindable
<?>
resolveTarget
(
Bindable
<?>
target
)
{
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java
View file @
aeb88519
...
@@ -319,17 +319,17 @@ public final class ConfigurationPropertyName
...
@@ -319,17 +319,17 @@ public final class ConfigurationPropertyName
int
l1
=
e1
.
length
();
int
l1
=
e1
.
length
();
int
l2
=
e2
.
length
();
int
l2
=
e2
.
length
();
boolean
indexed1
=
isIndexed
(
e1
);
boolean
indexed1
=
isIndexed
(
e1
);
int
offset1
=
(
indexed1
?
1
:
0
)
;
int
offset1
=
indexed1
?
1
:
0
;
boolean
indexed2
=
isIndexed
(
e2
);
boolean
indexed2
=
isIndexed
(
e2
);
int
offset2
=
(
indexed2
?
1
:
0
)
;
int
offset2
=
indexed2
?
1
:
0
;
int
i1
=
offset1
;
int
i1
=
offset1
;
int
i2
=
offset2
;
int
i2
=
offset2
;
while
(
i1
<
l1
-
offset1
)
{
while
(
i1
<
l1
-
offset1
)
{
if
(
i2
>=
l2
-
offset2
)
{
if
(
i2
>=
l2
-
offset2
)
{
return
false
;
return
false
;
}
}
char
ch1
=
(
indexed1
?
e1
.
charAt
(
i1
)
:
Character
.
toLowerCase
(
e1
.
charAt
(
i1
)
));
char
ch1
=
indexed1
?
e1
.
charAt
(
i1
)
:
Character
.
toLowerCase
(
e1
.
charAt
(
i1
));
char
ch2
=
(
indexed2
?
e2
.
charAt
(
i2
)
:
Character
.
toLowerCase
(
e2
.
charAt
(
i2
)
));
char
ch2
=
indexed2
?
e2
.
charAt
(
i2
)
:
Character
.
toLowerCase
(
e2
.
charAt
(
i2
));
if
(
ch1
==
'-'
||
ch1
==
'_'
)
{
if
(
ch1
==
'-'
||
ch1
==
'_'
)
{
i1
++;
i1
++;
}
}
...
@@ -372,7 +372,7 @@ public final class ConfigurationPropertyName
...
@@ -372,7 +372,7 @@ public final class ConfigurationPropertyName
private
int
getElementHashCode
(
CharSequence
element
)
{
private
int
getElementHashCode
(
CharSequence
element
)
{
int
hash
=
0
;
int
hash
=
0
;
boolean
indexed
=
isIndexed
(
element
);
boolean
indexed
=
isIndexed
(
element
);
int
offset
=
(
indexed
?
1
:
0
)
;
int
offset
=
indexed
?
1
:
0
;
for
(
int
i
=
0
+
offset
;
i
<
element
.
length
()
-
offset
;
i
++)
{
for
(
int
i
=
0
+
offset
;
i
<
element
.
length
()
-
offset
;
i
++)
{
char
ch
=
(
indexed
?
element
.
charAt
(
i
)
char
ch
=
(
indexed
?
element
.
charAt
(
i
)
:
Character
.
toLowerCase
(
element
.
charAt
(
i
)));
:
Character
.
toLowerCase
(
element
.
charAt
(
i
)));
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/FilteredConfigurationPropertiesSource.java
View file @
aeb88519
...
@@ -44,7 +44,7 @@ class FilteredConfigurationPropertiesSource implements ConfigurationPropertySour
...
@@ -44,7 +44,7 @@ class FilteredConfigurationPropertiesSource implements ConfigurationPropertySour
public
ConfigurationProperty
getConfigurationProperty
(
public
ConfigurationProperty
getConfigurationProperty
(
ConfigurationPropertyName
name
)
{
ConfigurationPropertyName
name
)
{
boolean
filtered
=
getFilter
().
test
(
name
);
boolean
filtered
=
getFilter
().
test
(
name
);
return
(
filtered
?
getSource
().
getConfigurationProperty
(
name
)
:
null
)
;
return
filtered
?
getSource
().
getConfigurationProperty
(
name
)
:
null
;
}
}
@Override
@Override
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SystemEnvironmentPropertyMapper.java
View file @
aeb88519
...
@@ -100,7 +100,7 @@ final class SystemEnvironmentPropertyMapper implements PropertyMapper {
...
@@ -100,7 +100,7 @@ final class SystemEnvironmentPropertyMapper implements PropertyMapper {
private
CharSequence
processElementValue
(
CharSequence
value
)
{
private
CharSequence
processElementValue
(
CharSequence
value
)
{
String
result
=
value
.
toString
().
toLowerCase
(
Locale
.
ENGLISH
);
String
result
=
value
.
toString
().
toLowerCase
(
Locale
.
ENGLISH
);
return
(
isNumber
(
result
)
?
"["
+
result
+
"]"
:
result
)
;
return
isNumber
(
result
)
?
"["
+
result
+
"]"
:
result
;
}
}
private
static
boolean
isNumber
(
String
string
)
{
private
static
boolean
isNumber
(
String
string
)
{
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/system/ApplicationHome.java
View file @
aeb88519
...
@@ -140,7 +140,7 @@ public class ApplicationHome {
...
@@ -140,7 +140,7 @@ public class ApplicationHome {
if
(
homeDir
.
isFile
())
{
if
(
homeDir
.
isFile
())
{
homeDir
=
homeDir
.
getParentFile
();
homeDir
=
homeDir
.
getParentFile
();
}
}
homeDir
=
(
homeDir
.
exists
()
?
homeDir
:
new
File
(
"."
)
);
homeDir
=
homeDir
.
exists
()
?
homeDir
:
new
File
(
"."
);
return
homeDir
.
getAbsoluteFile
();
return
homeDir
.
getAbsoluteFile
();
}
}
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/ServerPortInfoApplicationContextInitializer.java
View file @
aeb88519
...
@@ -67,7 +67,7 @@ public class ServerPortInfoApplicationContextInitializer
...
@@ -67,7 +67,7 @@ public class ServerPortInfoApplicationContextInitializer
private
String
getName
(
WebServerApplicationContext
context
)
{
private
String
getName
(
WebServerApplicationContext
context
)
{
String
name
=
context
.
getServerNamespace
();
String
name
=
context
.
getServerNamespace
();
return
(
StringUtils
.
hasText
(
name
)
?
name
:
"server"
)
;
return
StringUtils
.
hasText
(
name
)
?
name
:
"server"
;
}
}
private
void
setPortProperty
(
ApplicationContext
context
,
String
propertyName
,
private
void
setPortProperty
(
ApplicationContext
context
,
String
propertyName
,
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatWebServer.java
View file @
aeb88519
...
@@ -320,7 +320,7 @@ public class TomcatWebServer implements WebServer {
...
@@ -320,7 +320,7 @@ public class TomcatWebServer implements WebServer {
StringBuilder
ports
=
new
StringBuilder
();
StringBuilder
ports
=
new
StringBuilder
();
for
(
Connector
connector
:
this
.
tomcat
.
getService
().
findConnectors
())
{
for
(
Connector
connector
:
this
.
tomcat
.
getService
().
findConnectors
())
{
ports
.
append
((
ports
.
length
()
!=
0
)
?
" "
:
""
);
ports
.
append
((
ports
.
length
()
!=
0
)
?
" "
:
""
);
int
port
=
(
localPort
?
connector
.
getLocalPort
()
:
connector
.
getPort
()
);
int
port
=
localPort
?
connector
.
getLocalPort
()
:
connector
.
getPort
(
);
ports
.
append
(
port
+
" ("
+
connector
.
getScheme
()
+
")"
);
ports
.
append
(
port
+
" ("
+
connector
.
getScheme
()
+
")"
);
}
}
return
ports
.
toString
();
return
ports
.
toString
();
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java
View file @
aeb88519
...
@@ -169,7 +169,7 @@ public class ServletContextInitializerBeans
...
@@ -169,7 +169,7 @@ public class ServletContextInitializerBeans
private
MultipartConfigElement
getMultipartConfig
(
ListableBeanFactory
beanFactory
)
{
private
MultipartConfigElement
getMultipartConfig
(
ListableBeanFactory
beanFactory
)
{
List
<
Entry
<
String
,
MultipartConfigElement
>>
beans
=
getOrderedBeansOfType
(
List
<
Entry
<
String
,
MultipartConfigElement
>>
beans
=
getOrderedBeansOfType
(
beanFactory
,
MultipartConfigElement
.
class
);
beanFactory
,
MultipartConfigElement
.
class
);
return
(
beans
.
isEmpty
()
?
null
:
beans
.
get
(
0
).
getValue
()
);
return
beans
.
isEmpty
()
?
null
:
beans
.
get
(
0
).
getValue
(
);
}
}
private
<
T
>
void
addAsRegistrationBean
(
ListableBeanFactory
beanFactory
,
Class
<
T
>
type
,
private
<
T
>
void
addAsRegistrationBean
(
ListableBeanFactory
beanFactory
,
Class
<
T
>
type
,
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java
View file @
aeb88519
...
@@ -712,7 +712,7 @@ public abstract class AbstractServletWebServerFactoryTests {
...
@@ -712,7 +712,7 @@ public abstract class AbstractServletWebServerFactoryTests {
}
}
private
String
getStoreType
(
String
keyStore
)
{
private
String
getStoreType
(
String
keyStore
)
{
return
(
keyStore
.
endsWith
(
".p12"
)
?
"pkcs12"
:
null
)
;
return
keyStore
.
endsWith
(
".p12"
)
?
"pkcs12"
:
null
;
}
}
@Test
@Test
...
...
spring-boot-samples/spring-boot-sample-atmosphere/src/main/java/sample/atmosphere/ChatService.java
View file @
aeb88519
...
@@ -42,7 +42,7 @@ public class ChatService {
...
@@ -42,7 +42,7 @@ public class ChatService {
@Disconnect
@Disconnect
public
void
onDisconnect
(
AtmosphereResourceEvent
event
)
{
public
void
onDisconnect
(
AtmosphereResourceEvent
event
)
{
this
.
logger
.
info
(
"Client {} disconnected [{}]"
,
event
.
getResource
().
uuid
(),
this
.
logger
.
info
(
"Client {} disconnected [{}]"
,
event
.
getResource
().
uuid
(),
(
event
.
isCancelled
()
?
"cancelled"
:
"closed"
)
);
event
.
isCancelled
()
?
"cancelled"
:
"closed"
);
}
}
@org
.
atmosphere
.
config
.
service
.
Message
(
encoders
=
JacksonEncoderDecoder
.
class
,
decoders
=
JacksonEncoderDecoder
.
class
)
@org
.
atmosphere
.
config
.
service
.
Message
(
encoders
=
JacksonEncoderDecoder
.
class
,
decoders
=
JacksonEncoderDecoder
.
class
)
...
...
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