Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2018-05-03 03:43:09 -0400
committerLars Vogel2018-05-03 03:43:09 -0400
commit4009f6e53aad406a09a623e9427213abe019f09f (patch)
treecbdc3d8fb6a1bee7275e76fef6fc6d1ff3efc0b5 /org.eclipse.debug.core
parent39d32c5f206bd5992e6d6fa7a7ac0910a68ea8ef (diff)
downloadeclipse.platform.debug-4009f6e53aad406a09a623e9427213abe019f09f.tar.gz
eclipse.platform.debug-4009f6e53aad406a09a623e9427213abe019f09f.tar.xz
eclipse.platform.debug-4009f6e53aad406a09a623e9427213abe019f09f.zip
Using StringBuilder instead of StringBuffer in org.eclipse.debug.core
Change-Id: If82d175d5e2793cf3974a05980fa95f348bc97ed Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Diffstat (limited to 'org.eclipse.debug.core')
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java6
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/RefreshUtil.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java12
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java6
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java4
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/SystemVariableResolver.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java8
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ResourceResolver.java2
10 files changed, 23 insertions, 23 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java
index 4bf262163..cfc1ef8e3 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java
@@ -383,7 +383,7 @@ public final class DebugEvent extends EventObject {
*/
@Override
public String toString() {
- StringBuffer buf = new StringBuffer("DebugEvent["); //$NON-NLS-1$
+ StringBuilder buf = new StringBuilder("DebugEvent["); //$NON-NLS-1$
if (getSource() != null) {
buf.append(getSource().toString());
} else {
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
index 6b119b816..c46f4bab3 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
@@ -1267,7 +1267,7 @@ public class DebugPlugin extends Plugin {
int state= DEFAULT;
int backslashes= 0;
- StringBuffer buf= new StringBuffer();
+ StringBuilder buf= new StringBuilder();
int len= args.length();
for (int i= 0; i < len; i++) {
char ch= args.charAt(i);
@@ -1377,7 +1377,7 @@ public class DebugPlugin extends Plugin {
final int IN_SINGLE_QUOTE= 3;
int state= DEFAULT;
- StringBuffer buf= new StringBuffer();
+ StringBuilder buf= new StringBuilder();
int len= args.length();
for (int i= 0; i < len; i++) {
char ch= args.charAt(i);
@@ -1531,7 +1531,7 @@ public class DebugPlugin extends Plugin {
*/
public static String renderArguments(String[] arguments, int[] segments) {
boolean isWin32= Platform.getOS().equals(Constants.OS_WIN32);
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
int count = arguments.length;
for (int i = 0; i < count; i++) {
if (i > 0) {
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/RefreshUtil.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/RefreshUtil.java
index 880bf3a4e..6653ea816 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/RefreshUtil.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/RefreshUtil.java
@@ -213,7 +213,7 @@ public class RefreshUtil {
} catch (IOException e) {
DebugPlugin.log(e);
}
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
buf.append("${working_set:"); //$NON-NLS-1$
buf.append(writer.toString());
buf.append("}"); //$NON-NLS-1$
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
index 075d2e24b..cd6fbcffd 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
@@ -465,7 +465,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
* "Abc.launch" or "Abc.prototype"
*/
protected String getFileName() {
- StringBuffer buf = new StringBuffer(getName());
+ StringBuilder buf = new StringBuilder(getName());
buf.append('.');
if (isPrototype()) {
buf.append(ILaunchConfiguration.LAUNCH_CONFIGURATION_PROTOTYPE_FILE_EXTENSION);
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
index f0800df0e..f8deb00ed 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
@@ -1109,9 +1109,9 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
}
String newname = base;
- StringBuffer buffer = null;
+ StringBuilder buffer = null;
while (isExistingLaunchConfigurationName(newname) || reservednames.contains(newname)) {
- buffer = new StringBuffer(base);
+ buffer = new StringBuilder(base);
buffer.append(" ("); //$NON-NLS-1$
buffer.append(String.valueOf(index));
index++;
@@ -1324,9 +1324,9 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
}
List<String> strings = new ArrayList<>(env.size());
- StringBuffer buffer = null;
+ StringBuilder buffer = null;
for (Entry<String, String> entry : env.entrySet()) {
- buffer = new StringBuffer(entry.getKey());
+ buffer = new StringBuilder(entry.getKey());
buffer.append('=').append(entry.getValue());
strings.add(buffer.toString());
}
@@ -2383,7 +2383,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
String preferenceName = PREF_PREFERRED_DELEGATES + '/' + type.getIdentifier();
Map<Set<String>, ILaunchDelegate> preferred = type.getPreferredDelegates();
if(preferred != null && preferred.size() > 0) {
- StringBuffer str = new StringBuffer();
+ StringBuilder str = new StringBuilder();
for (Entry<Set<String>, ILaunchDelegate> entry : preferred.entrySet()) {
Set<String> modes = entry.getKey();
ILaunchDelegate delegate = entry.getValue();
@@ -2534,7 +2534,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
Map<String, ILaunchConfiguration> sharedConfigs = new HashMap<>();
for (ILaunchConfiguration config : getAllLaunchConfigurations()) {
if (!config.isLocal()) {
- StringBuffer buf = new StringBuffer(config.getName());
+ StringBuilder buf = new StringBuilder(config.getName());
buf.append('.');
if (config.isPrototype()) {
buf.append(ILaunchConfiguration.LAUNCH_CONFIGURATION_PROTOTYPE_FILE_EXTENSION);
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java
index ca9ab0817..0b10f28a9 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java
@@ -125,7 +125,7 @@ public class LogicalStructureManager {
* Stores the map of structure selections to the preference store
*/
private void storeStructureTypeSelections() {
- StringBuffer buffer= new StringBuffer();
+ StringBuilder buffer= new StringBuilder();
for (Entry<String, Integer> entry : fStructureTypeSelections.entrySet()) {
buffer.append(entry.getKey());
buffer.append(entry.getValue());
@@ -154,7 +154,7 @@ public class LogicalStructureManager {
* Stores the collection of known structure identifiers to the preference store
*/
private void storeStructureTypeIds() {
- StringBuffer buffer= new StringBuffer();
+ StringBuilder buffer= new StringBuilder();
for (String id : fStructureTypeIds) {
buffer.append(id).append(',');
}
@@ -225,7 +225,7 @@ public class LogicalStructureManager {
* structure types
*/
protected String getComboString(ILogicalStructureType[] types) {
- StringBuffer comboKey= new StringBuffer();
+ StringBuilder comboKey= new StringBuilder();
for (int i = 0; i < types.length; i++) {
ILogicalStructureType type = types[i];
int typeIndex = fStructureTypeIds.indexOf(type.getId());
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java
index 0b35caa54..e344e229b 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java
@@ -48,7 +48,7 @@ public class OutputStreamMonitor implements IFlushableStreamMonitor {
/**
* The local copy of the stream contents
*/
- private StringBuffer fContents;
+ private StringBuilder fContents;
/**
* The thread which reads from the stream
@@ -81,7 +81,7 @@ public class OutputStreamMonitor implements IFlushableStreamMonitor {
public OutputStreamMonitor(InputStream stream, String encoding) {
fStream = new BufferedInputStream(stream, 8192);
fEncoding = encoding;
- fContents= new StringBuffer();
+ fContents= new StringBuilder();
}
/* (non-Javadoc)
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/SystemVariableResolver.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/SystemVariableResolver.java
index 361090a80..a775d3188 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/SystemVariableResolver.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/SystemVariableResolver.java
@@ -54,7 +54,7 @@ public class SystemVariableResolver implements IDynamicVariableResolver {
}
private static String getCorrectPath(String path) {
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
for (int i = 0; i < path.length(); i++) {
char c = path.charAt(i);
if (Platform.getOS().equals("win32")) { //$NON-NLS-1$
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java
index 31854b812..e10052ef8 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java
@@ -524,7 +524,7 @@ public final class XMLMemento {
}
private void startTag(Element element, boolean hasChildren) {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
sb.append("<"); //$NON-NLS-1$
sb.append(element.getTagName());
NamedNodeMap attributes = element.getAttributes();
@@ -541,14 +541,14 @@ public final class XMLMemento {
}
private void endTag(Element element) {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
sb.append("</"); //$NON-NLS-1$
sb.append(element.getNodeName());
sb.append(">"); //$NON-NLS-1$
print(sb.toString());
}
- private static void appendEscapedChar(StringBuffer buffer, char c) {
+ private static void appendEscapedChar(StringBuilder buffer, char c) {
String replacement = getReplacement(c);
if (replacement != null) {
buffer.append('&');
@@ -560,7 +560,7 @@ public final class XMLMemento {
}
private static String getEscaped(String s) {
- StringBuffer result = new StringBuffer(s.length() + 10);
+ StringBuilder result = new StringBuilder(s.length() + 10);
for (int i = 0; i < s.length(); ++i) {
appendEscapedChar(result, s.charAt(i));
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ResourceResolver.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ResourceResolver.java
index cdbf25e8c..4914c887b 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ResourceResolver.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ResourceResolver.java
@@ -90,7 +90,7 @@ public class ResourceResolver implements IDynamicVariableResolver {
* @return variable reference expression
*/
protected String getReferenceExpression(IDynamicVariable variable, String argument) {
- StringBuffer reference = new StringBuffer();
+ StringBuilder reference = new StringBuilder();
reference.append("${"); //$NON-NLS-1$
reference.append(variable.getName());
if (argument != null) {

Back to the top