Skip to content

Commit

Permalink
dsldevkit#22: SCA configuration - fixes
Browse files Browse the repository at this point in the history
 - Fix accidental use of StringBuilder(int) constructor

Issue: dsldevkit#22
  • Loading branch information
[email protected] authored and [email protected] committed Dec 21, 2017
1 parent c134074 commit fa00851
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public static String toIdentifier(final String source) {
} else if (source.length() == 0 || !Character.isJavaIdentifierStart(source.charAt(0))) {
return ""; //$NON-NLS-1$
}
StringBuilder result = new StringBuilder(source.charAt(0));
StringBuilder result = new StringBuilder();
result.append(source.charAt(0));
boolean space = false;
for (Character c : source.substring(1).toCharArray()) {
if (Character.isJavaIdentifierPart(c)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ private static String getThreadInfo() {
boolean contention = THREAD_BEAN.isThreadContentionMonitoringEnabled();
Set<Long> deadlockedThreads = getDeadlockThreadIds();
ThreadInfo[] threadInfos = THREAD_BEAN.dumpAllThreads(true, true);
StringBuilder trace = new StringBuilder(threadInfos.length).append(" active threads\r\n");
StringBuilder trace = new StringBuilder().append(threadInfos.length).append(" active threads\r\n");
for (ThreadInfo info : threadInfos) {
if (info == null) {
trace.append(" Inactive\r\n");
Expand Down

0 comments on commit fa00851

Please sign in to comment.