aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Bricon2018-04-10 10:56:01 -0400
committerFred Bricon2018-04-10 10:56:01 -0400
commit9f4036d305bf69600097a53dba1c5230bce464dc (patch)
tree0edd6521fa718f47f6c7dd9a36dd3c13ea2eb6ab
parent41f5ae34ad2543ef1439b7fd7e0a03b596af8685 (diff)
downloadm2e-core-9f4036d305bf69600097a53dba1c5230bce464dc.tar.gz
m2e-core-9f4036d305bf69600097a53dba1c5230bce464dc.tar.xz
m2e-core-9f4036d305bf69600097a53dba1c5230bce464dc.zip
Code cleanup: replace StringBuffers with StringBuilders
Change-Id: I47377dfbb4be208cf7f7e4b318217e58faf754e4 Signed-off-by: Fred Bricon <fbricon@gmail.com>
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/WorkingSetGroup.java2
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomEdits.java2
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/CComboContentAdapter.java2
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/M2EUIUtils.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactKey.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexedArtifact.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryInfo.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenUpdateRequest.java4
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/startup/UpdateConfigurationStartup.java2
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertExpressionProposal.java2
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java2
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java2
12 files changed, 13 insertions, 13 deletions
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/WorkingSetGroup.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/WorkingSetGroup.java
index 1a8a0f49..ab7f6022 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/WorkingSetGroup.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/WorkingSetGroup.java
@@ -141,7 +141,7 @@ public class WorkingSetGroup {
if(element instanceof IWorkingSet) {
return ((IWorkingSet) element).getLabel();
} else if(element instanceof List<?>) {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
for(Object o : (List<?>) element) {
if(o instanceof IWorkingSet) {
if(sb.length() > 0) {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomEdits.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomEdits.java
index 0d7349ac..c00d24a6 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomEdits.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomEdits.java
@@ -183,7 +183,7 @@ public class PomEdits {
public static String getTextValue(Node element) {
if(element == null)
return null;
- StringBuffer buff = new StringBuffer();
+ StringBuilder buff = new StringBuilder();
NodeList list = element.getChildNodes();
for(int i = 0; i < list.getLength(); i++ ) {
Node child = list.item(i);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/CComboContentAdapter.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/CComboContentAdapter.java
index 088b9014..b1b25817 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/CComboContentAdapter.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/CComboContentAdapter.java
@@ -49,7 +49,7 @@ public class CComboContentAdapter implements IControlContentAdapter /*, IControl
CCombo combo = (CCombo) control;
String contents = combo.getText();
Point selection = combo.getSelection();
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
sb.append(contents.substring(0, selection.x));
sb.append(text);
if(selection.y < contents.length()) {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/M2EUIUtils.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/M2EUIUtils.java
index 966fd6b3..bec34e4f 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/M2EUIUtils.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/M2EUIUtils.java
@@ -46,7 +46,7 @@ public class M2EUIUtils {
}
public static void showErrorDialog(Shell shell, String title, String msg, Exception e) {
- StringBuffer buff = new StringBuffer(msg);
+ StringBuilder buff = new StringBuilder(msg);
Throwable t = M2EUtils.getRootCause(e);
if(t != null && !nullOrEmpty(t.getMessage())) {
buff.append(t.getMessage());
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactKey.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactKey.java
index c706e09c..7d1d20d9 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactKey.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactKey.java
@@ -84,7 +84,7 @@ public class ArtifactKey implements Serializable {
}
public String toString() {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
sb.append(groupId).append(':').append(artifactId).append(':').append(version);
if(classifier != null) {
sb.append(':').append(classifier);
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexedArtifact.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexedArtifact.java
index 63c4f27d..e923dfac 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexedArtifact.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexedArtifact.java
@@ -81,7 +81,7 @@ public class IndexedArtifact implements Comparable<IndexedArtifact> {
}
public String toString() {
- StringBuffer sb = new StringBuffer(
+ StringBuilder sb = new StringBuilder(
"\n" + getClassname() + " " + packageName + " " + getGroupId() + " : " + getArtifactId()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
return sb.toString();
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryInfo.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryInfo.java
index 3ff0049a..21a3d746 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryInfo.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryInfo.java
@@ -122,7 +122,7 @@ public class RepositoryInfo implements IRepository {
MessageDigest digest = MessageDigest.getInstance("MD5"); //$NON-NLS-1$
digest.update(sb.toString().getBytes());
byte messageDigest[] = digest.digest();
- StringBuffer hexString = new StringBuffer();
+ StringBuilder hexString = new StringBuilder();
for(int i = 0; i < messageDigest.length; i++ ) {
String hex = Integer.toHexString(0xFF & messageDigest[i]);
if(hex.length() == 1) {
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenUpdateRequest.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenUpdateRequest.java
index fd919cdd..e3c4d1b9 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenUpdateRequest.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenUpdateRequest.java
@@ -56,8 +56,8 @@ public class MavenUpdateRequest {
public MavenUpdateRequest(IProject[] projects, boolean offline, boolean updateSnapshots) {
this(offline, updateSnapshots);
- for(int i = 0; i < projects.length; i++ ) {
- addPomFile(projects[i]);
+ for(IProject project : projects) {
+ addPomFile(project);
}
}
diff --git a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/startup/UpdateConfigurationStartup.java b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/startup/UpdateConfigurationStartup.java
index 8b49f391..344a4b8b 100644
--- a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/startup/UpdateConfigurationStartup.java
+++ b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/startup/UpdateConfigurationStartup.java
@@ -136,7 +136,7 @@ public class UpdateConfigurationStartup implements IStartup {
}
private static void setEarlyActivationPreference(String[] disabledPlugins) {// Add ourself to disabled
- StringBuffer preference = new StringBuffer();
+ StringBuilder preference = new StringBuilder();
for(String item : disabledPlugins) {
preference.append(item).append(IPreferenceConstants.SEPARATOR);
}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertExpressionProposal.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertExpressionProposal.java
index 6dedd533..c91f0bd9 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertExpressionProposal.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertExpressionProposal.java
@@ -81,7 +81,7 @@ public class InsertExpressionProposal
}
}
}
- StringBuffer buff = new StringBuffer();
+ StringBuilder buff = new StringBuilder();
buff.append("<html>"); //$NON-NLS-1$
if(value != null) {
buff.append(NLS.bind(Messages.InsertExpressionProposal_hint1, value));
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java
index f29862d6..ab5f52ff 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java
@@ -279,7 +279,7 @@ public class XmlUtils {
* level -1 means all the way to the top.
*/
public static String pathUp(Node node, int level) {
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
int current = level;
while(node != null && current > 0) {
if(node instanceof Element) {
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java
index 61313d44..c982cb11 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java
@@ -451,7 +451,7 @@ public class ManageDependenciesDialog extends AbstractMavenDialog {
return ""; //$NON-NLS-1$
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append(project.getGroupId() + " : " + project.getArtifactId() + " : " + project.getVersion()); //$NON-NLS-1$ //$NON-NLS-2$
return buffer.toString();