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
32f9e90d
Commit
32f9e90d
authored
Jan 25, 2017
by
Johnny Lim
Committed by
Stephane Nicoll
Jan 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace 'String.length() == 0' with 'String.isEmpty()'
See gh-8103
parent
79233b01
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
11 additions
and
11 deletions
+11
-11
ConfigurationPropertiesReportEndpoint.java
...tuate/endpoint/ConfigurationPropertiesReportEndpoint.java
+1
-1
AbstractMvcEndpoint.java
...mework/boot/actuate/endpoint/mvc/AbstractMvcEndpoint.java
+1
-1
RabbitProperties.java
...ngframework/boot/autoconfigure/amqp/RabbitProperties.java
+1
-1
H2ConsoleProperties.java
...gframework/boot/autoconfigure/h2/H2ConsoleProperties.java
+1
-1
WebServicesProperties.java
...boot/autoconfigure/webservices/WebServicesProperties.java
+1
-1
AsciiBytes.java
.../java/org/springframework/boot/loader/jar/AsciiBytes.java
+1
-1
JarURLConnection.java
...org/springframework/boot/loader/jar/JarURLConnection.java
+2
-2
RelaxedConversionService.java
...g/springframework/boot/bind/RelaxedConversionService.java
+1
-1
ConfigurationWarningsApplicationContextInitializer.java
...t/ConfigurationWarningsApplicationContextInitializer.java
+2
-2
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpoint.java
View file @
32f9e90d
...
@@ -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 @
32f9e90d
...
@@ -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-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java
View file @
32f9e90d
...
@@ -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/h2/H2ConsoleProperties.java
View file @
32f9e90d
...
@@ -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/webservices/WebServicesProperties.java
View file @
32f9e90d
...
@@ -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-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/AsciiBytes.java
View file @
32f9e90d
...
@@ -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 @
32f9e90d
...
@@ -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/src/main/java/org/springframework/boot/bind/RelaxedConversionService.java
View file @
32f9e90d
...
@@ -120,7 +120,7 @@ class RelaxedConversionService implements ConversionService {
...
@@ -120,7 +120,7 @@ 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
;
}
}
...
...
spring-boot/src/main/java/org/springframework/boot/context/ConfigurationWarningsApplicationContextInitializer.java
View file @
32f9e90d
...
@@ -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
+
"'"
;
...
...
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