mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8274898: Cleanup usages of StringBuffer in jdk tools modules
Reviewed-by: sspitsyn, lmesnik
This commit is contained in:
parent
7517c85da3
commit
04dbdd36dd
3 changed files with 8 additions and 8 deletions
|
@ -834,9 +834,9 @@ public class Main {
|
|||
}
|
||||
|
||||
// Only used when -verbose provided
|
||||
StringBuffer sb = null;
|
||||
StringBuilder sb = null;
|
||||
if (verbose != null) {
|
||||
sb = new StringBuffer();
|
||||
sb = new StringBuilder();
|
||||
boolean inManifest =
|
||||
((man.getAttributes(name) != null) ||
|
||||
(man.getAttributes("./"+name) != null) ||
|
||||
|
|
|
@ -108,7 +108,7 @@ public class Log {
|
|||
public void verbose(List<String> strings,
|
||||
List<String> output, int returnCode, long pid) {
|
||||
if (verbose) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Command [PID: ");
|
||||
sb.append(pid);
|
||||
sb.append("]:\n ");
|
||||
|
@ -116,13 +116,13 @@ public class Log {
|
|||
for (String s : strings) {
|
||||
sb.append(" " + s);
|
||||
}
|
||||
verbose(new String(sb));
|
||||
verbose(sb.toString());
|
||||
if (output != null && !output.isEmpty()) {
|
||||
sb = new StringBuffer("Output:");
|
||||
sb = new StringBuilder("Output:");
|
||||
for (String s : output) {
|
||||
sb.append("\n " + s);
|
||||
}
|
||||
verbose(new String(sb));
|
||||
verbose(sb.toString());
|
||||
}
|
||||
verbose("Returned: " + returnCode + "\n");
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -372,7 +372,7 @@ class Feedback {
|
|||
return "";
|
||||
}
|
||||
Matcher m = FIELD_PATTERN.matcher(format);
|
||||
StringBuffer sb = new StringBuffer(format.length());
|
||||
StringBuilder sb = new StringBuilder(format.length());
|
||||
while (m.find()) {
|
||||
String fieldName = m.group(1);
|
||||
String sub = format(fieldName, selector);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue