Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace StringBuffer with StringBuilder in RR code #36244

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public CacheControl fromString(String value) throws IllegalArgumentException {
return result;
}

private static StringBuffer addDirective(String directive, StringBuffer buffer) {
private static StringBuilder addDirective(String directive, StringBuilder buffer) {
if (buffer.length() > 0)
buffer.append(", ");
buffer.append(directive);
Expand All @@ -82,7 +82,7 @@ private static StringBuffer addDirective(String directive, StringBuffer buffer)
public String toString(CacheControl value) {
if (value == null)
throw new IllegalArgumentException("param was null");
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
if (value.isNoCache()) {
List<String> fields = value.getNoCacheFields();
if (fields.size() < 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public Cookie fromString(String value) throws IllegalArgumentException {
}

public String toString(Cookie value) {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
ServerCookie.appendCookieValue(buf, 0, value.getName(), value.getValue(), value.getPath(), value.getDomain(), null, -1,
false);
return buf.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void parseAttribute(MultivaluedMap<String, String> attributes) {
val = value.substring(curr, end);
curr = end + 1;
} else {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
while (curr < value.length()) {
char c = value.charAt(curr);
if (c == ',' || c == ';')
Expand Down Expand Up @@ -136,7 +136,7 @@ public Link fromString(String value) throws IllegalArgumentException {
public String toString(Link value) throws IllegalArgumentException {
if (value == null)
throw new IllegalArgumentException("value was null");
StringBuffer buf = new StringBuffer("<");
StringBuilder buf = new StringBuilder("<");
buf.append(value.getUri().toString()).append(">");

for (Map.Entry<String, String> entry : value.getParams().entrySet()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public static void formatOldCookie(Date d, StringBuffer sb,
private static final String ancientDate = formatOldCookie(new Date(10000));

// TODO RFC2965 fields also need to be passed
public static void appendCookieValue(StringBuffer headerBuf,
public static void appendCookieValue(StringBuilder headerBuf,
int version,
String name,
String value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public String setAttribute(

int start = offset;

StringBuffer newChars = new StringBuffer();
StringBuilder newChars = new StringBuilder();

while (hasChar()) {
paramName = parseToken(new char[] { '=', separator });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public MultivaluedMap<String, String> getMatrixParameters() {
}

public String toString() {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
if (path != null)
buf.append(path);
if (matrixParameters != null) {
Expand Down