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
5121ca5d
Commit
5121ca5d
authored
Nov 18, 2020
by
Marten Deinum
Committed by
Stephane Nicoll
Dec 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce the overhead of char[] creation
See gh-24204
parent
c063c343
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
4 deletions
+8
-4
SimpleHttpCodeStatusMapper.java
...ework/boot/actuate/health/SimpleHttpCodeStatusMapper.java
+2
-1
SimpleStatusAggregator.java
...framework/boot/actuate/health/SimpleStatusAggregator.java
+2
-1
ConfigurationMetadata.java
...onfigurationprocessor/metadata/ConfigurationMetadata.java
+2
-1
ConfigTreePropertySource.java
...rg/springframework/boot/env/ConfigTreePropertySource.java
+2
-1
No files found.
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHttpCodeStatusMapper.java
View file @
5121ca5d
...
@@ -81,7 +81,8 @@ public class SimpleHttpCodeStatusMapper implements HttpCodeStatusMapper {
...
@@ -81,7 +81,8 @@ public class SimpleHttpCodeStatusMapper implements HttpCodeStatusMapper {
return
null
;
return
null
;
}
}
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
StringBuilder
();
for
(
char
ch
:
code
.
toCharArray
())
{
for
(
int
i
=
0
;
i
<
code
.
length
();
i
++)
{
char
ch
=
code
.
charAt
(
i
);
if
(
Character
.
isAlphabetic
(
ch
)
||
Character
.
isDigit
(
ch
))
{
if
(
Character
.
isAlphabetic
(
ch
)
||
Character
.
isDigit
(
ch
))
{
builder
.
append
(
Character
.
toLowerCase
(
ch
));
builder
.
append
(
Character
.
toLowerCase
(
ch
));
}
}
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleStatusAggregator.java
View file @
5121ca5d
...
@@ -89,7 +89,8 @@ public class SimpleStatusAggregator implements StatusAggregator {
...
@@ -89,7 +89,8 @@ public class SimpleStatusAggregator implements StatusAggregator {
return
null
;
return
null
;
}
}
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
StringBuilder
();
for
(
char
ch
:
code
.
toCharArray
())
{
for
(
int
i
=
0
;
i
<
code
.
length
();
i
++)
{
char
ch
=
code
.
charAt
(
i
);
if
(
Character
.
isAlphabetic
(
ch
)
||
Character
.
isDigit
(
ch
))
{
if
(
Character
.
isAlphabetic
(
ch
)
||
Character
.
isDigit
(
ch
))
{
builder
.
append
(
Character
.
toLowerCase
(
ch
));
builder
.
append
(
Character
.
toLowerCase
(
ch
));
}
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ConfigurationMetadata.java
View file @
5121ca5d
...
@@ -189,7 +189,8 @@ public class ConfigurationMetadata {
...
@@ -189,7 +189,8 @@ public class ConfigurationMetadata {
static
String
toDashedCase
(
String
name
)
{
static
String
toDashedCase
(
String
name
)
{
StringBuilder
dashed
=
new
StringBuilder
();
StringBuilder
dashed
=
new
StringBuilder
();
Character
previous
=
null
;
Character
previous
=
null
;
for
(
char
current
:
name
.
toCharArray
())
{
for
(
int
i
=
0
;
i
<
name
.
length
();
i
++)
{
char
current
=
name
.
charAt
(
i
);
if
(
SEPARATORS
.
contains
(
current
))
{
if
(
SEPARATORS
.
contains
(
current
))
{
dashed
.
append
(
"-"
);
dashed
.
append
(
"-"
);
}
}
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/ConfigTreePropertySource.java
View file @
5121ca5d
...
@@ -308,7 +308,8 @@ public class ConfigTreePropertySource extends EnumerablePropertySource<Path> imp
...
@@ -308,7 +308,8 @@ public class ConfigTreePropertySource extends EnumerablePropertySource<Path> imp
return
string
;
return
string
;
}
}
int
numberOfLines
=
0
;
int
numberOfLines
=
0
;
for
(
char
ch
:
string
.
toCharArray
())
{
for
(
int
i
=
0
;
i
<
string
.
length
();
i
++)
{
char
ch
=
string
.
charAt
(
i
);
if
(
ch
==
'\n'
)
{
if
(
ch
==
'\n'
)
{
numberOfLines
++;
numberOfLines
++;
}
}
...
...
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