Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hammer2019-06-16 12:30:44 -0400
committerCarsten Hammer2019-10-19 04:52:44 -0400
commita9ef58351fa56adc8ab188f8fe93eb8c7255f034 (patch)
tree82948fb75b50793fc7f6686a3693ea9aa975fcaa
parent5458a74722ffb7c3784bc253d11c9d4a6b0d06b8 (diff)
downloadeclipse.platform.debug-a9ef58351fa56adc8ab188f8fe93eb8c7255f034.tar.gz
eclipse.platform.debug-a9ef58351fa56adc8ab188f8fe93eb8c7255f034.tar.xz
eclipse.platform.debug-a9ef58351fa56adc8ab188f8fe93eb8c7255f034.zip
Use jdk 5 for-each loop (Part 2)I20191024-1800I20191023-1810
Replace simple uses of Iterator with a corresponding for-each loop. Also add missing braces on loops as necessary. Change-Id: I5c017921217bcbc2909c30ef120a2104a26254b5 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointSortBy/SortBreakpointsByAction.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionsUpdater.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateActionsRequest.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/RegisterGroupProxy.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/CommonTabLite.java19
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsSelectionPage.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationAction.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationPrototypeAction.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java33
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java31
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTreeContentProvider.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeFilter.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationViewer.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java21
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java19
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingManager.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/RenderingBindings.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementLabelProvider.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java33
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchersPreferencePage.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/BasicContainerContentProvider.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIUtils.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerBrowser.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerBrowser.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkingSetSourceContainerBrowser.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariablePresentationManager.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchManagerProxy.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextManager.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java45
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingContextAction.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java47
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeModelContentProvider.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/NewMemoryViewAction.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveRenderingContextAction.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java57
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractVirtualContentTableModel.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncVirtualContentTableViewer.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressDialog.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRendering.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLine.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRendering.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTabGroup.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java23
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ExportBreakpointsOperation.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java45
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAction.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RelaunchLastAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java19
127 files changed, 634 insertions, 776 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java
index 15048895a..f90062145 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java
@@ -271,8 +271,7 @@ public class DebugPluginImages {
//try to get the images from the config types themselves, cache those that could not be found
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPE_IMAGES);
IConfigurationElement[] configElements= extensionPoint.getConfigurationElements();
- for (int i = 0; i < configElements.length; i++) {
- IConfigurationElement configElement = configElements[i];
+ for (IConfigurationElement configElement : configElements) {
ImageDescriptor descriptor = DebugUIPlugin.getImageDescriptor(configElement, ATTR_LAUNCH_CONFIG_TYPE_ICON);
if (descriptor == null) {
descriptor = ImageDescriptor.getMissingImageDescriptor();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
index 20694eba4..843e2e0d1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
@@ -93,11 +93,9 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
IExtensionPoint point= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.ID_DEBUG_MODEL_PRESENTATION);
if (point != null) {
IExtension[] extensions= point.getExtensions();
- for (int i= 0; i < extensions.length; i++) {
- IExtension extension= extensions[i];
+ for (IExtension extension : extensions) {
IConfigurationElement[] configElements= extension.getConfigurationElements();
- for (int j= 0; j < configElements.length; j++) {
- IConfigurationElement elt= configElements[j];
+ for (IConfigurationElement elt : configElements) {
String id= elt.getAttribute("id"); //$NON-NLS-1$
if (id != null) {
IDebugModelPresentation lp= new LazyModelPresentation(this, elt);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java
index 999b26f0e..bd36ba173 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java
@@ -110,8 +110,8 @@ public final class LaunchConfigurationTabExtension {
fDelegates = new HashSet<>();
IConfigurationElement[] children = fElement.getChildren(IConfigurationElementConstants.ASSOCIATED_DELEGATE);
String id = null;
- for(int i = 0; i < children.length; i++) {
- id = children[i].getAttribute(IConfigurationElementConstants.DELEGATE);
+ for (IConfigurationElement child : children) {
+ id = child.getAttribute(IConfigurationElementConstants.DELEGATE);
if(id != null) {
fDelegates.add(id);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java
index 474ee7b18..6f0b8fc3b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java
@@ -33,8 +33,8 @@ public class RemoveAllTerminatedAction extends AbstractRemoveAllActionDelegate i
protected boolean isEnabled() {
ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
if (launches != null) {
- for (int i= 0; i < launches.length; i++) {
- if (launches[i].isTerminated()) {
+ for (ILaunch launch : launches) {
+ if (launch.isTerminated()) {
return true;
}
}
@@ -44,8 +44,7 @@ public class RemoveAllTerminatedAction extends AbstractRemoveAllActionDelegate i
public static void removeTerminatedLaunches(ILaunch[] elements) {
List<ILaunch> removed = new ArrayList<>();
- for (int i = 0; i < elements.length; i++) {
- ILaunch launch = elements[i];
+ for (ILaunch launch : elements) {
if (launch.isTerminated()) {
removed.add(launch);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java
index 7fa406c38..75b3ccf3c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java
@@ -46,8 +46,7 @@ public abstract class SelectAllAction extends AbstractRemoveAllActionDelegate {
protected abstract String getActionId();
private void collectExpandedAndVisible(TreeItem[] items, List<TreeItem> result) {
- for (int i= 0; i < items.length; i++) {
- TreeItem item= items[i];
+ for (TreeItem item : items) {
result.add(item);
if (item.getExpanded()) {
collectExpandedAndVisible(item.getItems(), result);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java
index e4e33b59b..1049fedb9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java
@@ -52,8 +52,7 @@ public abstract class ToggleFilterAction extends Action {
ViewerFilter filter = getViewerFilter();
ViewerFilter[] filters = getViewer().getFilters();
boolean alreadyAdded = false;
- for (int i = 0; i < filters.length; i++) {
- ViewerFilter addedFilter = filters[i];
+ for (ViewerFilter addedFilter : filters) {
if (addedFilter.equals(filter)) {
alreadyAdded = true;
break;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java
index ebd28f5e3..41505f3ff 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java
@@ -69,9 +69,9 @@ public class SelectBreakpointWorkingsetDialog extends AbstractDebugCheckboxSelec
private IWorkingSet[] getBreakpointWorkingSets() {
IWorkingSet[] ws = PlatformUI.getWorkbench().getWorkingSetManager().getAllWorkingSets();
ArrayList<IWorkingSet> list = new ArrayList<>();
- for(int i = 0; i < ws.length; i++) {
- if(IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(ws[i].getId())) {
- list.add(ws[i]);
+ for (IWorkingSet w : ws) {
+ if (IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(w.getId())) {
+ list.add(w);
}
}
return list.toArray(new IWorkingSet[list.size()]);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointSortBy/SortBreakpointsByAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointSortBy/SortBreakpointsByAction.java
index c1c8d1965..c57d4df81 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointSortBy/SortBreakpointsByAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointSortBy/SortBreakpointsByAction.java
@@ -58,8 +58,8 @@ public class SortBreakpointsByAction extends AbstractBreakpointsViewAction imple
public void menuShown(MenuEvent e) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
+ for (MenuItem item : items) {
+ item.dispose();
}
fillMenu(m);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java
index 1d7fbfe49..b3d9094ea 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java
@@ -111,8 +111,8 @@ public class EnableBreakpointsAction implements IViewActionDelegate, IPartListen
}
public void setEnabled(IBreakpoint[] breakpoints) throws CoreException {
boolean enable= isEnableAction();
- for (int i = 0; i < breakpoints.length; i++) {
- breakpoints[i].setEnabled(enable);
+ for (IBreakpoint breakpoint : breakpoints) {
+ breakpoint.setEnabled(enable);
}
}
};
@@ -165,9 +165,9 @@ public class EnableBreakpointsAction implements IViewActionDelegate, IPartListen
}
else if (selected instanceof IBreakpointContainer) {
IBreakpoint[] breakpoints = ((IBreakpointContainer) selected).getBreakpoints();
- for (int i = 0; i < breakpoints.length; i++) {
+ for (IBreakpoint breakpoint : breakpoints) {
try {
- if (breakpoints[i].isEnabled()) {
+ if (breakpoint.isEnabled()) {
allDisabled= false;
} else {
allEnabled= false;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.java
index 9bafdd7f4..d2c0da2cb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.java
@@ -78,8 +78,8 @@ public class ShowSupportedBreakpointsAction extends ToggleFilterAction implement
if (element instanceof IBreakpointContainer) {
// Breakpoint containers are visible if any of their children are visible.
IBreakpoint[] breakpoints = ((IBreakpointContainer) element).getBreakpoints();
- for (int i = 0; i < breakpoints.length; i++) {
- if (select(viewer, element, breakpoints[i])) {
+ for (IBreakpoint breakpoint : breakpoints) {
+ if (select(viewer, element, breakpoint)) {
return true;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java
index 06365e72b..c2f9290cf 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java
@@ -117,8 +117,7 @@ public class EnableWatchExpressionAction implements IViewActionDelegate, IAction
@Override
public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- DebugEvent event = events[i];
+ for (DebugEvent event : events) {
if (event.getSource() instanceof IWatchExpression) {
if (event.getKind() == DebugEvent.CHANGE) {
selectionChanged(fAction, fSelection);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionsUpdater.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionsUpdater.java
index 8ebe00010..d8245e063 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionsUpdater.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionsUpdater.java
@@ -45,8 +45,8 @@ public class ActionsUpdater {
if (!fDone) {
if (!fEnabled || fNumOfVotes == fNumVoters) {
fDone = true;
- for (int i = 0; i < fActions.length; i++) {
- fActions[i].setEnabled(fEnabled);
+ for (IEnabledTarget fAction : fActions) {
+ fAction.setEnabled(fEnabled);
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java
index 31a513e95..99016622e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java
@@ -45,8 +45,8 @@ public class TerminateAndRelaunchAction extends DebugCommandAction {
DebugUIPlugin.getStandardDisplay().asyncExec(() -> {
// Must be run in the UI thread since the launch can require
// prompting to proceed
- for (int i = 0; i < targets.length; i++) {
- ILaunch launch = DebugUIPlugin.getLaunch(targets[i]);
+ for (Object target : targets) {
+ ILaunch launch = DebugUIPlugin.getLaunch(target);
if (launch != null) {
RelaunchActionDelegate.relaunch(launch.getLaunchConfiguration(), launch.getLaunchMode());
}
@@ -84,8 +84,8 @@ public class TerminateAndRelaunchAction extends DebugCommandAction {
ISelection context = event.getContext();
if (context instanceof IStructuredSelection) {
Object[] elements = ((IStructuredSelection)context).toArray();
- for (int i = 0; i < elements.length; i++) {
- if (!canRelaunch(elements[i])) {
+ for (Object element : elements) {
+ if (!canRelaunch(element)) {
setEnabled(false);
return;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateActionsRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateActionsRequest.java
index f3a75aa56..b40a9aede 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateActionsRequest.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateActionsRequest.java
@@ -41,8 +41,8 @@ public class UpdateActionsRequest extends DebugCommandRequest implements IEnable
@Override
public synchronized void done() {
if (!isCanceled()) {
- for (int i = 0; i < fActions.length; i++) {
- fActions[i].setEnabled(fEnabled);
+ for (IEnabledTarget action : fActions) {
+ action.setEnabled(fEnabled);
}
}
}
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 6587d6230..ca5219b40 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
@@ -279,10 +279,10 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
boolean launched = false;
ILaunchConfiguration tmp = null;
- for(int i = 0; i < launches.length; i++) {
- tmp = launches[i].getLaunchConfiguration();
- if(tmp != null) {
- if(!launches[i].isTerminated() && tmp.equals(config)) {
+ for (ILaunch launch : launches) {
+ tmp = launch.getLaunchConfiguration();
+ if (tmp != null) {
+ if (!launch.isTerminated() && tmp.equals(config)) {
launched = true;
break;
}
@@ -533,9 +533,9 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
if (list == null || configs == null) {
return;
}
- for (int i = 0; i < configs.length; i++) {
- if (!list.contains(configs[i])) {
- list.add(configs[i]);
+ for (ILaunchConfiguration config : configs) {
+ if (!list.contains(config)) {
+ list.add(config);
}
}
}
@@ -549,9 +549,9 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
workbench.addWindowListener(this);
// initialize for already open windows
IWorkbenchWindow[] workbenchWindows = workbench.getWorkbenchWindows();
- for (int i = 0; i < workbenchWindows.length; i++) {
- if (workbenchWindows[i].getSelectionService() != null) {
- windowOpened(workbenchWindows[i]);
+ for (IWorkbenchWindow workbenchWindow : workbenchWindows) {
+ if (workbenchWindow.getSelectionService() != null) {
+ windowOpened(workbenchWindow);
}
}
}
@@ -697,8 +697,8 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
//we want to ensure that even if a launch is removed from the debug view
//when it is not terminated we update the label just in case.
//bug 195232
- for(int i = 0; i < launches.length; i++) {
- if(!launches[i].isTerminated()) {
+ for (ILaunch launch : launches) {
+ if (!launch.isTerminated()) {
fUpdateLabel = true;
return;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
index 2accbd644..584e3935f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
@@ -170,8 +170,7 @@ public class DebugContextManager implements IDebugContextManager {
public void addDebugContextListener(IDebugContextListener listener) {
fGlobalListeners.add(listener);
DebugWindowContextService[] services = getServices();
- for (int i = 0; i < services.length; i++) {
- DebugWindowContextService service = services[i];
+ for (DebugWindowContextService service : services) {
service.addDebugContextListener(listener);
}
}
@@ -180,8 +179,7 @@ public class DebugContextManager implements IDebugContextManager {
public void removeDebugContextListener(IDebugContextListener listener) {
fGlobalListeners.remove(listener);
DebugWindowContextService[] services = getServices();
- for (int i = 0; i < services.length; i++) {
- DebugWindowContextService service = services[i];
+ for (DebugWindowContextService service : services) {
service.removeDebugContextListener(listener);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java
index 33531919e..8a3c3d3d9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java
@@ -75,10 +75,9 @@ public class LaunchSuspendTrigger implements ISuspendTrigger, IDebugEventSetList
public void handleDebugEvents(DebugEvent[] events) {
// open the debugger if this is a suspend event and the debug view is not yet open
// and the preferences are set to switch
- for (int i = 0; i < events.length; i++) {
- DebugEvent event = events[i];
+ for (DebugEvent event : events) {
if (event.getKind() == DebugEvent.SUSPEND && !event.isEvaluation() && event.getDetail() != DebugEvent.STEP_END) {
-// Don't switch perspective for evaluations or stepping
+ // Don't switch perspective for evaluations or stepping
Object source = event.getSource();
if (source instanceof IAdaptable) {
IAdaptable adaptable = (IAdaptable) source;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java
index 3430b43ec..91d9c2bbc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java
@@ -194,13 +194,13 @@ public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
MemoryByte[] bytes = ((MemorySegment)element).getBytes(start, tableRendering.getBytesPerColumn());
boolean allKnown = true;
boolean unchanged = true;
- for (int i=0; i<bytes.length; i++)
- {
- if (!bytes[i].isHistoryKnown())
+ for (MemoryByte b : bytes) {
+ if (!b.isHistoryKnown()) {
allKnown = false;
-
- if (bytes[i].isChanged())
+ }
+ if (b.isChanged()) {
unchanged = false;
+ }
}
if (allKnown)
@@ -339,13 +339,13 @@ public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
MemoryByte[] bytes = segment.getBytes(start, tableRendering.getBytesPerColumn());
boolean allKnown = true;
boolean unchanged = true;
- for (int i=0; i<bytes.length; i++)
- {
- if (!bytes[i].isHistoryKnown())
+ for (MemoryByte b : bytes) {
+ if (!b.isHistoryKnown()) {
allKnown = false;
-
- if (bytes[i].isChanged())
+ }
+ if (b.isChanged()) {
unchanged = false;
+ }
}
if (allKnown)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/RegisterGroupProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/RegisterGroupProxy.java
index 621f03580..0ea4beaa7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/RegisterGroupProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/RegisterGroupProxy.java
@@ -236,8 +236,8 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
@Override
public int hashCode() {
int code = getClass().hashCode();
- for (int i = 0; i < fGroups.length; i++) {
- code+=fGroups[i].hashCode();
+ for (IRegisterGroup fGroup : fGroups) {
+ code += fGroup.hashCode();
}
return code;
}
@@ -336,9 +336,9 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
* @param updates updates to cancel
*/
private void cancelUpdates(IViewerUpdate[] updates) {
- for (int i = 0; i < updates.length; i++) {
- updates[i].setStatus(Status.CANCEL_STATUS);
- updates[i].done();
+ for (IViewerUpdate update : updates) {
+ update.setStatus(Status.CANCEL_STATUS);
+ update.done();
}
}
@@ -347,8 +347,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
IElementMementoProvider provider = ViewerAdapterService.getMementoProvider(fFrame);
if (provider != null) {
List<IElementCompareRequest> others = new ArrayList<>(requests.length);
- for (int i = 0; i < requests.length; i++) {
- IElementCompareRequest request = requests[i];
+ for (IElementCompareRequest request : requests) {
if (request.getElement().equals(this)) {
Integer integer = request.getMemento().getInteger(HASH_CODE);
if (integer != null) {
@@ -374,8 +373,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
IElementMementoProvider provider = ViewerAdapterService.getMementoProvider(fFrame);
if (provider != null) {
List<IElementMementoRequest> others = new ArrayList<>(requests.length);
- for (int i = 0; i < requests.length; i++) {
- IElementMementoRequest request = requests[i];
+ for (IElementMementoRequest request : requests) {
if (request.getElement().equals(this)) {
request.getMemento().putInteger(HASH_CODE, this.hashCode());
request.done();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/CommonTabLite.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/CommonTabLite.java
index 501b58e40..8a4d9b698 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/CommonTabLite.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/CommonTabLite.java
@@ -211,11 +211,11 @@ class CommonTabLite extends AbstractLaunchConfigurationTab {
private String getDefaultSharedConfigLocation(ILaunchConfiguration config) {
String path = IInternalDebugCoreConstants.EMPTY_STRING;
try {
- IResource[] res = config.getMappedResources();
- if(res != null) {
+ IResource[] resources = config.getMappedResources();
+ if(resources != null) {
IProject proj;
- for (int i = 0; i < res.length; i++) {
- proj = res[i].getProject();
+ for (IResource res : resources) {
+ proj = res.getProject();
if(proj != null && proj.isAccessible()) {
return proj.getFullPath().toOSString();
}
@@ -385,8 +385,8 @@ class CommonTabLite extends AbstractLaunchConfigurationTab {
// see if there are any changes
if (num == checked.length) {
boolean different = false;
- for (int i = 0; i < checked.length; i++) {
- if (!groups.contains(checked[i])) {
+ for (Object c : checked) {
+ if (!groups.contains(c)) {
different = true;
break;
}
@@ -399,8 +399,8 @@ class CommonTabLite extends AbstractLaunchConfigurationTab {
config.setAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, (String)null);
config.setAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, (String)null);
List<String> groups = null;
- for (int i = 0; i < checked.length; i++) {
- LaunchGroupExtension group = (LaunchGroupExtension)checked[i];
+ for (Object c : checked) {
+ LaunchGroupExtension group = (LaunchGroupExtension) c;
if (groups == null) {
groups = new ArrayList<>();
}
@@ -499,8 +499,7 @@ class CommonTabLite extends AbstractLaunchConfigurationTab {
ILaunchGroup[] groups = DebugUITools.getLaunchGroups();
List<ILaunchGroup> possibleGroups = new ArrayList<>();
ILaunchConfiguration configuration = (ILaunchConfiguration)inputElement;
- for (int i = 0; i < groups.length; i++) {
- ILaunchGroup extension = groups[i];
+ for (ILaunchGroup extension : groups) {
LaunchHistory history = getLaunchConfigurationManager().getLaunchHistory(extension.getIdentifier());
if (history != null && history.accepts(configuration)) {
possibleGroups.add(extension);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java
index 958de66e4..0ca3ecf9a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java
@@ -310,8 +310,7 @@ public class WizardExportBreakpointsPage extends WizardPage implements Listener
// collect breakpoints
Object[] elements = fTView.getCheckedElements().toArray();
List<IBreakpoint> breakpoints = new ArrayList<>();
- for (int i = 0; i < elements.length; i++) {
- Object object = elements[i];
+ for (Object object : elements) {
if (object instanceof IBreakpoint) {
breakpoints.add((IBreakpoint) object);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java
index 318f98c7b..472c6450d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java
@@ -224,24 +224,24 @@ public class WizardImportBreakpointsPage extends WizardPage implements Listener
private void removeUncheckedBreakpoints(IBreakpoint[] importedBreakpoints) {
IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
- for(int i = 0; i < importedBreakpoints.length; i++) {
+ for (IBreakpoint importedBreakpoint : importedBreakpoints) {
boolean selected = false;
- for(int j = 0; j < selectedMarkers.size(); j++) {
+ for (int j = 0; j < selectedMarkers.size(); j++) {
try {
- Map<String, Object> importedMarkerAttributes = importedBreakpoints[i].getMarker().getAttributes();
- Map<String, Object> selectedMarkerAttributes = selectedMarkers.get(j).getAttributes();
+ Map<String, Object> importedMarkerAttributes = importedBreakpoint.getMarker().getAttributes();
+ Map<String, Object> selectedMarkerAttributes = selectedMarkers.get(j).getAttributes();
if(importedMarkerAttributes.equals(selectedMarkerAttributes)) {
selected = true;
break;
}
- } catch (CoreException e) {
+ }catch (CoreException e) {
DebugPlugin.log(e);
}
}
- if(!selected) {
+ if (!selected) {
try {
- manager.removeBreakpoint(importedBreakpoints[i], true);
- } catch (CoreException e) {
+ manager.removeBreakpoint(importedBreakpoint, true);
+ }catch (CoreException e) {
DebugPlugin.log(e);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsSelectionPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsSelectionPage.java
index d9a02aa16..f0e0df884 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsSelectionPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsSelectionPage.java
@@ -98,8 +98,8 @@ public class WizardImportBreakpointsSelectionPage extends WizardPage {
operation.run(monitor);
BreakpointContainer breakpointManager = new BreakpointContainer(null, null);
IBreakpoint[] importedBreakpoints = operation.getImportedBreakpoints();
- for (int i = 0; i < importedBreakpoints.length; i++) {
- breakpointManager.addBreakpoint(importedBreakpoints[i], new ModelDelta(null, IModelDelta.ADDED));
+ for (IBreakpoint importedBreakpoint : importedBreakpoints) {
+ breakpointManager.addBreakpoint(importedBreakpoint, new ModelDelta(null, IModelDelta.ADDED));
}
currentTView.getViewer().setInput(breakpointManager);
currentTView.getViewer().refresh();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
index e5cd4bfcf..8e30604a5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
@@ -198,8 +198,8 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
@Override
public void widgetSelected(SelectionEvent e) {
Object[] items = fContentProvider.getElements(fViewer.getInput());
- for (int i = 0; i < items.length; i++) {
- fViewer.setSubtreeChecked(items[i], true);
+ for (Object item : items) {
+ fViewer.setSubtreeChecked(item, true);
}
setPageComplete(isComplete());
}
@@ -209,8 +209,8 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
@Override
public void widgetSelected(SelectionEvent e) {
Object[] items = fContentProvider.getElements(fViewer.getInput());
- for (int i = 0; i < items.length; i++) {
- fViewer.setSubtreeChecked(items[i], false);
+ for (Object item : items) {
+ fViewer.setSubtreeChecked(item, false);
}
setPageComplete(isComplete());
}
@@ -244,8 +244,8 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
boolean state = fViewer.getChecked(element);
if(element instanceof ILaunchConfigurationType) {
Object[] items = ((ConfigContentProvider)fViewer.getContentProvider()).getChildren(element);
- for(int i = 0; i < items.length; i++) {
- fViewer.setChecked(items[i], state);
+ for (Object item : items) {
+ fViewer.setChecked(item, state);
}
fViewer.setGrayed(element, false);
}
@@ -255,8 +255,8 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
Object[] items = ccp.getChildren(parent);
boolean checked = true;
boolean onechecked = false;
- for(int i = 0; i < items.length; i++) {
- state = fViewer.getChecked(items[i]);
+ for (Object item : items) {
+ state = fViewer.getChecked(item);
checked &= state;
if(state) {
onechecked = true;
@@ -308,8 +308,8 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
protected boolean isComplete() {
Object[] elements = fViewer.getCheckedElements();
boolean oneconfig = false;
- for(int i = 0; i < elements.length; i++) {
- if(elements[i] instanceof ILaunchConfiguration) {
+ for (Object element : elements) {
+ if (element instanceof ILaunchConfiguration) {
oneconfig = true;
break;
}
@@ -364,13 +364,13 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
File newfile = null;
boolean owall = false, nowall = false;
MessageDialog dialog = null;
- for(int i = 0; i < configs.length; i++) {
+ for (Object config : configs) {
if (progressMonitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
- if(configs[i] instanceof ILaunchConfiguration) {
+ if (config instanceof ILaunchConfiguration) {
try {
- LaunchConfiguration launchConfig = (LaunchConfiguration) configs[i];
+ LaunchConfiguration launchConfig = (LaunchConfiguration) config;
file = launchConfig.getFileStore();
if (file == null) {
if (errors == null) {
@@ -384,11 +384,11 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
continue;
}
dialog = new MessageDialog(DebugUIPlugin.getShell(), WizardMessages.ExportLaunchConfigurationsWizardPage_11, null, MessageFormat.format(WizardMessages.ExportLaunchConfigurationsWizardPage_12, new Object[] { file.getName() }), MessageDialog.QUESTION, new String[] {
- WizardMessages.ExportLaunchConfigurationsWizardPage_13,
- WizardMessages.ExportLaunchConfigurationsWizardPage_14,
- WizardMessages.ExportLaunchConfigurationsWizardPage_15,
- WizardMessages.ExportLaunchConfigurationsWizardPage_16,
- WizardMessages.ExportLaunchConfigurationsWizardPage_17 }, 0);
+ WizardMessages.ExportLaunchConfigurationsWizardPage_13,
+ WizardMessages.ExportLaunchConfigurationsWizardPage_14,
+ WizardMessages.ExportLaunchConfigurationsWizardPage_15,
+ WizardMessages.ExportLaunchConfigurationsWizardPage_16,
+ WizardMessages.ExportLaunchConfigurationsWizardPage_17 }, 0);
if(!owall) {
int ret = dialog.open();
switch(ret) {
@@ -421,15 +421,13 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
copyFile(file, newfile);
}
}
- }
- catch (IOException e ) {
+ } catch (IOException e) {
if (errors == null) {
errors = new ArrayList<>(configs.length);
}
errors.add(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(),
e.getMessage(), e));
- }
- catch (CoreException e) {
+ } catch (CoreException e) {
if (errors == null) {
errors = new ArrayList<>(configs.length);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java
index 8e662cd58..b24b4a7b3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java
@@ -53,8 +53,8 @@ public class ClosedProjectFilter extends ViewerFilter {
if(resources == null) {
return true;
}
- for(int i = 0; i < resources.length; i++) {
- IProject project= resources[i].getProject();
+ for (IResource resource : resources) {
+ IProject project = resource.getProject();
//we don't want overlap with the deleted projects filter, so we need to allow projects that don't exist through
if(project != null && (project.isOpen() || !project.exists())) {
return true;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationAction.java
index 335839714..773612fc0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationAction.java
@@ -77,8 +77,8 @@ public class CreateLaunchConfigurationAction extends AbstractLaunchConfiguration
ILaunchConfigurationDialog dialog = LaunchConfigurationsDialog.getCurrentlyVisibleLaunchConfigurationDialog();
tabGroup.createTabs(dialog, dialog.getMode());
ILaunchConfigurationTab[] tabs = tabGroup.getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].setLaunchConfigurationDialog(dialog);
+ for (ILaunchConfigurationTab tab : tabs) {
+ tab.setLaunchConfigurationDialog(dialog);
}
tabGroup.setDefaults(wc);
tabGroup.dispose();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationPrototypeAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationPrototypeAction.java
index 64270d5ef..75b35c68e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationPrototypeAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationPrototypeAction.java
@@ -80,8 +80,8 @@ public class CreateLaunchConfigurationPrototypeAction extends AbstractLaunchConf
ILaunchConfigurationDialog dialog = LaunchConfigurationsDialog.getCurrentlyVisibleLaunchConfigurationDialog();
tabGroup.createTabs(dialog, dialog.getMode());
ILaunchConfigurationTab[] tabs = tabGroup.getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].setLaunchConfigurationDialog(dialog);
+ for (ILaunchConfigurationTab tab : tabs) {
+ tab.setLaunchConfigurationDialog(dialog);
}
tabGroup.setDefaults(wc);
tabGroup.dispose();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java
index 1eaf76cee..03d8ce712 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java
@@ -51,8 +51,8 @@ public class DeletedProjectFilter extends ViewerFilter {
if(resources == null) {
return true;
}
- for(int i = 0; i < resources.length; i++) {
- IProject project= resources[i].getProject();
+ for (IResource resource : resources) {
+ IProject project = resource.getProject();
if(project != null && project.exists()) {
return true;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java
index 75f5914c4..c6150ad54 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java
@@ -154,8 +154,8 @@ public class FavoritesDialog extends TrayDialog {
sfd.open();
Object[] selection = sfd.getResult();
if (selection != null) {
- for (int i = 0; i < selection.length; i++) {
- getFavorites().add((ILaunchConfiguration) selection[i]);
+ for (Object s : selection) {
+ getFavorites().add((ILaunchConfiguration) s);
}
updateStatus();
}
@@ -202,8 +202,7 @@ public class FavoritesDialog extends TrayDialog {
List<?> selList = sel.toList();
Object[] movedFavs= new Object[getFavorites().size()];
int i;
- for (Iterator<?> favs = selList.iterator(); favs.hasNext();) {
- Object config = favs.next();
+ for (Object config : selList) {
i= getFavorites().indexOf(config);
movedFavs[i + direction]= config;
}
@@ -380,10 +379,8 @@ public class FavoritesDialog extends TrayDialog {
int taskSize = Math.abs(initial.length-current.size());//get task size
monitor.beginTask(LaunchConfigurationsMessages.FavoritesDialog_8, taskSize);//and set it
-
// removed favorites
- for (int i = 0; i < initial.length; i++) {
- ILaunchConfiguration configuration = initial[i];
+ for (ILaunchConfiguration configuration : initial) {
if (!current.contains(configuration)) {
// remove fav attributes
try {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java
index d28a1b810..f916fef0d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java
@@ -83,8 +83,8 @@ public final class LaunchConfigurationFilteredTree extends FilteredTree {
treeViewer.setUseHashlookup(true);
treeViewer.setInput(ResourcesPlugin.getWorkspace().getRoot());
if(fFilters != null) {
- for (int i = 0; i < fFilters.length; i++) {
- treeViewer.addFilter(fFilters[i]);
+ for (ViewerFilter filter : fFilters) {
+ treeViewer.addFilter(filter);
}
}
treeViewer.getControl().addHelpListener(new HelpListener() {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java
index d560fae23..5e0719fc4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java
@@ -115,8 +115,8 @@ public class LaunchConfigurationPresentationManager {
String typeId = null;
Map<Set<String>, LaunchConfigurationTabGroupExtension> map = null;
List<Set<String>> modes = null;
- for (int i = 0; i < groups.length; i++) {
- group = new LaunchConfigurationTabGroupExtension(groups[i]);
+ for (IConfigurationElement g : groups) {
+ group = new LaunchConfigurationTabGroupExtension(g);
typeId = group.getTypeIdentifier();
map = fTabGroupExtensions.get(typeId);
if (map == null) {
@@ -164,8 +164,8 @@ public class LaunchConfigurationPresentationManager {
IConfigurationElement[] elements = epoint.getConfigurationElements();
LaunchConfigurationTabExtension tab = null;
Hashtable<String, LaunchConfigurationTabExtension> element = null;
- for(int i = 0; i < elements.length; i++) {
- tab = new LaunchConfigurationTabExtension(elements[i]);
+ for (IConfigurationElement e : elements) {
+ tab = new LaunchConfigurationTabExtension(e);
element = fContributedTabs.get(tab.getTabGroupId());
if(element == null) {
element = new Hashtable<>();
@@ -254,29 +254,28 @@ public class LaunchConfigurationPresentationManager {
return tabs;
}
HashSet<LaunchConfigurationTabExtension> set = new HashSet<>();
- for(int i = 0; i < tabs.length; i ++) {
- //filter capabilities
- if(!WorkbenchActivityHelper.filterItem(new LaunchTabContribution(tabs[i]))) {
- //filter to preferred delegate (if there is one)
+ for (LaunchConfigurationTabExtension tab : tabs) {
+ //filter capabilities
+ if (!WorkbenchActivityHelper.filterItem(new LaunchTabContribution(tab))) {
+ //filter to preferred delegate (if there is one)
Set<String> modes = config.getModes();
modes.add(mode);
ILaunchDelegate delegate = config.getPreferredDelegate(modes);
if(delegate == null) {
delegate = config.getType().getPreferredDelegate(modes);
}
- Set<String> delegateSet = tabs[i].getDelegateSet();
- if(delegate != null) {
- if(delegateSet.isEmpty() || delegateSet.contains(delegate.getId())) {
- set.add(tabs[i]);
+ Set<String> delegateSet = tab.getDelegateSet();
+ if (delegate != null) {
+ if (delegateSet.isEmpty() || delegateSet.contains(delegate.getId())) {
+ set.add(tab);
}
- }
- else {
+ } else {
//otherwise filter based on the collection of delegates for the modes
ILaunchDelegate[] delegates = config.getType().getDelegates(modes);
- for(int j = 0; j < delegates.length; j++) {
- if(delegateSet.isEmpty() || delegateSet.contains(delegates[j].getId())) {
+ for (ILaunchDelegate d : delegates) {
+ if (delegateSet.isEmpty() || delegateSet.contains(d.getId())) {
//associated with all modes and tab groups or only specific ones if indicated
- set.add(tabs[i]);
+ set.add(tab);
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java
index dcebb0f8d..aa71b9862 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java
@@ -105,8 +105,8 @@ public class LaunchConfigurationTabGroupExtension {
IConfigurationElement element = null;
String perspective = null, mode = null;
Set<String> mset = null;
- for (int i = 0; i < modes.length; i++) {
- element = modes[i];
+ for (IConfigurationElement m : modes) {
+ element = m;
mode = element.getAttribute(IConfigurationElementConstants.MODE);
mset = new HashSet<>();
mset.add(mode);
@@ -192,8 +192,8 @@ public class LaunchConfigurationTabGroupExtension {
IConfigurationElement child = null;
String mode = null;
HashSet<String> set = null;
- for (int i = 0; i < children.length; i++) {
- child = children[i];
+ for (IConfigurationElement c : children) {
+ child = c;
mode = child.getAttribute(IConfigurationElementConstants.MODE);
if(mode != null) {
set = new HashSet<>();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
index b09e8fddd..6cf80d1b8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
@@ -906,21 +906,21 @@ public class LaunchConfigurationTabGroupViewer {
CTabItem tab = null;
String name = IInternalDebugCoreConstants.EMPTY_STRING;
Control control = null;
- for (int i = 0; i < tabs.length; i++) {
+ for (ILaunchConfigurationTab t : tabs) {
tab = new CTabItem(fTabFolder, SWT.BORDER);
- name = tabs[i].getName();
+ name = t.getName();
if (name == null) {
name = LaunchConfigurationsMessages.LaunchConfigurationDialog_unspecified_28;
}
tab.setText(name);
- tab.setImage(tabs[i].getImage());
+ tab.setImage(t.getImage());
ScrolledComposite sc = new ScrolledComposite(tab.getParent(), SWT.V_SCROLL | SWT.H_SCROLL);
sc.setFont(tab.getParent().getFont());
sc.setExpandHorizontal(true);
sc.setExpandVertical(true);
sc.setShowFocusedControl(true);
- tabs[i].createControl(sc);
- control = tabs[i].getControl();
+ t.createControl(sc);
+ control = t.getControl();
if (control != null) {
sc.setContent(control);
sc.setMinSize(control.computeSize(SWT.DEFAULT, SWT.DEFAULT));
@@ -932,9 +932,9 @@ public class LaunchConfigurationTabGroupViewer {
setActiveTab(tabs[0]);
}
// select same tab as before, if possible
- for (int i = 0; i < tabs.length; i++) {
- if (tabs[i].getClass().equals(tabKind)) {
- setActiveTab(tabs[i]);
+ for (ILaunchConfigurationTab t : tabs) {
+ if (t.getClass().equals(tabKind)) {
+ setActiveTab(t);
break;
}
}
@@ -983,8 +983,8 @@ public class LaunchConfigurationTabGroupViewer {
}
tabGroup.createTabs(getLaunchConfigurationDialog(), getLaunchConfigurationDialog().getMode());
ILaunchConfigurationTab[] tabs = tabGroup.getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].setLaunchConfigurationDialog(getLaunchConfigurationDialog());
+ for (ILaunchConfigurationTab tab : tabs) {
+ tab.setLaunchConfigurationDialog(getLaunchConfigurationDialog());
}
};
@@ -1174,8 +1174,8 @@ public class LaunchConfigurationTabGroupViewer {
if (tabs == null) {
return false;
}
- for (int i = 0; i < tabs.length; i++) {
- if (!tabs[i].canSave()) {
+ for (ILaunchConfigurationTab tab : tabs) {
+ if (!tab.canSave()) {
return false;
}
}
@@ -1202,8 +1202,8 @@ public class LaunchConfigurationTabGroupViewer {
if (tabs == null) {
return false;
}
- for (int i = 0; i < tabs.length; i++) {
- if (!tabs[i].isValid(getWorkingCopy())) {
+ for (ILaunchConfigurationTab tab : tabs) {
+ if (!tab.isValid(getWorkingCopy())) {
return false;
}
}
@@ -1306,8 +1306,7 @@ public class LaunchConfigurationTabGroupViewer {
}
ILaunchConfigurationTab[] allTabs = getTabs();
- for (int i = 0; i < allTabs.length; i++) {
- ILaunchConfigurationTab tab = allTabs[i];
+ for (ILaunchConfigurationTab tab : allTabs) {
if (tab == activeTab) {
continue;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTreeContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTreeContentProvider.java
index 556fb9ef2..524c34202 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTreeContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTreeContentProvider.java
@@ -166,8 +166,7 @@ public class LaunchConfigurationTreeContentProvider implements ITreeContentProvi
List<ILaunchConfigurationType> filteredTypes = new ArrayList<>();
String mode = getMode();
LaunchConfigurationTypeContribution contribution;
- for (int i = 0; i < allTypes.length; i++) {
- ILaunchConfigurationType type = allTypes[i];
+ for (ILaunchConfigurationType type : allTypes) {
contribution= new LaunchConfigurationTypeContribution(type);
if (isVisible(type, mode) && !WorkbenchActivityHelper.filterItem(contribution)) {
filteredTypes.add(type);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeFilter.java
index 90446202c..24508bd84 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeFilter.java
@@ -45,8 +45,8 @@ public class LaunchConfigurationTypeFilter extends ViewerFilter {
if(element instanceof ILaunchConfigurationType) {
IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
String[] types = store.getString(IInternalDebugUIConstants.PREF_FILTER_TYPE_LIST).split("\\,"); //$NON-NLS-1$
- for(int i = 0; i < types.length; i++) {
- if(types[i].equals(((ILaunchConfigurationType)element).getIdentifier())) {
+ for (String type : types) {
+ if (type.equals(((ILaunchConfigurationType)element).getIdentifier())) {
return false;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationViewer.java
index c82e26bd7..54943724c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationViewer.java
@@ -173,12 +173,12 @@ public class LaunchConfigurationViewer extends TreeViewer {
Object[] types = cp.getElements(null);
LaunchGroupFilter filter = new LaunchGroupFilter(((LaunchConfigurationsDialog)LaunchConfigurationsDialog.getCurrentlyVisibleLaunchConfigurationDialog()).getLaunchGroup());
ILaunchConfiguration[] configs = null;
- for(int i = 0; i < types.length; i++) {
- if(filter.select(this, types[i], null)) {
+ for (Object type : types) {
+ if (filter.select(this, type, null)) {
fTotalCount++;
- configs = (ILaunchConfiguration[]) cp.getChildren(types[i]);
- for(int j = 0; j < configs.length; j++) {
- if(LaunchConfigurationManager.isVisible(configs[j])) {
+ configs = (ILaunchConfiguration[]) cp.getChildren(type);
+ for (ILaunchConfiguration config : configs) {
+ if (LaunchConfigurationManager.isVisible(config)) {
fTotalCount++;
}
}
@@ -199,9 +199,7 @@ public class LaunchConfigurationViewer extends TreeViewer {
TreeItem[] items = getTree().getItems();
count += items.length;
boolean expanded = false;
- TreeItem item = null;
- for(int i = 0; i < items.length; i++) {
- item = items[i];
+ for (TreeItem item : items) {
expanded = item.getExpanded();
setExpandedState(item.getData(), true);
count += item.getItems().length;
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 e40a5d078..cd8b1a640 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
@@ -1159,8 +1159,8 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
ILaunchConfigurationDialog dialog = LaunchConfigurationsDialog.getCurrentlyVisibleLaunchConfigurationDialog();
tabGroup.createTabs(dialog, dialog.getMode());
ILaunchConfigurationTab[] tabs = tabGroup.getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].setLaunchConfigurationDialog(dialog);
+ for (ILaunchConfigurationTab tab : tabs) {
+ tab.setLaunchConfigurationDialog(dialog);
}
tabGroup.setDefaults(wc);
tabGroup.dispose();
@@ -1259,12 +1259,11 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
String type = IInternalDebugCoreConstants.EMPTY_STRING;
//if the item is not in the list and is expanded add it, otherwise if it
//is not expanded do a remove...either way for the else we query the list
- for(int i = 0; i < items.length; i++) {
- type = ((ILaunchConfigurationType)items[i].getData()).getIdentifier();
- if(!list.contains(type) & items[i].getExpanded()) {
+ for (TreeItem item : items) {
+ type = ((ILaunchConfigurationType) item.getData()).getIdentifier();
+ if (!list.contains(type) & item.getExpanded()) {
list.add(type);
- }
- else if(!items[i].getExpanded()) {
+ } else if (!item.getExpanded()) {
list.remove(type);
}
}
@@ -1302,10 +1301,10 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
catch (CoreException e) {DebugUIPlugin.log(e);}
}
}
- for(int i = 0; i < nodes.length; i++) {
- for(int k = 0; k < items.length; k++) {
- ILaunchConfigurationType type = (ILaunchConfigurationType)items[k].getData();
- if(type.getIdentifier().equals(nodes[i])) {
+ for (String node : nodes) {
+ for (TreeItem item : items) {
+ ILaunchConfigurationType type = (ILaunchConfigurationType) item.getData();
+ if (type.getIdentifier().equals(node)) {
toexpand.add(type);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java
index e8b188773..7a48f5cc2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java
@@ -198,9 +198,8 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
}
IConfigurationElement[] labels = context.getChildren(IConfigurationElementConstants.CONTEXT_LABEL);
fContextLabels = new ArrayList<>(labels.length);
- for (int i = 0; i < labels.length; i++) {
- fContextLabels.add(new Pair(labels[i].getAttribute(IConfigurationElementConstants.MODE),
- labels[i].getAttribute(IConfigurationElementConstants.LABEL)));
+ for (IConfigurationElement label : labels) {
+ fContextLabels.add(new Pair(label.getAttribute(IConfigurationElementConstants.MODE), label.getAttribute(IConfigurationElementConstants.LABEL)));
}
}
// pick out the first occurance of the "name" bound to "mode"
@@ -223,8 +222,8 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
fAssociatedTypes = new HashSet<>();
IConfigurationElement[] children = fConfig.getChildren(IConfigurationElementConstants.CONFIGURATION_TYPES);
String id = null;
- for (int i = 0; i < children.length; i++) {
- id = children[i].getAttribute(IConfigurationElementConstants.ID);
+ for (IConfigurationElement child : children) {
+ id = child.getAttribute(IConfigurationElementConstants.ID);
if(id != null) {
fAssociatedTypes.add(id);
}
@@ -256,9 +255,9 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
}
//load descriptions for child description elements
IConfigurationElement[] children = fConfig.getChildren(IConfigurationElementConstants.DESCRIPTION);
- for(int i = 0; i < children.length; i++) {
- String lmode = children[i].getAttribute(IConfigurationElementConstants.MODE);
- descr = children[i].getAttribute(IConfigurationElementConstants.DESCRIPTION);
+ for (IConfigurationElement child : children) {
+ String lmode = child.getAttribute(IConfigurationElementConstants.MODE);
+ descr = child.getAttribute(IConfigurationElementConstants.DESCRIPTION);
fDescriptions.put(lmode, descr);
}
}
@@ -387,8 +386,8 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
if (fPerspectives == null) {
IConfigurationElement[] perspectives = getConfigurationElement().getChildren(IConfigurationElementConstants.PERSPECTIVE);
fPerspectives = new ArrayList<>(perspectives.length);
- for (int i = 0; i < perspectives.length; i++) {
- fPerspectives.add(perspectives[i].getAttribute(IConfigurationElementConstants.ID));
+ for (IConfigurationElement perspective : perspectives) {
+ fPerspectives.add(perspective.getAttribute(IConfigurationElementConstants.ID));
}
}
return fPerspectives;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
index 606540170..5ee2f41fc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
@@ -311,8 +311,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
Runnable r = () -> {
IContextActivation[] activations = fLaunchToContextActivations.remove(launch);
if (activations != null) {
- for (int i = 0; i < activations.length; i++) {
- IContextActivation activation = activations[i];
+ for (IContextActivation activation : activations) {
activation.getContextService().deactivateContext(activation);
}
}
@@ -539,8 +538,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
*/
private Shell getModalDialogOpen(Shell shell) {
Shell[] shells = shell.getShells();
- for (int i = 0; i < shells.length; i++) {
- Shell dialog = shells[i];
+ for (Shell dialog : shells) {
if ((dialog.getStyle() & (SWT.APPLICATION_MODAL | SWT.PRIMARY_MODAL | SWT.SYSTEM_MODAL)) > 0) {
return dialog;
}
@@ -563,8 +561,8 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
return window;
}
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
- for (int i = 0; i < windows.length; i++) {
- window = windows[i];
+ for (IWorkbenchWindow w : windows) {
+ window = w;
if (isWindowShowingPerspective(window, perspectiveId)) {
return window;
}
@@ -1034,8 +1032,8 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
private Set<String> parseModes(String modes) {
HashSet<String> modeset = new HashSet<>();
String[] ms = modes.split(","); //$NON-NLS-1$
- for(int i = 0; i < ms.length; i++) {
- modeset.add(ms[i].trim());
+ for (String m : ms) {
+ modeset.add(m.trim());
}
return modeset;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java
index f8a61893c..38350c96a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java
@@ -201,15 +201,15 @@ public class SaveScopeResourcesHandler implements IStatusHandler {
protected IResource[] getScopedDirtyResources(IProject[] projects) {
HashSet<IResource> dirtyres = new HashSet<>();
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
- for(int l = 0; l < windows.length; l++) {
- IWorkbenchPage[] pages = windows[l].getPages();
- for(int i = 0; i < pages.length; i++) {
- IEditorPart[] eparts = pages[i].getDirtyEditors();
- for(int j = 0; j < eparts.length; j++) {
- IResource resource = eparts[j].getEditorInput().getAdapter(IResource.class);
- if(resource != null) {
- for(int k = 0; k < projects.length; k++) {
- if(projects[k].equals(resource.getProject())) {
+ for (IWorkbenchWindow window : windows) {
+ IWorkbenchPage[] pages = window.getPages();
+ for (IWorkbenchPage page : pages) {
+ IEditorPart[] eparts = page.getDirtyEditors();
+ for (IEditorPart epart : eparts) {
+ IResource resource = epart.getEditorInput().getAdapter(IResource.class);
+ if (resource != null) {
+ for (IProject project : projects) {
+ if (project.equals(resource.getProject())) {
dirtyres.add(resource);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java
index eba5ab2f7..fe7dc4c5e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java
@@ -54,9 +54,9 @@ public class SelectFavoritesDialog extends AbstractDebugCheckboxSelectionDialog
}
List<ILaunchConfiguration> list = new ArrayList<>(all.length);
ViewerFilter filter = new LaunchGroupFilter(fHistory.getLaunchGroup());
- for (int i = 0; i < all.length; i++) {
- if (filter.select(null, null, all[i])) {
- list.add(all[i]);
+ for (ILaunchConfiguration config : all) {
+ if (filter.select(null, null, config)) {
+ list.add(config);
}
}
list.removeAll(fCurrentFavoriteSet);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java
index f7325749f..9e2234c09 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java
@@ -62,16 +62,16 @@ public class WorkingSetsFilter extends ViewerFilter {
}
//remove breakpoint working sets
ArrayList<IWorkingSet> ws = new ArrayList<>();
- for (int i = 0; i < wsets.length; i++) {
- if(!IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(wsets[i].getId())) {
- ws.add(wsets[i]);
+ for (IWorkingSet wset : wsets) {
+ if (!IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(wset.getId())) {
+ ws.add(wset);
}
}
if(ws.isEmpty()) {
return true;
}
- for (int i = 0; i < resources.length; i++) {
- if(workingSetContains(ws.toArray(new IWorkingSet[ws.size()]), resources[i])) {
+ for (IResource resource : resources) {
+ if (workingSetContains(ws.toArray(new IWorkingSet[ws.size()]), resource)) {
return true;
}
}
@@ -98,10 +98,10 @@ public class WorkingSetsFilter extends ViewerFilter {
}
}
IResource lres = null;
- for(int i = 0; i < wsets.length; i++) {
- IAdaptable[] elements = wsets[i].getElements();
- for(int j = 0; j < elements.length; j++) {
- lres = elements[j].getAdapter(IResource.class);
+ for (IWorkingSet wset : wsets) {
+ IAdaptable[] elements = wset.getElements();
+ for (IAdaptable element : elements) {
+ lres = element.getAdapter(IResource.class);
if(lres != null) {
if(parents.contains(lres)) {
return true;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingManager.java
index 16989ba40..30e88863b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingManager.java
@@ -99,8 +99,7 @@ public class MemoryRenderingManager extends AbstractMemoryRenderingBindingsProvi
while (iterator.hasNext()) {
RenderingBindings binding = iterator.next();
IMemoryRenderingType[] renderingTypes = binding.getDefaultRenderingTypes(block);
- for (int i = 0; i < renderingTypes.length; i++) {
- IMemoryRenderingType type = renderingTypes[i];
+ for (IMemoryRenderingType type : renderingTypes) {
if (!allTypes.contains(type)) {
allTypes.add(type);
}
@@ -125,8 +124,7 @@ public class MemoryRenderingManager extends AbstractMemoryRenderingBindingsProvi
List<IMemoryRenderingType> allTypes = new ArrayList<>();
for (RenderingBindings binding : fBindings) {
IMemoryRenderingType[] renderingTypes = binding.getRenderingTypes(block);
- for (int i = 0; i < renderingTypes.length; i++) {
- IMemoryRenderingType type = renderingTypes[i];
+ for (IMemoryRenderingType type : renderingTypes) {
if (!allTypes.contains(type)) {
allTypes.add(type);
}
@@ -141,8 +139,7 @@ public class MemoryRenderingManager extends AbstractMemoryRenderingBindingsProvi
private void initializeRenderings() {
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_MEMORY_RENDERINGS);
IConfigurationElement[] configurationElements = extensionPoint.getConfigurationElements();
- for (int i = 0; i < configurationElements.length; i++) {
- IConfigurationElement element = configurationElements[i];
+ for (IConfigurationElement element : configurationElements) {
String name = element.getName();
if (name.equals(ELEMENT_MEMORY_RENDERING_TYPE)) {
MemoryRenderingType type = new MemoryRenderingType(element);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/RenderingBindings.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/RenderingBindings.java
index fdea4f74c..6aa77b2ea 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/RenderingBindings.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/RenderingBindings.java
@@ -85,8 +85,8 @@ class RenderingBindings extends AbstractMemoryRenderingBindingsProvider implemen
IMemoryRenderingManager manager = getManager();
if (ids != null) {
String[] strings = ids.split(","); //$NON-NLS-1$
- for (int i = 0; i < strings.length; i++) {
- String id = strings[i].trim();
+ for (String s : strings) {
+ String id = s.trim();
IMemoryRenderingType type = manager.getRenderingType(id);
if (type != null) {
list.add(type);
@@ -95,8 +95,8 @@ class RenderingBindings extends AbstractMemoryRenderingBindingsProvider implemen
}
// remove any default bindings, in case of duplicate specification
IMemoryRenderingType[] defaultBindings = getDefaultBindings();
- for (int i = 0; i < defaultBindings.length; i++) {
- list.remove(defaultBindings[i]);
+ for (IMemoryRenderingType defaultBinding : defaultBindings) {
+ list.remove(defaultBinding);
}
fRenderingTypes = list.toArray(new IMemoryRenderingType[list.size()]);
}
@@ -115,8 +115,8 @@ class RenderingBindings extends AbstractMemoryRenderingBindingsProvider implemen
IMemoryRenderingManager manager = getManager();
if (ids != null) {
String[] strings = ids.split(","); //$NON-NLS-1$
- for (int i = 0; i < strings.length; i++) {
- String id = strings[i].trim();
+ for (String s : strings) {
+ String id = s.trim();
IMemoryRenderingType type = manager.getRenderingType(id);
if (type != null) {
list.add(type);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
index 48db0e51a..e7da67f94 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
@@ -1481,9 +1481,9 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
// check each of the items and find the minimum
TableItem[] items = table.getItems();
int minHeight = table.getItemHeight();
- for (int i = 0; i < items.length; i++) {
- if (items[i].getData() != null) {
- minHeight = Math.min(items[i].getBounds(0).height, minHeight);
+ for (TableItem item : items) {
+ if (item.getData() != null) {
+ minHeight = Math.min(item.getBounds(0).height, minHeight);
}
}
@@ -2754,8 +2754,7 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
*/
private TableItem getItem(Point point) {
TableItem[] items = fTableViewer.getTable().getItems();
- for (int i = 0; i < items.length; i++) {
- TableItem item = items[i];
+ for (TableItem item : items) {
if (item.getData() != null) {
Point start = new Point(item.getBounds(0).x, item.getBounds(0).y);
start = fTableViewer.getTable().toDisplay(start);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementLabelProvider.java
index 22543b77f..9fbb033e3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementLabelProvider.java
@@ -110,8 +110,8 @@ public class DebugElementLabelProvider extends ElementLabelProvider {
IDebugModelPresentation presentation = debugContext.getModelPresentation();
if (presentation instanceof IDebugModelPresentationExtension) {
IDebugModelPresentationExtension extension = (IDebugModelPresentationExtension) presentation;
- for (int i = 0; i < updates.length; i++) {
- if (extension.requiresUIThread(updates[i].getElement())) {
+ for (ILabelUpdate u : updates) {
+ if (extension.requiresUIThread(u.getElement())) {
return true;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java
index 911adc741..a3efe4520 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java
@@ -53,8 +53,7 @@ public abstract class ElementContentProvider implements IElementContentProvider
Job job = new ElementContentProviderJob("Debug children update") { //$NON-NLS-1$
@Override
protected IStatus run(IProgressMonitor monitor) {
- for (int i = 0; i < updates.length; i++) {
- IChildrenUpdate update = updates[i];
+ for (IChildrenUpdate update : updates) {
if (!update.isCanceled()) {
retrieveChildren(update);
}
@@ -72,8 +71,7 @@ public abstract class ElementContentProvider implements IElementContentProvider
Job job = new ElementContentProviderJob("Debug child count update") { //$NON-NLS-1$
@Override
protected IStatus run(IProgressMonitor monitor) {
- for (int i = 0; i < updates.length; i++) {
- IChildrenCountUpdate update = updates[i];
+ for (IChildrenCountUpdate update : updates) {
if (!update.isCanceled()) {
retrieveChildCount(update);
}
@@ -207,8 +205,7 @@ public abstract class ElementContentProvider implements IElementContentProvider
Job job = new ElementContentProviderJob("Debug has children update") { //$NON-NLS-1$
@Override
protected IStatus run(IProgressMonitor monitor) {
- for (int i = 0; i < updates.length; i++) {
- IHasChildrenUpdate update = updates[i];
+ for (IHasChildrenUpdate update : updates) {
if (!update.isCanceled()) {
updateHasChildren(update);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java
index ad2232401..7295f1678 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java
@@ -127,8 +127,8 @@ public abstract class ElementLabelProvider implements IElementLabelProvider {
if (fQueue == null) {
return false;
} else {
- for (int i = 0; i < updates.length; i++) {
- fQueue.addLast(updates[i]);
+ for (ILabelUpdate update : updates) {
+ fQueue.addLast(update);
}
return true;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java
index 50f4b5f5d..a8e37965c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java
@@ -35,8 +35,7 @@ public abstract class ElementMementoProvider implements IElementMementoProvider
Job job = new Job("compare element") { //$NON-NLS-1$
@Override
protected IStatus run(IProgressMonitor monitor) {
- for (int i = 0; i < requests.length; i++) {
- IElementCompareRequest request = requests[i];
+ for (IElementCompareRequest request : requests) {
try {
request.setEqual(isEqual(request.getElement(), request.getMemento(), request.getPresentationContext()));
} catch (CoreException e) {
@@ -67,8 +66,7 @@ public abstract class ElementMementoProvider implements IElementMementoProvider
Job job = new Job("encode element") { //$NON-NLS-1$
@Override
protected IStatus run(IProgressMonitor monitor) {
- for (int i = 0; i < requests.length; i++) {
- IElementMementoRequest request = requests[i];
+ for (IElementMementoRequest request : requests) {
try {
if (!encodeElement(request.getElement(), request.getMemento(), request.getPresentationContext())) {
request.cancel();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java
index 31e705f0f..ab8f4dca0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java
@@ -236,17 +236,17 @@ public class VariableContentProvider extends ElementContentProvider {
DebugPlugin.getDefault().addDebugEventListener(new IDebugEventSetListener(){
@Override
public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- if (events[i].getKind() == DebugEvent.TERMINATE){
+ for (DebugEvent event : events) {
+ if (event.getKind() == DebugEvent.TERMINATE) {
fgLogicalCache.clear();
break;
- } else if (events[i].getKind() == DebugEvent.RESUME && events[i].getDetail() != DebugEvent.EVALUATION_IMPLICIT){
+ } else if (event.getKind() == DebugEvent.RESUME && event.getDetail() != DebugEvent.EVALUATION_IMPLICIT) {
fgLogicalCache.clear();
break;
- } else if (events[i].getKind() == DebugEvent.SUSPEND && events[i].getDetail() != DebugEvent.EVALUATION_IMPLICIT){
- fgLogicalCache.clear();
- break;
- } else if (events[i].getKind() == DebugEvent.CHANGE && events[i].getDetail() == DebugEvent.CONTENT){
+ } else if (event.getKind() == DebugEvent.SUSPEND && event.getDetail() != DebugEvent.EVALUATION_IMPLICIT) {
+ fgLogicalCache.clear();
+ break;
+ } else if (event.getKind() == DebugEvent.CHANGE && event.getDetail() == DebugEvent.CONTENT) {
fgLogicalCache.clear();
break;
}
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 754c0e220..2e5c82fda 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
@@ -281,13 +281,12 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
ILaunchConfiguration[] configurations = lmanager.getMigrationCandidates();
//separate the private from the public
List<ILaunchConfiguration> pub = new ArrayList<>();
- for(int i = 0; i < configurations.length; i++) {
- if(DebugUITools.isPrivate(configurations[i])) {
+ for (ILaunchConfiguration configuration : configurations) {
+ if (DebugUITools.isPrivate(configuration)) {
//auto-migrate private ones
- configurations[i].migrate();
- }
- else {
- pub.add(configurations[i]);
+ configuration.migrate();
+ } else {
+ pub.add(configuration);
}
}
if(pub.isEmpty()) {
@@ -301,9 +300,9 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
fMonitor = new ProgressMonitorPart(fMigrateNow.getParent(), new GridLayout());
Object[] objs = listd.getResult();
fMonitor.beginTask(DebugPreferencesMessages.LaunchingPreferencePage_31, objs.length);
- for(int i = 0; i < objs.length; i++) {
- if(objs[i] instanceof ILaunchConfiguration) {
- ((ILaunchConfiguration)objs[i]).migrate();
+ for (Object obj : objs) {
+ if (obj instanceof ILaunchConfiguration) {
+ ((ILaunchConfiguration) obj).migrate();
}
fMonitor.worked(1);
}
@@ -335,11 +334,11 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
String[] types = getPreferenceStore().getString(IInternalDebugUIConstants.PREF_FILTER_TYPE_LIST).split("\\,"); //$NON-NLS-1$
TableItem[] items = fTable.getItems();
ILaunchConfigurationType type;
- for(int i = 0; i < types.length; i++) {
- for(int j = 0; j < items.length; j++) {
- type = (ILaunchConfigurationType)items[j].getData();
- if(type.getIdentifier().equals(types[i])) {
- items[j].setChecked(true);
+ for (String t : types) {
+ for (TableItem item : items) {
+ type = (ILaunchConfigurationType) item.getData();
+ if (type.getIdentifier().equals(t)) {
+ item.setChecked(true);
}
}
}
@@ -370,9 +369,9 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
String types = IInternalDebugCoreConstants.EMPTY_STRING;
TableItem[] items = fTable.getItems();
ILaunchConfigurationType type;
- for(int i = 0; i < items.length; i++) {
- if(items[i].getChecked()) {
- type = (ILaunchConfigurationType)items[i].getData();
+ for (TableItem item : items) {
+ 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/LaunchersPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchersPreferencePage.java
index dbacaeeaa..cc9fbc128 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchersPreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchersPreferencePage.java
@@ -296,20 +296,20 @@ public class LaunchersPreferencePage extends PreferencePage implements IWorkbenc
Set<DuplicateDelegate> tmp = null;
ILaunchDelegate prefdelegate = null;
DuplicateDelegate dd = null;
- for(int i = 0; i < types.length; i++) {
- modes = types[i].getSupportedModeCombinations();
+ for (ILaunchConfigurationType type : types) {
+ modes = type.getSupportedModeCombinations();
for (Iterator<Set<String>> iter = modes.iterator(); iter.hasNext();) {
modeset = iter.next();
- delegates = types[i].getDelegates(modeset);
- if(delegates.length > 1) {
- tmp = fDuplicates.get(types[i]);
+ delegates = type.getDelegates(modeset);
+ if (delegates.length > 1) {
+ tmp = fDuplicates.get(type);
if(tmp == null) {
tmp = new HashSet<>();
}
- dd = new DuplicateDelegate(types[i], delegates, modeset);
+ dd = new DuplicateDelegate(type, delegates, modeset);
tmp.add(dd);
- fDuplicates.put(types[i], tmp);
- prefdelegate = types[i].getPreferredDelegate(modeset);
+ fDuplicates.put(type, tmp);
+ prefdelegate = type.getPreferredDelegate(modeset);
if(prefdelegate != null) {
fDupeSelections.put(dd, prefdelegate);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
index 1c836f42e..e25d7dde4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
@@ -251,8 +251,8 @@ public class RunDebugPropertiesPage extends PropertyPage {
if(fTypeCandidates == null) {
String[] types = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getApplicableConfigurationTypes(getResource());
fTypeCandidates = new ArrayList<>(types.length);
- for(int i = 0; i < types.length; i++) {
- fTypeCandidates.add(DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(types[i]));
+ for (String type : types) {
+ fTypeCandidates.add(DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(type));
}
Collections.sort(fTypeCandidates, new Comparator<ILaunchConfigurationType>() {
@@ -279,8 +279,8 @@ public class RunDebugPropertiesPage extends PropertyPage {
fOriginalCandidates = new HashSet<>();
try {
ILaunchConfiguration[] configs = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getApplicableLaunchConfigurations(null, resource);
- for(int i = 0; i < configs.length; i++) {
- fOriginalCandidates.add(configs[i].getWorkingCopy());
+ for (ILaunchConfiguration config : configs) {
+ fOriginalCandidates.add(config.getWorkingCopy());
}
}
catch(CoreException ce) {DebugUIPlugin.log(ce);}
@@ -394,10 +394,10 @@ public class RunDebugPropertiesPage extends PropertyPage {
int[] indices = table.getSelectionIndices();
Arrays.sort(indices);
ILaunchConfigurationWorkingCopy[] configurations = getSelectedConfigurations();
- for (int i = 0; i < configurations.length; i++) {
- fDeletedConfigurations.add(configurations[i]);
- fChangedConfigurations.remove(configurations[i]);
- fViewer.remove(configurations[i]);
+ for (ILaunchConfigurationWorkingCopy configuration : configurations) {
+ fDeletedConfigurations.add(configuration);
+ fChangedConfigurations.remove(configuration);
+ fViewer.remove(configuration);
}
if (indices[0] < table.getItemCount()) {
fViewer.setSelection(new StructuredSelection(table.getItem(indices[0]).getData()));
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java
index d0acf296e..7e346460b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java
@@ -388,8 +388,8 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
}
}
VariableWrapper[] variables= variablesToRemove.toArray(new VariableWrapper[0]);
- for (int i = 0; i < variables.length; i++) {
- variables[i].setRemoved(true);
+ for (VariableWrapper variable : variables) {
+ variable.setRemoved(true);
}
variableTable.refresh();
}
@@ -474,8 +474,8 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
private void restoreDefaultColumnWidths(){
TableLayout layout = new TableLayout();
- for (int i = 0; i < variableTableColumnLayouts.length; i++) {
- layout.addColumnData(variableTableColumnLayouts[i]);
+ for (ColumnLayoutData variableTableColumnLayout : variableTableColumnLayouts) {
+ layout.addColumnData(variableTableColumnLayout);
}
variableTable.getTable().setLayout(layout);
}
@@ -560,8 +560,8 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
fWorkingSet.clear();
IStringVariableManager manager = getVariableManager();
IValueVariable[] variables = manager.getValueVariables();
- for (int i = 0; i < variables.length; i++) {
- fWorkingSet.add(new VariableWrapper(variables[i]));
+ for (IValueVariable variable : variables) {
+ fWorkingSet.add(new VariableWrapper(variable));
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java
index 3cec78f55..dbfb44d1c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java
@@ -160,8 +160,7 @@ public class AddSourceContainerDialog extends TitleAreaDialog {
*/
private ISourceContainerType[] filterTypes(ISourceContainerType[] types){
ArrayList<ISourceContainerType> validTypes = new ArrayList<>();
- for (int i=0; i< types.length; i++) {
- ISourceContainerType type = types[i];
+ for (ISourceContainerType type : types) {
if (fDirector.supportsSourceContainerType(type)) {
ISourceContainerBrowser sourceContainerBrowser = DebugUITools.getSourceContainerBrowser(type.getId());
if(sourceContainerBrowser != null && sourceContainerBrowser.canAddSourceContainers(fDirector)) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/BasicContainerContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/BasicContainerContentProvider.java
index 13e202b52..d1ea20c84 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/BasicContainerContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/BasicContainerContentProvider.java
@@ -44,9 +44,9 @@ public class BasicContainerContentProvider implements ITreeContentProvider {
}
ArrayList<IProject> accessibleProjects = new ArrayList<>();
- for (int i = 0; i < allProjects.length; i++) {
- if (allProjects[i].isOpen()) {
- accessibleProjects.add(allProjects[i]);
+ for (IProject p : allProjects) {
+ if (p.isOpen()) {
+ accessibleProjects.add(p);
}
}
return accessibleProjects.toArray();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAction.java
index 7ce9ef61d..aa46ebe65 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAction.java
@@ -82,8 +82,7 @@ public abstract class SourceContainerAction extends SelectionListenerAction {
List<ISourceContainer> targets = new ArrayList<>();
List<Object> selection = getViewer().getStructuredSelection().toList();
ISourceContainer[] entries = getViewer().getEntries();
- for (int i = 0; i < entries.length; i++) {
- ISourceContainer target = entries[i];
+ for (ISourceContainer target : entries) {
if (selection.contains(target)) {
targets.add(target);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java
index 28d0f4558..a3ee70ba9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java
@@ -205,8 +205,7 @@ public class SourceLookupFacility implements IPageListener, IPartListener2, IPro
@Override
public void handleDebugEvents(DebugEvent[] events) {
IStackFrame frame = null;
- for (int i = 0; i < events.length; i++) {
- final DebugEvent event = events[i];
+ for (DebugEvent event : events) {
switch (event.getKind()) {
case DebugEvent.TERMINATE:
case DebugEvent.RESUME:
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java
index 67a48fd0f..792d769bc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java
@@ -39,8 +39,7 @@ public class SourceLookupManager implements IWindowListener {
private SourceLookupManager() {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow[] workbenchWindows = workbench.getWorkbenchWindows();
- for (int i = 0; i < workbenchWindows.length; i++) {
- IWorkbenchWindow window = workbenchWindows[i];
+ for (IWorkbenchWindow window : workbenchWindows) {
windowOpened(window);
}
workbench.addWindowListener(this);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIUtils.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIUtils.java
index 3406fdef9..75da1a448 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIUtils.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIUtils.java
@@ -63,11 +63,9 @@ public class SourceLookupUIUtils {
//read in SourceContainer presentation extensions
IConfigurationElement[] sourceContainerPresentationExtensions =extensionPoint.getConfigurationElements();
fSourceContainerPresentationHashtable = new Hashtable<>();
- for (int i = 0; i < sourceContainerPresentationExtensions.length; i++) {
- fSourceContainerPresentationHashtable.put(
- sourceContainerPresentationExtensions[i].getAttribute(CONTAINER_ID_ATTRIBUTE),
- sourceContainerPresentationExtensions[i]);
- registerContainerImages(sourceContainerPresentationExtensions[i]);
+ for (IConfigurationElement extension : sourceContainerPresentationExtensions) {
+ fSourceContainerPresentationHashtable.put(extension.getAttribute(CONTAINER_ID_ATTRIBUTE), extension);
+ registerContainerImages(extension);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java
index d19e6a439..9a2787ac4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java
@@ -80,8 +80,7 @@ public class ArchiveFilter extends ViewerFilter {
boolean added = false;
try {
IResource[] resources = container.members();
- for (int i = 0; i < resources.length; i++) {
- IResource resource = resources[i];
+ for (IResource resource : resources) {
if (resource instanceof IFile) {
IFile file = (IFile)resource;
String ext = file.getFileExtension();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java
index 8a33b0ff2..9bf4a23f9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java
@@ -50,8 +50,8 @@ public class ArchiveSourceContainerBrowser extends AbstractSourceContainerBrowse
if (selection.length == 0) {
return new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
}
- for (int i= 0; i < selection.length; i++) {
- if (!(selection[i] instanceof IFile)) {
+ for (Object f : selection) {
+ if (!(f instanceof IFile)) {
return new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
}
}
@@ -69,8 +69,7 @@ public class ArchiveSourceContainerBrowser extends AbstractSourceContainerBrowse
protected List<ISourceContainer> getSelectedJars(ISourceLookupDirector director) {
ISourceContainer[] containers = director.getSourceContainers();
List<ISourceContainer> jars = new ArrayList<>();
- for (int i = 0; i < containers.length; i++) {
- ISourceContainer container = containers[i];
+ for (ISourceContainer container : containers) {
if (container.getType().getId().equals(ArchiveSourceContainer.TYPE_ID)) {
jars.add(container);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerBrowser.java
index bc78d67fe..75603c11b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerBrowser.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerBrowser.java
@@ -40,9 +40,9 @@ public class FolderSourceContainerBrowser extends AbstractSourceContainerBrowser
if (dialog.open() == Window.OK) {
Object[] selection= ((ElementTreeSelectionDialog)dialog).getResult();
ArrayList<ISourceContainer> containers = new ArrayList<>();
- for (int i= 0; i < selection.length; i++) {
- if(selection[i] instanceof IFolder) {
- containers.add(new FolderSourceContainer((IFolder)selection[i], dialog.isSearchSubfolders()));
+ for (Object f : selection) {
+ if (f instanceof IFolder) {
+ containers.add(new FolderSourceContainer((IFolder) f, dialog.isSearchSubfolders()));
}
}
return containers.toArray(new ISourceContainer[containers.size()]);
@@ -65,9 +65,9 @@ public class FolderSourceContainerBrowser extends AbstractSourceContainerBrowser
container.dispose();
Object[] selection= ((ElementTreeSelectionDialog)dialog).getResult();
ArrayList<ISourceContainer> list = new ArrayList<>();
- for (int i= 0; i < selection.length; i++) {
- if(selection[i] instanceof IFolder) {
- list.add(new FolderSourceContainer((IFolder)selection[i], dialog.isSearchSubfolders()));
+ for (Object f : selection) {
+ if (f instanceof IFolder) {
+ list.add(new FolderSourceContainer((IFolder) f, dialog.isSearchSubfolders()));
}
}
return list.toArray(new ISourceContainer[list.size()]);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java
index fedf26804..f23ae3eff 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java
@@ -92,8 +92,8 @@ public class FolderSourceContainerDialog extends ElementTreeSelectionDialog {
ISelectionStatusValidator validator= new ISelectionStatusValidator() {
@Override
public IStatus validate(Object[] selection) {
- for (int i= 0; i < selection.length; i++) {
- if (!(selection[i] instanceof IFolder)) {
+ for (Object f : selection) {
+ if (!(f instanceof IFolder)) {
return new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), -1, SourceLookupUIMessages.sourceSearch_folderSelectionError, null); //
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerBrowser.java
index 09b5e8788..6e405df76 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerBrowser.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerBrowser.java
@@ -48,11 +48,11 @@ public class ProjectSourceContainerBrowser extends AbstractSourceContainerBrowse
if(dialog.open() == Window.OK){
Object[] elements= ((ListSelectionDialog)dialog).getResult();
ArrayList<ISourceContainer> res = new ArrayList<>();
- for (int i= 0; i < elements.length; i++) {
- if(!(elements[i] instanceof IProject)) {
+ for (Object element : elements) {
+ if (!(element instanceof IProject)) {
continue;
}
- res.add(new ProjectSourceContainer((IProject)elements[i], ((ProjectSourceContainerDialog)dialog).isAddRequiredProjects()));
+ res.add(new ProjectSourceContainer((IProject) element, ((ProjectSourceContainerDialog)dialog).isAddRequiredProjects()));
}
return res.toArray(new ISourceContainer[res.size()]);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkingSetSourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkingSetSourceContainerBrowser.java
index f59639d2a..cefc0d9ef 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkingSetSourceContainerBrowser.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkingSetSourceContainerBrowser.java
@@ -40,8 +40,8 @@ public class WorkingSetSourceContainerBrowser extends AbstractSourceContainerBro
if (dialog.open() == Window.OK) {
IWorkingSet[] selections = dialog.getSelection();
if (selections != null) {
- for (int i = 0; i < selections.length; i++) {
- containers.add(new WorkingSetSourceContainer(selections[i]));
+ for (IWorkingSet selection : selections) {
+ containers.add(new WorkingSetSourceContainer(selection));
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariablePresentationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariablePresentationManager.java
index 0709463bf..f9d5235cd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariablePresentationManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariablePresentationManager.java
@@ -99,8 +99,7 @@ public class StringVariablePresentationManager {
fConfigurations = new HashMap<>();
IExtensionPoint point= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), EXTENSION_POINT_STRING_VARIABLE_PRESENTATIONS);
IConfigurationElement elements[]= point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- IConfigurationElement element = elements[i];
+ for (IConfigurationElement element : elements) {
String name= element.getAttribute(ATTR_NAME);
if (name == null) {
DebugUIPlugin.logErrorMessage(MessageFormat.format("String variable presentation extension missing required 'variableName' attribute: {0}", new Object[] { element.getDeclaringExtension().getLabel() })); //$NON-NLS-1$
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java
index 8a9d49627..8913c2c6c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java
@@ -254,10 +254,10 @@ public class VirtualFindAction extends Action implements IUpdate {
private void collectAllChildren(VirtualItem element, List<VirtualItem> collect) {
VirtualItem[] children = element.getItems();
if (children != null) {
- for (int i = 0; i < children.length; i++) {
- if (!children[i].needsLabelUpdate()) {
- collect.add(children[i]);
- collectAllChildren(children[i], collect);
+ for (VirtualItem child : children) {
+ if (!child.needsLabelUpdate()) {
+ collect.add(child);
+ collectAllChildren(child, collect);
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchManagerProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchManagerProxy.java
index a694d5c59..6c9ee161d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchManagerProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchManagerProxy.java
@@ -80,8 +80,8 @@ public class LaunchManagerProxy extends AbstractModelProxy implements ILaunchesL
*/
protected void fireDelta(ILaunch[] launches, int launchFlags) {
ModelDelta delta = new ModelDelta(fLaunchManager, IModelDelta.NO_CHANGE);
- for (int i = 0; i < launches.length; i++) {
- delta.addNode(launches[i], launchFlags);
+ for (ILaunch launch : launches) {
+ delta.addNode(launch, launchFlags);
}
fireModelChanged(delta);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java
index d7e0e6ae3..3813ce159 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java
@@ -75,8 +75,8 @@ public class LaunchProxy extends AbstractModelProxy implements ILaunchesListener
@Override
public void launchesTerminated(ILaunch[] launches) {
- for (int i = 0; i < launches.length; i++) {
- if (launches[i] == fLaunch) {
+ for (ILaunch launch : launches) {
+ if (launch == fLaunch) {
fireDelta(IModelDelta.STATE | IModelDelta.CONTENT | IModelDelta.UNINSTALL);
break;
}
@@ -85,8 +85,8 @@ public class LaunchProxy extends AbstractModelProxy implements ILaunchesListener
@Override
public void launchesRemoved(ILaunch[] launches) {
- for (int i = 0; i < launches.length; i++) {
- if (launches[i] == fLaunch) {
+ for (ILaunch launch : launches) {
+ if (launch == fLaunch) {
fireDelta(IModelDelta.UNINSTALL);
break;
}
@@ -99,8 +99,8 @@ public class LaunchProxy extends AbstractModelProxy implements ILaunchesListener
@Override
public void launchesChanged(ILaunch[] launches) {
- for (int i = 0; i < launches.length; i++) {
- if (launches[i] == fLaunch) {
+ for (ILaunch launch : launches) {
+ if (launch == fLaunch) {
fireDelta(IModelDelta.STATE | IModelDelta.CONTENT);
installModelProxies();
break;
@@ -121,8 +121,7 @@ public class LaunchProxy extends AbstractModelProxy implements ILaunchesListener
synchronized(this) {
Object[] children = fLaunch.getChildren();
ModelDelta launchDelta = root.addNode(fLaunch, indexOf(fLaunch, allLaunches), IModelDelta.EXPAND, children.length);
- for (int j = 0; j < children.length; j++) {
- Object child = children[j];
+ for (Object child : children) {
if (fPrevChildren.add(child)) {
changes = true;
launchDelta.addNode(child, indexOf(child, children), IModelDelta.INSTALL, -1);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java
index 83ce4f705..2b315c68c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java
@@ -77,20 +77,18 @@ public class MemoryRetrievalProxy extends AbstractModelProxy implements IMemoryB
ModelDelta delta = new ModelDelta(fRetrieval, IModelDelta.NO_CHANGE);
// find a memory block to select
-
- for (int i = 0; i < memory.length; i++) {
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(memory[i]);
-
+ for (IMemoryBlock block : memory) {
+ IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(block);
if (retrieval != null) {
if (retrieval == fRetrieval) {
// do not change selection if the memory block
// removed is not
// currently selected
// #getCurrentSelection must be run on the UI thread
- if (isMemoryBlockSelected(getCurrentSelection(), memory[i])) {
+ if (isMemoryBlockSelected(getCurrentSelection(), block)) {
addSelectDeltaNode(delta);
}
- delta.addNode(memory[i], IModelDelta.REMOVED);
+ delta.addNode(block, IModelDelta.REMOVED);
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextManager.java
index c8669a24c..3a78e8d1e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextManager.java
@@ -53,8 +53,7 @@ public class ViewContextManager implements IWindowListener {
private ViewContextManager() {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow[] workbenchWindows = workbench.getWorkbenchWindows();
- for (int i = 0; i < workbenchWindows.length; i++) {
- IWorkbenchWindow window = workbenchWindows[i];
+ for (IWorkbenchWindow window : workbenchWindows) {
windowOpened(window);
}
workbench.addWindowListener(this);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java
index 9c7bf8d82..7f04f4a83 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java
@@ -160,8 +160,8 @@ public class BreakpointOrganizerExtension implements IBreakpointOrganizer, IBrea
if (organizer instanceof IBreakpointOrganizerDelegateExtension) {
((IBreakpointOrganizerDelegateExtension)organizer).addBreakpoints(breakpoints, category);
} else {
- for (int i = 0; i < breakpoints.length; i++) {
- addBreakpoint(breakpoints[i], category);
+ for (IBreakpoint breakpoint : breakpoints) {
+ addBreakpoint(breakpoint, category);
}
}
}
@@ -172,8 +172,8 @@ public class BreakpointOrganizerExtension implements IBreakpointOrganizer, IBrea
if (organizer instanceof IBreakpointOrganizerDelegateExtension) {
((IBreakpointOrganizerDelegateExtension)organizer).removeBreakpoints(breakpoints, category);
} else {
- for (int i = 0; i < breakpoints.length; i++) {
- removeBreakpoint(breakpoints[i], category);
+ for (IBreakpoint breakpoint : breakpoints) {
+ removeBreakpoint(breakpoint, category);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java
index 9d8d08d08..a8129c311 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java
@@ -82,12 +82,10 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
public IAdaptable[] getCategories(IBreakpoint breakpoint) {
List<IAdaptable> result = new ArrayList<>();
IWorkingSet[] workingSets = fWorkingSetManager.getWorkingSets();
- for (int i = 0; i < workingSets.length; i++) {
- IWorkingSet set = workingSets[i];
+ for (IWorkingSet set : workingSets) {
if (IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(set.getId())) {
IAdaptable[] elements = set.getElements();
- for (int j = 0; j < elements.length; j++) {
- IAdaptable adaptable = elements[j];
+ for (IAdaptable adaptable : elements) {
if (adaptable.equals(breakpoint)) {
result.add(new WorkingSetCategory(set));
break;
@@ -143,9 +141,9 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
}
if(property.equals(IWorkingSetManager.CHANGE_WORKING_SET_ADD)) {
IAdaptable[] breakpoints = set.getElements();
- for (int i = 0; i < breakpoints.length; i++) {
- if (breakpoints[i] instanceof IBreakpoint) {
- IMarker marker = ((IBreakpoint)breakpoints[i]).getMarker();
+ for (IAdaptable breakpoint : breakpoints) {
+ if (breakpoint instanceof IBreakpoint) {
+ IMarker marker = ((IBreakpoint) breakpoint).getMarker();
fCache.addEntry(marker, set.getName());
fCache.flushMarkerCache(marker);
}
@@ -159,12 +157,12 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
@Override
public void breakpointsAdded(IBreakpoint[] breakpoints) {
Map<IWorkingSet, List<IBreakpoint>> setToBreakpoints = new HashMap<>();
- for (int i = 0; i < breakpoints.length; i++) {
- IMarker marker = breakpoints[i].getMarker();
+ for (IBreakpoint breakpoint : breakpoints) {
+ IMarker marker = breakpoint.getMarker();
String[] names = getWorkingsetAttributeFromMarker(marker, IInternalDebugUIConstants.WORKING_SET_NAME);
//add it to the default set if the listing is empty
if (names.length == 0) {
- queueToSet(breakpoints[i], getDefaultWorkingSet(), setToBreakpoints);
+ queueToSet(breakpoint, getDefaultWorkingSet(), setToBreakpoints);
} else {
for (int j = 1; j < names.length; j++) {
IWorkingSet set = PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(names[j]);
@@ -172,7 +170,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
if (set == null) {
set = getDefaultWorkingSet();
}
- queueToSet(breakpoints[i], set, setToBreakpoints);
+ queueToSet(breakpoint, set, setToBreakpoints);
}
}
}
@@ -204,12 +202,11 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
IAdaptable[] elements = set.getElements();
Set<IAdaptable> collection = new HashSet<>(elements.length);
List<IAdaptable> list = new ArrayList<>(elements.length + breakpoints.length);
- for(int i = 0; i < elements.length; i++) {
- collection.add(elements[i]);
- list.add(elements[i]);
+ for (IAdaptable element : elements) {
+ collection.add(element);
+ list.add(element);
}
- for (int i = 0; i < breakpoints.length; i++) {
- IBreakpoint breakpoint = breakpoints[i];
+ for (IBreakpoint breakpoint : breakpoints) {
if (!collection.contains(breakpoint)) {
list.add(breakpoint);
fCache.addEntry(breakpoint.getMarker(), set.getName()); //fix for bug 103731
@@ -225,8 +222,8 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
IMarkerDelta[] deltas) {
IWorkingSet[] workingSets = fWorkingSetManager.getWorkingSets();
IWorkingSet set = null;
- for (int i = 0; i < workingSets.length; i++) {
- set = workingSets[i];
+ for (IWorkingSet workingSet : workingSets) {
+ set = workingSet;
if (IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(set.getId())) {
clean(set);
}
@@ -255,8 +252,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
}
if (update) {
List<IAdaptable> newElements = new ArrayList<>(elements.length);
- for (int i = 0; i < elements.length; i++) {
- IAdaptable adaptable = elements[i];
+ for (IAdaptable adaptable : elements) {
if (adaptable != null) {
newElements.add(adaptable);
}
@@ -360,8 +356,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
IWorkingSet set = ((WorkingSetCategory) category).getWorkingSet();
IAdaptable[] elements = set.getElements();
List<IAdaptable> list = new ArrayList<>();
- for (int i = 0; i < elements.length; i++) {
- IAdaptable adaptable = elements[i];
+ for (IAdaptable adaptable : elements) {
if (!adaptable.equals(breakpoint)) {
list.add(adaptable);
}
@@ -376,8 +371,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
public IAdaptable[] getCategories() {
IWorkingSet[] workingSets = fWorkingSetManager.getWorkingSets();
List<IAdaptable> all = new ArrayList<>();
- for (int i = 0; i < workingSets.length; i++) {
- IWorkingSet set = workingSets[i];
+ for (IWorkingSet set : workingSets) {
if (IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(set
.getId())) {
all.add(new WorkingSetCategory(set));
@@ -401,8 +395,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
IAdaptable[] elements = set.getElements();
List<IAdaptable> list = new ArrayList<>(elements.length);
Collections.addAll(list, elements);
- for (int i = 0; i < breakpoints.length; i++) {
- IBreakpoint breakpoint = breakpoints[i];
+ for (IBreakpoint breakpoint : breakpoints) {
fCache.removeMappedEntry(breakpoint.getMarker(), set.getName());
fCache.flushMarkerCache(breakpoint.getMarker());
list.remove(breakpoint);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java
index c0226dcf8..053ac17e4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java
@@ -37,8 +37,7 @@ public class ConsoleRemoveAllTerminatedAction extends Action implements IUpdate,
@Override
public synchronized void update() {
ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
- for (int i = 0; i < launches.length; i++) {
- ILaunch launch = launches[i];
+ for (ILaunch launch : launches) {
if (launch.isTerminated()) {
setEnabled(true);
return;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java
index 37a6b44db..37033eabb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java
@@ -261,9 +261,9 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS
@Override
public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- Object source = events[i].getSource();
- if (events[i].getKind() == DebugEvent.TERMINATE && source instanceof IMemoryBlockRetrieval) {
+ for (DebugEvent event : events) {
+ Object source = event.getSource();
+ if (event.getKind() == DebugEvent.TERMINATE && source instanceof IMemoryBlockRetrieval) {
if (isDisposed()) {
return;
}
@@ -333,8 +333,8 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS
// if tab folder is not empty, dipose view tabs
CTabItem[] tabs = tabFolder.getItems();
- for (int i = 0; i < tabs.length; i++) {
- disposeTab(tabs[i]);
+ for (CTabItem tab : tabs) {
+ disposeTab(tab);
}
tabFolder.dispose();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java
index 61f3c5c54..844f628e3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java
@@ -184,8 +184,8 @@ public class AddMemoryBlockAction extends Action implements IDebugContextListene
* @return if we should exit
*/
private boolean addMemoryBlocks(boolean exit, Object elem, IMemoryBlockRetrieval standardMemRetrieval, MonitorMemoryBlockDialog dialog, final String[] expressionsArray) {
- for (int i = 0; i < expressionsArray.length; i++) {
- String expression = expressionsArray[i].trim();
+ for (String e : expressionsArray) {
+ String expression = e.trim();
try {
if (standardMemRetrieval instanceof IMemoryBlockRetrievalExtension) {
// if the debug session supports
@@ -276,8 +276,8 @@ public class AddMemoryBlockAction extends Action implements IDebugContextListene
@Override
public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- handleDebugEvent(events[i]);
+ for (DebugEvent event : events) {
+ handleDebugEvent(event);
}
}
@@ -344,18 +344,18 @@ public class AddMemoryBlockAction extends Action implements IDebugContextListene
DebugUIPlugin.log(e1);
}
- for (int i = 0; i < renderingTypes.length; i++) {
+ for (IMemoryRenderingType renderingType : renderingTypes) {
try {
boolean create = true;
if (primaryType != null) {
- if (primaryType.getId().equals(renderingTypes[i].getId())) {
+ if (primaryType.getId().equals(renderingType.getId())) {
create = false;
}
}
if (create) {
- createRenderingInContainer(memoryBlock, renderingTypes[i], IDebugUIConstants.ID_RENDERING_VIEW_PANE_2);
+ createRenderingInContainer(memoryBlock, renderingType, IDebugUIConstants.ID_RENDERING_VIEW_PANE_2);
}
- } catch (CoreException e) {
+ }catch (CoreException e) {
DebugUIPlugin.log(e);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingContextAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingContextAction.java
index d517e68a9..83d398f54 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingContextAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingContextAction.java
@@ -56,9 +56,9 @@ public class AddMemoryRenderingContextAction implements IViewActionDelegate {
String actionId = action.getId();
IMemoryRenderingContainer selectedPane = null;
- for (int i = 0; i < viewPanes.length; i++) {
- if (actionId.contains(viewPanes[i].getId())) {
- selectedPane = viewPanes[i];
+ for (IMemoryRenderingContainer viewPane : viewPanes) {
+ if (actionId.contains(viewPane.getId())) {
+ selectedPane = viewPane;
break;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java
index add3e0eb9..c54bc43c3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java
@@ -367,8 +367,8 @@ public class AddMemoryRenderingDialog extends SelectionDialog {
// clean up
combo.removeAll();
- for (int i = 0; i < labels.length; i++) {
- combo.add(labels[i]);
+ for (String label : labels) {
+ combo.add(label);
}
combo.select(selectionIdx);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java
index e5478da29..2ca3ac384 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java
@@ -110,9 +110,9 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
if (selected != null && selected instanceof IStructuredSelection) {
Object[] selectedMemBlks = ((IStructuredSelection) selected).toArray();
ArrayList<Object> memoryBlocks = new ArrayList<>();
- for (int i = 0; i < selectedMemBlks.length; i++) {
- if (selectedMemBlks[i] instanceof IMemoryBlock) {
- memoryBlocks.add(selectedMemBlks[i]);
+ for (Object selectedMemBlk : selectedMemBlks) {
+ if (selectedMemBlk instanceof IMemoryBlock) {
+ memoryBlocks.add(selectedMemBlk);
}
}
@@ -224,8 +224,8 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
@Override
public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- doHandleDebugEvent(events[i]);
+ for (DebugEvent event : events) {
+ doHandleDebugEvent(event);
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
index 71b707408..53347de57 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
@@ -262,9 +262,9 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
// also try to find other views and register
if (DebugUIPlugin.getActiveWorkbenchWindow() != null && DebugUIPlugin.getActiveWorkbenchWindow().getActivePage() != null) {
IViewReference references[] = DebugUIPlugin.getActiveWorkbenchWindow().getActivePage().getViewReferences();
- for (int i = 0; i < references.length; i++) {
- if (references[i].getSecondaryId() != null) {
- MemoryViewIdRegistry.registerView(references[i].getSecondaryId());
+ for (IViewReference reference : references) {
+ if (reference.getSecondaryId() != null) {
+ MemoryViewIdRegistry.registerView(reference.getSecondaryId());
}
}
}
@@ -422,8 +422,8 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
ToolBarManager viewerToolBarMgr = new ToolBarManager(SWT.FLAT);
IAction[] actions = fMemBlkViewer.getActions();
- for (int i = 0; i < actions.length; i++) {
- viewerToolBarMgr.add(actions[i]);
+ for (IAction action : actions) {
+ viewerToolBarMgr.add(action);
}
ToolBar viewerToolbar = viewerToolBarMgr.createControl(viewerViewForm);
viewerViewForm.setTopRight(viewerToolbar);
@@ -547,15 +547,15 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
private void setVisible(boolean visible) {
IMemoryViewPane[] viewPanes = getViewPanes();
- for (int i = 0; i < viewPanes.length; i++) {
+ for (IMemoryViewPane viewPane : viewPanes) {
// if currently visible, take view pane's visibility into account
// else force view pane to be visible if it is listed in
// "visible view panes" array list.
if (fVisible) {
- viewPanes[i].setVisible(visible && viewPanes[i].isVisible());
+ viewPane.setVisible(visible && viewPane.isVisible());
} else {
- if (isViewPaneVisible(viewPanes[i].getId())) {
- viewPanes[i].setVisible(visible);
+ if (isViewPaneVisible(viewPane.getId())) {
+ viewPane.setVisible(visible);
}
}
}
@@ -596,8 +596,8 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
*/
private void restoreView() {
IMemoryViewPane[] viewPanes = getViewPanes();
- for (int i = 0; i < viewPanes.length; i++) {
- viewPanes[i].restoreViewPane();
+ for (IMemoryViewPane viewPane : viewPanes) {
+ viewPane.restoreViewPane();
}
}
@@ -613,9 +613,9 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
if (viewPaneControl != null) {
Control children[] = fSashForm.getChildren();
- for (int i = 0; i < children.length; i++) {
- if (children[i] == viewPaneControl) {
- children[i].setVisible(show);
+ for (Control child : children) {
+ if (child == viewPaneControl) {
+ child.setVisible(show);
IMemoryViewPane viewPane = fViewPanes.get(paneId);
if (viewPane != null) {
viewPane.setVisible(show);
@@ -673,8 +673,8 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
fVisibleViewPanes.add(paneId);
}
} else {
- for (int i = 0; i < defaultVisiblePaneIds.length; i++) {
- fVisibleViewPanes.add(defaultVisiblePaneIds[i]);
+ for (String defaultVisiblePaneId : defaultVisiblePaneIds) {
+ fVisibleViewPanes.add(defaultVisiblePaneId);
}
}
@@ -699,9 +699,9 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
private void loadOrientation() {
fViewOrientation = Platform.getPreferencesService().getInt(DebugUIPlugin.getUniqueIdentifier(), getOrientationPrefId(), HORIZONTAL_VIEW_ORIENTATION, null);
- for (int i = 0; i < fOrientationActions.length; i++) {
- if (fOrientationActions[i].getOrientation() == fViewOrientation) {
- fOrientationActions[i].run();
+ for (ViewPaneOrientationAction fOrientationAction : fOrientationActions) {
+ if (fOrientationAction.getOrientation() == fViewOrientation) {
+ fOrientationAction.run();
}
}
updateOrientationActions();
@@ -720,13 +720,12 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
}
private void updateOrientationActions() {
- for (int i = 0; i < fOrientationActions.length; i++) {
- if (fOrientationActions[i].getOrientation() == fViewOrientation) {
- fOrientationActions[i].setChecked(true);
+ for (ViewPaneOrientationAction fOrientationAction : fOrientationActions) {
+ if (fOrientationAction.getOrientation() == fViewOrientation) {
+ fOrientationAction.setChecked(true);
} else {
- fOrientationActions[i].setChecked(false);
+ fOrientationAction.setChecked(false);
}
-
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java
index a14fcf7d6..9a5002d31 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java
@@ -81,8 +81,8 @@ public class MemoryViewSynchronizationService implements IMemoryRenderingSynchro
if (fFilters == null) {
return true;
}
- for (int i = 0; i < fFilters.length; i++) {
- if (fFilters[i].equals(property)) {
+ for (String filter : fFilters) {
+ if (filter.equals(property)) {
return true;
}
}
@@ -134,9 +134,7 @@ public class MemoryViewSynchronizationService implements IMemoryRenderingSynchro
return;
}
- for (int i = 0; i < memoryBlocks.length; i++) {
- IMemoryBlock memory = memoryBlocks[i];
-
+ for (IMemoryBlock memory : memoryBlocks) {
if (fLastChangedRendering != null && fLastChangedRendering.getMemoryBlock() == memory) {
fLastChangedRendering = null;
}
@@ -343,9 +341,8 @@ public class MemoryViewSynchronizationService implements IMemoryRenderingSynchro
// synchronization service is being enabled
// this is to get around problem when the last changed
// rendering is not currently the sync info provider
-
- for (int i = 0; i < ids.length; i++) {
- PropertyChangeEvent evt = new PropertyChangeEvent(fLastChangedRendering, ids[i], null, info.getProperty(ids[i]));
+ for (String id : ids) {
+ PropertyChangeEvent evt = new PropertyChangeEvent(fLastChangedRendering, id, null, info.getProperty(id));
firePropertyChanged(evt);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeModelContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeModelContentProvider.java
index 810e8b39e..14a3f0273 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeModelContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeModelContentProvider.java
@@ -28,8 +28,7 @@ public class MemoryViewTreeModelContentProvider extends TreeModelContentProvider
protected void updateNodes(IModelDelta[] nodes, int mask) {
if (getViewer() instanceof TreeModelViewer) {
- for (int i = 0; i < nodes.length; i++) {
- IModelDelta node = nodes[i];
+ for (IModelDelta node : nodes) {
int flags = node.getFlags();
if ((mask & ITreeModelContentProvider.CONTROL_MODEL_DELTA_FLAGS) != 0 && (flags & IModelDelta.ADDED) != 0 && (flags & IModelDelta.SELECT) != 0 && node.getElement() instanceof IMemoryBlock) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/NewMemoryViewAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/NewMemoryViewAction.java
index dd09175bc..aec3672ed 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/NewMemoryViewAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/NewMemoryViewAction.java
@@ -88,9 +88,9 @@ public class NewMemoryViewAction implements IViewActionDelegate {
MemoryView newMView = (MemoryView) newView;
IMemoryViewPane[] viewPanes = fView.getViewPanes();
int orientation = fView.getViewPanesOrientation();
- for (int i = 0; i < viewPanes.length; i++) {
+ for (IMemoryViewPane viewPane : viewPanes) {
// copy view pane visibility
- newMView.showViewPane(fView.isViewPaneVisible(viewPanes[i].getId()), viewPanes[i].getId());
+ newMView.showViewPane(fView.isViewPaneVisible(viewPane.getId()), viewPane.getId());
}
// do not want to copy renderings as it could be very expensive
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveRenderingContextAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveRenderingContextAction.java
index d671dc806..2ccb57445 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveRenderingContextAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveRenderingContextAction.java
@@ -69,9 +69,9 @@ public class RemoveRenderingContextAction implements IViewActionDelegate {
String actionId = action.getId();
IMemoryRenderingContainer selectedPane = null;
- for (int i = 0; i < viewPanes.length; i++) {
- if (actionId.contains(viewPanes[i].getId())) {
- selectedPane = viewPanes[i];
+ for (IMemoryRenderingContainer viewPane : viewPanes) {
+ if (actionId.contains(viewPane.getId())) {
+ selectedPane = viewPane;
break;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java
index 90ef9daaf..9509fde4d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java
@@ -128,9 +128,7 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
return;
}
- for (int i = 0; i < memoryBlocks.length; i++) {
- IMemoryBlock memory = memoryBlocks[i];
-
+ for (IMemoryBlock memory : memoryBlocks) {
if (!fTabFolderForMemoryBlock.containsKey(memory)) {
createFolderForMemoryBlock(memory);
}
@@ -143,27 +141,21 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
@Override
public void memoryBlocksRemoved(final IMemoryBlock[] memoryBlocks) {
Display.getDefault().asyncExec(() -> {
- for (int j = 0; j < memoryBlocks.length; j++) {
- IMemoryBlock mbRemoved = memoryBlocks[j];
+ for (IMemoryBlock mbRemoved : memoryBlocks) {
if (fTabFolderForMemoryBlock == null) {
return;
}
-
// get all renderings from this memory block and remove them
// from the view
IMemoryRendering[] renderings = fRenderingMgr.getRenderingsFromMemoryBlock(mbRemoved);
-
- for (int k = 0; k < renderings.length; k++) {
- removeMemoryRendering(renderings[k]);
+ for (IMemoryRendering rendering : renderings) {
+ removeMemoryRendering(rendering);
}
-
// remove a the tab folder if the memory block is removed
CTabFolder tabFolder = fTabFolderForMemoryBlock.get(mbRemoved);
-
if (tabFolder == null) {
continue;
}
-
fTabFolderForMemoryBlock.remove(mbRemoved);
fMemoryBlockFromTabFolder.remove(tabFolder);
IMemoryBlockRetrieval retrieve = MemoryViewUtil.getMemoryBlockRetrieval(mbRemoved);
@@ -172,18 +164,14 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
fTabFolderForDebugView.remove(MemoryViewUtil.getHashCode(retrieve));
}
}
-
if (!tabFolder.isDisposed()) {
// dispose all view tabs belonging to the tab folder
CTabItem[] items = tabFolder.getItems();
-
- for (int i = 0; i < items.length; i++) {
- disposeTab(items[i]);
+ for (CTabItem item : items) {
+ disposeTab(item);
}
-
// dispose the tab folder
tabFolder.dispose();
-
// if this is the top control
if (tabFolder == fStackLayout.topControl) {
@@ -222,7 +210,6 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
// if not the top control
// no need to do anything
}
-
fAddedMemoryBlocks.remove(mbRemoved);
updateToolBarActionsEnablement();
}
@@ -502,20 +489,17 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
CTabItem[] tabs = tabFolder.getItems();
boolean foundTab = false;
- for (int i1 = 0; i1 < tabs.length; i1++) {
- IMemoryViewTab viewTab1 = (IMemoryViewTab) tabs[i1].getData();
-
- if (tabs[i1].isDisposed()) {
+ for (CTabItem tab : tabs) {
+ IMemoryViewTab viewTab1 = (IMemoryViewTab) tab.getData();
+ if (tab.isDisposed()) {
continue;
}
-
if (viewTab1.getRendering().getMemoryBlock() == memory) {
if (viewTab1.getRendering() == rendering) {
foundTab = true;
- disposeTab(tabs[i1]);
+ disposeTab(tab);
break;
}
-
}
}
@@ -528,12 +512,12 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
CTabFolder otherTabFolder = enumeration.nextElement();
tabs = otherTabFolder.getItems();
IMemoryViewTab viewTab2 = null;
- for (int i2 = 0; i2 < tabs.length; i2++) {
- viewTab2 = (IMemoryViewTab) tabs[i2].getData();
+ for (CTabItem tab : tabs) {
+ viewTab2 = (IMemoryViewTab) tab.getData();
if (viewTab2.getRendering().getMemoryBlock() == memory) {
if (viewTab2.getRendering() == rendering) {
foundTab = true;
- disposeTab(tabs[i2]);
+ disposeTab(tab);
break;
}
}
@@ -563,8 +547,8 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
}
private void restoreViewTabs(IMemoryRendering[] renderings) {
- for (int i = 0; i < renderings.length; i++) {
- memoryBlockRenderingAdded(renderings[i]);
+ for (IMemoryRendering rendering : renderings) {
+ memoryBlockRenderingAdded(rendering);
}
}
@@ -1050,10 +1034,9 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
originalProvider = service.getSynchronizationProvider();
}
- for (int i = 0; i < renderings.length; i++) {
- if (renderings[i] instanceof IResettableMemoryRendering) {
+ for (IMemoryRendering rendering : renderings) {
+ if (rendering instanceof IResettableMemoryRendering) {
try {
-
// This is done to allow user to select multiple memory
// monitors and
// reset their renderings.
@@ -1075,10 +1058,10 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
// though the rendering
// is currently hidden.
if (service != null) {
- service.setSynchronizationProvider(renderings[i]);
+ service.setSynchronizationProvider(rendering);
}
- ((IResettableMemoryRendering) renderings[i]).resetRendering();
- } catch (DebugException e) {
+ ((IResettableMemoryRendering) rendering).resetRendering();
+ }catch (DebugException e) {
// do not pop up error message
// error message is annoying where there are multiple
// rendering
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java
index a1c8b76ad..1860641da 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java
@@ -61,9 +61,9 @@ public class ResetMemoryBlockAction implements IViewActionDelegate {
MemoryView memView = (MemoryView) fView;
IMemoryRenderingContainer[] containers = memView.getMemoryRenderingContainers();
- for (int i = 0; i < containers.length; i++) {
- if (containers[i] instanceof RenderingViewPane) {
- ((RenderingViewPane) containers[i]).resetRenderings(mb, resetVisible);
+ for (IMemoryRenderingContainer container : containers) {
+ if (container instanceof RenderingViewPane) {
+ ((RenderingViewPane) container).resetRenderings(mb, resetVisible);
}
}
}
@@ -77,12 +77,12 @@ public class ResetMemoryBlockAction implements IViewActionDelegate {
IStructuredSelection strucSel = (IStructuredSelection) selection;
Object[] objs = strucSel.toArray();
fSelectedMB.clear();
- for (int i = 0; i < objs.length; i++) {
- if (objs[i] instanceof IMemoryBlock) {
- fSelectedMB.add(objs[i]);
+ for (Object obj : objs) {
+ if (obj instanceof IMemoryBlock) {
+ fSelectedMB.add(obj);
}
- if (objs[i] instanceof IMemoryRendering) {
- fSelectedMB.add(((IMemoryRendering) objs[i]).getMemoryBlock());
+ if (obj instanceof IMemoryRendering) {
+ fSelectedMB.add(((IMemoryRendering) obj).getMemoryBlock());
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java
index 6292c9be2..1d99b6bfe 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java
@@ -237,9 +237,9 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega
allMemoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(retrieval);
}
if (allMemoryBlocks != null) {
- for (int i = 0; i < allMemoryBlocks.length; i++) {
- SwitchToAction action = new SwitchToAction(allMemoryBlocks[i], true);
- if (allMemoryBlocks[i] == memoryBlock) {
+ for (IMemoryBlock block : allMemoryBlocks) {
+ SwitchToAction action = new SwitchToAction(block, true);
+ if (block == memoryBlock) {
action.setChecked(true);
}
ActionContributionItem item = new ActionContributionItem(action);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java
index ff8ec2667..ff4e4277a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java
@@ -78,9 +78,8 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener {
IMemoryRendering[] toRemove = getRenderings(mem, renderingId);
- for (int i = 0; i < toRemove.length; i++) {
- fRenderings.remove(toRemove[i]);
-
+ for (IMemoryRendering rendering : toRemove) {
+ fRenderings.remove(rendering);
// remove listener after the last memory block has been removed
if (fRenderings.isEmpty()) {
DebugPlugin.getDefault().removeDebugEventListener(this);
@@ -179,8 +178,8 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener {
@Override
public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- handleDebugEvent(events[i]);
+ for (DebugEvent event : events) {
+ handleDebugEvent(event);
}
}
@@ -198,9 +197,9 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener {
// returns empty array if dt == null
IMemoryRendering[] deletedrendering = getRenderingsFromDebugTarget(dt);
- for (int i = 0; i < deletedrendering.length; i++) {
- removeMemoryBlockRendering(deletedrendering[i].getMemoryBlock(), deletedrendering[i].getRenderingId());
- fViewPane.removeMemoryRendering(deletedrendering[i]);
+ for (IMemoryRendering rendering : deletedrendering) {
+ removeMemoryBlockRendering(rendering.getMemoryBlock(), rendering.getRenderingId());
+ fViewPane.removeMemoryRendering(rendering);
}
}
}
@@ -302,8 +301,7 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener {
Document document = LaunchManager.getDocument();
Element rootElement = document.createElement(RENDERINGS_TAG);
document.appendChild(rootElement);
- for (int i = 0; i < renderings.length; i++) {
- IMemoryRendering rendering = renderings[i];
+ for (IMemoryRendering rendering : renderings) {
Element element = document.createElement(MEMORY_RENDERING_TAG);
element.setAttribute(MEMORY_BLOCK, Integer.toString(rendering.getMemoryBlock().hashCode()));
element.setAttribute(RENDERING_ID, rendering.getRenderingId());
@@ -347,18 +345,18 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener {
IMemoryBlock[] memoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks();
IMemoryBlock memoryBlock = null;
- for (int j = 0; j < memoryBlocks.length; j++) {
- if (Integer.toString(memoryBlocks[j].hashCode()).equals(memoryBlockHashCode)) {
- memoryBlock = memoryBlocks[j];
+ for (IMemoryBlock m : memoryBlocks) {
+ if (Integer.toString(m.hashCode()).equals(memoryBlockHashCode)) {
+ memoryBlock = m;
}
}
if (memoryBlock != null) {
IMemoryRenderingType[] types = DebugUITools.getMemoryRenderingManager().getRenderingTypes(memoryBlock);
IMemoryRenderingType type = null;
- for (int k = 0; k < types.length; k++) {
- if (types[k].getId().equals(renderingId)) {
- type = types[k];
+ for (IMemoryRenderingType t : types) {
+ if (t.getId().equals(renderingId)) {
+ type = t;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java
index 168e44d65..676c53a59 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java
@@ -62,10 +62,9 @@ public class ViewTabEnablementManager implements SelectionListener {
CTabItem[] allTabs = folder.getItems();
// check all tabs to make sure they are enabled/disabled properly
- for (int i = 0; i < allTabs.length; i++) {
+ for (CTabItem tab : allTabs) {
IMemoryViewTab viewTab;
- Object obj = allTabs[i].getData();
-
+ Object obj = tab.getData();
if (obj instanceof IMemoryViewTab) {
viewTab = (IMemoryViewTab) obj;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractVirtualContentTableModel.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractVirtualContentTableModel.java
index 4c6633eeb..58a9b18ee 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractVirtualContentTableModel.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractVirtualContentTableModel.java
@@ -29,11 +29,11 @@ abstract public class AbstractVirtualContentTableModel extends AsynchronousTable
ModelNode[] nodes = getNodes(getRootNode().getElement());
ArrayList<Object> result = new ArrayList<>();
if (nodes != null) {
- for (int i = 0; i < nodes.length; i++) {
- ModelNode[] children = nodes[i].getChildrenNodes();
+ for (ModelNode node : nodes) {
+ ModelNode[] children = node.getChildrenNodes();
if (children != null) {
- for (int j = 0; j < children.length; j++) {
- result.add(children[j].getElement());
+ for (ModelNode child : children) {
+ result.add(child.getElement());
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java
index c57c7bf8e..d9a9a927c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java
@@ -614,9 +614,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
int colNum = -1;
int numCol = getColumnProperties().length;
- for (int j=0; j<tableItems.length; j++)
- {
- TableItem item = tableItems[j];
+ for (TableItem item : tableItems) {
if (item.getData() != null)
{
for (int i=0; i<numCol; i++)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncVirtualContentTableViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncVirtualContentTableViewer.java
index 8a94cf217..0ec26b16b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncVirtualContentTableViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncVirtualContentTableViewer.java
@@ -87,8 +87,8 @@ abstract public class AsyncVirtualContentTableViewer extends AsynchronousTableVi
// clean up old columns
TableColumn[] oldColumns = getTable().getColumns();
- for (int i = 0; i < oldColumns.length; i++) {
- oldColumns[i].dispose();
+ for (TableColumn oldColumn : oldColumns) {
+ oldColumn.dispose();
}
}
@@ -97,8 +97,8 @@ abstract public class AsyncVirtualContentTableViewer extends AsynchronousTableVi
CellEditor[] oldCellEditors = getCellEditors();
if (oldCellEditors != null) {
- for (int i = 0; i < oldCellEditors.length; i++) {
- oldCellEditors[i].dispose();
+ for (CellEditor oldCellEditor : oldCellEditors) {
+ oldCellEditor.dispose();
}
}
}
@@ -424,9 +424,9 @@ abstract public class AsyncVirtualContentTableViewer extends AsynchronousTableVi
// check each of the items and find the minimum
TableItem[] items = table.getItems();
int minHeight = table.getItemHeight();
- for (int i = 0; i < items.length; i++) {
- if (items[i].getData() != null) {
- minHeight = Math.min(items[i].getBounds(0).height, minHeight);
+ for (TableItem item : items) {
+ if (item.getData() != null) {
+ minHeight = Math.min(item.getBounds(0).height, minHeight);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java
index 08fb101ff..48f93c40a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java
@@ -109,8 +109,8 @@ public abstract class BasicDebugViewContentProvider implements IStructuredConten
@Override
public void handleDebugEvents(DebugEvent[] events) {
- for (int i=0; i < events.length; i++) {
- handleDebugEvent(events[i]);
+ for (DebugEvent event : events) {
+ handleDebugEvent(event);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java
index 3decf470e..2ec3f8297 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java
@@ -139,11 +139,11 @@ public class CopyTableRenderingToClipboardAction extends Action
StringBuilder temp;
//get the column contents from all the rows
- for (int i=0; i < itemList.length; i++) {
- for (int j=0; j < numColumns; j++) {
+ for (TableItem item : itemList) {
+ for (int j = 0; j < numColumns; j++) {
tableContents.append(COLUMN_SEPERATOR);
- temp = new StringBuilder(labelProvider.getColumnText(itemList[i].getData(), j));
+ temp = new StringBuilder(labelProvider.getColumnText(item.getData(), j));
if (j>0)
{
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java
index 4db332fb7..c09a32c98 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java
@@ -257,12 +257,10 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
// make a copy of the container, may be diposed when a rendering is added
IMemoryRenderingContainer container = fContainer;
// add memory renderings to Memory Rendering Manager
- for (int i=0; i<renderings.length; i++)
- {
- if (renderings[i] instanceof IMemoryRenderingType)
- {
+ for (Object r : renderings) {
+ if (r instanceof IMemoryRenderingType) {
try {
- IMemoryRendering rendering = ((IMemoryRenderingType)renderings[i]).createRendering();
+ IMemoryRendering rendering = ((IMemoryRenderingType) r).createRendering();
if (rendering != null)
{
rendering.init(container, getMemoryBlock());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java
index 7ddfd7f26..06c3bfbb1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java
@@ -353,9 +353,8 @@ public class FormatTableRenderingDialog extends TrayDialog
}
addressCol.pack();
- for (int i=0; i<columns.length; i++)
- {
- columns[i].pack();
+ for (TableColumn column : columns) {
+ column.pack();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressDialog.java
index 0982ff7a1..c82588500 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressDialog.java
@@ -80,8 +80,8 @@ public class GoToAddressDialog extends TrayDialog implements ModifyListener {
// add history
String[] historyExpression = history.toArray(new String[history.size()]);
- for (int i = 0; i < historyExpression.length; i++) {
- expressionInput.add(historyExpression[i]);
+ for (String h : historyExpression) {
+ expressionInput.add(h);
}
expressionInput.addModifyListener(this);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java
index 53280662e..4e05c2207 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java
@@ -46,14 +46,10 @@ public class HexIntegerRendering extends AbstractIntegerRendering {
data = swapped;
}
- for (int i=0; i<data.length; i++)
- {
- if (data[i].isReadable())
- {
- strBuffer.append(new String(RenderingsUtil.convertByteToCharArray(data[i].getValue())));
- }
- else
- {
+ for (MemoryByte memByte : data) {
+ if (memByte.isReadable()) {
+ strBuffer.append(new String(RenderingsUtil.convertByteToCharArray(memByte.getValue())));
+ } else {
// pad with padded string
strBuffer.append(paddedStr);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java
index 5561c180f..f3544e302 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java
@@ -38,14 +38,10 @@ public class HexRendering extends AbstractAsyncTableRendering {
String paddedStr = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR);
- for (int i=0; i<data.length; i++)
- {
- if (data[i].isReadable())
- {
- strBuffer.append(new String(RenderingsUtil.convertByteToCharArray(data[i].getValue())));
- }
- else
- {
+ for (MemoryByte memByte : data) {
+ if (memByte.isReadable()) {
+ strBuffer.append(new String(RenderingsUtil.convertByteToCharArray(memByte.getValue())));
+ } else {
// pad with padded string
strBuffer.append(paddedStr);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java
index 6068deb0c..9b405f8e9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java
@@ -80,22 +80,20 @@ public class PrintTableRenderingAction extends Action
lineNum = printColumnLabels(printGC, lineNum);
//for all items in the table
- for (int i=0; i < itemList.length; i++) {
+ for (TableItem item : itemList) {
StringBuilder tableContents = new StringBuilder();
//print all columns for this row
- for (int j=0; j < numColumns; j++) {
- String columnText = labelProvider.getColumnText(itemList[i].getData(), j);
-
+ for (int j = 0; j < numColumns; j++) {
+ String columnText = labelProvider.getColumnText(item.getData(), j);
while (columnText.length() < fRendering.getBytesPerColumn() * charsPerByte)
{
- columnText += " "; //$NON-NLS-1$
+ columnText += " "; //$NON-NLS-1$
}
tableContents.append(COLUMN_SEPERATOR);
tableContents.append(columnText);
}
printGC.drawString(tableContents.toString(), 10, 10+(lineNum*printGC.getFontMetrics().getHeight()));
lineNum++;
-
// if we've run over the end of a page, start a new one
if (20+lineNum*printGC.getFontMetrics().getHeight() > printer.getClientArea().height) {
lineNum=1;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRendering.java
index b808a2c50..ac774e814 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRendering.java
@@ -144,10 +144,8 @@ public class SignedIntegerRendering extends AbstractIntegerRendering {
boolean invalid = false;
String paddedStr = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR);
- for (int i=0; i<data.length; i++)
- {
- if (!data[i].isReadable())
- {
+ for (MemoryByte memByte : data) {
+ if (!memByte.isReadable()) {
invalid = true;
break;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java
index f8c20fd79..58df27051 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java
@@ -726,10 +726,9 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
// content.
if (!getTableRendering(fInput).isDisplayingError())
{
- for (int i=0; i<lines.length; i++)
- {
- contentCache.put(lines[i].getAddress(), lines[i]);
- lines[i].isMonitored = true;
+ for (TableRenderingLine line : lines) {
+ contentCache.put(line.getAddress(), line);
+ line.isMonitored = true;
}
}
@@ -933,9 +932,8 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
TableRenderingLine[] convertedLines = convertBytesToLines(bytes, bytesPerLine, new BigInteger(fContentCacheStartAddress, 16));
contentCache.clear();
- for (int i=0; i<convertedLines.length; i++)
- {
- contentCache.put(convertedLines[i].getAddress(), convertedLines[i]);
+ for (TableRenderingLine convertedLine : convertedLines) {
+ contentCache.put(convertedLine.getAddress(), convertedLine);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLine.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLine.java
index 677bf2714..b1165f9cf 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLine.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLine.java
@@ -93,11 +93,9 @@ public class TableRenderingLine extends PlatformObject {
// pad unavailable bytes with padded string from memory block
String paddedString = null;
int bufferCounter = 0;
- for (int i=0; i<fBytes.length; i++)
- {
+ for (MemoryByte mb : fBytes) {
// if byte is invalid
- if (!fBytes[i].isReadable())
- {
+ if (!mb.isReadable()) {
if (paddedString == null)
{
paddedString = fPaddedString;
@@ -177,10 +175,9 @@ public class TableRenderingLine extends PlatformObject {
// if the string representation is the same, no need to compare
if (oldData.getRawMemoryString().equals(getRawMemoryString()))
{
- for (int i=0; i<fBytes.length; i++)
- {
+ for (MemoryByte mb : fBytes) {
// set history as known if we have old data for this line
- fBytes[i].setHistoryKnown(true);
+ mb.setHistoryKnown(true);
}
return;
}
@@ -283,11 +280,10 @@ public class TableRenderingLine extends PlatformObject {
public void unmarkDeltas()
{
- for (int i=0; i<fBytes.length; i++)
- {
+ for (MemoryByte mb : fBytes) {
// unset the change bit
- if (fBytes[i].isChanged()) {
- fBytes[i].setChanged(false);
+ if (mb.isChanged()) {
+ mb.setChanged(false);
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java
index 859bc9f3f..7937f4576 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java
@@ -166,8 +166,7 @@ public class TableRenderingModel extends AbstractVirtualContentTableModel implem
@Override
public void cache(Object[] elements) {
- for (int i = 0; i < elements.length; i++) {
- Object obj = elements[i];
+ for (Object obj : elements) {
if (obj instanceof MemorySegment) {
cache(((MemorySegment) obj).getAddress(), obj);
}
@@ -187,8 +186,7 @@ public class TableRenderingModel extends AbstractVirtualContentTableModel implem
return newElements;
}
- for (int j = 0; j < newElements.length; j++) {
- Object obj = newElements[j];
+ for (Object obj : newElements) {
if (obj instanceof MemorySegment) {
MemorySegment newSegment = (MemorySegment) obj;
MemorySegment oldSegment = (MemorySegment) fCache.get(newSegment.getAddress());
@@ -275,8 +273,8 @@ public class TableRenderingModel extends AbstractVirtualContentTableModel implem
}
MemorySegment[] newSegments = convertMemoryBytesToSegments(address, bytes, bytesPerLine, numAddressableUnitPerLine, addressableSize, alignAddress);
- for (int i = 0; i < newSegments.length; i++) {
- cache(newSegments[i].getAddress(), newSegments[i]);
+ for (MemorySegment newSegment : newSegments) {
+ cache(newSegment.getAddress(), newSegment);
}
}
@@ -290,8 +288,7 @@ public class TableRenderingModel extends AbstractVirtualContentTableModel implem
ArrayList<Object> segments = new ArrayList<>();
Object[] elements = getElements();
- for (int i = 0; i < elements.length; i++) {
- Object element = elements[i];
+ for (Object element : elements) {
if (element instanceof MemorySegment) {
segments.add(element);
}
@@ -322,8 +319,8 @@ public class TableRenderingModel extends AbstractVirtualContentTableModel implem
private MemoryByte[] convertSegmentsToBytes(MemorySegment[] segments) {
ArrayList<MemoryByte> toReturn = new ArrayList<>();
- for (int i = 0; i < segments.length; i++) {
- MemoryByte[] temp = segments[i].getBytes();
+ for (MemorySegment segment : segments) {
+ MemoryByte[] temp = segment.getBytes();
Collections.addAll(toReturn, temp);
}
return toReturn.toArray(new MemoryByte[0]);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRendering.java
index 25b8a8197..572bbf293 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRendering.java
@@ -130,10 +130,8 @@ public class UnsignedIntegerRendering extends AbstractIntegerRendering {
String paddedStr = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR);
boolean invalid = false;
- for (int i=0; i<data.length; i++)
- {
- if (!data[i].isReadable())
- {
+ for (MemoryByte memByte : data) {
+ if (!memByte.isReadable()) {
invalid = true;
break;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
index b06a47bc3..8b83c4d4f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
@@ -500,8 +500,8 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
createOrientationActions(variablesViewer);
IPreferenceStore prefStore = DebugUIPlugin.getDefault().getPreferenceStore();
String orientation = prefStore.getString(getDetailPanePreferenceKey());
- for (int i = 0; i < fToggleDetailPaneActions.length; i++) {
- fToggleDetailPaneActions[i].setChecked(fToggleDetailPaneActions[i].getOrientation().equals(orientation));
+ for (ToggleDetailPaneAction action : fToggleDetailPaneActions) {
+ action.setChecked(action.getOrientation().equals(orientation));
}
fDetailPane = new DetailPaneProxy(this);
@@ -1440,9 +1440,9 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
protected ToggleDetailPaneAction getToggleDetailPaneAction(String orientation)
{
- for (int i=0; i<fToggleDetailPaneActions.length; i++) {
- if (fToggleDetailPaneActions[i].getOrientation().equals(orientation)) {
- return fToggleDetailPaneActions[i];
+ for (ToggleDetailPaneAction action : fToggleDetailPaneActions) {
+ if (action.getOrientation().equals(orientation)) {
+ return action;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java
index 5c41204b1..9eea45848 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java
@@ -445,8 +445,8 @@ public class DetailPaneManager {
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_DETAIL_FACTORIES);
IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
DetailPaneFactoryExtension delegate = null;
- for(int i = 0; i < infos.length; i++) {
- delegate = new DetailPaneFactoryExtension(infos[i]);
+ for (IConfigurationElement info : infos) {
+ delegate = new DetailPaneFactoryExtension(info);
fKnownFactories.add(delegate);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java
index fe10bfdd5..bd8ffbe65 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java
@@ -435,10 +435,9 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
protected void saveAllCheckedActionStates() {
IToolBarManager tbm= getViewSite().getActionBars().getToolBarManager();
IContributionItem[] items= tbm.getItems();
- for (int i = 0; i < items.length; i++) {
- IContributionItem iContributionItem = items[i];
- if (iContributionItem instanceof ActionContributionItem) {
- ActionContributionItem item= (ActionContributionItem)iContributionItem;
+ for (IContributionItem contitem : items) {
+ if (contitem instanceof ActionContributionItem) {
+ ActionContributionItem item= (ActionContributionItem)contitem;
IAction action= item.getAction();
if (action.getStyle() == IAction.AS_CHECK_BOX && action.isEnabled()) {
saveCheckedActionState(action);
@@ -627,9 +626,9 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
}
IContributionItem[] items = tbm.getItems();
if (items != null) {
- for (int i = 0; i < items.length; i++) {
- if (items[i] instanceof ActionContributionItem) {
- IAction action = ((ActionContributionItem) items[i]).getAction();
+ for (IContributionItem item : items) {
+ if (item instanceof ActionContributionItem) {
+ IAction action = ((ActionContributionItem) item).getAction();
if (!SkipAllBreakpointsAction.ACTION_ID.equals(action.getId())) {
if (action.getStyle() == IAction.AS_CHECK_BOX) {
initActionState(action);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTabGroup.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTabGroup.java
index f66cffd1f..79daa7c07 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTabGroup.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTabGroup.java
@@ -62,8 +62,8 @@ public abstract class AbstractLaunchConfigurationTabGroup implements ILaunchConf
public void dispose() {
ILaunchConfigurationTab[] tabs = getTabs();
if (tabs != null) {
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].dispose();
+ for (ILaunchConfigurationTab tab : tabs) {
+ tab.dispose();
}
}
}
@@ -76,8 +76,8 @@ public abstract class AbstractLaunchConfigurationTabGroup implements ILaunchConf
@Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
ILaunchConfigurationTab[] tabs = getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].setDefaults(configuration);
+ for (ILaunchConfigurationTab tab : tabs) {
+ tab.setDefaults(configuration);
}
}
@@ -89,8 +89,8 @@ public abstract class AbstractLaunchConfigurationTabGroup implements ILaunchConf
@Override
public void initializeFrom(ILaunchConfiguration configuration) {
ILaunchConfigurationTab[] tabs = getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].initializeFrom(configuration);
+ for (ILaunchConfigurationTab tab : tabs) {
+ tab.initializeFrom(configuration);
}
}
@@ -102,8 +102,8 @@ public abstract class AbstractLaunchConfigurationTabGroup implements ILaunchConf
@Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
ILaunchConfigurationTab[] tabs = getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].performApply(configuration);
+ for (ILaunchConfigurationTab tab : tabs) {
+ tab.performApply(configuration);
}
}
@@ -120,8 +120,8 @@ public abstract class AbstractLaunchConfigurationTabGroup implements ILaunchConf
@Override
public void launched(ILaunch launch) {
ILaunchConfigurationTab[] tabs = getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].launched(launch);
+ for (ILaunchConfigurationTab tab : tabs) {
+ tab.launched(launch);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java
index aa98ff0e1..41dbb4a5e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java
@@ -401,8 +401,8 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
if (selection.length == 0) {
return new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
}
- for (int i = 0; i < selection.length; i++) {
- if (!(selection[i] instanceof IFile)) {
+ for (Object f : selection) {
+ if (!(f instanceof IFile)) {
return new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
}
}
@@ -621,11 +621,11 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
private String getDefaultSharedConfigLocation(ILaunchConfiguration config) {
String path = IInternalDebugCoreConstants.EMPTY_STRING;
try {
- IResource[] res = config.getMappedResources();
- if(res != null) {
+ IResource[] mappedResources = config.getMappedResources();
+ if(mappedResources != null) {
IProject proj;
- for (int i = 0; i < res.length; i++) {
- proj = res[i].getProject();
+ for (IResource resource : mappedResources) {
+ proj = resource.getProject();
if(proj != null && proj.isAccessible()) {
return proj.getFullPath().toOSString();
}
@@ -906,8 +906,8 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
// see if there are any changes
if (num == checked.length) {
boolean different = false;
- for (int i = 0; i < checked.length; i++) {
- if (!groups.contains(checked[i])) {
+ for (Object checked1 : checked) {
+ if (!groups.contains(checked1)) {
different = true;
break;
}
@@ -920,8 +920,8 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
config.setAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, (String)null);
config.setAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, (String)null);
List<String> groups = null;
- for (int i = 0; i < checked.length; i++) {
- LaunchGroupExtension group = (LaunchGroupExtension)checked[i];
+ for (Object c : checked) {
+ LaunchGroupExtension group = (LaunchGroupExtension) c;
if (groups == null) {
groups = new ArrayList<>();
}
@@ -1125,8 +1125,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
ILaunchGroup[] groups = DebugUITools.getLaunchGroups();
List<ILaunchGroup> possibleGroups = new ArrayList<>();
ILaunchConfiguration configuration = (ILaunchConfiguration)inputElement;
- for (int i = 0; i < groups.length; i++) {
- ILaunchGroup extension = groups[i];
+ for (ILaunchGroup extension : groups) {
LaunchHistory history = getLaunchConfigurationManager().getLaunchHistory(extension.getIdentifier());
if (history != null && history.accepts(configuration)) {
possibleGroups.add(extension);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java
index 886f32ef6..1f5a2675f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java
@@ -16,7 +16,6 @@ package org.eclipse.debug.ui;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
@@ -220,11 +219,9 @@ public class DebugUITools {
IExtensionPoint point= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.ID_DEBUG_MODEL_PRESENTATION);
if (point != null) {
IExtension[] extensions= point.getExtensions();
- for (int i= 0; i < extensions.length; i++) {
- IExtension extension= extensions[i];
+ for (IExtension extension : extensions) {
IConfigurationElement[] configElements= extension.getConfigurationElements();
- for (int j= 0; j < configElements.length; j++) {
- IConfigurationElement elt= configElements[j];
+ for (IConfigurationElement elt : configElements) {
String id= elt.getAttribute("id"); //$NON-NLS-1$
if (id != null && id.equals(identifier)) {
return new LazyModelPresentation(elt);
@@ -323,8 +320,8 @@ public class DebugUITools {
if (allowUndo) {
- for (int i= 0; i < markers.length; i++) {
- markers[i].setAttribute(DebugPlugin.ATTR_BREAKPOINT_IS_DELETED, true);
+ for (IMarker marker : markers) {
+ marker.setAttribute(DebugPlugin.ATTR_BREAKPOINT_IS_DELETED, true);
}
IAdaptable context= null;
@@ -537,8 +534,7 @@ public class DebugUITools {
@Deprecated
public static int openLaunchConfigurationDialog(Shell shell, IStructuredSelection selection, String mode) {
ILaunchGroup[] groups = getLaunchGroups();
- for (int i = 0; i < groups.length; i++) {
- ILaunchGroup group = groups[i];
+ for (ILaunchGroup group : groups) {
if (group.getMode().equals(mode) && group.getCategory() == null) {
return openLaunchConfigurationDialogOnGroup(shell, selection, group.getIdentifier());
}
@@ -859,8 +855,7 @@ public class DebugUITools {
try {
IResource[] configResource = iLaunch.getLaunchConfiguration().getMappedResources();
if (configResource != null && configResource.length == 1) {
- for (Iterator<Object> iter = fgLaunchToggleTerminateMap.keySet().iterator(); iter.hasNext();) {
- Object key = iter.next();
+ for (Object key : fgLaunchToggleTerminateMap.keySet()) {
if (key instanceof IEditorPart) {
IEditorInput input = ((IEditorPart) key).getEditorInput();
if (input.getAdapter(IResource.class).equals(configResource[0])) {
@@ -879,8 +874,7 @@ public class DebugUITools {
}
}
} else {
- for (Iterator<Object> iter = fgLaunchToggleTerminateMap.keySet().iterator(); iter.hasNext();) {
- Object key = iter.next();
+ for (Object key : fgLaunchToggleTerminateMap.keySet()) {
if (key instanceof IStructuredSelection) {
Object toggleValue = getToggleTerminateValue(key);
if (toggleValue instanceof TerminateToggleValue) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
index b83d7bbe5..d86750f7f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
@@ -608,8 +608,8 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
protected boolean addVariable(EnvironmentVariable variable) {
String name = variable.getName();
TableItem[] items = environmentTable.getTable().getItems();
- for (int i = 0; i < items.length; i++) {
- EnvironmentVariable existingVariable = (EnvironmentVariable) items[i].getData();
+ for (TableItem item : items) {
+ EnvironmentVariable existingVariable = (EnvironmentVariable) item.getData();
if (existingVariable.getName().equals(name)) {
boolean overWrite = MessageDialog.openQuestion(getShell(),
@@ -685,8 +685,8 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
// get Environment Variables from the table
TableItem[] items = environmentTable.getTable().getItems();
- for (int i = 0; i < items.length; i++) {
- EnvironmentVariable var = (EnvironmentVariable) items[i].getData();
+ for (TableItem item : items) {
+ EnvironmentVariable var = (EnvironmentVariable) item.getData();
envVariables.remove(var.getName());
}
@@ -696,8 +696,8 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
int button = dialog.open();
if (button == Window.OK) {
Object[] selected = dialog.getResult();
- for (int i = 0; i < selected.length; i++) {
- environmentTable.add(selected[i]);
+ for (Object o : selected) {
+ environmentTable.add(o);
}
}
@@ -883,8 +883,8 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
// configuration's attributes.
TableItem[] items = environmentTable.getTable().getItems();
Map<String, String> map = new HashMap<>(items.length);
- for (int i = 0; i < items.length; i++) {
- EnvironmentVariable var = (EnvironmentVariable) items[i].getData();
+ for (TableItem item : items) {
+ EnvironmentVariable var = (EnvironmentVariable) item.getData();
map.put(var.getName(), var.getValue());
}
if (map.isEmpty()) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java
index 8db2295f0..363df67de 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java
@@ -183,13 +183,13 @@ public class StringVariableSelectionDialog extends ElementListSelectionDialog {
ArrayList<Object> filtered = new ArrayList<>();
filtered.addAll(Arrays.asList(elements));
if(!fFilters.isEmpty() && !fShowAllSelected) {
- for (int i = 0; i < elements.length; i++) {
- if(elements[i] instanceof IDynamicVariable) {
+ for (Object element : elements) {
+ if (element instanceof IDynamicVariable) {
boolean bFiltered = false;
for (int j = 0; (j < fFilters.size()) && !bFiltered; j++) {
VariableFilter filter = fFilters.get(j);
- if(filter.isFiltered((IDynamicVariable)elements[i])) {
- filtered.remove(elements[i]);
+ if (filter.isFiltered((IDynamicVariable) element)) {
+ filtered.remove(element);
bFiltered = true;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java
index d0fc7c389..99d14350a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java
@@ -181,8 +181,8 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
*/
private boolean existsConfigTypesForMode() {
ILaunchConfigurationType[] configTypes = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes();
- for (int i = 0; i < configTypes.length; i++) {
- if (configTypes[i].supportsMode(getMode())) {
+ for (ILaunchConfigurationType configType : configTypes) {
+ if (configType.supportsMode(getMode())) {
return true;
}
}
@@ -314,8 +314,8 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
if (fRecreateMenu) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
+ for (MenuItem item : items) {
+ item.dispose();
}
fillMenu(m);
fRecreateMenu= false;
@@ -347,8 +347,7 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
// Add favorites
int accelerator = 1;
- for (int i = 0; i < favoriteList.length; i++) {
- ILaunchConfiguration launch= favoriteList[i];
+ for (ILaunchConfiguration launch : favoriteList) {
LaunchAction action= new LaunchAction(launch, getMode());
addToMenu(menu, action, accelerator);
accelerator++;
@@ -360,8 +359,7 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
}
// Add history launches next
- for (int i = 0; i < historyList.length; i++) {
- ILaunchConfiguration launch= historyList[i];
+ for (ILaunchConfiguration launch : historyList) {
LaunchAction action= new LaunchAction(launch, getMode());
addToMenu(menu, action, accelerator);
accelerator++;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java
index 30eba5386..2abcd920a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java
@@ -118,8 +118,8 @@ public class AddMemoryRenderingActionDelegate extends Action implements IViewAct
public void menuShown(MenuEvent e) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
+ for (MenuItem item : items) {
+ item.dispose();
}
fillMenu(m);
}
@@ -133,9 +133,8 @@ public class AddMemoryRenderingActionDelegate extends Action implements IViewAct
{
IMemoryRenderingType[] types = fActionDelegate.getMemoryRenderingTypes(fPart, fCurrentSelection);
- for (int i=0; i<types.length; i++)
- {
- AddMemoryRenderingAction action = new AddMemoryRenderingAction(types[i]);
+ for (IMemoryRenderingType type : types) {
+ AddMemoryRenderingAction action = new AddMemoryRenderingAction(type);
ActionContributionItem item = new ActionContributionItem(action);
item.fill(parent, -1);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java
index a763267c5..f3a9da714 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java
@@ -86,8 +86,7 @@ public abstract class ContextualLaunchAction implements IObjectActionDelegate, I
fMode = mode;
ILaunchGroup[] groups = DebugUITools.getLaunchGroups();
fGroupsByCategory = new HashMap<>(3);
- for (int i = 0; i < groups.length; i++) {
- ILaunchGroup group = groups[i];
+ for (ILaunchGroup group : groups) {
if (group.getMode().equals(mode)) {
if (group.getCategory() == null) {
fGroup = group;
@@ -132,8 +131,8 @@ public abstract class ContextualLaunchAction implements IObjectActionDelegate, I
if (fFillMenu) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
+ for (MenuItem item : items) {
+ item.dispose();
}
fillMenu(m);
fFillMenu = false;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ExportBreakpointsOperation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ExportBreakpointsOperation.java
index 9d26718bf..80c9e5f17 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ExportBreakpointsOperation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ExportBreakpointsOperation.java
@@ -90,11 +90,10 @@ public class ExportBreakpointsOperation implements IRunnableWithProgress {
SubMonitor localmonitor = SubMonitor.convert(monitor, ImportExportMessages.ExportOperation_0, fBreakpoints.length);
XMLMemento memento = XMLMemento.createWriteRoot(IImportExportConstants.IE_NODE_BREAKPOINTS);
try (Writer writer = fWriter) {
- for (int i = 0; i < fBreakpoints.length; i++) {
+ for (IBreakpoint breakpoint : fBreakpoints) {
if (localmonitor.isCanceled()) {
return;
}
- IBreakpoint breakpoint = fBreakpoints[i];
//in the event we are in working set view, we can have multiple selection of the same breakpoint
//so do a simple check for it
IMarker marker = breakpoint.getMarker();
@@ -170,10 +169,9 @@ public class ExportBreakpointsOperation implements IRunnableWithProgress {
IWorkingSetManager mgr = PlatformUI.getWorkbench().getWorkingSetManager();
StringBuilder buffer = new StringBuilder();
IWorkingSet[] sets = mgr.getWorkingSets();
- for (int i = 0; i < sets.length; i++) {
- if(IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(sets[i].getId()) &&
- containsBreakpoint(sets[i], breakpoint)) {
- buffer.append(IImportExportConstants.DELIMITER).append(sets[i].getName());
+ for (IWorkingSet set : sets) {
+ if (IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(set.getId()) && containsBreakpoint(set, breakpoint)) {
+ buffer.append(IImportExportConstants.DELIMITER).append(set.getName());
}
}
return buffer.toString();
@@ -188,8 +186,8 @@ public class ExportBreakpointsOperation implements IRunnableWithProgress {
*/
private boolean containsBreakpoint(IWorkingSet set, IBreakpoint breakpoint) {
IAdaptable[] elements = set.getElements();
- for (int i = 0; i < elements.length; i++) {
- if (elements[i].equals(breakpoint)) {
+ for (IAdaptable element : elements) {
+ if (element.equals(breakpoint)) {
return true;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java
index 945cc6422..f303b059d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java
@@ -183,11 +183,11 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
localmonitor.setWorkRemaining(nodes.length);
Map<String, Object> attributes = null;
IBreakpointImportParticipant[] participants = null;
- for(int i = 0; i < nodes.length; i++) {
+ for (IMemento node : nodes) {
if(localmonitor.isCanceled()) {
return;
}
- attributes = collectBreakpointProperties(nodes[i]);
+ attributes = collectBreakpointProperties(node);
if(attributes == null) {
continue;
}
@@ -197,7 +197,6 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
} else {
resource = workspace;
}
-
// filter resource breakpoints that do not exist in this workspace
if(resource != null) {
try {
@@ -245,14 +244,13 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
*/
protected IMarker findExistingMarker(Map<String, Object> attributes, IBreakpointImportParticipant[] participants) {
IBreakpoint[] bps = fManager.getBreakpoints();
- for(int i = 0; i < bps.length; i++) {
- for(int j = 0; j < participants.length; j++) {
+ for (IBreakpoint bp : bps) {
+ for (IBreakpointImportParticipant participant : participants) {
try {
- if(participants[j].matches(attributes, bps[i])) {
- return bps[i].getMarker();
+ if (participant.matches(attributes, bp)) {
+ return bp.getMarker();
}
- }
- catch(CoreException ce) {}
+ }catch(CoreException ce) {}
}
}
return null;
@@ -285,8 +283,8 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
//copy all the marker attributes to the map
IMemento[] children = child.getChildren(IImportExportConstants.IE_NODE_ATTRIB);
- for(int i = 0; i < children.length; i++) {
- readAttribute(children[i], map);
+ for (IMemento c : children) {
+ readAttribute(c, map);
}
//collect attributes from the 'resource' node
@@ -349,8 +347,8 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
updateWorkingSets(names, breakpoint);
}
if(participants != null) {
- for(int i = 0; i < participants.length; i++) {
- participants[i].verify(breakpoint);
+ for (IBreakpointImportParticipant participant : participants) {
+ participant.verify(breakpoint);
}
}
}
@@ -376,14 +374,14 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
IWorkingSetManager mgr = PlatformUI.getWorkbench().getWorkingSetManager();
ArrayList<IWorkingSet> sets = new ArrayList<>();
collectContainingWorkingsets(breakpoint, sets);
- for (int i = 0; i < wsnames.length; i++) {
- if("".equals(wsnames[i])) { //$NON-NLS-1$
+ for (String wsname : wsnames) {
+ if ("".equals(wsname)) { //$NON-NLS-1$
continue;
}
- IWorkingSet set = mgr.getWorkingSet(wsnames[i]);
- if(set == null) {
+ IWorkingSet set = mgr.getWorkingSet(wsname);
+ if (set == null) {
//create working set
- set = mgr.createWorkingSet(wsnames[i], new IAdaptable[] {});
+ set = mgr.createWorkingSet(wsname, new IAdaptable[] {});
set.setId(IDebugUIConstants.BREAKPOINT_WORKINGSET_ID);
mgr.addWorkingSet(set);
}
@@ -416,10 +414,9 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
private void collectContainingWorkingsets(IBreakpoint breakpoint, List<IWorkingSet> collector) {
IWorkingSetManager mgr = PlatformUI.getWorkbench().getWorkingSetManager();
IWorkingSet[] sets = mgr.getWorkingSets();
- for (int i = 0; i < sets.length; i++) {
- if(IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(sets[i].getId()) &&
- containsBreakpoint(sets[i], breakpoint)) {
- collector.add(sets[i]);
+ for (IWorkingSet set : sets) {
+ if (IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(set.getId()) && containsBreakpoint(set, breakpoint)) {
+ collector.add(set);
}
}
}
@@ -432,8 +429,8 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
*/
private boolean containsBreakpoint(IWorkingSet set, IBreakpoint breakpoint) {
IAdaptable[] elements = set.getElements();
- for (int i = 0; i < elements.length; i++) {
- if (elements[i].equals(breakpoint)) {
+ for (IAdaptable element : elements) {
+ if (element.equals(breakpoint)) {
return true;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAction.java
index 1e010a204..db8d2812f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAction.java
@@ -143,12 +143,12 @@ public class LaunchAction extends Action {
*/
private void removeFromLaunchHistories(ILaunchConfiguration config, ILaunchGroup[] groups) {
LaunchHistory history = null;
- for(int i = 0; i < groups.length; i++) {
- history = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchHistory(groups[i].getIdentifier());
- if(history != null) {
+ for (ILaunchGroup group : groups) {
+ history = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchHistory(group.getIdentifier());
+ if (history != null) {
history.removeFromHistory(fConfiguration);
} else {
- DebugUIPlugin.logErrorMessage(MessageFormat.format("Unable to remove configuration [{0}] from launch history. The launch history for mode [{1}] does not exist.", new Object[] { config.getName(), groups[i].getMode() })); //$NON-NLS-1$
+ DebugUIPlugin.logErrorMessage(MessageFormat.format("Unable to remove configuration [{0}] from launch history. The launch history for mode [{1}] does not exist.", new Object[]{config.getName(), group.getMode()})); //$NON-NLS-1$
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java
index b0d800b58..082b7c817 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java
@@ -182,8 +182,8 @@ public class LaunchAsAction extends Action implements IMenuCreator, IWorkbenchWi
public void menuShown(MenuEvent e) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
+ for (MenuItem item : items) {
+ item.dispose();
}
fillMenu();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java
index 17dcd129a..dd9b6994c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java
@@ -275,8 +275,8 @@ public class LaunchShortcutsAction extends Action implements IMenuCreator, IWork
public void menuShown(MenuEvent e) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
+ for (MenuItem item : items) {
+ item.dispose();
}
fillMenu();
}
@@ -335,8 +335,7 @@ public class LaunchShortcutsAction extends Action implements IMenuCreator, IWork
*/
private boolean existsConfigTypesForMode() {
ILaunchConfigurationType[] configTypes = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes();
- for (int i = 0; i < configTypes.length; i++) {
- ILaunchConfigurationType configType = configTypes[i];
+ for (ILaunchConfigurationType configType : configTypes) {
if (configType.supportsMode(getMode())) {
return true;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java
index 9eabdfa9b..2299dadbe 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java
@@ -115,8 +115,7 @@ public class OpenLaunchDialogAction extends Action implements IActionDelegate2,
*/
private boolean existsConfigTypesForMode() {
ILaunchConfigurationType[] configTypes = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes();
- for (int i = 0; i < configTypes.length; i++) {
- ILaunchConfigurationType configType = configTypes[i];
+ for (ILaunchConfigurationType configType : configTypes) {
if (configType.supportsMode(getMode())) {
return true;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RelaunchLastAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RelaunchLastAction.java
index 14ec2c03e..d94ec214d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RelaunchLastAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RelaunchLastAction.java
@@ -195,8 +195,7 @@ public abstract class RelaunchLastAction implements IWorkbenchWindowActionDelega
*/
private boolean existsConfigTypesForMode() {
ILaunchConfigurationType[] configTypes = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes();
- for (int i = 0; i < configTypes.length; i++) {
- ILaunchConfigurationType configType = configTypes[i];
+ for (ILaunchConfigurationType configType : configTypes) {
if (configType.supportsMode(getMode())) {
return true;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java
index 122dab8e1..6d96bedb6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java
@@ -1450,17 +1450,15 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
// clean up old columns
TableColumn[] oldColumns = fTableViewer.getTable().getColumns();
- for (int i=0; i<oldColumns.length; i++)
- {
- oldColumns[i].dispose();
+ for (TableColumn oldColumn : oldColumns) {
+ oldColumn.dispose();
}
// clean up old cell editors
CellEditor[] oldCellEditors = fTableViewer.getCellEditors();
- for (int i=0; i<oldCellEditors.length; i++)
- {
- oldCellEditors[i].dispose();
+ for (CellEditor oldCellEditor : oldCellEditors) {
+ oldCellEditor.dispose();
}
}
@@ -2377,9 +2375,8 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
fTableCursor = null;
// clean up cell editors
- for (int i=0; i<fEditors.length; i++)
- {
- fEditors[i].dispose();
+ for (CellEditor editor : fEditors) {
+ editor.dispose();
}
// remove font change listener when the view tab is disposed
@@ -2751,9 +2748,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
int colNum = -1;
int numCol = fTableViewer.getColumnProperties().length;
- for (int j=0; j<tableItems.length; j++)
- {
- TableItem item = tableItems[j];
+ for (TableItem item : tableItems) {
for (int i=0; i<numCol; i++)
{
Rectangle bound = item.getBounds(i);
@@ -3350,9 +3345,8 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
// check each of the items and find the minimum
TableItem[] items = table.getItems();
int minHeight = table.getItemHeight();
- for (int i=0; i<items.length; i++)
- {
- minHeight = Math.min(items[i].getBounds(0).height, minHeight);
+ for (TableItem item : items) {
+ minHeight = Math.min(item.getBounds(0).height, minHeight);
}
return minHeight;
@@ -3676,14 +3670,12 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
private TableItem getItem(Point point)
{
TableItem[] items = fTableViewer.getTable().getItems();
- for (int i=0; i<items.length; i++)
- {
- Point start = new Point(items[i].getBounds(0).x, items[i].getBounds(0).y);
+ for (TableItem item : items) {
+ Point start = new Point(item.getBounds(0).x, item.getBounds(0).y);
start = fTableViewer.getTable().toDisplay(start);
- Point end = new Point(start.x + items[i].getBounds(0).width, start.y + items[i].getBounds(0).height);
-
+ Point end = new Point(start.x + item.getBounds(0).width, start.y + item.getBounds(0).height);
if (start.y < point.y && point.y < end.y) {
- return items[i];
+ return item;
}
}
return null;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java
index e718db992..709dd4758 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java
@@ -269,8 +269,7 @@ public class CommonSourceNotFoundEditor extends EditorPart implements IReusableE
Object artifact = getArtifact();
if (artifact instanceof IDebugElement) {
IDebugElement element = (IDebugElement)artifact;
- for (int i = 0; i < launches.length; i++) {
- ILaunch launch = launches[i];
+ for (ILaunch launch : launches) {
if (launch.equals(element.getLaunch())) {
closeEditor();
return;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java
index 722cef429..0a0425397 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java
@@ -86,18 +86,17 @@ public class WorkingSetSourceContainer extends CompositeSourceContainer{
}
ArrayList<ISourceContainer> locationList = new ArrayList<>();
- for (int i = 0; i < elements.length; i++) {
- IResource resource = elements[i].getAdapter(IResource.class);
-
+ for (IAdaptable element : elements) {
+ IResource resource = element.getAdapter(IResource.class);
if (resource != null) {
switch (resource.getType()) {
- case IResource.FOLDER:
- locationList.add(new FolderSourceContainer((IFolder)resource, true));
- break;
- case IResource.PROJECT:
- locationList.add(new ProjectSourceContainer((IProject)resource, true));
- break;
- //if the element corresponds to an IFile, do nothing
+ case IResource.FOLDER:
+ locationList.add(new FolderSourceContainer((IFolder)resource, true));
+ break;
+ case IResource.PROJECT:
+ locationList.add(new ProjectSourceContainer((IProject)resource, true));
+ break;
+ //if the element corresponds to an IFile, do nothing
default:
break;
}

Back to the top