ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject [3/6] ant-ivy git commit: use java 5 constructs
Date Sun, 04 Jan 2015 18:00:39 GMT
http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/latest/LatestRevisionStrategy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/latest/LatestRevisionStrategy.java b/src/java/org/apache/ivy/plugins/latest/LatestRevisionStrategy.java
index 51d72d1..7fc3293 100644
--- a/src/java/org/apache/ivy/plugins/latest/LatestRevisionStrategy.java
+++ b/src/java/org/apache/ivy/plugins/latest/LatestRevisionStrategy.java
@@ -31,10 +31,10 @@ public class LatestRevisionStrategy extends ComparatorLatestStrategy {
      * Compares two ModuleRevisionId by their revision. Revisions are compared using an algorithm
      * inspired by PHP version_compare one.
      */
-    final class MridComparator implements Comparator {
-        public int compare(Object o1, Object o2) {
-            String rev1 = ((ModuleRevisionId) o1).getRevision();
-            String rev2 = ((ModuleRevisionId) o2).getRevision();
+    final class MridComparator implements Comparator<ModuleRevisionId> {
+        public int compare(ModuleRevisionId o1, ModuleRevisionId o2) {
+            String rev1 = o1.getRevision();
+            String rev2 = o2.getRevision();
 
             rev1 = rev1.replaceAll("([a-zA-Z])(\\d)", "$1.$2");
             rev1 = rev1.replaceAll("(\\d)([a-zA-Z])", "$1.$2");
@@ -61,9 +61,9 @@ public class LatestRevisionStrategy extends ComparatorLatestStrategy {
                     return Long.valueOf(parts1[i]).compareTo(Long.valueOf(parts2[i]));
                 }
                 // both are strings, we compare them taking into account special meaning
-                Map specialMeanings = getSpecialMeanings();
-                Integer sm1 = (Integer) specialMeanings.get(parts1[i].toLowerCase(Locale.US));
-                Integer sm2 = (Integer) specialMeanings.get(parts2[i].toLowerCase(Locale.US));
+                Map<String, Integer> specialMeanings = getSpecialMeanings();
+                Integer sm1 = specialMeanings.get(parts1[i].toLowerCase(Locale.US));
+                Integer sm2 = specialMeanings.get(parts2[i].toLowerCase(Locale.US));
                 if (sm1 != null) {
                     sm2 = sm2 == null ? new Integer(0) : sm2;
                     return sm1.compareTo(sm2);
@@ -92,10 +92,10 @@ public class LatestRevisionStrategy extends ComparatorLatestStrategy {
      * inspired by PHP version_compare one, unless a dynamic revision is given, in which case the
      * version matcher is used to perform the comparison.
      */
-    final class ArtifactInfoComparator implements Comparator {
-        public int compare(Object o1, Object o2) {
-            String rev1 = ((ArtifactInfo) o1).getRevision();
-            String rev2 = ((ArtifactInfo) o2).getRevision();
+    final class ArtifactInfoComparator implements Comparator<ArtifactInfo> {
+        public int compare(ArtifactInfo o1, ArtifactInfo o2) {
+            String rev1 = o1.getRevision();
+            String rev2 = o2.getRevision();
 
             /*
              * The revisions can still be not resolved, so we use the current version matcher to
@@ -152,19 +152,19 @@ public class LatestRevisionStrategy extends ComparatorLatestStrategy {
         }
     }
 
-    private static final Map DEFAULT_SPECIAL_MEANINGS;
+    private static final Map<String, Integer> DEFAULT_SPECIAL_MEANINGS;
     static {
-        DEFAULT_SPECIAL_MEANINGS = new HashMap();
+        DEFAULT_SPECIAL_MEANINGS = new HashMap<String, Integer>();
         DEFAULT_SPECIAL_MEANINGS.put("dev", new Integer(-1));
         DEFAULT_SPECIAL_MEANINGS.put("rc", new Integer(1));
         DEFAULT_SPECIAL_MEANINGS.put("final", new Integer(2));
     }
 
-    private final Comparator mridComparator = new MridComparator();
+    private final Comparator<ModuleRevisionId> mridComparator = new MridComparator();
 
-    private final Comparator artifactInfoComparator = new ArtifactInfoComparator();
+    private final Comparator<ArtifactInfo> artifactInfoComparator = new ArtifactInfoComparator();
 
-    private Map specialMeanings = null;
+    private Map<String, Integer> specialMeanings = null;
 
     private boolean usedefaultspecialmeanings = true;
 
@@ -178,9 +178,9 @@ public class LatestRevisionStrategy extends ComparatorLatestStrategy {
         getSpecialMeanings().put(meaning.getName().toLowerCase(Locale.US), meaning.getValue());
     }
 
-    public synchronized Map getSpecialMeanings() {
+    public synchronized Map<String, Integer> getSpecialMeanings() {
         if (specialMeanings == null) {
-            specialMeanings = new HashMap();
+            specialMeanings = new HashMap<String, Integer>();
             if (isUsedefaultspecialmeanings()) {
                 specialMeanings.putAll(DEFAULT_SPECIAL_MEANINGS);
             }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/latest/LatestStrategy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/latest/LatestStrategy.java b/src/java/org/apache/ivy/plugins/latest/LatestStrategy.java
index 3666d6a..b9ceb99 100644
--- a/src/java/org/apache/ivy/plugins/latest/LatestStrategy.java
+++ b/src/java/org/apache/ivy/plugins/latest/LatestStrategy.java
@@ -39,7 +39,7 @@ public interface LatestStrategy {
      * @param infos
      * @return
      */
-    List sort(ArtifactInfo[] infos);
+    List<ArtifactInfo> sort(ArtifactInfo[] infos);
 
     String getName();
 }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/latest/LatestTimeStrategy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/latest/LatestTimeStrategy.java b/src/java/org/apache/ivy/plugins/latest/LatestTimeStrategy.java
index e5f8ccf..7ae7b6c 100644
--- a/src/java/org/apache/ivy/plugins/latest/LatestTimeStrategy.java
+++ b/src/java/org/apache/ivy/plugins/latest/LatestTimeStrategy.java
@@ -20,10 +20,10 @@ package org.apache.ivy.plugins.latest;
 import java.util.Comparator;
 
 public class LatestTimeStrategy extends ComparatorLatestStrategy {
-    private static final Comparator COMPARATOR = new Comparator() {
-        public int compare(Object o1, Object o2) {
-            long d1 = ((ArtifactInfo) o1).getLastModified();
-            long d2 = ((ArtifactInfo) o2).getLastModified();
+    private static final Comparator<ArtifactInfo> COMPARATOR = new Comparator<ArtifactInfo>() {
+        public int compare(ArtifactInfo o1, ArtifactInfo o2) {
+            long d1 = o1.getLastModified();
+            long d2 = o2.getLastModified();
             return new Long(d1).compareTo(new Long(d2));
         }
 

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/matcher/AbstractPatternMatcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/matcher/AbstractPatternMatcher.java b/src/java/org/apache/ivy/plugins/matcher/AbstractPatternMatcher.java
index cf90573..28aecfd 100644
--- a/src/java/org/apache/ivy/plugins/matcher/AbstractPatternMatcher.java
+++ b/src/java/org/apache/ivy/plugins/matcher/AbstractPatternMatcher.java
@@ -57,6 +57,7 @@ public abstract class AbstractPatternMatcher implements PatternMatcher {
      */
     protected abstract/* @NotNull */Matcher newMatcher(/* @NotNull */String expression);
 
+    @Override
     public String toString() {
         return getName();
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/matcher/ExactOrRegexpPatternMatcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/matcher/ExactOrRegexpPatternMatcher.java b/src/java/org/apache/ivy/plugins/matcher/ExactOrRegexpPatternMatcher.java
index 116a47a..68e2f74 100644
--- a/src/java/org/apache/ivy/plugins/matcher/ExactOrRegexpPatternMatcher.java
+++ b/src/java/org/apache/ivy/plugins/matcher/ExactOrRegexpPatternMatcher.java
@@ -36,6 +36,7 @@ public/* @Immutable */final class ExactOrRegexpPatternMatcher extends AbstractPa
         super(EXACT_OR_REGEXP);
     }
 
+    @Override
     protected Matcher newMatcher(String expression) {
         return new ExactOrRegexpMatcher(expression);
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/matcher/ExactPatternMatcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/matcher/ExactPatternMatcher.java b/src/java/org/apache/ivy/plugins/matcher/ExactPatternMatcher.java
index 565ee24..0613e38 100644
--- a/src/java/org/apache/ivy/plugins/matcher/ExactPatternMatcher.java
+++ b/src/java/org/apache/ivy/plugins/matcher/ExactPatternMatcher.java
@@ -31,6 +31,7 @@ public/* @Immutable */final class ExactPatternMatcher extends AbstractPatternMat
         super(EXACT);
     }
 
+    @Override
     protected Matcher newMatcher(String expression) {
         return new ExactMatcher(expression);
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/matcher/GlobPatternMatcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/matcher/GlobPatternMatcher.java b/src/java/org/apache/ivy/plugins/matcher/GlobPatternMatcher.java
index 544cb23..5afc5a2 100644
--- a/src/java/org/apache/ivy/plugins/matcher/GlobPatternMatcher.java
+++ b/src/java/org/apache/ivy/plugins/matcher/GlobPatternMatcher.java
@@ -51,6 +51,7 @@ public/* @Immutable */final class GlobPatternMatcher extends AbstractPatternMatc
         super(GLOB);
     }
 
+    @Override
     protected Matcher newMatcher(String expression) {
         return new GlobMatcher(expression);
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/matcher/MapMatcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/matcher/MapMatcher.java b/src/java/org/apache/ivy/plugins/matcher/MapMatcher.java
index fb1bc81..540d8f9 100644
--- a/src/java/org/apache/ivy/plugins/matcher/MapMatcher.java
+++ b/src/java/org/apache/ivy/plugins/matcher/MapMatcher.java
@@ -19,35 +19,31 @@ package org.apache.ivy.plugins.matcher;
 
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Map.Entry;
 
 public class MapMatcher {
-    private Map/* <String, Matcher> */matchers = new HashMap();
+    private Map<String, Matcher> matchers = new HashMap<String, Matcher>();
 
     private PatternMatcher pm;
 
-    private Map attributes;
+    private Map<String, String> attributes;
 
-    public MapMatcher(Map attributes, PatternMatcher pm) {
+    public MapMatcher(Map<String, String> attributes, PatternMatcher pm) {
         this.attributes = attributes;
         this.pm = pm;
-        for (Iterator iter = attributes.entrySet().iterator(); iter.hasNext();) {
-            Entry entry = (Entry) iter.next();
-            String value = (String) entry.getValue();
+        for (Entry<String, String> entry : attributes.entrySet()) {
+            String value = entry.getValue();
             if (value != null) {
                 matchers.put(entry.getKey(), pm.getMatcher(value));
             }
         }
     }
 
-    public boolean matches(Map/* <String,String> */m) {
-        for (Iterator iter = matchers.entrySet().iterator(); iter.hasNext();) {
-            Entry entry = (Entry) iter.next();
-
-            Matcher matcher = (Matcher) entry.getValue();
-            String value = (String) m.get(entry.getKey());
+    public boolean matches(Map<String, String> m) {
+        for (Entry<String, Matcher> entry : matchers.entrySet()) {
+            Matcher matcher = entry.getValue();
+            String value = m.get(entry.getKey());
             if ((value == null) || !matcher.matches(value)) {
                 return false;
             }
@@ -56,11 +52,12 @@ public class MapMatcher {
         return true;
     }
 
+    @Override
     public String toString() {
         return attributes + " (" + pm.getName() + ")";
     }
 
-    public Map getAttributes() {
+    public Map<String, String> getAttributes() {
         return Collections.unmodifiableMap(attributes);
     }
 

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/matcher/RegexpPatternMatcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/matcher/RegexpPatternMatcher.java b/src/java/org/apache/ivy/plugins/matcher/RegexpPatternMatcher.java
index 832ab84..5be28f6 100644
--- a/src/java/org/apache/ivy/plugins/matcher/RegexpPatternMatcher.java
+++ b/src/java/org/apache/ivy/plugins/matcher/RegexpPatternMatcher.java
@@ -38,6 +38,7 @@ public final/* @Immutable */class RegexpPatternMatcher extends AbstractPatternMa
         super(REGEXP);
     }
 
+    @Override
     protected Matcher newMatcher(String expression) {
         return new RegexpMatcher(expression);
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java b/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
index 25ec67c..0dd9bb3 100644
--- a/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
+++ b/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
@@ -69,7 +69,7 @@ public abstract class AbstractModuleDescriptorParser implements ModuleDescriptor
 
         private Resource res;
 
-        private List errors = new ArrayList();
+        private List<String> errors = new ArrayList<String>();
 
         private DefaultModuleDescriptor md;
 
@@ -258,7 +258,7 @@ public abstract class AbstractModuleDescriptorParser implements ModuleDescriptor
 
         private void addExtendingConfigurations(String conf, DefaultDependencyDescriptor dd,
                 boolean useDefaultMappingToGuessRightOperande) {
-            Set configsToAdd = new HashSet();
+            Set<String> configsToAdd = new HashSet<String>();
             Configuration[] configs = md.getConfigurations();
             for (int i = 0; i < configs.length; i++) {
                 String[] ext = configs[i].getExtends();
@@ -272,7 +272,7 @@ public abstract class AbstractModuleDescriptorParser implements ModuleDescriptor
                 }
             }
 
-            String[] confs = (String[]) configsToAdd.toArray(new String[configsToAdd.size()]);
+            String[] confs = configsToAdd.toArray(new String[configsToAdd.size()]);
             parseDepsConfs(confs, dd, useDefaultMappingToGuessRightOperande);
         }
 
@@ -293,14 +293,17 @@ public abstract class AbstractModuleDescriptorParser implements ModuleDescriptor
             }
         }
 
+        @Override
         public void warning(SAXParseException ex) {
             Message.warn("xml parsing: " + getLocationString(ex) + ": " + ex.getMessage());
         }
 
+        @Override
         public void error(SAXParseException ex) {
             addError("xml parsing: " + getLocationString(ex) + ": " + ex.getMessage());
         }
 
+        @Override
         public void fatalError(SAXParseException ex) throws SAXException {
             addError("[Fatal Error] " + getLocationString(ex) + ": " + ex.getMessage());
         }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java b/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java
index f2150d2..b7626df 100644
--- a/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java
+++ b/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java
@@ -22,7 +22,6 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
 import java.text.ParseException;
-import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 
@@ -40,7 +39,7 @@ public final class ModuleDescriptorParserRegistry extends AbstractModuleDescript
         return INSTANCE;
     }
 
-    private List parsers = new LinkedList();
+    private List<ModuleDescriptorParser> parsers = new LinkedList<ModuleDescriptorParser>();
 
     private ModuleDescriptorParserRegistry() {
         parsers.add(PomModuleDescriptorParser.getInstance());
@@ -63,13 +62,11 @@ public final class ModuleDescriptorParserRegistry extends AbstractModuleDescript
     }
 
     public ModuleDescriptorParser[] getParsers() {
-        return (ModuleDescriptorParser[]) parsers
-                .toArray(new ModuleDescriptorParser[parsers.size()]);
+        return parsers.toArray(new ModuleDescriptorParser[parsers.size()]);
     }
 
     public ModuleDescriptorParser getParser(Resource res) {
-        for (Iterator iter = parsers.iterator(); iter.hasNext();) {
-            ModuleDescriptorParser parser = (ModuleDescriptorParser) iter.next();
+        for (ModuleDescriptorParser parser : parsers) {
             if (parser.accept(res)) {
                 return parser;
             }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/parser/ParserSettings.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/parser/ParserSettings.java b/src/java/org/apache/ivy/plugins/parser/ParserSettings.java
index e306421..fc10fd3 100644
--- a/src/java/org/apache/ivy/plugins/parser/ParserSettings.java
+++ b/src/java/org/apache/ivy/plugins/parser/ParserSettings.java
@@ -34,7 +34,7 @@ public interface ParserSettings {
 
     String substitute(String value);
 
-    Map/* <String, String> */substitute(Map/* <String, String> */strings);
+    Map<String, String> substitute(Map<String, String> strings);
 
     ResolutionCacheManager getResolutionCacheManager();
 

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/parser/m2/PomDependencyMgt.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/parser/m2/PomDependencyMgt.java b/src/java/org/apache/ivy/plugins/parser/m2/PomDependencyMgt.java
index 6b6b0af..011e188 100644
--- a/src/java/org/apache/ivy/plugins/parser/m2/PomDependencyMgt.java
+++ b/src/java/org/apache/ivy/plugins/parser/m2/PomDependencyMgt.java
@@ -19,6 +19,8 @@ package org.apache.ivy.plugins.parser.m2;
 
 import java.util.List;
 
+import org.apache.ivy.core.module.id.ModuleId;
+
 public interface PomDependencyMgt {
 
     public abstract String getGroupId();
@@ -29,5 +31,5 @@ public interface PomDependencyMgt {
 
     public abstract String getScope();
 
-    public List /* <ModuleId> */getExcludedModules();
+    public List<ModuleId> getExcludedModules();
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java b/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
index 40a007a..4d13efc 100644
--- a/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
+++ b/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
@@ -23,7 +23,6 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.LinkedList;
 import java.util.List;
@@ -110,7 +109,7 @@ public class PomModuleDescriptorBuilder {
             new Configuration("optional", Visibility.PUBLIC, "contains all optional dependencies",
                     new String[0], true, null)};
 
-    static final Map MAVEN2_CONF_MAPPING = new HashMap();
+    static final Map<String, ConfMapper> MAVEN2_CONF_MAPPING = new HashMap<String, ConfMapper>();
 
     private static final String DEPENDENCY_MANAGEMENT = "m:dependency.management";
 
@@ -118,9 +117,9 @@ public class PomModuleDescriptorBuilder {
 
     private static final String EXTRA_INFO_DELIMITER = "__";
 
-    private static final Collection/* <String> */JAR_PACKAGINGS = Arrays.asList(new String[] {
-            "ejb", "bundle", "maven-plugin", "eclipse-plugin", "jbi-component",
-            "jbi-shared-library", "orbit", "hk2-jar"});
+    private static final Collection<String> JAR_PACKAGINGS = Arrays.asList(new String[] {"ejb",
+            "bundle", "maven-plugin", "eclipse-plugin", "jbi-component", "jbi-shared-library",
+            "orbit", "hk2-jar"});
 
     static interface ConfMapper {
         public void addMappingConfs(DefaultDependencyDescriptor dd, boolean isOptional);
@@ -295,9 +294,9 @@ public class PomModuleDescriptorBuilder {
         DefaultDependencyDescriptor dd = new PomDependencyDescriptor(dep, ivyModuleDescriptor,
                 moduleRevId);
         scope = (scope == null || scope.length() == 0) ? getDefaultScope(dep) : scope;
-        ConfMapper mapping = (ConfMapper) MAVEN2_CONF_MAPPING.get(scope);
+        ConfMapper mapping = MAVEN2_CONF_MAPPING.get(scope);
         mapping.addMappingConfs(dd, dep.isOptional());
-        Map extraAtt = new HashMap();
+        Map<String, String> extraAtt = new HashMap<String, String>();
         if ((dep.getClassifier() != null)
                 || ((dep.getType() != null) && !"jar".equals(dep.getType()))) {
             String type = "jar";
@@ -332,13 +331,12 @@ public class PomModuleDescriptorBuilder {
         // inherited from parent POMs if either of the following is true:
         // the <exclusions> element is missing or the <exclusions> element
         // is present, but empty.
-        List /* <ModuleId> */excluded = dep.getExcludedModules();
+        List<ModuleId> excluded = dep.getExcludedModules();
         if (excluded.isEmpty()) {
             excluded = getDependencyMgtExclusions(ivyModuleDescriptor, dep.getGroupId(),
                 dep.getArtifactId());
         }
-        for (Iterator itExcl = excluded.iterator(); itExcl.hasNext();) {
-            ModuleId excludedModule = (ModuleId) itExcl.next();
+        for (ModuleId excludedModule : excluded) {
             String[] confs = dd.getModuleConfigurations();
             for (int k = 0; k < confs.length; k++) {
                 dd.addExcludeRule(confs[k], new DefaultExcludeRule(new ArtifactId(excludedModule,
@@ -375,11 +373,10 @@ public class PomModuleDescriptorBuilder {
             overwriteExtraInfoIfExists(scopeKey, dep.getScope());
         }
         if (!dep.getExcludedModules().isEmpty()) {
-            final String exclusionPrefix = getDependencyMgtExtraInfoPrefixForExclusion(
-                dep.getGroupId(), dep.getArtifactId());
+            String exclusionPrefix = getDependencyMgtExtraInfoPrefixForExclusion(dep.getGroupId(),
+                dep.getArtifactId());
             int index = 0;
-            for (final Iterator iter = dep.getExcludedModules().iterator(); iter.hasNext();) {
-                final ModuleId excludedModule = (ModuleId) iter.next();
+            for (ModuleId excludedModule : dep.getExcludedModules()) {
                 overwriteExtraInfoIfExists(
                     exclusionPrefix + index,
                     excludedModule.getOrganisation() + EXTRA_INFO_DELIMITER
@@ -413,11 +410,11 @@ public class PomModuleDescriptorBuilder {
         extraInfoByTagName.setContent(pluginExtraInfo);
     }
 
-    public static List /* <PomDependencyMgt> */getPlugins(ModuleDescriptor md) {
-        List result = new ArrayList();
+    public static List<PomDependencyMgt> getPlugins(ModuleDescriptor md) {
+        List<PomDependencyMgt> result = new ArrayList<PomDependencyMgt>();
         String plugins = md.getExtraInfoContentByTagName("m:maven.plugins");
         if (plugins == null) {
-            return new ArrayList();
+            return new ArrayList<PomDependencyMgt>();
         }
         String[] pluginsArray = plugins.split("\\|");
         for (int i = 0; i < pluginsArray.length; i++) {
@@ -457,16 +454,15 @@ public class PomModuleDescriptorBuilder {
             return null;
         }
 
-        public List /* <ModuleId> */getExcludedModules() {
-            return Collections.EMPTY_LIST; // probably not used?
+        public List<ModuleId> getExcludedModules() {
+            return Collections.emptyList(); // probably not used?
         }
     }
 
     private String getDefaultVersion(PomDependencyData dep) {
         ModuleId moduleId = ModuleId.newInstance(dep.getGroupId(), dep.getArtifactId());
         if (ivyModuleDescriptor.getDependencyManagementMap().containsKey(moduleId)) {
-            return ((PomDependencyMgt) ivyModuleDescriptor.getDependencyManagementMap().get(
-                moduleId)).getVersion();
+            return ivyModuleDescriptor.getDependencyManagementMap().get(moduleId).getVersion();
         }
         String key = getDependencyMgtExtraInfoKeyForVersion(dep.getGroupId(), dep.getArtifactId());
         return ivyModuleDescriptor.getExtraInfoContentByTagName(key);
@@ -476,8 +472,7 @@ public class PomModuleDescriptorBuilder {
         String result;
         ModuleId moduleId = ModuleId.newInstance(dep.getGroupId(), dep.getArtifactId());
         if (ivyModuleDescriptor.getDependencyManagementMap().containsKey(moduleId)) {
-            result = ((PomDependencyMgt) ivyModuleDescriptor.getDependencyManagementMap().get(
-                moduleId)).getScope();
+            result = ivyModuleDescriptor.getDependencyManagementMap().get(moduleId).getScope();
         } else {
             String key = getDependencyMgtExtraInfoKeyForScope(dep.getGroupId(), dep.getArtifactId());
             result = ivyModuleDescriptor.getExtraInfoContentByTagName(key);
@@ -508,17 +503,17 @@ public class PomModuleDescriptorBuilder {
                 + artifaceId + EXTRA_INFO_DELIMITER + "exclusion_";
     }
 
-    private static List /* <ModuleId> */getDependencyMgtExclusions(ModuleDescriptor descriptor,
+    private static List<ModuleId> getDependencyMgtExclusions(ModuleDescriptor descriptor,
             String groupId, String artifactId) {
         if (descriptor instanceof PomModuleDescriptor) {
-            PomDependencyMgt dependencyMgt = (PomDependencyMgt) ((PomModuleDescriptor) descriptor)
+            PomDependencyMgt dependencyMgt = ((PomModuleDescriptor) descriptor)
                     .getDependencyManagementMap().get(ModuleId.newInstance(groupId, artifactId));
             if (dependencyMgt != null) {
                 return dependencyMgt.getExcludedModules();
             }
         }
         String exclusionPrefix = getDependencyMgtExtraInfoPrefixForExclusion(groupId, artifactId);
-        List /* <ModuleId> */exclusionIds = new LinkedList /* <ModuleId> */();
+        List<ModuleId> exclusionIds = new LinkedList<ModuleId>();
         for (ExtraInfoHolder extraInfoHolder : descriptor.getExtraInfos()) {
             String key = extraInfoHolder.getName();
             if (key.startsWith(exclusionPrefix)) {
@@ -535,14 +530,12 @@ public class PomModuleDescriptorBuilder {
         return exclusionIds;
     }
 
-    public static Map/* <ModuleId, String version> */
-    getDependencyManagementMap(ModuleDescriptor md) {
-        Map ret = new LinkedHashMap();
+    public static Map<ModuleId, String> getDependencyManagementMap(ModuleDescriptor md) {
+        Map<ModuleId, String> ret = new LinkedHashMap<ModuleId, String>();
         if (md instanceof PomModuleDescriptor) {
-            for (final Iterator iterator = ((PomModuleDescriptor) md).getDependencyManagementMap()
-                    .entrySet().iterator(); iterator.hasNext();) {
-                Map.Entry e = (Entry) iterator.next();
-                PomDependencyMgt dependencyMgt = (PomDependencyMgt) e.getValue();
+            for (Entry<ModuleId, PomDependencyMgt> e : ((PomModuleDescriptor) md)
+                    .getDependencyManagementMap().entrySet()) {
+                PomDependencyMgt dependencyMgt = e.getValue();
                 ret.put(e.getKey(), dependencyMgt.getVersion());
             }
         } else {
@@ -563,8 +556,8 @@ public class PomModuleDescriptorBuilder {
         return ret;
     }
 
-    public static List getDependencyManagements(ModuleDescriptor md) {
-        List result = new ArrayList();
+    public static List<PomDependencyMgt> getDependencyManagements(ModuleDescriptor md) {
+        List<PomDependencyMgt> result = new ArrayList<PomDependencyMgt>();
 
         if (md instanceof PomModuleDescriptor) {
             result.addAll(((PomModuleDescriptor) md).getDependencyManagementMap().values());
@@ -586,7 +579,7 @@ public class PomModuleDescriptorBuilder {
                         String version = md.getExtraInfoContentByTagName(versionKey);
                         String scope = md.getExtraInfoContentByTagName(scopeKey);
 
-                        List /* <ModuleId> */exclusions = getDependencyMgtExclusions(md, parts[1],
+                        List<ModuleId> exclusions = getDependencyMgtExclusions(md, parts[1],
                             parts[2]);
                         result.add(new DefaultPomDependencyMgt(parts[1], parts[2], version, scope,
                                 exclusions));
@@ -598,12 +591,9 @@ public class PomModuleDescriptorBuilder {
     }
 
     @Deprecated
-    public void addExtraInfos(Map extraAttributes) {
-        for (Iterator it = extraAttributes.entrySet().iterator(); it.hasNext();) {
-            Map.Entry entry = (Entry) it.next();
-            String key = (String) entry.getKey();
-            String value = (String) entry.getValue();
-            addExtraInfo(key, value);
+    public void addExtraInfos(Map<String, String> extraAttributes) {
+        for (Entry<String, String> entry : extraAttributes.entrySet()) {
+            addExtraInfo(entry.getKey(), entry.getValue());
         }
     }
 
@@ -633,21 +623,20 @@ public class PomModuleDescriptorBuilder {
     }
 
     @Deprecated
-    public static Map extractPomProperties(Map extraInfo) {
-        Map r = new HashMap();
-        for (Iterator it = extraInfo.entrySet().iterator(); it.hasNext();) {
-            Map.Entry extraInfoEntry = (Map.Entry) it.next();
-            if (((String) extraInfoEntry.getKey()).startsWith(PROPERTIES)) {
-                String prop = ((String) extraInfoEntry.getKey()).substring(PROPERTIES.length()
-                        + EXTRA_INFO_DELIMITER.length());
+    public static Map<String, String> extractPomProperties(Map<String, String> extraInfo) {
+        Map<String, String> r = new HashMap<String, String>();
+        for (Entry<String, String> extraInfoEntry : extraInfo.entrySet()) {
+            if (extraInfoEntry.getKey().startsWith(PROPERTIES)) {
+                String prop = extraInfoEntry.getKey().substring(
+                    PROPERTIES.length() + EXTRA_INFO_DELIMITER.length());
                 r.put(prop, extraInfoEntry.getValue());
             }
         }
         return r;
     }
 
-    public static Map extractPomProperties(List<ExtraInfoHolder> extraInfos) {
-        Map r = new HashMap();
+    public static Map<String, String> extractPomProperties(List<ExtraInfoHolder> extraInfos) {
+        Map<String, String> r = new HashMap<String, String>();
         for (ExtraInfoHolder extraInfoHolder : extraInfos) {
             if ((extraInfoHolder.getName()).startsWith(PROPERTIES)) {
                 String prop = (extraInfoHolder.getName()).substring(PROPERTIES.length()
@@ -717,7 +706,7 @@ public class PomModuleDescriptorBuilder {
     }
 
     public static class PomModuleDescriptor extends DefaultModuleDescriptor {
-        private final Map/* <ModuleId, PomDependencyMgt> */dependencyManagementMap = new HashMap();
+        private final Map<ModuleId, PomDependencyMgt> dependencyManagementMap = new HashMap<ModuleId, PomDependencyMgt>();
 
         public PomModuleDescriptor(ModuleDescriptorParser parser, Resource res) {
             super(parser, res);
@@ -729,7 +718,7 @@ public class PomModuleDescriptorBuilder {
                 dependencyMgt);
         }
 
-        public Map getDependencyManagementMap() {
+        public Map<ModuleId, PomDependencyMgt> getDependencyManagementMap() {
             return dependencyManagementMap;
         }
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java b/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java
index 081db57..1d25d48 100644
--- a/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java
+++ b/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java
@@ -27,7 +27,6 @@ import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
@@ -107,7 +106,7 @@ public class PomReader {
 
     private static final String TYPE = "type";
 
-    private HashMap properties = new HashMap();
+    private HashMap<String, String> properties = new HashMap<String, String>();
 
     private final Element projectElement;
 
@@ -238,9 +237,8 @@ public class PomReader {
             return new License[0];
         }
         licenses.normalize();
-        List/* <License> */lics = new ArrayList();
-        for (Iterator it = getAllChilds(licenses).iterator(); it.hasNext();) {
-            Element license = (Element) it.next();
+        List<License> lics = new ArrayList<License>();
+        for (Element license : getAllChilds(licenses)) {
             if (LICENSE.equals(license.getNodeName())) {
                 String name = getFirstChildText(license, LICENSE_NAME);
                 String url = getFirstChildText(license, LICENSE_URL);
@@ -258,7 +256,7 @@ public class PomReader {
                 lics.add(new License(name, url));
             }
         }
-        return (License[]) lics.toArray(new License[lics.size()]);
+        return lics.toArray(new License[lics.size()]);
     }
 
     public ModuleRevisionId getRelocation() {
@@ -277,9 +275,9 @@ public class PomReader {
         }
     }
 
-    public List /* <PomDependencyData> */getDependencies() {
+    public List<PomDependencyData> getDependencies() {
         Element dependenciesElement = getFirstChildElement(projectElement, DEPENDENCIES);
-        LinkedList dependencies = new LinkedList();
+        LinkedList<PomDependencyData> dependencies = new LinkedList<PomDependencyData>();
         if (dependenciesElement != null) {
             NodeList childs = dependenciesElement.getChildNodes();
             for (int i = 0; i < childs.getLength(); i++) {
@@ -292,10 +290,10 @@ public class PomReader {
         return dependencies;
     }
 
-    public List /* <PomDependencyMgt> */getDependencyMgt() {
+    public List<PomDependencyMgt> getDependencyMgt() {
         Element dependenciesElement = getFirstChildElement(projectElement, DEPENDENCY_MGT);
         dependenciesElement = getFirstChildElement(dependenciesElement, DEPENDENCIES);
-        LinkedList dependencies = new LinkedList();
+        LinkedList<PomDependencyMgt> dependencies = new LinkedList<PomDependencyMgt>();
         if (dependenciesElement != null) {
             NodeList childs = dependenciesElement.getChildNodes();
             for (int i = 0; i < childs.getLength(); i++) {
@@ -354,9 +352,9 @@ public class PomReader {
             return replaceProps(val);
         }
 
-        public List /* <ModuleId> */getExcludedModules() {
+        public List<ModuleId> getExcludedModules() {
             Element exclusionsElement = getFirstChildElement(depElement, EXCLUSIONS);
-            LinkedList exclusions = new LinkedList();
+            LinkedList<ModuleId> exclusions = new LinkedList<ModuleId>();
             if (exclusionsElement != null) {
                 NodeList childs = exclusionsElement.getChildNodes();
                 for (int i = 0; i < childs.getLength(); i++) {
@@ -374,8 +372,8 @@ public class PomReader {
         }
     }
 
-    public List /* <PomPluginElement> */getPlugins() {
-        LinkedList plugins = new LinkedList();
+    public List<PomPluginElement> getPlugins() {
+        LinkedList<PomPluginElement> plugins = new LinkedList<PomPluginElement>();
 
         Element buildElement = getFirstChildElement(projectElement, "build");
         if (buildElement == null) {
@@ -421,8 +419,8 @@ public class PomReader {
             return null; // not used
         }
 
-        public List /* <ModuleId> */getExcludedModules() {
-            return Collections.EMPTY_LIST; // probably not used?
+        public List<ModuleId> getExcludedModules() {
+            return Collections.emptyList(); // probably not used?
         }
     }
 
@@ -438,6 +436,7 @@ public class PomReader {
             this.depElement = depElement;
         }
 
+        @Override
         public String getScope() {
             String val = getFirstChildText(depElement, SCOPE);
             return replaceProps(val);
@@ -463,14 +462,13 @@ public class PomReader {
     /**
      * @return the content of the properties tag into the pom.
      */
-    public Map/* <String,String> */getPomProperties() {
-        Map pomProperties = new HashMap();
+    public Map<String, String> getPomProperties() {
+        Map<String, String> pomProperties = new HashMap<String, String>();
         Element propsEl = getFirstChildElement(projectElement, PROPERTIES);
         if (propsEl != null) {
             propsEl.normalize();
         }
-        for (Iterator it = getAllChilds(propsEl).iterator(); it.hasNext();) {
-            Element prop = (Element) it.next();
+        for (Element prop : getAllChilds(propsEl)) {
             pomProperties.put(prop.getNodeName(), getTextContent(prop));
         }
         return pomProperties;
@@ -527,14 +525,14 @@ public class PomReader {
         return null;
     }
 
-    private static List/* <Element> */getAllChilds(Element parent) {
-        List r = new LinkedList();
+    private static List<Element> getAllChilds(Element parent) {
+        List<Element> r = new LinkedList<Element>();
         if (parent != null) {
             NodeList childs = parent.getChildNodes();
             for (int i = 0; i < childs.getLength(); i++) {
                 Node node = childs.item(i);
                 if (node instanceof Element) {
-                    r.add(node);
+                    r.add((Element) node);
                 }
             }
         }
@@ -590,6 +588,7 @@ public class PomReader {
             }
         }
 
+        @Override
         public int read() throws IOException {
             if (count < prefix.length) {
                 return prefix[count++];
@@ -599,6 +598,7 @@ public class PomReader {
             return result;
         }
 
+        @Override
         public int read(byte[] b, int off, int len) throws IOException {
             if (b == null) {
                 throw new NullPointerException();

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java b/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
index de28d74..5e2a073 100644
--- a/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
+++ b/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
@@ -122,7 +122,7 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
 
     /** Used for test purpose */
     ModuleDescriptor parseDescriptor(ParserSettings ivySettings, InputStream descriptor,
-            Resource res, boolean validate) throws ParseException, IOException {
+            Resource res, boolean validate) throws ParseException {
         Parser parser = newParser(ivySettings);
         parser.setValidate(validate);
         parser.setResource(res);
@@ -209,8 +209,8 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
             }
         }
 
-        protected static final List ALLOWED_VERSIONS = Arrays.asList(new String[] {"1.0", "1.1",
-                "1.2", "1.3", "1.4", "2.0", "2.1", "2.2", "2.3", "2.4"});
+        protected static final List<String> ALLOWED_VERSIONS = Arrays.asList(new String[] {"1.0",
+                "1.1", "1.2", "1.3", "1.4", "2.0", "2.1", "2.2", "2.3", "2.4"});
 
         /* how and what do we have to parse */
         private ParserSettings settings;
@@ -261,7 +261,7 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
             this.validate = validate;
         }
 
-        public void parse() throws ParseException, IOException {
+        public void parse() throws ParseException {
             try {
                 URL schemaURL = validate ? getSchemaURL() : null;
                 if (descriptorURL != null) {
@@ -297,6 +297,7 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
             }
         }
 
+        @Override
         public void startElement(String uri, String localName, String qName, Attributes attributes)
                 throws SAXException {
             try {
@@ -426,7 +427,7 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
             String extendType = attributes.getValue("extendType") != null ? settings
                     .substitute(attributes.getValue("extendType").toLowerCase(Locale.US)) : "all";
 
-            List/* <String> */extendTypes = Arrays.asList(extendType.split(","));
+            List<String> extendTypes = Arrays.asList(extendType.split(","));
             ModuleId parentMid = new ModuleId(parentOrganisation, parentModule);
             ModuleRevisionId parentMrid = new ModuleRevisionId(parentMid, parentRevision);
 
@@ -472,7 +473,7 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
             }
 
             DefaultExtendsDescriptor ed = new DefaultExtendsDescriptor(parent, location,
-                    (String[]) extendTypes.toArray(new String[extendTypes.size()]), local);
+                    extendTypes.toArray(new String[extendTypes.size()]), local);
             getMd().addInheritedDescriptor(ed);
 
             mergeWithOtherModuleDescriptor(extendTypes, parent);
@@ -487,8 +488,8 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
          * @param parent
          *            a given parent module descriptor
          */
-        protected void mergeWithOtherModuleDescriptor(List/* <String> */extendTypes,
-                ModuleDescriptor parent) throws ParseException {
+        protected void mergeWithOtherModuleDescriptor(List<String> extendTypes,
+                ModuleDescriptor parent) {
 
             if (extendTypes.contains("all")) {
                 mergeAll(parent);
@@ -577,8 +578,10 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
             return override == null ? inherited : override;
         }
 
-        private static Map mergeValues(Map inherited, Map overrides) {
-            LinkedHashMap dup = new LinkedHashMap(inherited.size() + overrides.size());
+        private static Map<String, String> mergeValues(Map<String, String> inherited,
+                Map<String, String> overrides) {
+            LinkedHashMap<String, String> dup = new LinkedHashMap<String, String>(inherited.size()
+                    + overrides.size());
             dup.putAll(inherited);
             dup.putAll(overrides);
             return dup;
@@ -922,8 +925,8 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
             String rev = settings.substitute(attributes.getValue("rev"));
             String revConstraint = settings.substitute(attributes.getValue("revConstraint"));
 
-            Map extraAttributes = ExtendableItemHelper.getExtraAttributes(settings, attributes,
-                DEPENDENCY_REGULAR_ATTRIBUTES);
+            Map<String, String> extraAttributes = ExtendableItemHelper.getExtraAttributes(settings,
+                attributes, DEPENDENCY_REGULAR_ATTRIBUTES);
 
             ModuleRevisionId revId = ModuleRevisionId.newInstance(org, name, branch, rev,
                 extraAttributes);
@@ -1124,8 +1127,8 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
             ext = ext != null ? ext : type;
             if (state == State.DEP_ARTIFACT) {
                 String url = settings.substitute(attributes.getValue("url"));
-                Map extraAtt = ExtendableItemHelper.getExtraAttributes(settings, attributes,
-                    new String[] {"name", "type", "ext", "url", "conf"});
+                Map<String, String> extraAtt = ExtendableItemHelper.getExtraAttributes(settings,
+                    attributes, new String[] {"name", "type", "ext", "url", "conf"});
                 confAware = new DefaultDependencyArtifactDescriptor(dd, name, type, ext,
                         url == null ? null : new URL(url), extraAtt);
             } else if (state == State.ARTIFACT_INCLUDE) {
@@ -1135,8 +1138,9 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
                 String module = settings.substitute(attributes.getValue("module"));
                 module = module == null ? PatternMatcher.ANY_EXPRESSION : module;
                 ArtifactId aid = new ArtifactId(new ModuleId(org, module), name, type, ext);
-                Map extraAtt = ExtendableItemHelper.getExtraAttributes(settings, attributes,
-                    new String[] {"org", "module", "name", "type", "ext", "matcher", "conf"});
+                Map<String, String> extraAtt = ExtendableItemHelper.getExtraAttributes(settings,
+                    attributes, new String[] {"org", "module", "name", "type", "ext", "matcher",
+                            "conf"});
                 confAware = new DefaultIncludeRule(aid, matcher, extraAtt);
             } else { // _state == ARTIFACT_EXCLUDE || EXCLUDE
                 PatternMatcher matcher = getPatternMatcher(attributes.getValue("matcher"));
@@ -1145,8 +1149,9 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
                 String module = settings.substitute(attributes.getValue("module"));
                 module = module == null ? PatternMatcher.ANY_EXPRESSION : module;
                 ArtifactId aid = new ArtifactId(new ModuleId(org, module), name, type, ext);
-                Map extraAtt = ExtendableItemHelper.getExtraAttributes(settings, attributes,
-                    new String[] {"org", "module", "name", "type", "ext", "matcher", "conf"});
+                Map<String, String> extraAtt = ExtendableItemHelper.getExtraAttributes(settings,
+                    attributes, new String[] {"org", "module", "name", "type", "ext", "matcher",
+                            "conf"});
                 confAware = new DefaultExcludeRule(aid, matcher, extraAtt);
             }
             String confs = settings.substitute(attributes.getValue("conf"));
@@ -1197,12 +1202,14 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
             return matcher;
         }
 
+        @Override
         public void characters(char[] ch, int start, int length) throws SAXException {
             if (buffer != null) {
                 buffer.append(ch, start, length);
             }
         }
 
+        @Override
         public void endElement(String uri, String localName, String qName) throws SAXException {
             if (state == State.PUB && "artifact".equals(qName)
                     && artifact.getConfigurations().length == 0) {
@@ -1380,6 +1387,7 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
         }
     }
 
+    @Override
     public String toString() {
         return "ivy parser";
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/repository/AbstractRepository.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/repository/AbstractRepository.java b/src/java/org/apache/ivy/plugins/repository/AbstractRepository.java
index f1f4238..f5419bc 100644
--- a/src/java/org/apache/ivy/plugins/repository/AbstractRepository.java
+++ b/src/java/org/apache/ivy/plugins/repository/AbstractRepository.java
@@ -121,6 +121,7 @@ public abstract class AbstractRepository implements Repository {
         this.name = name;
     }
 
+    @Override
     public String toString() {
         return getName();
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/repository/Repository.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/repository/Repository.java b/src/java/org/apache/ivy/plugins/repository/Repository.java
index 9534c99..5bec765 100644
--- a/src/java/org/apache/ivy/plugins/repository/Repository.java
+++ b/src/java/org/apache/ivy/plugins/repository/Repository.java
@@ -98,11 +98,11 @@ public interface Repository {
      * 
      * @param parent
      *            The parent directory from which to generate the listing.
-     * @return A listing of the parent directory's file content, as a List of String.
+     * @return A listing of the parent directory's file content
      * @throws IOException
      *             On listing failure.
      */
-    List list(String parent) throws IOException;
+    List<String> list(String parent) throws IOException;
 
     /**
      * Add a listener to the repository.

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java b/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java
index a0f205b..b813d38 100644
--- a/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java
@@ -27,7 +27,6 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.List;
-import java.util.ListIterator;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
@@ -49,9 +48,9 @@ import org.apache.ivy.util.Message;
  */
 public abstract class AbstractPatternsBasedResolver extends BasicResolver {
 
-    private List ivyPatterns = new ArrayList(); // List (String pattern)
+    private List<String> ivyPatterns = new ArrayList<String>();
 
-    private List artifactPatterns = new ArrayList(); // List (String pattern)
+    private List<String> artifactPatterns = new ArrayList<String>();
 
     private boolean m2compatible = false;
 
@@ -68,6 +67,7 @@ public abstract class AbstractPatternsBasedResolver extends BasicResolver {
             data.getDate());
     }
 
+    @Override
     public ResolvedResource findArtifactRef(Artifact artifact, Date date) {
         ModuleRevisionId mrid = artifact.getModuleRevisionId();
         if (isM2compatible()) {
@@ -77,6 +77,7 @@ public abstract class AbstractPatternsBasedResolver extends BasicResolver {
             getDefaultRMDParser(artifact.getModuleRevisionId().getModuleId()), date);
     }
 
+    @Override
     public ResolvedResource findResource(ResolvedResource[] rress, ResourceMDParser rmdparser,
             ModuleRevisionId mrid, Date date) {
         if (isM2compatible()) {
@@ -87,13 +88,13 @@ public abstract class AbstractPatternsBasedResolver extends BasicResolver {
     }
 
     protected ResolvedResource findResourceUsingPatterns(ModuleRevisionId moduleRevision,
-            List patternList, Artifact artifact, ResourceMDParser rmdparser, Date date) {
-        List resolvedResources = new ArrayList();
-        Set foundRevisions = new HashSet();
+            List<String> patternList, Artifact artifact, ResourceMDParser rmdparser, Date date) {
+        List<ResolvedResource> resolvedResources = new ArrayList<ResolvedResource>();
+        Set<String> foundRevisions = new HashSet<String>();
         boolean dynamic = getSettings().getVersionMatcher().isDynamic(moduleRevision);
         boolean stop = false;
-        for (Iterator iter = patternList.iterator(); iter.hasNext() && !stop;) {
-            String pattern = (String) iter.next();
+        for (Iterator<String> iter = patternList.iterator(); iter.hasNext() && !stop;) {
+            String pattern = iter.next();
             ResolvedResource rres = findResourceUsingPattern(moduleRevision, pattern, artifact,
                 rmdparser, date);
             if ((rres != null) && !foundRevisions.contains(rres.getRevision())) {
@@ -105,11 +106,11 @@ public abstract class AbstractPatternsBasedResolver extends BasicResolver {
         }
 
         if (resolvedResources.size() > 1) {
-            ResolvedResource[] rress = (ResolvedResource[]) resolvedResources
+            ResolvedResource[] rress = resolvedResources
                     .toArray(new ResolvedResource[resolvedResources.size()]);
             return findResource(rress, rmdparser, moduleRevision, date);
         } else if (resolvedResources.size() == 1) {
-            return (ResolvedResource) resolvedResources.get(0);
+            return resolvedResources.get(0);
         } else {
             return null;
         }
@@ -118,8 +119,9 @@ public abstract class AbstractPatternsBasedResolver extends BasicResolver {
     protected abstract ResolvedResource findResourceUsingPattern(ModuleRevisionId mrid,
             String pattern, Artifact artifact, ResourceMDParser rmdparser, Date date);
 
-    protected Collection findNames(Map tokenValues, String token) {
-        Collection names = new HashSet();
+    @Override
+    protected Collection<String> findNames(Map<String, String> tokenValues, String token) {
+        Collection<String> names = new HashSet<String>();
         names.addAll(findIvyNames(tokenValues, token));
         if (isAllownomd()) {
             names.addAll(findArtifactNames(tokenValues, token));
@@ -127,9 +129,9 @@ public abstract class AbstractPatternsBasedResolver extends BasicResolver {
         return names;
     }
 
-    protected Collection findIvyNames(Map tokenValues, String token) {
-        Collection names = new HashSet();
-        tokenValues = new HashMap(tokenValues);
+    protected Collection<String> findIvyNames(Map<String, String> tokenValues, String token) {
+        Collection<String> names = new HashSet<String>();
+        tokenValues = new HashMap<String, String>(tokenValues);
         tokenValues.put(IvyPatternHelper.ARTIFACT_KEY, "ivy");
         tokenValues.put(IvyPatternHelper.TYPE_KEY, "ivy");
         tokenValues.put(IvyPatternHelper.EXT_KEY, "xml");
@@ -141,9 +143,9 @@ public abstract class AbstractPatternsBasedResolver extends BasicResolver {
         return names;
     }
 
-    protected Collection findArtifactNames(Map tokenValues, String token) {
-        Collection names = new HashSet();
-        tokenValues = new HashMap(tokenValues);
+    protected Collection<String> findArtifactNames(Map<String, String> tokenValues, String token) {
+        Collection<String> names = new HashSet<String>();
+        tokenValues = new HashMap<String, String>(tokenValues);
         tokenValues
                 .put(IvyPatternHelper.ARTIFACT_KEY, tokenValues.get(IvyPatternHelper.MODULE_KEY));
         tokenValues.put(IvyPatternHelper.TYPE_KEY, "jar");
@@ -156,54 +158,53 @@ public abstract class AbstractPatternsBasedResolver extends BasicResolver {
         return names;
     }
 
-    public Map[] listTokenValues(String[] tokens, Map criteria) {
-        Set result = new LinkedHashSet();
+    @Override
+    public Map<String, String>[] listTokenValues(String[] tokens, Map<String, Object> criteria) {
+        Set<Map<String, String>> result = new LinkedHashSet<Map<String, String>>();
 
         // use ivy patterns
-        List ivyPatterns = getIvyPatterns();
-        Map tokenValues = new HashMap(criteria);
-        tokenValues.put(IvyPatternHelper.TYPE_KEY, "ivy");
-        tokenValues.put(IvyPatternHelper.EXT_KEY, getModuleDescriptorExtension());
+        List<String> ivyPatterns = getIvyPatterns();
+        Map<String, Object> subcriteria = new HashMap<String, Object>(criteria);
+        subcriteria.put(IvyPatternHelper.TYPE_KEY, "ivy");
+        subcriteria.put(IvyPatternHelper.EXT_KEY, getModuleDescriptorExtension());
         if (isM2compatible()) {
-            convertM2TokenValuesForResourceSearch(tokenValues);
+            convertM2CriteriaForResourceSearch(subcriteria);
         }
-        for (Iterator it = ivyPatterns.iterator(); it.hasNext();) {
-            String ivyPattern = (String) it.next();
-            result.addAll(resolveTokenValues(tokens, ivyPattern, tokenValues, false));
+        for (String ivyPattern : ivyPatterns) {
+            result.addAll(resolveTokenValues(tokens, ivyPattern, subcriteria, false));
         }
 
         if (isAllownomd()) {
-            List artifactPatterns = getArtifactPatterns();
-            tokenValues = new HashMap(criteria);
-            tokenValues.put(IvyPatternHelper.TYPE_KEY, "jar");
-            tokenValues.put(IvyPatternHelper.EXT_KEY, "jar");
+            List<String> artifactPatterns = getArtifactPatterns();
+            subcriteria = new HashMap<String, Object>(criteria);
+            subcriteria.put(IvyPatternHelper.TYPE_KEY, "jar");
+            subcriteria.put(IvyPatternHelper.EXT_KEY, "jar");
             if (isM2compatible()) {
-                convertM2TokenValuesForResourceSearch(tokenValues);
+                convertM2CriteriaForResourceSearch(subcriteria);
             }
-            for (Iterator it = artifactPatterns.iterator(); it.hasNext();) {
-                String artifactPattern = (String) it.next();
-                result.addAll(resolveTokenValues(tokens, artifactPattern, tokenValues, true));
+            for (String artifactPattern : artifactPatterns) {
+                result.addAll(resolveTokenValues(tokens, artifactPattern, subcriteria, true));
             }
         }
 
-        return (Map[]) result.toArray(new Map[result.size()]);
+        return result.toArray(new Map[result.size()]);
     }
 
     protected String getModuleDescriptorExtension() {
         return "xml";
     }
 
-    private Set resolveTokenValues(String[] tokens, String pattern, Map criteria, boolean noMd) {
-        Set result = new LinkedHashSet();
-        Set tokenSet = new HashSet(Arrays.asList(tokens));
+    private Set<Map<String, String>> resolveTokenValues(String[] tokens, String pattern,
+            Map<String, Object> criteria, boolean noMd) {
+        Set<Map<String, String>> result = new LinkedHashSet<Map<String, String>>();
+        Set<String> tokenSet = new HashSet<String>(Arrays.asList(tokens));
 
-        Map tokenValues = new HashMap();
-        for (Iterator it = criteria.entrySet().iterator(); it.hasNext();) {
-            Map.Entry entry = (Entry) it.next();
-            Object key = entry.getKey();
+        Map<String, String> tokenValues = new HashMap<String, String>();
+        for (Entry<String, Object> entry : criteria.entrySet()) {
+            String key = entry.getKey();
             Object value = entry.getValue();
             if (value instanceof String) {
-                tokenValues.put(key, value);
+                tokenValues.put(key, (String) value);
             }
         }
 
@@ -234,11 +235,10 @@ public abstract class AbstractPatternsBasedResolver extends BasicResolver {
             return result;
         }
 
-        List vals = new ArrayList(Arrays.asList(values));
+        List<String> vals = new ArrayList<String>(Arrays.asList(values));
         filterNames(vals);
 
-        for (Iterator it = vals.iterator(); it.hasNext();) {
-            String value = (String) it.next();
+        for (String value : vals) {
             if ((matcher != null) && !matcher.matches(value)) {
                 continue;
             }
@@ -247,16 +247,15 @@ public abstract class AbstractPatternsBasedResolver extends BasicResolver {
             String moreResolvedPattern = IvyPatternHelper.substituteTokens(
                 partiallyResolvedPattern, tokenValues);
 
-            Map newCriteria = new HashMap(criteria);
+            Map<String, Object> newCriteria = new HashMap<String, Object>(criteria);
             newCriteria.put(token, value);
             if (noMd && "artifact".equals(token)) {
                 newCriteria.put("module", value);
             } else if (noMd && "module".equals(token)) {
                 newCriteria.put("artifact", value);
             }
-            result.addAll(resolveTokenValues(
-                (String[]) tokenSet.toArray(new String[tokenSet.size()]), moreResolvedPattern,
-                newCriteria, noMd));
+            result.addAll(resolveTokenValues(tokenSet.toArray(new String[tokenSet.size()]),
+                moreResolvedPattern, newCriteria, noMd));
         }
 
         return result;
@@ -266,7 +265,8 @@ public abstract class AbstractPatternsBasedResolver extends BasicResolver {
 
     protected abstract boolean exist(String path);
 
-    protected void findTokenValues(Collection names, List patterns, Map tokenValues, String token) {
+    protected void findTokenValues(Collection<String> names, List<String> patterns,
+            Map<String, String> tokenValues, String token) {
         // to be overridden by subclasses wanting to have listing features
     }
 
@@ -283,19 +283,19 @@ public abstract class AbstractPatternsBasedResolver extends BasicResolver {
         artifactPatterns.add(pattern);
     }
 
-    public List getIvyPatterns() {
+    public List<String> getIvyPatterns() {
         return Collections.unmodifiableList(ivyPatterns);
     }
 
-    public List getArtifactPatterns() {
+    public List<String> getArtifactPatterns() {
         return Collections.unmodifiableList(artifactPatterns);
     }
 
-    protected void setIvyPatterns(List patterns) {
+    protected void setIvyPatterns(List<String> patterns) {
         ivyPatterns = patterns;
     }
 
-    protected void setArtifactPatterns(List patterns) {
+    protected void setArtifactPatterns(List<String> patterns) {
         artifactPatterns = patterns;
     }
 
@@ -310,17 +310,16 @@ public abstract class AbstractPatternsBasedResolver extends BasicResolver {
         artifactPatterns.add(p.getPattern());
     }
 
+    @Override
     public void dumpSettings() {
         super.dumpSettings();
         Message.debug("\t\tm2compatible: " + isM2compatible());
         Message.debug("\t\tivy patterns:");
-        for (ListIterator iter = getIvyPatterns().listIterator(); iter.hasNext();) {
-            String p = (String) iter.next();
+        for (String p : getIvyPatterns()) {
             Message.debug("\t\t\t" + p);
         }
         Message.debug("\t\tartifact patterns:");
-        for (ListIterator iter = getArtifactPatterns().listIterator(); iter.hasNext();) {
-            String p = (String) iter.next();
+        for (String p : getArtifactPatterns()) {
             Message.debug("\t\t\t" + p);
         }
     }
@@ -355,11 +354,17 @@ public abstract class AbstractPatternsBasedResolver extends BasicResolver {
         return org.replace('.', '/');
     }
 
-    protected void convertM2TokenValuesForResourceSearch(Map tokenValues) {
-        if (tokenValues.get(IvyPatternHelper.ORGANISATION_KEY) instanceof String) {
-            tokenValues.put(IvyPatternHelper.ORGANISATION_KEY,
-                convertM2OrganizationForResourceSearch((String) tokenValues
-                        .get(IvyPatternHelper.ORGANISATION_KEY)));
+    protected void convertM2TokenValuesForResourceSearch(Map<String, String> tokenValues) {
+        tokenValues.put(IvyPatternHelper.ORGANISATION_KEY,
+            convertM2OrganizationForResourceSearch(tokenValues
+                    .get(IvyPatternHelper.ORGANISATION_KEY)));
+    }
+
+    protected void convertM2CriteriaForResourceSearch(Map<String, Object> criteria) {
+        Object org = criteria.get(IvyPatternHelper.ORGANISATION_KEY);
+        if (org instanceof String) {
+            criteria.put(IvyPatternHelper.ORGANISATION_KEY,
+                convertM2OrganizationForResourceSearch((String) org));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java b/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java
index 7f0d75f..ff0fa3c 100644
--- a/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java
@@ -170,11 +170,11 @@ public abstract class AbstractResolver implements DependencyResolver, HasLatestS
         Message.verbose("no failure report implemented by " + getName());
     }
 
-    public String[] listTokenValues(String token, Map otherTokenValues) {
+    public String[] listTokenValues(String token, Map<String, String> otherTokenValues) {
         return new String[0];
     }
 
-    public Map[] listTokenValues(String[] tokens, Map criteria) {
+    public Map<String, String>[] listTokenValues(String[] tokens, Map<String, Object> criteria) {
         return new Map[0];
     }
 
@@ -190,6 +190,7 @@ public abstract class AbstractResolver implements DependencyResolver, HasLatestS
         return new RevisionEntry[0];
     }
 
+    @Override
     public String toString() {
         return getName();
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/AbstractSshBasedResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/AbstractSshBasedResolver.java b/src/java/org/apache/ivy/plugins/resolver/AbstractSshBasedResolver.java
index f85ce86..9834679 100644
--- a/src/java/org/apache/ivy/plugins/resolver/AbstractSshBasedResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/AbstractSshBasedResolver.java
@@ -143,5 +143,6 @@ public abstract class AbstractSshBasedResolver extends RepositoryResolver {
         getSshBasedRepository().setPort(port);
     }
 
+    @Override
     public abstract String getTypeName();
 }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java b/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java
index ce1309d..2980d0c 100644
--- a/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java
@@ -31,7 +31,6 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.ListIterator;
 import java.util.Map;
@@ -61,6 +60,7 @@ import org.apache.ivy.core.search.ModuleEntry;
 import org.apache.ivy.core.search.OrganisationEntry;
 import org.apache.ivy.core.search.RevisionEntry;
 import org.apache.ivy.plugins.conflict.ConflictManager;
+import org.apache.ivy.plugins.latest.ArtifactInfo;
 import org.apache.ivy.plugins.namespace.Namespace;
 import org.apache.ivy.plugins.parser.ModuleDescriptorParser;
 import org.apache.ivy.plugins.parser.ModuleDescriptorParserRegistry;
@@ -138,9 +138,9 @@ public abstract class BasicResolver extends AbstractResolver {
      */
     private boolean envDependent = true;
 
-    private List ivyattempts = new ArrayList();
+    private List<String> ivyattempts = new ArrayList<String>();
 
-    private Map artattempts = new HashMap();
+    private Map<Artifact, List<String>> artattempts = new HashMap<Artifact, List<String>>();
 
     private boolean checkconsistency = true;
 
@@ -471,8 +471,8 @@ public abstract class BasicResolver extends AbstractResolver {
     }
 
     private ModuleRevisionId getRevision(ResolvedResource ivyRef, ModuleRevisionId askedMrid,
-            ModuleDescriptor md) throws ParseException {
-        Map allAttributes = new HashMap();
+            ModuleDescriptor md) {
+        Map<String, String> allAttributes = new HashMap<String, String>();
         allAttributes.putAll(md.getQualifiedExtraAttributes());
         allAttributes.putAll(askedMrid.getQualifiedExtraAttributes());
 
@@ -626,13 +626,12 @@ public abstract class BasicResolver extends AbstractResolver {
             errors.append("bad status: '" + md.getStatus() + "'; ");
             ok = false;
         }
-        for (Iterator it = mrid.getExtraAttributes().entrySet().iterator(); it.hasNext();) {
-            Entry extra = (Entry) it.next();
+        for (Entry<String, String> extra : mrid.getExtraAttributes().entrySet()) {
             if (extra.getValue() != null
-                    && !extra.getValue().equals(md.getExtraAttribute((String) extra.getKey()))) {
+                    && !extra.getValue().equals(md.getExtraAttribute(extra.getKey()))) {
                 String errorMsg = "bad " + extra.getKey() + " found in " + ivyRef.getResource()
                         + ": expected='" + extra.getValue() + "' found='"
-                        + md.getExtraAttribute((String) extra.getKey()) + "'";
+                        + md.getExtraAttribute(extra.getKey()) + "'";
                 Message.error("\t" + getName() + ": " + errorMsg);
                 errors.append(errorMsg + ";");
                 ok = false;
@@ -663,18 +662,20 @@ public abstract class BasicResolver extends AbstractResolver {
         VersionMatcher versionMatcher = getSettings().getVersionMatcher();
 
         ResolvedResource found = null;
-        List sorted = getLatestStrategy().sort(rress);
-        List rejected = new ArrayList();
-        List foundBlacklisted = new ArrayList();
+        List<ArtifactInfo> sorted = getLatestStrategy().sort(rress);
+        List<String> rejected = new ArrayList<String>();
+        List<ModuleRevisionId> foundBlacklisted = new ArrayList<ModuleRevisionId>();
         IvyContext context = IvyContext.getContext();
 
-        for (ListIterator iter = sorted.listIterator(sorted.size()); iter.hasPrevious();) {
+        for (ListIterator<ArtifactInfo> iter = sorted.listIterator(sorted.size()); iter
+                .hasPrevious();) {
             ResolvedResource rres = (ResolvedResource) iter.previous();
             // we start by filtering based on information already available,
             // even though we don't even know if the resource actually exist.
             // But checking for existence is most of the time more costly than checking
             // name, blacklisting and first level version matching
-            if (filterNames(new ArrayList(Collections.singleton(rres.getRevision()))).isEmpty()) {
+            if (filterNames(new ArrayList<String>(Collections.singleton(rres.getRevision())))
+                    .isEmpty()) {
                 Message.debug("\t" + name + ": filtered by name: " + rres);
                 continue;
             }
@@ -760,7 +761,7 @@ public abstract class BasicResolver extends AbstractResolver {
      *            the list to filter.
      * @return the filtered list
      */
-    protected Collection filterNames(Collection names) {
+    protected Collection<String> filterNames(Collection<String> names) {
         getSettings().filterIgnore(names);
         return names;
     }
@@ -776,9 +777,9 @@ public abstract class BasicResolver extends AbstractResolver {
     }
 
     protected void logArtifactAttempt(Artifact art, String attempt) {
-        List attempts = (List) artattempts.get(art);
+        List<String> attempts = artattempts.get(art);
         if (attempts == null) {
-            attempts = new ArrayList();
+            attempts = new ArrayList<String>();
             artattempts.put(art, attempts);
         }
         attempts.add(attempt);
@@ -794,31 +795,30 @@ public abstract class BasicResolver extends AbstractResolver {
         }
     }
 
+    @Override
     public void reportFailure() {
         Message.warn("==== " + getName() + ": tried");
-        for (ListIterator iter = ivyattempts.listIterator(); iter.hasNext();) {
-            String m = (String) iter.next();
+        for (String m : ivyattempts) {
             Message.warn("  " + m);
         }
-        for (Iterator iter = artattempts.keySet().iterator(); iter.hasNext();) {
-            Artifact art = (Artifact) iter.next();
-            List attempts = (List) artattempts.get(art);
+        for (Entry<Artifact, List<String>> entry : artattempts.entrySet()) {
+            Artifact art = entry.getKey();
+            List<String> attempts = entry.getValue();
             if (attempts != null) {
                 Message.warn("  -- artifact " + art + ":");
-                for (ListIterator iterator = attempts.listIterator(); iterator.hasNext();) {
-                    String m = (String) iterator.next();
+                for (String m : attempts) {
                     Message.warn("  " + m);
                 }
             }
         }
     }
 
+    @Override
     public void reportFailure(Artifact art) {
         Message.warn("==== " + getName() + ": tried");
-        List attempts = (List) artattempts.get(art);
+        List<String> attempts = artattempts.get(art);
         if (attempts != null) {
-            for (ListIterator iter = attempts.listIterator(); iter.hasNext();) {
-                String m = (String) iter.next();
+            for (String m : attempts) {
                 Message.warn("  " + m);
             }
         }
@@ -857,6 +857,7 @@ public abstract class BasicResolver extends AbstractResolver {
         artattempts.clear();
     }
 
+    @Override
     public ArtifactDownloadReport download(final ArtifactOrigin origin, DownloadOptions options) {
         Checks.checkNotNull(origin, "origin");
         return getRepositoryCacheManager().download(origin.getArtifact(),
@@ -879,6 +880,7 @@ public abstract class BasicResolver extends AbstractResolver {
 
     protected abstract Resource getResource(String source) throws IOException;
 
+    @Override
     public boolean exists(Artifact artifact) {
         ResolvedResource artifactRef = getArtifactRef(artifact, null);
         if (artifactRef != null) {
@@ -887,6 +889,7 @@ public abstract class BasicResolver extends AbstractResolver {
         return false;
     }
 
+    @Override
     public ArtifactOrigin locate(Artifact artifact) {
         ArtifactOrigin origin = getRepositoryCacheManager().getSavedArtifactOrigin(
             toSystem(artifact));
@@ -912,54 +915,57 @@ public abstract class BasicResolver extends AbstractResolver {
         return -1;
     }
 
+    @Override
     public String toString() {
         return getName();
     }
 
-    public String[] listTokenValues(String token, Map otherTokenValues) {
-        Collection ret = findNames(otherTokenValues, token);
-        return (String[]) ret.toArray(new String[ret.size()]);
+    @Override
+    public String[] listTokenValues(String token, Map<String, String> otherTokenValues) {
+        Collection<String> ret = findNames(otherTokenValues, token);
+        return ret.toArray(new String[ret.size()]);
     }
 
+    @Override
     public OrganisationEntry[] listOrganisations() {
-        Collection names = findNames(Collections.EMPTY_MAP, IvyPatternHelper.ORGANISATION_KEY);
+        Collection<String> names = findNames(Collections.<String, String> emptyMap(),
+            IvyPatternHelper.ORGANISATION_KEY);
         OrganisationEntry[] ret = new OrganisationEntry[names.size()];
         int i = 0;
-        for (Iterator iter = names.iterator(); iter.hasNext(); i++) {
-            String org = (String) iter.next();
-            ret[i] = new OrganisationEntry(this, org);
+        for (String org : names) {
+            ret[i++] = new OrganisationEntry(this, org);
         }
         return ret;
     }
 
+    @Override
     public ModuleEntry[] listModules(OrganisationEntry org) {
-        Map tokenValues = new HashMap();
+        Map<String, String> tokenValues = new HashMap<String, String>();
         tokenValues.put(IvyPatternHelper.ORGANISATION_KEY, org.getOrganisation());
-        Collection names = findNames(tokenValues, IvyPatternHelper.MODULE_KEY);
+        Collection<String> names = findNames(tokenValues, IvyPatternHelper.MODULE_KEY);
         ModuleEntry[] ret = new ModuleEntry[names.size()];
         int i = 0;
-        for (Iterator iter = names.iterator(); iter.hasNext(); i++) {
-            String name = (String) iter.next();
-            ret[i] = new ModuleEntry(org, name);
+        for (String name : names) {
+            ret[i++] = new ModuleEntry(org, name);
         }
         return ret;
     }
 
+    @Override
     public RevisionEntry[] listRevisions(ModuleEntry mod) {
-        Map tokenValues = new HashMap();
+        Map<String, String> tokenValues = new HashMap<String, String>();
         tokenValues.put(IvyPatternHelper.ORGANISATION_KEY, mod.getOrganisation());
         tokenValues.put(IvyPatternHelper.MODULE_KEY, mod.getModule());
-        Collection names = findNames(tokenValues, IvyPatternHelper.REVISION_KEY);
+        Collection<String> names = findNames(tokenValues, IvyPatternHelper.REVISION_KEY);
         RevisionEntry[] ret = new RevisionEntry[names.size()];
         int i = 0;
-        for (Iterator iter = names.iterator(); iter.hasNext(); i++) {
-            String name = (String) iter.next();
-            ret[i] = new RevisionEntry(mod, name);
+        for (String name : names) {
+            ret[i++] = new RevisionEntry(mod, name);
         }
         return ret;
     }
 
-    protected abstract Collection findNames(Map tokenValues, String token);
+    protected abstract Collection<String> findNames(Map<String, String> tokenValues, String token);
 
     protected ResolvedResource findFirstArtifactRef(ModuleDescriptor md, DependencyDescriptor dd,
             ResolveData data) {
@@ -1118,14 +1124,14 @@ public abstract class BasicResolver extends AbstractResolver {
         // csDef is a comma separated list of checksum algorithms to use with this resolver
         // we parse and return it as a String[]
         String[] checksums = csDef.split(",");
-        List algos = new ArrayList();
+        List<String> algos = new ArrayList<String>();
         for (int i = 0; i < checksums.length; i++) {
             String cs = checksums[i].trim();
             if (!"".equals(cs) && !"none".equals(cs)) {
                 algos.add(cs);
             }
         }
-        return (String[]) algos.toArray(new String[algos.size()]);
+        return algos.toArray(new String[algos.size()]);
     }
 
     public void setChecksums(String checksums) {

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/BintrayResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/BintrayResolver.java b/src/java/org/apache/ivy/plugins/resolver/BintrayResolver.java
index c8d7b26..9466d18 100644
--- a/src/java/org/apache/ivy/plugins/resolver/BintrayResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/BintrayResolver.java
@@ -21,7 +21,6 @@ package org.apache.ivy.plugins.resolver;
  * BintrayResolver is a resolver which can be used to resolve dependencies found in the Bintray
  * artifacts repository.
  */
-@SuppressWarnings("ClassTooDeepInInheritanceTree")
 public class BintrayResolver extends IBiblioResolver {
 
     private static final String JCENTER = "https://jcenter.bintray.com/";
@@ -55,7 +54,6 @@ public class BintrayResolver extends IBiblioResolver {
         updateRoot();
     }
 
-    @SuppressWarnings("MethodWithMultipleReturnPoints")
     private void updateRoot() {
         if (isEmpty(subject) || isEmpty(repo)) {
             return;

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/CacheResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/CacheResolver.java b/src/java/org/apache/ivy/plugins/resolver/CacheResolver.java
index 27ac887..a08226d 100644
--- a/src/java/org/apache/ivy/plugins/resolver/CacheResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/CacheResolver.java
@@ -51,6 +51,7 @@ public class CacheResolver extends FileSystemResolver {
         setName("cache");
     }
 
+    @Override
     public ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data)
             throws ParseException {
         clearIvyAttempts();
@@ -101,6 +102,7 @@ public class CacheResolver extends FileSystemResolver {
         }
     }
 
+    @Override
     public DownloadReport download(Artifact[] artifacts, DownloadOptions options) {
         ensureConfigured();
         clearArtifactAttempts();
@@ -125,44 +127,51 @@ public class CacheResolver extends FileSystemResolver {
         return dr;
     }
 
+    @Override
     public boolean exists(Artifact artifact) {
         ensureConfigured();
         return super.exists(artifact);
     }
 
+    @Override
     public ArtifactOrigin locate(Artifact artifact) {
         ensureConfigured();
         return super.locate(artifact);
     }
 
+    @Override
     public void publish(Artifact artifact, File src, boolean overwrite) throws IOException {
         ensureConfigured();
         super.publish(artifact, src, overwrite);
     }
 
+    @Override
     public OrganisationEntry[] listOrganisations() {
         ensureConfigured();
         return super.listOrganisations();
     }
 
+    @Override
     public ModuleEntry[] listModules(OrganisationEntry org) {
         ensureConfigured();
         return super.listModules(org);
     }
 
+    @Override
     public RevisionEntry[] listRevisions(ModuleEntry module) {
         ensureConfigured();
         return super.listRevisions(module);
     }
 
+    @Override
     public void dumpSettings() {
         Message.verbose("\t" + getName() + " [cache]");
     }
 
     private void ensureConfigured() {
         if (getIvyPatterns().isEmpty()) {
-            setIvyPatterns(new ArrayList());
-            setArtifactPatterns(new ArrayList());
+            setIvyPatterns(new ArrayList<String>());
+            setArtifactPatterns(new ArrayList<String>());
             RepositoryCacheManager[] caches = getSettings().getRepositoryCacheManagers();
             for (int i = 0; i < caches.length; i++) {
                 if (caches[i] instanceof DefaultRepositoryCacheManager) {
@@ -179,6 +188,7 @@ public class CacheResolver extends FileSystemResolver {
         }
     }
 
+    @Override
     public String getTypeName() {
         return "cache";
     }


Mime
View raw message