Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2020-07-29 09:23:02 +0000
committerLars Vogel2020-08-06 06:21:09 +0000
commit2814fd1092deee3787cb7da5aec403df500f02bc (patch)
tree491d6f7ed926055181a284092a20beffad539512
parentf7efa5595fa9df6b1a703d5a0bdb165a7a2b9093 (diff)
downloadeclipse.platform.team-Y20200903-2210.tar.gz
eclipse.platform.team-Y20200903-2210.tar.xz
eclipse.platform.team-Y20200903-2210.zip
Done via JDT clean-up action and manual fix for indentation in ResourceModelContentProvider Change-Id: I4bc1a3913a1e4e71fe9093724c64bef76454f960 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfoTree.java7
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/FileContentManager.java5
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/PathTree.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelElementSelectionPage.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/RemoveFromViewAction.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceDragAdapterAssistant.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelContentProvider.java6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelParticipantAction.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java12
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureSynchronizeScheduleComposite.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshChangeListener.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/CopyToClipboardAction.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/DirectionFilterActionGroup.java17
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveSynchronizeParticipantAction.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetMainPage.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java4
19 files changed, 39 insertions, 67 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfoTree.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfoTree.java
index 37ee0c489..4e7161004 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfoTree.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfoTree.java
@@ -17,7 +17,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -311,8 +310,7 @@ public class SyncInfoTree extends SyncInfoSet {
private synchronized IResource[] internalMembers(IWorkspaceRoot root) {
Set possibleChildren = parents.keySet();
Set<IResource> children = new HashSet<>();
- for (Iterator it = possibleChildren.iterator(); it.hasNext();) {
- Object next = it.next();
+ for (Object next : possibleChildren) {
IResource element = root.findMember((IPath)next);
if (element != null) {
children.add(element.getProject());
@@ -339,8 +337,7 @@ public class SyncInfoTree extends SyncInfoSet {
IPath path = parent.getFullPath();
Set possibleChildren = parents.get(path);
if(possibleChildren != null) {
- for (Iterator it = possibleChildren.iterator(); it.hasNext();) {
- Object next = it.next();
+ for (Object next : possibleChildren) {
IResource element = (IResource)next;
IPath childPath = element.getFullPath();
IResource modelObject = null;
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/FileContentManager.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/FileContentManager.java
index 4c7dd374f..6063fd593 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/FileContentManager.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/FileContentManager.java
@@ -21,7 +21,6 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
@@ -258,8 +257,8 @@ public class FileContentManager implements IFileContentManager {
private static IStringMapping [] getStringMappings(Map map) {
final IStringMapping [] result= new IStringMapping [map.size()];
int index= 0;
- for (final Iterator iter = map.entrySet().iterator(); iter.hasNext();) {
- final Map.Entry entry= (Map.Entry)iter.next();
+ for (Object element : map.entrySet()) {
+ final Map.Entry entry= (Map.Entry)element;
result[index++]= new StringMapping((String)entry.getKey(), ((Integer)entry.getValue()).intValue());
}
return result;
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/PathTree.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/PathTree.java
index 67ff59302..e119fd3be 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/PathTree.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/PathTree.java
@@ -17,7 +17,6 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -153,8 +152,7 @@ public class PathTree {
if (node != null) {
Set possibleChildren = node.descendantsWithPayload;
if(possibleChildren != null) {
- for (Iterator it = possibleChildren.iterator(); it.hasNext();) {
- Object next = it.next();
+ for (Object next : possibleChildren) {
IPath descendantPath = (IPath)next;
IPath childPath = null;
if(descendantPath.segmentCount() == (path.segmentCount() + 1)) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
index 2019b9ea2..2c4ceb2b2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
@@ -21,7 +21,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
@@ -708,8 +707,7 @@ public class Utils {
* descendants match the given filter
*/
public static boolean hasMatchingDescendant(IStructuredSelection selection, FastSyncInfoFilter filter) {
- for (Iterator iter = selection.iterator(); iter.hasNext();) {
- Object o = iter.next();
+ for (Object o : selection) {
if (o instanceof ISynchronizeModelElement) {
if (hasMatchingDescendant((ISynchronizeModelElement)o, filter)) {
return true;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelElementSelectionPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelElementSelectionPage.java
index b900c194a..f663816c6 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelElementSelectionPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ModelElementSelectionPage.java
@@ -16,7 +16,6 @@ package org.eclipse.team.internal.ui.mapping;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.core.resources.IResource;
@@ -177,8 +176,7 @@ public class ModelElementSelectionPage extends GlobalRefreshElementSelectionPage
private Collection<Object> computeSelectedResources(StructuredSelection selection) {
List<Object> result = new ArrayList<>();
- for (Iterator iter = selection.iterator(); iter.hasNext();) {
- Object element = iter.next();
+ for (Object element : selection) {
ResourceMapping mapping = Utils.getResourceMapping(element);
if (mapping != null && scopeContainsMapping(mapping)) {
result.add(element);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/RemoveFromViewAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/RemoveFromViewAction.java
index 1bac330f9..41ae3d3df 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/RemoveFromViewAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/RemoveFromViewAction.java
@@ -15,7 +15,6 @@ package org.eclipse.team.internal.ui.mapping;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.core.resources.IResource;
@@ -115,8 +114,7 @@ public class RemoveFromViewAction extends ResourceModelParticipantAction {
// Only enable if the selected elements adapt to IResource
if (selection.isEmpty())
return false;
- for (Iterator iter = selection.iterator(); iter.hasNext();) {
- Object element = iter.next();
+ for (Object element : selection) {
if (Utils.getResource(element) == null) {
return false;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceDragAdapterAssistant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceDragAdapterAssistant.java
index 32d0476f1..67bb7d2af 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceDragAdapterAssistant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceDragAdapterAssistant.java
@@ -14,7 +14,6 @@
******************************************************************************/
package org.eclipse.team.internal.ui.mapping;
-import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
@@ -100,8 +99,7 @@ public class ResourceDragAdapterAssistant extends CommonDragAdapterAssistant {
private IResource[] getSelectedResources(IStructuredSelection aSelection) {
Set<IResource> resources = new LinkedHashSet<>();
IResource resource = null;
- for (Iterator iter = aSelection.iterator(); iter.hasNext();) {
- Object selected = iter.next();
+ for (Object selected : aSelection) {
resource = adaptToResource(selected);
if (resource != null) {
resources.add(resource);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelContentProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelContentProvider.java
index f7fd2ad60..99cbff4ab 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelContentProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelContentProvider.java
@@ -16,7 +16,6 @@ package org.eclipse.team.internal.ui.mapping;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -559,9 +558,8 @@ public class ResourceModelContentProvider extends SynchronizationContentProvider
result.add(resource);
} else {
// We need to check the list of displayed resources to see if one matches the given path
- for (Iterator iterator = existingResources.iterator(); iterator
- .hasNext();) {
- resource = (IResource) iterator.next();
+ for (Object element : existingResources) {
+ resource = (IResource) element;
if (resource.getFullPath().equals(path)) {
result.add(resource);
break;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelParticipantAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelParticipantAction.java
index 2f503e029..085af140c 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelParticipantAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelParticipantAction.java
@@ -14,7 +14,6 @@
package org.eclipse.team.internal.ui.mapping;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Set;
import org.eclipse.core.resources.IResource;
@@ -60,8 +59,7 @@ public abstract class ResourceModelParticipantAction extends ModelParticipantAct
traversal.addTraversals(traversals);
}
} else {
- for (Iterator iter = selection.iterator(); iter.hasNext();) {
- Object element = iter.next();
+ for (Object element : selection) {
ResourceTraversal[] traversals = getTraversals(element, Policy.subMonitorFor(monitor, 100));
traversal.addTraversals(traversals);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java
index 1cb44fa18..bcb9901b9 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java
@@ -269,8 +269,8 @@ public class TextPreferencePage extends PreferencePage implements IWorkbenchPref
private static int [] integerListToIntArray(List integers) {
final int [] array= new int [integers.size()];
int index= 0;
- for (Iterator iter = integers.iterator(); iter.hasNext();)
- array[index++]= ((Integer)iter.next()).intValue();
+ for (Object element : integers)
+ array[index++]= ((Integer)element).intValue();
return array;
}
@@ -331,8 +331,8 @@ public class TextPreferencePage extends PreferencePage implements IWorkbenchPref
if (selection == null)
return;
- for (final Iterator it = selection.iterator(); it.hasNext(); ) {
- final FileTypeTable.Item item= (FileTypeTable.Item)it.next();
+ for (Object element : selection) {
+ final FileTypeTable.Item item= (FileTypeTable.Item)element;
if (item.contributed)
continue;
fItems.remove(item);
@@ -348,8 +348,8 @@ public class TextPreferencePage extends PreferencePage implements IWorkbenchPref
if (selection == null)
return;
- for (final Iterator it = selection.iterator(); it.hasNext(); ) {
- final FileTypeTable.Item item= (FileTypeTable.Item)it.next();
+ for (Object element : selection) {
+ final FileTypeTable.Item item= (FileTypeTable.Item)element;
item.mode= item.mode == Team.TEXT ? Team.BINARY : Team.TEXT;
fTable.getViewer().refresh(item);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java
index bb350d1e7..9eb6b6fa2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java
@@ -16,7 +16,6 @@ package org.eclipse.team.internal.ui.synchronize;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -515,8 +514,8 @@ public abstract class AbstractSynchronizeModelProvider implements ISynchronizeMo
return new IResource[0];
IContainer container = ResourcesPlugin.getWorkspace().getRoot();
ArrayList<IResource> resources = new ArrayList<>();
- for (Iterator it = paths.iterator(); it.hasNext();) {
- String path = (String) it.next();
+ for (Object path2 : paths) {
+ String path = (String) path2;
IResource resource = getResourceForPath(container, path);
if (resource != null) {
resources.add(resource);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureSynchronizeScheduleComposite.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureSynchronizeScheduleComposite.java
index 5b21f7a8a..da1c052ca 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureSynchronizeScheduleComposite.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureSynchronizeScheduleComposite.java
@@ -155,8 +155,8 @@ public class ConfigureSynchronizeScheduleComposite extends Composite {
String string = e.text;
char[] chars = new char[string.length()];
string.getChars(0, chars.length, chars, 0);
- for (int i = 0; i < chars.length; i++) {
- if (!('0' <= chars[i] && chars[i] <= '9')) {
+ for (char element : chars) {
+ if (!('0' <= element && element <= '9')) {
e.doit = false;
return;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshChangeListener.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshChangeListener.java
index b48b1fe68..e4426e714 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshChangeListener.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshChangeListener.java
@@ -14,7 +14,6 @@
package org.eclipse.team.internal.ui.synchronize;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.core.resources.IResource;
@@ -45,8 +44,8 @@ public class RefreshChangeListener implements ISubscriberChangeListener, IChange
public SyncInfo[] getChanges() {
List changedSyncInfos = new ArrayList();
SyncInfoSet set = collector.getSyncInfoSet();
- for (Iterator it = changes.iterator(); it.hasNext();) {
- ISubscriberChangeEvent delta = (ISubscriberChangeEvent) it.next();
+ for (Object change : changes) {
+ ISubscriberChangeEvent delta = (ISubscriberChangeEvent) change;
SyncInfo info = set.getSyncInfo(delta.getResource());
if (info != null && interestingChange(info)) {
changedSyncInfos.add(info);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/CopyToClipboardAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/CopyToClipboardAction.java
index f87077178..f70ecfb4a 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/CopyToClipboardAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/CopyToClipboardAction.java
@@ -99,8 +99,7 @@ class CopyToClipboardAction extends SelectionListenerAction {
}
}
} else {
- for (Iterator it = structuredSelection.iterator(); it.hasNext();) {
- Object element = it.next();
+ for (Object element : structuredSelection) {
if (element instanceof ITypedElement) {
if (i > 0)
buf.append(EOL);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/DirectionFilterActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/DirectionFilterActionGroup.java
index 864bbbf88..3aed1da86 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/DirectionFilterActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/DirectionFilterActionGroup.java
@@ -14,7 +14,6 @@
package org.eclipse.team.internal.ui.synchronize.actions;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.jface.action.Action;
@@ -143,8 +142,8 @@ public class DirectionFilterActionGroup extends ActionGroup implements IProperty
public void fillActionBars(IActionBars actionBars, String group) {
super.fillActionBars(actionBars);
IToolBarManager toolBar = actionBars.getToolBarManager();
- for (Iterator it = actions.iterator(); it.hasNext();) {
- DirectionFilterAction action = (DirectionFilterAction) it.next();
+ for (Object action2 : actions) {
+ DirectionFilterAction action = (DirectionFilterAction) action2;
if(group != null) {
toolBar.appendToGroup(group, action);
} else {
@@ -154,22 +153,22 @@ public class DirectionFilterActionGroup extends ActionGroup implements IProperty
}
public void fillToolBar(String groupId, IToolBarManager toolBar) {
- for (Iterator it = actions.iterator(); it.hasNext();) {
- DirectionFilterAction action = (DirectionFilterAction) it.next();
+ for (Object action2 : actions) {
+ DirectionFilterAction action = (DirectionFilterAction) action2;
toolBar.appendToGroup(groupId, action);
}
}
public void fillMenu(IContributionManager manager) {
- for (Iterator it = actions.iterator(); it.hasNext();) {
- DirectionFilterAction action = (DirectionFilterAction) it.next();
+ for (Object action2 : actions) {
+ DirectionFilterAction action = (DirectionFilterAction) action2;
manager.add(action);
}
}
private void checkMode(int mode) {
- for (Iterator it = actions.iterator(); it.hasNext();) {
- DirectionFilterAction action = (DirectionFilterAction)it.next();
+ for (Object action2 : actions) {
+ DirectionFilterAction action = (DirectionFilterAction)action2;
if(action.getModeId() == mode) {
action.setChecked(true);
} else {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java
index 366b2f6a3..b31aab2a1 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java
@@ -14,7 +14,6 @@
package org.eclipse.team.internal.ui.synchronize.actions;
import java.lang.reflect.InvocationTargetException;
-import java.util.Iterator;
import org.eclipse.compare.CompareEditorInput;
import org.eclipse.compare.CompareUI;
@@ -71,8 +70,7 @@ public class OpenInCompareAction extends Action {
return;
boolean reuseEditorIfPossible = ((IStructuredSelection) selection).size()==1;
- for (Iterator iterator = ((IStructuredSelection) selection).iterator(); iterator.hasNext();) {
- Object obj = iterator.next();
+ for (Object obj : ((IStructuredSelection) selection)) {
if (obj instanceof SyncInfoModelElement) {
SyncInfo info = ((SyncInfoModelElement) obj).getSyncInfo();
if (info != null) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveSynchronizeParticipantAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveSynchronizeParticipantAction.java
index 7ef260056..bc358d972 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveSynchronizeParticipantAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveSynchronizeParticipantAction.java
@@ -16,7 +16,6 @@ package org.eclipse.team.internal.ui.synchronize.actions;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
@@ -182,8 +181,8 @@ public class RemoveSynchronizeParticipantAction extends Action {
final List finalModels = dirtyModels;
IRunnableWithProgress progressOp = monitor -> {
monitor.beginTask(null, finalModels.size());
- for (Iterator i = finalModels.iterator(); i.hasNext();) {
- Saveable model = (Saveable) i.next();
+ for (Object finalModel : finalModels) {
+ Saveable model = (Saveable) finalModel;
if (model.isDirty()) {
try {
model.doSave(SubMonitor.convert(monitor, 1));
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetMainPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetMainPage.java
index e894e4483..d2ace141c 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetMainPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetMainPage.java
@@ -18,7 +18,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -153,8 +152,8 @@ public class ExportProjectSetMainPage extends TeamWizardPage {
} else if (inputElement instanceof HashSet){
Set<IProject> tempList = new HashSet<>();
HashSet inputElementSet = (HashSet) inputElement;
- for (Iterator iterator = inputElementSet.iterator(); iterator.hasNext();) {
- IProject[] projects = getProjectsForObject(iterator.next());
+ for (Object element : inputElementSet) {
+ IProject[] projects = getProjectsForObject(element);
if (projects != null)
tempList.addAll(Arrays.asList(projects));
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java
index de5f8c35e..0a077550b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java
@@ -15,7 +15,6 @@ package org.eclipse.team.ui.synchronize;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -340,8 +339,7 @@ public abstract class SynchronizePageActionGroup extends ActionGroup {
for (String groupId : groups.keySet()) {
List actions = groups.get(groupId);
if (actions != null) {
- for (Iterator iter2 = actions.iterator(); iter2.hasNext();) {
- Object element = iter2.next();
+ for (Object element : actions) {
if (element instanceof IAction) {
// Call the internal method to avoid registering the action
// as a global handler since it would have been registered

Back to the top