summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorBenjamin Muskalla2010-07-05 16:28:48 (EDT)
committer Benjamin Muskalla2010-07-05 16:28:48 (EDT)
commit425065c4dc588e78679675d159b0fe900b243c2e (patch)
treec8199832784ba73ca3b471efdab553bab4348386
parent48a952895da01179c74330b19a752d8fbecf2cf4 (diff)
downloadegit-425065c4dc588e78679675d159b0fe900b243c2e.zip
egit-425065c4dc588e78679675d159b0fe900b243c2e.tar.gz
egit-425065c4dc588e78679675d159b0fe900b243c2e.tar.bz2
Minor refactoring in GitProjectsImportPagerefs/changes/63/1063/1
We should not deal with Objects when we can leverage the type information of the compiler. Only a trivial refactoring to cleanup the code a little bit. Change-Id: I0e6f099e68d8bddae6b8a973da8c2b7ee41d42b8 Signed-off-by: Benjamin Muskalla <bmuskalla@eclipsesource.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java14
1 files changed, 7 insertions, 7 deletions
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 cdc8671..b913782 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
@@ -461,17 +461,17 @@ public class GitProjectsImportPage extends WizardPage {
* successful.
*/
boolean createProjects() {
- final Object[] selected = getCheckedProjects().toArray();
+ final Set<ProjectRecord> selected = getCheckedProjects();
WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
protected void execute(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
try {
- monitor.beginTask("", selected.length); //$NON-NLS-1$
+ monitor.beginTask("", selected.size()); //$NON-NLS-1$
if (monitor.isCanceled()) {
throw new OperationCanceledException();
}
- for (int i = 0; i < selected.length; i++) {
- createExistingProject((ProjectRecord) selected[i],
+ for (ProjectRecord projectRecord : selected) {
+ createExistingProject(projectRecord,
new SubProgressMonitor(monitor, 1));
}
} finally {
@@ -608,11 +608,11 @@ public class GitProjectsImportPage extends WizardPage {
/**
* @return All the currently checked projects in the projectsList tree
*/
- private HashSet<Object> getCheckedProjects() {
- HashSet<Object> ret = new HashSet<Object>();
+ private Set<ProjectRecord> getCheckedProjects() {
+ HashSet<ProjectRecord> ret = new HashSet<ProjectRecord>();
for (TreeItem item : projectsList.getTree().getItems())
if (item.getChecked())
- ret.add(item.getData());
+ ret.add((ProjectRecord) item.getData());
return ret;
}