Permalink
Browse files

Change some StringBuffer uses to StringBuilder [3532330]

  • Loading branch information...
1 parent 2ea8563 commit 66c4a1c10d33243fb0a6f850d350226ab4d55a6c @jodastephen jodastephen committed Jun 6, 2012
View
@@ -21,6 +21,7 @@ of restrictions. If the license causes you problems please contact the mailing l
Enhancements since 2.1
----------------------
+- Change some StringBuffer uses to StringBuilder [3532330]
Compatibility with 2.1
@@ -38,7 +38,7 @@
*/
private static String createMessage(String fieldName, Number value,
Number lowerBound, Number upperBound, String explain) {
- StringBuffer buf = new StringBuffer()
+ StringBuilder buf = new StringBuilder()
.append("Value ").append(value).append(" for ").append(fieldName).append(' ');
if (lowerBound == null) {
@@ -760,7 +760,7 @@ public String toString() {
*/
public String toStringList() {
int size = size();
- StringBuffer buf = new StringBuffer(20 * size);
+ StringBuilder buf = new StringBuilder(20 * size);
buf.append('[');
for (int i = 0; i < size; i++) {
if (i > 0) {
@@ -214,7 +214,7 @@ public int hashCode() {
* @return a debugging string
*/
public String toString() {
- StringBuffer sb = new StringBuffer(60);
+ StringBuilder sb = new StringBuilder(60);
String name = getClass().getName();
int index = name.lastIndexOf('.');
if (index >= 0) {
@@ -298,7 +298,7 @@ private static Converter selectSlow(ConverterSet set, Class<?> type) {
// Class c implements a, b {}
// Converters exist only for a and b. Which is better? Neither.
- StringBuffer msg = new StringBuffer();
+ StringBuilder msg = new StringBuilder();
msg.append("Unable to find best converter for type \"");
msg.append(type.getName());
msg.append("\" from remaining set: ");
@@ -571,7 +571,7 @@ private static void parsePatternTo(DateTimeFormatterBuilder builder, String patt
* @return the parsed token
*/
private static String parseToken(String pattern, int[] indexRef) {
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
int i = indexRef[0];
int length = pattern.length();
@@ -203,7 +203,7 @@ private InputStream openResource(String name) throws IOException {
in = ClassLoader.getSystemResourceAsStream(path);
}
if (in == null) {
- StringBuffer buf = new StringBuffer(40)
+ StringBuilder buf = new StringBuilder(40)
.append("Resource not found: \"")
.append(path)
.append("\" ClassLoader: ")

0 comments on commit 66c4a1c

Please sign in to comment.