You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by hi...@apache.org on 2014/12/22 18:37:17 UTC

[1/6] ant-ivy git commit: use java 5 constructs

Repository: ant-ivy
Updated Branches:
  refs/heads/master 12c3a4354 -> 5539fc8b2


use java 5 constructs

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

Branch: refs/heads/master
Commit: c95e6a35b21bc5bcad2ac3a2d2d58843959b52f9
Parents: 12c3a43
Author: Nicolas Lalevée <ni...@hibnet.org>
Authored: Sun Dec 14 15:19:11 2014 +0100
Committer: Nicolas Lalevée <ni...@hibnet.org>
Committed: Sun Dec 14 15:19:30 2014 +0100

----------------------------------------------------------------------
 src/java/org/apache/ivy/ant/IvyRetrieve.java    |  18 +--
 .../ivy/core/retrieve/RetrieveEngine.java       | 128 +++++++++----------
 .../ivy/core/retrieve/RetrieveReport.java       |  20 +--
 src/java/org/apache/ivy/util/FileUtil.java      |  39 ++++--
 4 files changed, 107 insertions(+), 98 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/c95e6a35/src/java/org/apache/ivy/ant/IvyRetrieve.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/ant/IvyRetrieve.java b/src/java/org/apache/ivy/ant/IvyRetrieve.java
index d333cd8..e19232b 100644
--- a/src/java/org/apache/ivy/ant/IvyRetrieve.java
+++ b/src/java/org/apache/ivy/ant/IvyRetrieve.java
@@ -20,7 +20,6 @@ package org.apache.ivy.ant;
 import java.io.File;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.Iterator;
 
 import org.apache.ivy.core.LogOptions;
 import org.apache.ivy.core.retrieve.RetrieveOptions;
@@ -38,9 +37,9 @@ import org.apache.tools.ant.util.FileNameMapper;
  */
 public class IvyRetrieve extends IvyPostResolveTask {
 
-    private static final Collection OVERWRITEMODE_VALUES = Arrays.asList(new String[] {
-            RetrieveOptions.OVERWRITEMODE_ALWAYS, RetrieveOptions.OVERWRITEMODE_NEVER,
-            RetrieveOptions.OVERWRITEMODE_NEWER, RetrieveOptions.OVERWRITEMODE_DIFFERENT});
+    private static final Collection<String> OVERWRITEMODE_VALUES = Arrays.asList(
+        RetrieveOptions.OVERWRITEMODE_ALWAYS, RetrieveOptions.OVERWRITEMODE_NEVER,
+        RetrieveOptions.OVERWRITEMODE_NEWER, RetrieveOptions.OVERWRITEMODE_DIFFERENT);
 
     private String pattern;
 
@@ -84,6 +83,7 @@ public class IvyRetrieve extends IvyPostResolveTask {
         this.setId = setId;
     }
 
+    @Override
     public void doExecute() throws BuildException {
         prepareAndCheck();
 
@@ -114,8 +114,8 @@ public class IvyRetrieve extends IvyPostResolveTask {
                 Path path = new Path(getProject());
                 getProject().addReference(getPathId(), path);
 
-                for (Iterator iter = report.getRetrievedFiles().iterator(); iter.hasNext();) {
-                    path.createPathElement().setLocation((File) iter.next());
+                for (File file : report.getRetrievedFiles()) {
+                    path.createPathElement().setLocation(file);
                 }
             }
 
@@ -126,9 +126,9 @@ public class IvyRetrieve extends IvyPostResolveTask {
 
                 fileset.setDir(report.getRetrieveRoot());
 
-                for (Iterator iter = report.getRetrievedFiles().iterator(); iter.hasNext();) {
+                for (File file : report.getRetrievedFiles()) {
                     PatternSet.NameEntry ne = fileset.createInclude();
-                    ne.setName(getPath(report.getRetrieveRoot(), (File) iter.next()));
+                    ne.setName(getPath(report.getRetrieveRoot(), file));
                 }
             }
         } catch (Exception ex) {
@@ -136,7 +136,7 @@ public class IvyRetrieve extends IvyPostResolveTask {
         }
     }
 
-    protected Collection/* <String> */getAllowedLogOptions() {
+    protected Collection<String> getAllowedLogOptions() {
         return Arrays.asList(new String[] {LogOptions.LOG_DEFAULT, LogOptions.LOG_DOWNLOAD_ONLY,
                 LogOptions.LOG_QUIET});
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/c95e6a35/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java b/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java
index d827f78..7cfa6a8 100644
--- a/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java
+++ b/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java
@@ -27,9 +27,9 @@ import java.util.Collections;
 import java.util.Comparator;
 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.ivy.core.IvyContext;
@@ -43,6 +43,7 @@ import org.apache.ivy.core.event.retrieve.StartRetrieveArtifactEvent;
 import org.apache.ivy.core.event.retrieve.StartRetrieveEvent;
 import org.apache.ivy.core.module.descriptor.Artifact;
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
+import org.apache.ivy.core.module.id.ArtifactRevisionId;
 import org.apache.ivy.core.module.id.ModuleId;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.core.report.ArtifactDownloadReport;
@@ -113,30 +114,30 @@ public class RetrieveEngine {
         }
 
         try {
-            Map/* <File, File> */destToSrcMap = null;
-            // Map<ArtifactDownloadReport, Set<String>>
-            Map artifactsToCopy = determineArtifactsToCopy(mrid, destFilePattern, options);
+            Map<File, File> destToSrcMap = null;
+            Map<ArtifactDownloadReport, Set<String>> artifactsToCopy = determineArtifactsToCopy(
+                mrid, destFilePattern, options);
             File fileRetrieveRoot = settings.resolveFile(IvyPatternHelper
                     .getTokenRoot(destFilePattern));
             report.setRetrieveRoot(fileRetrieveRoot);
             File ivyRetrieveRoot = destIvyPattern == null ? null : settings
                     .resolveFile(IvyPatternHelper.getTokenRoot(destIvyPattern));
-            Collection targetArtifactsStructure = new HashSet(); // Set(File) set of all paths
-            // which should be present at
-            // then end of retrieve (useful
+            Collection<File> targetArtifactsStructure = new HashSet<File>();
+            // Set(File) set of all paths which should be present at then end of retrieve (useful
             // for sync)
-            Collection targetIvysStructure = new HashSet(); // same for ivy files
+            Collection<File> targetIvysStructure = new HashSet<File>(); // same for ivy files
 
             if (options.isMakeSymlinksInMass()) {
                 // The HashMap is of "destToSrc" because src could go two places, but dest can only
                 // come from one
-                destToSrcMap = new HashMap();
+                destToSrcMap = new HashMap<File, File>();
             }
 
             // do retrieve
             long totalCopiedSize = 0;
-            for (Iterator iter = artifactsToCopy.keySet().iterator(); iter.hasNext();) {
-                ArtifactDownloadReport artifact = (ArtifactDownloadReport) iter.next();
+            for (Entry<ArtifactDownloadReport, Set<String>> artifactAndPaths : artifactsToCopy
+                    .entrySet()) {
+                ArtifactDownloadReport artifact = artifactAndPaths.getKey();
                 File archive = artifact.getLocalFile();
                 if (artifact.getUnpackedLocalFile() != null) {
                     archive = artifact.getUnpackedLocalFile();
@@ -145,11 +146,11 @@ public class RetrieveEngine {
                     Message.verbose("\tno local file available for " + artifact + ": skipping");
                     continue;
                 }
-                Set dest = (Set) artifactsToCopy.get(artifact);
+                Set<String> paths = artifactAndPaths.getValue();
                 Message.verbose("\tretrieving " + archive);
-                for (Iterator it2 = dest.iterator(); it2.hasNext();) {
+                for (String path : paths) {
                     IvyContext.getContext().checkInterrupted();
-                    File destFile = settings.resolveFile((String) it2.next());
+                    File destFile = settings.resolveFile(path);
                     if (!settings.isCheckUpToDate() || !upToDate(archive, destFile, options)) {
                         Message.verbose("\t\tto " + destFile);
                         if (this.eventManager != null) {
@@ -188,11 +189,11 @@ public class RetrieveEngine {
                         targetIvysStructure
                                 .addAll(FileUtil.getPathFiles(ivyRetrieveRoot, destFile));
                     } else {
-                        Iterator destFiles = FileUtil.listAll(destFile, Collections.EMPTY_LIST)
-                                .iterator();
-                        while (destFiles.hasNext()) {
+                        Collection<File> files = FileUtil.listAll(destFile,
+                            Collections.<String> emptyList());
+                        for (File file : files) {
                             targetArtifactsStructure.addAll(FileUtil.getPathFiles(fileRetrieveRoot,
-                                (File) destFiles.next()));
+                                file));
                         }
                     }
                 }
@@ -207,16 +208,16 @@ public class RetrieveEngine {
                 Message.verbose("\tsyncing...");
 
                 String[] ignorableFilenames = settings.getIgnorableFilenames();
-                Collection ignoreList = Arrays.asList(ignorableFilenames);
+                Collection<String> ignoreList = Arrays.asList(ignorableFilenames);
 
-                Collection existingArtifacts = FileUtil.listAll(fileRetrieveRoot, ignoreList);
-                Collection existingIvys = ivyRetrieveRoot == null ? null : FileUtil.listAll(
+                Collection<File> existingArtifacts = FileUtil.listAll(fileRetrieveRoot, ignoreList);
+                Collection<File> existingIvys = ivyRetrieveRoot == null ? null : FileUtil.listAll(
                     ivyRetrieveRoot, ignoreList);
 
                 if (fileRetrieveRoot.equals(ivyRetrieveRoot)) {
-                    Collection target = targetArtifactsStructure;
+                    Collection<File> target = targetArtifactsStructure;
                     target.addAll(targetIvysStructure);
-                    Collection existing = existingArtifacts;
+                    Collection<File> existing = existingArtifacts;
                     existing.addAll(existingIvys);
                     sync(target, existing);
                 } else {
@@ -274,18 +275,15 @@ public class RetrieveEngine {
         return settings.getResolutionCacheManager();
     }
 
-    private void sync(Collection target, Collection existing) {
-        Collection toRemove = new HashSet();
-        for (Iterator iter = existing.iterator(); iter.hasNext();) {
-            File file = (File) iter.next();
+    private void sync(Collection<File> target, Collection<File> existing) {
+        Collection<File> toRemove = new HashSet<File>();
+        for (File file : existing) {
             toRemove.add(file.getAbsoluteFile());
         }
-        for (Iterator iter = target.iterator(); iter.hasNext();) {
-            File file = (File) iter.next();
+        for (File file : target) {
             toRemove.remove(file.getAbsoluteFile());
         }
-        for (Iterator iter = toRemove.iterator(); iter.hasNext();) {
-            File file = (File) iter.next();
+        for (File file : toRemove) {
             if (file.exists()) {
                 Message.verbose("\t\tdeleting " + file);
                 FileUtil.forceDelete(file);
@@ -293,11 +291,8 @@ public class RetrieveEngine {
         }
     }
 
-    /**
-     * @return Map<ArtifactDownloadReport, Set<String>>
-     */
-    public Map determineArtifactsToCopy(ModuleRevisionId mrid, String destFilePattern,
-            RetrieveOptions options) throws ParseException, IOException {
+    public Map<ArtifactDownloadReport, Set<String>> determineArtifactsToCopy(ModuleRevisionId mrid,
+            String destFilePattern, RetrieveOptions options) throws ParseException, IOException {
         ModuleId moduleId = mrid.getModuleId();
 
         if (options.getResolveId() == null) {
@@ -312,13 +307,13 @@ public class RetrieveEngine {
         // find what we must retrieve where
 
         // ArtifactDownloadReport source -> Set (String copyDestAbsolutePath)
-        final Map artifactsToCopy = new HashMap();
+        final Map<ArtifactDownloadReport, Set<String>> artifactsToCopy = new HashMap<ArtifactDownloadReport, Set<String>>();
         // String copyDestAbsolutePath -> Set (ArtifactRevisionId source)
-        final Map conflictsMap = new HashMap();
+        final Map<String, Set<ArtifactRevisionId>> conflictsMap = new HashMap<String, Set<ArtifactRevisionId>>();
         // String copyDestAbsolutePath -> Set (ArtifactDownloadReport source)
-        final Map conflictsReportsMap = new HashMap();
+        final Map<String, Set<ArtifactDownloadReport>> conflictsReportsMap = new HashMap<String, Set<ArtifactDownloadReport>>();
         // String copyDestAbsolutePath -> Set (String conf)
-        final Map conflictsConfMap = new HashMap();
+        final Map<String, Set<String>> conflictsConfMap = new HashMap<String, Set<String>>();
 
         XmlReportParser parser = new XmlReportParser();
         for (int i = 0; i < confs.length; i++) {
@@ -328,15 +323,15 @@ public class RetrieveEngine {
                 conf);
             parser.parse(report);
 
-            Collection artifacts = new ArrayList(Arrays.asList(parser.getArtifactReports()));
+            Collection<ArtifactDownloadReport> artifacts = new ArrayList<ArtifactDownloadReport>(
+                    Arrays.asList(parser.getArtifactReports()));
             if (destIvyPattern != null) {
                 ModuleRevisionId[] mrids = parser.getRealDependencyRevisionIds();
                 for (int j = 0; j < mrids.length; j++) {
                     artifacts.add(parser.getMetadataArtifactReport(mrids[j]));
                 }
             }
-            for (Iterator iter = artifacts.iterator(); iter.hasNext();) {
-                ArtifactDownloadReport adr = (ArtifactDownloadReport) iter.next();
+            for (ArtifactDownloadReport adr : artifacts) {
 
                 Artifact artifact = adr.getArtifact();
                 String ext = artifact.getExt();
@@ -357,9 +352,9 @@ public class RetrieveEngine {
                     aMrid.getRevision(), artifact.getName(), artifact.getType(), ext, conf,
                     adr.getArtifactOrigin(), aMrid.getQualifiedExtraAttributes(),
                     artifact.getQualifiedExtraAttributes());
-                Set dest = (Set) artifactsToCopy.get(adr);
+                Set<String> dest = artifactsToCopy.get(adr);
                 if (dest == null) {
-                    dest = new HashSet();
+                    dest = new HashSet<String>();
                     artifactsToCopy.put(adr, dest);
                 }
                 String copyDest = settings.resolveFile(destFileName).getAbsolutePath();
@@ -372,19 +367,20 @@ public class RetrieveEngine {
                 for (int j = 0; j < destinations.length; j++) {
                     dest.add(destinations[j]);
 
-                    Set conflicts = (Set) conflictsMap.get(destinations[j]);
-                    Set conflictsReports = (Set) conflictsReportsMap.get(destinations[j]);
-                    Set conflictsConf = (Set) conflictsConfMap.get(destinations[j]);
+                    Set<ArtifactRevisionId> conflicts = conflictsMap.get(destinations[j]);
+                    Set<ArtifactDownloadReport> conflictsReports = conflictsReportsMap
+                            .get(destinations[j]);
+                    Set<String> conflictsConf = conflictsConfMap.get(destinations[j]);
                     if (conflicts == null) {
-                        conflicts = new HashSet();
+                        conflicts = new HashSet<ArtifactRevisionId>();
                         conflictsMap.put(destinations[j], conflicts);
                     }
                     if (conflictsReports == null) {
-                        conflictsReports = new HashSet();
+                        conflictsReports = new HashSet<ArtifactDownloadReport>();
                         conflictsReportsMap.put(destinations[j], conflictsReports);
                     }
                     if (conflictsConf == null) {
-                        conflictsConf = new HashSet();
+                        conflictsConf = new HashSet<String>();
                         conflictsConfMap.put(destinations[j], conflictsConf);
                     }
                     if (conflicts.add(artifact.getId())) {
@@ -396,23 +392,23 @@ public class RetrieveEngine {
         }
 
         // resolve conflicts if any
-        for (Iterator iter = conflictsMap.keySet().iterator(); iter.hasNext();) {
-            String copyDest = (String) iter.next();
-            Set artifacts = (Set) conflictsMap.get(copyDest);
-            Set conflictsConfs = (Set) conflictsConfMap.get(copyDest);
+        for (Entry<String, Set<ArtifactRevisionId>> entry : conflictsMap.entrySet()) {
+            String copyDest = entry.getKey();
+            Set<ArtifactRevisionId> artifacts = entry.getValue();
+            Set<String> conflictsConfs = conflictsConfMap.get(copyDest);
             if (artifacts.size() > 1) {
-                List artifactsList = new ArrayList((Collection) conflictsReportsMap.get(copyDest));
+                List<ArtifactDownloadReport> artifactsList = new ArrayList<ArtifactDownloadReport>(
+                        conflictsReportsMap.get(copyDest));
                 // conflicts battle is resolved by a sort using a conflict resolving policy
                 // comparator which consider as greater a winning artifact
                 Collections.sort(artifactsList, getConflictResolvingPolicy());
 
                 // after the sort, the winning artifact is the greatest one, i.e. the last one
                 // we fail if different artifacts of the same module are mapped to the same file
-                ArtifactDownloadReport winner = (ArtifactDownloadReport) artifactsList
-                        .get(artifactsList.size() - 1);
+                ArtifactDownloadReport winner = artifactsList.get(artifactsList.size() - 1);
                 ModuleRevisionId winnerMD = winner.getArtifact().getModuleRevisionId();
                 for (int i = artifactsList.size() - 2; i >= 0; i--) {
-                    ArtifactDownloadReport current = (ArtifactDownloadReport) artifactsList.get(i);
+                    ArtifactDownloadReport current = artifactsList.get(i);
                     if (winnerMD.equals(current.getArtifact().getModuleRevisionId())) {
                         throw new RuntimeException("Multiple artifacts of the module " + winnerMD
                                 + " are retrieved to the same file! Update the retrieve pattern "
@@ -426,12 +422,12 @@ public class RetrieveEngine {
                 // we now iterate over the list beginning with the artifact preceding the winner,
                 // and going backward to the least artifact
                 for (int i = artifactsList.size() - 2; i >= 0; i--) {
-                    ArtifactDownloadReport looser = (ArtifactDownloadReport) artifactsList.get(i);
+                    ArtifactDownloadReport looser = artifactsList.get(i);
                     Message.verbose("\t\tremoving conflict looser artifact: "
                             + looser.getArtifact());
                     // for each loser, we remove the pair (loser - copyDest) in the artifactsToCopy
                     // map
-                    Set dest = (Set) artifactsToCopy.get(looser);
+                    Set<String> dest = artifactsToCopy.get(looser);
                     dest.remove(copyDest);
                     if (dest.isEmpty()) {
                         artifactsToCopy.remove(looser);
@@ -474,12 +470,12 @@ public class RetrieveEngine {
      * 
      * @return
      */
-    private Comparator getConflictResolvingPolicy() {
-        return new Comparator() {
+    private Comparator<ArtifactDownloadReport> getConflictResolvingPolicy() {
+        return new Comparator<ArtifactDownloadReport>() {
             // younger conflict resolving policy
-            public int compare(Object o1, Object o2) {
-                Artifact a1 = ((ArtifactDownloadReport) o1).getArtifact();
-                Artifact a2 = ((ArtifactDownloadReport) o2).getArtifact();
+            public int compare(ArtifactDownloadReport o1, ArtifactDownloadReport o2) {
+                Artifact a1 = o1.getArtifact();
+                Artifact a2 = o2.getArtifact();
                 if (a1.getPublicationDate().after(a2.getPublicationDate())) {
                     // a1 is after a2 <=> a1 is younger than a2 <=> a1 wins the conflict battle
                     return +1;

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/c95e6a35/src/java/org/apache/ivy/core/retrieve/RetrieveReport.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/core/retrieve/RetrieveReport.java b/src/java/org/apache/ivy/core/retrieve/RetrieveReport.java
index 42273d3..bff2007 100644
--- a/src/java/org/apache/ivy/core/retrieve/RetrieveReport.java
+++ b/src/java/org/apache/ivy/core/retrieve/RetrieveReport.java
@@ -28,11 +28,11 @@ import org.apache.ivy.core.report.ArtifactDownloadReport;
 
 public class RetrieveReport {
 
-    private Collection/* <File> */upToDateFiles = new HashSet();
+    private Collection<File> upToDateFiles = new HashSet<File>();
 
-    private Collection/* <File> */copiedFiles = new HashSet();
+    private Collection<File> copiedFiles = new HashSet<File>();
 
-    private Map/* <File, ArtifactDownloadReport> */downloadReport = new HashMap();
+    private Map<File, ArtifactDownloadReport> downloadReport = new HashMap<File, ArtifactDownloadReport>();
 
     private File retrieveRoot;
 
@@ -69,24 +69,24 @@ public class RetrieveReport {
      * Returns a collection of <tt>File</tt> objects who were actually copied during the retrieve
      * process.
      */
-    public Collection getCopiedFiles() {
-        return new ArrayList(copiedFiles);
+    public Collection<File> getCopiedFiles() {
+        return new ArrayList<File>(copiedFiles);
     }
 
     /**
      * Returns a collection of <tt>File</tt> objects who were actually copied during the retrieve
      * process.
      */
-    public Collection getUpToDateFiles() {
-        return new ArrayList(upToDateFiles);
+    public Collection<File> getUpToDateFiles() {
+        return new ArrayList<File>(upToDateFiles);
     }
 
     /**
      * Returns a collection of <tt>File</tt> objects who were retrieved during the retrieve process.
      * This is the union of the files being copied and the files that were up-to-date.
      */
-    public Collection getRetrievedFiles() {
-        Collection result = new ArrayList(upToDateFiles.size() + copiedFiles.size());
+    public Collection<File> getRetrievedFiles() {
+        Collection<File> result = new ArrayList<File>(upToDateFiles.size() + copiedFiles.size());
         result.addAll(upToDateFiles);
         result.addAll(copiedFiles);
         return result;
@@ -95,7 +95,7 @@ public class RetrieveReport {
     /**
      * Get the mapping between the copied files and their corresponding download report
      */
-    public Map getDownloadReport() {
+    public Map<File, ArtifactDownloadReport> getDownloadReport() {
         return downloadReport;
     }
 }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/c95e6a35/src/java/org/apache/ivy/util/FileUtil.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/util/FileUtil.java b/src/java/org/apache/ivy/util/FileUtil.java
index 7a7be31..e251f5c 100644
--- a/src/java/org/apache/ivy/util/FileUtil.java
+++ b/src/java/org/apache/ivy/util/FileUtil.java
@@ -65,7 +65,7 @@ public final class FileUtil {
 
     private static final Pattern ALLOWED_PATH_PATTERN = Pattern.compile("[\\w-./\\\\:~ %\\(\\)]+");
 
-    public static void symlinkInMass(Map/* <File, File> */destToSrcMap, boolean overwrite)
+    public static void symlinkInMass(Map<File, File> destToSrcMap, boolean overwrite)
             throws IOException {
 
         // This pattern could be more forgiving if somebody wanted it to be...
@@ -77,11 +77,11 @@ public final class FileUtil {
         try {
             StringBuffer sb = new StringBuffer();
 
-            Iterator keyItr = destToSrcMap.entrySet().iterator();
+            Iterator<Entry<File, File>> keyItr = destToSrcMap.entrySet().iterator();
             while (keyItr.hasNext()) {
-                Entry/* <File, File> */entry = (Entry) keyItr.next();
-                File destFile = (File) entry.getKey();
-                File srcFile = (File) entry.getValue();
+                Entry<File, File> entry = keyItr.next();
+                File destFile = entry.getKey();
+                File srcFile = entry.getValue();
                 if (!ALLOWED_PATH_PATTERN.matcher(srcFile.getAbsolutePath()).matches()) {
                     throw new IOException("Unsafe file to 'mass' symlink: '"
                             + srcFile.getAbsolutePath() + "'");
@@ -234,7 +234,7 @@ public final class FileUtil {
     public static boolean deepCopy(File src, File dest, CopyProgressListener l, boolean overwrite)
             throws IOException {
         // the list of files which already exist in the destination folder
-        List/* <File> */existingChild = Collections.EMPTY_LIST;
+        List<File> existingChild = Collections.emptyList();
         if (dest.exists()) {
             if (!dest.isDirectory()) {
                 // not expected type, remove
@@ -270,7 +270,7 @@ public final class FileUtil {
         }
         // some file exist in the destination but not in the source: delete them
         for (int i = 0; i < existingChild.size(); i++) {
-            forceDelete((File) existingChild.get(i));
+            forceDelete(existingChild.get(i));
         }
         return true;
     }
@@ -462,8 +462,8 @@ public final class FileUtil {
      * File("test/dir1/dir2/file.txt") } Note that if root is not an ancester of file, or if root is
      * null, all directories from the file system root will be returned.
      */
-    public static List getPathFiles(File root, File file) {
-        List ret = new ArrayList();
+    public static List<File> getPathFiles(File root, File file) {
+        List<File> ret = new ArrayList<File>();
         while (file != null && !file.getAbsolutePath().equals(root.getAbsolutePath())) {
             ret.add(file);
             file = file.getParentFile();
@@ -486,11 +486,12 @@ public final class FileUtil {
      *            a Collection of filenames which must be excluded from listing
      * @return A collectoin containing all the files of the given directory and it's subdirectories.
      */
-    public static Collection listAll(File dir, Collection ignore) {
-        return listAll(dir, new ArrayList(), ignore);
+    public static Collection<File> listAll(File dir, Collection<String> ignore) {
+        return listAll(dir, new ArrayList<File>(), ignore);
     }
 
-    private static Collection listAll(File file, Collection list, Collection ignore) {
+    private static Collection<File> listAll(File file, Collection<File> list,
+            Collection<String> ignore) {
         if (ignore.contains(file.getName())) {
             return list;
         }
@@ -542,7 +543,7 @@ public final class FileUtil {
      *             if path is null.
      */
     public static File normalize(final String path) {
-        Stack s = new Stack();
+        Stack<String> s = new Stack<String>();
         String[] dissect = dissect(path);
         s.push(dissect[0]);
 
@@ -679,50 +680,62 @@ public final class FileUtil {
             this.wrapped = wrapped;
         }
 
+        @Override
         public void close() throws IOException {
             // do not close
         }
 
+        @Override
         public int read() throws IOException {
             return wrapped.read();
         }
 
+        @Override
         public int hashCode() {
             return wrapped.hashCode();
         }
 
+        @Override
         public int read(byte[] b) throws IOException {
             return wrapped.read(b);
         }
 
+        @Override
         public boolean equals(Object obj) {
             return wrapped.equals(obj);
         }
 
+        @Override
         public int read(byte[] b, int off, int len) throws IOException {
             return wrapped.read(b, off, len);
         }
 
+        @Override
         public long skip(long n) throws IOException {
             return wrapped.skip(n);
         }
 
+        @Override
         public String toString() {
             return wrapped.toString();
         }
 
+        @Override
         public int available() throws IOException {
             return wrapped.available();
         }
 
+        @Override
         public void mark(int readlimit) {
             wrapped.mark(readlimit);
         }
 
+        @Override
         public void reset() throws IOException {
             wrapped.reset();
         }
 
+        @Override
         public boolean markSupported() {
             return wrapped.markSupported();
         }


[2/6] ant-ivy git commit: avoid an NPE on malformed p2 repository

Posted by hi...@apache.org.
avoid an NPE on malformed p2 repository

Project: http://git-wip-us.apache.org/repos/asf/ant-ivy/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-ivy/commit/10118c9c
Tree: http://git-wip-us.apache.org/repos/asf/ant-ivy/tree/10118c9c
Diff: http://git-wip-us.apache.org/repos/asf/ant-ivy/diff/10118c9c

Branch: refs/heads/master
Commit: 10118c9c1b00d31868d6ab43e8171e3c16efdcfc
Parents: c95e6a3
Author: Nicolas Lalevée <ni...@hibnet.org>
Authored: Sun Dec 21 17:29:40 2014 +0100
Committer: Nicolas Lalevée <ni...@hibnet.org>
Committed: Sun Dec 21 17:29:40 2014 +0100

----------------------------------------------------------------------
 src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/10118c9c/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java b/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java
index 42b4b84..1630424 100644
--- a/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java
+++ b/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java
@@ -423,6 +423,9 @@ public class P2MetadataParser implements XMLInputParser {
     }
 
     private static String namespace2Type(String namespace) {
+        if (namespace == null) {
+            return null;
+        }
         if (namespace.equals("java.package")) {
             return BundleInfo.PACKAGE_TYPE;
         }


[3/6] ant-ivy git commit: Make the latest-osgi take also into account the implementation when resolving requirements

Posted by hi...@apache.org.
Make the latest-osgi take also into account the implementation when resolving requirements

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

Branch: refs/heads/master
Commit: ee94e6d82370b6b6086cae2693dc2fe31388fb64
Parents: 10118c9
Author: Nicolas Lalevée <ni...@hibnet.org>
Authored: Sun Dec 21 17:58:49 2014 +0100
Committer: Nicolas Lalevée <ni...@hibnet.org>
Committed: Sun Dec 21 18:08:14 2014 +0100

----------------------------------------------------------------------
 .../ivy/osgi/core/OsgiLatestStrategy.java       | 53 +++++++++++++++++++-
 1 file changed, 52 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/ee94e6d8/src/java/org/apache/ivy/osgi/core/OsgiLatestStrategy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/osgi/core/OsgiLatestStrategy.java b/src/java/org/apache/ivy/osgi/core/OsgiLatestStrategy.java
index e160fce..4cdf906 100644
--- a/src/java/org/apache/ivy/osgi/core/OsgiLatestStrategy.java
+++ b/src/java/org/apache/ivy/osgi/core/OsgiLatestStrategy.java
@@ -21,10 +21,14 @@ import java.text.ParseException;
 import java.util.Comparator;
 
 import org.apache.ivy.core.IvyContext;
+import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
+import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
+import org.apache.ivy.core.resolve.ResolvedModuleRevision;
 import org.apache.ivy.osgi.util.Version;
 import org.apache.ivy.plugins.latest.ArtifactInfo;
 import org.apache.ivy.plugins.latest.ComparatorLatestStrategy;
+import org.apache.ivy.plugins.resolver.util.MDResolvedResource;
 import org.apache.ivy.plugins.version.VersionMatcher;
 
 public class OsgiLatestStrategy extends ComparatorLatestStrategy {
@@ -80,7 +84,54 @@ public class OsgiLatestStrategy extends ComparatorLatestStrategy {
                 return c >= 0 ? -1 : 1;
             }
 
-            return mridComparator.compare(mrid1, mrid2);
+            int res = mridComparator.compare(mrid1, mrid2);
+
+            if (res == 0) {
+                // if same requirements, maybe we can make a difference on the implementation ?
+                ModuleRevisionId implMrid1 = getImplMrid(o1);
+                ModuleRevisionId implMrid2 = getImplMrid(o2);
+                if (implMrid1 != null && implMrid2 != null) {
+                    if (implMrid1.getModuleId().equals(implMrid2.getModuleId())) {
+                        // same implementation, compare the versions
+                        res = mridComparator.compare(implMrid1, implMrid2);
+                    } else {
+                        // not same bundle
+                        // to keep a total order, compare module names even if it means nothing
+                        res = implMrid1.getModuleId().compareTo(implMrid2.getModuleId());
+                    }
+                }
+
+            }
+
+            return res;
+        }
+
+        /*
+         * In the resolve process, a resolved requirement is represented in a special way. Here we
+         * deconstruct the resolved resource to know which implementation is actually resolved. See
+         * AbstractOSGiResolver.buildResolvedCapabilityMd()
+         */
+        private ModuleRevisionId getImplMrid(ArtifactInfo o) {
+            if (!(o instanceof MDResolvedResource)) {
+                return null;
+            }
+            MDResolvedResource mdrr = (MDResolvedResource) o;
+            ResolvedModuleRevision rmr = mdrr.getResolvedModuleRevision();
+            if (rmr == null) {
+                return null;
+            }
+            ModuleDescriptor md = rmr.getDescriptor();
+            if (md == null) {
+                return null;
+            }
+            if (!md.getModuleRevisionId().getOrganisation().equals(BundleInfo.PACKAGE_TYPE)) {
+                return null;
+            }
+            DependencyDescriptor[] dds = md.getDependencies();
+            if (dds == null || dds.length != 1) {
+                return null;
+            }
+            return dds[0].getDependencyRevisionId();
         }
     }
 


[5/6] ant-ivy git commit: Document the upload to the nexus repository

Posted by hi...@apache.org.
Document the upload to the nexus repository

Project: http://git-wip-us.apache.org/repos/asf/ant-ivy/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-ivy/commit/3df94448
Tree: http://git-wip-us.apache.org/repos/asf/ant-ivy/tree/3df94448
Diff: http://git-wip-us.apache.org/repos/asf/ant-ivy/diff/3df94448

Branch: refs/heads/master
Commit: 3df94448a8f6b095a07cc2b8f0a78c1f47278094
Parents: 6d2e199
Author: Nicolas Lalevée <ni...@hibnet.org>
Authored: Mon Dec 22 18:21:22 2014 +0100
Committer: Nicolas Lalevée <ni...@hibnet.org>
Committed: Mon Dec 22 18:21:22 2014 +0100

----------------------------------------------------------------------
 doc/dev/makerelease.html | 54 ++++++++++++++++++++++++++++++++-----------
 1 file changed, 41 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/3df94448/doc/dev/makerelease.html
----------------------------------------------------------------------
diff --git a/doc/dev/makerelease.html b/doc/dev/makerelease.html
index deefd80..cb0a89a 100644
--- a/doc/dev/makerelease.html
+++ b/doc/dev/makerelease.html
@@ -82,10 +82,10 @@ Be prepared to enter your passphrase several times if you use this script, gpg w
 
 To be able to test the release within IvyDE, it can be deployed in the IvyDE update site. See <a href="http://ant.apache.org/ivy/ivyde/history/trunk/dev/updatesite.html">that page</a> to know how to process.
 
-<h3>8. Create the tag</h3>
+<h3>8. Create a signed tag</h3>
 As soon as you are happy with the artifacts to be released, it is time to tag the release
 <code>
-git tag 2.0.0-beta1
+git tag -s 2.0.0-beta1 -m 'Release Ivy 2.0.0-beta1'
 </code>
 
 And push the changes to the ASF repo
@@ -93,13 +93,28 @@ And push the changes to the ASF repo
 git push --tags 
 </code>
 
-<h3>Publish the release candidate</h3>
+<h3>9. Publish the release candidate</h3>
 
 All artifacts in <tt>build/distrib</tt> except the <tt>maven2</tt> folder needs to be published on the 'dist' svn of the ASF, in the <b>dev</b> part.
 
 The artifacts should be pushed in that svn folder: https://dist.apache.org/repos/dist/dev/ant/ivy/$VERSION
 
-<h3>9. Call for a vote to approve the release</h3>
+<h3>10. Publish the Maven artifact to Nexus</h3>
+
+Having your GPG key ID, its password, your apache ID and the associated password, just launch ant and enter the information as required:
+<code>
+ant -f build-release.xml upload-nexus
+</code>
+
+Once uploaded, log in https://repository.apache.org/ with your prefered web browser (use your Apache ID).
+
+You should find there an <i>open</i> repository with the name of the form <tt>orgapacheant-XXXX</tt>. It should contain the Maven artifacts: the pom, the jar, the sources, the javadocs and the md5 and asc files.
+
+Now <i>close</i> the staging repository, with the description "Ivy 2.0.0-beta1". Closing means you finished the upload and some automatic checks will run. You can see them in the <i>Activity</i> tab of the repository.
+
+Once the checks passed, you can find in the <i>Summary</i> the URL of the staging repository. It will something like: https://repository.apache.org/content/repositories/orgapacheant-XXXX/
+
+<h3>11. Call for a vote to approve the release</h3>
 Cast a vote to approve the release on the dev@ant.apache.org mailing list.
 
 Here is an example:
@@ -108,9 +123,13 @@ Subject: [VOTE] Ivy ${version} Release
 
 I have built a release candidate for Ivy ${version}
 
-The svn tag of this release is: https://git-wip-us.apache.org/repos/asf?p=ant-ivy.git;a=commit;h=SHA1-OF-THE-TAG
+The svn tag of this release is: https://git-wip-us.apache.org/repos/asf?p=ant-ivy.git;a=tag;h=refs/tags/2.0.0-beta1
 
-The artifacts has been published to: https://dist.apache.org/repos/dist/dev/ant/ivy/$VERSION@${svn-rev-of-the-check-in}
+The artifacts has been published to: https://dist.apache.org/repos/dist/dev/ant/ivy/$VERSION at revision ${svn-rev-of-the-check-in}
+
+The staging maven repository is availble there: https://repository.apache.org/content/repositories/orgapacheant-XXXX
+
+The Eclipse updatesite has been build there: https://dist.apache.org/repos/dist/dev/ant/ivyde/updatesite/ivy-2.0.0.beta1_20141213170938/
 
 Do you vote for the release of these binaries?
 
@@ -121,7 +140,7 @@ Regards,
 
 ${me}, Ivy ${version} release manager
 </code>
-<h3>10. Publish the release</h3>
+<h3>12. Publish the release</h3>
 
 If the release is approved, it's now time to make it public. The artifacts in the <i>dev</i> part needs to be moved into the <i>release</i> one:
 <code>
@@ -130,7 +149,13 @@ $ svn mv https://dist.apache.org/repos/dist/dev/ant/ivy/$VERSION https://dist.ap
 
 In order to keep the main dist area of a reasonable size, old releases should be removed. They will disapear from the main dist but will still be available via the <a href="http://archive.apache.org/dist/ant/ivy/">archive</a>. To do so, just use the <tt>svn rm</tt> command against the artifacts or folders to remove.
 
-<h3>11. Update the web site</h3>
+<h3>13. Promote the Maven staging repository</h3>
+
+Go log in https://repository.apache.org/ with your prefered web browser (use your Apache ID).
+
+Select the appropriate <tt>orgapacheant-XXXX</tt> repository and select the <i>Release</i> action.
+
+<h3>14. Update the web site</h3>
 
 It's time to update the download image used on the home page and the download page. Use site/images/ivy-dl.xcf as a basis if you have <a href="http://www.gimp.org/">gimp</a> installed. Then you can update the home page to refer to this image, and add a news item announcing the new version. Update also the download page with the new image and update the links to the download location (using a search/replace on the html source is recommended for this).
 
@@ -167,18 +192,21 @@ And once your happy with it, commit the changes in the source directory, and in
 Tip: lot's of files might need to be 'added' to svn. An handy command to <tt>add</tt> any file which is not yet under version control is the following one:
 <code>svn add --force sources</code>
 
-<h3>12. Deploy the Eclipse updatesite</h3>
+<h3>15. Deploy the Eclipse updatesite</h3>
 
 If the Eclipse update site has already been prepared to include that new Ivy release, it is now needed to be deployed. Then follow the deployment instruction on <a href="http://ant.apache.org/ivy/ivyde/history/trunk/dev/updatesite.html">that page</a>.
 
-<h3>13. Announce</h3>
+<h3>16. Announce</h3>
 Announce the release on the dev@ant.a.o, ivy-user@ant.a.o, user@ant.apache.org and announce@apache.org mailing lists.
 You can also announce the release on popular web sites, like freshmeat.net (xavier is the owner of the Ivy project on freshmeat), javalobby.org, theserverside.com, dzone.com, ...
-<h3>14. Update this doc</h3>
+
+<h3>17. Update this doc</h3>
 If you feel like anything is missing or misleading in this release doc, update it as soon as you encounter the problem.
-<h3>15. Merge your modifications back to the master if necessary.</h3>
+
+<h3>18. Merge your modifications back to the master if necessary.</h3>
 Modifications on the template files do not need to be merged, but if you had troubles during your release you may want to merge your fixes back to the trunk.
-<h3>16. Prepare next release</h3>
+
+<h3>19. Prepare next release</h3>
 In the master branch, update the file version.properties with the version of the next release so that anyone building from the trunk will obtain jar with the correct version number.
 
 If the version just release is a final one (not an alpha, beta or rc), the list of changes should be emptied in doc/release-notes.html, and update there the next expected version. The announcement in the file should also be changed accordingly to the next expected version.


[4/6] ant-ivy git commit: use java 5 constructs

Posted by hi...@apache.org.
use java 5 constructs

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

Branch: refs/heads/master
Commit: 6d2e199e31f8109d21b3865cbc45b34d8b725a03
Parents: ee94e6d
Author: Nicolas Lalevée <ni...@hibnet.org>
Authored: Sun Dec 21 19:56:12 2014 +0100
Committer: Nicolas Lalevée <ni...@hibnet.org>
Committed: Sun Dec 21 23:43:30 2014 +0100

----------------------------------------------------------------------
 .../org/apache/ivy/core/resolve/IvyNode.java    | 228 +++++++++----------
 .../apache/ivy/core/resolve/IvyNodeCallers.java |  71 +++---
 .../ivy/core/resolve/IvyNodeEviction.java       | 160 ++++++-------
 .../apache/ivy/core/resolve/IvyNodeUsage.java   |  99 ++++----
 .../ivy/util/filter/ArtifactTypeFilter.java     |  14 +-
 src/java/org/apache/ivy/util/filter/Filter.java |   4 +-
 .../apache/ivy/util/filter/FilterHelper.java    |  18 +-
 .../org/apache/ivy/util/filter/NoFilter.java    |   6 +
 8 files changed, 290 insertions(+), 310 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6d2e199e/src/java/org/apache/ivy/core/resolve/IvyNode.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/core/resolve/IvyNode.java b/src/java/org/apache/ivy/core/resolve/IvyNode.java
index dec51d5..3764c47 100644
--- a/src/java/org/apache/ivy/core/resolve/IvyNode.java
+++ b/src/java/org/apache/ivy/core/resolve/IvyNode.java
@@ -28,6 +28,7 @@ import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Set;
 import java.util.Stack;
 import java.util.regex.Matcher;
@@ -59,7 +60,7 @@ import org.apache.ivy.util.StringUtils;
 import org.apache.ivy.util.filter.Filter;
 import org.apache.ivy.util.filter.FilterHelper;
 
-public class IvyNode implements Comparable {
+public class IvyNode implements Comparable<IvyNode> {
     private static final Pattern FALLBACK_CONF_PATTERN = Pattern.compile("(.+)\\((.*)\\)");
 
     // //////// CONTEXT
@@ -80,8 +81,7 @@ public class IvyNode implements Comparable {
     private ModuleRevisionId id;
 
     // set only when node has been built or updated from a DependencyDescriptor
-    // Map(IvyNode parent -> DependencyDescriptor)
-    private Map dds = new HashMap();
+    private Map<IvyNode, DependencyDescriptor> dds = new HashMap<IvyNode, DependencyDescriptor>();
 
     // Set when data has been loaded only, or when constructed from a module descriptor
     private ModuleDescriptor md;
@@ -95,18 +95,18 @@ public class IvyNode implements Comparable {
 
     private boolean searched = false;
 
-    private Collection confsToFetch = new HashSet();
+    private Collection<String> confsToFetch = new HashSet<String>();
 
-    private Collection fetchedConfigurations = new HashSet();
+    private Collection<String> fetchedConfigurations = new HashSet<String>();
 
-    private Collection loadedRootModuleConfs = new HashSet();
+    private Collection<String> loadedRootModuleConfs = new HashSet<String>();
 
     // //////// USAGE DATA
 
     private IvyNodeUsage usage = new IvyNodeUsage(this);
 
     // usage information merged from evicted nodes this node is "replacing"
-    private Map/* <ModuleRevisionId, IvyNodeUsage> */mergedUsages = new LinkedHashMap();
+    private Map<ModuleRevisionId, IvyNodeUsage> mergedUsages = new LinkedHashMap<ModuleRevisionId, IvyNodeUsage>();
 
     public IvyNode(ResolveData data, IvyNode parent, DependencyDescriptor dd) {
         id = dd.getDependencyRevisionId();
@@ -289,7 +289,8 @@ public class IvyNode implements Comparable {
         }
     }
 
-    public Collection getDependencies(String rootModuleConf, String[] confs, String requestedConf) {
+    public Collection<IvyNode> getDependencies(String rootModuleConf, String[] confs,
+            String requestedConf) {
         if (md == null) {
             throw new IllegalStateException(
                     "impossible to get dependencies when data has not been loaded");
@@ -301,7 +302,7 @@ public class IvyNode implements Comparable {
                 confs = md.getPublicConfigurationsNames();
             }
         }
-        Collection deps = new HashSet();
+        Collection<IvyNode> deps = new HashSet<IvyNode>();
         for (int i = 0; i < confs.length; i++) {
             deps.addAll(getDependencies(rootModuleConf, confs[i], requestedConf));
         }
@@ -321,15 +322,15 @@ public class IvyNode implements Comparable {
      *            the actual node conf requested, possibly extending the <code>conf</code> one.
      * @return
      */
-    public Collection/* <IvyNode> */getDependencies(String rootModuleConf, String conf,
+    public Collection<IvyNode> getDependencies(String rootModuleConf, String conf,
             String requestedConf) {
         if (md == null) {
             throw new IllegalStateException(
                     "impossible to get dependencies when data has not been loaded");
         }
         DependencyDescriptor[] dds = md.getDependencies();
-        Map/* <ModuleRevisionId, IvyNode> */dependencies = new LinkedHashMap(); // it's important to
-                                                                                // respect order
+        // it's important to respect order => LinkedHashMap
+        Map<ModuleRevisionId, IvyNode> dependencies = new LinkedHashMap<ModuleRevisionId, IvyNode>();
         for (int i = 0; i < dds.length; i++) {
             DependencyDescriptor dd = data.mediate(dds[i]);
             String[] dependencyConfigurations = dd.getDependencyConfigurations(conf, requestedConf);
@@ -347,7 +348,7 @@ public class IvyNode implements Comparable {
             }
 
             // check if not already loaded here
-            IvyNode depNode = (IvyNode) dependencies.get(requestedDependencyRevisionId);
+            IvyNode depNode = dependencies.get(requestedDependencyRevisionId);
             if (depNode == null) {
                 // check if not already loaded during the resolve session
                 depNode = data.getNode(requestedDependencyRevisionId);
@@ -364,7 +365,7 @@ public class IvyNode implements Comparable {
 
             }
             String[] confsArray = depNode.resolveSpecialConfigurations(dependencyConfigurations);
-            Collection confs = Arrays.asList(confsArray);
+            Collection<String> confs = Arrays.asList(confsArray);
             depNode.updateConfsToFetch(confs);
             depNode.addRootModuleConfigurations(depNode.usage, rootModuleConf, confsArray);
             depNode.usage.setRequiredConfs(this, conf, confs);
@@ -381,7 +382,7 @@ public class IvyNode implements Comparable {
     }
 
     public DependencyDescriptor getDependencyDescriptor(IvyNode parent) {
-        return (DependencyDescriptor) dds.get(parent);
+        return dds.get(parent);
     }
 
     private boolean isDependencyModuleExcluded(DependencyDescriptor dd, String rootModuleConf,
@@ -390,14 +391,14 @@ public class IvyNode implements Comparable {
         if (isRoot()) {
             // no callers, but maybe some exclude
             Boolean exclude = doesExclude(md, rootModuleConf, new String[] {rootModuleConf}, dd, a,
-                new Stack());
+                new Stack<ModuleRevisionId>());
             return exclude == null ? false : exclude.booleanValue();
         }
         return callers.doesCallersExclude(rootModuleConf, a);
     }
 
     Boolean doesExclude(ModuleDescriptor md, String rootModuleConf, String[] moduleConfs,
-            DependencyDescriptor dd, Artifact artifact, Stack callersStack) {
+            DependencyDescriptor dd, Artifact artifact, Stack<ModuleRevisionId> callersStack) {
         // artifact is excluded if it match any of the exclude pattern for this dependency...
         if (dd != null) {
             if (dd.doesExclude(moduleConfs, artifact.getId().getArtifactId())) {
@@ -494,7 +495,7 @@ public class IvyNode implements Comparable {
         }
     }
 
-    public void updateConfsToFetch(Collection confs) {
+    public void updateConfsToFetch(Collection<String> confs) {
         confsToFetch.addAll(confs);
         confsToFetch.removeAll(fetchedConfigurations);
     }
@@ -510,12 +511,13 @@ public class IvyNode implements Comparable {
                 return getDescriptor().getPublicConfigurationsNames();
             }
             // there are exclusions in the configuration
-            List exclusions = Arrays.asList(conf.substring(2).split("\\!"));
+            List<String> exclusions = Arrays.asList(conf.substring(2).split("\\!"));
 
-            List ret = new ArrayList(Arrays.asList(getDescriptor().getPublicConfigurationsNames()));
+            List<String> ret = new ArrayList<String>(Arrays.asList(getDescriptor()
+                    .getPublicConfigurationsNames()));
             ret.removeAll(exclusions);
 
-            return (String[]) ret.toArray(new String[ret.size()]);
+            return ret.toArray(new String[ret.size()]);
         }
         return dependencyConfigurations;
     }
@@ -527,16 +529,15 @@ public class IvyNode implements Comparable {
      * @return
      */
     public String[] getRequiredConfigurations(IvyNode in, String inConf) {
-        Collection req = new LinkedHashSet();
+        Collection<String> req = new LinkedHashSet<String>();
         addAllIfNotNull(req, usage.getRequiredConfigurations(in, inConf));
-        for (Iterator iterator = mergedUsages.values().iterator(); iterator.hasNext();) {
-            IvyNodeUsage usage = (IvyNodeUsage) iterator.next();
+        for (IvyNodeUsage usage : mergedUsages.values()) {
             addAllIfNotNull(req, usage.getRequiredConfigurations(in, inConf));
         }
-        return req == null ? new String[0] : (String[]) req.toArray(new String[req.size()]);
+        return req == null ? new String[0] : req.toArray(new String[req.size()]);
     }
 
-    private void addAllIfNotNull(Collection into, Collection col) {
+    private <T> void addAllIfNotNull(Collection<T> into, Collection<T> col) {
         if (col != null) {
             into.addAll(col);
         }
@@ -548,10 +549,11 @@ public class IvyNode implements Comparable {
      * @return
      */
     public String[] getRequiredConfigurations() {
-        Collection required = new ArrayList(confsToFetch.size() + fetchedConfigurations.size());
+        Collection<String> required = new ArrayList<String>(confsToFetch.size()
+                + fetchedConfigurations.size());
         required.addAll(fetchedConfigurations);
         required.addAll(confsToFetch);
-        return (String[]) required.toArray(new String[required.size()]);
+        return required.toArray(new String[required.size()]);
     }
 
     public Configuration getConfiguration(String conf) {
@@ -575,23 +577,22 @@ public class IvyNode implements Comparable {
      * @return
      */
     public String[] getConfigurations(String rootModuleConf) {
-        Set depConfs = new LinkedHashSet();
+        Set<String> depConfs = new LinkedHashSet<String>();
         addAllIfNotNull(depConfs, usage.getConfigurations(rootModuleConf));
-        for (Iterator iterator = mergedUsages.values().iterator(); iterator.hasNext();) {
-            IvyNodeUsage usage = (IvyNodeUsage) iterator.next();
+        for (IvyNodeUsage usage : mergedUsages.values()) {
             addAllIfNotNull(depConfs, usage.getConfigurations(rootModuleConf));
         }
-        return (String[]) depConfs.toArray(new String[depConfs.size()]);
+        return depConfs.toArray(new String[depConfs.size()]);
     }
 
     protected boolean isConfRequiredByMergedUsageOnly(String rootModuleConf, String conf) {
-        Set confs = usage.getConfigurations(rootModuleConf);
+        Set<String> confs = usage.getConfigurations(rootModuleConf);
         return confs == null || !confs.contains(conf);
     }
 
     // This is never called. Could we remove it?
     public void discardConf(String rootModuleConf, String conf) {
-        Set depConfs = usage.addAndGetConfigurations(rootModuleConf);
+        Set<String> depConfs = usage.addAndGetConfigurations(rootModuleConf);
         if (md != null) {
             // remove all given dependency configurations to the set + extended ones
             Configuration c = md.getConfiguration(conf);
@@ -612,7 +613,7 @@ public class IvyNode implements Comparable {
 
     private void addRootModuleConfigurations(IvyNodeUsage usage, String rootModuleConf,
             String[] dependencyConfs) {
-        Set depConfs = usage.addAndGetConfigurations(rootModuleConf);
+        Set<String> depConfs = usage.addAndGetConfigurations(rootModuleConf);
         if (md != null) {
             // add all given dependency configurations to the set + extended ones
             for (int i = 0; i < dependencyConfs.length; i++) {
@@ -637,8 +638,8 @@ public class IvyNode implements Comparable {
      * @return
      */
     public String[] getRootModuleConfigurations() {
-        Set confs = getRootModuleConfigurationsSet();
-        return (String[]) confs.toArray(new String[confs.size()]);
+        Set<String> confs = getRootModuleConfigurationsSet();
+        return confs.toArray(new String[confs.size()]);
     }
 
     /**
@@ -646,18 +647,17 @@ public class IvyNode implements Comparable {
      * 
      * @return
      */
-    public Set getRootModuleConfigurationsSet() {
-        Set confs = new LinkedHashSet();
+    public Set<String> getRootModuleConfigurationsSet() {
+        Set<String> confs = new LinkedHashSet<String>();
         addAllIfNotNull(confs, usage.getRootModuleConfigurations());
-        for (Iterator iterator = mergedUsages.values().iterator(); iterator.hasNext();) {
-            IvyNodeUsage usage = (IvyNodeUsage) iterator.next();
+        for (IvyNodeUsage usage : mergedUsages.values()) {
             addAllIfNotNull(confs, usage.getRootModuleConfigurations());
         }
         return confs;
     }
 
     public String[] getConfsToFetch() {
-        return (String[]) confsToFetch.toArray(new String[confsToFetch.size()]);
+        return confsToFetch.toArray(new String[confsToFetch.size()]);
     }
 
     public String[] getRealConfs(String conf) {
@@ -694,11 +694,11 @@ public class IvyNode implements Comparable {
      * @return a collection representing the path, starting with the from node, followed by the list
      *         of nodes being one path to the current node, excluded
      */
-    private Collection findPath(ModuleId from) {
-        return findPath(from, this, new LinkedList());
+    private Collection<IvyNode> findPath(ModuleId from) {
+        return findPath(from, this, new LinkedList<IvyNode>());
     }
 
-    private Collection findPath(ModuleId from, IvyNode node, List path) {
+    private Collection<IvyNode> findPath(ModuleId from, IvyNode node, List<IvyNode> path) {
         IvyNode parent = node.getDirectCallerFor(from);
         if (parent == null) {
             throw new IllegalArgumentException("no path from " + from + " to " + getId() + " found");
@@ -738,7 +738,7 @@ public class IvyNode implements Comparable {
         } else {
             // let's copy usage information for the given rootModuleConf, into a separate usage
             // object to keep detailed data about where usage comes from
-            IvyNodeUsage mergedUsage = (IvyNodeUsage) mergedUsages.get(node.getId());
+            IvyNodeUsage mergedUsage = mergedUsages.get(node.getId());
             if (mergedUsage == null) {
                 mergedUsage = new IvyNodeUsage(node);
                 mergedUsages.put(node.getId(), mergedUsage);
@@ -751,8 +751,8 @@ public class IvyNode implements Comparable {
         updateConfsToFetch(node.confsToFetch);
     }
 
-    private Collection/* <IvyNodeUsage> */getAllUsages() {
-        Collection usages = new ArrayList();
+    private Collection<IvyNodeUsage> getAllUsages() {
+        Collection<IvyNodeUsage> usages = new ArrayList<IvyNodeUsage>();
         usages.add(usage);
         usages.addAll(mergedUsages.values());
         return usages;
@@ -764,13 +764,11 @@ public class IvyNode implements Comparable {
      * @return
      */
     public Artifact[] getAllArtifacts() {
-        Set ret = new HashSet();
-
-        for (Iterator it = getRootModuleConfigurationsSet().iterator(); it.hasNext();) {
-            String rootModuleConf = (String) it.next();
+        Set<Artifact> ret = new HashSet<Artifact>();
+        for (String rootModuleConf : getRootModuleConfigurationsSet()) {
             ret.addAll(Arrays.asList(getArtifacts(rootModuleConf)));
         }
-        return (Artifact[]) ret.toArray(new Artifact[ret.size()]);
+        return ret.toArray(new Artifact[ret.size()]);
     }
 
     /**
@@ -780,16 +778,15 @@ public class IvyNode implements Comparable {
      * @param artifactFilter
      * @return
      */
-    public Artifact[] getSelectedArtifacts(Filter artifactFilter) {
-        Collection ret = new HashSet();
-        for (Iterator it = getRootModuleConfigurationsSet().iterator(); it.hasNext();) {
-            String rootModuleConf = (String) it.next();
+    public Artifact[] getSelectedArtifacts(Filter<Artifact> artifactFilter) {
+        Collection<Artifact> ret = new HashSet<Artifact>();
+        for (String rootModuleConf : getRootModuleConfigurationsSet()) {
             if (!isEvicted(rootModuleConf) && !isBlacklisted(rootModuleConf)) {
                 ret.addAll(Arrays.asList(getArtifacts(rootModuleConf)));
             }
         }
         ret = FilterHelper.filter(ret, artifactFilter);
-        return (Artifact[]) ret.toArray(new Artifact[ret.size()]);
+        return ret.toArray(new Artifact[ret.size()]);
     }
 
     /**
@@ -813,19 +810,19 @@ public class IvyNode implements Comparable {
                             + this.toString());
         }
 
-        Set artifacts = new HashSet(); // the set we fill before returning
+        Set<Artifact> artifacts = new HashSet<Artifact>(); // the set we fill before returning
 
         // we check if we have dependencyArtifacts includes description for this rootModuleConf
-        Set dependencyArtifacts = usage.getDependencyArtifactsSet(rootModuleConf);
+        Set<DependencyArtifactDescriptor> dependencyArtifacts = usage
+                .getDependencyArtifactsSet(rootModuleConf);
 
         if (md.isDefault() && dependencyArtifacts != null && !dependencyArtifacts.isEmpty()) {
             addArtifactsFromOwnUsage(artifacts, dependencyArtifacts);
             addArtifactsFromMergedUsage(rootModuleConf, artifacts);
         } else {
-            Set includes = new LinkedHashSet();
+            Set<IncludeRule> includes = new LinkedHashSet<IncludeRule>();
             addAllIfNotNull(includes, usage.getDependencyIncludesSet(rootModuleConf));
-            for (Iterator iterator = mergedUsages.values().iterator(); iterator.hasNext();) {
-                IvyNodeUsage usage = (IvyNodeUsage) iterator.next();
+            for (IvyNodeUsage usage : mergedUsages.values()) {
                 addAllIfNotNull(includes, usage.getDependencyIncludesSet(rootModuleConf));
             }
 
@@ -840,7 +837,7 @@ public class IvyNode implements Comparable {
 
                 // first we get all artifacts as defined by the module descriptor
                 // and classify them by artifact id
-                Map allArtifacts = new HashMap();
+                Map<ArtifactId, Artifact> allArtifacts = new HashMap<ArtifactId, Artifact>();
                 for (int i = 0; i < confs.length; i++) {
                     Artifact[] arts = md.getArtifacts(confs[i]);
                     for (int j = 0; j < arts.length; j++) {
@@ -855,9 +852,9 @@ public class IvyNode implements Comparable {
                 addArtifactsFromMergedUsage(rootModuleConf, artifacts);
 
                 // and now we filter according to include rules
-                for (Iterator it = includes.iterator(); it.hasNext();) {
-                    IncludeRule dad = (IncludeRule) it.next();
-                    Collection arts = findArtifactsMatching(dad, allArtifacts);
+                for (Iterator<IncludeRule> it = includes.iterator(); it.hasNext();) {
+                    IncludeRule dad = it.next();
+                    Collection<Artifact> arts = findArtifactsMatching(dad, allArtifacts);
                     if (arts.isEmpty()) {
                         Message.error("a required artifact is not listed by module descriptor: "
                                 + dad.getId());
@@ -873,33 +870,33 @@ public class IvyNode implements Comparable {
         }
 
         // now excludes artifacts that aren't accepted by any caller
-        for (Iterator iter = artifacts.iterator(); iter.hasNext();) {
-            Artifact artifact = (Artifact) iter.next();
+        for (Iterator<Artifact> iter = artifacts.iterator(); iter.hasNext();) {
+            Artifact artifact = iter.next();
             boolean excluded = callers.doesCallersExclude(rootModuleConf, artifact);
             if (excluded) {
                 Message.debug(this + " in " + rootModuleConf + ": excluding " + artifact);
                 iter.remove();
             }
         }
-        return (Artifact[]) artifacts.toArray(new Artifact[artifacts.size()]);
+        return artifacts.toArray(new Artifact[artifacts.size()]);
     }
 
-    private void addArtifactsFromOwnUsage(Set artifacts, Set dependencyArtifacts) {
-        for (Iterator it = dependencyArtifacts.iterator(); it.hasNext();) {
-            DependencyArtifactDescriptor dad = (DependencyArtifactDescriptor) it.next();
+    private void addArtifactsFromOwnUsage(Set<Artifact> artifacts,
+            Set<DependencyArtifactDescriptor> dependencyArtifacts) {
+        for (DependencyArtifactDescriptor dad : dependencyArtifacts) {
             artifacts.add(new MDArtifact(md, dad.getName(), dad.getType(), dad.getExt(), dad
                     .getUrl(), dad.getQualifiedExtraAttributes()));
         }
     }
 
-    private void addArtifactsFromMergedUsage(String rootModuleConf, Set artifacts) {
-        for (Iterator iterator = mergedUsages.values().iterator(); iterator.hasNext();) {
-            IvyNodeUsage usage = (IvyNodeUsage) iterator.next();
-            Set mergedDependencyArtifacts = usage.getDependencyArtifactsSet(rootModuleConf);
+    private void addArtifactsFromMergedUsage(String rootModuleConf, Set<Artifact> artifacts) {
+        for (IvyNodeUsage usage : mergedUsages.values()) {
+            Set<DependencyArtifactDescriptor> mergedDependencyArtifacts = usage
+                    .getDependencyArtifactsSet(rootModuleConf);
             if (mergedDependencyArtifacts != null) {
-                for (Iterator it = mergedDependencyArtifacts.iterator(); it.hasNext();) {
-                    DependencyArtifactDescriptor dad = (DependencyArtifactDescriptor) it.next();
-                    Map extraAttributes = new HashMap(dad.getQualifiedExtraAttributes());
+                for (DependencyArtifactDescriptor dad : mergedDependencyArtifacts) {
+                    Map<String, String> extraAttributes = new HashMap<String, String>(
+                            dad.getQualifiedExtraAttributes());
                     MDArtifact artifact = new MDArtifact(md, dad.getName(), dad.getType(),
                             dad.getExt(), dad.getUrl(), extraAttributes);
 
@@ -914,12 +911,12 @@ public class IvyNode implements Comparable {
         }
     }
 
-    private static Collection findArtifactsMatching(IncludeRule rule, Map allArtifacts) {
-        Collection ret = new ArrayList();
-        for (Iterator iter = allArtifacts.keySet().iterator(); iter.hasNext();) {
-            ArtifactId aid = (ArtifactId) iter.next();
-            if (MatcherHelper.matches(rule.getMatcher(), rule.getId(), aid)) {
-                ret.add(allArtifacts.get(aid));
+    private static Collection<Artifact> findArtifactsMatching(IncludeRule rule,
+            Map<ArtifactId, Artifact> allArtifacts) {
+        Collection<Artifact> ret = new ArrayList<Artifact>();
+        for (Entry<ArtifactId, Artifact> entry : allArtifacts.entrySet()) {
+            if (MatcherHelper.matches(rule.getMatcher(), rule.getId(), entry.getKey())) {
+                ret.add(allArtifacts.get(entry.getValue()));
             }
         }
         return ret;
@@ -1059,7 +1056,7 @@ public class IvyNode implements Comparable {
         return callers.getCallers(rootModuleConf);
     }
 
-    public Collection getAllCallersModuleIds() {
+    public Collection<ModuleId> getAllCallersModuleIds() {
         return callers.getAllCallersModuleIds();
     }
 
@@ -1082,16 +1079,16 @@ public class IvyNode implements Comparable {
         }
     }
 
-    public boolean doesCallersExclude(String rootModuleConf, Artifact artifact, Stack callersStack) {
+    public boolean doesCallersExclude(String rootModuleConf, Artifact artifact,
+            Stack<ModuleRevisionId> callersStack) {
         return callers.doesCallersExclude(rootModuleConf, artifact, callersStack);
     }
 
-    private ModuleRevisionId[] toMrids(Collection path, IvyNode depNode) {
+    private ModuleRevisionId[] toMrids(Collection<IvyNode> path, IvyNode depNode) {
         ModuleRevisionId[] ret = new ModuleRevisionId[path.size() + 1];
         int i = 0;
-        for (Iterator iter = path.iterator(); iter.hasNext(); i++) {
-            IvyNode node = (IvyNode) iter.next();
-            ret[i] = node.getId();
+        for (IvyNode node : path) {
+            ret[i++] = node.getId();
         }
         ret[ret.length - 1] = depNode.getId();
         return ret;
@@ -1102,11 +1099,12 @@ public class IvyNode implements Comparable {
     // /////////////////////////////////////////////////////////////////////////////
 
     /** A copy of the set of resolved nodes (real nodes) */
-    public Set getResolvedNodes(ModuleId moduleId, String rootModuleConf) {
+    public Set<IvyNode> getResolvedNodes(ModuleId moduleId, String rootModuleConf) {
         return eviction.getResolvedNodes(moduleId, rootModuleConf);
     }
 
-    public Collection getResolvedRevisions(ModuleId moduleId, String rootModuleConf) {
+    public Collection<ModuleRevisionId> getResolvedRevisions(ModuleId moduleId,
+            String rootModuleConf) {
         return eviction.getResolvedRevisions(moduleId, rootModuleConf);
     }
 
@@ -1116,22 +1114,21 @@ public class IvyNode implements Comparable {
 
         // bug 105: update selected data with evicted one
         if (evictionData.getSelected() != null) {
-            for (Iterator iter = evictionData.getSelected().iterator(); iter.hasNext();) {
-                IvyNode selected = (IvyNode) iter.next();
+            for (IvyNode selected : evictionData.getSelected()) {
                 selected.updateDataFrom(this, rootModuleConf, false);
             }
         }
     }
 
-    public Collection getAllEvictingConflictManagers() {
+    public Collection<ConflictManager> getAllEvictingConflictManagers() {
         return eviction.getAllEvictingConflictManagers();
     }
 
-    public Collection getAllEvictingNodes() {
+    public Collection<IvyNode> getAllEvictingNodes() {
         return eviction.getAllEvictingNodes();
     }
 
-    public Collection/* <String> */getAllEvictingNodesDetails() {
+    public Collection<String> getAllEvictingNodesDetails() {
         return eviction.getAllEvictingNodesDetails();
     }
 
@@ -1143,11 +1140,11 @@ public class IvyNode implements Comparable {
         return eviction.getEvictedData(rootModuleConf);
     }
 
-    public Collection getEvictedNodes(ModuleId mid, String rootModuleConf) {
+    public Collection<IvyNode> getEvictedNodes(ModuleId mid, String rootModuleConf) {
         return eviction.getEvictedNodes(mid, rootModuleConf);
     }
 
-    public Collection getEvictedRevisions(ModuleId mid, String rootModuleConf) {
+    public Collection<ModuleRevisionId> getEvictedRevisions(ModuleId mid, String rootModuleConf) {
         return eviction.getEvictedRevisions(mid, rootModuleConf);
     }
 
@@ -1164,24 +1161,28 @@ public class IvyNode implements Comparable {
     }
 
     public void markEvicted(String rootModuleConf, IvyNode node, ConflictManager conflictManager,
-            Collection resolved) {
+            Collection<IvyNode> resolved) {
         EvictionData evictionData = new EvictionData(rootModuleConf, node, conflictManager,
                 resolved);
         markEvicted(evictionData);
     }
 
-    public void setEvictedNodes(ModuleId moduleId, String rootModuleConf, Collection evicted) {
+    public void setEvictedNodes(ModuleId moduleId, String rootModuleConf,
+            Collection<IvyNode> evicted) {
         eviction.setEvictedNodes(moduleId, rootModuleConf, evicted);
     }
 
-    public void setResolvedNodes(ModuleId moduleId, String rootModuleConf, Collection resolved) {
+    public void setResolvedNodes(ModuleId moduleId, String rootModuleConf,
+            Collection<IvyNode> resolved) {
         eviction.setResolvedNodes(moduleId, rootModuleConf, resolved);
     }
 
+    @Override
     public String toString() {
         return getResolvedId().toString();
     }
 
+    @Override
     public boolean equals(Object obj) {
         if (!(obj instanceof IvyNode)) {
             return false;
@@ -1190,11 +1191,11 @@ public class IvyNode implements Comparable {
         return node.getId().equals(getId());
     }
 
-    public int compareTo(Object obj) {
-        IvyNode that = (IvyNode) obj;
+    public int compareTo(IvyNode that) {
         return this.getModuleId().compareTo(that.getModuleId());
     }
 
+    @Override
     public int hashCode() {
         return getId().hashCode();
     }
@@ -1208,11 +1209,12 @@ public class IvyNode implements Comparable {
      *            the module id for which pending conflicts should be found
      * @return a Collection of IvyNode in pending conflict
      */
-    public Collection getPendingConflicts(String rootModuleConf, ModuleId mid) {
+    public Collection<IvyNode> getPendingConflicts(String rootModuleConf, ModuleId mid) {
         return eviction.getPendingConflicts(rootModuleConf, mid);
     }
 
-    public void setPendingConflicts(ModuleId moduleId, String rootModuleConf, Collection conflicts) {
+    public void setPendingConflicts(ModuleId moduleId, String rootModuleConf,
+            Collection<IvyNode> conflicts) {
         eviction.setPendingConflicts(moduleId, rootModuleConf, conflicts);
     }
 
@@ -1239,7 +1241,7 @@ public class IvyNode implements Comparable {
             Message.verbose("BLACKLISTING " + bdata);
         }
 
-        Stack callerStack = new Stack();
+        Stack<IvyNode> callerStack = new Stack<IvyNode>();
         callerStack.push(this);
         clearEvictionDataInAllCallers(bdata.getRootModuleConf(), callerStack);
 
@@ -1247,9 +1249,8 @@ public class IvyNode implements Comparable {
         data.blacklist(this);
     }
 
-    private void clearEvictionDataInAllCallers(String rootModuleConf,
-            Stack/* <IvyNode> */callerStack) {
-        IvyNode node = (IvyNode) callerStack.peek();
+    private void clearEvictionDataInAllCallers(String rootModuleConf, Stack<IvyNode> callerStack) {
+        IvyNode node = callerStack.peek();
         Caller[] callers = node.getCallers(rootModuleConf);
         for (int i = 0; i < callers.length; i++) {
             IvyNode callerNode = findNode(callers[i].getModuleRevisionId());
@@ -1332,8 +1333,7 @@ public class IvyNode implements Comparable {
         if (mergedUsages == null) {
             return false;
         }
-        for (Iterator iterator = mergedUsages.values().iterator(); iterator.hasNext();) {
-            IvyNodeUsage usage = (IvyNodeUsage) iterator.next();
+        for (IvyNodeUsage usage : mergedUsages.values()) {
             if (usage.hasTransitiveDepender(rootModuleConf)) {
                 return true;
             }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6d2e199e/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java b/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java
index 399a60a..a53262a 100644
--- a/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java
+++ b/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java
@@ -21,7 +21,6 @@ import java.util.Arrays;
 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 java.util.Stack;
@@ -39,7 +38,8 @@ public class IvyNodeCallers {
 
         private ModuleRevisionId mrid;
 
-        private Map confs = new HashMap(); // Map (String callerConf -> String[] dependencyConfs)
+        // callerConf -> dependencyConfs
+        private Map<String, String[]> confs = new HashMap<String, String[]>();
 
         private DependencyDescriptor dd;
 
@@ -69,9 +69,9 @@ public class IvyNodeCallers {
         }
 
         private void updateConfs(String callerConf, String[] dependencyConfs) {
-            String[] prevDepConfs = (String[]) confs.get(callerConf);
+            String[] prevDepConfs = confs.get(callerConf);
             if (prevDepConfs != null) {
-                Set newDepConfs = new HashSet(Arrays.asList(prevDepConfs));
+                Set<String> newDepConfs = new HashSet<String>(Arrays.asList(prevDepConfs));
                 newDepConfs.addAll(Arrays.asList(dependencyConfs));
                 confs.put(callerConf, newDepConfs.toArray(new String[newDepConfs.size()]));
             } else {
@@ -80,13 +80,14 @@ public class IvyNodeCallers {
         }
 
         public String[] getCallerConfigurations() {
-            return (String[]) confs.keySet().toArray(new String[confs.keySet().size()]);
+            return confs.keySet().toArray(new String[confs.keySet().size()]);
         }
 
         public ModuleRevisionId getModuleRevisionId() {
             return mrid;
         }
 
+        @Override
         public boolean equals(Object obj) {
             if (!(obj instanceof Caller)) {
                 return false;
@@ -95,6 +96,7 @@ public class IvyNodeCallers {
             return other.confs.equals(confs) && mrid.equals(other.mrid);
         }
 
+        @Override
         public int hashCode() {
             // CheckStyle:MagicNumber| OFF
             int hash = 31;
@@ -104,6 +106,7 @@ public class IvyNodeCallers {
             return hash;
         }
 
+        @Override
         public String toString() {
             return mrid.toString();
         }
@@ -133,15 +136,13 @@ public class IvyNodeCallers {
         }
     }
 
-    // Map (String rootModuleConf -> Map (ModuleRevisionId -> Caller)): key in second map is used to
-    // easily get a caller by its mrid
-    private Map callersByRootConf = new HashMap();
+    // key in second map is used to easily get a caller by its mrid
+    private Map<String, Map<ModuleRevisionId, Caller>> callersByRootConf = new HashMap<String, Map<ModuleRevisionId, Caller>>();
 
     // this map contains all the module ids calling this one (including transitively) as keys.
     // the mapped nodes (values) correspond to a direct caller from which the transitive caller
     // comes
-
-    private Map allCallers = new HashMap(); // Map (ModuleId -> IvyNode)
+    private Map<ModuleId, IvyNode> allCallers = new HashMap<ModuleId, IvyNode>();
 
     private IvyNode node;
 
@@ -166,12 +167,12 @@ public class IvyNodeCallers {
             throw new IllegalArgumentException("a module is not authorized to depend on itself: "
                     + node.getId());
         }
-        Map callers = (Map) callersByRootConf.get(rootModuleConf);
+        Map<ModuleRevisionId, Caller> callers = callersByRootConf.get(rootModuleConf);
         if (callers == null) {
-            callers = new HashMap();
+            callers = new HashMap<ModuleRevisionId, Caller>();
             callersByRootConf.put(rootModuleConf, callers);
         }
-        Caller caller = (Caller) callers.get(mrid);
+        Caller caller = callers.get(mrid);
         if (caller == null) {
             caller = new Caller(md, mrid, dd, callerNode.canExclude(rootModuleConf));
             callers.put(mrid, caller);
@@ -179,8 +180,7 @@ public class IvyNodeCallers {
         caller.addConfiguration(requestedConf, dependencyConfs);
 
         IvyNode parent = callerNode.getRealNode();
-        for (Iterator iter = parent.getAllCallersModuleIds().iterator(); iter.hasNext();) {
-            ModuleId mid = (ModuleId) iter.next();
+        for (ModuleId mid : parent.getAllCallersModuleIds()) {
             allCallers.put(mid, parent);
         }
         allCallers.put(mrid.getModuleId(), callerNode);
@@ -188,57 +188,53 @@ public class IvyNodeCallers {
 
     void removeCaller(String rootModuleConf, ModuleRevisionId callerMrid) {
         allCallers.remove(callerMrid.getModuleId());
-        Map callers = (Map) callersByRootConf.get(rootModuleConf);
+        Map<ModuleRevisionId, Caller> callers = callersByRootConf.get(rootModuleConf);
         if (callers != null) {
             callers.remove(callerMrid);
         }
     }
 
     public Caller[] getCallers(String rootModuleConf) {
-        Map callers = (Map) callersByRootConf.get(rootModuleConf);
+        Map<ModuleRevisionId, Caller> callers = callersByRootConf.get(rootModuleConf);
         if (callers == null) {
             return new Caller[0];
         }
-        return (Caller[]) callers.values().toArray(new Caller[callers.values().size()]);
+        return callers.values().toArray(new Caller[callers.values().size()]);
     }
 
     public Caller[] getAllCallers() {
-        Set all = new HashSet();
-        for (Iterator iter = callersByRootConf.values().iterator(); iter.hasNext();) {
-            Map callers = (Map) iter.next();
+        Set<Caller> all = new HashSet<Caller>();
+        for (Map<ModuleRevisionId, Caller> callers : callersByRootConf.values()) {
             all.addAll(callers.values());
         }
-        return (Caller[]) all.toArray(new Caller[all.size()]);
+        return all.toArray(new Caller[all.size()]);
     }
 
     public Caller[] getAllRealCallers() {
-        Set all = new HashSet();
-        for (Iterator iter = callersByRootConf.values().iterator(); iter.hasNext();) {
-            Map callers = (Map) iter.next();
-            for (Iterator iterator = callers.values().iterator(); iterator.hasNext();) {
-                Caller c = (Caller) iterator.next();
+        Set<Caller> all = new HashSet<Caller>();
+        for (Map<ModuleRevisionId, Caller> callers : callersByRootConf.values()) {
+            for (Caller c : callers.values()) {
                 if (c.isRealCaller()) {
                     all.add(c);
                 }
             }
         }
-        return (Caller[]) all.toArray(new Caller[all.size()]);
+        return all.toArray(new Caller[all.size()]);
     }
 
-    public Collection getAllCallersModuleIds() {
+    public Collection<ModuleId> getAllCallersModuleIds() {
         return allCallers.keySet();
     }
 
     void updateFrom(IvyNodeCallers callers, String rootModuleConf, boolean real) {
-        Map nodecallers = (Map) callers.callersByRootConf.get(rootModuleConf);
+        Map<ModuleRevisionId, Caller> nodecallers = callers.callersByRootConf.get(rootModuleConf);
         if (nodecallers != null) {
-            Map thiscallers = (Map) callersByRootConf.get(rootModuleConf);
+            Map<ModuleRevisionId, Caller> thiscallers = callersByRootConf.get(rootModuleConf);
             if (thiscallers == null) {
-                thiscallers = new HashMap();
+                thiscallers = new HashMap<ModuleRevisionId, Caller>();
                 callersByRootConf.put(rootModuleConf, thiscallers);
             }
-            for (Iterator iter = nodecallers.values().iterator(); iter.hasNext();) {
-                Caller caller = (Caller) iter.next();
+            for (Caller caller : nodecallers.values()) {
                 if (!thiscallers.containsKey(caller.getModuleRevisionId())) {
                     if (!real) {
                         caller.setRealCaller(false);
@@ -250,7 +246,7 @@ public class IvyNodeCallers {
     }
 
     public IvyNode getDirectCallerFor(ModuleId from) {
-        return (IvyNode) allCallers.get(from);
+        return allCallers.get(from);
     }
 
     /**
@@ -261,10 +257,11 @@ public class IvyNodeCallers {
      * @return
      */
     boolean doesCallersExclude(String rootModuleConf, Artifact artifact) {
-        return doesCallersExclude(rootModuleConf, artifact, new Stack());
+        return doesCallersExclude(rootModuleConf, artifact, new Stack<ModuleRevisionId>());
     }
 
-    boolean doesCallersExclude(String rootModuleConf, Artifact artifact, Stack callersStack) {
+    boolean doesCallersExclude(String rootModuleConf, Artifact artifact,
+            Stack<ModuleRevisionId> callersStack) {
         callersStack.push(node.getId());
         try {
             Caller[] callers = getCallers(rootModuleConf);

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6d2e199e/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.java b/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.java
index 5c757ee..c08f94a 100644
--- a/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.java
+++ b/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.java
@@ -46,7 +46,7 @@ public class IvyNodeEviction {
         /**
          * Can be null in case of transitive eviction.
          */
-        private Collection selected; // Collection(IvyNode)
+        private Collection<IvyNode> selected;
 
         private String rootModuleConf;
 
@@ -67,7 +67,7 @@ public class IvyNodeEviction {
          *            <tt>null</tt> in case of transitive eviction)
          */
         public EvictionData(String rootModuleConf, IvyNode parent, ConflictManager conflictManager,
-                Collection selected) {
+                Collection<IvyNode> selected) {
             this(rootModuleConf, parent, conflictManager, selected, null);
         }
 
@@ -88,7 +88,7 @@ public class IvyNodeEviction {
          *            a String detailing the reason why the node was evicted
          */
         public EvictionData(String rootModuleConf, IvyNode parent, ConflictManager conflictManager,
-                Collection selected, String detail) {
+                Collection<IvyNode> selected, String detail) {
             this.rootModuleConf = rootModuleConf;
             this.parent = parent;
             this.conflictManager = conflictManager;
@@ -96,6 +96,7 @@ public class IvyNodeEviction {
             this.detail = detail;
         }
 
+        @Override
         public String toString() {
             if (selected != null) {
                 return selected + " in " + parent + (detail == null ? "" : " " + detail) + " ("
@@ -113,7 +114,7 @@ public class IvyNodeEviction {
             return parent;
         }
 
-        public Collection getSelected() {
+        public Collection<IvyNode> getSelected() {
             return selected;
         }
 
@@ -154,6 +155,7 @@ public class IvyNodeEviction {
             return moduleId;
         }
 
+        @Override
         public boolean equals(Object obj) {
             if (!(obj instanceof ModuleIdConf)) {
                 return false;
@@ -162,6 +164,7 @@ public class IvyNodeEviction {
                     && getConf().equals(((ModuleIdConf) obj).getConf());
         }
 
+        @Override
         public int hashCode() {
             // CheckStyle:MagicNumber| OFF
             int hash = 33;
@@ -174,28 +177,21 @@ public class IvyNodeEviction {
 
     private IvyNode node;
 
-    private Map selectedDeps = new HashMap(); // Map (ModuleIdConf -> Set(Node)) // map indicating
+    // map indicating for each dependency which node has been selected
+    private Map<ModuleIdConf, Set<IvyNode>> selectedDeps = new HashMap<ModuleIdConf, Set<IvyNode>>();
 
-    // for each dependency which node has been selected
+    // map indicating for each dependency which nodes are in pending conflict (conflict detected but
+    // not yet resolved)
+    private Map<ModuleIdConf, Set<IvyNode>> pendingConflicts = new HashMap<ModuleIdConf, Set<IvyNode>>();
 
-    private Map pendingConflicts = new HashMap(); // Map (ModuleIdConf -> Set(Node)) // map
+    // map indicating for each dependency which node has been evicted
+    private Map<ModuleIdConf, Set<IvyNode>> evictedDeps = new HashMap<ModuleIdConf, Set<IvyNode>>();
 
-    // indicating for each dependency which nodes
-    // are in pending conflict (conflict detected
-    // but not yet resolved)
+    // map indicating for each dependency which revision has been evicted
+    private Map<ModuleIdConf, Collection<ModuleRevisionId>> evictedRevs = new HashMap<ModuleIdConf, Collection<ModuleRevisionId>>();
 
-    private Map evictedDeps = new HashMap(); // Map (ModuleIdConf -> Set(Node)) // map indicating
-
-    // for each dependency which node has been evicted
-
-    private Map evictedRevs = new HashMap(); // Map (ModuleIdConf -> Set(ModuleRevisionId)) //
-
-    // map indicating for each dependency which revision
-    // has been evicted
-
-    private Map evicted = new HashMap(); // Map (root module conf -> EvictionData) // indicates
-
-    // if the node is evicted in each root module conf
+    // indicates if the node is evicted in each root module conf
+    private Map<String, EvictionData> evicted = new HashMap<String, EvictionData>();
 
     public IvyNodeEviction(IvyNode node) {
         if (node == null) {
@@ -207,26 +203,24 @@ public class IvyNodeEviction {
     /**
      * @return A copy of the set of resolved nodes (real nodes)
      */
-    public Set getResolvedNodes(ModuleId mid, String rootModuleConf) {
-        Collection resolved = (Collection) selectedDeps.get(new ModuleIdConf(mid, rootModuleConf));
-        Set ret = new HashSet();
+    public Set<IvyNode> getResolvedNodes(ModuleId mid, String rootModuleConf) {
+        Collection<IvyNode> resolved = selectedDeps.get(new ModuleIdConf(mid, rootModuleConf));
+        Set<IvyNode> ret = new HashSet<IvyNode>();
         if (resolved != null) {
-            for (Iterator iter = resolved.iterator(); iter.hasNext();) {
-                IvyNode node = (IvyNode) iter.next();
+            for (IvyNode node : resolved) {
                 ret.add(node.getRealNode());
             }
         }
         return ret;
     }
 
-    public Collection getResolvedRevisions(ModuleId mid, String rootModuleConf) {
-        Collection resolved = (Collection) selectedDeps.get(new ModuleIdConf(mid, rootModuleConf));
+    public Collection<ModuleRevisionId> getResolvedRevisions(ModuleId mid, String rootModuleConf) {
+        Collection<IvyNode> resolved = selectedDeps.get(new ModuleIdConf(mid, rootModuleConf));
         if (resolved == null) {
-            return new HashSet();
+            return new HashSet<ModuleRevisionId>();
         } else {
-            Collection resolvedRevs = new HashSet();
-            for (Iterator iter = resolved.iterator(); iter.hasNext();) {
-                IvyNode node = (IvyNode) iter.next();
+            Collection<ModuleRevisionId> resolvedRevs = new HashSet<ModuleRevisionId>();
+            for (IvyNode node : resolved) {
                 ModuleRevisionId resolvedId = node.getResolvedId();
                 resolvedRevs.add(node.getId());
                 resolvedRevs.add(resolvedId);
@@ -242,38 +236,39 @@ public class IvyNodeEviction {
         }
     }
 
-    public void setResolvedNodes(ModuleId moduleId, String rootModuleConf, Collection resolved) {
+    public void setResolvedNodes(ModuleId moduleId, String rootModuleConf,
+            Collection<IvyNode> resolved) {
         ModuleIdConf moduleIdConf = new ModuleIdConf(moduleId, rootModuleConf);
-        selectedDeps.put(moduleIdConf, new HashSet(resolved));
+        selectedDeps.put(moduleIdConf, new HashSet<IvyNode>(resolved));
     }
 
-    public Collection getEvictedNodes(ModuleId mid, String rootModuleConf) {
-        Collection resolved = (Collection) evictedDeps.get(new ModuleIdConf(mid, rootModuleConf));
-        Set ret = new HashSet();
+    public Collection<IvyNode> getEvictedNodes(ModuleId mid, String rootModuleConf) {
+        Collection<IvyNode> resolved = evictedDeps.get(new ModuleIdConf(mid, rootModuleConf));
+        Set<IvyNode> ret = new HashSet<IvyNode>();
         if (resolved != null) {
-            for (Iterator iter = resolved.iterator(); iter.hasNext();) {
-                IvyNode node = (IvyNode) iter.next();
+            for (IvyNode node : resolved) {
                 ret.add(node.getRealNode());
             }
         }
         return ret;
     }
 
-    public Collection getEvictedRevisions(ModuleId mid, String rootModuleConf) {
-        Collection evicted = (Collection) evictedRevs.get(new ModuleIdConf(mid, rootModuleConf));
+    public Collection<ModuleRevisionId> getEvictedRevisions(ModuleId mid, String rootModuleConf) {
+        Collection<ModuleRevisionId> evicted = evictedRevs
+                .get(new ModuleIdConf(mid, rootModuleConf));
         if (evicted == null) {
-            return new HashSet();
+            return new HashSet<ModuleRevisionId>();
         } else {
-            return new HashSet(evicted);
+            return new HashSet<ModuleRevisionId>(evicted);
         }
     }
 
-    public void setEvictedNodes(ModuleId moduleId, String rootModuleConf, Collection evicted) {
+    public void setEvictedNodes(ModuleId moduleId, String rootModuleConf,
+            Collection<IvyNode> evicted) {
         ModuleIdConf moduleIdConf = new ModuleIdConf(moduleId, rootModuleConf);
-        evictedDeps.put(moduleIdConf, new HashSet(evicted));
-        Collection evictedRevs = new HashSet();
-        for (Iterator iter = evicted.iterator(); iter.hasNext();) {
-            IvyNode node = (IvyNode) iter.next();
+        evictedDeps.put(moduleIdConf, new HashSet<IvyNode>(evicted));
+        Collection<ModuleRevisionId> evictedRevs = new HashSet<ModuleRevisionId>();
+        for (IvyNode node : evicted) {
             evictedRevs.add(node.getId());
             evictedRevs.add(node.getResolvedId());
         }
@@ -291,7 +286,8 @@ public class IvyNodeEviction {
         }
         IvyNode root = node.getRoot();
         ModuleId moduleId = node.getId().getModuleId();
-        Collection resolvedRevisions = root.getResolvedRevisions(moduleId, rootModuleConf);
+        Collection<ModuleRevisionId> resolvedRevisions = root.getResolvedRevisions(moduleId,
+            rootModuleConf);
         return !resolvedRevisions.contains(node.getResolvedId())
                 || evictedData.isTransitivelyEvicted();
     }
@@ -312,13 +308,12 @@ public class IvyNodeEviction {
 
     private void cleanEvicted() {
         // check if it was evicted by a node that we are now the real node for
-        for (Iterator iter = evicted.keySet().iterator(); iter.hasNext();) {
-            String rootModuleConf = (String) iter.next();
-            EvictionData ed = (EvictionData) evicted.get(rootModuleConf);
-            Collection sel = ed.getSelected();
+        for (Iterator<String> iter = evicted.keySet().iterator(); iter.hasNext();) {
+            String rootModuleConf = iter.next();
+            EvictionData ed = evicted.get(rootModuleConf);
+            Collection<IvyNode> sel = ed.getSelected();
             if (sel != null) {
-                for (Iterator iterator = sel.iterator(); iterator.hasNext();) {
-                    IvyNode n = (IvyNode) iterator.next();
+                for (IvyNode n : sel) {
                     if (n.getRealNode().equals(node)) {
                         // yes, we are the real node for a selected one !
                         // we are no more evicted in this conf !
@@ -335,12 +330,12 @@ public class IvyNodeEviction {
 
     public EvictionData getEvictedData(String rootModuleConf) {
         cleanEvicted();
-        return (EvictionData) evicted.get(rootModuleConf);
+        return evicted.get(rootModuleConf);
     }
 
     public String[] getEvictedConfs() {
         cleanEvicted();
-        return (String[]) evicted.keySet().toArray(new String[evicted.keySet().size()]);
+        return evicted.keySet().toArray(new String[evicted.keySet().size()]);
     }
 
     /**
@@ -349,14 +344,13 @@ public class IvyNodeEviction {
      * 
      * @return
      */
-    public Collection getAllEvictingNodes() {
-        Collection allEvictingNodes = null;
-        for (Iterator iter = evicted.values().iterator(); iter.hasNext();) {
-            EvictionData ed = (EvictionData) iter.next();
-            Collection selected = ed.getSelected();
+    public Collection<IvyNode> getAllEvictingNodes() {
+        Collection<IvyNode> allEvictingNodes = null;
+        for (EvictionData ed : evicted.values()) {
+            Collection<IvyNode> selected = ed.getSelected();
             if (selected != null) {
                 if (allEvictingNodes == null) {
-                    allEvictingNodes = new HashSet();
+                    allEvictingNodes = new HashSet<IvyNode>();
                 }
                 allEvictingNodes.addAll(selected);
             }
@@ -364,14 +358,13 @@ public class IvyNodeEviction {
         return allEvictingNodes;
     }
 
-    public Collection/* <String> */getAllEvictingNodesDetails() {
-        Collection ret = null;
-        for (Iterator iter = evicted.values().iterator(); iter.hasNext();) {
-            EvictionData ed = (EvictionData) iter.next();
-            Collection selected = ed.getSelected();
+    public Collection<String> getAllEvictingNodesDetails() {
+        Collection<String> ret = null;
+        for (EvictionData ed : evicted.values()) {
+            Collection<IvyNode> selected = ed.getSelected();
             if (selected != null) {
                 if (ret == null) {
-                    ret = new HashSet();
+                    ret = new HashSet<String>();
                 }
                 if (selected.size() == 1) {
                     ret.add(selected.iterator().next()
@@ -384,10 +377,9 @@ public class IvyNodeEviction {
         return ret;
     }
 
-    public Collection getAllEvictingConflictManagers() {
-        Collection ret = new HashSet();
-        for (Iterator iter = evicted.values().iterator(); iter.hasNext();) {
-            EvictionData ed = (EvictionData) iter.next();
+    public Collection<ConflictManager> getAllEvictingConflictManagers() {
+        Collection<ConflictManager> ret = new HashSet<ConflictManager>();
+        for (EvictionData ed : evicted.values()) {
             ret.add(ed.getConflictManager());
         }
         return ret;
@@ -403,10 +395,9 @@ public class IvyNodeEviction {
      * @return
      */
     public EvictionData getEvictionDataInRoot(String rootModuleConf, IvyNode ancestor) {
-        Collection selectedNodes = node.getRoot().getResolvedNodes(node.getModuleId(),
+        Collection<IvyNode> selectedNodes = node.getRoot().getResolvedNodes(node.getModuleId(),
             rootModuleConf);
-        for (Iterator iter = selectedNodes.iterator(); iter.hasNext();) {
-            IvyNode node = (IvyNode) iter.next();
+        for (IvyNode node : selectedNodes) {
             if (node.getResolvedId().equals(this.node.getResolvedId())) {
                 // the node is part of the selected ones for the root: no eviction data to return
                 return null;
@@ -418,22 +409,21 @@ public class IvyNodeEviction {
             node.getModuleId()), selectedNodes);
     }
 
-    public Collection getPendingConflicts(String rootModuleConf, ModuleId mid) {
-        Collection resolved = (Collection) pendingConflicts.get(new ModuleIdConf(mid,
-                rootModuleConf));
-        Set ret = new HashSet();
+    public Collection<IvyNode> getPendingConflicts(String rootModuleConf, ModuleId mid) {
+        Collection<IvyNode> resolved = pendingConflicts.get(new ModuleIdConf(mid, rootModuleConf));
+        Set<IvyNode> ret = new HashSet<IvyNode>();
         if (resolved != null) {
-            for (Iterator iter = resolved.iterator(); iter.hasNext();) {
-                IvyNode node = (IvyNode) iter.next();
+            for (IvyNode node : resolved) {
                 ret.add(node.getRealNode());
             }
         }
         return ret;
     }
 
-    public void setPendingConflicts(ModuleId moduleId, String rootModuleConf, Collection conflicts) {
+    public void setPendingConflicts(ModuleId moduleId, String rootModuleConf,
+            Collection<IvyNode> conflicts) {
         ModuleIdConf moduleIdConf = new ModuleIdConf(moduleId, rootModuleConf);
-        pendingConflicts.put(moduleIdConf, new HashSet(conflicts));
+        pendingConflicts.put(moduleIdConf, new HashSet<IvyNode>(conflicts));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6d2e199e/src/java/org/apache/ivy/core/resolve/IvyNodeUsage.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/core/resolve/IvyNodeUsage.java b/src/java/org/apache/ivy/core/resolve/IvyNodeUsage.java
index 5269558..b6631f2 100644
--- a/src/java/org/apache/ivy/core/resolve/IvyNodeUsage.java
+++ b/src/java/org/apache/ivy/core/resolve/IvyNodeUsage.java
@@ -21,7 +21,6 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
@@ -64,6 +63,7 @@ public class IvyNodeUsage {
             return node;
         }
 
+        @Override
         public boolean equals(Object obj) {
             if (!(obj instanceof NodeConf)) {
                 return false;
@@ -72,6 +72,7 @@ public class IvyNodeUsage {
                     && getConf().equals(((NodeConf) obj).getConf());
         }
 
+        @Override
         public int hashCode() {
             // CheckStyle:MagicNumber| OFF
             int hash = 33;
@@ -81,6 +82,7 @@ public class IvyNodeUsage {
             return hash;
         }
 
+        @Override
         public String toString() {
             return "NodeConf(" + conf + ")";
         }
@@ -96,10 +98,12 @@ public class IvyNodeUsage {
             this.dependerConf = dependerConf;
         }
 
+        @Override
         public String toString() {
             return dd + " [" + dependerConf + "]";
         }
 
+        @Override
         public boolean equals(Object obj) {
             if (!(obj instanceof Depender)) {
                 return false;
@@ -108,6 +112,7 @@ public class IvyNodeUsage {
             return other.dd == dd && other.dependerConf.equals(dependerConf);
         }
 
+        @Override
         public int hashCode() {
             int hash = 33;
             hash += dd.hashCode() * 13;
@@ -118,29 +123,28 @@ public class IvyNodeUsage {
 
     private IvyNode node;
 
-    // Map (String rootConfName -> Set(String confName))
     // used to know which configurations of the dependency are required
     // for each root module configuration
-    private Map rootModuleConfs = new HashMap();
+    // rootConfName -> confNames
+    private Map<String, Set<String>> rootModuleConfs = new HashMap<String, Set<String>>();
 
-    // Map (NodeConf in -> Set(String conf))
-    private Map requiredConfs = new HashMap();
+    private Map<NodeConf, Set<String>> requiredConfs = new HashMap<NodeConf, Set<String>>();
 
-    private Map /* <String, Set<Depender>> */dependers = new HashMap();
+    private Map<String, Set<Depender>> dependers = new HashMap<String, Set<Depender>>();
 
-    // Map (String rootModuleConf -> IvyNodeBlacklist)
-    private Map blacklisted = new HashMap();
+    // rootModuleConf -> black list
+    private Map<String, IvyNodeBlacklist> blacklisted = new HashMap<String, IvyNodeBlacklist>();
 
     public IvyNodeUsage(IvyNode node) {
         this.node = node;
     }
 
-    protected Collection getRequiredConfigurations(IvyNode in, String inConf) {
-        return (Collection) requiredConfs.get(new NodeConf(in, inConf));
+    protected Collection<String> getRequiredConfigurations(IvyNode in, String inConf) {
+        return requiredConfs.get(new NodeConf(in, inConf));
     }
 
-    protected void setRequiredConfs(IvyNode parent, String parentConf, Collection confs) {
-        requiredConfs.put(new NodeConf(parent, parentConf), new HashSet(confs));
+    protected void setRequiredConfs(IvyNode parent, String parentConf, Collection<String> confs) {
+        requiredConfs.put(new NodeConf(parent, parentConf), new HashSet<String>(confs));
     }
 
     /**
@@ -149,26 +153,25 @@ public class IvyNodeUsage {
      * @param rootModuleConf
      * @return
      */
-    protected Set getConfigurations(String rootModuleConf) {
-        return (Set) rootModuleConfs.get(rootModuleConf);
+    protected Set<String> getConfigurations(String rootModuleConf) {
+        return rootModuleConfs.get(rootModuleConf);
     }
 
-    protected Set addAndGetConfigurations(String rootModuleConf) {
-        Set depConfs = (Set) rootModuleConfs.get(rootModuleConf);
+    protected Set<String> addAndGetConfigurations(String rootModuleConf) {
+        Set<String> depConfs = rootModuleConfs.get(rootModuleConf);
         if (depConfs == null) {
-            depConfs = new HashSet();
+            depConfs = new HashSet<String>();
             rootModuleConfs.put(rootModuleConf, depConfs);
         }
         return depConfs;
     }
 
-    protected Set /* <String> */getRootModuleConfigurations() {
+    protected Set<String> getRootModuleConfigurations() {
         return rootModuleConfs.keySet();
     }
 
-    public void updateDataFrom(Collection/* <IvyNodeUsage> */usages, String rootModuleConf) {
-        for (Iterator iterator = usages.iterator(); iterator.hasNext();) {
-            IvyNodeUsage usage = (IvyNodeUsage) iterator.next();
+    public void updateDataFrom(Collection<IvyNodeUsage> usages, String rootModuleConf) {
+        for (IvyNodeUsage usage : usages) {
             updateDataFrom(usage, rootModuleConf);
         }
     }
@@ -184,39 +187,28 @@ public class IvyNodeUsage {
         updateMapOfSetForKey(usage.dependers, dependers, rootModuleConf);
     }
 
-    private void updateMapOfSet(Map from, Map to) {
-        for (Iterator iter = from.keySet().iterator(); iter.hasNext();) {
-            Object key = iter.next();
+    private <K, V> void updateMapOfSet(Map<K, Set<V>> from, Map<K, Set<V>> to) {
+        for (K key : from.keySet()) {
             updateMapOfSetForKey(from, to, key);
         }
     }
 
-    private void updateMapOfSetForKey(Map from, Map to, Object key) {
-        Set set = (Set) from.get(key);
+    private <K, V> void updateMapOfSetForKey(Map<K, Set<V>> from, Map<K, Set<V>> to, K key) {
+        Set<V> set = from.get(key);
         if (set != null) {
-            Set toupdate = (Set) to.get(key);
+            Set<V> toupdate = to.get(key);
             if (toupdate != null) {
                 toupdate.addAll(set);
             } else {
-                to.put(key, new HashSet(set));
+                to.put(key, new HashSet<V>(set));
             }
         }
     }
 
-    // protected void addDependencyArtifacts(String rootModuleConf,
-    // DependencyArtifactDescriptor[] dependencyArtifacts) {
-    // addObjectsForConf(rootModuleConf, Arrays.asList(dependencyArtifacts),
-    // this.dependencyArtifacts);
-    // }
-    //
-    // protected void addDependencyIncludes(String rootModuleConf, IncludeRule[] rules) {
-    // addObjectsForConf(rootModuleConf, Arrays.asList(rules), dependencyIncludes);
-    // }
-    //
-    private void addObjectsForConf(String rootModuleConf, Object objectToAdd, Map map) {
-        Set set = (Set) map.get(rootModuleConf);
+    private <K, V> void addObjectsForConf(K rootModuleConf, V objectToAdd, Map<K, Set<V>> map) {
+        Set<V> set = map.get(rootModuleConf);
         if (set == null) {
-            set = new HashSet();
+            set = new HashSet<V>();
             map.put(rootModuleConf, set);
         }
         set.add(objectToAdd);
@@ -226,14 +218,13 @@ public class IvyNodeUsage {
         addObjectsForConf(rootModuleConf, new Depender(dd, parentConf), dependers);
     }
 
-    protected Set getDependencyArtifactsSet(String rootModuleConf) {
-        Collection dependersInConf = (Collection) dependers.get(rootModuleConf);
+    protected Set<DependencyArtifactDescriptor> getDependencyArtifactsSet(String rootModuleConf) {
+        Collection<Depender> dependersInConf = dependers.get(rootModuleConf);
         if (dependersInConf == null) {
             return null;
         }
-        Set dependencyArtifacts = new HashSet();
-        for (Iterator iterator = dependersInConf.iterator(); iterator.hasNext();) {
-            Depender depender = (Depender) iterator.next();
+        Set<DependencyArtifactDescriptor> dependencyArtifacts = new HashSet<DependencyArtifactDescriptor>();
+        for (Depender depender : dependersInConf) {
             DependencyArtifactDescriptor[] dads = depender.dd
                     .getDependencyArtifacts(depender.dependerConf);
             dependencyArtifacts.addAll(Arrays.asList(dads));
@@ -241,14 +232,13 @@ public class IvyNodeUsage {
         return dependencyArtifacts;
     }
 
-    protected Set getDependencyIncludesSet(String rootModuleConf) {
-        Collection dependersInConf = (Collection) dependers.get(rootModuleConf);
+    protected Set<IncludeRule> getDependencyIncludesSet(String rootModuleConf) {
+        Collection<Depender> dependersInConf = dependers.get(rootModuleConf);
         if (dependersInConf == null) {
             return null;
         }
-        Set dependencyIncludes = new HashSet();
-        for (Iterator iterator = dependersInConf.iterator(); iterator.hasNext();) {
-            Depender depender = (Depender) iterator.next();
+        Set<IncludeRule> dependencyIncludes = new HashSet<IncludeRule>();
+        for (Depender depender : dependersInConf) {
             IncludeRule[] rules = depender.dd.getIncludeRules(depender.dependerConf);
             if (rules == null || rules.length == 0) {
                 // no include rule in at least one depender -> we must include everything,
@@ -293,7 +283,7 @@ public class IvyNodeUsage {
      * @return the blacklist data if any
      */
     protected IvyNodeBlacklist getBlacklistData(String rootModuleConf) {
-        return (IvyNodeBlacklist) blacklisted.get(rootModuleConf);
+        return blacklisted.get(rootModuleConf);
     }
 
     protected IvyNode getNode() {
@@ -310,12 +300,11 @@ public class IvyNodeUsage {
      *         the given root module conf, <code>false</code> otherwise.
      */
     public boolean hasTransitiveDepender(String rootModuleConf) {
-        Set/* <Depender> */dependersSet = (Set) dependers.get(rootModuleConf);
+        Set<Depender> dependersSet = dependers.get(rootModuleConf);
         if (dependersSet == null) {
             return false;
         }
-        for (Iterator iterator = dependersSet.iterator(); iterator.hasNext();) {
-            Depender depender = (Depender) iterator.next();
+        for (Depender depender : dependersSet) {
             if (depender.dd.isTransitive()) {
                 return true;
             }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6d2e199e/src/java/org/apache/ivy/util/filter/ArtifactTypeFilter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/util/filter/ArtifactTypeFilter.java b/src/java/org/apache/ivy/util/filter/ArtifactTypeFilter.java
index 932a891..f3a0165 100644
--- a/src/java/org/apache/ivy/util/filter/ArtifactTypeFilter.java
+++ b/src/java/org/apache/ivy/util/filter/ArtifactTypeFilter.java
@@ -22,18 +22,14 @@ import java.util.Collection;
 
 import org.apache.ivy.core.module.descriptor.Artifact;
 
-public class ArtifactTypeFilter implements Filter {
-    private Collection acceptedTypes;
+public class ArtifactTypeFilter implements Filter<Artifact> {
+    private Collection<String> acceptedTypes;
 
-    public ArtifactTypeFilter(Collection acceptedTypes) {
-        this.acceptedTypes = new ArrayList(acceptedTypes);
+    public ArtifactTypeFilter(Collection<String> acceptedTypes) {
+        this.acceptedTypes = new ArrayList<String>(acceptedTypes);
     }
 
-    public boolean accept(Object o) {
-        if (!(o instanceof Artifact)) {
-            return false;
-        }
-        Artifact art = (Artifact) o;
+    public boolean accept(Artifact art) {
         return acceptedTypes.contains(art.getType());
     }
 }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6d2e199e/src/java/org/apache/ivy/util/filter/Filter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/util/filter/Filter.java b/src/java/org/apache/ivy/util/filter/Filter.java
index 2950e14..cfcd14a 100644
--- a/src/java/org/apache/ivy/util/filter/Filter.java
+++ b/src/java/org/apache/ivy/util/filter/Filter.java
@@ -17,6 +17,6 @@
  */
 package org.apache.ivy.util.filter;
 
-public interface Filter {
-    boolean accept(Object o);
+public interface Filter<T> {
+    boolean accept(T o);
 }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6d2e199e/src/java/org/apache/ivy/util/filter/FilterHelper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/util/filter/FilterHelper.java b/src/java/org/apache/ivy/util/filter/FilterHelper.java
index 9d59ccd..d491e2d 100644
--- a/src/java/org/apache/ivy/util/filter/FilterHelper.java
+++ b/src/java/org/apache/ivy/util/filter/FilterHelper.java
@@ -22,13 +22,15 @@ import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.ivy.core.module.descriptor.Artifact;
+
 public final class FilterHelper {
     private FilterHelper() {
     }
 
-    public static final Filter NO_FILTER = NoFilter.INSTANCE;
+    public static final Filter<Artifact> NO_FILTER = NoFilter.instance();
 
-    public static Filter getArtifactTypeFilter(String types) {
+    public static Filter<Artifact> getArtifactTypeFilter(String types) {
         if (types == null || types.trim().equals("*")) {
             return NO_FILTER;
         }
@@ -36,11 +38,11 @@ public final class FilterHelper {
         return getArtifactTypeFilter(t);
     }
 
-    public static Filter getArtifactTypeFilter(String[] types) {
+    public static Filter<Artifact> getArtifactTypeFilter(String[] types) {
         if (types == null || types.length == 0) {
             return NO_FILTER;
         }
-        List acceptedTypes = new ArrayList(types.length);
+        List<String> acceptedTypes = new ArrayList<String>(types.length);
         for (int i = 0; i < types.length; i++) {
             String current = types[i].trim();
             if ("*".equals(current)) {
@@ -66,13 +68,13 @@ public final class FilterHelper {
      *         href="http://jakarta.apache.org/commons/collections/">Commons-Collections</a>
      *         facility for this. If we accepted to add dependencies on third party jars.
      */
-    public static Collection filter(Collection col, Filter filter) {
+    public static <T> Collection<T> filter(Collection<T> col, Filter<T> filter) {
         if (filter == null) {
             return col;
         }
-        Collection ret = new ArrayList(col);
-        for (Iterator iter = ret.iterator(); iter.hasNext();) {
-            Object element = iter.next();
+        Collection<T> ret = new ArrayList<T>(col);
+        for (Iterator<T> iter = ret.iterator(); iter.hasNext();) {
+            T element = iter.next();
             if (!filter.accept(element)) {
                 iter.remove();
             }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6d2e199e/src/java/org/apache/ivy/util/filter/NoFilter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/util/filter/NoFilter.java b/src/java/org/apache/ivy/util/filter/NoFilter.java
index 92dbbe5..cdaf88d 100644
--- a/src/java/org/apache/ivy/util/filter/NoFilter.java
+++ b/src/java/org/apache/ivy/util/filter/NoFilter.java
@@ -18,8 +18,13 @@
 package org.apache.ivy.util.filter;
 
 public final class NoFilter implements Filter {
+
     public static final Filter INSTANCE = new NoFilter();
 
+    public static <T> Filter<T> instance() {
+        return INSTANCE;
+    }
+
     private NoFilter() {
     }
 
@@ -27,6 +32,7 @@ public final class NoFilter implements Filter {
         return true;
     }
 
+    @Override
     public String toString() {
         return "NoFilter";
     }


[6/6] ant-ivy git commit: Simplify the publication of the distribution

Posted by hi...@apache.org.
Simplify the publication of the distribution

Project: http://git-wip-us.apache.org/repos/asf/ant-ivy/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-ivy/commit/5539fc8b
Tree: http://git-wip-us.apache.org/repos/asf/ant-ivy/tree/5539fc8b
Diff: http://git-wip-us.apache.org/repos/asf/ant-ivy/diff/5539fc8b

Branch: refs/heads/master
Commit: 5539fc8b2ef68c0ff32678cf8b349c8edf005869
Parents: 3df9444
Author: Nicolas Lalevée <ni...@hibnet.org>
Authored: Mon Dec 22 18:37:05 2014 +0100
Committer: Nicolas Lalevée <ni...@hibnet.org>
Committed: Mon Dec 22 18:37:05 2014 +0100

----------------------------------------------------------------------
 build-release.xml        | 26 ++++++++++++++------------
 doc/dev/makerelease.html | 38 +++++++++++++++++++++++---------------
 2 files changed, 37 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/5539fc8b/build-release.xml
----------------------------------------------------------------------
diff --git a/build-release.xml b/build-release.xml
index a164d67..e73bc36 100644
--- a/build-release.xml
+++ b/build-release.xml
@@ -232,8 +232,8 @@
 	</target>
 	
 	<target name="snapshot-src" depends="snapshot-metadata,all-doc">
-		<mkdir dir="${distrib.dir}"/>
-		<zip destfile="${distrib.dir}/${snapshot.full.name}-src.zip">
+		<mkdir dir="${distrib.dir}/dist/${build.version}"/>
+		<zip destfile="${distrib.dir}/dist/${build.version}/${snapshot.full.name}-src.zip">
 			<zipfileset dir="${doc.build.dir}" prefix="${snapshot.full.name}/doc" excludes="**/reports/coverage/**,**/reports/test/**"/>
 			<zipfileset dir="${src.dir}" prefix="${snapshot.full.name}/src/java"/>
 			<zipfileset dir="${basedir}/src/example" prefix="${snapshot.full.name}/src/example"/>
@@ -260,14 +260,15 @@
 
 			<zipfileset dir="${basedir}" includes="build.xml" fullpath="${snapshot.full.name}/build.xml"/>
 		</zip>
-		<tar destfile="${distrib.dir}/${snapshot.full.name}-src.tar.gz" 
+		<tar destfile="${distrib.dir}/dist/${build.version}/${snapshot.full.name}-src.tar.gz" 
 			compression="gzip" longfile="gnu">
-			<zipfileset src="${distrib.dir}/${snapshot.full.name}-src.zip"/>
+			<zipfileset src="${distrib.dir}/dist/${build.version}/${snapshot.full.name}-src.zip"/>
 		</tar>
 	</target>
 	
 	<target name="snapshot-bin-without-dependencies" depends="snapshot-metadata, jar, all-doc">
-		<zip destfile="${distrib.dir}/${snapshot.full.name}-bin.zip">
+		<mkdir dir="${distrib.dir}/dist/${build.version}"/>
+		<zip destfile="${distrib.dir}/dist/${build.version}/${snapshot.full.name}-bin.zip">
 			<zipfileset dir="${doc.build.dir}" prefix="${snapshot.full.name}/doc" excludes="**/reports/coverage/**,**/reports/test/**"/>
 			<zipfileset dir="${basedir}/src/example" prefix="${snapshot.full.name}/src/example"/>
 			<zipfileset dir="${basedir}" includes="NOTICE" fullpath="${snapshot.full.name}/NOTICE"/>
@@ -281,16 +282,17 @@
 
 			<zipfileset dir="${artifacts.build.dir}/jars" includes="${final.name}" fullpath="${snapshot.full.name}/ivy-${build.version}.jar"/>
 		</zip>
-		<tar destfile="${distrib.dir}/${snapshot.full.name}-bin.tar.gz" 
+		<tar destfile="${distrib.dir}/dist/${build.version}/${snapshot.full.name}-bin.tar.gz" 
 			compression="gzip" longfile="gnu">
-			<zipfileset src="${distrib.dir}/${snapshot.full.name}-bin.zip"/>
+			<zipfileset src="${distrib.dir}/dist/${build.version}/${snapshot.full.name}-bin.zip"/>
 		</tar>
 	</target>
 
 	<target name="snapshot-bin-with-dependencies" depends="snapshot-metadata, jar, all-doc">
+		<mkdir dir="${distrib.dir}/dist/${build.version}"/>
 		<delete dir="${build.dir}/lib" />
 		<ivy:retrieve conf="default" pattern="${build.dir}/lib/[artifact]-[revision].[ext]" />
-		<zip destfile="${distrib.dir}/${snapshot.full.name}-bin-with-deps.zip">
+		<zip destfile="${distrib.dir}/dist/${build.version}/${snapshot.full.name}-bin-with-deps.zip">
 			<zipfileset dir="${doc.build.dir}" prefix="${snapshot.full.name}/doc" excludes="**/reports/coverage/**,**/reports/test/**"/>
 			<zipfileset dir="${basedir}/src/example" prefix="${snapshot.full.name}/src/example"/>
 			<zipfileset dir="${basedir}" includes="NOTICE" fullpath="${snapshot.full.name}/NOTICE"/>
@@ -305,9 +307,9 @@
 
 			<zipfileset dir="${build.dir}/lib" prefix="${snapshot.full.name}/lib" excludes="ant-*.jar,bcpg-*.jar,bcprov*.jar" />
 		</zip>
-		<tar destfile="${distrib.dir}/${snapshot.full.name}-bin-with-deps.tar.gz" 
+		<tar destfile="${distrib.dir}/dist/${build.version}/${snapshot.full.name}-bin-with-deps.tar.gz" 
 			compression="gzip" longfile="gnu">
-			<zipfileset src="${distrib.dir}/${snapshot.full.name}-bin-with-deps.zip"/>
+			<zipfileset src="${distrib.dir}/dist/${build.version}/${snapshot.full.name}-bin-with-deps.zip"/>
 		</tar>
 	</target>
 
@@ -355,7 +357,7 @@
 
 	<target name="snapshot-checksums">
 		<checksum algorithm="md5">
-			<fileset dir="${distrib.dir}">
+			<fileset dir="${distrib.dir}/dist/${build.version}">
 				<include name="*.pom"/>
 				<include name="*.jar"/>
 				<include name="*.zip"/>
@@ -363,7 +365,7 @@
 			</fileset>
 		</checksum>
 		<checksum algorithm="sha">
-			<fileset dir="${distrib.dir}">
+			<fileset dir="${distrib.dir}/dist/${build.version}">
 				<include name="*.pom"/>
 				<include name="*.jar"/>
 				<include name="*.zip"/>

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/5539fc8b/doc/dev/makerelease.html
----------------------------------------------------------------------
diff --git a/doc/dev/makerelease.html b/doc/dev/makerelease.html
index cb0a89a..664cc09 100644
--- a/doc/dev/makerelease.html
+++ b/doc/dev/makerelease.html
@@ -51,16 +51,19 @@ And commit your changes in the branch:
 git add doc/ivy.xsd
 git commit -m "release the ivy.xsd"
 </code>
+
 <h3>4. Launch the release script</h3>
 <code>
 ant -f build-release.xml release
 </code>
 The status should be release only for final releases, and milestone for any other intermediate release.
 If the release script is successful, release artifacts will be waiting for you in the build/distrib directory.
+
 <h3>5. Verify the release</h3>
 Check that all zips can be opened correctly, and that running 'ant' after unzipping the source distribution works properly.
 You can also do a smoke test with the generated ivy.jar, to see if it is able to resolve properly a basic module (for instance you can run some tutorials provided in the src/example directory in all distributions).
-<h3>6. Sign and upload the artifacts</h3>
+
+<h3>6. Sign the artifacts</h3>
 It's now time to sign the release artifacts and upload them to a location accessible by other Apache commiters.
 
 Here is a simple way to sign the files using gnupg:
@@ -82,24 +85,18 @@ Be prepared to enter your passphrase several times if you use this script, gpg w
 
 To be able to test the release within IvyDE, it can be deployed in the IvyDE update site. See <a href="http://ant.apache.org/ivy/ivyde/history/trunk/dev/updatesite.html">that page</a> to know how to process.
 
-<h3>8. Create a signed tag</h3>
-As soon as you are happy with the artifacts to be released, it is time to tag the release
-<code>
-git tag -s 2.0.0-beta1 -m 'Release Ivy 2.0.0-beta1'
-</code>
+<h3>8. Publish the release candidate</h3>
 
-And push the changes to the ASF repo
+All artifacts in <tt>build/distrib/dist</tt> needs to be published on the 'dist' svn of the ASF, in the <b>dev</b> part.
+
+The following command lines should do the job:
 <code>
-git push --tags 
+svn checkout -N https://dist.apache.org/repos/dist/dev/ant/ivy build/distrib/dist
+svn add build/distrib/dist/*
+svn commit build/distrib/dist -m 'Ivy 2.4.0 distribution'
 </code>
 
-<h3>9. Publish the release candidate</h3>
-
-All artifacts in <tt>build/distrib</tt> except the <tt>maven2</tt> folder needs to be published on the 'dist' svn of the ASF, in the <b>dev</b> part.
-
-The artifacts should be pushed in that svn folder: https://dist.apache.org/repos/dist/dev/ant/ivy/$VERSION
-
-<h3>10. Publish the Maven artifact to Nexus</h3>
+<h3>9. Publish the Maven artifact to Nexus</h3>
 
 Having your GPG key ID, its password, your apache ID and the associated password, just launch ant and enter the information as required:
 <code>
@@ -114,6 +111,17 @@ Now <i>close</i> the staging repository, with the description "Ivy 2.0.0-beta1".
 
 Once the checks passed, you can find in the <i>Summary</i> the URL of the staging repository. It will something like: https://repository.apache.org/content/repositories/orgapacheant-XXXX/
 
+<h3>10. Create a signed tag</h3>
+As soon as you are happy with the artifacts to be released, it is time to tag the release
+<code>
+git tag -s 2.0.0-beta1 -m 'Release Ivy 2.0.0-beta1'
+</code>
+
+And push the changes to the ASF repo
+<code>
+git push --tags 
+</code>
+
 <h3>11. Call for a vote to approve the release</h3>
 Cast a vote to approve the release on the dev@ant.apache.org mailing list.