Skip to content

Commit

Permalink
8293008: Replace uses of StringBuffer with StringBuilder in MergeColl…
Browse files Browse the repository at this point in the history
…ation

Reviewed-by: rriggs, naoto, bpb
  • Loading branch information
Andrey Turbanov committed Aug 31, 2022
1 parent 5d6779f commit 0d51f63
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/java.base/share/classes/java/text/MergeCollation.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2022, 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
Expand Down Expand Up @@ -86,7 +86,7 @@ public String getPattern() {
* before & and <
*/
public String getPattern(boolean withWhiteSpace) {
StringBuffer result = new StringBuffer();
StringBuilder result = new StringBuilder();
PatternEntry tmp = null;
ArrayList<PatternEntry> extList = null;
int i;
Expand Down Expand Up @@ -146,7 +146,7 @@ public String emitPattern() {
* builder.
*/
public String emitPattern(boolean withWhiteSpace) {
StringBuffer result = new StringBuffer();
StringBuilder result = new StringBuilder();
for (int i = 0; i < patterns.size(); ++i)
{
PatternEntry entry = patterns.get(i);
Expand Down
12 changes: 6 additions & 6 deletions src/java.base/share/classes/java/text/PatternEntry.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2000, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2022, 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
Expand Down Expand Up @@ -52,14 +52,14 @@ class PatternEntry {
/**
* Gets the current extension, quoted
*/
public void appendQuotedExtension(StringBuffer toAddTo) {
private void appendQuotedExtension(StringBuilder toAddTo) {
appendQuoted(extension,toAddTo);
}

/**
* Gets the current chars, quoted
*/
public void appendQuotedChars(StringBuffer toAddTo) {
private void appendQuotedChars(StringBuilder toAddTo) {
appendQuoted(chars,toAddTo);
}

Expand All @@ -83,7 +83,7 @@ public int hashCode() {
* For debugging.
*/
public String toString() {
StringBuffer result = new StringBuffer();
StringBuilder result = new StringBuilder();
addToBuffer(result, true, false, null);
return result.toString();
}
Expand Down Expand Up @@ -111,7 +111,7 @@ final String getChars() {

// ===== privates =====

void addToBuffer(StringBuffer toAddTo,
void addToBuffer(StringBuilder toAddTo,
boolean showExtension,
boolean showWhiteSpace,
PatternEntry lastEntry)
Expand Down Expand Up @@ -151,7 +151,7 @@ void addToBuffer(StringBuffer toAddTo,
}
}

static void appendQuoted(String chars, StringBuffer toAddTo) {
private static void appendQuoted(String chars, StringBuilder toAddTo) {
boolean inQuote = false;
char ch = chars.charAt(0);
if (Character.isSpaceChar(ch)) {
Expand Down

1 comment on commit 0d51f63

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.