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
66b1742f
Commit
66b1742f
authored
Jul 31, 2018
by
dreis2211
Committed by
Stephane Nicoll
Aug 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize some StringBuilder.append() calls
Closes gh-13961
parent
d31f6838
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
15 deletions
+30
-15
ArchiveCommand.java
...ingframework/boot/cli/command/archive/ArchiveCommand.java
+3
-1
PropertyMappingContextCustomizer.java
...onfigure/properties/PropertyMappingContextCustomizer.java
+4
-2
ItemMetadata.java
...rk/boot/configurationprocessor/metadata/ItemMetadata.java
+4
-2
AbstractRunMojo.java
.../java/org/springframework/boot/maven/AbstractRunMojo.java
+4
-3
MapBinder.java
...ringframework/boot/context/properties/bind/MapBinder.java
+3
-1
ConfigurationPropertyName.java
.../context/properties/source/ConfigurationPropertyName.java
+4
-2
JettyWebServer.java
...ringframework/boot/web/embedded/jetty/JettyWebServer.java
+4
-2
TomcatWebServer.java
...ngframework/boot/web/embedded/tomcat/TomcatWebServer.java
+4
-2
No files found.
spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/archive/ArchiveCommand.java
View file @
66b1742f
...
...
@@ -230,7 +230,9 @@ abstract class ArchiveCommand extends OptionParsingCommand {
private
String
commaDelimitedClassNames
(
Class
<?>[]
classes
)
{
StringBuilder
builder
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
classes
.
length
;
i
++)
{
builder
.
append
((
i
!=
0
)
?
","
:
""
);
if
(
i
!=
0
)
{
builder
.
append
(
','
);
}
builder
.
append
(
classes
[
i
].
getName
());
}
return
builder
.
toString
();
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/PropertyMappingContextCustomizer.java
View file @
66b1742f
...
...
@@ -115,8 +115,10 @@ class PropertyMappingContextCustomizer implements ContextCustomizer {
private
String
getAnnotationsDescription
(
Set
<
Class
<?>>
annotations
)
{
StringBuilder
result
=
new
StringBuilder
();
for
(
Class
<?>
annotation
:
annotations
)
{
result
.
append
((
result
.
length
()
!=
0
)
?
", "
:
""
);
result
.
append
(
"@"
+
ClassUtils
.
getShortName
(
annotation
));
if
(
result
.
length
()
!=
0
)
{
result
.
append
(
", "
);
}
result
.
append
(
'@'
).
append
(
ClassUtils
.
getShortName
(
annotation
));
}
result
.
insert
(
0
,
(
annotations
.
size
()
!=
1
)
?
"annotations "
:
"annotation "
);
return
result
.
toString
();
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ItemMetadata.java
View file @
66b1742f
...
...
@@ -63,9 +63,11 @@ public final class ItemMetadata implements Comparable<ItemMetadata> {
}
StringBuilder
fullName
=
new
StringBuilder
((
prefix
!=
null
)
?
prefix
:
""
);
if
(
fullName
.
length
()
>
0
&&
name
!=
null
)
{
fullName
.
append
(
"."
);
fullName
.
append
(
'.'
);
}
if
(
name
!=
null
)
{
fullName
.
append
(
ConfigurationMetadata
.
toDashedCase
(
name
));
}
fullName
.
append
((
name
!=
null
)
?
ConfigurationMetadata
.
toDashedCase
(
name
)
:
""
);
return
fullName
.
toString
();
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java
View file @
66b1742f
...
...
@@ -331,9 +331,10 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
try
{
StringBuilder
classpath
=
new
StringBuilder
();
for
(
URL
ele
:
getClassPathUrls
())
{
classpath
=
classpath
.
append
(((
classpath
.
length
()
>
0
)
?
File
.
pathSeparator
:
""
)
+
new
File
(
ele
.
toURI
()));
if
(
classpath
.
length
()
>
0
)
{
classpath
.
append
(
File
.
pathSeparator
);
}
classpath
.
append
(
new
File
(
ele
.
toURI
()));
}
getLog
().
debug
(
"Classpath for forked process: "
+
classpath
);
args
.
add
(
"-cp"
);
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java
View file @
66b1742f
...
...
@@ -216,7 +216,9 @@ class MapBinder extends AggregateBinder<Map<Object, Object>> {
StringBuilder
result
=
new
StringBuilder
();
for
(
int
i
=
this
.
root
.
getNumberOfElements
();
i
<
name
.
getNumberOfElements
();
i
++)
{
result
.
append
((
result
.
length
()
!=
0
)
?
"."
:
""
);
if
(
result
.
length
()
!=
0
)
{
result
.
append
(
'.'
);
}
result
.
append
(
name
.
getElement
(
i
,
Form
.
ORIGINAL
));
}
return
result
.
toString
();
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java
View file @
66b1742f
...
...
@@ -394,7 +394,7 @@ public final class ConfigurationPropertyName
for
(
CharSequence
element
:
elements
)
{
boolean
indexed
=
isIndexed
(
element
);
if
(
result
.
length
()
>
0
&&
!
indexed
)
{
result
.
append
(
"."
);
result
.
append
(
'.'
);
}
if
(
indexed
)
{
result
.
append
(
element
);
...
...
@@ -402,7 +402,9 @@ public final class ConfigurationPropertyName
else
{
for
(
int
i
=
0
;
i
<
element
.
length
();
i
++)
{
char
ch
=
Character
.
toLowerCase
(
element
.
charAt
(
i
));
result
.
append
((
ch
!=
'_'
)
?
ch
:
""
);
if
(
ch
!=
'_'
)
{
result
.
append
(
ch
);
}
}
}
}
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyWebServer.java
View file @
66b1742f
...
...
@@ -172,8 +172,10 @@ public class JettyWebServer implements WebServer {
private
String
getActualPortsDescription
()
{
StringBuilder
ports
=
new
StringBuilder
();
for
(
Connector
connector
:
this
.
server
.
getConnectors
())
{
ports
.
append
((
ports
.
length
()
!=
0
)
?
", "
:
""
);
ports
.
append
(
getLocalPort
(
connector
)
+
getProtocols
(
connector
));
if
(
ports
.
length
()
!=
0
)
{
ports
.
append
(
", "
);
}
ports
.
append
(
getLocalPort
(
connector
)).
append
(
getProtocols
(
connector
));
}
return
ports
.
toString
();
}
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatWebServer.java
View file @
66b1742f
...
...
@@ -319,9 +319,11 @@ public class TomcatWebServer implements WebServer {
private
String
getPortsDescription
(
boolean
localPort
)
{
StringBuilder
ports
=
new
StringBuilder
();
for
(
Connector
connector
:
this
.
tomcat
.
getService
().
findConnectors
())
{
ports
.
append
((
ports
.
length
()
!=
0
)
?
" "
:
""
);
if
(
ports
.
length
()
!=
0
)
{
ports
.
append
(
' '
);
}
int
port
=
localPort
?
connector
.
getLocalPort
()
:
connector
.
getPort
();
ports
.
append
(
port
+
" ("
+
connector
.
getScheme
()
+
")"
);
ports
.
append
(
port
).
append
(
" ("
).
append
(
connector
.
getScheme
()).
append
(
')'
);
}
return
ports
.
toString
();
}
...
...
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