ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gin...@apache.org
Subject ant-ivyde git commit: Generics in visualizer
Date Sun, 05 Nov 2017 23:25:40 GMT
Repository: ant-ivyde
Updated Branches:
  refs/heads/master f808b0b4f -> 6ab8e4c1b


Generics in visualizer

Project: http://git-wip-us.apache.org/repos/asf/ant-ivyde/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-ivyde/commit/6ab8e4c1
Tree: http://git-wip-us.apache.org/repos/asf/ant-ivyde/tree/6ab8e4c1
Diff: http://git-wip-us.apache.org/repos/asf/ant-ivyde/diff/6ab8e4c1

Branch: refs/heads/master
Commit: 6ab8e4c1b2c3ea13aa3ef046521e58073040c557
Parents: f808b0b
Author: Gintas Grigelionis <gintas@apache.org>
Authored: Mon Nov 6 00:25:27 2017 +0100
Committer: Gintas Grigelionis <gintas@apache.org>
Committed: Mon Nov 6 00:25:27 2017 +0100

----------------------------------------------------------------------
 .../ClasspathContainerSelectionDialog.java      |  7 +-
 .../resolvevisualizer/IvyNodeLabelProvider.java | 68 ++++++++++----------
 .../MessageContentProvider.java                 | 19 +++---
 .../ResolveVisualizerContentProvider.java       | 15 ++---
 .../ResolveVisualizerForm.java                  | 16 ++---
 .../ResolveVisualizerView.java                  | 43 ++++++-------
 .../label/AllCallersAlgorithm.java              | 12 ++--
 .../label/AllDependencyAlgorithm.java           | 16 ++---
 .../label/AllRootPathsAlgorithm.java            | 15 +++--
 .../label/ConfigurationConflictAlgorithm.java   | 13 ++--
 .../label/DirectDependenciesAlgorithm.java      | 11 ++--
 .../label/ILabelDecoratorAlgorithm.java         |  5 +-
 .../label/SameModuleIdAlgorithm.java            | 14 ++--
 .../label/ShortestRootPathAlgorithm.java        | 40 ++++++------
 .../resolvevisualizer/model/IvyNodeElement.java | 33 +++++-----
 .../model/IvyNodeElementAdapter.java            | 59 +++++++----------
 .../model/IvyNodeElementFilterAdapter.java      | 10 +--
 17 files changed, 187 insertions(+), 209 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/6ab8e4c1/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ClasspathContainerSelectionDialog.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ClasspathContainerSelectionDialog.java b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ClasspathContainerSelectionDialog.java
index 59725c8..a2c10e6 100644
--- a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ClasspathContainerSelectionDialog.java
+++ b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ClasspathContainerSelectionDialog.java
@@ -39,10 +39,9 @@ public class ClasspathContainerSelectionDialog extends ElementListSelectionDialo
         setTitle("Ivy Classpath Containers");
         setMessage("Select a container to view in the resolve visualizer.");
 
-        List/* <IvyClasspathContainer> */classpathContainers = new ArrayList();
-        IProject[] ivyProjects = IvyClasspathContainerHelper.getIvyProjectsInWorkspace();
-        for (int i = 0; i < ivyProjects.length; i++) {
-            classpathContainers.addAll(IvyClasspathContainerHelper.getContainers(ivyProjects[i]));
+        List<IvyClasspathContainer> classpathContainers = new ArrayList<>();
+        for (IProject ivyProject : IvyClasspathContainerHelper.getIvyProjectsInWorkspace()) {
+            classpathContainers.addAll(IvyClasspathContainerHelper.getContainers(ivyProject));
         }
 
         setElements(classpathContainers.toArray());

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/6ab8e4c1/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/IvyNodeLabelProvider.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/IvyNodeLabelProvider.java b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/IvyNodeLabelProvider.java
index f2d8c92..8ea39b7 100644
--- a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/IvyNodeLabelProvider.java
+++ b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/IvyNodeLabelProvider.java
@@ -18,7 +18,6 @@
 package org.apache.ivyde.eclipse.resolvevisualizer;
 
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 
 import org.apache.ivyde.eclipse.resolvevisualizer.label.ConfigurationConflictAlgorithm;
@@ -53,8 +52,8 @@ public class IvyNodeLabelProvider implements ILabelProvider, IConnectionStylePro
 
     private IvyNodeElement selected = null;
     private IvyNodeElement rootNode = null;
-    private Map/* <EntityConnectionData, Color> */highlightedRelationships = new HashMap/* <EntityConnectionData, Color> */();
-    private Map/* <IvyNodeElement, Color> */highlightedDependencies = new HashMap/* <IvyNodeElement, Color> */();
+    private Map<EntityConnectionData, ConnectionStyle> highlightedRelationships = new HashMap<>();
+    private Map<IvyNodeElement, Color> highlightedDependencies = new HashMap<>();
     private Color disabledColor = null;
     private IvyNodeElement pinnedNode = null;
     private final GraphViewer viewer;
@@ -116,8 +115,9 @@ public class IvyNodeLabelProvider implements ILabelProvider, IConnectionStylePro
      * @return Color
      */
     public Color getColor(Object rel) {
-        if (highlightedRelationships.keySet().contains(rel)) {
-            ConnectionStyle style = (ConnectionStyle) highlightedRelationships.get(rel);
+        EntityConnectionData key = (EntityConnectionData) rel;
+        if (highlightedRelationships.keySet().contains(key)) {
+            ConnectionStyle style = highlightedRelationships.get(rel);
             return style.getHighlightColor();
         }
         return LIGHT_GRAY;
@@ -135,8 +135,9 @@ public class IvyNodeLabelProvider implements ILabelProvider, IConnectionStylePro
      * @return Color
      */
     public Color getHighlightColor(Object rel) {
-        if (highlightedRelationships.keySet().contains(rel)) {
-            ConnectionStyle style = (ConnectionStyle) highlightedRelationships.get(rel);
+        EntityConnectionData key = (EntityConnectionData) rel;
+        if (highlightedRelationships.keySet().contains(key)) {
+            ConnectionStyle style = highlightedRelationships.get(rel);
             return style.getHighlightColor();
         }
         return ColorConstants.blue;
@@ -147,8 +148,9 @@ public class IvyNodeLabelProvider implements ILabelProvider, IConnectionStylePro
     }
 
     public int getLineWidth(Object rel) {
-        if (highlightedRelationships.keySet().contains(rel)) {
-            ConnectionStyle style = (ConnectionStyle) highlightedRelationships.get(rel);
+        EntityConnectionData key = (EntityConnectionData) rel;
+        if (highlightedRelationships.keySet().contains(key)) {
+            ConnectionStyle style = highlightedRelationships.get(rel);
             if (style.isRevealOnHighlight()) {
                 return style.getLineWidth();
             }
@@ -160,7 +162,8 @@ public class IvyNodeLabelProvider implements ILabelProvider, IConnectionStylePro
         return null;
     }
 
-    public Color getBorderColor(Object entity) {
+    public Color getBorderColor(Object node) {
+        IvyNodeElement entity = (IvyNodeElement) node;
         if (this.selected != null || this.pinnedNode != null) {
             if (entity == this.selected || entity == this.pinnedNode) {
                 return BLACK;
@@ -172,7 +175,6 @@ public class IvyNodeLabelProvider implements ILabelProvider, IConnectionStylePro
             }
 
         }
-
         return BLACK;
     }
 
@@ -184,8 +186,8 @@ public class IvyNodeLabelProvider implements ILabelProvider, IConnectionStylePro
         return 0;
     }
 
-    public Color getBackgroundColour(Object entity) {
-
+    public Color getBackgroundColour(Object node) {
+        IvyNodeElement entity = (IvyNodeElement) node;
         if (entity == this.rootNode) {
             if (rootColor == null) {
                 rootColor = LIGHT_GREEN;
@@ -193,13 +195,14 @@ public class IvyNodeLabelProvider implements ILabelProvider, IConnectionStylePro
             return rootColor;
         }
         if (highlightedDependencies.keySet().contains(entity)) {
-            return (Color) highlightedDependencies.get(entity); // viewer.getGraphControl().HIGHLIGHT_ADJACENT_COLOR;
+            return highlightedDependencies.get(entity); // viewer.getGraphControl().HIGHLIGHT_ADJACENT_COLOR;
         } else {
             return viewer.getGraphControl().DEFAULT_NODE_COLOR;
         }
     }
 
-    public Color getForegroundColour(Object entity) {
+    public Color getForegroundColour(Object node) {
+        IvyNodeElement entity = (IvyNodeElement) node;
         if (this.selected != null || this.pinnedNode != null) {
             if (entity == this.selected || this.pinnedNode == entity) {
                 return BLACK;
@@ -232,10 +235,8 @@ public class IvyNodeLabelProvider implements ILabelProvider, IConnectionStylePro
      * @param currentSelection IvyNodeElement
      */
     public void setCurrentSelection(IvyNodeElement root, IvyNodeElement currentSelection) {
-        for (Iterator iter = highlightedRelationships.keySet().iterator(); iter.hasNext();) {
-            EntityConnectionData entityConnectionData = (EntityConnectionData) iter.next();
-
-            ConnectionStyle style = (ConnectionStyle) highlightedRelationships.get(entityConnectionData);
+        for (EntityConnectionData entityConnectionData : highlightedRelationships.keySet()) {
+            ConnectionStyle style = highlightedRelationships.get(entityConnectionData);
             if (style.isRevealOnHighlight()) {
                 viewer.unReveal(entityConnectionData);
             }
@@ -245,29 +246,27 @@ public class IvyNodeLabelProvider implements ILabelProvider, IConnectionStylePro
         this.selected = null;
         this.selected = currentSelection;
 
-        highlightedRelationships = new HashMap/* <EntityConnectionData, Color> */();
-        highlightedDependencies = new HashMap/* <IvyNodeElement, Color> */();
+        highlightedRelationships = new HashMap<>();
+        highlightedDependencies = new HashMap<>();
 
-        rootDirectDependenciesDecorator.calculateHighlighted(root, root, highlightedRelationships,
-                highlightedDependencies);
+        rootDirectDependenciesDecorator.calculateHighlighted(root, root,
+                highlightedRelationships, highlightedDependencies);
         conflictDecorator.calculateHighlighted(root, root, highlightedRelationships, highlightedDependencies);
 
         if (this.selected != null || this.pinnedNode != null) {
-            autoSelectDecorator.calculateHighlighted(root, selected, highlightedRelationships, highlightedDependencies);
+            autoSelectDecorator.calculateHighlighted(root, selected,
+                    highlightedRelationships, highlightedDependencies);
         }
 
-        Object[] connections = viewer.getConnectionElements();
-        for (Iterator iter = highlightedRelationships.keySet().iterator(); iter.hasNext();) {
-            Object entityConnectionData = iter.next();
-
-            ConnectionStyle style = (ConnectionStyle) highlightedRelationships.get(entityConnectionData);
+        for (EntityConnectionData entityConnectionData : highlightedRelationships.keySet()) {
+            ConnectionStyle style = highlightedRelationships.get(entityConnectionData);
             if (style.isRevealOnHighlight()) {
                 viewer.reveal(entityConnectionData);
             }
         }
 
-        for (int i = 0; i < connections.length; i++) {
-            viewer.update(connections[i], null);
+        for (Object connection : viewer.getConnectionElements()) {
+            viewer.update(connection, null);
         }
     }
 
@@ -292,10 +291,9 @@ public class IvyNodeLabelProvider implements ILabelProvider, IConnectionStylePro
             IvyNodeElement source = (IvyNodeElement) connection.source;
             IvyNodeElement dest = (IvyNodeElement) connection.dest;
 
-            String[] confs = dest.getCallerConfigurations(source);
-            String tooltipText = "";
-            for (int i = 0; i < confs.length; i++) {
-                tooltipText += confs[i] + ", ";
+            StringBuilder tooltipText = new StringBuilder();
+            for (String conf : dest.getCallerConfigurations(source)) {
+                tooltipText.append(conf).append(", ");
             }
             return new Label(tooltipText.substring(0, tooltipText.length() - 2));
         }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/6ab8e4c1/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/MessageContentProvider.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/MessageContentProvider.java b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/MessageContentProvider.java
index 5752779..313e7cc 100644
--- a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/MessageContentProvider.java
+++ b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/MessageContentProvider.java
@@ -20,7 +20,6 @@ package org.apache.ivyde.eclipse.resolvevisualizer;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Map;
 
 import org.apache.ivy.core.module.id.ModuleId;
@@ -42,23 +41,21 @@ public class MessageContentProvider {
         }
         manager.removeAllMessages();
 
-        Map/* <ModuleId, Collection<IvyNodeElement>> */conflicts = new HashMap/* <ModuleId, Collection<IvyNodeElement>> */();
+        Map<ModuleId, Collection<IvyNodeElement>> conflicts = new HashMap<>();
 
-        IvyNodeElement[] deepDependencies = root.getDeepDependencies();
-        for (int i = 0; i < deepDependencies.length; i++) {
-            if (deepDependencies[i].getConflicts().length > 0) {
-                Collection/* <IvyNodeElement> */conflictParticipants = (Collection) conflicts.get(deepDependencies[i]
+        for (IvyNodeElement deepDependency : root.getDeepDependencies()) {
+            if (deepDependency.getConflicts().length > 0) {
+                Collection<IvyNodeElement> conflictParticipants = conflicts.get(deepDependency
                         .getModuleRevisionId().getModuleId());
                 if (conflictParticipants == null) {
-                    conflictParticipants = new HashSet/* <IvyNodeElement> */();
+                    conflictParticipants = new HashSet<>();
                 }
-                conflictParticipants.add(deepDependencies[i]);
-                conflicts.put(deepDependencies[i].getModuleRevisionId().getModuleId(), conflictParticipants);
+                conflictParticipants.add(deepDependency);
+                conflicts.put(deepDependency.getModuleRevisionId().getModuleId(), conflictParticipants);
             }
         }
 
-        for (Iterator conflictIter = conflicts.keySet().iterator(); conflictIter.hasNext();) {
-            ModuleId conflictKey = (ModuleId) conflictIter.next();
+        for (ModuleId conflictKey : conflicts.keySet()) {
             manager.addMessage(conflictKey,
                     "Conflict on module " + conflictKey.getOrganisation() + "#" + conflictKey.getName(),
                     conflicts.get(conflictKey), IMessageProvider.ERROR);

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/6ab8e4c1/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ResolveVisualizerContentProvider.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ResolveVisualizerContentProvider.java b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ResolveVisualizerContentProvider.java
index 41522c7..91d136a 100644
--- a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ResolveVisualizerContentProvider.java
+++ b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ResolveVisualizerContentProvider.java
@@ -22,7 +22,6 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.ivyde.eclipse.resolvevisualizer.model.IIvyNodeElementFilter;
@@ -31,7 +30,7 @@ import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.zest.core.viewers.IGraphEntityContentProvider;
 
 public class ResolveVisualizerContentProvider implements IGraphEntityContentProvider {
-    Collection/* <IIvyNodeElementFilter> */filters = new HashSet/* <IIvyNodeElementFilter> */();
+    final Collection<IIvyNodeElementFilter> filters = new HashSet<>();
 
     // Returns all entities that should be linked with the given entity
     public Object[] getConnectedTo(Object entity) {
@@ -43,7 +42,7 @@ public class ResolveVisualizerContentProvider implements IGraphEntityContentProv
             return new Object[] {};
         } else {
             IvyNodeElement inputNode = (IvyNodeElement) inputElement;
-            List elements = Arrays.asList(filter(inputNode.getDeepDependencies()));
+            List<IvyNodeElement> elements = Arrays.asList(filter(inputNode.getDeepDependencies()));
             Collections.sort(elements, new IvyNodeElementComparator());
             return elements.toArray();
         }
@@ -51,8 +50,7 @@ public class ResolveVisualizerContentProvider implements IGraphEntityContentProv
 
     public IvyNodeElement[] filter(IvyNodeElement[] deepDependencies) {
         IvyNodeElement[] filtered = deepDependencies;
-        for (Iterator iter = filters.iterator(); iter.hasNext();) {
-            IIvyNodeElementFilter filter = (IIvyNodeElementFilter) iter.next();
+        for (IIvyNodeElementFilter filter : filters) {
             filtered = filter.filter(filtered); // I love this line
         }
 
@@ -70,11 +68,8 @@ public class ResolveVisualizerContentProvider implements IGraphEntityContentProv
     public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
     }
 
-    private class IvyNodeElementComparator implements Comparator {
-        public int compare(Object arg1, Object arg2) {
-            IvyNodeElement element1 = (IvyNodeElement) arg1;
-            IvyNodeElement element2 = (IvyNodeElement) arg2;
-
+    private class IvyNodeElementComparator implements Comparator<IvyNodeElement> {
+        public int compare(IvyNodeElement element1, IvyNodeElement element2) {
             if (element1.getDepth() > element2.getDepth()) {
                 return -1;
             } else if (element1.getDepth() < element2.getDepth()) {

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/6ab8e4c1/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ResolveVisualizerForm.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ResolveVisualizerForm.java b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ResolveVisualizerForm.java
index 3893c82..d0eccfc 100644
--- a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ResolveVisualizerForm.java
+++ b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ResolveVisualizerForm.java
@@ -160,7 +160,8 @@ public class ResolveVisualizerForm {
         enableSearchBox(false);
 
         form.getForm().addMessageHyperlinkListener(new HyperlinkAdapter() {
-            public void linkActivated(org.eclipse.ui.forms.events.HyperlinkEvent e) {
+            @SuppressWarnings("unchecked")
+            public void linkActivated(HyperlinkEvent e) {
                 String title = e.getLabel();
                 Object href = e.getHref();
                 if (href instanceof IMessage[] && ((IMessage[]) href).length > 1) {
@@ -192,18 +193,16 @@ public class ResolveVisualizerForm {
                     group.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
                     FormText text = toolkit.createFormText(group, true);
                     configureFormText(ResolveVisualizerForm.this.form.getForm(), text);
-                    if (href instanceof IMessage[]) {
-                        text.setText(createFormTextContent((IMessage[]) href), true, false);
-                    }
+                    text.setText(createFormTextContent((IMessage[]) href), true, false);
 
                     shell.setLocation(hl);
                     shell.pack();
                     shell.open();
                 } else if (href instanceof IMessage[]) {
                     IMessage oneMessage = ((IMessage[]) href)[0];
-                    Set/* <IvyNodeElement> */conflicts = (Set/* <IvyNodeElement> */) oneMessage.getData();
+                    Set<IvyNodeElement> conflicts = (Set<IvyNodeElement>) oneMessage.getData();
                     if (conflicts != null) {
-                        viewer.setSelection(new StructuredSelection(new ArrayList(conflicts)));
+                        viewer.setSelection(new StructuredSelection(new ArrayList<>(conflicts)));
                     }
                 }
             }
@@ -458,6 +457,7 @@ public class ResolveVisualizerForm {
 
     private void configureFormText(final Form form, FormText text) {
         text.addHyperlinkListener(new HyperlinkAdapter() {
+            @SuppressWarnings("unchecked")
             public void linkActivated(HyperlinkEvent e) {
                 String is = (String) e.getHref();
                 try {
@@ -465,9 +465,9 @@ public class ResolveVisualizerForm {
                     int index = Integer.parseInt(is);
                     IMessage[] messages = form.getChildrenMessages();
                     IMessage message = messages[index];
-                    Set/* <IvyNodeElement> */conflicts = (Set/* <IvyNodeElement> */) message.getData();
+                    Set<IvyNodeElement> conflicts = (Set<IvyNodeElement>) message.getData();
                     if (conflicts != null) {
-                        viewer.setSelection(new StructuredSelection(new ArrayList(conflicts)));
+                        viewer.setSelection(new StructuredSelection(new ArrayList<>(conflicts)));
                     }
                 } catch (NumberFormatException ex) {
                 }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/6ab8e4c1/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ResolveVisualizerView.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ResolveVisualizerView.java b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ResolveVisualizerView.java
index 6e4fbac..5590d89 100644
--- a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ResolveVisualizerView.java
+++ b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ResolveVisualizerView.java
@@ -18,12 +18,12 @@
 package org.apache.ivyde.eclipse.resolvevisualizer;
 
 import java.awt.Dimension;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 import java.util.Stack;
 
 import org.apache.ivy.core.report.ResolveReport;
@@ -72,7 +72,6 @@ import org.eclipse.zest.layouts.algorithms.HorizontalShift;
 
 public class ResolveVisualizerView extends ViewPart implements IZoomableWorkbenchPart {
     private GraphViewer viewer;
-    private FormToolkit toolKit;
 
     private Action focusDialogAction;
     private Action focusDialogActionToolbar;
@@ -87,8 +86,8 @@ public class ResolveVisualizerView extends ViewPart implements IZoomableWorkbenc
     private ZoomContributionViewItem contextZoomContributionViewItem;
     private ZoomContributionViewItem toolbarZoomContributionViewItem;
 
-    private Stack/* <IvyNodeElement> */historyStack;
-    private Stack/* <IvyNodeElement> */forwardStack;
+    private final Stack<IvyNodeElement> historyStack;
+    private final Stack<IvyNodeElement> forwardStack;
 
     private IvyNodeElement currentRoot;
     private IvyNodeElement currentSelection;
@@ -102,8 +101,8 @@ public class ResolveVisualizerView extends ViewPart implements IZoomableWorkbenc
     private final ForceHiddenFilter forceHiddenFilter;
 
     public ResolveVisualizerView() {
-        historyStack = new Stack/* <IvyNodeElement> */();
-        forwardStack = new Stack/* <IvyNodeElement> */();
+        historyStack = new Stack<>();
+        forwardStack = new Stack<>();
 
         forceHiddenFilter = new ForceHiddenFilter();
         forceHiddenFilter.setEnabled(true);
@@ -116,7 +115,7 @@ public class ResolveVisualizerView extends ViewPart implements IZoomableWorkbenc
      * @param parent Composite
      */
     public void createPartControl(Composite parent) {
-        toolKit = new FormToolkit(parent.getDisplay());
+        FormToolkit toolKit = new FormToolkit(parent.getDisplay());
 
         visualizationForm = new ResolveVisualizerForm(parent, toolKit, this);
         viewer = visualizationForm.getGraphViewer();
@@ -147,26 +146,24 @@ public class ResolveVisualizerView extends ViewPart implements IZoomableWorkbenc
         });
 
         visualizationForm.getSearchBox().addModifyListener(new ModifyListener() {
+            @SuppressWarnings("unchecked")
             public void modifyText(ModifyEvent e) {
                 String textString = visualizationForm.getSearchBox().getText();
 
-                HashMap figureListing = new HashMap();
-                ArrayList list = new ArrayList();
-                Iterator iterator = viewer.getGraphControl().getNodes().iterator();
-                while (iterator.hasNext()) {
-                    GraphItem item = (GraphItem) iterator.next();
+                Map<String, GraphItem> figureListing = new HashMap<>();
+                List<GraphItem> list = (List<GraphItem>) viewer.getGraphControl().getNodes();
+                for (GraphItem item : list) {
                     figureListing.put(item.getText(), item);
                 }
-                iterator = figureListing.keySet().iterator();
+                list.clear();
                 if (textString.length() > 0) {
-                    while (iterator.hasNext()) {
-                        String string = (String) iterator.next();
+                    for (String string : figureListing.keySet()) {
                         if (string.toLowerCase().contains(textString.toLowerCase())) {
                             list.add(figureListing.get(string));
                         }
                     }
                 }
-                viewer.getGraphControl().setSelection((GraphItem[]) list.toArray(new GraphItem[list.size()]));
+                viewer.getGraphControl().setSelection(list.toArray(new GraphItem[list.size()]));
             }
         });
 
@@ -299,7 +296,7 @@ public class ResolveVisualizerView extends ViewPart implements IZoomableWorkbenc
         historyAction = new Action() {
             public void run() {
                 if (historyStack.size() > 0) {
-                    IvyNodeElement element = (IvyNodeElement) historyStack.pop();
+                    IvyNodeElement element = historyStack.pop();
                     forwardStack.push(currentRoot);
                     forwardAction.setEnabled(true);
                     focusOn(element);
@@ -318,7 +315,7 @@ public class ResolveVisualizerView extends ViewPart implements IZoomableWorkbenc
         forwardAction = new Action() {
             public void run() {
                 if (forwardStack.size() > 0) {
-                    IvyNodeElement element = (IvyNodeElement) forwardStack.pop();
+                    IvyNodeElement element = forwardStack.pop();
 
                     historyStack.push(currentRoot);
                     historyAction.setEnabled(true);
@@ -394,16 +391,16 @@ public class ResolveVisualizerView extends ViewPart implements IZoomableWorkbenc
      *
      * @param focus IvyNodeElement
      */
+    @SuppressWarnings("unchecked")
     public void focusOn(IvyNodeElement focus) {
         viewer.setSelection(new StructuredSelection(focus));
         viewer.setFilters(new ViewerFilter[] {});
         viewer.setInput(focus);
 
-        Iterator nodes = viewer.getGraphControl().getNodes().iterator();
         Graph graph = viewer.getGraphControl();
         Dimension centre = new Dimension(graph.getBounds().width / 2, graph.getBounds().height / 2);
-        while (nodes.hasNext()) {
-            GraphNode graphNode = (GraphNode) nodes.next();
+        List<GraphNode> list = (List<GraphNode>) viewer.getGraphControl().getNodes();
+        for (GraphNode graphNode : list) {
             if (graphNode.getLocation().x <= 1 && graphNode.getLocation().y <= 1) {
                 graphNode.setLocation(centre.width, centre.height);
             }
@@ -461,7 +458,7 @@ public class ResolveVisualizerView extends ViewPart implements IZoomableWorkbenc
     }
 
     private class ForceHiddenFilter extends IvyNodeElementFilterAdapter {
-        private Collection/* <IvyNodeElement> */forceHidden = new HashSet/* <IvyNodeElement> */();
+        private final Collection/* <IvyNodeElement> */<IvyNodeElement> forceHidden = new HashSet/* <IvyNodeElement> */<>();
 
         public boolean accept(IvyNodeElement unfiltered) {
             return !forceHidden.contains(unfiltered);

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/6ab8e4c1/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/AllCallersAlgorithm.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/AllCallersAlgorithm.java b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/AllCallersAlgorithm.java
index 254ca60..e0e797d 100644
--- a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/AllCallersAlgorithm.java
+++ b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/AllCallersAlgorithm.java
@@ -20,18 +20,18 @@ package org.apache.ivyde.eclipse.resolvevisualizer.label;
 import java.util.Map;
 
 import org.apache.ivyde.eclipse.resolvevisualizer.model.IvyNodeElement;
+import org.eclipse.swt.graphics.Color;
 import org.eclipse.zest.core.viewers.EntityConnectionData;
 
 public class AllCallersAlgorithm extends LabelDecoratorAlgorithmAdapter {
     public void calculateHighlighted(IvyNodeElement root, IvyNodeElement selected,
-            Map/* <EntityConnectionData> */highlightRelationships, Map/* <IvyNodeElement> */highlightEntities) {
+                                     Map<EntityConnectionData, ConnectionStyle> highlightRelationships,
+                                     Map<IvyNodeElement, Color> highlightEntities) {
         if (selected != null) {
             highlightEntities.put(selected, entityColor);
-            IvyNodeElement[] directCallers = selected.getCallers();
-            for (int i = 0; i < directCallers.length; i++) {
-                highlightRelationships.put(new EntityConnectionData(directCallers[i], selected), relationshipColor);
-                highlightEntities.put(directCallers[i], entityColor);
-                highlightEntities.put(directCallers[i], entityColor);
+            for (IvyNodeElement directCaller : selected.getCallers()) {
+                highlightRelationships.put(new EntityConnectionData(directCaller, selected), relationshipColor);
+                highlightEntities.put(directCaller, entityColor);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/6ab8e4c1/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/AllDependencyAlgorithm.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/AllDependencyAlgorithm.java b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/AllDependencyAlgorithm.java
index 3c5b2fd..4ef46da 100644
--- a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/AllDependencyAlgorithm.java
+++ b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/AllDependencyAlgorithm.java
@@ -20,26 +20,26 @@ package org.apache.ivyde.eclipse.resolvevisualizer.label;
 import java.util.Map;
 
 import org.apache.ivyde.eclipse.resolvevisualizer.model.IvyNodeElement;
+import org.eclipse.swt.graphics.Color;
 import org.eclipse.zest.core.viewers.EntityConnectionData;
 
 public class AllDependencyAlgorithm extends LabelDecoratorAlgorithmAdapter {
     public void calculateHighlighted(IvyNodeElement root, IvyNodeElement selected,
-            Map/* <EntityConnectionData, Color> */highlightRelationships,
-            Map/* <IvyNodeElement, Color> */highlightEntities) {
+                                     Map<EntityConnectionData, ConnectionStyle> highlightRelationships,
+                                     Map<IvyNodeElement, Color> highlightEntities) {
         if (selected != null) {
             highlightDependenciesRecursive(selected, highlightRelationships, highlightEntities);
         }
     }
 
     private void highlightDependenciesRecursive(IvyNodeElement node,
-            Map/* <EntityConnectionData, Color> */highlightRelationships,
-            Map/* <IvyNodeElement, Color> */highlightEntities) {
+                                                Map<EntityConnectionData, ConnectionStyle> highlightRelationships,
+                                                Map<IvyNodeElement, Color> highlightEntities) {
         highlightEntities.put(node, entityColor);
 
-        IvyNodeElement[] directDependencies = node.getDependencies();
-        for (int i = 0; i < directDependencies.length; i++) {
-            highlightRelationships.put(new EntityConnectionData(node, directDependencies[i]), relationshipColor);
-            highlightDependenciesRecursive(directDependencies[i], highlightRelationships, highlightEntities);
+        for (IvyNodeElement directDependency : node.getDependencies()) {
+            highlightRelationships.put(new EntityConnectionData(node, directDependency), relationshipColor);
+            highlightDependenciesRecursive(directDependency, highlightRelationships, highlightEntities);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/6ab8e4c1/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/AllRootPathsAlgorithm.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/AllRootPathsAlgorithm.java b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/AllRootPathsAlgorithm.java
index ff53aae..8732aa6 100644
--- a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/AllRootPathsAlgorithm.java
+++ b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/AllRootPathsAlgorithm.java
@@ -20,23 +20,24 @@ package org.apache.ivyde.eclipse.resolvevisualizer.label;
 import java.util.Map;
 
 import org.apache.ivyde.eclipse.resolvevisualizer.model.IvyNodeElement;
+import org.eclipse.swt.graphics.Color;
 import org.eclipse.zest.core.viewers.EntityConnectionData;
 
 public class AllRootPathsAlgorithm extends LabelDecoratorAlgorithmAdapter {
     public void calculateHighlighted(IvyNodeElement root, IvyNodeElement selected,
-            Map/* <EntityConnectionData> */highlightRelationships, Map/* <IvyNodeElement> */highlightEntities) {
+                                     Map<EntityConnectionData, ConnectionStyle> highlightRelationships,
+                                     Map<IvyNodeElement, Color> highlightEntities) {
         if (selected != null) {
             highlightCallersRecursive(selected, highlightRelationships, highlightEntities);
         }
     }
 
-    private void highlightCallersRecursive(IvyNodeElement node, Map/* <EntityConnectionData> */highlightRelationships,
-            Map/* <IvyNodeElement> */highlightEntities) {
+    private void highlightCallersRecursive(IvyNodeElement node, Map<EntityConnectionData,
+            ConnectionStyle> highlightRelationships, Map<IvyNodeElement, Color> highlightEntities) {
         highlightEntities.put(node, entityColor);
-        IvyNodeElement[] directCallers = node.getCallers();
-        for (int i = 0; i < directCallers.length; i++) {
-            highlightRelationships.put(new EntityConnectionData(directCallers[i], node), relationshipColor);
-            highlightCallersRecursive(directCallers[i], highlightRelationships, highlightEntities);
+        for (IvyNodeElement directCaller : node.getCallers()) {
+            highlightRelationships.put(new EntityConnectionData(directCaller, node), relationshipColor);
+            highlightCallersRecursive(directCaller, highlightRelationships, highlightEntities);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/6ab8e4c1/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/ConfigurationConflictAlgorithm.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/ConfigurationConflictAlgorithm.java b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/ConfigurationConflictAlgorithm.java
index acaff71..b7a31dc 100644
--- a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/ConfigurationConflictAlgorithm.java
+++ b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/ConfigurationConflictAlgorithm.java
@@ -22,6 +22,7 @@ import java.util.Map;
 import org.apache.ivyde.eclipse.resolvevisualizer.model.IvyNodeElement;
 import org.eclipse.draw2d.ColorConstants;
 import org.eclipse.swt.graphics.Color;
+import org.eclipse.zest.core.viewers.EntityConnectionData;
 import org.eclipse.zest.core.widgets.ZestStyles;
 
 public class ConfigurationConflictAlgorithm extends LabelDecoratorAlgorithmAdapter {
@@ -31,15 +32,15 @@ public class ConfigurationConflictAlgorithm extends LabelDecoratorAlgorithmAdapt
         relationshipColor = new ConnectionStyle(ZestStyles.CONNECTIONS_SOLID, ColorConstants.red, 1, false);
     }
 
-    public void calculateHighlighted(IvyNodeElement root, IvyNodeElement selected, Map highlightRelationships,
-            Map highlightEntities) {
+    public void calculateHighlighted(IvyNodeElement root, IvyNodeElement selected,
+                                     Map<EntityConnectionData, ConnectionStyle> highlightRelationships,
+                                     Map<IvyNodeElement, Color> highlightEntities) {
         if (root == null) {
             return;
         }
-        IvyNodeElement[] deepDependencies = root.getDeepDependencies();
-        for (int i = 0; i < deepDependencies.length; i++) {
-            if (deepDependencies[i].getConflicts().length > 0) {
-                highlightEntities.put(deepDependencies[i], entityColor);
+        for (IvyNodeElement deepDependency : root.getDeepDependencies()) {
+            if (deepDependency.getConflicts().length > 0) {
+                highlightEntities.put(deepDependency, entityColor);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/6ab8e4c1/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/DirectDependenciesAlgorithm.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/DirectDependenciesAlgorithm.java b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/DirectDependenciesAlgorithm.java
index 59f8c8f..7b954c5 100644
--- a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/DirectDependenciesAlgorithm.java
+++ b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/DirectDependenciesAlgorithm.java
@@ -20,17 +20,18 @@ package org.apache.ivyde.eclipse.resolvevisualizer.label;
 import java.util.Map;
 
 import org.apache.ivyde.eclipse.resolvevisualizer.model.IvyNodeElement;
+import org.eclipse.swt.graphics.Color;
 import org.eclipse.zest.core.viewers.EntityConnectionData;
 
 public class DirectDependenciesAlgorithm extends LabelDecoratorAlgorithmAdapter {
     public void calculateHighlighted(IvyNodeElement root, IvyNodeElement selected,
-            Map/* <EntityConnectionData> */highlightRelationships, Map/* <IvyNodeElement> */highlightEntities) {
+                                     Map<EntityConnectionData, ConnectionStyle> highlightRelationships,
+                                     Map<IvyNodeElement, Color> highlightEntities) {
         if (selected != null) {
             highlightEntities.put(root, entityColor);
-            IvyNodeElement[] dependencies = root.getDependencies();
-            for (int i = 0; i < dependencies.length; i++) {
-                highlightEntities.put(dependencies[i], entityColor);
-                highlightRelationships.put(new EntityConnectionData(root, dependencies[i]), relationshipColor);
+            for (IvyNodeElement dependency : root.getDependencies()) {
+                highlightEntities.put(dependency, entityColor);
+                highlightRelationships.put(new EntityConnectionData(root, dependency), relationshipColor);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/6ab8e4c1/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/ILabelDecoratorAlgorithm.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/ILabelDecoratorAlgorithm.java b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/ILabelDecoratorAlgorithm.java
index 9747736..3fbf5da 100644
--- a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/ILabelDecoratorAlgorithm.java
+++ b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/ILabelDecoratorAlgorithm.java
@@ -20,8 +20,11 @@ package org.apache.ivyde.eclipse.resolvevisualizer.label;
 import java.util.Map;
 
 import org.apache.ivyde.eclipse.resolvevisualizer.model.IvyNodeElement;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.zest.core.viewers.EntityConnectionData;
 
 public interface ILabelDecoratorAlgorithm {
     void calculateHighlighted(IvyNodeElement root, IvyNodeElement selected,
-            Map/* <EntityConnectionData> */highlightRelationships, Map/* <IvyNodeElement> */highlightEntities);
+                              Map<EntityConnectionData, ConnectionStyle> highlightRelationships,
+                              Map<IvyNodeElement, Color> highlightEntities);
 }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/6ab8e4c1/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/SameModuleIdAlgorithm.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/SameModuleIdAlgorithm.java b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/SameModuleIdAlgorithm.java
index a73c86f..b2eb351 100644
--- a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/SameModuleIdAlgorithm.java
+++ b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/SameModuleIdAlgorithm.java
@@ -20,16 +20,18 @@ package org.apache.ivyde.eclipse.resolvevisualizer.label;
 import java.util.Map;
 
 import org.apache.ivyde.eclipse.resolvevisualizer.model.IvyNodeElement;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.zest.core.viewers.EntityConnectionData;
 
 public class SameModuleIdAlgorithm extends LabelDecoratorAlgorithmAdapter {
     public void calculateHighlighted(IvyNodeElement root, IvyNodeElement selected,
-            Map/* <EntityConnectionData> */highlightRelationships, Map/* <IvyNodeElement> */highlightEntities) {
+                                     Map<EntityConnectionData, ConnectionStyle> highlightRelationships,
+                                     Map<IvyNodeElement, Color> highlightEntities) {
         if (selected != null) {
-            IvyNodeElement[] deepDependencies = root.getDeepDependencies();
-            for (int i = 0; i < deepDependencies.length; i++) {
-                if (deepDependencies[i].getOrganization().equals(selected.getOrganization())
-                        && deepDependencies[i].getName().equals(selected.getName())) {
-                    highlightEntities.put(deepDependencies[i], entityColor);
+            for (IvyNodeElement deepDependency : root.getDeepDependencies()) {
+                if (deepDependency.getOrganization().equals(selected.getOrganization())
+                        && deepDependency.getName().equals(selected.getName())) {
+                    highlightEntities.put(deepDependency, entityColor);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/6ab8e4c1/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/ShortestRootPathAlgorithm.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/ShortestRootPathAlgorithm.java b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/ShortestRootPathAlgorithm.java
index 7bf5885..0034b6a 100644
--- a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/ShortestRootPathAlgorithm.java
+++ b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/label/ShortestRootPathAlgorithm.java
@@ -20,17 +20,18 @@ package org.apache.ivyde.eclipse.resolvevisualizer.label;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.Map;
 import java.util.Set;
 
 import org.apache.ivyde.eclipse.resolvevisualizer.model.IvyNodeElement;
 import org.eclipse.zest.core.viewers.EntityConnectionData;
+import org.eclipse.swt.graphics.Color;
 
 public class ShortestRootPathAlgorithm extends LabelDecoratorAlgorithmAdapter {
     public void calculateHighlighted(IvyNodeElement root, IvyNodeElement selected,
-            Map/* <EntityConnectionData> */highlightRelationships, Map/* <IvyNodeElement> */highlightEntities) {
+                                     Map<EntityConnectionData, ConnectionStyle> highlightRelationships,
+                                     Map<IvyNodeElement, Color> highlightEntities) {
         // Calculates the smart path.
         if (selected != null) {
             IvyNodeElement[] path = getShortestPathToDescendent(root, selected);
@@ -47,12 +48,12 @@ public class ShortestRootPathAlgorithm extends LabelDecoratorAlgorithmAdapter {
     }
 
     public IvyNodeElement[] getShortestPathToDescendent(IvyNodeElement root, IvyNodeElement target) {
-        LinkedList/* <IvyNodeElement> */q = new LinkedList/* <IvyNodeElement> */();
-        Set/* <IvyNodeElement> */orderedSet = new HashSet/* <IvyNodeElement> */();
-        LinkedList/* <IvyNodeElement> */orderedList = new LinkedList/* <IvyNodeElement> */();
+        LinkedList<IvyNodeElement> q = new LinkedList<>();
+        Set<IvyNodeElement> orderedSet = new HashSet<>();
+        LinkedList<IvyNodeElement> orderedList = new LinkedList<>();
         q.add(root);
         while (!q.isEmpty()) {
-            IvyNodeElement head = (IvyNodeElement) q.remove(0);
+            IvyNodeElement head = q.remove(0);
             if (!orderedSet.contains(head)) {
                 orderedSet.add(head);
                 orderedList.add(head);
@@ -62,32 +63,31 @@ public class ShortestRootPathAlgorithm extends LabelDecoratorAlgorithmAdapter {
         return fixedWeightDijkstraAlgorithm(orderedList, root, target);
     }
 
-    private IvyNodeElement[] fixedWeightDijkstraAlgorithm(LinkedList q, IvyNodeElement s, IvyNodeElement t) {
-        HashMap/* <IvyNodeElement, Integer> */previous = new HashMap/* <IvyNodeElement, Integer> */();
-        HashMap/* <IvyNodeElement, Integer> */dValues = new HashMap/* <IvyNodeElement, Integer> */();
-        for (Iterator/* <IvyNodeElement> */iter = q.iterator(); iter.hasNext();) {
-            dValues.put(iter.next(), Integer.MAX_VALUE / 10);
+    private IvyNodeElement[] fixedWeightDijkstraAlgorithm(LinkedList<IvyNodeElement> q,
+                                                          IvyNodeElement s, IvyNodeElement t) {
+        HashMap<IvyNodeElement, IvyNodeElement> previous = new HashMap<>();
+        HashMap<IvyNodeElement, Integer> dValues = new HashMap<>();
+        for (IvyNodeElement e : q) {
+            dValues.put(e, Integer.MAX_VALUE / 10);
         }
         dValues.put(s, 0);
 
         while (!q.isEmpty()) {
-            IvyNodeElement head = (IvyNodeElement) q.remove(0);
-            IvyNodeElement[] outgoing = head.getDependencies();
-            for (int i = 0; i < outgoing.length; i++) {
-                IvyNodeElement v = outgoing[i];
-                if ((Integer) dValues.get(head) + 1 < (Integer) dValues.get(v)) {
+            IvyNodeElement head = q.remove(0);
+            for (IvyNodeElement v : head.getDependencies()) {
+                if (dValues.get(head) + 1 < dValues.get(v)) {
                     previous.put(v, head);
-                    dValues.put(v, (Integer) dValues.get(head) + 1);
+                    dValues.put(v, dValues.get(head) + 1);
                 }
             }
         }
-        LinkedList/* <IvyNodeElement> */path = new LinkedList/* <IvyNodeElement> */();
+        LinkedList<IvyNodeElement> path = new LinkedList<>();
         IvyNodeElement currentNode = t;
         while (previous.containsKey(currentNode)) {
             path.add(currentNode);
-            currentNode = (IvyNodeElement) previous.get(currentNode);
+            currentNode = previous.get(currentNode);
         }
         path.add(currentNode);
-        return (IvyNodeElement[]) path.toArray(new IvyNodeElement[path.size()]);
+        return path.toArray(new IvyNodeElement[path.size()]);
     }
 }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/6ab8e4c1/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/model/IvyNodeElement.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/model/IvyNodeElement.java b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/model/IvyNodeElement.java
index 24acba2..2016968 100644
--- a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/model/IvyNodeElement.java
+++ b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/model/IvyNodeElement.java
@@ -20,7 +20,6 @@ package org.apache.ivyde.eclipse.resolvevisualizer.model;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Map;
 
 import org.apache.ivy.core.module.id.ModuleRevisionId;
@@ -33,14 +32,14 @@ public class IvyNodeElement {
     private ModuleRevisionId moduleRevisionId;
     private boolean evicted = false;
     private int depth = Integer.MAX_VALUE / 10;
-    private Collection/* <IvyNodeElement> */dependencies = new HashSet/* <IvyNodeElement> */();
-    private Collection/* <IvyNodeElement> */callers = new HashSet/* <IvyNodeElement> */();
-    private Collection/* <IvyNodeElement> */conflicts = new HashSet/* <IvyNodeElement> */();
+    private final Collection<IvyNodeElement> dependencies = new HashSet<>();
+    private final Collection<IvyNodeElement> callers = new HashSet<>();
+    private Collection<IvyNodeElement> conflicts = new HashSet<>();
 
     /**
      * The caller configurations that caused this node to be reached in the resolution, grouped by caller.
      */
-    private Map/* <IvyNodeElement, String[]> */callerConfigurationMap = new HashMap/* <IvyNodeElement, String[]> */();
+    private final Map<IvyNodeElement, String[]> callerConfigurationMap = new HashMap<>();
 
     /**
      * We try to avoid building the list of this nodes deep dependencies by storing them in this cache by depth level.
@@ -59,7 +58,7 @@ public class IvyNodeElement {
     }
 
     public IvyNodeElement[] getDependencies() {
-        return (IvyNodeElement[]) dependencies.toArray(new IvyNodeElement[dependencies.size()]);
+        return dependencies.toArray(new IvyNodeElement[dependencies.size()]);
     }
 
     /**
@@ -70,7 +69,7 @@ public class IvyNodeElement {
      */
     public IvyNodeElement[] getDeepDependencies() {
         if (deepDependencyCache == null) {
-            deepDependencyCache = (IvyNodeElement[]) getDeepDependencies(this).toArray(new IvyNodeElement[] {});
+            deepDependencyCache = getDeepDependencies(this).toArray(new IvyNodeElement[] {});
         }
         return deepDependencyCache;
     }
@@ -81,13 +80,12 @@ public class IvyNodeElement {
      * @param node IvyNodeElement
      * @return Collection&lt;IvyNodeElement&gt;
      */
-    private Collection/* <IvyNodeElement> */getDeepDependencies(IvyNodeElement node) {
-        Collection/* <IvyNodeElement> */deepDependencies = new HashSet/* <IvyNodeElement> */();
+    private Collection<IvyNodeElement> getDeepDependencies(IvyNodeElement node) {
+        Collection<IvyNodeElement> deepDependencies = new HashSet<>();
         deepDependencies.add(node);
 
-        IvyNodeElement[] directDependencies = node.getDependencies();
-        for (int i = 0; i < directDependencies.length; i++) {
-            deepDependencies.addAll(getDeepDependencies(directDependencies[i]));
+        for (IvyNodeElement directDependency : node.getDependencies()) {
+            deepDependencies.addAll(getDeepDependencies(directDependency));
         }
 
         return deepDependencies;
@@ -98,7 +96,7 @@ public class IvyNodeElement {
      * @return An array of configurations by which this module was resolved
      */
     public String[] getCallerConfigurations(IvyNodeElement caller) {
-        return (String[]) callerConfigurationMap.get(caller);
+        return callerConfigurationMap.get(caller);
     }
 
     public void setCallerConfigurations(IvyNodeElement caller, String[] configurations) {
@@ -136,17 +134,16 @@ public class IvyNodeElement {
      */
     public void setDepth(int depth) {
         this.depth = depth;
-        for (Iterator iter = dependencies.iterator(); iter.hasNext();) {
-            IvyNodeElement dependency = (IvyNodeElement) iter.next();
+        for (IvyNodeElement dependency : dependencies) {
             dependency.setDepth(depth + 1);
         }
     }
 
     public IvyNodeElement[] getConflicts() {
-        return (IvyNodeElement[]) conflicts.toArray(new IvyNodeElement[conflicts.size()]);
+        return conflicts.toArray(new IvyNodeElement[conflicts.size()]);
     }
 
-    public void setConflicts(Collection conflicts) {
+    public void setConflicts(Collection<IvyNodeElement> conflicts) {
         this.conflicts = conflicts;
     }
 
@@ -164,6 +161,6 @@ public class IvyNodeElement {
     }
 
     public IvyNodeElement[] getCallers() {
-        return (IvyNodeElement[]) callers.toArray(new IvyNodeElement[callers.size()]);
+        return callers.toArray(new IvyNodeElement[callers.size()]);
     }
 }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/6ab8e4c1/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/model/IvyNodeElementAdapter.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/model/IvyNodeElementAdapter.java b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/model/IvyNodeElementAdapter.java
index 6f34ed1..74c10aa 100644
--- a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/model/IvyNodeElementAdapter.java
+++ b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/model/IvyNodeElementAdapter.java
@@ -17,15 +17,15 @@
  */
 package org.apache.ivyde.eclipse.resolvevisualizer.model;
 
-import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
 import org.apache.ivy.core.module.id.ModuleId;
+import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.core.report.ResolveReport;
 import org.apache.ivy.core.resolve.IvyNode;
 import org.apache.ivy.core.resolve.IvyNodeCallers.Caller;
@@ -38,17 +38,16 @@ public class IvyNodeElementAdapter {
      * @return the root node adapted from the ResolveReport
      */
     public static IvyNodeElement adapt(ResolveReport report) {
-        Map/* <ModuleRevisionId, IvyNodeElement> */resolvedNodes = new HashMap/* <ModuleRevisionId, IvyNodeElement> */();
+        Map<ModuleRevisionId, IvyNodeElement> resolvedNodes = new HashMap<>();
 
         IvyNodeElement root = new IvyNodeElement();
         root.setModuleRevisionId(report.getModuleDescriptor().getModuleRevisionId());
         resolvedNodes.put(report.getModuleDescriptor().getModuleRevisionId(), root);
 
-        List/* <IvyNode> */dependencies = report.getDependencies();
+        List<IvyNode> dependencies = report.getDependencies();
 
         // First pass - build the map of resolved nodes by revision id
-        for (Iterator iter = dependencies.iterator(); iter.hasNext();) {
-            IvyNode node = (IvyNode) iter.next();
+        for (IvyNode node : dependencies) {
             if (node.getAllEvictingNodes() != null) {
                 // Nodes that are evicted as a result of conf inheritance still appear
                 // as dependencies, but with eviction data. They also appear as evictions.
@@ -61,36 +60,31 @@ public class IvyNodeElementAdapter {
         }
 
         // Second pass - establish relationships between the resolved nodes
-        for (Iterator iter = dependencies.iterator(); iter.hasNext();) {
-            IvyNode node = (IvyNode) iter.next();
+        for (IvyNode node : dependencies) {
             if (node.getAllEvictingNodes() != null) {
                 continue; // see note above
             }
 
-            IvyNodeElement nodeElement = (IvyNodeElement) resolvedNodes.get(node.getResolvedId());
-            Caller[] callers = node.getAllRealCallers();
-            for (int i = 0; i < callers.length; i++) {
-                IvyNodeElement caller = (IvyNodeElement) resolvedNodes.get(callers[i].getModuleRevisionId());
+            IvyNodeElement nodeElement = resolvedNodes.get(node.getResolvedId());
+            for (Caller call : node.getAllRealCallers()) {
+                IvyNodeElement caller = resolvedNodes.get(call.getModuleRevisionId());
                 if (caller != null) {
                     nodeElement.addCaller(caller);
-                    nodeElement.setCallerConfigurations(caller, callers[i].getCallerConfigurations());
+                    nodeElement.setCallerConfigurations(caller, call.getCallerConfigurations());
                 }
             }
         }
 
-        IvyNode[] evictions = report.getEvictedNodes();
-        for (int i = 0; i < evictions.length; i++) {
-            IvyNode eviction = evictions[i];
+        for (IvyNode eviction : report.getEvictedNodes()) {
             IvyNodeElement evictionElement = new IvyNodeElement();
             evictionElement.setModuleRevisionId(eviction.getResolvedId());
             evictionElement.setEvicted(true);
 
-            Caller[] callers = eviction.getAllCallers();
-            for (int j = 0; j < callers.length; j++) {
-                IvyNodeElement caller = (IvyNodeElement) resolvedNodes.get(callers[j].getModuleRevisionId());
+            for (Caller call : eviction.getAllCallers()) {
+                IvyNodeElement caller = resolvedNodes.get(call.getModuleRevisionId());
                 if (caller != null) {
                     evictionElement.addCaller(caller);
-                    evictionElement.setCallerConfigurations(caller, callers[j].getCallerConfigurations());
+                    evictionElement.setCallerConfigurations(caller, call.getCallerConfigurations());
                 }
             }
         }
@@ -109,29 +103,22 @@ public class IvyNodeElementAdapter {
      */
     private static void findConflictsBeneathNode(IvyNodeElement node) {
         // Derive conflicts
-        Map/* <ModuleId, Collection<IvyNodeElement>> */moduleRevisionMap = new HashMap/*
-                                                                                       * <ModuleId,
-                                                                                       * Collection<IvyNodeElement>>
-                                                                                       */();
-        IvyNodeElement[] deepDependencies = node.getDeepDependencies();
-        for (int i = 0; i < deepDependencies.length; i++) {
-            if (deepDependencies[i].isEvicted()) {
+        Map<ModuleId, Collection<IvyNodeElement>> moduleRevisionMap = new HashMap<>();
+        for (IvyNodeElement deepDependency : node.getDeepDependencies()) {
+            if (deepDependency.isEvicted()) {
                 continue;
             }
 
-            ModuleId moduleId = deepDependencies[i].getModuleRevisionId().getModuleId();
+            ModuleId moduleId = deepDependency.getModuleRevisionId().getModuleId();
             if (moduleRevisionMap.containsKey(moduleId)) {
-                Collection/* <IvyNodeElement> */conflicts = (Collection/* <IvyNodeElement> */) moduleRevisionMap
-                        .get(moduleId);
-                conflicts.add(deepDependencies[i]);
-                for (Iterator iter = conflicts.iterator(); iter.hasNext();) {
-                    IvyNodeElement conflict = (IvyNodeElement) iter.next();
+                Collection<IvyNodeElement> conflicts = moduleRevisionMap.get(moduleId);
+                conflicts.add(deepDependency);
+                for (IvyNodeElement conflict : conflicts) {
                     conflict.setConflicts(conflicts);
                 }
             } else {
-                List/* <IvyNodeElement> */immutableMatchingSet = Arrays
-                        .asList(new IvyNodeElement[] { deepDependencies[i] });
-                moduleRevisionMap.put(moduleId, new HashSet(immutableMatchingSet));
+                List<IvyNodeElement> immutableMatchingSet = Collections.singletonList(deepDependency);
+                moduleRevisionMap.put(moduleId, new HashSet<>(immutableMatchingSet));
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/6ab8e4c1/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/model/IvyNodeElementFilterAdapter.java
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/model/IvyNodeElementFilterAdapter.java b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/model/IvyNodeElementFilterAdapter.java
index a4a7d6b..a76b7ce 100644
--- a/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/model/IvyNodeElementFilterAdapter.java
+++ b/org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/model/IvyNodeElementFilterAdapter.java
@@ -28,14 +28,14 @@ public abstract class IvyNodeElementFilterAdapter implements IIvyNodeElementFilt
             return unfiltered;
         }
 
-        Collection/* <IvyNodeElement> */filtered = new HashSet/* <IvyNodeElement> */();
-        for (int i = 0; i < unfiltered.length; i++) {
-            if (accept(unfiltered[i])) {
-                filtered.add(unfiltered[i]);
+        Collection<IvyNodeElement> filtered = new HashSet<>();
+        for (IvyNodeElement raw : unfiltered) {
+            if (accept(raw)) {
+                filtered.add(raw);
             }
         }
 
-        return (IvyNodeElement[]) filtered.toArray(new IvyNodeElement[filtered.size()]);
+        return filtered.toArray(new IvyNodeElement[filtered.size()]);
     }
 
     public abstract boolean accept(IvyNodeElement unfiltered);


Mime
View raw message