Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchammer2019-11-12 22:01:53 +0000
committerKarsten Thoms2019-12-10 20:54:52 +0000
commit3cc2eb1128810a7319e9e23c0fc6029c324fb30a (patch)
tree32f9c49e2534359f2d324cd0bf93f5536302c5d8 /org.eclipse.debug.ui/ui/org
parent96aae7f86b741a42618dbe787394e64557605e66 (diff)
downloadeclipse.platform.debug-3cc2eb1128810a7319e9e23c0fc6029c324fb30a.tar.gz
eclipse.platform.debug-3cc2eb1128810a7319e9e23c0fc6029c324fb30a.tar.xz
eclipse.platform.debug-3cc2eb1128810a7319e9e23c0fc6029c324fb30a.zip
Use jdk 5 for-each loop
Replace simple uses of Iterator with a corresponding for-loop. Also add missing braces on loops as necessary. Change-Id: Ic778a3ae3faac8009970f13a7f9f15f07d5d7b58 Signed-off-by: chammer <carsten.hammer@t-online.de>
Diffstat (limited to 'org.eclipse.debug.ui/ui/org')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java94
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java19
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java28
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java8
7 files changed, 72 insertions, 110 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java
index ca5219b40..99ae859ea 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java
@@ -485,8 +485,8 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
Object o = selection.getFirstElement();
LaunchShortcutExtension ext = null;
ILaunchConfiguration[] cfgs = null;
- for(int i = 0; i < shortcuts.size(); i++) {
- ext = shortcuts.get(i);
+ for (LaunchShortcutExtension shortcut : shortcuts) {
+ ext = shortcut;
if(o instanceof IEditorPart) {
cfgs = ext.getLaunchConfigurations((IEditorPart)o);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
index 1898e7821..ec0934c17 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
@@ -197,9 +197,8 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
launchManager.addLaunchListener(this);
DebugUIPlugin.getDefault().addSaveParticipant(this);
//update histories for launches already registered
- ILaunch[] launches = launchManager.getLaunches();
- for (int i = 0; i < launches.length; i++) {
- launchAdded(launches[i]);
+ for (ILaunch launch : launchManager.getLaunches()) {
+ launchAdded(launch);
}
}
@@ -243,14 +242,10 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
return configurations;
}
List<ILaunchConfiguration> filteredConfigs = new ArrayList<>();
- ILaunchConfigurationType type = null;
- LaunchConfigurationTypeContribution contribution = null;
- ILaunchConfiguration configuration = null;
- for (int i = 0; i < configurations.length; i++) {
- configuration = configurations[i];
+ for (ILaunchConfiguration configuration : configurations) {
try {
- type = configuration.getType();
- contribution = new LaunchConfigurationTypeContribution(type);
+ ILaunchConfigurationType type = configuration.getType();
+ LaunchConfigurationTypeContribution contribution = new LaunchConfigurationTypeContribution(type);
if (DebugUIPlugin.doLaunchConfigurationFiltering(configuration) & !WorkbenchActivityHelper.filterItem(contribution)) {
filteredConfigs.add(configuration);
}
@@ -275,10 +270,10 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
return delegates;
}
HashSet<ILaunchDelegate> set = new HashSet<>();
- for(int i = 0; i < delegates.length; i++) {
+ for (ILaunchDelegate delegate : delegates) {
//filter by capabilities
- if(!WorkbenchActivityHelper.filterItem(new LaunchDelegateContribution(delegates[i]))) {
- set.add(delegates[i]);
+ if(!WorkbenchActivityHelper.filterItem(new LaunchDelegateContribution(delegate))) {
+ set.add(delegate);
}
}
return set.toArray(new ILaunchDelegate[set.size()]);
@@ -327,9 +322,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
protected void removeTerminatedLaunches(ILaunch newLaunch) {
if (DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugUIConstants.PREF_AUTO_REMOVE_OLD_LAUNCHES)) {
ILaunchManager lManager= DebugPlugin.getDefault().getLaunchManager();
- Object[] launches= lManager.getLaunches();
- for (int i= 0; i < launches.length; i++) {
- ILaunch launch= (ILaunch)launches[i];
+ for (ILaunch launch : lManager.getLaunches()) {
if (launch != newLaunch && launch.isTerminated()) {
lManager.removeLaunch(launch);
}
@@ -434,8 +427,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
* @throws CoreException is an exception occurs
*/
protected void createEntry(Document doc, Element historyRootElement, ILaunchConfiguration[] configurations) throws CoreException {
- for (int i = 0; i < configurations.length; i++) {
- ILaunchConfiguration configuration = configurations[i];
+ for (ILaunchConfiguration configuration : configurations) {
if (configuration.exists()) {
Element launch = doc.createElement(IConfigurationElementConstants.LAUNCH);
launch.setAttribute(IConfigurationElementConstants.MEMENTO, configuration.getMemento());
@@ -561,18 +553,16 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
if (node.getNodeType() == Node.ELEMENT_NODE) {
Element element = (Element)node;
if (element.getNodeName().equals(IConfigurationElementConstants.MRU_HISTORY)) {
- ILaunchConfiguration[] configs = getLaunchConfigurations(element);
- for (int j = 0; j < configs.length; j++) {
- history.addHistory(configs[j], false);
+ for (ILaunchConfiguration config : getLaunchConfigurations(element)) {
+ history.addHistory(config, false);
}
} else if (element.getNodeName().equals(IConfigurationElementConstants.FAVORITES)) {
ILaunchConfiguration[] favs = getLaunchConfigurations(element);
history.setFavorites(favs);
// add any favorites that have been added to the workspace before this plug-in
// was loaded - @see bug 231600
- ILaunchConfiguration[] configurations = getLaunchManager().getLaunchConfigurations();
- for (int j = 0; j < configurations.length; j++) {
- history.checkFavorites(configurations[j]);
+ for (ILaunchConfiguration configuration : getLaunchManager().getLaunchConfigurations()) {
+ history.checkFavorites(configuration);
}
}
}
@@ -627,9 +617,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
//touch the type to see if its type exists
launchConfig.getType();
if (launchConfig.exists()) {
- LaunchHistory history = null;
- for (int i = 0; i < histories.length; i++) {
- history = histories[i];
+ for (LaunchHistory history : histories) {
if (history.accepts(launchConfig) && history.getLaunchGroup().getMode().equals(mode)) {
history.addHistory(launchConfig, prepend);
}
@@ -651,8 +639,8 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
// Load the configuration elements into a Map
fLaunchShortcuts = new ArrayList<>(infos.length);
- for (int i = 0; i < infos.length; i++) {
- fLaunchShortcuts.add(new LaunchShortcutExtension(infos[i]));
+ for (IConfigurationElement info : infos) {
+ fLaunchShortcuts.add(new LaunchShortcutExtension(info));
}
Collections.sort(fLaunchShortcuts, new ShortcutComparator());
}
@@ -670,8 +658,8 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
// Load the configuration elements into a Map
fLaunchGroups = new HashMap<>(infos.length);
LaunchGroupExtension ext = null;
- for (int i = 0; i < infos.length; i++) {
- ext = new LaunchGroupExtension(infos[i]);
+ for (IConfigurationElement info : infos) {
+ ext = new LaunchGroupExtension(info);
fLaunchGroups.put(ext.getIdentifier(), ext);
}
}
@@ -779,16 +767,12 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
//copy into collection for hashcode matching
HashSet<String> typeset = new HashSet<>(ctypes.length);
Collections.addAll(typeset, ctypes);
- ILaunchConfiguration[] configurations = filterConfigs(getLaunchManager().getLaunchConfigurations());
- ILaunchConfiguration configuration = null;
- IResource[] resrcs = null;
- for(int i = 0; i < configurations.length; i++) {
- configuration = configurations[i];
+ for (ILaunchConfiguration configuration : filterConfigs(getLaunchManager().getLaunchConfigurations())) {
if(typeset.contains(configuration.getType().getIdentifier()) && acceptConfiguration(configuration)) {
- resrcs = configuration.getMappedResources();
+ IResource[] resrcs = configuration.getMappedResources();
if (resrcs != null) {
- for (int j = 0; j < resrcs.length; j++) {
- if (resource.equals(resrcs[j]) || resource.getFullPath().isPrefixOf(resrcs[j].getFullPath())) {
+ for (IResource res : resrcs) {
+ if (resource.equals(res) || resource.getFullPath().isPrefixOf(res.getFullPath())) {
list.add(configuration);
break;
}
@@ -908,13 +892,13 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
LaunchHistory history = getLaunchHistory(group.getIdentifier());
if(history != null) {
ILaunchConfiguration[] configs = history.getCompleteLaunchHistory();
- for(int i = 0; i < configs.length; i++) {
- if(configurations.contains(configs[i])) {
+ for (ILaunchConfiguration config : configs) {
+ if(configurations.contains(config)) {
if(resource instanceof IContainer) {
- return configs[i];
+ return config;
}
else {
- candidates.add(configs[i]);
+ candidates.add(config);
}
}
}
@@ -925,8 +909,8 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
try {
res = config.getMappedResources();
if(res != null) {
- for(int i = 0; i < res.length; i++) {
- if(res[i].equals(resource)) {
+ for (IResource re : res) {
+ if(re.equals(resource)) {
return config;
}
}
@@ -935,9 +919,9 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
catch(CoreException ce) {}
}
}
- for(int i = 0; i < configs.length; i++) {
- if(candidates.contains(configs[i])) {
- return configs[i];
+ for (ILaunchConfiguration config : configs) {
+ if(candidates.contains(config)) {
+ return config;
}
}
}
@@ -1059,8 +1043,8 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
ILaunchGroup[] groups = getLaunchGroups();
fLaunchHistories = new HashMap<>(groups.length);
ILaunchGroup extension = null;
- for (int i = 0; i < groups.length; i++) {
- extension = groups[i];
+ for (ILaunchGroup group : groups) {
+ extension = group;
if (extension.isPublic()) {
fLaunchHistories.put(extension.getIdentifier(), new LaunchHistory(extension));
}
@@ -1097,10 +1081,9 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
return null;
}
String category = type.getCategory();
- ILaunchGroup[] groups = getLaunchGroups();
ILaunchGroup extension = null;
- for (int i = 0; i < groups.length; i++) {
- extension = groups[i];
+ for (ILaunchGroup group : getLaunchGroups()) {
+ extension = group;
if (category == null) {
if (extension.getCategory() == null && extension.getMode().equals(mode)) {
return extension;
@@ -1147,10 +1130,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
String id = type.getIdentifier();
String name = id + ".SHARED_INFO"; //$NON-NLS-1$
ILaunchConfiguration shared = null;
- ILaunchConfiguration[] configurations = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(type);
- ILaunchConfiguration configuration = null;
- for (int i = 0; i < configurations.length; i++) {
- configuration = configurations[i];
+ for (ILaunchConfiguration configuration : DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(type)) {
if (configuration.getName().equals(name)) {
shared = configuration;
break;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
index cd8b1a640..cfdeacac5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
@@ -20,7 +20,6 @@ import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Set;
import org.eclipse.core.runtime.CoreException;
@@ -1269,8 +1268,8 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
}
value = IInternalDebugCoreConstants.EMPTY_STRING;
//build the preference string
- for (Iterator<String> iter = list.iterator(); iter.hasNext();) {
- value += iter.next() + DELIMITER;
+ for (String segment : list) {
+ value += segment + DELIMITER;
}
settings.put(DIALOG_EXPANDED_NODES, value);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java
index 2e5c82fda..bed606c1b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java
@@ -321,9 +321,7 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
* @since 3.2
*/
private void initFieldEditors() {
- FieldEditor editor;
- for(int i = 0; i < fFieldEditors.size(); i++) {
- editor = fFieldEditors.get(i);
+ for (FieldEditor editor : fFieldEditors) {
editor.setPreferenceStore(getPreferenceStore());
editor.load();
}
@@ -331,10 +329,9 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
Platform.getPreferencesService().getBoolean(DebugPlugin.getUniqueIdentifier(),
DebugPlugin.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE, true, null));
//restore the tables' checked state
- String[] types = getPreferenceStore().getString(IInternalDebugUIConstants.PREF_FILTER_TYPE_LIST).split("\\,"); //$NON-NLS-1$
TableItem[] items = fTable.getItems();
ILaunchConfigurationType type;
- for (String t : types) {
+ for (String t : getPreferenceStore().getString(IInternalDebugUIConstants.PREF_FILTER_TYPE_LIST).split("\\,")) { //$NON-NLS-1$
for (TableItem item : items) {
type = (ILaunchConfigurationType) item.getData();
if (type.getIdentifier().equals(t)) {
@@ -347,29 +344,25 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
@Override
protected void performDefaults() {
fDeleteConfigs.setSelection(Preferences.getDefaultBoolean(DebugPlugin.getUniqueIdentifier(), DebugPlugin.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE, true));
- FieldEditor editor = null;
- for(int i = 0; i < fFieldEditors.size(); i++) {
- editor = fFieldEditors.get(i);
+ for (FieldEditor editor : fFieldEditors) {
editor.loadDefault();
if(editor instanceof BooleanFieldEditor2) {
fTable.setEnabled(((BooleanFieldEditor2)editor).getBooleanValue());
}
}
-
}
@Override
public boolean performOk() {
//save field editors
- for(int i = 0; i < fFieldEditors.size(); i++) {
- fFieldEditors.get(i).store();
+ for (FieldEditor editor : fFieldEditors) {
+ editor.store();
}
Preferences.setBoolean(DebugPlugin.getUniqueIdentifier(), DebugPlugin.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE, fDeleteConfigs.getSelection(), null);
//save table
String types = IInternalDebugCoreConstants.EMPTY_STRING;
- TableItem[] items = fTable.getItems();
ILaunchConfigurationType type;
- for (TableItem item : items) {
+ for (TableItem item : fTable.getItems()) {
if (item.getChecked()) {
type = (ILaunchConfigurationType) item.getData();
types += type.getIdentifier()+","; //$NON-NLS-1$
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 23b970649..750ba5e74 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
@@ -544,21 +544,14 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
fSwitchSuspend.loadDefault();
PerspectiveManager pm = DebugUIPlugin.getDefault().getPerspectiveManager();
- TreeItem[] items = fTree.getItems();
- ILaunchConfigurationType type = null;
- Set<Set<String>> modes = null;
- Object[] delegates = null;
- for(int i = 0; i < items.length; i++) {
- type = (ILaunchConfigurationType) items[i].getData();
- modes = type.getSupportedModeCombinations();
- delegates = fTreeViewer.getFilteredChildren(type);
- for (Set<String> modeset : modes) {
+ for (TreeItem item : fTree.getItems()) {
+ ILaunchConfigurationType type = (ILaunchConfigurationType) item.getData();
+ for (Set<String> modeset : type.getSupportedModeCombinations()) {
fgChangeSet.add(new PerspectiveChange(type, null, modeset, pm.getDefaultLaunchPerspective(type, null, modeset)));
}
- for(int j = 0; j < delegates.length; j++) {
- ILaunchDelegate delegate = (ILaunchDelegate) delegates[j];
- modes = new HashSet<>(delegate.getModes());
- for (Set<String> modeset : modes) {
+ for (Object child : fTreeViewer.getFilteredChildren(type)) {
+ ILaunchDelegate delegate = (ILaunchDelegate) child;
+ for (Set<String> modeset : new HashSet<>(delegate.getModes())) {
fgChangeSet.add(new PerspectiveChange(type, delegate, modeset, pm.getDefaultLaunchPerspective(type, delegate, modeset)));
}
}
@@ -580,13 +573,12 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
ArrayList<String> labels = new ArrayList<>();
labels.add(DebugPreferencesMessages.PerspectivePreferencePage_4);
IPerspectiveRegistry registry = PlatformUI.getWorkbench().getPerspectiveRegistry();
- IPerspectiveDescriptor[] descriptors = registry.getPerspectives();
String label = null;
- for(int i = 0; i < descriptors.length; i++) {
- if(!WorkbenchActivityHelper.filterItem(descriptors[i])) {
- label = descriptors[i].getLabel();
+ for (IPerspectiveDescriptor descriptor : registry.getPerspectives()) {
+ if(!WorkbenchActivityHelper.filterItem(descriptor)) {
+ label = descriptor.getLabel();
labels.add(label);
- fgPerspectiveIdMap.put(label, descriptors[i].getId());
+ fgPerspectiveIdMap.put(label, descriptor.getId());
}
}
fgPerspectiveLabels = labels.toArray(new String[labels.size()]);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
index c94d5ada4..51119c0ff 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
@@ -24,7 +24,6 @@ import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
@@ -385,10 +384,9 @@ public class LaunchView extends AbstractDebugView
synchronized (this) {
if (fContext instanceof ITreeSelection) {
ITreeSelection ss = (ITreeSelection) fContext;
- TreePath[] ssPaths = ss.getPaths();
- for (int i = 0; i < ssPaths.length; i++) {
- if (ssPaths[i].startsWith(element, null)) {
- if (ssPaths[i].getSegmentCount() == element.getSegmentCount()) {
+ for (TreePath path : ss.getPaths()) {
+ if (path.startsWith(element, null)) {
+ if (path.getSegmentCount() == element.getSegmentCount()) {
event = new DebugContextEvent(this, fContext, type);
} else {
// if parent of the currently selected element
@@ -486,8 +484,8 @@ public class LaunchView extends AbstractDebugView
super(LaunchView.this);
fProviders = providers;
fActiveProvider = providers[0];
- for (int i = 0; i < fProviders.length; i++) {
- fProviders[i].addDebugContextListener(this);
+ for (IDebugContextProvider provider : fProviders) {
+ provider.addDebugContextListener(this);
}
}
@@ -519,8 +517,8 @@ public class LaunchView extends AbstractDebugView
}
void dispose() {
- for (int i = 0; i < fProviders.length; i++) {
- fProviders[i].removeDebugContextListener(this);
+ for (IDebugContextProvider provider : fProviders) {
+ provider.removeDebugContextListener(this);
}
fProviders = null;
fActiveProvider = null;
@@ -637,8 +635,8 @@ public class LaunchView extends AbstractDebugView
IPreferenceStore prefStore = DebugUIPlugin.getDefault().getPreferenceStore();
String mode = prefStore.getString(IDebugPreferenceConstants.DEBUG_VIEW_MODE);
setViewMode(mode, parent);
- for (int i = 0; i < fDebugViewModeActions.length; i++) {
- fDebugViewModeActions[i].setChecked(fDebugViewModeActions[i].getMode().equals(mode));
+ for (DebugViewModeAction action : fDebugViewModeActions) {
+ action.setChecked(action.getMode().equals(mode));
}
createDebugToolBarInViewActions(parent);
@@ -958,8 +956,8 @@ public class LaunchView extends AbstractDebugView
}
StringBuilder buffer= new StringBuilder();
- for (Iterator<String> itr = fDebugToolbarPerspectives.iterator(); itr.hasNext();) {
- buffer.append(itr.next()).append(',');
+ for (String perspectiveId : fDebugToolbarPerspectives) {
+ buffer.append(perspectiveId).append(',');
}
getPreferenceStore().setValue(IDebugPreferenceConstants.DEBUG_VIEW_TOOLBAR_HIDDEN_PERSPECTIVES, buffer.toString());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java
index 6edd222ea..ff175503e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java
@@ -87,10 +87,10 @@ public class LaunchViewCopyToClipboardActionDelegate extends VirtualCopyToClipbo
if (items == null) {
return;
}
- for (int i = 0; i < items.length; i++) {
- set.add(items[i]);
- if (items[i].getExpanded()) {
- collectChildItems(set, items[i].getItems());
+ for (TreeItem item : items) {
+ set.add(item);
+ if (item.getExpanded()) {
+ collectChildItems(set, item.getItems());
}
}
}

Back to the top