|
1 | 1 | /*
|
2 |
| - * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
4 | 4 | *
|
5 | 5 | * This code is free software; you can redistribute it and/or modify it
|
@@ -605,9 +605,9 @@ public synchronized CollationKey getCollationKey(String source)
|
605 | 605 | return null;
|
606 | 606 |
|
607 | 607 | if (primResult == null) {
|
608 |
| - primResult = new StringBuffer(); |
609 |
| - secResult = new StringBuffer(); |
610 |
| - terResult = new StringBuffer(); |
| 608 | + primResult = new StringBuilder(); |
| 609 | + secResult = new StringBuilder(); |
| 610 | + terResult = new StringBuilder(); |
611 | 611 | } else {
|
612 | 612 | primResult.setLength(0);
|
613 | 613 | secResult.setLength(0);
|
@@ -681,8 +681,8 @@ public synchronized CollationKey getCollationKey(String source)
|
681 | 681 | }
|
682 | 682 | primResult.append((char)0);
|
683 | 683 | secResult.append((char)0);
|
684 |
| - secResult.append(terResult.toString()); |
685 |
| - primResult.append(secResult.toString()); |
| 684 | + secResult.append(terResult); |
| 685 | + primResult.append(secResult); |
686 | 686 |
|
687 | 687 | if (getStrength() == IDENTICAL) {
|
688 | 688 | primResult.append((char)0);
|
@@ -762,9 +762,9 @@ RBCollationTables getTables() {
|
762 | 762 |
|
763 | 763 | // Internal objects that are cached across calls so that they don't have to
|
764 | 764 | // be created/destroyed on every call to compare() and getCollationKey()
|
765 |
| - private StringBuffer primResult = null; |
766 |
| - private StringBuffer secResult = null; |
767 |
| - private StringBuffer terResult = null; |
| 765 | + private StringBuilder primResult = null; |
| 766 | + private StringBuilder secResult = null; |
| 767 | + private StringBuilder terResult = null; |
768 | 768 | private CollationElementIterator sourceCursor = null;
|
769 | 769 | private CollationElementIterator targetCursor = null;
|
770 | 770 | }
|
0 commit comments