Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2019-06-20 02:55:39 -0400
committerLars Vogel2019-06-20 10:23:44 -0400
commit28eafb0f03d500dd162f2151845d2644cfc5ab5c (patch)
tree566014f80e777223b4d78d8d43b87d9f9289beed /org.eclipse.debug.ui/ui
parent7757dfc66e70003c0d3b546af66aba962b4fa44e (diff)
downloadeclipse.platform.debug-28eafb0f03d500dd162f2151845d2644cfc5ab5c.tar.gz
eclipse.platform.debug-28eafb0f03d500dd162f2151845d2644cfc5ab5c.tar.xz
eclipse.platform.debug-28eafb0f03d500dd162f2151845d2644cfc5ab5c.zip
Small String optimizationI20190620-1800
Useless toString call in String concatenation Using String.valueOf instead of ""+ Use faster indexof('') version Change-Id: Iec383bd1b6af03a40af735f9ec878689caf4fb23 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Diffstat (limited to 'org.eclipse.debug.ui/ui')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java4
10 files changed, 16 insertions, 16 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java
index e8d565124..23b970649 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java
@@ -370,7 +370,7 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
fmodes = LaunchConfigurationPresentationManager.getDefault().getLaunchModeNames(smodes);
if(!fmodes.isEmpty()) {
//add the mode set and create a combo
- String modeString= fmodes.size() == 1 ? fmodes.get(0).toString() : fmodes.toString();
+ String modeString= fmodes.size() == 1 ? fmodes.get(0) : fmodes.toString();
SWTFactory.createLabel(parent, modeString + ":", 1); //$NON-NLS-1$
combo = SWTFactory.createCombo(parent, SWT.READ_ONLY, 1, fgPerspectiveLabels);
if(combo == null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java
index 8ff077d7c..45e137203 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java
@@ -189,7 +189,7 @@ public class ProcessPropertyPage extends PropertyPage {
return tmp;
}
tmp = proc.getLabel();
- int idx = tmp.lastIndexOf("("); //$NON-NLS-1$
+ int idx = tmp.lastIndexOf('(');
if(idx < 0) {
idx = tmp.length();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java
index 0a29af029..7799b6d50 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java
@@ -138,7 +138,7 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
end = Math.max(end, otherEnd);
fLength = end - fIndex;
if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) {
- DebugUIPlugin.trace("coalesced: " + this.toString()); //$NON-NLS-1$
+ DebugUIPlugin.trace("coalesced: " + this); //$NON-NLS-1$
}
return true;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java
index bf8bd98df..b3cca22bc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java
@@ -894,7 +894,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
String[] columns = entry.getValue();
visible.putInteger(SIZE, columns.length);
for (int i = 0; i < columns.length; i++) {
- visible.putString(COLUMN+Integer.toString(i), columns[i]);
+ visible.putString(COLUMN+i, columns[i]);
}
}
}
@@ -905,7 +905,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
int[] order = entry.getValue();
orderMemento.putInteger(SIZE, order.length);
for (int i = 0; i < order.length; i++) {
- orderMemento.putInteger(COLUMN+Integer.toString(i), order[i]);
+ orderMemento.putInteger(COLUMN+i, order[i]);
}
}
}
@@ -951,7 +951,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
int length = integer.intValue();
String[] columns = new String[length];
for (int j = 0; j < length; j++) {
- columns[j] = child.getString(COLUMN+Integer.toString(j));
+ columns[j] = child.getString(COLUMN+j);
}
fVisibleColumns.put(id, columns);
}
@@ -965,7 +965,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
int length = integer.intValue();
int[] order = new int[length];
for (int j = 0; j < length; j++) {
- order[j] = child.getInteger(COLUMN+Integer.toString(j)).intValue();
+ order[j] = child.getInteger(COLUMN+j).intValue();
}
fColumnOrder.put(id, order);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
index a722be5aa..351f5d5ed 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
@@ -1296,7 +1296,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
String[] columns = entry.getValue();
visible.putInteger(SIZE, columns.length);
for (int i = 0; i < columns.length; i++) {
- visible.putString(COLUMN+Integer.toString(i), columns[i]);
+ visible.putString(COLUMN+i, columns[i]);
}
}
}
@@ -1333,7 +1333,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
int length = integer.intValue();
String[] columns = new String[length];
for (int j = 0; j < length; j++) {
- columns[j] = child.getString(COLUMN+Integer.toString(j));
+ columns[j] = child.getString(COLUMN+j);
}
fVisibleColumns.put(id, columns);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
index 80c487b76..073898188 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
@@ -524,7 +524,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
private void doModelChanged(IModelDelta delta, IModelProxy proxy) {
if (!proxy.isDisposed()) {
if (DebugUIPlugin.DEBUG_DELTAS && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) {
- DebugUIPlugin.trace("RECEIVED DELTA: " + delta.toString()); //$NON-NLS-1$
+ DebugUIPlugin.trace("RECEIVED DELTA: " + delta); //$NON-NLS-1$
}
updateModel(delta, getModelDeltaMask());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java
index 4ddb63f31..168ac1b6a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java
@@ -288,7 +288,7 @@ class ViewerStateTracker {
&& DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(
fContentProvider.getPresentationContext())) {
DebugUIPlugin.trace("STATE RESTORE BEGINS"); //$NON-NLS-1$
- DebugUIPlugin.trace("\tRESTORE: " + stateDelta2.toString()); //$NON-NLS-1$
+ DebugUIPlugin.trace("\tRESTORE: " + stateDelta2); //$NON-NLS-1$
notifyStateUpdate(input, STATE_RESTORE_SEQUENCE_BEGINS, null);
}
stateDelta2.setElement(input);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java
index 683de9c45..b11584e90 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java
@@ -69,14 +69,14 @@ public class TableRenderingPropertiesPage extends PropertyPage implements
addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_2, content.toString());
}
- String length = String.valueOf(rendering.getAddressableUnitPerColumn()) + " " + DebugUIMessages.TableRenderingPropertiesPage_3; //$NON-NLS-1$
+ String length = rendering.getAddressableUnitPerColumn() + " " + DebugUIMessages.TableRenderingPropertiesPage_3; //$NON-NLS-1$
addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_4, length);
String selectedContent = rendering.getSelectedAsString();
addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_5, selectedContent);
int addressableSize = rendering.getAddressableSize() * 8;
- addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_6, String.valueOf(addressableSize) + " " + DebugUIMessages.TableRenderingPropertiesPage_8); //$NON-NLS-1$
+ addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_6, addressableSize + " " + DebugUIMessages.TableRenderingPropertiesPage_8); //$NON-NLS-1$
boolean endianessKnown = bytes[0].isEndianessKnown();
int endianess = RenderingsUtil.ENDIANESS_UNKNOWN;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java
index f5a5c9354..ff9c356e7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java
@@ -110,7 +110,7 @@ public class AvailableLogicalStructuresAction extends Action implements IMenuCre
}
label.append(action.getText());
if (enabledType == type) {
- action.setText(label.toString() + " " + VariablesViewMessages.AvailableLogicalStructuresAction_2); //$NON-NLS-1$
+ action.setText(label + " " + VariablesViewMessages.AvailableLogicalStructuresAction_2); //$NON-NLS-1$
} else {
action.setText(label.toString());
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java
index f4e5588c6..6e353459f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java
@@ -285,9 +285,9 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
*/
protected String decorateLabel(String label) {
if (fLabelDecorator != null) {
- return fLabelDecorator.decorateText(label.toString(), this);
+ return fLabelDecorator.decorateText(label, this);
}
- return label.toString();
+ return label;
}
/**

Back to the top