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
4ae3691f
Commit
4ae3691f
authored
Aug 25, 2017
by
Johnny Lim
Committed by
Stephane Nicoll
Aug 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid substring() invocation when the result is itself
Closes gh-10077
parent
8198b875
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6 additions
and
6 deletions
+6
-6
EnvironmentTestUtils.java
.../springframework/boot/test/util/EnvironmentTestUtils.java
+1
-1
TestPropertyValues.java
...rg/springframework/boot/test/util/TestPropertyValues.java
+1
-1
SpringApplicationBuilder.java
...pringframework/boot/builder/SpringApplicationBuilder.java
+1
-1
BindFailureAnalyzerTests.java
...k/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java
+1
-1
BindValidationFailureAnalyzerTests.java
...gnostics/analyzer/BindValidationFailureAnalyzerTests.java
+1
-1
UnboundConfigurationPropertyFailureAnalyzerTests.java
...zer/UnboundConfigurationPropertyFailureAnalyzerTests.java
+1
-1
No files found.
spring-boot-test/src/main/java/org/springframework/boot/test/util/EnvironmentTestUtils.java
View file @
4ae3691f
...
...
@@ -73,7 +73,7 @@ public abstract class EnvironmentTestUtils {
Map
<
String
,
Object
>
map
=
getOrAdd
(
sources
,
name
);
for
(
String
pair
:
pairs
)
{
int
index
=
getSeparatorIndex
(
pair
);
String
key
=
pair
.
substring
(
0
,
index
>
0
?
index
:
pair
.
length
())
;
String
key
=
index
>
0
?
pair
.
substring
(
0
,
index
)
:
pair
;
String
value
=
index
>
0
?
pair
.
substring
(
index
+
1
)
:
""
;
map
.
put
(
key
.
trim
(),
value
.
trim
());
}
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/util/TestPropertyValues.java
View file @
4ae3691f
...
...
@@ -253,7 +253,7 @@ public final class TestPropertyValues {
public
static
Pair
parse
(
String
pair
)
{
int
index
=
getSeparatorIndex
(
pair
);
String
key
=
pair
.
substring
(
0
,
index
>
0
?
index
:
pair
.
length
())
;
String
key
=
index
>
0
?
pair
.
substring
(
0
,
index
)
:
pair
;
String
value
=
index
>
0
?
pair
.
substring
(
index
+
1
)
:
""
;
return
of
(
key
.
trim
(),
value
.
trim
());
}
...
...
spring-boot/src/main/java/org/springframework/boot/builder/SpringApplicationBuilder.java
View file @
4ae3691f
...
...
@@ -395,7 +395,7 @@ public class SpringApplicationBuilder {
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
for
(
String
property
:
properties
)
{
int
index
=
lowestIndexOf
(
property
,
":"
,
"="
);
String
key
=
property
.
substring
(
0
,
index
>
0
?
index
:
property
.
length
())
;
String
key
=
index
>
0
?
property
.
substring
(
0
,
index
)
:
property
;
String
value
=
index
>
0
?
property
.
substring
(
index
+
1
)
:
""
;
map
.
put
(
key
,
value
);
}
...
...
spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java
View file @
4ae3691f
...
...
@@ -102,7 +102,7 @@ public class BindFailureAnalyzerTests {
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
for
(
String
pair
:
environment
)
{
int
index
=
pair
.
indexOf
(
"="
);
String
key
=
pair
.
substring
(
0
,
index
>
0
?
index
:
pair
.
length
())
;
String
key
=
index
>
0
?
pair
.
substring
(
0
,
index
)
:
pair
;
String
value
=
index
>
0
?
pair
.
substring
(
index
+
1
)
:
""
;
map
.
put
(
key
.
trim
(),
value
.
trim
());
}
...
...
spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzerTests.java
View file @
4ae3691f
...
...
@@ -135,7 +135,7 @@ public class BindValidationFailureAnalyzerTests {
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
for
(
String
pair
:
environment
)
{
int
index
=
pair
.
indexOf
(
"="
);
String
key
=
pair
.
substring
(
0
,
index
>
0
?
index
:
pair
.
length
())
;
String
key
=
index
>
0
?
pair
.
substring
(
0
,
index
)
:
pair
;
String
value
=
index
>
0
?
pair
.
substring
(
index
+
1
)
:
""
;
map
.
put
(
key
.
trim
(),
value
.
trim
());
}
...
...
spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/UnboundConfigurationPropertyFailureAnalyzerTests.java
View file @
4ae3691f
...
...
@@ -98,7 +98,7 @@ public class UnboundConfigurationPropertyFailureAnalyzerTests {
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
for
(
String
pair
:
environment
)
{
int
index
=
pair
.
indexOf
(
"="
);
String
key
=
pair
.
substring
(
0
,
index
>
0
?
index
:
pair
.
length
())
;
String
key
=
index
>
0
?
pair
.
substring
(
0
,
index
)
:
pair
;
String
value
=
index
>
0
?
pair
.
substring
(
index
+
1
)
:
""
;
map
.
put
(
key
.
trim
(),
value
.
trim
());
}
...
...
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