ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gin...@apache.org
Subject [2/3] ant-ivyde git commit: Generics, JUnit 4
Date Sun, 05 Nov 2017 23:01:39 GMT
http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathContainerSerializer.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathContainerSerializer.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathContainerSerializer.java
index 45bbd17..20ab071 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathContainerSerializer.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathContainerSerializer.java
@@ -25,7 +25,6 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import javax.xml.parsers.DocumentBuilder;
@@ -38,6 +37,7 @@ import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
 
+import org.apache.ivyde.eclipse.cp.IvyClasspathContainer;
 import org.apache.ivyde.eclipse.cp.IvyClasspathContainerHelper;
 import org.apache.ivyde.internal.eclipse.IvyDEMessage;
 import org.apache.ivyde.internal.eclipse.IvyPlugin;
@@ -101,7 +101,7 @@ public class IvyClasspathContainerSerializer {
     }
 
     public void save(IJavaProject project) {
-        List/* <IvyClasspathContainer> */ivycps = IvyClasspathContainerHelper
+        List<IvyClasspathContainer> containers = IvyClasspathContainerHelper
                 .getContainers(project);
         try {
             File file = new File(containersStateDir, project.getProject().getName() + ".xml");
@@ -109,7 +109,7 @@ public class IvyClasspathContainerSerializer {
                     + project.getProject().getName() + " into " + file);
             FileOutputStream out = new FileOutputStream(file);
             try {
-                write(out, ivycps);
+                write(out, containers);
             } finally {
                 try {
                     out.close();
@@ -123,7 +123,7 @@ public class IvyClasspathContainerSerializer {
         }
     }
 
-    public Map/* <IPath, IvyClasspathContainer> */read(IJavaProject project) {
+    public Map<IPath, IvyClasspathContainer> read(IJavaProject project) {
         File file = new File(containersStateDir, project.getProject().getName() + ".xml");
         IvyDEMessage.verbose("Loading the state of the containers of the project "
                 + project.getProject().getName() + " from " + file);
@@ -150,7 +150,7 @@ public class IvyClasspathContainerSerializer {
         }
     }
 
-    private void write(OutputStream out, List/* <IvyClasspathContainer> */containers)
+    private void write(OutputStream out, List<IvyClasspathContainer> containers)
             throws IOException {
         try {
             StreamResult result = new StreamResult(out);
@@ -161,9 +161,8 @@ public class IvyClasspathContainerSerializer {
             Node root = document.createElement(ROOT);
             document.appendChild(root);
 
-            Iterator it = containers.iterator();
-            while (it.hasNext()) {
-                IvyClasspathContainerImpl ivycp = (IvyClasspathContainerImpl) it.next();
+            for (IvyClasspathContainer container : containers) {
+                IvyClasspathContainerImpl ivycp = (IvyClasspathContainerImpl) container;
 
                 Node node = document.createElement(IVYCP);
                 root.appendChild(node);
@@ -281,7 +280,7 @@ public class IvyClasspathContainerSerializer {
         }
     }
 
-    public Map/* <IPath, IvyClasspathContainer> */read(InputStream in) throws IOException,
+    public Map<IPath, IvyClasspathContainer> read(InputStream in) throws IOException,
             SAXException {
         try {
             InputSource source = new InputSource(in);
@@ -292,7 +291,7 @@ public class IvyClasspathContainerSerializer {
 
             NodeList elements = document.getElementsByTagName(IVYCP);
 
-            Map/* <IPath, IvyClasspathContainer> */ivycps = new HashMap();
+            Map<IPath, IvyClasspathContainer> containers = new HashMap<>();
 
             int count = elements.getLength();
             for (int i = 0; i != count; i++) {
@@ -320,9 +319,9 @@ public class IvyClasspathContainerSerializer {
 
                 IvyClasspathContainerImpl ivycp = new IvyClasspathContainerImpl(project, path, cpEntries,
                         cpAttributes);
-                ivycps.put(path, ivycp);
+                containers.put(path, ivycp);
             }
-            return ivycps;
+            return containers;
         } catch (ParserConfigurationException e) {
             throw new RuntimeException(e.getMessage(), e);
         }
@@ -330,7 +329,7 @@ public class IvyClasspathContainerSerializer {
     }
 
     private IClasspathEntry[] readCpEntries(Node cpEntries) throws IOException {
-        List/* <IClasspathEntry> */entries = new ArrayList();
+        List<IClasspathEntry> entries = new ArrayList<>();
         NodeList children = cpEntries.getChildNodes();
         for (int i = 0; i < children.getLength(); i++) {
             Node item = children.item(i);
@@ -341,7 +340,7 @@ public class IvyClasspathContainerSerializer {
                 }
             }
         }
-        return (IClasspathEntry[]) entries.toArray(new IClasspathEntry[entries.size()]);
+        return entries.toArray(new IClasspathEntry[entries.size()]);
     }
 
     private IClasspathEntry readCpEntry(Node cpEntryNode) throws IOException {
@@ -385,7 +384,7 @@ public class IvyClasspathContainerSerializer {
     }
 
     private IAccessRule[] readAccessRules(Node accessRulesNode) throws IOException {
-        List/* <IAccessRule> */rules = new ArrayList();
+        List<IAccessRule> rules = new ArrayList<>();
         NodeList children = accessRulesNode.getChildNodes();
         for (int i = 0; i < children.getLength(); i++) {
             Node item = children.item(i);
@@ -396,7 +395,7 @@ public class IvyClasspathContainerSerializer {
                 }
             }
         }
-        return (IAccessRule[]) rules.toArray(new IAccessRule[rules.size()]);
+        return rules.toArray(new IAccessRule[rules.size()]);
     }
 
     private IAccessRule readAccessRule(Node ruleNode) throws IOException {
@@ -407,7 +406,7 @@ public class IvyClasspathContainerSerializer {
     }
 
     private IClasspathAttribute[] readCpAttr(Node cpAttrsNode) throws IOException {
-        List/* <IClasspathAttribute> */attrs = new ArrayList();
+        List<IClasspathAttribute> attrs = new ArrayList<>();
         NodeList children = cpAttrsNode.getChildNodes();
         for (int i = 0; i < children.getLength(); i++) {
             Node item = children.item(i);
@@ -418,7 +417,7 @@ public class IvyClasspathContainerSerializer {
                 }
             }
         }
-        return (IClasspathAttribute[]) attrs.toArray(new IClasspathAttribute[attrs.size()]);
+        return attrs.toArray(new IClasspathAttribute[attrs.size()]);
     }
 
     private IClasspathAttribute readAttr(Node attrNode) throws IOException {

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathContainerState.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathContainerState.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathContainerState.java
index 1537637..d7fb2dc 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathContainerState.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathContainerState.java
@@ -54,7 +54,7 @@ public class IvyClasspathContainerState extends CachedIvy {
         return conf.getProject();
     }
 
-    protected Collection getPropertyFiles() throws IvyDEException {
+    protected Collection<String> getPropertyFiles() throws IvyDEException {
         return conf.getInheritedSettingsSetup().getResolvedPropertyFiles();
     }
 

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathInitializer.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathInitializer.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathInitializer.java
index 7ac3f92..0253982 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathInitializer.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathInitializer.java
@@ -22,6 +22,7 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.ivyde.eclipse.cp.IvyClasspathContainer;
 import org.apache.ivyde.eclipse.cp.IvyClasspathContainerHelper;
 import org.apache.ivyde.internal.eclipse.IvyDEMessage;
 import org.apache.ivyde.internal.eclipse.IvyPlugin;
@@ -96,10 +97,10 @@ public class IvyClasspathInitializer extends ClasspathContainerInitializer {
                         // try what the IvyDE plugin saved
                         IvyClasspathContainerSerializer serializer = IvyPlugin.getDefault()
                                 .getIvyClasspathContainerSerializer();
-                        Map ivycps = serializer.read(project);
-                        if (ivycps != null) {
+                        Map<IPath, IvyClasspathContainer> containers = serializer.read(project);
+                        if (containers != null) {
                             IvyDEMessage.debug("Found serialized containers");
-                            ivycp = (IvyClasspathContainerImpl) ivycps.get(containerPath);
+                            ivycp = (IvyClasspathContainerImpl) containers.get(containerPath);
                         }
                         if (ivycp == null) {
                             IvyDEMessage.debug("No serialized containers match the expected container path");
@@ -169,18 +170,16 @@ public class IvyClasspathInitializer extends ClasspathContainerInitializer {
                     // update the classpath of the project by updating the IvyDE container
                     IClasspathEntry newEntry = JavaCore.newContainerEntry(updatedPath, null,
                         attributes, exported);
-                    IClasspathEntry[] entries;
-                    entries = project.getRawClasspath();
-                    List newEntries = new ArrayList(Arrays.asList(entries));
+                    IClasspathEntry[] entries = project.getRawClasspath();
+                    List<IClasspathEntry> newEntries = new ArrayList<>(Arrays.asList(entries));
                     for (int i = 0; i < newEntries.size(); i++) {
-                        IClasspathEntry e = (IClasspathEntry) newEntries.get(i);
+                        IClasspathEntry e = newEntries.get(i);
                         if (e == entry) {
                             newEntries.set(i, newEntry);
                             break;
                         }
                     }
-                    entries = (IClasspathEntry[]) newEntries.toArray(new IClasspathEntry[newEntries
-                            .size()]);
+                    entries = newEntries.toArray(new IClasspathEntry[newEntries.size()]);
                     project.setRawClasspath(entries, project.getOutputLocation(), null);
                 } catch (JavaModelException e) {
                     IvyPlugin.logError("Unable to update the container path", e);

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathUtil.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathUtil.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathUtil.java
index 19aae09..7ebd1fd 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathUtil.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathUtil.java
@@ -23,7 +23,6 @@ import java.net.URL;
 import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
@@ -70,11 +69,10 @@ public final class IvyClasspathUtil {
         return null;
     }
 
-    public static List split(String str) {
-        String[] terms = str.split(",");
-        List ret = new ArrayList();
-        for (int i = 0; i < terms.length; i++) {
-            String t = terms[i].trim();
+    public static List<String> split(String str) {
+        List<String> ret = new ArrayList<>();
+        for (String term : str.split(",")) {
+            String t = term.trim();
             if (t.length() > 0) {
                 ret.add(t);
             }
@@ -82,17 +80,16 @@ public final class IvyClasspathUtil {
         return ret;
     }
 
-    public static String concat(Collection/* <String> */list) {
+    public static String concat(Collection<String> list) {
         if (list == null) {
             return "";
         }
         StringBuilder b = new StringBuilder();
-        Iterator it = list.iterator();
-        while (it.hasNext()) {
-            b.append(it.next());
-            if (it.hasNext()) {
+        for (String item : list) {
+            if (b.length() > 0) {
                 b.append(",");
             }
+            b.append(item);
         }
         return b.toString();
     }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvydeContainerPage.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvydeContainerPage.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvydeContainerPage.java
index 6430030..5d9f700 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvydeContainerPage.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvydeContainerPage.java
@@ -19,11 +19,11 @@ package org.apache.ivyde.internal.eclipse.cpcontainer;
 
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
 import org.apache.ivyde.eclipse.IvyDEException;
+import org.apache.ivyde.eclipse.cp.IvyClasspathContainer;
 import org.apache.ivyde.eclipse.cp.IvyClasspathContainerConfiguration;
 import org.apache.ivyde.eclipse.cp.IvyClasspathContainerHelper;
 import org.apache.ivyde.eclipse.cp.SettingsSetup;
@@ -86,7 +86,7 @@ public class IvydeContainerPage extends NewElementWizardPage implements IClasspa
 
     private String oldIvyFile = null;
 
-    private List oldConfs = null;
+    private List<String> oldConfs = null;
 
     private IvyClasspathContainerState state;
 
@@ -132,18 +132,16 @@ public class IvydeContainerPage extends NewElementWizardPage implements IClasspa
         String error = null;
 
         String ivyFilePath = ivyFilePathText.getIvyFilePath();
-        List selectedConfigurations = confTableViewer.getSelectedConfigurations();
+        List<String> selectedConfigurations = confTableViewer.getSelectedConfigurations();
 
-        List/* <IvyClasspathContainer> */containers = IvyClasspathContainerHelper
+        List<IvyClasspathContainer> containers = IvyClasspathContainerHelper
                 .getContainers(project);
         if (containers == null) {
             return null;
         }
 
-        Iterator/* <IvyClasspathContainer> */itContainers = containers.iterator();
-        while (error == null && itContainers.hasNext()) {
-            IvyClasspathContainerImpl ivycp = (IvyClasspathContainerImpl) itContainers.next();
-            IvyClasspathContainerConfiguration cpc = ivycp.getConf();
+        for (IvyClasspathContainer container : containers) {
+            IvyClasspathContainerConfiguration cpc = container.getConf();
 
             // first check that this is not the one we are editing
             if (oldIvyFile != null && cpc.getIvyXmlPath().equals(oldIvyFile) && oldConfs != null
@@ -157,12 +155,14 @@ public class IvydeContainerPage extends NewElementWizardPage implements IClasspa
                         || cpc.getConfs().isEmpty() || cpc.getConfs().contains("*")) {
                     error = "A container already exists for the selected conf of "
                             + "the module descriptor";
+                    break;
                 } else {
-                    ArrayList list = new ArrayList(cpc.getConfs());
+                    List<String> list = new ArrayList<>(cpc.getConfs());
                     list.retainAll(selectedConfigurations);
                     if (!list.isEmpty()) {
                         error = "A container already exists for the selected conf of "
                                 + "the module descriptor";
+                        break;
                     }
                 }
             }
@@ -185,7 +185,7 @@ public class IvydeContainerPage extends NewElementWizardPage implements IClasspa
     }
 
     public boolean finish() {
-        List confs = confTableViewer.getSelectedConfigurations();
+        List<String> confs = confTableViewer.getSelectedConfigurations();
         if (confs.isEmpty()) {
             confs = Collections.singletonList("*");
         }
@@ -356,7 +356,7 @@ public class IvydeContainerPage extends NewElementWizardPage implements IClasspa
         confTableViewer = new ConfTableViewer(configComposite, SWT.NONE);
         confTableViewer.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
         confTableViewer.addListener(new ConfTableListener() {
-            public void confTableUpdated(List confs) {
+            public void confTableUpdated(List<String> confs) {
                 checkCompleted();
             }
         });

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/AbstractIvyDEHandler.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/AbstractIvyDEHandler.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/AbstractIvyDEHandler.java
index e755add..055ecc8 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/AbstractIvyDEHandler.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/AbstractIvyDEHandler.java
@@ -19,12 +19,12 @@ package org.apache.ivyde.internal.eclipse.handlers;
 
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
 
+import org.apache.ivyde.eclipse.cp.IvyClasspathContainer;
 import org.apache.ivyde.eclipse.cp.IvyClasspathContainerHelper;
 import org.apache.ivyde.internal.eclipse.cpcontainer.IvyClasspathContainerImpl;
 import org.apache.ivyde.internal.eclipse.cpcontainer.IvyClasspathUtil;
@@ -48,8 +48,7 @@ public abstract class AbstractIvyDEHandler extends AbstractHandler {
             return null;
         }
 
-        // Map<IProject, Set<IvyClasspathContainer>>
-        Map projects = getProjectAndContainers((IStructuredSelection) selection);
+        Map<IProject, Set<IvyClasspathContainer>> projects = getProjectAndContainers((IStructuredSelection) selection);
 
         if (projects.size() > 0) {
             handleProjects(projects);
@@ -58,30 +57,27 @@ public abstract class AbstractIvyDEHandler extends AbstractHandler {
         return null;
     }
 
-    public static Map/* <IProject, Set<IvyClasspathContainer>> */getProjectAndContainers(
+    public static Map<IProject, Set<IvyClasspathContainer>> getProjectAndContainers(
             IStructuredSelection selection) {
-        Map/* <IProject, Set<IvyClasspathContainer>> */projects = new HashMap();
+        Map<IProject, Set<IvyClasspathContainer>> projects = new HashMap<>();
 
-        Iterator it = selection.iterator();
-        while (it.hasNext()) {
-            Object element = it.next();
+        for (Object element : selection.toList()) {
             if (element instanceof IWorkingSet) {
-                IAdaptable[] elements = ((IWorkingSet) element).getElements();
-                for (int i = 0; i < elements.length; i++) {
-                    addElement(projects, elements[i]);
+                for (IAdaptable elem : ((IWorkingSet) element).getElements()) {
+                    addElement(projects, elem);
                 }
             } else if (element instanceof ClassPathContainer) {
                 IvyClasspathContainerImpl ivycp = IvyClasspathUtil
                         .jdt2IvyCPC(((ClassPathContainer) element));
                 IJavaProject javaProject = ivycp.getConf().getJavaProject();
                 if (javaProject != null) {
-                    Set/* <IvyClasspathContainer> */cplist = (Set) projects.get(javaProject
+                    Set<IvyClasspathContainer> containers = projects.get(javaProject
                             .getProject());
-                    if (cplist == null) {
-                        cplist = new HashSet();
-                        projects.put(javaProject.getProject(), cplist);
+                    if (containers == null) {
+                        containers = new HashSet<>();
+                        projects.put(javaProject.getProject(), containers);
                     }
-                    cplist.add(ivycp);
+                    containers.add(ivycp);
                 }
             } else {
                 addElement(projects, element);
@@ -90,7 +86,7 @@ public abstract class AbstractIvyDEHandler extends AbstractHandler {
         return projects;
     }
 
-    private static void addElement(Map/* <IProject, Set<IvyClasspathContainer>> */projects,
+    private static void addElement(Map<IProject, Set<IvyClasspathContainer>> projects,
             Object adaptableProject) {
         IProject project = null;
         if (adaptableProject instanceof IProject) {
@@ -100,26 +96,23 @@ public abstract class AbstractIvyDEHandler extends AbstractHandler {
         }
         if (project != null) {
             // check that there is an IvyDE container
-            List containers = IvyClasspathContainerHelper.getContainers(project);
+            List<IvyClasspathContainer> containers = IvyClasspathContainerHelper.getContainers(project);
             if (!containers.isEmpty()) {
-                projects.put(project, new HashSet(containers));
+                projects.put(project, new HashSet<>(containers));
             }
         }
     }
 
-    protected void handleProjects(Map projects) {
-        Iterator it = projects.entrySet().iterator();
-        while (it.hasNext()) {
-            Entry entry = (Entry) it.next();
-            Iterator itContainers = ((Set) entry.getValue()).iterator();
-            while (itContainers.hasNext()) {
-                handleContainer((IProject) entry.getKey(),
-                    (IvyClasspathContainerImpl) itContainers.next());
+    protected void handleProjects(Map<IProject, Set<IvyClasspathContainer>> projects) {
+        for (Entry<IProject, Set<IvyClasspathContainer>> entry : projects.entrySet()) {
+            IProject project = entry.getKey();
+            for (IvyClasspathContainer container : entry.getValue()) {
+                handleContainer(project, container);
             }
         }
     }
 
-    protected void handleContainer(IProject project, IvyClasspathContainerImpl cp) {
+    protected void handleContainer(IProject project, IvyClasspathContainer container) {
         throw new UnsupportedOperationException();
     }
 

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/AddIvyNatureHandler.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/AddIvyNatureHandler.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/AddIvyNatureHandler.java
index a16ff35..5041f76 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/AddIvyNatureHandler.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/AddIvyNatureHandler.java
@@ -17,7 +17,6 @@
  */
 package org.apache.ivyde.internal.eclipse.handlers;
 
-import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 
@@ -39,11 +38,8 @@ public class AddIvyNatureHandler extends AbstractHandler {
             return null;
         }
 
-        List/* <IProject> */projects = new LinkedList();
-        IStructuredSelection newSelection = (IStructuredSelection) selection;
-        Iterator iter = newSelection.iterator();
-        while (iter.hasNext()) {
-            Object object = iter.next();
+        List<IProject> projects = new LinkedList<>();
+        for (Object object : ((IStructuredSelection) selection).toList()) {
             if (object instanceof IAdaptable) {
                 IProject project = (IProject) ((IAdaptable) object).getAdapter(IProject.class);
                 if (project != null) {
@@ -57,9 +53,7 @@ public class AddIvyNatureHandler extends AbstractHandler {
         }
 
         if (projects.size() > 0) {
-            Iterator itProject = projects.iterator();
-            while (itProject.hasNext()) {
-                IProject project = (IProject) itProject.next();
+            for (IProject project : projects) {
                 IvyNatureHelper.addNature(project);
             }
         }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/OpenIvyFileHandler.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/OpenIvyFileHandler.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/OpenIvyFileHandler.java
index 36c5dc1..647c10b 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/OpenIvyFileHandler.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/OpenIvyFileHandler.java
@@ -17,8 +17,8 @@
  */
 package org.apache.ivyde.internal.eclipse.handlers;
 
+import org.apache.ivyde.eclipse.cp.IvyClasspathContainer;
 import org.apache.ivyde.eclipse.cp.IvyClasspathContainerConfiguration;
-import org.apache.ivyde.internal.eclipse.cpcontainer.IvyClasspathContainerImpl;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.CoreException;
@@ -36,12 +36,12 @@ public class OpenIvyFileHandler extends AbstractIvyDEHandler {
 
     public static final String COMMAND_ID = "org.apache.ivyde.commands.openivyfile";
 
-    protected void handleContainer(IProject project, IvyClasspathContainerImpl cp) {
-        open(cp);
+    protected void handleContainer(IProject project, IvyClasspathContainer container) {
+        open(container);
     }
 
-    public static void open(IvyClasspathContainerImpl cp) {
-        IvyClasspathContainerConfiguration conf = cp.getConf();
+    public static void open(IvyClasspathContainer container) {
+        IvyClasspathContainerConfiguration conf = container.getConf();
         if (conf.getJavaProject() == null) {
             return;
         }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/RefreshHandler.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/RefreshHandler.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/RefreshHandler.java
index 2a07091..c637a37 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/RefreshHandler.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/RefreshHandler.java
@@ -17,15 +17,15 @@
  */
 package org.apache.ivyde.internal.eclipse.handlers;
 
-import org.apache.ivyde.internal.eclipse.cpcontainer.IvyClasspathContainerImpl;
+import org.apache.ivyde.eclipse.cp.IvyClasspathContainer;
 import org.eclipse.core.resources.IProject;
 
 public class RefreshHandler extends AbstractIvyDEHandler {
 
     public static final String COMMAND_ID = "org.apache.ivyde.commands.refresh";
 
-    protected void handleContainer(IProject project, IvyClasspathContainerImpl ivycp) {
-        ivycp.launchResolve(true, null);
+    protected void handleContainer(IProject project, IvyClasspathContainer container) {
+        container.launchResolve(true, null);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ReloadSettingsHandler.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ReloadSettingsHandler.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ReloadSettingsHandler.java
index a19908e..8812c25 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ReloadSettingsHandler.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ReloadSettingsHandler.java
@@ -17,15 +17,15 @@
  */
 package org.apache.ivyde.internal.eclipse.handlers;
 
-import org.apache.ivyde.internal.eclipse.cpcontainer.IvyClasspathContainerImpl;
+import org.apache.ivyde.eclipse.cp.IvyClasspathContainer;
 import org.eclipse.core.resources.IProject;
 
 public class ReloadSettingsHandler extends AbstractIvyDEHandler {
 
     public static final String COMMAND_ID = "org.apache.ivyde.commands.reloadsettings";
 
-    protected void handleContainer(IProject project, IvyClasspathContainerImpl cp) {
-        cp.reloadSettings();
+    protected void handleContainer(IProject project, IvyClasspathContainer container) {
+        container.reloadSettings();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/RemoveIvyNatureHandler.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/RemoveIvyNatureHandler.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/RemoveIvyNatureHandler.java
index aaae115..18dc9e3 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/RemoveIvyNatureHandler.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/RemoveIvyNatureHandler.java
@@ -17,7 +17,6 @@
  */
 package org.apache.ivyde.internal.eclipse.handlers;
 
-import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 
@@ -44,11 +43,8 @@ public class RemoveIvyNatureHandler extends AbstractHandler {
             return null;
         }
 
-        List/* <IProject> */projects = new LinkedList();
-        IStructuredSelection newSelection = (IStructuredSelection) selection;
-        Iterator iter = newSelection.iterator();
-        while (iter.hasNext()) {
-            Object object = iter.next();
+        List<IProject> projects = new LinkedList<>();
+        for (Object object : ((IStructuredSelection) selection).toList()) {
             if (object instanceof IAdaptable) {
                 IProject project = (IProject) ((IAdaptable) object).getAdapter(IProject.class);
                 if (project != null) {
@@ -71,9 +67,7 @@ public class RemoveIvyNatureHandler extends AbstractHandler {
                         + "The configuration of the classpath containers will be lost.\n"
                         + "This operation cannot be undone.");
             if (doRemove) {
-                Iterator itProject = projects.iterator();
-                while (itProject.hasNext()) {
-                    IProject project = (IProject) itProject.next();
+                for (IProject project : projects) {
                     IvyNatureHelper.removeNature(project);
                 }
             }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ResolveAllHandler.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ResolveAllHandler.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ResolveAllHandler.java
index 95a2cb2..8994189 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ResolveAllHandler.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ResolveAllHandler.java
@@ -17,10 +17,8 @@
  */
 package org.apache.ivyde.internal.eclipse.handlers;
 
-import java.util.Iterator;
-
+import org.apache.ivyde.eclipse.cp.IvyClasspathContainer;
 import org.apache.ivyde.eclipse.cp.IvyClasspathContainerHelper;
-import org.apache.ivyde.internal.eclipse.cpcontainer.IvyClasspathContainerImpl;
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
@@ -42,11 +40,9 @@ public class ResolveAllHandler extends AbstractHandler {
             return null;
         }
 
-        for (int i = 0; i < projects.length; i++) {
-            Iterator it = IvyClasspathContainerHelper.getContainers(projects[i]).iterator();
-            while (it.hasNext()) {
-                IvyClasspathContainerImpl ivycp = (IvyClasspathContainerImpl) it.next();
-                ivycp.launchResolve(false, null);
+        for (IJavaProject project : projects) {
+            for (IvyClasspathContainer container : IvyClasspathContainerHelper.getContainers(project)) {
+                container.launchResolve(false, null);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ResolveHandler.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ResolveHandler.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ResolveHandler.java
index 1b27da0..6801f8d 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ResolveHandler.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ResolveHandler.java
@@ -17,15 +17,15 @@
  */
 package org.apache.ivyde.internal.eclipse.handlers;
 
-import org.apache.ivyde.internal.eclipse.cpcontainer.IvyClasspathContainerImpl;
+import org.apache.ivyde.eclipse.cp.IvyClasspathContainer;
 import org.eclipse.core.resources.IProject;
 
 public class ResolveHandler extends AbstractIvyDEHandler {
 
     public static final String COMMAND_ID = "org.apache.ivyde.commands.resolve";
 
-    protected void handleContainer(IProject project, IvyClasspathContainerImpl ivycp) {
-        ivycp.launchResolve(false, null);
+    protected void handleContainer(IProject project, IvyClasspathContainer container) {
+        container.launchResolve(false, null);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ViewReverseDependenciesHandler.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ViewReverseDependenciesHandler.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ViewReverseDependenciesHandler.java
index 85864d9..a1aee01 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ViewReverseDependenciesHandler.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/handlers/ViewReverseDependenciesHandler.java
@@ -18,7 +18,9 @@
 package org.apache.ivyde.internal.eclipse.handlers;
 
 import java.util.Map;
+import java.util.Set;
 
+import org.apache.ivyde.eclipse.cp.IvyClasspathContainer;
 import org.apache.ivyde.internal.eclipse.IvyPlugin;
 import org.apache.ivyde.internal.eclipse.ui.views.ReverseDependencyExplorerView;
 import org.eclipse.core.resources.IProject;
@@ -29,10 +31,9 @@ public class ViewReverseDependenciesHandler extends AbstractIvyDEHandler {
 
     public static final String COMMAND_ID = "org.apache.ivyde.commands.revdepexplorer";
 
-    protected void handleProjects(Map projects) {
+    protected void handleProjects(Map<IProject, Set<IvyClasspathContainer>> projects) {
         try {
-            ReverseDependencyExplorerView.setSelectedProjects((IProject[]) projects.keySet()
-                    .toArray(new IProject[0]));
+            ReverseDependencyExplorerView.setSelectedProjects(projects.keySet().toArray(new IProject[0]));
             IWorkbenchPage page = IvyPlugin.getActivePage();
             page.showView("org.apache.ivyde.eclipse.ui.views.ReverseDependencyExplorer");
             ReverseDependencyExplorerView.refresh(true);

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolveJob.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolveJob.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolveJob.java
index 90ebfc4..84f7044 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolveJob.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolveJob.java
@@ -19,7 +19,6 @@ package org.apache.ivyde.internal.eclipse.resolve;
 
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -57,7 +56,7 @@ public class IvyResolveJob extends Job {
 
     private static final int WAIT_BEFORE_LAUNCH = 1000;
 
-    private final List resolveQueue = new ArrayList();
+    private final List<ResolveRequest> resolveQueue = new ArrayList<>();
 
     public IvyResolveJob() {
         super("IvyDE resolve");
@@ -92,9 +91,9 @@ public class IvyResolveJob extends Job {
     private IStatus doRun(IProgressMonitor monitor) {
         IvyDEMessage.info("Resolve job starting...");
 
-        List toResolve;
+        List<ResolveRequest> toResolve;
         synchronized (resolveQueue) {
-            toResolve = new ArrayList(resolveQueue);
+            toResolve = new ArrayList<>(resolveQueue);
             resolveQueue.clear();
         }
 
@@ -107,10 +106,10 @@ public class IvyResolveJob extends Job {
 
         monitor.beginTask("Loading ivy descriptors", MONITOR_LENGTH);
 
-        Map/* <ModuleDescriptor, List<ResolveRequest>> */inworkspaceModules = new LinkedHashMap();
-        List/* <ResolveRequest> */otherModules = new ArrayList();
-        Map/* <ResolveRequest, Ivy> */ivys = new HashMap();
-        Map/* <ResolveRequest, ModuleDescriptor> */mds = new HashMap();
+        Map<ModuleDescriptor, List<ResolveRequest>> inworkspaceModules = new LinkedHashMap<>();
+        List<ResolveRequest> otherModules = new ArrayList<>();
+        Map<ResolveRequest, Ivy> ivys = new HashMap<>();
+        Map<ResolveRequest, ModuleDescriptor> mds = new HashMap<>();
 
         final MultiStatus errorsStatus = new MultiStatus(IvyPlugin.ID, IStatus.ERROR,
                 "Some projects fail to be resolved", null);
@@ -124,10 +123,7 @@ public class IvyResolveJob extends Job {
         ClassLoader old = Thread.currentThread().getContextClassLoader();
         Thread.currentThread().setContextClassLoader(IvyResolveJob.class.getClassLoader());
         try {
-            Iterator itRequests = toResolve.iterator();
-            while (itRequests.hasNext()) {
-                ResolveRequest request = (ResolveRequest) itRequests.next();
-
+            for (ResolveRequest request : toResolve) {
                 IvyDEMessage.info("Processing resolve request " + request.toString());
 
                 forceFailOnError = forceFailOnError || request.isForceFailOnError();
@@ -174,9 +170,9 @@ public class IvyResolveJob extends Job {
                 cachedIvy.setErrorMarker(null);
                 mds.put(request, md);
                 if (request.isInWorkspace()) {
-                    List requests = (List) inworkspaceModules.get(md);
+                    List<ResolveRequest> requests = inworkspaceModules.get(md);
                     if (requests == null) {
-                        requests = new ArrayList();
+                        requests = new ArrayList<>();
                         inworkspaceModules.put(md, requests);
                     }
                     requests.add(request);
@@ -199,30 +195,22 @@ public class IvyResolveJob extends Job {
             // we resolve them in the correct order
 
             // The version matcher used will be the one configured for the first project
-            ResolveRequest request = (ResolveRequest) ((List) inworkspaceModules.values()
-                    .iterator().next()).get(0);
-            VersionMatcher versionMatcher = ((Ivy) ivys.get(request)).getSettings()
-                    .getVersionMatcher();
+            ResolveRequest request = inworkspaceModules.values().iterator().next().get(0);
+            VersionMatcher versionMatcher = ivys.get(request).getSettings().getVersionMatcher();
 
             WarningNonMatchingVersionReporter vReporter = new WarningNonMatchingVersionReporter();
             CircularDependencyStrategy circularDependencyStrategy = WarnCircularDependencyStrategy
                     .getInstance();
             ModuleDescriptorSorter sorter = new ModuleDescriptorSorter(inworkspaceModules.keySet(),
                     versionMatcher, vReporter, circularDependencyStrategy);
-            List sortedModuleDescriptors = sorter.sortModuleDescriptors();
 
-            Iterator it = sortedModuleDescriptors.iterator();
-            while (it.hasNext()) {
-                ModuleDescriptor module = (ModuleDescriptor) it.next();
-                List requests = (List) inworkspaceModules.get(module);
+            for (ModuleDescriptor module : sorter.sortModuleDescriptors()) {
+                List<ResolveRequest> requests = inworkspaceModules.get(module);
                 IvyDEMessage.info(requests.size() + " container(s) of module " + module
                         + " to resolve in workspace");
-                for (int i = 0; i < requests.size(); i++) {
-                    request = (ResolveRequest) requests.get(i);
-                    Ivy ivy = (Ivy) ivys.get(request);
-                    ModuleDescriptor md = (ModuleDescriptor) mds.get(request);
-                    boolean canceled = launchResolveThread(request, monitor, step, errorsStatus,
-                        ivy, md);
+                for (ResolveRequest req : requests) {
+                    boolean canceled = launchResolveThread(req, monitor, step, errorsStatus,
+                            ivys.get(req), mds.get(req));
                     if (canceled) {
                         IvyDEMessage.warn("Resolve job canceled");
                         return Status.CANCEL_STATUS;
@@ -236,13 +224,9 @@ public class IvyResolveJob extends Job {
         } else {
             IvyDEMessage.info(otherModules.size() + " module(s) to resolve outside the workspace");
 
-            Iterator it = otherModules.iterator();
-            while (it.hasNext()) {
-                ResolveRequest request = (ResolveRequest) it.next();
-                Ivy ivy = (Ivy) ivys.get(request);
-                ModuleDescriptor md = (ModuleDescriptor) mds.get(request);
-                boolean canceled = launchResolveThread(request, monitor, step, errorsStatus, ivy,
-                    md);
+            for (ResolveRequest request : otherModules) {
+                boolean canceled = launchResolveThread(request, monitor, step, errorsStatus,
+                        ivys.get(request), mds.get(request));
                 if (canceled) {
                     IvyDEMessage.warn("Resolve job canceled");
                     return Status.CANCEL_STATUS;
@@ -255,9 +239,7 @@ public class IvyResolveJob extends Job {
         monitor.setTaskName("Post resolve");
 
         // launch every post batch resolve
-        Iterator itRequests = toResolve.iterator();
-        while (itRequests.hasNext()) {
-            ResolveRequest request = (ResolveRequest) itRequests.next();
+        for (ResolveRequest request : toResolve) {
             if (!request.isResolveFailed()) {
                 monitor.setTaskName(request.getResolver().toString());
                 request.getResolver().postBatchResolve();

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolver.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolver.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolver.java
index 6f96bcf..531289b 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolver.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolver.java
@@ -21,7 +21,6 @@ import java.io.File;
 import java.io.IOException;
 import java.text.ParseException;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -68,7 +67,7 @@ public class IvyResolver {
 
     private final IProject project;
 
-    private final List confInput;
+    private final List<String> confInput;
 
     private String retrievePattern = null;
 
@@ -84,7 +83,7 @@ public class IvyResolver {
 
     private boolean transitiveResolve = true;
 
-    public IvyResolver(String ivyXmlPath, List confInput, IProject project) {
+    public IvyResolver(String ivyXmlPath, List<String> confInput, IProject project) {
         this.ivyXmlPath = ivyXmlPath;
         this.confInput = confInput;
         this.project = project;
@@ -175,9 +174,9 @@ public class IvyResolver {
             if (!result.getProblemMessages().isEmpty()) {
                 MultiStatus multiStatus = new MultiStatus(IvyPlugin.ID, IStatus.ERROR,
                         "Impossible to resolve dependencies of " + md.getModuleRevisionId(), null);
-                for (Iterator iter = result.getProblemMessages().iterator(); iter.hasNext();) {
+                for (String s : result.getProblemMessages()) {
                     multiStatus.add(new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR,
-                            (String) iter.next(), null));
+                            s, null));
                 }
                 return multiStatus;
             }
@@ -196,14 +195,14 @@ public class IvyResolver {
         // nothing to do by default
     }
 
-    private void computeConfs(List/* <String> */confInput, ModuleDescriptor md) {
-        Set configurations = new HashSet();
+    private void computeConfs(List<String> confInput, ModuleDescriptor md) {
+        Set<String> configurations = new HashSet<>();
         configurations.addAll(confInput);
 
         if (configurations.contains("*")) {
             confs = md.getConfigurationsNames();
         } else {
-            confs = (String[]) configurations.toArray(new String[configurations.size()]);
+            confs = configurations.toArray(new String[configurations.size()]);
         }
     }
 
@@ -243,6 +242,7 @@ public class IvyResolver {
         return result;
     }
 
+    @SuppressWarnings("unchecked")
     private ResolveResult doResolve(Ivy ivy, ModuleDescriptor md) throws ParseException,
             IOException {
         IvyDEMessage.debug("Doing a full resolve...");
@@ -264,14 +264,13 @@ public class IvyResolver {
 
         ArtifactDownloadReport[] artifactReports = report.getArtifactsReports(null, false);
 
-        Map/* <Artifact, ArtifactDownloadReport> */workspaceArtifacts = IvyContext
-                .getContext().get(WorkspaceResolver.IVYDE_WORKSPACE_ARTIFACT_REPORTS);
+        Map<Artifact, ArtifactDownloadReport> workspaceArtifacts = IvyContext.getContext()
+                .get(WorkspaceResolver.IVYDE_WORKSPACE_ARTIFACT_REPORTS);
         if (workspaceArtifacts != null) {
             // some artifact were 'forced' by the dependency declaration, whereas they should be
             // switch by the eclipse project reference
             for (int i = 0; i < artifactReports.length; i++) {
-                ArtifactDownloadReport eclipseArtifactReport = (ArtifactDownloadReport) workspaceArtifacts
-                        .get(artifactReports[i].getArtifact());
+                ArtifactDownloadReport eclipseArtifactReport = workspaceArtifacts.get(artifactReports[i].getArtifact());
                 if (eclipseArtifactReport != null) {
                     // let's switch.
                     artifactReports[i] = eclipseArtifactReport;
@@ -320,9 +319,8 @@ public class IvyResolver {
         }
     }
 
-    private void collectArtifactsByDependency(ResolveReport r, ResolveResult result) {
-        for (Iterator it = r.getDependencies().iterator(); it.hasNext();) {
-            IvyNode node = (IvyNode) it.next();
+    private void collectArtifactsByDependency(ResolveReport rr, ResolveResult result) {
+        for (IvyNode node : rr.getDependencies()) {
             if (node.getDescriptor() != null) {
                 result.putArtifactsForDep(node.getResolvedId(), node.getDescriptor()
                         .getAllArtifacts());
@@ -363,7 +361,7 @@ public class IvyResolver {
         }
         options.setConfs(confs).setDestArtifactPattern(pattern);
         if (retrieveTypes != null && !retrieveTypes.equals("*")) {
-            List typeList = IvyClasspathUtil.split(retrieveTypes);
+            List<String> typeList = IvyClasspathUtil.split(retrieveTypes);
             options.setArtifactFilter(new ArtifactTypeFilter(typeList));
         }
         options.setResolveId(IvyClasspathUtil.buildResolveId(useExtendedResolveId, md));
@@ -404,7 +402,7 @@ public class IvyResolver {
                 .getVariables());
         try {
             // FIXME same as above
-            Map retrievedArtifacts = ivy.getRetrieveEngine().determineArtifactsToCopy(
+            Map<ArtifactDownloadReport, Set<String>> retrievedArtifacts = ivy.getRetrieveEngine().determineArtifactsToCopy(
                 md.getModuleRevisionId(), resolvedPattern, options);
             result.setRetrievedArtifacts(retrievedArtifacts);
         } catch (ParseException e) {

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/retrieve/RetrieveSetupManager.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/retrieve/RetrieveSetupManager.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/retrieve/RetrieveSetupManager.java
index 9b43b93..db1465e 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/retrieve/RetrieveSetupManager.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/retrieve/RetrieveSetupManager.java
@@ -22,7 +22,6 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -41,13 +40,13 @@ public class RetrieveSetupManager implements ISaveParticipant {
 
     private static final String PREF_ID = "org.apache.ivyde.eclipse.standaloneretrieve";
 
-    private Map/* <IProject, IEclipsePreferences> */projectPrefs = new HashMap();
+    private final Map<IProject, IEclipsePreferences> projectPrefs = new HashMap<>();
 
-    public List/* <StandaloneRetrieveSetup> */getSetup(IProject project) throws IOException {
+    public List<StandaloneRetrieveSetup> getSetup(IProject project) throws IOException {
 
         IEclipsePreferences pref;
         synchronized (projectPrefs) {
-            pref = (IEclipsePreferences) projectPrefs.get(project);
+            pref = projectPrefs.get(project);
         }
         if (pref == null) {
             IScopeContext projectScope = new ProjectScope(project);
@@ -55,9 +54,9 @@ public class RetrieveSetupManager implements ISaveParticipant {
         }
         String retrieveSetup = pref.get(PREF_ID, null);
         if (retrieveSetup == null) {
-            return new ArrayList();
+            return new ArrayList<>();
         }
-        List/* <StandaloneRetrieveSetup> */retrieveSetups;
+        List<StandaloneRetrieveSetup> retrieveSetups;
 
         StandaloneRetrieveSerializer serializer = new StandaloneRetrieveSerializer();
         ByteArrayInputStream in = new ByteArrayInputStream(retrieveSetup.getBytes());
@@ -73,7 +72,7 @@ public class RetrieveSetupManager implements ISaveParticipant {
         return retrieveSetups;
     }
 
-    public void save(final IProject project, List/* <StandaloneRetrieveSetup> */retrieveSetups)
+    public void save(final IProject project, List<StandaloneRetrieveSetup> retrieveSetups)
             throws IOException {
         StandaloneRetrieveSerializer serializer = new StandaloneRetrieveSerializer();
         ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -90,7 +89,7 @@ public class RetrieveSetupManager implements ISaveParticipant {
         final String retrieveSetup = new String(out.toByteArray());
 
         synchronized (projectPrefs) {
-            IEclipsePreferences pref = (IEclipsePreferences) projectPrefs.get(project);
+            IEclipsePreferences pref = projectPrefs.get(project);
             if (pref == null) {
                 IScopeContext projectScope = new ProjectScope(project);
                 pref = projectScope.getNode(IvyPlugin.ID);
@@ -105,19 +104,17 @@ public class RetrieveSetupManager implements ISaveParticipant {
     }
 
     public void saving(ISaveContext context) throws CoreException {
-        Map toFlush = new HashMap();
+        Map<IProject, IEclipsePreferences> toFlush = new HashMap<>();
         synchronized (projectPrefs) {
             toFlush.putAll(projectPrefs);
             projectPrefs.clear();
         }
-        Iterator itPrefs = toFlush.entrySet().iterator();
-        while (itPrefs.hasNext()) {
-            Entry entry = (Entry) itPrefs.next();
+        for (Entry<IProject, IEclipsePreferences> entry : toFlush.entrySet()) {
             try {
-                ((IEclipsePreferences) entry.getValue()).flush();
+                entry.getValue().flush();
             } catch (BackingStoreException e) {
                 IvyPlugin.logError("Failed to save the state of the Ivy preferences of "
-                        + ((IProject) entry.getKey()).getName(), e);
+                        + entry.getKey().getName(), e);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/retrieve/StandaloneRetrieveSerializer.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/retrieve/StandaloneRetrieveSerializer.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/retrieve/StandaloneRetrieveSerializer.java
index 64a810a..4c671d1 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/retrieve/StandaloneRetrieveSerializer.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/retrieve/StandaloneRetrieveSerializer.java
@@ -21,7 +21,6 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import javax.xml.parsers.DocumentBuilder;
@@ -81,7 +80,7 @@ public class StandaloneRetrieveSerializer {
 
     private static final String RESOLVE_IN_WORKSPACE = "resolveInWorkspace";
 
-    public void write(OutputStream out, List/* <StandaloneRetrieveSetup> */setuplist)
+    public void write(OutputStream out, List<StandaloneRetrieveSetup> setuplist)
             throws IOException {
         try {
             StreamResult result = new StreamResult(out);
@@ -92,9 +91,7 @@ public class StandaloneRetrieveSerializer {
             Node root = document.createElement(ROOT);
             document.appendChild(root);
 
-            Iterator it = setuplist.iterator();
-            while (it.hasNext()) {
-                StandaloneRetrieveSetup setup = (StandaloneRetrieveSetup) it.next();
+            for (StandaloneRetrieveSetup setup : setuplist) {
 
                 Node node = document.createElement(SETUP);
                 root.appendChild(node);
@@ -155,9 +152,7 @@ public class StandaloneRetrieveSerializer {
         attr.setValue(settingsSetup.getRawIvyUserDir());
         attributes.setNamedItem(attr);
 
-        Iterator it = settingsSetup.getRawPropertyFiles().iterator();
-        while (it.hasNext()) {
-            String file = (String) it.next();
+        for (String file : settingsSetup.getRawPropertyFiles()) {
             Node pathNode = document.createElement(PROPERTYFILE);
             settingsNode.appendChild(pathNode);
             attributes = pathNode.getAttributes();
@@ -195,7 +190,7 @@ public class StandaloneRetrieveSerializer {
         attributes.setNamedItem(attr);
     }
 
-    public List/* <StandaloneRetrieveSetup> */read(InputStream in, IProject project)
+    public List<StandaloneRetrieveSetup> read(InputStream in, IProject project)
             throws IOException {
         try {
             InputSource source = new InputSource(in);
@@ -206,7 +201,7 @@ public class StandaloneRetrieveSerializer {
 
             NodeList elements = document.getElementsByTagName(SETUP);
 
-            List/* <StandaloneRetrieveSetup> */setupList = new ArrayList();
+            List<StandaloneRetrieveSetup> setupList = new ArrayList<>();
 
             int count = elements.getLength();
             for (int i = 0; i != count; i++) {
@@ -279,7 +274,7 @@ public class StandaloneRetrieveSerializer {
         String ivyUserDir = getAttribute(attributes, IVY_USER_DIR);
         settingsSetup.setIvyUserDir(ivyUserDir);
 
-        List/* <String> */propertyFiles = new ArrayList();
+        List<String> propertyFiles = new ArrayList<>();
 
         NodeList children = node.getChildNodes();
         for (int j = 0; j != children.getLength(); j++) {

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/retrieve/StandaloneRetrieveSetupState.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/retrieve/StandaloneRetrieveSetupState.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/retrieve/StandaloneRetrieveSetupState.java
index d56a0a9..db9bbd4 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/retrieve/StandaloneRetrieveSetupState.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/retrieve/StandaloneRetrieveSetupState.java
@@ -48,7 +48,7 @@ public class StandaloneRetrieveSetupState extends CachedIvy {
         return setup.getInheritedSettingSetup().getResolvedIvyUserDir(setup.getProject());
     }
 
-    protected Collection getPropertyFiles() throws IvyDEException {
+    protected Collection<String> getPropertyFiles() throws IvyDEException {
         return setup.getInheritedSettingSetup().getResolvedPropertyFiles();
     }
 

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/revdepexplorer/IvyUtil.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/revdepexplorer/IvyUtil.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/revdepexplorer/IvyUtil.java
index fc8c70f..3e7ebd2 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/revdepexplorer/IvyUtil.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/revdepexplorer/IvyUtil.java
@@ -21,12 +21,13 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
 import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
+import org.apache.ivy.core.module.id.ModuleId;
+import org.apache.ivyde.eclipse.cp.IvyClasspathContainer;
 import org.apache.ivyde.eclipse.cp.IvyClasspathContainerHelper;
 import org.apache.ivyde.internal.eclipse.cpcontainer.IvyClasspathContainerImpl;
 import org.eclipse.core.resources.IProject;
@@ -37,24 +38,18 @@ public final class IvyUtil {
         // utility class
     }
 
-    public static MultiRevDependencyDescriptor[] getDependencyDescriptorsByProjects(
-            IProject[] projects) {
+    public static MultiRevDependencyDescriptor[] getDependencyDescriptorsByProjects(IProject[] projects) {
         // a temporary cache of multi-revision dependency descriptors
-        Map/* <ModuleId, MultiRevisionDependencyDescriptor> */mdMap = new HashMap();
+        Map<ModuleId, MultiRevDependencyDescriptor> mdMap = new HashMap<>();
 
-        for (int i = 0; i < projects.length; i++) {
-            List containers = IvyClasspathContainerHelper.getContainers(projects[i]);
-            Iterator containerIter = containers.iterator();
-
-            while (containerIter.hasNext()) {
-                IvyClasspathContainerImpl container = (IvyClasspathContainerImpl) containerIter.next();
-                ModuleDescriptor md = container.getState().getCachedModuleDescriptor();
+        for (IProject project : projects) {
+            for (IvyClasspathContainer container : IvyClasspathContainerHelper.getContainers(project)) {
+                ModuleDescriptor md = ((IvyClasspathContainerImpl) container).getState().getCachedModuleDescriptor();
                 if (md == null) {
                     continue;
                 }
                 for (DependencyDescriptor descriptor : md.getDependencies()) {
-                    MultiRevDependencyDescriptor syncabledd = (MultiRevDependencyDescriptor)
-                            mdMap.get(descriptor.getDependencyId());
+                    MultiRevDependencyDescriptor syncabledd = mdMap.get(descriptor.getDependencyId());
 
                     if (syncabledd == null) {
                         syncabledd = new MultiRevDependencyDescriptor(
@@ -68,14 +63,10 @@ public final class IvyUtil {
             }
         }
 
-        List/* <MultiRevisionDependencyDescriptor> */sorted = new ArrayList(mdMap
-                .values());
-
-        Collections.sort(sorted, new Comparator/* <MultiRevisionDependencyDescriptor> */() {
-            public int compare(Object o1, Object o2) {
-                MultiRevDependencyDescriptor desc1 = (MultiRevDependencyDescriptor) o1;
-                MultiRevDependencyDescriptor desc2 = (MultiRevDependencyDescriptor) o2;
+        List<MultiRevDependencyDescriptor> sorted = new ArrayList<>(mdMap.values());
 
+        Collections.sort(sorted, new Comparator<MultiRevDependencyDescriptor>() {
+            public int compare(MultiRevDependencyDescriptor desc1, MultiRevDependencyDescriptor desc2) {
                 int equal = desc1.getOrganization().compareTo(desc2.getOrganization());
                 if (equal == 0) {
                     equal = desc1.getModule().compareTo(desc2.getModule());
@@ -84,8 +75,7 @@ public final class IvyUtil {
             }
         });
 
-        return (MultiRevDependencyDescriptor[]) sorted
-                .toArray(new MultiRevDependencyDescriptor[sorted.size()]);
+        return sorted.toArray(new MultiRevDependencyDescriptor[sorted.size()]);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/revdepexplorer/MultiRevDependencyDescriptor.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/revdepexplorer/MultiRevDependencyDescriptor.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/revdepexplorer/MultiRevDependencyDescriptor.java
index ecd7d25..861e6b5 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/revdepexplorer/MultiRevDependencyDescriptor.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/revdepexplorer/MultiRevDependencyDescriptor.java
@@ -20,21 +20,17 @@ package org.apache.ivyde.internal.eclipse.revdepexplorer;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
 import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
 import org.apache.ivy.core.module.id.ModuleId;
-import org.apache.ivyde.internal.eclipse.cpcontainer.IvyClasspathContainerImpl;
+import org.apache.ivyde.eclipse.cp.IvyClasspathContainer;
 
 public class MultiRevDependencyDescriptor {
     private final ModuleId moduleId;
 
-    /**
-     * Map<IvyClasspathContainer, Collection<DependencyDescriptor>>
-     */
-    private final Map dependenciesByContainer = new HashMap();
+    private final Map<IvyClasspathContainer, Collection<DependencyDescriptor>> dependenciesByContainer = new HashMap<>();
 
     private String newRevision;
 
@@ -71,13 +67,12 @@ public class MultiRevDependencyDescriptor {
      * @param dependencyDescriptor
      *            current descriptor
      */
-    public void addDependencyDescriptor(IvyClasspathContainerImpl container,
+    public void addDependencyDescriptor(IvyClasspathContainer container,
             DependencyDescriptor dependencyDescriptor) {
-        Collection/* <DependencyDescriptor> */dependencies = (Collection) dependenciesByContainer
-                .get(container);
+        Collection<DependencyDescriptor> dependencies = dependenciesByContainer.get(container);
 
         if (dependencies == null) {
-            dependencies = new HashSet/* <DependencyDescriptor> */();
+            dependencies = new HashSet<>();
             dependenciesByContainer.put(container, dependencies);
         }
 
@@ -102,22 +97,15 @@ public class MultiRevDependencyDescriptor {
      * @return all revisions
      */
     public String[] getRevisions() {
-        Set/* <String> */revisions = new HashSet/* <String> */();
-
-        /* Collection<Collection<DependencyDescriptor>> */
-        Collection projectDependencyDescriptors = dependenciesByContainer.values();
+        Set<String> revisions = new HashSet<>();
 
-        Iterator it = projectDependencyDescriptors.iterator();
-        while (it.hasNext()) {
-            Collection/* <DependencyDescriptor> */projectCollection = (Collection) it.next();
-            Iterator descriptorIter = projectCollection.iterator();
-            while (descriptorIter.hasNext()) {
-                DependencyDescriptor descriptor = (DependencyDescriptor) descriptorIter.next();
+        for (Collection<DependencyDescriptor> projectCollection : dependenciesByContainer.values()) {
+            for (DependencyDescriptor descriptor : projectCollection) {
                 revisions.add(descriptor.getDependencyRevisionId().getRevision());
             }
         }
 
-        return (String[]) revisions.toArray(new String[revisions.size()]);
+        return revisions.toArray(new String[revisions.size()]);
     }
 
     /**
@@ -145,10 +133,9 @@ public class MultiRevDependencyDescriptor {
     /**
      * @return all projects
      */
-    public IvyClasspathContainerImpl[] getIvyClasspathContainers() {
-        Collection containers = dependenciesByContainer.keySet();
-        return (IvyClasspathContainerImpl[]) containers.toArray(new IvyClasspathContainerImpl[containers
-                .size()]);
+    public IvyClasspathContainer[] getIvyClasspathContainers() {
+        Collection<IvyClasspathContainer> containers = dependenciesByContainer.keySet();
+        return containers.toArray(new IvyClasspathContainer[containers.size()]);
     }
 
     /**
@@ -156,10 +143,8 @@ public class MultiRevDependencyDescriptor {
      *            classpath container
      * @return true if there is a project match
      */
-    public boolean isForContainer(IvyClasspathContainerImpl container) {
-        IvyClasspathContainerImpl[] containers = getIvyClasspathContainers();
-        for (int i = 0; i < containers.length; i++) {
-            IvyClasspathContainerImpl currentContainer = containers[i];
+    public boolean isForContainer(IvyClasspathContainer container) {
+        for (IvyClasspathContainer currentContainer : getIvyClasspathContainers()) {
             if (currentContainer.equals(container)) {
                 return true;
             }
@@ -181,23 +166,20 @@ public class MultiRevDependencyDescriptor {
      *            container
      * @return revision
      */
-    public String[] getRevisions(IvyClasspathContainerImpl container) {
-        /* Collection<DependencyDescriptor> */
-        Collection containerDependencyDescriptors = (Collection) dependenciesByContainer
+    public String[] getRevisions(IvyClasspathContainer container) {
+        Collection<DependencyDescriptor> containerDependencyDescriptors = dependenciesByContainer
                 .get(container);
 
         if (containerDependencyDescriptors == null) {
             return new String[0];
         }
 
-        Set/* <String> */revisions = new HashSet/* <String> */();
+        Set<String> revisions = new HashSet<>();
 
-        Iterator iter = containerDependencyDescriptors.iterator();
-        while (iter.hasNext()) {
-            DependencyDescriptor descriptor = (DependencyDescriptor) iter.next();
+        for (DependencyDescriptor descriptor : containerDependencyDescriptors) {
             revisions.add(descriptor.getDependencyRevisionId().getRevision());
         }
 
-        return (String[]) revisions.toArray(new String[revisions.size()]);
+        return revisions.toArray(new String[revisions.size()]);
     }
 }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/revdepexplorer/SyncIvyFilesJob.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/revdepexplorer/SyncIvyFilesJob.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/revdepexplorer/SyncIvyFilesJob.java
index 2191b81..070e566 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/revdepexplorer/SyncIvyFilesJob.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/revdepexplorer/SyncIvyFilesJob.java
@@ -38,9 +38,11 @@ import org.apache.ivy.plugins.namespace.NamespaceTransformer;
 import org.apache.ivy.plugins.parser.xml.UpdateOptions;
 import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorUpdater;
 import org.apache.ivyde.eclipse.IvyDEException;
+import org.apache.ivyde.eclipse.cp.IvyClasspathContainer;
 import org.apache.ivyde.eclipse.cp.IvyClasspathContainerConfiguration;
 import org.apache.ivyde.internal.eclipse.IvyPlugin;
 import org.apache.ivyde.internal.eclipse.cpcontainer.IvyClasspathContainerImpl;
+import org.apache.ivyde.internal.eclipse.cpcontainer.IvyClasspathContainerState;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IWorkspace;
 import org.eclipse.core.resources.WorkspaceJob;
@@ -106,28 +108,23 @@ public class SyncIvyFilesJob extends WorkspaceJob {
         MultiStatus errorStatuses = new MultiStatus(IvyPlugin.ID, IStatus.ERROR,
                 "Failed to update one or more Ivy files.  See details.", null);
 
-        IvyClasspathContainerImpl[] containers = getIvyClasspathContainers();
-        for (int i = 0; i < containers.length; i++) {
-            IvyClasspathContainerImpl container = containers[i];
+        for (IvyClasspathContainer container : getIvyClasspathContainers()) {
+            IvyClasspathContainerState ivycps = ((IvyClasspathContainerImpl) container).getState();
 
-            ModuleDescriptor md = container.getState().getCachedModuleDescriptor();
+            ModuleDescriptor md = ivycps.getCachedModuleDescriptor();
             if (md == null) {
                 continue;
             }
 
-            Map/* <ModuleRevisionId, String> */newRevisions = new HashMap();
-
-            DependencyDescriptor[] dependencies = md.getDependencies();
-            for (int j = 0; j < dependencies.length; j++) {
-                for (int k = 0; k < multiRevisionDependencies.length; k++) {
-                    MultiRevDependencyDescriptor multiRevision = multiRevisionDependencies[k];
-                    ModuleRevisionId dependencyRevisionId = dependencies[j]
-                            .getDependencyRevisionId();
-                    if (dependencies[j].getDependencyId().equals(multiRevision.getModuleId())
+            Map<ModuleRevisionId, String> newRevisions = new HashMap<>();
+            for (DependencyDescriptor dependency : md.getDependencies()) {
+                for (MultiRevDependencyDescriptor multiRevision : multiRevisionDependencies) {
+                    ModuleRevisionId dependencyRevisionId = dependency.getDependencyRevisionId();
+                    if (dependency.getDependencyId().equals(multiRevision.getModuleId())
                             && multiRevision.hasNewRevision()
                             && multiRevision.isForContainer(container)) {
                         newRevisions.put(dependencyRevisionId,
-                            multiRevisionDependencies[k].getNewRevision());
+                                multiRevision.getNewRevision());
                         break; // move on to the next dependency
                     }
                 }
@@ -139,7 +136,7 @@ public class SyncIvyFilesJob extends WorkspaceJob {
 
             File ivyFile;
             try {
-                ivyFile = container.getState().getIvyFile();
+                ivyFile = ivycps.getIvyFile();
             } catch (IvyDEException e) {
                 errorStatuses.add(new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR,
                         "Fail to resolve the ivy file", e));
@@ -180,21 +177,19 @@ public class SyncIvyFilesJob extends WorkspaceJob {
         return status;
     }
 
-    private IvyClasspathContainerImpl[] getIvyClasspathContainers() {
-        Collection/* <IvyClasspathContainer> */containers = new HashSet();
+    private Collection<IvyClasspathContainer> getIvyClasspathContainers() {
+        Collection<IvyClasspathContainer> containers = new HashSet<>();
 
-        for (int i = 0; i < multiRevisionDependencies.length; i++) {
-            MultiRevDependencyDescriptor multiRevision = multiRevisionDependencies[i];
+        for (MultiRevDependencyDescriptor multiRevision : multiRevisionDependencies) {
             if (multiRevision.hasNewRevision()) {
                 containers.addAll(Arrays.asList(multiRevision.getIvyClasspathContainers()));
             }
         }
 
-        return (IvyClasspathContainerImpl[]) containers.toArray(new IvyClasspathContainerImpl[containers
-                .size()]);
+        return containers;
     }
 
-    private void saveChanges(IvyClasspathContainerImpl container, File permanentSaveTarget,
+    private void saveChanges(IvyClasspathContainer container, File permanentSaveTarget,
             File temporaryChanges) throws IOException {
         IvyClasspathContainerConfiguration conf = container.getConf();
         IFile virtualIvyFile = conf.getJavaProject().getProject().getFile(conf.getIvyXmlPath());

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/AdvancedSetupTab.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/AdvancedSetupTab.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/AdvancedSetupTab.java
index c368c74..ad29bd6 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/AdvancedSetupTab.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/AdvancedSetupTab.java
@@ -53,4 +53,4 @@ public class AdvancedSetupTab extends AbstractSetupTab {
         return advancedSetupEditor;
     }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/ConfTableViewer.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/ConfTableViewer.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/ConfTableViewer.java
index d9e9092..9eb50eb 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/ConfTableViewer.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/ConfTableViewer.java
@@ -18,8 +18,7 @@
 package org.apache.ivyde.internal.eclipse.ui;
 
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
+import java.util.Collections;
 import java.util.List;
 
 import org.apache.ivy.core.module.descriptor.Configuration;
@@ -45,7 +44,7 @@ public class ConfTableViewer extends Composite {
 
     private CheckboxTableViewer confTableViewer;
 
-    private final List listeners = new ArrayList();
+    private final List<ConfTableListener> listeners = new ArrayList<>();
 
     private final Button selectAll;
 
@@ -191,22 +190,21 @@ public class ConfTableViewer extends Composite {
         confTableViewer.setInput(orderedConfigurations);
     }
 
-    public void init(List/* <String> */confs) {
+    public void init(List<String> confs) {
         boolean enabled;
         if (confs.size() == 1 && "*".equals(confs.get(0))) {
             enabled = true;
             selectAll.setSelection(true);
-            for (int i = 0; i < orderedConfigurations.length; i++) {
-                confTableViewer.setChecked(orderedConfigurations[i], true);
+            for (Configuration orderedConfiguration : orderedConfigurations) {
+                confTableViewer.setChecked(orderedConfiguration, true);
             }
         } else {
             enabled = false;
             selectAll.setSelection(false);
-            for (int i = 0; i < confs.size(); i++) {
-                String c = (String) confs.get(i);
-                for (int j = 0; j < orderedConfigurations.length; j++) {
-                    if (orderedConfigurations[j].getName().equals(c)) {
-                        confTableViewer.setChecked(orderedConfigurations[j], true);
+            for (String conf : confs) {
+                for (Configuration orderedConfiguration : orderedConfigurations) {
+                    if (orderedConfiguration.getName().equals(conf)) {
+                        confTableViewer.setChecked(orderedConfiguration, true);
                         break;
                     }
                 }
@@ -217,15 +215,13 @@ public class ConfTableViewer extends Composite {
         updateUpDownEnableButtons(enabled);
     }
 
-    public List getSelectedConfigurations() {
+    public List<String> getSelectedConfigurations() {
         if (selectAll.getSelection()) {
-            return Arrays.asList(new String[] {"*"});
+            return Collections.singletonList("*");
         }
-        Object[] confs = confTableViewer.getCheckedElements();
-        List confList = new ArrayList();
-        for (int i = 0; i < confs.length; i++) {
-            Configuration c = (Configuration) confs[i];
-            confList.add(c.getName());
+        List<String> confList = new ArrayList<>();
+        for (Object conf : confTableViewer.getCheckedElements()) {
+            confList.add(((Configuration) conf).getName());
         }
         return confList;
     }
@@ -245,7 +241,7 @@ public class ConfTableViewer extends Composite {
     }
 
     public interface ConfTableListener {
-        void confTableUpdated(List confs);
+        void confTableUpdated(List<String> confs);
     }
 
     public void addListener(ConfTableListener listener) {
@@ -260,11 +256,10 @@ public class ConfTableViewer extends Composite {
         }
     }
 
-    void confTableUpdated() {
+    private void confTableUpdated() {
         synchronized (listeners) {
-            Iterator it = listeners.iterator();
-            while (it.hasNext()) {
-                ((ConfTableListener) it.next()).confTableUpdated(getSelectedConfigurations());
+            for (ConfTableListener listener : listeners) {
+                listener.confTableUpdated(getSelectedConfigurations());
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/FileListEditor.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/FileListEditor.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/FileListEditor.java
index e91c6f7..e642f70 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/FileListEditor.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/FileListEditor.java
@@ -41,7 +41,7 @@ public class FileListEditor extends Composite {
 
     private final ListViewer filelist;
 
-    private List/* <String> */files = new ArrayList();
+    private List<String> files = new ArrayList<>();
 
     private Button edit;
 
@@ -120,8 +120,9 @@ public class FileListEditor extends Composite {
         remove.setText("Remove");
         remove.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
         remove.addSelectionListener(new SelectionAdapter() {
+            @SuppressWarnings("unchecked")
             public void widgetSelected(SelectionEvent e) {
-                List selection = ((IStructuredSelection) filelist.getSelection()).toList();
+                List<String> selection = ((IStructuredSelection) filelist.getSelection()).toList();
                 files.removeAll(selection);
                 filelist.refresh();
                 fileListUpdated();
@@ -136,7 +137,7 @@ public class FileListEditor extends Composite {
         up.addSelectionListener(new SelectionAdapter() {
             public void widgetSelected(SelectionEvent e) {
                 int i = getSelectedConfigurationIndex();
-                String f = (String) files.get(i);
+                String f = files.get(i);
                 files.set(i, files.get(i - 1));
                 files.set(i - 1, f);
                 filelist.refresh();
@@ -151,7 +152,7 @@ public class FileListEditor extends Composite {
         down.addSelectionListener(new SelectionAdapter() {
             public void widgetSelected(SelectionEvent e) {
                 int i = getSelectedConfigurationIndex();
-                String f = (String) files.get(i);
+                String f = files.get(i);
                 files.set(i, files.get(i + 1));
                 files.set(i + 1, f);
                 filelist.refresh();
@@ -168,12 +169,7 @@ public class FileListEditor extends Composite {
     }
 
     private int getSelectedConfigurationIndex(String file) {
-        for (int i = 0; i < files.size(); i++) {
-            if (files.get(i) == file) {
-                return i;
-            }
-        }
-        return -1;
+        return files.indexOf(file);
     }
 
     private void updateUpDownEnableButtons(boolean enabled) {
@@ -183,7 +179,7 @@ public class FileListEditor extends Composite {
         down.setEnabled(enabled && selected && i < files.size() - 1);
     }
 
-    public void init(List/* <String> */files) {
+    public void init(List<String> files) {
         this.files = files;
         filelist.setInput(files);
         remove.setEnabled(false);
@@ -194,7 +190,7 @@ public class FileListEditor extends Composite {
         // to be override to listen to changes
     }
 
-    public List getFiles() {
+    public List<String> getFiles() {
         return files;
     }
 

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/f808b0b4/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/IvyFilePathText.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/IvyFilePathText.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/IvyFilePathText.java
index 17764f1..2299118 100644
--- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/IvyFilePathText.java
+++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/ui/IvyFilePathText.java
@@ -20,7 +20,6 @@ package org.apache.ivyde.internal.eclipse.ui;
 import java.io.File;
 import java.net.MalformedURLException;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.ivyde.eclipse.IvyDEException;
@@ -47,7 +46,7 @@ public class IvyFilePathText extends PathEditor {
 
     private IvyDEException ivyXmlError;
 
-    private final List listeners = new ArrayList();
+    private final List<IvyXmlPathListener> listeners = new ArrayList<>();
 
     private FieldDecoration errorDecoration;
 
@@ -124,9 +123,8 @@ public class IvyFilePathText extends PathEditor {
 
     void ivyXmlPathUpdated() {
         synchronized (listeners) {
-            Iterator it = listeners.iterator();
-            while (it.hasNext()) {
-                ((IvyXmlPathListener) it.next()).ivyXmlPathUpdated(ivyFilePathText.getText());
+            for (IvyXmlPathListener listener : listeners) {
+                listener.ivyXmlPathUpdated(ivyFilePathText.getText());
             }
         }
     }


Mime
View raw message