Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hammer2019-09-14 20:15:13 +0000
committerLars Vogel2019-10-02 07:02:35 +0000
commit1e75ec162f392dcfe6eb9e3cfad6dfef6ea3d1c0 (patch)
tree7797f4b792fecc271af0611301bbdf4a95257bd9 /bundles/org.eclipse.equinox.p2.metadata
parent247d7f936fe1e34e4e862f3d75e5c8a20e328b01 (diff)
downloadrt.equinox.p2-1e75ec162f392dcfe6eb9e3cfad6dfef6ea3d1c0.tar.gz
rt.equinox.p2-1e75ec162f392dcfe6eb9e3cfad6dfef6ea3d1c0.tar.xz
rt.equinox.p2-1e75ec162f392dcfe6eb9e3cfad6dfef6ea3d1c0.zip
Use StringBuilder instead of StringBuffer where possible.
Change-Id: Ie756b6925b7dfc3471659764990c85d0e17eb1df Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.metadata')
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/License.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/TouchpointData.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionFormatParser.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionParser.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/CoercingComparator.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/parser/ExpressionParser.java2
6 files changed, 9 insertions, 9 deletions
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/License.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/License.java
index 3c3e1dfdf..fc58e3e78 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/License.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/License.java
@@ -131,7 +131,7 @@ public class License implements ILicense {
*/
private String normalize(String license) {
String text = license.trim();
- StringBuffer result = new StringBuffer();
+ StringBuilder result = new StringBuilder();
int length = text.length();
for (int i = 0; i < length; i++) {
char c = text.charAt(i);
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/TouchpointData.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/TouchpointData.java
index 05f2ddb0e..1ff968aeb 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/TouchpointData.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/TouchpointData.java
@@ -90,7 +90,7 @@ public class TouchpointData implements ITouchpointData {
*/
@Override
public String toString() {
- StringBuffer result = new StringBuffer();
+ StringBuilder result = new StringBuilder();
for (Entry<String, ITouchpointInstruction> instruction : instructions.entrySet()) {
result.append(instruction.getKey()).append(" -> ").append(instruction.getValue()).append('\n'); //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionFormatParser.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionFormatParser.java
index 87b7485e5..1c1079e1c 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionFormatParser.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionFormatParser.java
@@ -1240,7 +1240,7 @@ class VersionFormatParser {
}
private String parseAndConsiderEscapeUntil(char endChar) throws VersionFormatException {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
while (current < eos) {
char c = format.charAt(current++);
if (c == endChar)
@@ -1288,7 +1288,7 @@ class VersionFormatParser {
private void parseCharacterGroup(VersionFormatParser.Instructions ep) throws VersionFormatException {
assertChar('[');
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
outer: for (; current < eos; ++current) {
char c = format.charAt(current);
switch (c) {
@@ -1355,7 +1355,7 @@ class VersionFormatParser {
++current;
ArrayList<List<String>> identifiers = new ArrayList<>();
ArrayList<String> idents = new ArrayList<>();
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
for (;;) {
if (current >= eos)
throw formatException(Messages.bad_enum_definition);
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionParser.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionParser.java
index 4ecc7e3f7..0a76d24ad 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionParser.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionParser.java
@@ -231,7 +231,7 @@ public abstract class VersionParser {
switch (c) {
case '\'' :
case '"' : {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
for (;;) {
char q = c;
if (++current == maxPos)
@@ -370,7 +370,7 @@ public abstract class VersionParser {
int pos = position[0];
ArrayList<List<String>> identifiers = new ArrayList<>();
int ordinal = -1;
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
for (;;) {
if (pos >= maxPos)
return null;
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/CoercingComparator.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/CoercingComparator.java
index 822df547e..cbfd94932 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/CoercingComparator.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/CoercingComparator.java
@@ -370,7 +370,7 @@ public abstract class CoercingComparator<T> {
}
protected IllegalArgumentException uncoercable(Object v) {
- StringBuffer sb = new StringBuffer("Cannot coerce "); //$NON-NLS-1$
+ StringBuilder sb = new StringBuilder("Cannot coerce "); //$NON-NLS-1$
if (v instanceof String) {
sb.append('\'');
sb.append(v);
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/parser/ExpressionParser.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/parser/ExpressionParser.java
index 057065de7..6c08f2a06 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/parser/ExpressionParser.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/parser/ExpressionParser.java
@@ -610,7 +610,7 @@ public class ExpressionParser extends Stack<IExpression> implements IExpressionC
private void parseDelimitedString(char delim) {
int start = ++tokenPos;
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
int top = expression.length();
while (tokenPos < top) {
char ec = expression.charAt(tokenPos);

Back to the top