Use StringBuilder instead of StringBuffer where possible.
Change-Id: I603b16b8de42fe0db33c949f53fa44de1c043430
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/FeatureEntry.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/FeatureEntry.java
index e1ca011..93bde1c 100644
--- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/FeatureEntry.java
+++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/FeatureEntry.java
@@ -249,7 +249,7 @@
URL[] urls = branding.getWindowImagesURLs();
if (urls == null)
return null;
- StringBuffer windowImagesURLs = new StringBuffer();
+ StringBuilder windowImagesURLs = new StringBuilder();
for (int i=0; i<urls.length; i++){
windowImagesURLs.append(urls[i].toExternalForm());
if (i != urls.length-1)
diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/SiteEntry.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/SiteEntry.java
index 08724e7..9008b54 100644
--- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/SiteEntry.java
+++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/SiteEntry.java
@@ -655,7 +655,7 @@
siteElement.setAttribute(CFG_POLICY, typeString);
String[] list = getSitePolicy().getList();
if (list.length > 0) {
- StringBuffer sb = new StringBuffer(256);
+ StringBuilder sb = new StringBuilder(256);
for (int i=0; i<list.length-1; i++) {
sb.append(list[i]);
sb.append(',');
diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/Utils.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/Utils.java
index ee30183..12da041 100644
--- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/Utils.java
+++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/Utils.java
@@ -85,7 +85,7 @@
((MultiStatus) status).add(childrenStatus);
((MultiStatus) status).addAll(childrenStatus);
} else {
- StringBuffer completeString = new StringBuffer(""); //$NON-NLS-1$
+ StringBuilder completeString = new StringBuilder(); //$NON-NLS-1$
if (s != null)
completeString.append(s);
if (e != null) {
diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/XMLPrintHandler.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/XMLPrintHandler.java
index 5e3eb7e..ddaea69 100644
--- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/XMLPrintHandler.java
+++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/XMLPrintHandler.java
@@ -31,27 +31,27 @@
public static final String XML_SLASH = "/"; //$NON-NLS-1$
public static void printBeginElement(Writer xmlWriter, String elementString) throws IOException{
- StringBuffer temp = new StringBuffer(XML_BEGIN_TAG);
+ StringBuilder temp = new StringBuilder(XML_BEGIN_TAG);
temp.append(elementString).append(XML_END_TAG).append("\n"); //$NON-NLS-1$
xmlWriter.write(temp.toString());
}
public static void printEndElement(Writer xmlWriter, String elementString) throws IOException{
- StringBuffer temp = new StringBuffer(XML_BEGIN_TAG);
+ StringBuilder temp = new StringBuilder(XML_BEGIN_TAG);
temp.append(XML_SLASH).append(elementString).append(XML_END_TAG).append("\n"); //$NON-NLS-1$
xmlWriter.write(temp.toString());
}
public static void printHead(Writer xmlWriter, String encoding) throws IOException {
- StringBuffer temp = new StringBuffer(XML_HEAD);
+ StringBuilder temp = new StringBuilder(XML_HEAD);
temp.append(encoding).append(XML_DBL_QUOTES).append(XML_HEAD_END_TAG).append("\n"); //$NON-NLS-1$
xmlWriter.write(temp.toString());
}
public static String wrapAttributeForPrint(String attribute, String value) throws IOException {
- StringBuffer temp = new StringBuffer(XML_SPACE);
+ StringBuilder temp = new StringBuilder(XML_SPACE);
temp.append(attribute).append(XML_EQUAL).append(XML_DBL_QUOTES)
.append(encode(value).toString()).append(XML_DBL_QUOTES);
return temp.toString();
@@ -71,7 +71,7 @@
}
case Node.ELEMENT_NODE: {
//get the attribute list for this node.
- StringBuffer tempElementString = new StringBuffer(node.getNodeName());
+ StringBuilder tempElementString = new StringBuilder(node.getNodeName());
NamedNodeMap attributeList = node.getAttributes();
if ( attributeList != null ) {
for(int i= 0; i <attributeList.getLength();i++){