Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2019-08-14 10:51:34 -0400
committerLars Vogel2019-08-14 10:51:34 -0400
commit212756c289fccaa47aac82ad584bcf7521642f64 (patch)
tree848ddda9386bf0b31b3c09e54dea4a42bbd15ae5
parent3f538fe8c4491fe9faa78c388385fec5aba3eb54 (diff)
downloadrt.equinox.framework-master.tar.gz
rt.equinox.framework-master.tar.xz
rt.equinox.framework-master.zip
from OSGi Tom asked me where I see StringBuffer used. This is NOT to modify the code (Tom suggested that we update the code from the OSGi repo), it is just to show Tom the places. Change-Id: Id2324d475bdf96d2a82fb4627d5184eca6892989 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/compatibility/state/StateConverter.java2
-rw-r--r--bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverImpl.java6
-rw-r--r--bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BaseDescriptionImpl.java2
-rw-r--r--bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleDeltaImpl.java2
-rw-r--r--bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleSpecificationImpl.java2
-rw-r--r--bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/ExportPackageDescriptionImpl.java2
-rw-r--r--bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericDescriptionImpl.java2
-rw-r--r--bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericSpecificationImpl.java2
-rw-r--r--bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/HostSpecificationImpl.java2
-rw-r--r--bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/ImportPackageSpecificationImpl.java2
-rw-r--r--bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeDescriptionImpl.java2
-rw-r--r--bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java2
-rw-r--r--bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateBuilder.java6
-rw-r--r--bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/VersionConstraintImpl.java6
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java4
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogWriter.java4
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityRow.java6
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/BERProcessor.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/PKCS7Processor.java4
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignatureBlockProcessor.java4
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerFactoryImpl.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerFactoryImpl.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java4
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/NestedDirBundleFile.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleResourceHandler.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/util/TextProcessor.java4
-rw-r--r--bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/ManifestElement.java4
28 files changed, 43 insertions, 43 deletions
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/compatibility/state/StateConverter.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/compatibility/state/StateConverter.java
index f3115f089..ccd7de19f 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/compatibility/state/StateConverter.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/compatibility/state/StateConverter.java
@@ -210,7 +210,7 @@ class StateConverter {
if (map.isEmpty())
return ""; //$NON-NLS-1$
Set<Entry<String, V>> set = map.entrySet();
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
for (Entry<String, V> entry : set) {
sb.append("; "); //$NON-NLS-1$
String key = entry.getKey();
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverImpl.java
index 0ddf0183a..fb14b6a4b 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverImpl.java
@@ -281,7 +281,7 @@ public class ResolverImpl implements Resolver {
// check to see if the bundle is disabled
DisabledInfo[] disabledInfos = state.getDisabledInfos(bundleDesc);
if (disabledInfos.length > 0) {
- StringBuffer message = new StringBuffer();
+ StringBuilder message = new StringBuilder();
for (int i = 0; i < disabledInfos.length; i++) {
if (i > 0)
message.append(' ');
@@ -303,7 +303,7 @@ public class ResolverImpl implements Resolver {
matchedEE = true;
}
if (!matchedEE) {
- StringBuffer bundleEE = new StringBuffer(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT.length() + 20);
+ StringBuilder bundleEE = new StringBuilder(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT.length() + 20);
bundleEE.append(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT).append(": "); //$NON-NLS-1$
for (int i = 0; i < ees.length; i++) {
if (i > 0)
@@ -1025,7 +1025,7 @@ public class ResolverImpl implements Resolver {
}
private void printCombination(int[] curCombination) {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
sb.append('[');
for (int i = 0; i < curCombination.length; i++) {
sb.append(curCombination[i]);
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BaseDescriptionImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BaseDescriptionImpl.java
index a1d3507e0..7c084214f 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BaseDescriptionImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BaseDescriptionImpl.java
@@ -56,7 +56,7 @@ public abstract class BaseDescriptionImpl implements BaseDescription {
return ""; //$NON-NLS-1$
String assignment = directives ? ":=" : "="; //$NON-NLS-1$//$NON-NLS-2$
Set<Entry<String, V>> set = map.entrySet();
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
for (Entry<String, V> entry : set) {
sb.append("; "); //$NON-NLS-1$
String key = entry.getKey();
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleDeltaImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleDeltaImpl.java
index a0d1464e8..c7b1bf071 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleDeltaImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleDeltaImpl.java
@@ -53,7 +53,7 @@ final class BundleDeltaImpl implements BundleDelta {
}
private static String toTypeString(int type) {
- StringBuffer typeStr = new StringBuffer();
+ StringBuilder typeStr = new StringBuilder();
if ((type & BundleDelta.ADDED) != 0)
typeStr.append("ADDED,"); //$NON-NLS-1$
if ((type & BundleDelta.REMOVED) != 0)
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleSpecificationImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleSpecificationImpl.java
index b22852037..ee40e1b00 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleSpecificationImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleSpecificationImpl.java
@@ -137,7 +137,7 @@ public class BundleSpecificationImpl extends VersionConstraintImpl implements Bu
}
private String createFilterDirective() {
- StringBuffer filter = new StringBuffer();
+ StringBuilder filter = new StringBuilder();
filter.append("(&"); //$NON-NLS-1$
synchronized (this.monitor) {
addFilterAttribute(filter, BundleRevision.BUNDLE_NAMESPACE, getName());
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/ExportPackageDescriptionImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/ExportPackageDescriptionImpl.java
index 7bfccba1a..d2e4c78cd 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/ExportPackageDescriptionImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/ExportPackageDescriptionImpl.java
@@ -114,7 +114,7 @@ public class ExportPackageDescriptionImpl extends BaseDescriptionImpl implements
}
static String toString(String[] list) {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
for (String string : list)
buffer.append(string).append(',');
if (buffer.length() > 0)
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericDescriptionImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericDescriptionImpl.java
index 6c97a19ff..57be3021d 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericDescriptionImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericDescriptionImpl.java
@@ -76,7 +76,7 @@ public class GenericDescriptionImpl extends BaseDescriptionImpl implements Gener
@Override
public String toString() {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
sb.append(Constants.PROVIDE_CAPABILITY).append(": ").append(getType()); //$NON-NLS-1$
Map<String, Object> attrs = getDeclaredAttributes();
sb.append(toString(attrs, false));
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericSpecificationImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericSpecificationImpl.java
index 1fa60bf68..cef6d8798 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericSpecificationImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericSpecificationImpl.java
@@ -73,7 +73,7 @@ public class GenericSpecificationImpl extends VersionConstraintImpl implements G
@Override
public String toString() {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
sb.append(Constants.REQUIRE_CAPABILITY).append(": ").append(getType()); //$NON-NLS-1$
if (matchingFilter != null)
sb.append("; filter=\"").append(getMatchingFilter()).append('"'); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/HostSpecificationImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/HostSpecificationImpl.java
index a39d021d0..f3f1ce008 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/HostSpecificationImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/HostSpecificationImpl.java
@@ -154,7 +154,7 @@ public class HostSpecificationImpl extends VersionConstraintImpl implements Host
}
private String createFilterDirective() {
- StringBuffer filter = new StringBuffer();
+ StringBuilder filter = new StringBuilder();
filter.append("(&"); //$NON-NLS-1$
synchronized (this.monitor) {
addFilterAttribute(filter, BundleRevision.HOST_NAMESPACE, getName());
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/ImportPackageSpecificationImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/ImportPackageSpecificationImpl.java
index 30e190832..7c99f29df 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/ImportPackageSpecificationImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/ImportPackageSpecificationImpl.java
@@ -238,7 +238,7 @@ public class ImportPackageSpecificationImpl extends VersionConstraintImpl implem
}
private String createFilterDirective() {
- StringBuffer filter = new StringBuffer();
+ StringBuilder filter = new StringBuilder();
filter.append("(&"); //$NON-NLS-1$
synchronized (this.monitor) {
addFilterAttribute(filter, BundleRevision.PACKAGE_NAMESPACE, getName(), false);
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeDescriptionImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeDescriptionImpl.java
index 91f51be7b..3bd8b580a 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeDescriptionImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeDescriptionImpl.java
@@ -116,7 +116,7 @@ public class NativeCodeDescriptionImpl extends BaseDescriptionImpl implements Na
@Override
public String toString() {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
String[] paths = getNativePaths();
for (int i = 0; i < paths.length; i++) {
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java
index 4408640dd..292ef0e91 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java
@@ -174,7 +174,7 @@ public class NativeCodeSpecificationImpl extends VersionConstraintImpl implement
@Override
public String toString() {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
NativeCodeDescription[] suppliers = getPossibleSuppliers();
for (int i = 0; i < suppliers.length; i++) {
if (i > 0)
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateBuilder.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateBuilder.java
index b96a7ae8b..37c43f786 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateBuilder.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateBuilder.java
@@ -165,7 +165,7 @@ public class StateBuilder {
if (aliasReqs == null)
continue;
for (ManifestElement aliasReq : aliasReqs) {
- StringBuffer strBuf = new StringBuffer();
+ StringBuilder strBuf = new StringBuilder();
strBuf.append(aliasReq.getValue()).append(':').append(genericAlias[2]);
String filter = aliasReq.getAttribute(Constants.SELECTION_FILTER_ATTRIBUTE);
if (filter != null)
@@ -192,7 +192,7 @@ public class StateBuilder {
if (aliasCapabilities == null)
continue;
for (ManifestElement aliasCapability : aliasCapabilities) {
- StringBuffer strBuf = new StringBuffer();
+ StringBuilder strBuf = new StringBuilder();
strBuf.append(aliasCapability.getValue()).append(':').append(genericAlias[2]);
for (Enumeration<String> keys = aliasCapability.getKeys(); keys != null && keys.hasMoreElements();) {
String key = keys.nextElement();
@@ -532,7 +532,7 @@ public class StateBuilder {
if (breeFilters.size() == 1) {
filterSpec = breeFilters.get(0);
} else {
- StringBuffer filterBuf = new StringBuffer("(|"); //$NON-NLS-1$
+ StringBuilder filterBuf = new StringBuilder("(|"); //$NON-NLS-1$
for (String breeFilter : breeFilters) {
filterBuf.append(breeFilter);
}
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/VersionConstraintImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/VersionConstraintImpl.java
index 9f53f941c..3fad96067 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/VersionConstraintImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/VersionConstraintImpl.java
@@ -198,18 +198,18 @@ abstract class VersionConstraintImpl implements VersionConstraint {
}
}
- static StringBuffer addFilterAttributes(StringBuffer filter, Map<String, ?> attributes) {
+ static StringBuilder addFilterAttributes(StringBuilder filter, Map<String, ?> attributes) {
for (Map.Entry<String, ?> entry : attributes.entrySet()) {
addFilterAttribute(filter, entry.getKey(), entry.getValue());
}
return filter;
}
- static StringBuffer addFilterAttribute(StringBuffer filter, String attr, Object value) {
+ static StringBuilder addFilterAttribute(StringBuilder filter, String attr, Object value) {
return addFilterAttribute(filter, attr, value, true);
}
- static StringBuffer addFilterAttribute(StringBuffer filter, String attr, Object value, boolean escapeWildCard) {
+ static StringBuilder addFilterAttribute(StringBuilder filter, String attr, Object value, boolean escapeWildCard) {
if (value instanceof VersionRange) {
VersionRange range = (VersionRange) value;
filter.append(range.toFilterString(attr));
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java
index f496852db..dea3620d1 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java
@@ -1667,7 +1667,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */ {
}
private String parse_value() throws InvalidSyntaxException {
- StringBuffer sb = new StringBuffer(filterChars.length - pos);
+ StringBuilder sb = new StringBuilder(filterChars.length - pos);
parseloop: while (true) {
char c = filterChars[pos];
@@ -1703,7 +1703,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */ {
}
private Object parse_substring() throws InvalidSyntaxException {
- StringBuffer sb = new StringBuffer(filterChars.length - pos);
+ StringBuilder sb = new StringBuilder(filterChars.length - pos);
List<String> operands = new ArrayList<>(10);
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java
index 61bfd8927..cfe4b48fb 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java
@@ -393,7 +393,7 @@ public abstract class ModuleClassLoader extends ClassLoader implements BundleRef
@Override
public String toString() {
Bundle b = getBundle();
- StringBuffer result = new StringBuffer(super.toString());
+ StringBuilder result = new StringBuilder(super.toString());
if (b == null)
return result.toString();
return result.append('[').append(b.getSymbolicName()).append(':').append(b.getVersion()).append("(id=").append(b.getBundleId()).append(")]").toString(); //$NON-NLS-1$//$NON-NLS-2$
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogWriter.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogWriter.java
index 32fa2ff8d..1fd7dcb6b 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogWriter.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogWriter.java
@@ -410,7 +410,7 @@ class EquinoxLogWriter implements SynchronousLogListener, LogFilter {
private String getDate(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
appendPaddedInt(c.get(Calendar.YEAR), 4, sb).append('-');
appendPaddedInt(c.get(Calendar.MONTH) + 1, 2, sb).append('-');
appendPaddedInt(c.get(Calendar.DAY_OF_MONTH), 2, sb).append(' ');
@@ -421,7 +421,7 @@ class EquinoxLogWriter implements SynchronousLogListener, LogFilter {
return sb.toString();
}
- private StringBuffer appendPaddedInt(int value, int pad, StringBuffer buffer) {
+ private StringBuilder appendPaddedInt(int value, int pad, StringBuilder buffer) {
pad = pad - 1;
if (pad == 0)
return buffer.append(Integer.toString(value));
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityRow.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityRow.java
index c00e7728f..64bdc0eb9 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityRow.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityRow.java
@@ -162,7 +162,7 @@ public final class SecurityRow implements ConditionalPermissionInfo {
return result;
}
- private static void escapeString(String str, StringBuffer output) {
+ private static void escapeString(String str, StringBuilder output) {
int len = str.length();
for (int i = 0; i < len; i++) {
char c = str.charAt(i);
@@ -186,7 +186,7 @@ public final class SecurityRow implements ConditionalPermissionInfo {
}
private static String unescapeString(String str) {
- StringBuffer output = new StringBuffer(str.length());
+ StringBuilder output = new StringBuilder(str.length());
int end = str.length();
for (int i = 0; i < end; i++) {
char c = str.charAt(i);
@@ -439,7 +439,7 @@ public final class SecurityRow implements ConditionalPermissionInfo {
}
static String getEncoded(String name, ConditionInfo[] conditionInfos, PermissionInfo[] permissionInfos, boolean deny) {
- StringBuffer result = new StringBuffer();
+ StringBuilder result = new StringBuilder();
if (deny)
result.append(ConditionalPermissionInfo.DENY);
else
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/BERProcessor.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/BERProcessor.java
index 5da9c8e93..5cfb4215b 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/BERProcessor.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/BERProcessor.java
@@ -152,7 +152,7 @@ public class BERProcessor {
*/
@Override
public String toString() {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
switch (classOfTag) {
case UNIVERSAL_TAGCLASS :
sb.append('U');
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/PKCS7Processor.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/PKCS7Processor.java
index 248a2e471..37bc0ec11 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/PKCS7Processor.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/PKCS7Processor.java
@@ -59,7 +59,7 @@ public class PKCS7Processor implements SignedContentConstants {
private Date signingTime;
private static String oid2String(int oid[]) {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
for (int i = 0; i < oid.length; i++) {
if (i > 0)
sb.append('.');
@@ -205,7 +205,7 @@ public class PKCS7Processor implements SignedContentConstants {
// create the appropriate date time string format
// date format could be yyyyMMddHHmmss[.s...]Z or yyyyMMddHHmmssZ
int dotIndex = dateString.indexOf('.');
- StringBuffer dateFormatSB = new StringBuffer("yyyyMMddHHmmss"); //$NON-NLS-1$
+ StringBuilder dateFormatSB = new StringBuilder("yyyyMMddHHmmss"); //$NON-NLS-1$
if (dotIndex != -1) {
// yyyyMMddHHmmss[.s...]Z, find out number of s in the bracket
int noS = dateString.indexOf('Z') - 1 - dotIndex;
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignatureBlockProcessor.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignatureBlockProcessor.java
index 63bf5522b..04d6abe02 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignatureBlockProcessor.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignatureBlockProcessor.java
@@ -454,14 +454,14 @@ public class SignatureBlockProcessor implements SignedContentConstants {
private static String stripContinuations(String entry) {
if (entry.indexOf("\n ") < 0 && entry.indexOf("\r ") < 0) //$NON-NLS-1$//$NON-NLS-2$
return entry;
- StringBuffer buffer = new StringBuffer(entry);
+ StringBuilder buffer = new StringBuilder(entry);
removeAll(buffer, "\r\n "); //$NON-NLS-1$
removeAll(buffer, "\n "); //$NON-NLS-1$
removeAll(buffer, "\r "); //$NON-NLS-1$
return buffer.toString();
}
- private static StringBuffer removeAll(StringBuffer buffer, String toRemove) {
+ private static StringBuilder removeAll(StringBuilder buffer, String toRemove) {
int index = buffer.indexOf(toRemove);
int length = toRemove.length();
while (index > 0) {
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerFactoryImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerFactoryImpl.java
index 3afa85e77..077ade007 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerFactoryImpl.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerFactoryImpl.java
@@ -81,7 +81,7 @@ public class ContentHandlerFactoryImpl extends MultiplexingFactory implements ja
convertedContentType = convertedContentType.replace('-', '_');
StringTokenizer tok = new StringTokenizer(builtInHandlers, "|"); //$NON-NLS-1$
while (tok.hasMoreElements()) {
- StringBuffer name = new StringBuffer();
+ StringBuilder name = new StringBuilder();
name.append(tok.nextToken());
name.append("."); //$NON-NLS-1$
name.append(convertedContentType);
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerFactoryImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerFactoryImpl.java
index 204715ffd..d74f030b9 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerFactoryImpl.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerFactoryImpl.java
@@ -66,7 +66,7 @@ public class URLStreamHandlerFactoryImpl extends MultiplexingFactory implements
Class<?> clazz;
StringTokenizer tok = new StringTokenizer(builtInHandlers, "|"); //$NON-NLS-1$
while (tok.hasMoreElements()) {
- StringBuffer name = new StringBuffer();
+ StringBuilder name = new StringBuilder();
name.append(tok.nextToken());
name.append("."); //$NON-NLS-1$
name.append(protocol);
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java
index d4d89cd17..8b985cafe 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java
@@ -2019,7 +2019,7 @@ public class Storage {
}
public static String sanitizeFilterInput(String filePattern) throws InvalidSyntaxException {
- StringBuffer buffer = null;
+ StringBuilder buffer = null;
boolean foundEscape = false;
for (int i = 0; i < filePattern.length(); i++) {
char c = filePattern.charAt(i);
@@ -2034,7 +2034,7 @@ public class Storage {
case ')' :
if (!foundEscape) {
if (buffer == null) {
- buffer = new StringBuffer(filePattern.length() + 16);
+ buffer = new StringBuilder(filePattern.length() + 16);
buffer.append(filePattern.substring(0, i));
}
// must escape with '\'
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/NestedDirBundleFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/NestedDirBundleFile.java
index 4d8fc7c68..1167b9f45 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/NestedDirBundleFile.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/NestedDirBundleFile.java
@@ -108,7 +108,7 @@ public class NestedDirBundleFile extends BundleFile {
private String prependNestedDir(String path) {
if (path.length() > 0 && path.charAt(0) == '/')
path = path.substring(1);
- return new StringBuffer(nestedDirName).append(path).toString();
+ return new StringBuilder(nestedDirName).append(path).toString();
}
@Override
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleResourceHandler.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleResourceHandler.java
index b0ada55f0..991f0574b 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleResourceHandler.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleResourceHandler.java
@@ -193,7 +193,7 @@ public abstract class BundleResourceHandler extends URLStreamHandler {
*/
@Override
protected String toExternalForm(URL url) {
- StringBuffer result = new StringBuffer(url.getProtocol());
+ StringBuilder result = new StringBuilder(url.getProtocol());
result.append("://"); //$NON-NLS-1$
String host = url.getHost();
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/util/TextProcessor.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/util/TextProcessor.java
index 4e6224e6f..69f2e910b 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/util/TextProcessor.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/util/TextProcessor.java
@@ -171,7 +171,7 @@ public class TextProcessor {
delimiter = delimiter == null ? getDefaultDelimiters() : delimiter;
- StringBuffer target = new StringBuffer();
+ StringBuilder target = new StringBuilder();
target.append(LRE);
char ch;
@@ -240,7 +240,7 @@ public class TextProcessor {
if (!IS_PROCESSING_NEEDED || str == null || str.length() <= 1)
return str;
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
for (int i = 0; i < str.length(); i++) {
char c = str.charAt(i);
switch (c) {
diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/ManifestElement.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/ManifestElement.java
index 76833c7ee..51cd39f78 100644
--- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/ManifestElement.java
+++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/ManifestElement.java
@@ -589,7 +589,7 @@ public class ManifestElement {
Enumeration<String> directiveKeys = getDirectiveKeys();
if (attrKeys == null && directiveKeys == null)
return mainValue;
- StringBuffer result = new StringBuffer(mainValue);
+ StringBuilder result = new StringBuilder(mainValue);
if (attrKeys != null) {
while (attrKeys.hasMoreElements()) {
String key = attrKeys.nextElement();
@@ -605,7 +605,7 @@ public class ManifestElement {
return result.toString();
}
- private void addValues(boolean directive, String key, String[] values, StringBuffer result) {
+ private void addValues(boolean directive, String key, String[] values, StringBuilder result) {
if (values == null)
return;
for (String value : values) {

Back to the top