Skip to content

Commit 2bebf5f

Browse files
committed
refactor old StringBuffer usage
1 parent a651a58 commit 2bebf5f

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

api/src/main/java/org/eclipse/daanse/olap/api/IdentifierSegment.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ public sealed interface IdentifierSegment permits KeyIdentifierSegment, NameIden
7070
String toString();
7171

7272
/**
73-
* Appends a string representation of this Segment to a StringBuffer.
73+
* Appends a string representation of this Segment to a StringBuilder.
7474
*
75-
* @param buf StringBuffer
75+
* @param buf StringBuilder
7676
*/
7777
void toString(StringBuilder buf);
7878

common/src/main/java/org/eclipse/daanse/olap/common/Util.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,9 +2315,8 @@ public static String replaceProperties(
23152315
String text,
23162316
Map<String, String> env)
23172317
{
2318-
// As of JDK 1.5, cannot use StringBuilder - appendReplacement requires
2319-
// the antediluvian StringBuffer.
2320-
StringBuffer buf = new StringBuffer(text.length() + 200);
2318+
// Since Java 9, Matcher.appendReplacement accepts StringBuilder
2319+
StringBuilder buf = new StringBuilder(text.length() + 200);
23212320

23222321
Pattern pattern = Pattern.compile("\\$\\{([^${}]+)\\}");
23232322
Matcher matcher = pattern.matcher(text);

common/src/test/java/org/eclipse/daanse/olap/function/def/crossjoin/CrossJoinTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ protected void doMTupleTupleListTest(
338338
// Helper methods
339339
////////////////////////////////////////////////////////////////////////
340340
protected String toString( TupleIterable l ) {
341-
StringBuffer buf = new StringBuffer( 100 );
341+
StringBuilder buf = new StringBuilder( 100 );
342342
buf.append( '{' );
343343
int j = 0;
344344
for ( List<Member> o : l ) {

0 commit comments

Comments
 (0)