Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java4
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ProjectUtil.java20
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/DisconnectProviderOperation.java17
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryFinder.java3
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/RepoRemoteBranchesPage.java4
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java3
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CompareActionsTest.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java8
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/DecorationOverlayDescriptor.java8
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/SWTUtils.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/SaveFilter.java20
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateGeneralProjectPage.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java10
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/CachedCheckboxTreeViewer.java10
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/importing/GitScmUrlImportWizardPage.java18
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/GitDecoratorPreferencePage.java16
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryStatisticsPage.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/sharing/ExistingOrNewPage.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/FixedJFaceToolTip.java12
20 files changed, 87 insertions, 90 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java
index da5f304e0..c6e1197a6 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java
@@ -51,8 +51,8 @@ public final class GitProjectSetCapability extends ProjectSetCapability {
ProjectSetSerializationContext context, IProgressMonitor monitor)
throws TeamException {
List<String> references = new ArrayList<>(projects.length);
- for (int i = 0; i < projects.length; i++) {
- String reference = asReference(projects[i]);
+ for (IProject project : projects) {
+ String reference = asReference(project);
if(reference != null){
references.add(reference);
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ProjectUtil.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ProjectUtil.java
index f74896039..3c278cce0 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ProjectUtil.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ProjectUtil.java
@@ -482,8 +482,7 @@ public class ProjectUtil {
// first look for project description files
boolean foundProject = false;
final String dotProject = IProjectDescription.DESCRIPTION_FILE_NAME;
- for (int i = 0; i < contents.length; i++) {
- File file = contents[i];
+ for (File file : contents) {
if (file.isFile() && file.getName().equals(dotProject)) {
files.add(file);
foundProject = true;
@@ -491,20 +490,23 @@ public class ProjectUtil {
}
if (foundProject && !searchNested)
return true;
- // recurse into sub-directories (even when project was found above, for nested projects)
- for (int i = 0; i < contents.length; i++) {
+ // recurse into sub-directories (even when project was found above, for
+ // nested projects)
+ for (File content : contents) {
// Skip non-directories
- if (!contents[i].isDirectory())
+ if (!content.isDirectory()) {
continue;
+ }
// Skip .metadata folders
- if (contents[i].getName().equals(METADATA_FOLDER))
+ if (content.getName().equals(METADATA_FOLDER)) {
continue;
- String path = contents[i].getAbsolutePath();
+ }
+ String path = content.getAbsolutePath();
if (!directoriesVisited.add(path))
// already been here --> do not recurse
continue;
- findProjectFiles(files, contents[i], searchNested,
- directoriesVisited, pm);
+ findProjectFiles(files, content, searchNested, directoriesVisited,
+ pm);
}
return true;
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/DisconnectProviderOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/DisconnectProviderOperation.java
index 47a624a5f..354b5842a 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/DisconnectProviderOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/DisconnectProviderOperation.java
@@ -74,17 +74,16 @@ public class DisconnectProviderOperation implements IEGitOperation {
final IResource[] c;
c = p.members(IContainer.INCLUDE_TEAM_PRIVATE_MEMBERS);
if (c != null) {
- for (int k = 0; k < c.length; k++) {
- if (c[k] instanceof IContainer) {
- unmarkTeamPrivate((IContainer) c[k]);
+ for (IResource container : c) {
+ if (container instanceof IContainer) {
+ unmarkTeamPrivate((IContainer) container);
}
- if (c[k].isTeamPrivateMember()) {
+ if (container.isTeamPrivateMember()) {
// TODO is this the right location?
- if (GitTraceLocation.CORE.isActive())
- GitTraceLocation.getTrace().trace(
- GitTraceLocation.CORE.getLocation(),
- "notTeamPrivate " + c[k]); //$NON-NLS-1$
- c[k].setTeamPrivateMember(false);
+ if (GitTraceLocation.CORE.isActive()) {
+ GitTraceLocation.getTrace().trace(GitTraceLocation.CORE.getLocation(), "notTeamPrivate " + container); //$NON-NLS-1$
+ }
+ container.setTeamPrivateMember(false);
}
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryFinder.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryFinder.java
index 99ef8e984..bbc877661 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryFinder.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryFinder.java
@@ -156,8 +156,7 @@ public class RepositoryFinder {
final IResource[] children = c.members();
if (children != null && children.length > 0) {
progress.setWorkRemaining(children.length);
- for (int k = 0; k < children.length; k++) {
- final IResource o = children[k];
+ for (IResource o : children) {
if (o instanceof IContainer
&& !o.getName().equals(Constants.DOT_GIT)) {
find(progress.newChild(1), (IContainer) o,
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/RepoRemoteBranchesPage.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/RepoRemoteBranchesPage.java
index 35e57beb3..a0c87bdbe 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/RepoRemoteBranchesPage.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/RepoRemoteBranchesPage.java
@@ -54,8 +54,8 @@ public class RepoRemoteBranchesPage {
bot.waitUntil(widgetIsEnabled(tree), 60000);
SWTBotTreeItem[] items = tree.getAllItems();
- for (int i = 0; i < items.length; i++) {
- items[i].uncheck();
+ for (SWTBotTreeItem item : items) {
+ item.uncheck();
}
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
index a586299bc..d65c7d503 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
@@ -830,8 +830,7 @@ public class TestUtil {
for (IWorkbenchWindow window : windows) {
IWorkbenchPage workbenchPage = window.getActivePage();
IViewReference[] views = workbenchPage.getViewReferences();
- for (int i = 0; i < views.length; i++) {
- IViewReference view = views[i];
+ for (IViewReference view : views) {
if (viewId.equals(view.getId())) {
workbenchPage.hideView(view);
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CompareActionsTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CompareActionsTest.java
index 4229466dd..54ae2f48a 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CompareActionsTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CompareActionsTest.java
@@ -337,8 +337,7 @@ public class CompareActionsTest extends LocalRepositoryTestCase {
private void closeFirstEmptySynchronizeDialog() {
// Do not use bot.shell(String) : we don't want to fail if not present.
SWTBotShell[] shells = bot.shells();
- for (int i = 0; i < shells.length; i++) {
- SWTBotShell shell = shells[i];
+ for (SWTBotShell shell : shells) {
if ("Synchronize Complete - Git".equals(shell.getText()))
shell.close();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java
index 380229908..b83827a14 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java
@@ -323,8 +323,8 @@ public class CompareUtils {
CompareEditorInput input, IWorkbenchPage page) {
IEditorReference[] editorRefs = page.getEditorReferences();
// first loop looking for an editor with the same input
- for (int i = 0; i < editorRefs.length; i++) {
- IEditorPart part = editorRefs[i].getEditor(false);
+ for (IEditorReference editorRef : editorRefs) {
+ IEditorPart part = editorRef.getEditor(false);
if (part != null
&& (part.getEditorInput() instanceof GitCompareFileRevisionEditorInput || part.getEditorInput() instanceof GitCompareEditorInput)
&& part instanceof IReusableEditor
@@ -335,8 +335,8 @@ public class CompareUtils {
// if none found and "Reuse open compare editors" preference is on use
// a non-dirty editor
if (isReuseOpenEditor()) {
- for (int i = 0; i < editorRefs.length; i++) {
- IEditorPart part = editorRefs[i].getEditor(false);
+ for (IEditorReference editorRef : editorRefs) {
+ IEditorPart part = editorRef.getEditor(false);
if (part != null
&& (part.getEditorInput() instanceof SaveableCompareEditorInput)
&& part instanceof IReusableEditor && !part.isDirty()) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/DecorationOverlayDescriptor.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/DecorationOverlayDescriptor.java
index baf91c5a6..fd9ca68e2 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/DecorationOverlayDescriptor.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/DecorationOverlayDescriptor.java
@@ -169,9 +169,11 @@ public class DecorationOverlayDescriptor extends CompositeImageDescriptor {
@Override
public int hashCode() {
int code = base.hashCode();
- for (int i = 0; i < overlays.length; i++)
- if (overlays[i] != null)
- code ^= overlays[i].hashCode();
+ for (ImageDescriptor overlay : overlays) {
+ if (overlay != null) {
+ code ^= overlay.hashCode();
+ }
+ }
return code;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/SWTUtils.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/SWTUtils.java
index 227534b49..dc1b736f6 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/SWTUtils.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/SWTUtils.java
@@ -565,9 +565,8 @@ public class SWTUtils {
public static int getWidthInCharsForLongest(PixelConverter converter,
String[] strings) {
int minimum = 0;
- for (int i = 0; i < strings.length; i++) {
- final int length = converter.convertWidthInCharsToPixels(strings[i]
- .length());
+ for (String string : strings) {
+ final int length = converter.convertWidthInCharsToPixels(string.length());
if (minimum < length)
minimum = length;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/SaveFilter.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/SaveFilter.java
index 2fc638ca2..1c69899fc 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/SaveFilter.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/SaveFilter.java
@@ -58,8 +58,7 @@ class SaveFilter implements ISaveableFilter {
return true;
}
// For backwards compatibility, we need to check the parts
- for (int i = 0; i < containingParts.length; i++) {
- IWorkbenchPart workbenchPart = containingParts[i];
+ for (IWorkbenchPart workbenchPart : containingParts) {
if (workbenchPart instanceof IEditorPart) {
IEditorPart editorPart = (IEditorPart) workbenchPart;
if (isEditingDescendantOf(editorPart)) {
@@ -84,11 +83,9 @@ class SaveFilter implements ISaveableFilter {
try {
ResourceTraversal[] traversals = mapping.getTraversals(
ResourceMappingContext.LOCAL_CONTEXT, null);
- for (int i = 0; i < traversals.length; i++) {
- ResourceTraversal traversal = traversals[i];
+ for (ResourceTraversal traversal : traversals) {
IResource[] resources = traversal.getResources();
- for (int j = 0; j < resources.length; j++) {
- IResource resource = resources[j];
+ for (IResource resource : resources) {
if (isDescendantOfRoots(resource)) {
return true;
}
@@ -96,10 +93,10 @@ class SaveFilter implements ISaveableFilter {
}
} catch (CoreException e) {
Activator
- .logError(
- NLS
- .bind(
- "An internal error occurred while determining the resources for {0}", saveable.getName()), e); //$NON-NLS-1$
+ .logError(
+ NLS
+ .bind(
+ "An internal error occurred while determining the resources for {0}", saveable.getName()), e); //$NON-NLS-1$
}
} else {
// If there is no mapping, try to adapt to a resource or file directly
@@ -120,8 +117,7 @@ class SaveFilter implements ISaveableFilter {
* one of the given roots
*/
private boolean isDescendantOfRoots(IResource resource) {
- for (int l = 0; l < roots.length; l++) {
- IResource root = roots[l];
+ for (IResource root : roots) {
if (root.getFullPath().isPrefixOf(resource.getFullPath())) {
return true;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateGeneralProjectPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateGeneralProjectPage.java
index 4b43b42e9..dbf956a74 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateGeneralProjectPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateGeneralProjectPage.java
@@ -232,8 +232,8 @@ public class GitCreateGeneralProjectPage extends WizardPage {
return false;
}
IProject[] workspaceProjects = getProjectsInWorkspace();
- for (int i = 0; i < workspaceProjects.length; i++) {
- if (projectName.equals(workspaceProjects[i].getName())) {
+ for (IProject workspaceProject : workspaceProjects) {
+ if (projectName.equals(workspaceProject.getName())) {
return true;
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java
index d2e2d763a..ceebedbaa 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java
@@ -517,9 +517,9 @@ public class GitProjectsImportPage extends WizardPage {
*/
public ProjectRecord[] getValidProjects() {
List<ProjectRecord> validProjects = new ArrayList<>();
- for (int i = 0; i < selectedProjects.length; i++) {
- if (!isProjectInWorkspace(selectedProjects[i].getProjectName())) {
- validProjects.add(selectedProjects[i]);
+ for (ProjectRecord selectedProject : selectedProjects) {
+ if (!isProjectInWorkspace(selectedProject.getProjectName())) {
+ validProjects.add(selectedProject);
}
}
return validProjects.toArray(new ProjectRecord[0]);
@@ -538,8 +538,8 @@ public class GitProjectsImportPage extends WizardPage {
return false;
}
IProject[] workspaceProjects = getProjectsInWorkspace();
- for (int i = 0; i < workspaceProjects.length; i++) {
- if (projectName.equals(workspaceProjects[i].getName())) {
+ for (IProject workspaceProject : workspaceProjects) {
+ if (projectName.equals(workspaceProject.getName())) {
return true;
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/CachedCheckboxTreeViewer.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/CachedCheckboxTreeViewer.java
index 3dd87cd09..7b55ea278 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/CachedCheckboxTreeViewer.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/CachedCheckboxTreeViewer.java
@@ -173,11 +173,11 @@ public class CachedCheckboxTreeViewer extends ContainerCheckedTreeViewer {
contentProvider = (ITreeContentProvider) getContentProvider();
}
- for (int i = 0; i < elements.length; i++) {
- Object[] children = contentProvider != null ? contentProvider.getChildren(elements[i]) : null;
- if (!getGrayed(elements[i]) && (children == null || children.length == 0)) {
- if (!checkState.contains(elements[i])) {
- checkState.add(elements[i]);
+ for (Object element : elements) {
+ Object[] children = contentProvider != null ? contentProvider.getChildren(element) : null;
+ if (!getGrayed(element) && (children == null || children.length == 0)) {
+ if (!checkState.contains(element)) {
+ checkState.add(element);
}
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/importing/GitScmUrlImportWizardPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/importing/GitScmUrlImportWizardPage.java
index 5053d2820..d8657a72c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/importing/GitScmUrlImportWizardPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/importing/GitScmUrlImportWizardPage.java
@@ -192,9 +192,9 @@ public class GitScmUrlImportWizardPage extends WizardPage implements
if (head && descriptions != null)
// modify tags on bundle import descriptions
- for (int i = 0; i < descriptions.length; i++) {
- URI scmUri = descriptions[i].getUri();
- descriptions[i].setUrl(removeTag(scmUri));
+ for (ScmUrlImportDescription description : descriptions) {
+ URI scmUri = description.getUri();
+ description.setUrl(removeTag(scmUri));
}
return true;
@@ -248,14 +248,16 @@ public class GitScmUrlImportWizardPage extends WizardPage implements
if (j != -1) {
sb.append(ssp.substring(0, j));
String[] params = ssp.substring(j).split(";"); //$NON-NLS-1$
- for (int k = 0; k < params.length; k++)
+ for (String param : params) {
// PDE way of providing tags
- if (params[k].startsWith("tag=")) { //$NON-NLS-1$
+ if (param.startsWith("tag=")) {//$NON-NLS-1$
// ignore
- } else if (params[k].startsWith("version=")) { //$NON-NLS-1$
+ } else if (param.startsWith("version=")) {//$NON-NLS-1$
// ignore
- } else if (params[k] != null && !params[k].isEmpty())
- sb.append(";").append(params[k]); //$NON-NLS-1$
+ } else if (!param.isEmpty()) {
+ sb.append(";").append(param); //$NON-NLS-1$
+ }
+ }
} else
sb.append(ssp);
return sb.toString();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java
index 1319a1909..0b1bb4eac 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java
@@ -968,8 +968,9 @@ public class ConfigurationEditorComponent {
if (boldFont != null)
return boldFont;
FontData[] data = defaultFont.getFontData();
- for (int i = 0; i < data.length; i++)
- data[i].setStyle(data[i].getStyle() | SWT.BOLD);
+ for (FontData d : data) {
+ d.setStyle(d.getStyle() | SWT.BOLD);
+ }
boldFont = new Font(PlatformUI.getWorkbench().getDisplay(), data);
return boldFont;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/GitDecoratorPreferencePage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/GitDecoratorPreferencePage.java
index 65166cb41..06f9102f8 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/GitDecoratorPreferencePage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/GitDecoratorPreferencePage.java
@@ -585,8 +585,8 @@ public class GitDecoratorPreferencePage extends PreferencePage implements
Object[] result = dialog.getResult();
- for (int i = 0; i < result.length; i++) {
- text.insert("{" + ((Map.Entry) result[i]).getKey() + "}"); //$NON-NLS-1$ //$NON-NLS-2$
+ for (Object r : result) {
+ text.insert("{" + ((Map.Entry) r).getKey() + "}"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -970,12 +970,12 @@ public class GitDecoratorPreferencePage extends PreferencePage implements
}
private void setColorsAndFonts(TreeItem[] items) {
- for (int i = 0; i < items.length; i++) {
- DecorationResult decoration = getDecoration(items[i].getData());
- items[i].setBackground(decoration.getBackgroundColor());
- items[i].setForeground(decoration.getForegroundColor());
- items[i].setFont(decoration.getFont());
- setColorsAndFonts(items[i].getItems());
+ for (TreeItem item : items) {
+ DecorationResult decoration = getDecoration(item.getData());
+ item.setBackground(decoration.getBackgroundColor());
+ item.setForeground(decoration.getForegroundColor());
+ item.setFont(decoration.getFont());
+ setColorsAndFonts(item.getItems());
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryStatisticsPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryStatisticsPage.java
index 43ef95906..d0ae76b3a 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryStatisticsPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryStatisticsPage.java
@@ -60,9 +60,9 @@ public class RepositoryStatisticsPage extends PropertyPage {
String[] titles = { UIText.RepositoryStatistics_Description,
UIText.RepositoryStatistics_LooseObjects,
UIText.RepositoryStatistics_PackedObjects };
- for (int i = 0; i < titles.length; i++) {
+ for (String title : titles) {
TableColumn column = new TableColumn(table, SWT.NONE);
- column.setText(titles[i]);
+ column.setText(title);
}
Repository repo = AdapterUtils.adapt(getElement(), Repository.class);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/sharing/ExistingOrNewPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/sharing/ExistingOrNewPage.java
index 544879fb7..122f87932 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/sharing/ExistingOrNewPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/sharing/ExistingOrNewPage.java
@@ -264,8 +264,7 @@ class ExistingOrNewPage extends WizardPage {
}
});
TableItem[] children = projectMoveViewer.getTable().getItems();
- for (int i = 0; i < children.length; i++) {
- TableItem item = children[i];
+ for (TableItem item : children) {
IProject data = (IProject) item.getData();
RepositoryFinder repositoryFinder = new RepositoryFinder(data);
repositoryFinder.setFindInChildren(false);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/FixedJFaceToolTip.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/FixedJFaceToolTip.java
index 79d7eafaf..04c1b1f74 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/FixedJFaceToolTip.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/FixedJFaceToolTip.java
@@ -378,8 +378,8 @@ public abstract class FixedJFaceToolTip {
// Search on which monitor the event occurred
Rectangle tmp;
- for (int i = 0; i < ms.length; i++) {
- tmp = ms[i].getBounds();
+ for (Monitor m : ms) {
+ tmp = m.getBounds();
if (tmp.contains(p)) {
bounds = tmp;
break;
@@ -483,8 +483,8 @@ public abstract class FixedJFaceToolTip {
if (c instanceof Composite) {
Control[] children = ((Composite) c).getChildren();
- for (int i = 0; i < children.length; i++) {
- toolTipHookByTypeRecursively(children[i], add, type);
+ for (Control child : children) {
+ toolTipHookByTypeRecursively(child, add, type);
}
}
}
@@ -495,8 +495,8 @@ public abstract class FixedJFaceToolTip {
if (c instanceof Composite) {
Control[] children = ((Composite) c).getChildren();
- for (int i = 0; i < children.length; i++) {
- toolTipHookBothRecursively(children[i]);
+ for (Control child : children) {
+ toolTipHookBothRecursively(child);
}
}
}

Back to the top