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
64989ae1
Commit
64989ae1
authored
Apr 18, 2016
by
Jakub Narloch
Committed by
Stephane Nicoll
Apr 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replacing StringBuffer with lock-free StringBuilder
Closes gh-5727
parent
1da9e4d8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
18 deletions
+19
-18
OnBeanCondition.java
...amework/boot/autoconfigure/condition/OnBeanCondition.java
+7
-6
OnClassCondition.java
...mework/boot/autoconfigure/condition/OnClassCondition.java
+6
-6
OnPropertyCondition.java
...ork/boot/autoconfigure/condition/OnPropertyCondition.java
+3
-3
CommandCompleter.java
...ingframework/boot/cli/command/shell/CommandCompleter.java
+1
-1
ConnectionInputStream.java
...ework/boot/devtools/livereload/ConnectionInputStream.java
+1
-1
AbstractRunMojo.java
.../java/org/springframework/boot/maven/AbstractRunMojo.java
+1
-1
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.java
View file @
64989ae1
...
...
@@ -74,7 +74,7 @@ class OnBeanCondition extends SpringBootCondition implements ConfigurationCondit
@Override
public
ConditionOutcome
getMatchOutcome
(
ConditionContext
context
,
AnnotatedTypeMetadata
metadata
)
{
StringBu
ffer
matchMessage
=
new
StringBuff
er
();
StringBu
ilder
matchMessage
=
new
StringBuild
er
();
if
(
metadata
.
isAnnotated
(
ConditionalOnBean
.
class
.
getName
()))
{
BeanSearchSpec
spec
=
new
BeanSearchSpec
(
context
,
metadata
,
ConditionalOnBean
.
class
);
...
...
@@ -83,8 +83,8 @@ class OnBeanCondition extends SpringBootCondition implements ConfigurationCondit
return
ConditionOutcome
.
noMatch
(
"@ConditionalOnBean "
+
spec
+
" found no beans"
);
}
matchMessage
.
append
(
"@ConditionalOnBean "
+
spec
+
" found the following "
+
matching
);
matchMessage
.
append
(
"@ConditionalOnBean "
).
append
(
spec
)
.
append
(
" found the following "
).
append
(
matching
);
}
if
(
metadata
.
isAnnotated
(
ConditionalOnSingleCandidate
.
class
.
getName
()))
{
BeanSearchSpec
spec
=
new
SingleCandidateBeanSearchSpec
(
context
,
metadata
,
...
...
@@ -99,8 +99,8 @@ class OnBeanCondition extends SpringBootCondition implements ConfigurationCondit
+
" found no primary candidate amongst the"
+
" following "
+
matching
);
}
matchMessage
.
append
(
"@ConditionalOnSingleCandidate "
+
spec
+
" found "
+
"a primary candidate amongst the following "
+
matching
);
matchMessage
.
append
(
"@ConditionalOnSingleCandidate "
).
append
(
spec
)
.
append
(
" found a primary candidate amongst the following "
).
append
(
matching
);
}
if
(
metadata
.
isAnnotated
(
ConditionalOnMissingBean
.
class
.
getName
()))
{
BeanSearchSpec
spec
=
new
BeanSearchSpec
(
context
,
metadata
,
...
...
@@ -111,7 +111,8 @@ class OnBeanCondition extends SpringBootCondition implements ConfigurationCondit
+
" found the following "
+
matching
);
}
matchMessage
.
append
(
matchMessage
.
length
()
==
0
?
""
:
" "
);
matchMessage
.
append
(
"@ConditionalOnMissingBean "
+
spec
+
" found no beans"
);
matchMessage
.
append
(
"@ConditionalOnMissingBean "
).
append
(
spec
)
.
append
(
" found no beans"
);
}
return
ConditionOutcome
.
match
(
matchMessage
.
toString
());
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnClassCondition.java
View file @
64989ae1
...
...
@@ -44,7 +44,7 @@ class OnClassCondition extends SpringBootCondition {
public
ConditionOutcome
getMatchOutcome
(
ConditionContext
context
,
AnnotatedTypeMetadata
metadata
)
{
StringBu
ffer
matchMessage
=
new
StringBuff
er
();
StringBu
ilder
matchMessage
=
new
StringBuild
er
();
MultiValueMap
<
String
,
Object
>
onClasses
=
getAttributes
(
metadata
,
ConditionalOnClass
.
class
);
...
...
@@ -56,8 +56,8 @@ class OnClassCondition extends SpringBootCondition {
.
noMatch
(
"required @ConditionalOnClass classes not found: "
+
StringUtils
.
collectionToCommaDelimitedString
(
missing
));
}
matchMessage
.
append
(
"@ConditionalOnClass classes found: "
+
StringUtils
.
collectionToCommaDelimitedString
(
matchMessage
.
append
(
"@ConditionalOnClass classes found: "
)
.
append
(
StringUtils
.
collectionToCommaDelimitedString
(
getMatchingClasses
(
onClasses
,
MatchType
.
PRESENT
,
context
)));
}
...
...
@@ -72,9 +72,9 @@ class OnClassCondition extends SpringBootCondition {
+
StringUtils
.
collectionToCommaDelimitedString
(
present
));
}
matchMessage
.
append
(
matchMessage
.
length
()
==
0
?
""
:
" "
);
matchMessage
.
append
(
"@ConditionalOnMissing classes not found: "
+
StringUtils
.
collectionToCommaDelimitedString
(
getMatchingClasses
(
onMissingClasses
,
MatchType
.
MISSING
,
context
)));
matchMessage
.
append
(
"@ConditionalOnMissing classes not found: "
)
.
append
(
StringUtils
.
collectionToCommaDelimitedString
(
getMatchingClasses
(
onMissingClasses
,
MatchType
.
MISSING
,
context
)));
}
return
ConditionOutcome
.
match
(
matchMessage
.
toString
());
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnPropertyCondition.java
View file @
64989ae1
...
...
@@ -83,8 +83,8 @@ class OnPropertyCondition extends SpringBootCondition {
StringBuilder
message
=
new
StringBuilder
(
"@ConditionalOnProperty "
);
if
(!
missingProperties
.
isEmpty
())
{
message
.
append
(
"missing required properties "
+
expandNames
(
prefix
,
missingProperties
)
+
" "
);
message
.
append
(
"missing required properties "
).
append
(
expandNames
(
prefix
,
missingProperties
))
.
append
(
" "
);
}
if
(!
nonMatchingProperties
.
isEmpty
())
{
String
expected
=
StringUtils
.
hasLength
(
havingValue
)
?
havingValue
:
"!false"
;
...
...
@@ -113,7 +113,7 @@ class OnPropertyCondition extends SpringBootCondition {
}
private
String
expandNames
(
String
prefix
,
List
<
String
>
names
)
{
StringBu
ffer
expanded
=
new
StringBuff
er
();
StringBu
ilder
expanded
=
new
StringBuild
er
();
for
(
String
name
:
names
)
{
expanded
.
append
(
expanded
.
length
()
==
0
?
""
:
", "
);
expanded
.
append
(
prefix
);
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/CommandCompleter.java
View file @
64989ae1
...
...
@@ -127,7 +127,7 @@ public class CommandCompleter extends StringsCompleter {
private
final
String
usage
;
OptionHelpLine
(
OptionHelp
optionHelp
)
{
StringBu
ffer
options
=
new
StringBuff
er
();
StringBu
ilder
options
=
new
StringBuild
er
();
for
(
String
option
:
optionHelp
.
getOptions
())
{
options
.
append
(
options
.
length
()
==
0
?
""
:
", "
);
options
.
append
(
option
);
...
...
spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/ConnectionInputStream.java
View file @
64989ae1
...
...
@@ -44,7 +44,7 @@ class ConnectionInputStream extends FilterInputStream {
*/
public
String
readHeader
()
throws
IOException
{
byte
[]
buffer
=
new
byte
[
BUFFER_SIZE
];
StringBu
ffer
content
=
new
StringBuff
er
(
BUFFER_SIZE
);
StringBu
ilder
content
=
new
StringBuild
er
(
BUFFER_SIZE
);
while
(
content
.
indexOf
(
HEADER_END
)
==
-
1
)
{
int
amountRead
=
checkedRead
(
buffer
,
0
,
BUFFER_SIZE
);
content
.
append
(
new
String
(
buffer
,
0
,
amountRead
));
...
...
spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java
View file @
64989ae1
...
...
@@ -401,7 +401,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
}
private
void
logArguments
(
String
message
,
String
[]
args
)
{
StringBu
ffer
sb
=
new
StringBuff
er
(
message
);
StringBu
ilder
sb
=
new
StringBuild
er
(
message
);
for
(
String
arg
:
args
)
{
sb
.
append
(
arg
).
append
(
" "
);
}
...
...
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