diff options
| author | Lars Vogel | 2017-06-09 09:08:51 +0000 |
|---|---|---|
| committer | Lars Vogel | 2017-06-16 08:03:35 +0000 |
| commit | c42709d2e2893a355d9c654f67301dc349e56ef0 (patch) | |
| tree | 5fe5e0c6318258f1b7bcb8c49af7a5e453fe7704 | |
| parent | 1f6dbedc5eb5d955d2a976ffab268a0fc3b00805 (diff) | |
| download | eclipse.platform.ui-c42709d2e2893a355d9c654f67301dc349e56ef0.tar.gz eclipse.platform.ui-c42709d2e2893a355d9c654f67301dc349e56ef0.tar.xz eclipse.platform.ui-c42709d2e2893a355d9c654f67301dc349e56ef0.zip | |
Bug 516530 - Use StringBuilder instead of StringBuffer - Part 2
Change-Id: Ic27aa9d66d748d6daf32562223c0522f939d4ffb
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
4 files changed, 20 insertions, 20 deletions
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTFontHelper.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTFontHelper.java index 6ff2b6ee83f..1cf3544bd8f 100644 --- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTFontHelper.java +++ b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTFontHelper.java @@ -417,7 +417,7 @@ public class CSSSWTFontHelper { public static String getFontComposite(FontData fontData) { if (fontData != null) { - StringBuffer composite = new StringBuffer(); + StringBuilder composite = new StringBuilder(); // font-family composite.append(getFontFamily(fontData)); composite.append(" "); diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/SWTStyleHelpers.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/SWTStyleHelpers.java index 93b0cc9d3e5..f7421db6828 100644 --- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/SWTStyleHelpers.java +++ b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/SWTStyleHelpers.java @@ -47,7 +47,7 @@ public class SWTStyleHelpers { if (style == 0) { return ""; } - StringBuffer swtStyles = new StringBuffer(); + StringBuilder swtStyles = new StringBuilder(); // Use catch error if SWT version doesn't provide // the SWT constant try { @@ -770,7 +770,7 @@ public class SWTStyleHelpers { } /** - * Add SWT String <code>style</code> to the {@link StringBuffer} + * Add SWT String <code>style</code> to the {@link StringBuilder} * <cod>swtStyles</code> and separate it with <code>separator</code> * String. * @@ -778,7 +778,7 @@ public class SWTStyleHelpers { * @param style * @param separator */ - private static void addSWTStyle(StringBuffer swtStyles, String style, + private static void addSWTStyle(StringBuilder swtStyles, String style, String separator) { if (swtStyles.length() > 0) { swtStyles.append(separator); diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/URI.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/URI.java index 07801e21236..d670ffc9617 100644 --- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/URI.java +++ b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/URI.java @@ -382,7 +382,7 @@ public final class URI /* private static String toBits(long l) { - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); for (int i = 0; i < 64; i++) { boolean b = (l & 1L) != 0; @@ -1798,7 +1798,7 @@ public final class URI return null; } - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); if (hasAbsolutePath()) { result.append(SEGMENT_SEPARATOR); } @@ -1837,7 +1837,7 @@ public final class URI return null; } - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); if (hasAuthority()) { @@ -2424,7 +2424,7 @@ public final class URI { if (cachedToString == null) { - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); if (!isRelative()) { result.append(scheme); @@ -2484,7 +2484,7 @@ public final class URI // showing each of the components. String toString(boolean includeSimpleForm) { - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); if (includeSimpleForm) { result.append(toString()); } @@ -2538,7 +2538,7 @@ public final class URI return null; } - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); char separator = File.separatorChar; if (hasAuthority()) @@ -2582,7 +2582,7 @@ public final class URI { if (isPlatform()) { - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); for (int i = 1, len = segments.length; i < len; i++) { result.append('/').append(decode ? URI.decode(segments[i]) : segments[i]); @@ -2760,7 +2760,7 @@ public final class URI if (SEGMENT_EMPTY.equals(lastSegment)) { return this; } - StringBuffer newLastSegment = new StringBuffer(lastSegment); + StringBuilder newLastSegment = new StringBuilder(lastSegment); newLastSegment.append(FILE_EXTENSION_SEPARATOR); newLastSegment.append(fileExtension); @@ -3011,7 +3011,7 @@ public final class URI return null; } - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); int i = uri.indexOf(SCHEME_SEPARATOR); if (i != -1) @@ -3054,7 +3054,7 @@ public final class URI return null; } - StringBuffer result = null; + StringBuilder result = null; for (int i = 0, len = value.length(); i < len; i++) { @@ -3065,7 +3065,7 @@ public final class URI { if (result == null) { - result = new StringBuffer(value.substring(0, i)); + result = new StringBuilder(value.substring(0, i)); } appendEscaped(result, (byte)c); } @@ -3087,9 +3087,9 @@ public final class URI } // Computes a three-character escape sequence for the byte, appending - // it to the StringBuffer. Only characters up to 0xFF should be escaped; + // it to the StringBuilder. Only characters up to 0xFF should be escaped; // all but the least significant byte will be ignored. - private static void appendEscaped(StringBuffer result, byte b) + private static void appendEscaped(StringBuilder result, byte b) { result.append(ESCAPE); @@ -3297,7 +3297,7 @@ public final class URI { if (value == null) return null; - StringBuffer result = null; + StringBuilder result = null; for (int i = 0, length = value.length(); i < length; i++) { @@ -3307,7 +3307,7 @@ public final class URI { if (result == null) { - result = new StringBuffer(value.substring(0, i)); + result = new StringBuilder(value.substring(0, i)); } try diff --git a/bundles/org.eclipse.e4.ui.dialogs/src/org/eclipse/e4/ui/dialogs/filteredtree/StringMatcher.java b/bundles/org.eclipse.e4.ui.dialogs/src/org/eclipse/e4/ui/dialogs/filteredtree/StringMatcher.java index e2290e85e33..0e07056aa6d 100644 --- a/bundles/org.eclipse.e4.ui.dialogs/src/org/eclipse/e4/ui/dialogs/filteredtree/StringMatcher.java +++ b/bundles/org.eclipse.e4.ui.dialogs/src/org/eclipse/e4/ui/dialogs/filteredtree/StringMatcher.java @@ -309,7 +309,7 @@ public class StringMatcher { Vector<String> temp = new Vector<>(); int pos = 0; - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); while (pos < fLength) { char c = fPattern.charAt(pos++); switch (c) { |
