ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject [2/6] ant-ivy git commit: use java 5 constructs
Date Sun, 04 Jan 2015 18:00:38 GMT
http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/ChainResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/ChainResolver.java b/src/java/org/apache/ivy/plugins/resolver/ChainResolver.java
index 63b6c1a..e4a2987 100644
--- a/src/java/org/apache/ivy/plugins/resolver/ChainResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/ChainResolver.java
@@ -69,7 +69,7 @@ public class ChainResolver extends AbstractResolver {
 
     private boolean returnFirst = false;
 
-    private List chain = new ArrayList();
+    private List<DependencyResolver> chain = new ArrayList<DependencyResolver>();
 
     private boolean dual;
 
@@ -81,7 +81,7 @@ public class ChainResolver extends AbstractResolver {
             throws ParseException {
         data = new ResolveData(data, doValidate(data));
 
-        List errors = new ArrayList();
+        List<Exception> errors = new ArrayList<Exception>();
 
         ResolvedModuleRevision resolved = data.getCurrentResolvedModuleRevision();
         ResolvedModuleRevision mr = resolved;
@@ -95,8 +95,7 @@ public class ChainResolver extends AbstractResolver {
             }
         }
 
-        for (Iterator iter = chain.iterator(); iter.hasNext();) {
-            DependencyResolver resolver = (DependencyResolver) iter.next();
+        for (DependencyResolver resolver : chain) {
             LatestStrategy oldLatest = setLatestIfRequired(resolver, getLatestStrategy());
             try {
                 ResolvedModuleRevision previouslyResolved = mr;
@@ -117,7 +116,7 @@ public class ChainResolver extends AbstractResolver {
         }
         if (mr == null && !errors.isEmpty()) {
             if (errors.size() == 1) {
-                Exception ex = (Exception) errors.get(0);
+                Exception ex = errors.get(0);
                 if (ex instanceof RuntimeException) {
                     throw (RuntimeException) ex;
                 } else if (ex instanceof ParseException) {
@@ -127,8 +126,7 @@ public class ChainResolver extends AbstractResolver {
                 }
             } else {
                 StringBuffer err = new StringBuffer();
-                for (Iterator iter = errors.iterator(); iter.hasNext();) {
-                    Exception ex = (Exception) iter.next();
+                for (Exception ex : errors) {
                     err.append("\t").append(StringUtils.getErrorMessage(ex)).append("\n");
                 }
                 err.setLength(err.length() - 1);
@@ -173,8 +171,7 @@ public class ChainResolver extends AbstractResolver {
     }
 
     public ResolvedResource findIvyFileRef(DependencyDescriptor dd, ResolveData data) {
-        for (Iterator iter = chain.iterator(); iter.hasNext();) {
-            DependencyResolver resolver = (DependencyResolver) iter.next();
+        for (DependencyResolver resolver : chain) {
             ResolvedResource result = resolver.findIvyFileRef(dd, data);
             if (result != null) {
                 return result;
@@ -184,39 +181,40 @@ public class ChainResolver extends AbstractResolver {
         return null;
     }
 
-    public Map[] listTokenValues(String[] tokens, Map criteria) {
-        Set result = new HashSet();
-        for (Iterator iter = chain.iterator(); iter.hasNext();) {
-            DependencyResolver resolver = (DependencyResolver) iter.next();
-            Map[] temp = resolver.listTokenValues(tokens, new HashMap(criteria));
+    @Override
+    public Map<String, String>[] listTokenValues(String[] tokens, Map<String, Object> criteria) {
+        Set<Map<String, String>> result = new HashSet<Map<String, String>>();
+        for (DependencyResolver resolver : chain) {
+            Map<String, String>[] temp = resolver.listTokenValues(tokens,
+                new HashMap<String, Object>(criteria));
             result.addAll(Arrays.asList(temp));
         }
 
-        return (Map[]) result.toArray(new Map[result.size()]);
+        return result.toArray(new Map[result.size()]);
     }
 
+    @Override
     public void reportFailure() {
-        for (Iterator iter = chain.iterator(); iter.hasNext();) {
-            DependencyResolver resolver = (DependencyResolver) iter.next();
+        for (DependencyResolver resolver : chain) {
             resolver.reportFailure();
         }
     }
 
+    @Override
     public void reportFailure(Artifact art) {
-        for (Iterator iter = chain.iterator(); iter.hasNext();) {
-            DependencyResolver resolver = (DependencyResolver) iter.next();
+        for (DependencyResolver resolver : chain) {
             resolver.reportFailure(art);
         }
     }
 
     public DownloadReport download(Artifact[] artifacts, DownloadOptions options) {
-        List artifactsToDownload = new ArrayList(Arrays.asList(artifacts));
+        List<Artifact> artifactsToDownload = new ArrayList<Artifact>(Arrays.asList(artifacts));
         DownloadReport report = new DownloadReport();
-        for (Iterator iter = chain.iterator(); iter.hasNext() && !artifactsToDownload.isEmpty();) {
-            DependencyResolver resolver = (DependencyResolver) iter.next();
+        for (Iterator<DependencyResolver> iter = chain.iterator(); iter.hasNext()
+                && !artifactsToDownload.isEmpty();) {
+            DependencyResolver resolver = iter.next();
             DownloadReport r = resolver.download(
-                (Artifact[]) artifactsToDownload.toArray(new Artifact[artifactsToDownload.size()]),
-                options);
+                artifactsToDownload.toArray(new Artifact[artifactsToDownload.size()]), options);
             ArtifactDownloadReport[] adr = r.getArtifactsReports();
             for (int i = 0; i < adr.length; i++) {
                 if (adr[i].getDownloadStatus() != DownloadStatus.FAILED) {
@@ -225,8 +223,7 @@ public class ChainResolver extends AbstractResolver {
                 }
             }
         }
-        for (Iterator iter = artifactsToDownload.iterator(); iter.hasNext();) {
-            Artifact art = (Artifact) iter.next();
+        for (Artifact art : artifactsToDownload) {
             ArtifactDownloadReport adr = new ArtifactDownloadReport(art);
             adr.setDownloadStatus(DownloadStatus.FAILED);
             report.addArtifactReport(adr);
@@ -234,7 +231,7 @@ public class ChainResolver extends AbstractResolver {
         return report;
     }
 
-    public List getResolvers() {
+    public List<DependencyResolver> getResolvers() {
         return chain;
     }
 
@@ -243,15 +240,18 @@ public class ChainResolver extends AbstractResolver {
         getFirstResolver().publish(artifact, src, overwrite);
     }
 
+    @Override
     public void abortPublishTransaction() throws IOException {
         getFirstResolver().abortPublishTransaction();
     }
 
+    @Override
     public void beginPublishTransaction(ModuleRevisionId module, boolean overwrite)
             throws IOException {
         getFirstResolver().beginPublishTransaction(module, overwrite);
     }
 
+    @Override
     public void commitPublishTransaction() throws IOException {
         getFirstResolver().commitPublishTransaction();
     }
@@ -260,7 +260,7 @@ public class ChainResolver extends AbstractResolver {
         if (chain.isEmpty()) {
             throw new IllegalStateException("invalid chain resolver with no sub resolver");
         }
-        return ((DependencyResolver) chain.get(0));
+        return chain.get(0);
     }
 
     public boolean isReturnFirst() {
@@ -271,19 +271,19 @@ public class ChainResolver extends AbstractResolver {
         this.returnFirst = returnFirst;
     }
 
+    @Override
     public void dumpSettings() {
         Message.verbose("\t" + getName() + " [chain] " + chain);
         Message.debug("\t\treturn first: " + isReturnFirst());
         Message.debug("\t\tdual: " + isDual());
-        for (Iterator iter = chain.iterator(); iter.hasNext();) {
-            DependencyResolver r = (DependencyResolver) iter.next();
-            Message.debug("\t\t-> " + r.getName());
+        for (DependencyResolver resolver : chain) {
+            Message.debug("\t\t-> " + resolver.getName());
         }
     }
 
+    @Override
     public boolean exists(Artifact artifact) {
-        for (Iterator iter = chain.iterator(); iter.hasNext();) {
-            DependencyResolver resolver = (DependencyResolver) iter.next();
+        for (DependencyResolver resolver : chain) {
             if (resolver.exists(artifact)) {
                 return true;
             }
@@ -291,9 +291,9 @@ public class ChainResolver extends AbstractResolver {
         return false;
     }
 
+    @Override
     public ArtifactOrigin locate(Artifact artifact) {
-        for (Iterator iter = chain.iterator(); iter.hasNext();) {
-            DependencyResolver resolver = (DependencyResolver) iter.next();
+        for (DependencyResolver resolver : chain) {
             ArtifactOrigin origin = resolver.locate(artifact);
             if (!ArtifactOrigin.isUnknown(origin)) {
                 return origin;
@@ -302,9 +302,9 @@ public class ChainResolver extends AbstractResolver {
         return ArtifactOrigin.unkwnown(artifact);
     }
 
+    @Override
     public ArtifactDownloadReport download(ArtifactOrigin artifact, DownloadOptions options) {
-        for (Iterator iter = chain.iterator(); iter.hasNext();) {
-            DependencyResolver resolver = (DependencyResolver) iter.next();
+        for (DependencyResolver resolver : chain) {
             ArtifactDownloadReport adr = resolver.download(artifact, options);
             if (adr.getDownloadStatus() != DownloadStatus.FAILED) {
                 return adr;

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/DependencyResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/DependencyResolver.java b/src/java/org/apache/ivy/plugins/resolver/DependencyResolver.java
index c1ee376..5d4c76c 100644
--- a/src/java/org/apache/ivy/plugins/resolver/DependencyResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/DependencyResolver.java
@@ -169,7 +169,7 @@ public interface DependencyResolver {
      * with the Namespace returned by {@link #getNamespace()}.
      * </p>
      */
-    String[] listTokenValues(String token, Map otherTokenValues);
+    String[] listTokenValues(String token, Map<String, String> otherTokenValues);
 
     /**
      * Same as {@link #listTokenValues(String, Map)} but more generic.
@@ -178,9 +178,9 @@ public interface DependencyResolver {
      *            the tokens of the query
      * @param criteria
      *            the token which have values
-     * @return the list of token values (Map<Strin, String>[]), must not be <code>null</code>
+     * @return the list of token values, must not be <code>null</code>
      */
-    Map[] listTokenValues(String[] tokens, Map criteria);
+    Map<String, String>[] listTokenValues(String[] tokens, Map<String, Object> criteria);
 
     OrganisationEntry[] listOrganisations();
 

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/DualResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/DualResolver.java b/src/java/org/apache/ivy/plugins/resolver/DualResolver.java
index e23b9ff..76b7e54 100644
--- a/src/java/org/apache/ivy/plugins/resolver/DualResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/DualResolver.java
@@ -137,22 +137,26 @@ public class DualResolver extends AbstractResolver {
         }
     }
 
+    @Override
     public void abortPublishTransaction() throws IOException {
         ivyResolver.abortPublishTransaction();
         artifactResolver.abortPublishTransaction();
     }
 
+    @Override
     public void beginPublishTransaction(ModuleRevisionId module, boolean overwrite)
             throws IOException {
         ivyResolver.beginPublishTransaction(module, overwrite);
         artifactResolver.beginPublishTransaction(module, overwrite);
     }
 
+    @Override
     public void commitPublishTransaction() throws IOException {
         ivyResolver.commitPublishTransaction();
         artifactResolver.commitPublishTransaction();
     }
 
+    @Override
     public void dumpSettings() {
         if (ivyResolver == null || artifactResolver == null) {
             throw new IllegalStateException(
@@ -162,6 +166,7 @@ public class DualResolver extends AbstractResolver {
                 + artifactResolver.getName() + "]");
     }
 
+    @Override
     public boolean exists(Artifact artifact) {
         if (artifact.isMetadata()) {
             return ivyResolver.exists(artifact);
@@ -170,6 +175,7 @@ public class DualResolver extends AbstractResolver {
         }
     }
 
+    @Override
     public ArtifactOrigin locate(Artifact artifact) {
         if (artifact.isMetadata()) {
             return ivyResolver.locate(artifact);
@@ -178,6 +184,7 @@ public class DualResolver extends AbstractResolver {
         }
     }
 
+    @Override
     public ArtifactDownloadReport download(ArtifactOrigin artifact, DownloadOptions options) {
         if (artifact.getArtifact().isMetadata()) {
             return ivyResolver.download(artifact, options);

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java b/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java
index a7cee6b..fe0d0f2 100644
--- a/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java
@@ -67,7 +67,7 @@ public class FileSystemResolver extends RepositoryResolver {
      * Map between actual patterns and patterns used during the transaction to put files in a
      * temporary directory
      */
-    private Map/* <String,String> */fullTransactionPatterns = new HashMap();
+    private Map<String, String> fullTransactionPatterns = new HashMap<String, String>();
 
     /**
      * Location where files are published during the transaction
@@ -83,6 +83,7 @@ public class FileSystemResolver extends RepositoryResolver {
         setRepository(new FileRepository());
     }
 
+    @Override
     public String getTypeName() {
         return "file";
     }
@@ -99,10 +100,11 @@ public class FileSystemResolver extends RepositoryResolver {
         return (FileRepository) getRepository();
     }
 
+    @Override
     protected String getDestination(String pattern, Artifact artifact, ModuleRevisionId mrid) {
         if (supportTransaction() && isTransactionStarted()) {
 
-            String destPattern = (String) fullTransactionPatterns.get(pattern);
+            String destPattern = fullTransactionPatterns.get(pattern);
             if (destPattern == null) {
                 throw new IllegalArgumentException(
                         "unsupported pattern for publish destination pattern: " + pattern
@@ -118,6 +120,7 @@ public class FileSystemResolver extends RepositoryResolver {
         return transactionTempDir != null;
     }
 
+    @Override
     public void abortPublishTransaction() throws IOException {
         if (supportTransaction()) {
             if (isTransactionStarted()) {
@@ -133,6 +136,7 @@ public class FileSystemResolver extends RepositoryResolver {
         }
     }
 
+    @Override
     public void commitPublishTransaction() throws IOException {
         if (supportTransaction()) {
             if (!isTransactionStarted()) {
@@ -169,6 +173,7 @@ public class FileSystemResolver extends RepositoryResolver {
         }
     }
 
+    @Override
     public void beginPublishTransaction(ModuleRevisionId module, boolean overwrite)
             throws IOException {
         if (supportTransaction()) {
@@ -194,11 +199,12 @@ public class FileSystemResolver extends RepositoryResolver {
         }
     }
 
-    protected Collection filterNames(Collection values) {
+    @Override
+    protected Collection<String> filterNames(Collection<String> values) {
         if (supportTransaction()) {
             values = super.filterNames(values);
-            for (Iterator iterator = values.iterator(); iterator.hasNext();) {
-                String v = (String) iterator.next();
+            for (Iterator<String> iterator = values.iterator(); iterator.hasNext();) {
+                String v = iterator.next();
                 if (v.endsWith(TRANSACTION_DESTINATION_SUFFIX)) {
                     iterator.remove();
                 }
@@ -225,11 +231,11 @@ public class FileSystemResolver extends RepositoryResolver {
     private void checkSupportTransaction() {
         if (supportTransaction == null) {
             supportTransaction = Boolean.FALSE;
-            List ivyPatterns = getIvyPatterns();
-            List artifactPatterns = getArtifactPatterns();
+            List<String> ivyPatterns = getIvyPatterns();
+            List<String> artifactPatterns = getArtifactPatterns();
 
             if (ivyPatterns.size() > 0) {
-                String pattern = (String) ivyPatterns.get(0);
+                String pattern = ivyPatterns.get(0);
                 Matcher m = TRANSACTION_PATTERN.matcher(pattern);
                 if (!m.matches()) {
                     unsupportedTransaction("ivy pattern does not use revision as a directory");
@@ -241,7 +247,7 @@ public class FileSystemResolver extends RepositoryResolver {
                 }
             }
             if (artifactPatterns.size() > 0) {
-                String pattern = (String) artifactPatterns.get(0);
+                String pattern = artifactPatterns.get(0);
                 Matcher m = TRANSACTION_PATTERN.matcher(pattern);
                 if (!m.matches()) {
                     unsupportedTransaction("artifact pattern does not use revision as a directory");
@@ -299,23 +305,27 @@ public class FileSystemResolver extends RepositoryResolver {
         this.transactional = transactional;
     }
 
+    @Override
     public void addConfiguredIvy(IvyPattern p) {
         File file = Checks.checkAbsolute(p.getPattern(), "ivy pattern");
         p.setPattern(file.getAbsolutePath());
         super.addConfiguredIvy(p);
     }
 
+    @Override
     public void addIvyPattern(String pattern) {
         File file = Checks.checkAbsolute(pattern, "ivy pattern");
         super.addIvyPattern(file.getAbsolutePath());
     }
 
+    @Override
     public void addConfiguredArtifact(IvyPattern p) {
         File file = Checks.checkAbsolute(p.getPattern(), "artifact pattern");
         p.setPattern(file.getAbsolutePath());
         super.addConfiguredArtifact(p);
     }
 
+    @Override
     public void addArtifactPattern(String pattern) {
         File file = Checks.checkAbsolute(pattern, "artifact pattern");
         super.addArtifactPattern(file.getAbsolutePath());

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java b/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java
index 8072e3f..7fa4780 100644
--- a/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java
@@ -25,7 +25,6 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -87,6 +86,7 @@ public class IBiblioResolver extends URLResolver {
         setChangingPattern(".*-SNAPSHOT");
     }
 
+    @Override
     public ResolvedResource findIvyFileRef(DependencyDescriptor dd, ResolveData data) {
         if (isM2compatible() && isUsepoms()) {
             ModuleRevisionId mrid = dd.getDependencyRevisionId();
@@ -109,6 +109,7 @@ public class IBiblioResolver extends URLResolver {
         }
     }
 
+    @Override
     public ResolvedResource findArtifactRef(Artifact artifact, Date date) {
         ensureConfigured(getSettings());
         ModuleRevisionId mrid = artifact.getModuleRevisionId();
@@ -172,6 +173,7 @@ public class IBiblioResolver extends URLResolver {
                     final StringBuffer timestamp = new StringBuffer();
                     final StringBuffer buildNumer = new StringBuffer();
                     XMLHelper.parse(metadataStream, null, new ContextualSAXHandler() {
+                        @Override
                         public void endElement(String uri, String localName, String qName)
                                 throws SAXException {
                             if ("metadata/versioning/snapshot/timestamp".equals(getContext())) {
@@ -213,6 +215,7 @@ public class IBiblioResolver extends URLResolver {
         return null;
     }
 
+    @Override
     public void setM2compatible(boolean m2compatible) {
         super.setM2compatible(m2compatible);
         if (m2compatible) {
@@ -250,6 +253,7 @@ public class IBiblioResolver extends URLResolver {
         }
     }
 
+    @Override
     protected String getModuleDescriptorExtension() {
         return "pom";
     }
@@ -301,7 +305,7 @@ public class IBiblioResolver extends URLResolver {
         if (isM2compatible() && isUsepoms()) {
             setIvyPatterns(Collections.singletonList(getWholePattern()));
         } else {
-            setIvyPatterns(Collections.EMPTY_LIST);
+            setIvyPatterns(Collections.<String> emptyList());
         }
         setArtifactPatterns(Collections.singletonList(getWholePattern()));
     }
@@ -311,7 +315,8 @@ public class IBiblioResolver extends URLResolver {
     }
 
     // we do not allow to list organisations on ibiblio, nor modules in ibiblio 1
-    public String[] listTokenValues(String token, Map otherTokenValues) {
+    @Override
+    public String[] listTokenValues(String token, Map<String, String> otherTokenValues) {
         if (IvyPatternHelper.ORGANISATION_KEY.equals(token)) {
             return new String[0];
         }
@@ -322,6 +327,7 @@ public class IBiblioResolver extends URLResolver {
         return super.listTokenValues(token, otherTokenValues);
     }
 
+    @Override
     protected String[] listTokenValues(String pattern, String token) {
         if (IvyPatternHelper.ORGANISATION_KEY.equals(token)) {
             return new String[0];
@@ -350,9 +356,9 @@ public class IBiblioResolver extends URLResolver {
                 String metadataLocation = pattern.substring(0,
                     pattern.lastIndexOf(partiallyResolvedM2PerModulePattern))
                         + "maven-metadata.xml";
-                List revs = listRevisionsWithMavenMetadata(getRepository(), metadataLocation);
+                List<?> revs = listRevisionsWithMavenMetadata(getRepository(), metadataLocation);
                 if (revs != null) {
-                    return (String[]) revs.toArray(new String[revs.size()]);
+                    return revs.toArray(new String[revs.size()]);
                 }
             } else {
                 /*
@@ -368,10 +374,12 @@ public class IBiblioResolver extends URLResolver {
         return super.listTokenValues(pattern, token);
     }
 
+    @Override
     public OrganisationEntry[] listOrganisations() {
         return new OrganisationEntry[0];
     }
 
+    @Override
     public ModuleEntry[] listModules(OrganisationEntry org) {
         if (isM2compatible()) {
             ensureConfigured(getSettings());
@@ -380,21 +388,22 @@ public class IBiblioResolver extends URLResolver {
         return new ModuleEntry[0];
     }
 
+    @Override
     public RevisionEntry[] listRevisions(ModuleEntry mod) {
         ensureConfigured(getSettings());
         return super.listRevisions(mod);
     }
 
+    @Override
     protected ResolvedResource[] listResources(Repository repository, ModuleRevisionId mrid,
             String pattern, Artifact artifact) {
         if (shouldUseMavenMetadata(pattern)) {
-            List revs = listRevisionsWithMavenMetadata(repository, mrid.getModuleId()
+            List<String> revs = listRevisionsWithMavenMetadata(repository, mrid.getModuleId()
                     .getAttributes());
             if (revs != null) {
                 Message.debug("\tfound revs: " + revs);
-                List rres = new ArrayList();
-                for (Iterator iter = revs.iterator(); iter.hasNext();) {
-                    String rev = (String) iter.next();
+                List<ResolvedResource> rres = new ArrayList<ResolvedResource>();
+                for (String rev : revs) {
                     ModuleRevisionId historicalMrid = ModuleRevisionId.newInstance(mrid, rev);
 
                     String patternForRev = pattern;
@@ -421,7 +430,7 @@ public class IBiblioResolver extends URLResolver {
                                     + rres, e);
                     }
                 }
-                return (ResolvedResource[]) rres.toArray(new ResolvedResource[rres.size()]);
+                return rres.toArray(new ResolvedResource[rres.size()]);
             } else {
                 // maven metadata not available or something went wrong,
                 // use default listing capability
@@ -432,22 +441,25 @@ public class IBiblioResolver extends URLResolver {
         }
     }
 
-    private List listRevisionsWithMavenMetadata(Repository repository, Map tokenValues) {
+    private List<String> listRevisionsWithMavenMetadata(Repository repository,
+            Map<String, String> tokenValues) {
         String metadataLocation = IvyPatternHelper.substituteTokens(root
                 + "[organisation]/[module]/maven-metadata.xml", tokenValues);
         return listRevisionsWithMavenMetadata(repository, metadataLocation);
     }
 
-    private List listRevisionsWithMavenMetadata(Repository repository, String metadataLocation) {
-        List revs = null;
+    private List<String> listRevisionsWithMavenMetadata(Repository repository,
+            String metadataLocation) {
+        List<String> revs = null;
         InputStream metadataStream = null;
         try {
             Resource metadata = repository.getResource(metadataLocation);
             if (metadata.exists()) {
                 Message.verbose("\tlisting revisions from maven-metadata: " + metadata);
-                final List metadataRevs = new ArrayList();
+                final List<String> metadataRevs = new ArrayList<String>();
                 metadataStream = metadata.openStream();
                 XMLHelper.parse(metadataStream, null, new ContextualSAXHandler() {
+                    @Override
                     public void endElement(String uri, String localName, String qName)
                             throws SAXException {
                         if ("metadata/versioning/versions/version".equals(getContext())) {
@@ -478,10 +490,12 @@ public class IBiblioResolver extends URLResolver {
         return revs;
     }
 
-    protected void findTokenValues(Collection names, List patterns, Map tokenValues, String token) {
+    @Override
+    protected void findTokenValues(Collection<String> names, List<String> patterns,
+            Map<String, String> tokenValues, String token) {
         if (IvyPatternHelper.REVISION_KEY.equals(token)) {
             if (shouldUseMavenMetadata(getWholePattern())) {
-                List revs = listRevisionsWithMavenMetadata(getRepository(), tokenValues);
+                List<String> revs = listRevisionsWithMavenMetadata(getRepository(), tokenValues);
                 if (revs != null) {
                     names.addAll(filterNames(revs));
                     return;
@@ -495,33 +509,39 @@ public class IBiblioResolver extends URLResolver {
         return isUseMavenMetadata() && isM2compatible() && pattern.endsWith(M2_PATTERN);
     }
 
+    @Override
     public String getTypeName() {
         return "ibiblio";
     }
 
     // override some methods to ensure configuration
+    @Override
     public ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data)
             throws ParseException {
         ensureConfigured(data.getSettings());
         return super.getDependency(dd, data);
     }
 
+    @Override
     public DownloadReport download(Artifact[] artifacts, DownloadOptions options) {
         ensureConfigured(getSettings());
         return super.download(artifacts, options);
     }
 
+    @Override
     public boolean exists(Artifact artifact) {
         ensureConfigured(getSettings());
         return super.exists(artifact);
     }
 
+    @Override
     public ArtifactOrigin locate(Artifact artifact) {
         ensureConfigured(getSettings());
         return super.locate(artifact);
     }
 
-    public List getArtifactPatterns() {
+    @Override
+    public List<String> getArtifactPatterns() {
         ensureConfigured(getSettings());
         return super.getArtifactPatterns();
     }
@@ -543,6 +563,7 @@ public class IBiblioResolver extends URLResolver {
         this.useMavenMetadata = useMavenMetadata;
     }
 
+    @Override
     public void dumpSettings() {
         ensureConfigured(getSettings());
         super.dumpSettings();

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/IvyRepResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/IvyRepResolver.java b/src/java/org/apache/ivy/plugins/resolver/IvyRepResolver.java
index 12e1e2b..7e08bbc 100644
--- a/src/java/org/apache/ivy/plugins/resolver/IvyRepResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/IvyRepResolver.java
@@ -26,7 +26,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.Map;
 
@@ -168,6 +167,7 @@ public class IvyRepResolver extends URLResolver {
         updateWholeIvyPattern();
     }
 
+    @Override
     public void setM2compatible(boolean m2compatible) {
         if (m2compatible) {
             throw new IllegalArgumentException(
@@ -219,12 +219,14 @@ public class IvyRepResolver extends URLResolver {
         updateWholeArtPattern();
     }
 
+    @Override
     public OrganisationEntry[] listOrganisations() {
         ensureIvyConfigured(getSettings());
         try {
             URL content = new URL(ivyroot + "content.xml");
-            final List ret = new ArrayList();
+            final List<OrganisationEntry> ret = new ArrayList<OrganisationEntry>();
             XMLHelper.parse(content, null, new DefaultHandler() {
+                @Override
                 public void startElement(String uri, String localName, String qName,
                         org.xml.sax.Attributes attributes) throws SAXException {
                     if ("organisation".equals(qName)) {
@@ -235,7 +237,7 @@ public class IvyRepResolver extends URLResolver {
                     }
                 }
             });
-            return (OrganisationEntry[]) ret.toArray(new OrganisationEntry[ret.size()]);
+            return ret.toArray(new OrganisationEntry[ret.size()]);
         } catch (MalformedURLException e) {
             // ???
         } catch (Exception e) {
@@ -246,63 +248,72 @@ public class IvyRepResolver extends URLResolver {
 
     // overwrite parent to use only ivy patterns (and not artifact ones, cause ibiblio is too slow
     // to answer)
+    @Override
     public ModuleEntry[] listModules(OrganisationEntry org) {
         ensureIvyConfigured(getSettings());
-        Map tokenValues = new HashMap();
+        Map<String, String> tokenValues = new HashMap<String, String>();
         tokenValues.put(IvyPatternHelper.ORGANISATION_KEY, org.getOrganisation());
-        Collection names = findIvyNames(tokenValues, IvyPatternHelper.MODULE_KEY);
+        Collection<String> names = findIvyNames(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();
+        for (String name : names) {
             ret[i] = new ModuleEntry(org, name);
         }
         return ret;
     }
 
+    @Override
     public RevisionEntry[] listRevisions(ModuleEntry mod) {
         ensureIvyConfigured(getSettings());
         ensureArtifactConfigured(getSettings());
         return super.listRevisions(mod);
     }
 
+    @Override
     public String getTypeName() {
         return "ivyrep";
     }
 
     // override some methods to ensure configuration
+    @Override
     public ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data)
             throws ParseException {
         ensureIvyConfigured(data.getSettings());
         return super.getDependency(dd, data);
     }
 
+    @Override
     public ResolvedResource findArtifactRef(Artifact artifact, Date date) {
         ensureArtifactConfigured(getSettings());
         return super.findArtifactRef(artifact, date);
     }
 
+    @Override
     public DownloadReport download(Artifact[] artifacts, DownloadOptions options) {
         ensureArtifactConfigured(getSettings());
         return super.download(artifacts, options);
     }
 
+    @Override
     public boolean exists(Artifact artifact) {
         ensureArtifactConfigured(getSettings());
         return super.exists(artifact);
     }
 
+    @Override
     public ArtifactOrigin locate(Artifact artifact) {
         ensureArtifactConfigured(getSettings());
         return super.locate(artifact);
     }
 
-    public List getIvyPatterns() {
+    @Override
+    public List<String> getIvyPatterns() {
         ensureIvyConfigured(getSettings());
         return super.getIvyPatterns();
     }
 
-    public List getArtifactPatterns() {
+    @Override
+    public List<String> getArtifactPatterns() {
         ensureArtifactConfigured(getSettings());
         return super.getArtifactPatterns();
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/JarResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/JarResolver.java b/src/java/org/apache/ivy/plugins/resolver/JarResolver.java
index f305cf6..623a5f5 100644
--- a/src/java/org/apache/ivy/plugins/resolver/JarResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/JarResolver.java
@@ -40,6 +40,7 @@ public class JarResolver extends RepositoryResolver {
         setRepository(new JarRepository());
     }
 
+    @Override
     public String getTypeName() {
         return "jar";
     }
@@ -72,6 +73,7 @@ public class JarResolver extends RepositoryResolver {
         getJarRepository().setJarFile(jar);
     }
 
+    @Override
     public void setSettings(ResolverSettings settings) {
         super.setSettings(settings);
         // let's resolve the url

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/MirroredURLResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/MirroredURLResolver.java b/src/java/org/apache/ivy/plugins/resolver/MirroredURLResolver.java
index 09777ad..2d17308 100644
--- a/src/java/org/apache/ivy/plugins/resolver/MirroredURLResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/MirroredURLResolver.java
@@ -25,12 +25,12 @@ import java.io.InputStreamReader;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.ivy.core.cache.CacheResourceOptions;
 import org.apache.ivy.core.report.ArtifactDownloadReport;
 import org.apache.ivy.osgi.repo.RelativeURLRepository;
+import org.apache.ivy.plugins.repository.Repository;
 import org.apache.ivy.plugins.repository.url.ChainedRepository;
 import org.apache.ivy.plugins.repository.url.URLRepository;
 import org.apache.ivy.plugins.repository.url.URLResource;
@@ -50,17 +50,15 @@ public class MirroredURLResolver extends RepositoryResolver {
 
     private void setupMirrors() {
         File mirrorListFile = downloadMirrorList();
-        List mirrorBaseUrls;
+        List<String> mirrorBaseUrls;
         try {
             mirrorBaseUrls = readMirrorList(mirrorListFile);
         } catch (IOException e) {
             throw new IllegalStateException("The mirror list could not be read from "
                     + mirrorListUrl + " (" + e.getMessage() + ")");
         }
-        List/* <Repository> */repositories = new ArrayList();
-        Iterator it = mirrorBaseUrls.iterator();
-        while (it.hasNext()) {
-            String baseUrl = (String) it.next();
+        List<Repository> repositories = new ArrayList<Repository>();
+        for (String baseUrl : mirrorBaseUrls) {
             URL url = null;
             try {
                 url = new URL(baseUrl);
@@ -88,10 +86,10 @@ public class MirroredURLResolver extends RepositoryResolver {
         return report.getLocalFile();
     }
 
-    private List/* <String> */readMirrorList(File mirrorListFile) throws IOException {
+    private List<String> readMirrorList(File mirrorListFile) throws IOException {
         BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(
                 mirrorListFile)));
-        List/* <String> */list = new ArrayList();
+        List<String> list = new ArrayList<String>();
         try {
             String line = in.readLine();
             while (line != null) {
@@ -104,10 +102,12 @@ public class MirroredURLResolver extends RepositoryResolver {
         return list;
     }
 
+    @Override
     public String getTypeName() {
         return "mirroredurl";
     }
 
+    @Override
     public void validate() {
         super.validate();
         setupMirrors();

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java b/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java
index 59dbf67..32c42ab 100644
--- a/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java
@@ -25,7 +25,6 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Date;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -73,6 +72,7 @@ public class RepositoryResolver extends AbstractPatternsBasedResolver {
         this.repository = repository;
     }
 
+    @Override
     public void setName(String name) {
         super.setName(name);
         if (repository instanceof AbstractRepository) {
@@ -84,6 +84,7 @@ public class RepositoryResolver extends AbstractPatternsBasedResolver {
         this.signerName = signerName;
     }
 
+    @Override
     protected ResolvedResource findResourceUsingPattern(ModuleRevisionId mrid, String pattern,
             Artifact artifact, ResourceMDParser rmdparser, Date date) {
         String name = getName();
@@ -160,6 +161,7 @@ public class RepositoryResolver extends AbstractPatternsBasedResolver {
         }
     }
 
+    @Override
     protected Resource getResource(String source) throws IOException {
         return repository.getResource(source);
     }
@@ -184,6 +186,7 @@ public class RepositoryResolver extends AbstractPatternsBasedResolver {
         return ResolverHelper.findAll(repository, mrid, pattern, artifact);
     }
 
+    @Override
     protected long get(Resource resource, File dest) throws IOException {
         Message.verbose("\t" + getName() + ": downloading " + resource.getName());
         Message.debug("\t\tto " + dest);
@@ -197,9 +200,9 @@ public class RepositoryResolver extends AbstractPatternsBasedResolver {
     public void publish(Artifact artifact, File src, boolean overwrite) throws IOException {
         String destPattern;
         if ("ivy".equals(artifact.getType()) && !getIvyPatterns().isEmpty()) {
-            destPattern = (String) getIvyPatterns().get(0);
+            destPattern = getIvyPatterns().get(0);
         } else if (!getArtifactPatterns().isEmpty()) {
-            destPattern = (String) getArtifactPatterns().get(0);
+            destPattern = getArtifactPatterns().get(0);
         } else {
             throw new IllegalStateException("impossible to publish " + artifact + " using " + this
                     + ": no artifact pattern defined");
@@ -276,6 +279,7 @@ public class RepositoryResolver extends AbstractPatternsBasedResolver {
         }
     }
 
+    @Override
     public DownloadReport download(Artifact[] artifacts, DownloadOptions options) {
         EventManager eventManager = getEventManager();
         try {
@@ -290,23 +294,26 @@ public class RepositoryResolver extends AbstractPatternsBasedResolver {
         }
     }
 
-    protected void findTokenValues(Collection names, List patterns, Map tokenValues, String token) {
-        for (Iterator iter = patterns.iterator(); iter.hasNext();) {
-            String pattern = (String) iter.next();
+    @Override
+    protected void findTokenValues(Collection<String> names, List<String> patterns,
+            Map<String, String> tokenValues, String token) {
+        for (String pattern : patterns) {
             String partiallyResolvedPattern = IvyPatternHelper.substituteTokens(pattern,
                 tokenValues);
             String[] values = ResolverHelper.listTokenValues(repository, partiallyResolvedPattern,
                 token);
             if (values != null) {
-                names.addAll(filterNames(new ArrayList(Arrays.asList(values))));
+                names.addAll(filterNames(new ArrayList<String>(Arrays.asList(values))));
             }
         }
     }
 
+    @Override
     protected String[] listTokenValues(String pattern, String token) {
         return ResolverHelper.listTokenValues(repository, pattern, token);
     }
 
+    @Override
     protected boolean exist(String path) {
         try {
             Resource resource = repository.getResource(path);
@@ -317,15 +324,18 @@ public class RepositoryResolver extends AbstractPatternsBasedResolver {
         }
     }
 
+    @Override
     public String getTypeName() {
         return "repository";
     }
 
+    @Override
     public void dumpSettings() {
         super.dumpSettings();
         Message.debug("\t\trepository: " + getRepository());
     }
 
+    @Override
     public void setSettings(ResolverSettings settings) {
         super.setSettings(settings);
         if (settings != null) {

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/ResolverSettings.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/ResolverSettings.java b/src/java/org/apache/ivy/plugins/resolver/ResolverSettings.java
index 5401801..27e897b 100644
--- a/src/java/org/apache/ivy/plugins/resolver/ResolverSettings.java
+++ b/src/java/org/apache/ivy/plugins/resolver/ResolverSettings.java
@@ -51,7 +51,7 @@ public interface ResolverSettings extends ParserSettings {
 
     String getResolveMode(ModuleId moduleId);
 
-    void filterIgnore(Collection names);
+    void filterIgnore(Collection<String> names);
 
     SignatureGenerator getSignatureGenerator(String name);
 

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/SFTPResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/SFTPResolver.java b/src/java/org/apache/ivy/plugins/resolver/SFTPResolver.java
index 190d150..096df8d 100644
--- a/src/java/org/apache/ivy/plugins/resolver/SFTPResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/SFTPResolver.java
@@ -31,6 +31,7 @@ public class SFTPResolver extends AbstractSshBasedResolver {
         setRepository(new SFTPRepository());
     }
 
+    @Override
     public String getTypeName() {
         return "sftp";
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/SshResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/SshResolver.java b/src/java/org/apache/ivy/plugins/resolver/SshResolver.java
index 8a4f859..f1114de 100644
--- a/src/java/org/apache/ivy/plugins/resolver/SshResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/SshResolver.java
@@ -83,6 +83,7 @@ public class SshResolver extends AbstractSshBasedResolver {
         ((SshRepository) getRepository()).setExistCommand(cmd);
     }
 
+    @Override
     public String getTypeName() {
         return "ssh";
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/URLResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/URLResolver.java b/src/java/org/apache/ivy/plugins/resolver/URLResolver.java
index 7afacdc..d34ad33 100644
--- a/src/java/org/apache/ivy/plugins/resolver/URLResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/URLResolver.java
@@ -28,6 +28,7 @@ public class URLResolver extends RepositoryResolver {
         setRepository(new URLRepository());
     }
 
+    @Override
     public String getTypeName() {
         return "url";
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/VfsResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/VfsResolver.java b/src/java/org/apache/ivy/plugins/resolver/VfsResolver.java
index a897a36..afae993 100644
--- a/src/java/org/apache/ivy/plugins/resolver/VfsResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/VfsResolver.java
@@ -34,10 +34,12 @@ public class VfsResolver extends RepositoryResolver {
         setRepository(new VfsRepository());
     }
 
+    @Override
     public String getTypeName() {
         return "vfs";
     }
 
+    @Override
     public String hidePassword(String name) {
         return prepareForDisplay(name);
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/VsftpResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/VsftpResolver.java b/src/java/org/apache/ivy/plugins/resolver/VsftpResolver.java
index e2c4e24..07a81da 100644
--- a/src/java/org/apache/ivy/plugins/resolver/VsftpResolver.java
+++ b/src/java/org/apache/ivy/plugins/resolver/VsftpResolver.java
@@ -28,6 +28,7 @@ public class VsftpResolver extends RepositoryResolver {
         setRepository(new VsftpRepository());
     }
 
+    @Override
     public String getTypeName() {
         return "vsftp";
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/util/ApacheHttpURLLister.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/util/ApacheHttpURLLister.java b/src/java/org/apache/ivy/plugins/resolver/util/ApacheHttpURLLister.java
index 90d68b0..374d942 100644
--- a/src/java/org/apache/ivy/plugins/resolver/util/ApacheHttpURLLister.java
+++ b/src/java/org/apache/ivy/plugins/resolver/util/ApacheHttpURLLister.java
@@ -30,10 +30,11 @@ public class ApacheHttpURLLister implements URLLister {
         return pattern.startsWith("http");
     }
 
-    public List listAll(URL url) throws IOException {
+    public List<URL> listAll(URL url) throws IOException {
         return lister.listAll(url);
     }
 
+    @Override
     public String toString() {
         return "apache http lister";
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/util/FileURLLister.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/util/FileURLLister.java b/src/java/org/apache/ivy/plugins/resolver/util/FileURLLister.java
index 26cd04d..f5c680d 100644
--- a/src/java/org/apache/ivy/plugins/resolver/util/FileURLLister.java
+++ b/src/java/org/apache/ivy/plugins/resolver/util/FileURLLister.java
@@ -41,7 +41,7 @@ public class FileURLLister implements URLLister {
         return pattern.startsWith("file");
     }
 
-    public List listAll(URL url) throws IOException {
+    public List<URL> listAll(URL url) throws IOException {
         String path;
         try {
             path = new File(new URI(url.toExternalForm())).getPath();
@@ -52,17 +52,18 @@ public class FileURLLister implements URLLister {
         File file = basedir == null ? new File(path) : new File(basedir, path);
         if (file.exists() && file.isDirectory()) {
             String[] files = file.list();
-            List ret = new ArrayList(files.length);
+            List<URL> ret = new ArrayList<URL>(files.length);
             URL context = url.getPath().endsWith("/") ? url : new URL(url.toExternalForm() + "/");
             for (int i = 0; i < files.length; i++) {
                 ret.add(new URL(context, files[i]));
             }
             return ret;
         } else {
-            return Collections.EMPTY_LIST;
+            return Collections.emptyList();
         }
     }
 
+    @Override
     public String toString() {
         return "file lister";
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/util/ResolvedResource.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/util/ResolvedResource.java b/src/java/org/apache/ivy/plugins/resolver/util/ResolvedResource.java
index e655112..52e5c2f 100644
--- a/src/java/org/apache/ivy/plugins/resolver/util/ResolvedResource.java
+++ b/src/java/org/apache/ivy/plugins/resolver/util/ResolvedResource.java
@@ -38,6 +38,7 @@ public class ResolvedResource implements ArtifactInfo {
         return res;
     }
 
+    @Override
     public String toString() {
         return res + " (" + rev + ")";
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/util/ResolverHelper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/util/ResolverHelper.java b/src/java/org/apache/ivy/plugins/resolver/util/ResolverHelper.java
index 91411a9..d2575ed 100644
--- a/src/java/org/apache/ivy/plugins/resolver/util/ResolverHelper.java
+++ b/src/java/org/apache/ivy/plugins/resolver/util/ResolverHelper.java
@@ -22,7 +22,6 @@ import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Iterator;
 import java.util.List;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -83,7 +82,7 @@ public final class ResolverHelper {
                         }
                     }
                     Message.debug("\t\t" + ret.size() + " matched " + pattern);
-                    return (String[]) ret.toArray(new String[ret.size()]);
+                    return ret.toArray(new String[ret.size()]);
                 } else {
                     return null;
                 }
@@ -98,19 +97,18 @@ public final class ResolverHelper {
         try {
             String fileSep = rep.getFileSeparator();
             Message.debug("\tusing " + rep + " to list all in " + parent);
-            List all = rep.list(parent);
+            List<String> all = rep.list(parent);
             if (all != null) {
                 Message.debug("\t\tfound " + all.size() + " resources");
-                List names = new ArrayList(all.size());
-                for (Iterator iter = all.iterator(); iter.hasNext();) {
-                    String path = (String) iter.next();
+                List<String> names = new ArrayList<String>(all.size());
+                for (String path : all) {
                     if (path.endsWith(fileSep)) {
                         path = path.substring(0, path.length() - 1);
                     }
                     int slashIndex = path.lastIndexOf(fileSep);
                     names.add(path.substring(slashIndex + 1));
                 }
-                return (String[]) names.toArray(new String[names.size()]);
+                return names.toArray(new String[names.size()]);
             } else {
                 Message.debug("\t\tno resources found");
                 return null;
@@ -137,7 +135,7 @@ public final class ResolverHelper {
             IvyPatternHelper.REVISION_KEY);
         if (revs != null) {
             Message.debug("\tfound revs: " + Arrays.asList(revs));
-            List ret = new ArrayList(revs.length);
+            List<ResolvedResource> ret = new ArrayList<ResolvedResource>(revs.length);
             for (int i = 0; i < revs.length; i++) {
                 String rres = IvyPatternHelper.substituteToken(partiallyResolvedPattern,
                     IvyPatternHelper.REVISION_KEY, revs[i]);
@@ -157,7 +155,7 @@ public final class ResolverHelper {
             if (revs.length != ret.size()) {
                 Message.debug("\tfound resolved res: " + ret);
             }
-            return (ResolvedResource[]) ret.toArray(new ResolvedResource[ret.size()]);
+            return ret.toArray(new ResolvedResource[ret.size()]);
         } else if (partiallyResolvedPattern.indexOf("[" + IvyPatternHelper.REVISION_KEY + "]") == -1) {
             // the partially resolved pattern is completely resolved, check the resource
             try {
@@ -267,9 +265,9 @@ public final class ResolverHelper {
 
                 try {
                     Message.debug("\tusing " + lister + " to list all in " + root);
-                    List all = lister.listAll(new URL(root));
+                    List<URL> all = lister.listAll(new URL(root));
                     Message.debug("\t\tfound " + all.size() + " urls");
-                    List ret = new ArrayList(all.size());
+                    List<String> ret = new ArrayList<String>(all.size());
                     int endNameIndex = pattern.indexOf('/', slashIndex + 1);
                     String namePattern;
                     if (endNameIndex != -1) {
@@ -281,8 +279,7 @@ public final class ResolverHelper {
                             + IvyPatternHelper.substituteToken(namePattern, token, "([^/]+)")
                             + ".*";
                     Pattern p = Pattern.compile(acceptNamePattern.toString());
-                    for (Iterator iter = all.iterator(); iter.hasNext();) {
-                        URL url = (URL) iter.next();
+                    for (URL url : all) {
                         String path = standardize(url.getPath());
                         Matcher m = p.matcher(path);
                         if (m.matches()) {
@@ -291,7 +288,7 @@ public final class ResolverHelper {
                         }
                     }
                     Message.debug("\t\t" + ret.size() + " matched " + pattern);
-                    return (String[]) ret.toArray(new String[ret.size()]);
+                    return ret.toArray(new String[ret.size()]);
                 } catch (Exception e) {
                     Message.warn("problem while listing files in " + root, e);
                     return null;
@@ -309,11 +306,10 @@ public final class ResolverHelper {
         try {
             if (lister.accept(root.toExternalForm())) {
                 Message.debug("\tusing " + lister + " to list all in " + root);
-                List all = lister.listAll(root);
+                List<URL> all = lister.listAll(root);
                 Message.debug("\t\tfound " + all.size() + " urls");
-                List names = new ArrayList(all.size());
-                for (Iterator iter = all.iterator(); iter.hasNext();) {
-                    URL dir = (URL) iter.next();
+                List<String> names = new ArrayList<String>(all.size());
+                for (URL dir : all) {
                     String path = dir.getPath();
                     if (path.endsWith("/")) {
                         path = path.substring(0, path.length() - 1);
@@ -321,7 +317,7 @@ public final class ResolverHelper {
                     int slashIndex = path.lastIndexOf('/');
                     names.add(path.substring(slashIndex + 1));
                 }
-                return (String[]) names.toArray(new String[names.size()]);
+                return names.toArray(new String[names.size()]);
             }
             return null;
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/plugins/resolver/util/URLLister.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/plugins/resolver/util/URLLister.java b/src/java/org/apache/ivy/plugins/resolver/util/URLLister.java
index 6e7258a..b8bc901 100644
--- a/src/java/org/apache/ivy/plugins/resolver/util/URLLister.java
+++ b/src/java/org/apache/ivy/plugins/resolver/util/URLLister.java
@@ -31,5 +31,5 @@ public interface URLLister {
      */
     boolean accept(String pattern);
 
-    List listAll(URL url) throws IOException;
+    List<URL> listAll(URL url) throws IOException;
 }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/util/AbstractMessageLogger.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/util/AbstractMessageLogger.java b/src/java/org/apache/ivy/util/AbstractMessageLogger.java
index 118db66..5e2f8e9 100644
--- a/src/java/org/apache/ivy/util/AbstractMessageLogger.java
+++ b/src/java/org/apache/ivy/util/AbstractMessageLogger.java
@@ -24,75 +24,40 @@ import java.util.List;
  * An abstract base class to ease {@link MessageLogger} implementation.
  */
 public abstract class AbstractMessageLogger implements MessageLogger {
-    private List problems = new ArrayList();
+    private List<String> problems = new ArrayList<String>();
 
-    private List warns = new ArrayList();
+    private List<String> warns = new ArrayList<String>();
 
-    private List errors = new ArrayList();
+    private List<String> errors = new ArrayList<String>();
 
     private boolean showProgress = true;
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.ivy.util.MessageLogger#debug(java.lang.String)
-     */
     public void debug(String msg) {
         log(msg, Message.MSG_DEBUG);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.ivy.util.MessageLogger#verbose(java.lang.String)
-     */
     public void verbose(String msg) {
         log(msg, Message.MSG_VERBOSE);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.ivy.util.MessageLogger#deprecated(java.lang.String)
-     */
     public void deprecated(String msg) {
         log("DEPRECATED: " + msg, Message.MSG_WARN);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.ivy.util.MessageLogger#info(java.lang.String)
-     */
     public void info(String msg) {
         log(msg, Message.MSG_INFO);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.ivy.util.MessageLogger#info(java.lang.String)
-     */
     public void rawinfo(String msg) {
         rawlog(msg, Message.MSG_INFO);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.ivy.util.MessageLogger#warn(java.lang.String)
-     */
     public void warn(String msg) {
         log("WARN: " + msg, Message.MSG_VERBOSE);
         problems.add("WARN:  " + msg);
         getWarns().add(msg);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.ivy.util.MessageLogger#error(java.lang.String)
-     */
     public void error(String msg) {
         // log in verbose mode because message is appended as a problem, and will be
         // logged at the end at error level
@@ -101,20 +66,10 @@ public abstract class AbstractMessageLogger implements MessageLogger {
         getErrors().add(msg);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.ivy.util.MessageLogger#getProblems()
-     */
-    public List getProblems() {
+    public List<String> getProblems() {
         return problems;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.ivy.util.MessageLogger#sumupProblems()
-     */
     public void sumupProblems() {
         MessageLoggerHelper.sumupProblems(this);
         clearProblems();
@@ -126,59 +81,34 @@ public abstract class AbstractMessageLogger implements MessageLogger {
         errors.clear();
     }
 
-    public List getErrors() {
+    public List<String> getErrors() {
         return errors;
     }
 
-    public List getWarns() {
+    public List<String> getWarns() {
         return warns;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.ivy.util.MessageLogger#progress()
-     */
     public void progress() {
         if (showProgress) {
             doProgress();
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.ivy.util.MessageLogger#endProgress()
-     */
     public void endProgress() {
         endProgress("");
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.ivy.util.MessageLogger#endProgress(java.lang.String)
-     */
     public void endProgress(String msg) {
         if (showProgress) {
             doEndProgress(msg);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.ivy.util.MessageLogger#isShowProgress()
-     */
     public boolean isShowProgress() {
         return showProgress;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.ivy.util.MessageLogger#setShowProgress(boolean)
-     */
     public void setShowProgress(boolean progress) {
         showProgress = progress;
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/util/ContextualSAXHandler.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/util/ContextualSAXHandler.java b/src/java/org/apache/ivy/util/ContextualSAXHandler.java
index daf85c0..64992ae 100644
--- a/src/java/org/apache/ivy/util/ContextualSAXHandler.java
+++ b/src/java/org/apache/ivy/util/ContextualSAXHandler.java
@@ -17,7 +17,6 @@
  */
 package org.apache.ivy.util;
 
-import java.util.Iterator;
 import java.util.Stack;
 
 import org.xml.sax.Attributes;
@@ -26,20 +25,23 @@ import org.xml.sax.helpers.DefaultHandler;
 
 public class ContextualSAXHandler extends DefaultHandler {
 
-    private Stack contextStack = new Stack();
+    private Stack<String> contextStack = new Stack<String>();
 
     private StringBuffer buffer = new StringBuffer();
 
+    @Override
     public void characters(char[] ch, int start, int length) throws SAXException {
         buffer.append(ch, start, length);
     }
 
+    @Override
     public void startElement(String uri, String localName, String qName, Attributes attributes)
             throws SAXException {
         contextStack.push(qName);
         buffer.setLength(0);
     }
 
+    @Override
     public void endElement(String uri, String localName, String qName) throws SAXException {
         contextStack.pop();
         buffer.setLength(0);
@@ -47,8 +49,7 @@ public class ContextualSAXHandler extends DefaultHandler {
 
     protected String getContext() {
         StringBuffer buf = new StringBuffer();
-        for (Iterator iter = contextStack.iterator(); iter.hasNext();) {
-            String ctx = (String) iter.next();
+        for (String ctx : contextStack) {
             buf.append(ctx).append("/");
         }
         if (buf.length() > 0) {

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/util/MessageLoggerEngine.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/util/MessageLoggerEngine.java b/src/java/org/apache/ivy/util/MessageLoggerEngine.java
index 21bc72f..07c5658 100644
--- a/src/java/org/apache/ivy/util/MessageLoggerEngine.java
+++ b/src/java/org/apache/ivy/util/MessageLoggerEngine.java
@@ -18,7 +18,6 @@
 package org.apache.ivy.util;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Stack;
 
@@ -34,20 +33,20 @@ import java.util.Stack;
  * </p>
  */
 public class MessageLoggerEngine implements MessageLogger {
-    private final ThreadLocal/* <Stack<MessageLogger>> */loggerStacks = new ThreadLocal();
+    private final ThreadLocal<Stack<MessageLogger>> loggerStacks = new ThreadLocal<Stack<MessageLogger>>();
 
     private MessageLogger defaultLogger = null;
 
-    private List problems = new ArrayList();
+    private List<String> problems = new ArrayList<String>();
 
-    private List warns = new ArrayList();
+    private List<String> warns = new ArrayList<String>();
 
-    private List errors = new ArrayList();
+    private List<String> errors = new ArrayList<String>();
 
-    private Stack getLoggerStack() {
-        Stack stack = (Stack) loggerStacks.get();
+    private Stack<MessageLogger> getLoggerStack() {
+        Stack<MessageLogger> stack = loggerStacks.get();
         if (stack == null) {
-            stack = new Stack();
+            stack = new Stack<MessageLogger>();
             loggerStacks.set(stack);
         }
         return stack;
@@ -98,7 +97,7 @@ public class MessageLoggerEngine implements MessageLogger {
         if (getLoggerStack().isEmpty()) {
             return getDefaultLogger();
         }
-        return (MessageLogger) getLoggerStack().peek();
+        return getLoggerStack().peek();
     }
 
     private MessageLogger getDefaultLogger() {
@@ -120,15 +119,15 @@ public class MessageLoggerEngine implements MessageLogger {
         errors.add(msg);
     }
 
-    public List getErrors() {
+    public List<String> getErrors() {
         return errors;
     }
 
-    public List getProblems() {
+    public List<String> getProblems() {
         return problems;
     }
 
-    public List getWarns() {
+    public List<String> getWarns() {
         return warns;
     }
 
@@ -139,8 +138,7 @@ public class MessageLoggerEngine implements MessageLogger {
 
     public void clearProblems() {
         getDefaultLogger().clearProblems();
-        for (Iterator iter = getLoggerStack().iterator(); iter.hasNext();) {
-            MessageLogger l = (MessageLogger) iter.next();
+        for (MessageLogger l : getLoggerStack()) {
             l.clearProblems();
         }
         problems.clear();
@@ -151,8 +149,7 @@ public class MessageLoggerEngine implements MessageLogger {
     public void setShowProgress(boolean progress) {
         getDefaultLogger().setShowProgress(progress);
         // updates all loggers in the stack
-        for (Iterator iter = getLoggerStack().iterator(); iter.hasNext();) {
-            MessageLogger l = (MessageLogger) iter.next();
+        for (MessageLogger l : getLoggerStack()) {
             l.setShowProgress(progress);
         }
     }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/util/cli/CommandLineParser.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/util/cli/CommandLineParser.java b/src/java/org/apache/ivy/util/cli/CommandLineParser.java
index 7b2212d..a24ab70 100644
--- a/src/java/org/apache/ivy/util/cli/CommandLineParser.java
+++ b/src/java/org/apache/ivy/util/cli/CommandLineParser.java
@@ -20,7 +20,6 @@ package org.apache.ivy.util.cli;
 import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.ListIterator;
@@ -34,22 +33,23 @@ public class CommandLineParser {
 
     private static final int MAX_SPEC_WIDTH = 30;
 
-    private Map/* <String, Option> */options = new LinkedHashMap();
+    private Map<String, Option> options = new LinkedHashMap<String, Option>();
 
-    private Map/* <String, List<Option>> */categories = new LinkedHashMap();
+    private Map<String, List<Option>> categories = new LinkedHashMap<String, List<Option>>();
 
     public CommandLineParser() {
     }
 
     public CommandLineParser addCategory(String category) {
-        categories.put(category, new ArrayList());
+        categories.put(category, new ArrayList<Option>());
         return this;
     }
 
     public CommandLineParser addOption(Option option) {
         options.put(option.getName(), option);
         if (!categories.isEmpty()) {
-            ((List) categories.values().toArray()[categories.values().size() - 1]).add(option);
+            ((List<Option>) categories.values().toArray()[categories.values().size() - 1])
+                    .add(option);
         }
         return this;
     }
@@ -58,9 +58,9 @@ public class CommandLineParser {
         CommandLine line = new CommandLine();
 
         int index = args.length;
-        ListIterator iterator = Arrays.asList(args).listIterator();
+        ListIterator<String> iterator = Arrays.asList(args).listIterator();
         while (iterator.hasNext()) {
-            String arg = (String) iterator.next();
+            String arg = iterator.next();
             if ("--".equals(arg)) {
                 // skip this argument and stop looping
                 index = iterator.nextIndex();
@@ -72,7 +72,7 @@ public class CommandLineParser {
                 break;
             }
 
-            Option option = (Option) options.get(arg.substring(1));
+            Option option = options.get(arg.substring(1));
             if (option == null) {
                 throw new ParseException("Unrecognized option: " + arg);
             }
@@ -91,8 +91,7 @@ public class CommandLineParser {
         pw.println("usage: " + command);
         // compute the largest option spec
         int specWidth = 0;
-        for (Iterator iterator = options.values().iterator(); iterator.hasNext();) {
-            Option option = (Option) iterator.next();
+        for (Option option : options.values()) {
             if (option.isDeprecated() && !showDeprecated) {
                 continue;
             }
@@ -100,13 +99,11 @@ public class CommandLineParser {
         }
 
         // print options help
-        for (Iterator iterator = categories.entrySet().iterator(); iterator.hasNext();) {
-            Entry entry = (Entry) iterator.next();
-            String category = (String) entry.getKey();
+        for (Entry<String, List<Option>> entry : categories.entrySet()) {
+            String category = entry.getKey();
             pw.println("==== " + category);
-            List/* <Option> */options = (List) entry.getValue();
-            for (Iterator it = options.iterator(); it.hasNext();) {
-                Option option = (Option) it.next();
+            List<Option> options = entry.getValue();
+            for (Option option : options) {
                 if (option.isDeprecated() && !showDeprecated) {
                     continue;
                 }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/util/extendable/ExtendableItem.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/util/extendable/ExtendableItem.java b/src/java/org/apache/ivy/util/extendable/ExtendableItem.java
index 91fb129..408be7e 100644
--- a/src/java/org/apache/ivy/util/extendable/ExtendableItem.java
+++ b/src/java/org/apache/ivy/util/extendable/ExtendableItem.java
@@ -48,7 +48,7 @@ public interface ExtendableItem {
      * 
      * @return A Map instance containing all the attributes and their values.
      */
-    Map getAttributes();
+    Map<String, String> getAttributes();
 
     /**
      * Returns a Map of all extra attributes of this extendable item. The Map keys are
@@ -58,7 +58,7 @@ public interface ExtendableItem {
      * @return A Map instance containing all the extra attributes and their values.
      * @see #getQualifiedExtraAttributes()
      */
-    Map getExtraAttributes();
+    Map<String, String> getExtraAttributes();
 
     /**
      * Returns a Map of all extra attributes of this extendable item.
@@ -74,5 +74,5 @@ public interface ExtendableItem {
      * @return A Map instance containing all the extra attributes and their values.
      * @see #getExtraAttributes()
      */
-    Map getQualifiedExtraAttributes();
+    Map<String, String> getQualifiedExtraAttributes();
 }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/util/extendable/ExtendableItemHelper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/util/extendable/ExtendableItemHelper.java b/src/java/org/apache/ivy/util/extendable/ExtendableItemHelper.java
index cfb4340..c7c3f57 100644
--- a/src/java/org/apache/ivy/util/extendable/ExtendableItemHelper.java
+++ b/src/java/org/apache/ivy/util/extendable/ExtendableItemHelper.java
@@ -20,8 +20,8 @@ package org.apache.ivy.util.extendable;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
+import java.util.Map.Entry;
 
 import org.apache.ivy.plugins.parser.ParserSettings;
 import org.xml.sax.Attributes;
@@ -30,8 +30,8 @@ public final class ExtendableItemHelper {
     private ExtendableItemHelper() {
     }
 
-    public static Map getExtraAttributes(Attributes attributes, String prefix) {
-        Map ret = new HashMap();
+    public static Map<String, String> getExtraAttributes(Attributes attributes, String prefix) {
+        Map<String, String> ret = new HashMap<String, String>();
         for (int i = 0; i < attributes.getLength(); i++) {
             if (attributes.getQName(i).startsWith(prefix)) {
                 ret.put(attributes.getQName(i).substring(prefix.length()), attributes.getValue(i));
@@ -49,10 +49,10 @@ public final class ExtendableItemHelper {
      *            the XML attributes names which are not extra but Ivy core ones
      * @return
      */
-    public static Map getExtraAttributes(ParserSettings settings, Attributes attributes,
-            String[] ignoredAttNames) {
-        Map ret = new HashMap();
-        Collection ignored = Arrays.asList(ignoredAttNames);
+    public static Map<String, String> getExtraAttributes(ParserSettings settings,
+            Attributes attributes, String[] ignoredAttNames) {
+        Map<String, String> ret = new HashMap<String, String>();
+        Collection<String> ignored = Arrays.asList(ignoredAttNames);
         for (int i = 0; i < attributes.getLength(); i++) {
             if (!ignored.contains(attributes.getQName(i))) {
                 ret.put(attributes.getQName(i), settings.substitute(attributes.getValue(i)));
@@ -63,11 +63,9 @@ public final class ExtendableItemHelper {
 
     public static void fillExtraAttributes(ParserSettings settings, DefaultExtendableItem item,
             Attributes attributes, String[] ignoredAttNames) {
-        Map att = getExtraAttributes(settings, attributes, ignoredAttNames);
-        for (Iterator iter = att.keySet().iterator(); iter.hasNext();) {
-            String attName = (String) iter.next();
-            String attValue = (String) att.get(attName);
-            item.setExtraAttribute(attName, attValue);
+        Map<String, String> att = getExtraAttributes(settings, attributes, ignoredAttNames);
+        for (Entry<String, String> entry : att.entrySet()) {
+            item.setExtraAttribute(entry.getKey(), entry.getValue());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/util/extendable/UnmodifiableExtendableItem.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/util/extendable/UnmodifiableExtendableItem.java b/src/java/org/apache/ivy/util/extendable/UnmodifiableExtendableItem.java
index 6342569..5bb170f 100644
--- a/src/java/org/apache/ivy/util/extendable/UnmodifiableExtendableItem.java
+++ b/src/java/org/apache/ivy/util/extendable/UnmodifiableExtendableItem.java
@@ -19,49 +19,49 @@ package org.apache.ivy.util.extendable;
 
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Map.Entry;
 
 public class UnmodifiableExtendableItem implements ExtendableItem {
-    private final Map attributes = new HashMap();
+    private final Map<String, String> attributes = new HashMap<String, String>();
 
-    private final Map unmodifiableAttributesView = Collections.unmodifiableMap(attributes);
+    private final Map<String, String> unmodifiableAttributesView = Collections
+            .unmodifiableMap(attributes);
 
-    private final Map extraAttributes = new HashMap();
+    private final Map<String, String> extraAttributes = new HashMap<String, String>();
 
-    private final Map unmodifiableExtraAttributesView = Collections
+    private final Map<String, String> unmodifiableExtraAttributesView = Collections
             .unmodifiableMap(extraAttributes);
 
     /*
      * this is the only place where extra attributes are stored in qualified form. In all other maps
      * they are stored unqualified.
      */
-    private final Map qualifiedExtraAttributes = new HashMap();
+    private final Map<String, String> qualifiedExtraAttributes = new HashMap<String, String>();
 
-    private final Map unmodifiableQualifiedExtraAttributesView = Collections
+    private final Map<String, String> unmodifiableQualifiedExtraAttributesView = Collections
             .unmodifiableMap(qualifiedExtraAttributes);
 
-    public UnmodifiableExtendableItem(Map stdAttributes, Map extraAttributes) {
+    public UnmodifiableExtendableItem(Map<String, String> stdAttributes,
+            Map<String, String> extraAttributes) {
         if (stdAttributes != null) {
             this.attributes.putAll(stdAttributes);
         }
         if (extraAttributes != null) {
-            for (Iterator iter = extraAttributes.entrySet().iterator(); iter.hasNext();) {
-                Entry extraAtt = (Entry) iter.next();
-                setExtraAttribute((String) extraAtt.getKey(), (String) extraAtt.getValue());
+            for (Entry<String, String> extraAtt : extraAttributes.entrySet()) {
+                setExtraAttribute(extraAtt.getKey(), extraAtt.getValue());
             }
         }
     }
 
     public String getAttribute(String attName) {
-        return (String) attributes.get(attName);
+        return attributes.get(attName);
     }
 
     public String getExtraAttribute(String attName) {
-        String v = (String) qualifiedExtraAttributes.get(attName);
+        String v = qualifiedExtraAttributes.get(attName);
         if (v == null) {
-            v = (String) extraAttributes.get(attName);
+            v = extraAttributes.get(attName);
         }
         return v;
     }
@@ -82,15 +82,15 @@ public class UnmodifiableExtendableItem implements ExtendableItem {
         attributes.put(attName, attValue);
     }
 
-    public Map getAttributes() {
+    public Map<String, String> getAttributes() {
         return unmodifiableAttributesView;
     }
 
-    public Map getExtraAttributes() {
+    public Map<String, String> getExtraAttributes() {
         return unmodifiableExtraAttributesView;
     }
 
-    public Map getQualifiedExtraAttributes() {
+    public Map<String, String> getQualifiedExtraAttributes() {
         return unmodifiableQualifiedExtraAttributesView;
     }
 

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/src/java/org/apache/ivy/util/url/ApacheURLLister.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/util/url/ApacheURLLister.java b/src/java/org/apache/ivy/util/url/ApacheURLLister.java
index e2e7dea..24f0f43 100644
--- a/src/java/org/apache/ivy/util/url/ApacheURLLister.java
+++ b/src/java/org/apache/ivy/util/url/ApacheURLLister.java
@@ -54,7 +54,7 @@ public class ApacheURLLister {
      * @throws IOException
      *             If an error occures retrieving the HTML.
      */
-    public List listAll(URL url) throws IOException {
+    public List<URL> listAll(URL url) throws IOException {
         return retrieveListing(url, true, true);
     }
 
@@ -67,7 +67,7 @@ public class ApacheURLLister {
      * @throws IOException
      *             If an error occures retrieving the HTML.
      */
-    public List listDirectories(URL url) throws IOException {
+    public List<URL> listDirectories(URL url) throws IOException {
         return retrieveListing(url, false, true);
     }
 
@@ -81,7 +81,7 @@ public class ApacheURLLister {
      * @throws IOException
      *             If an error occures retrieving the HTML.
      */
-    public List listFiles(URL url) throws IOException {
+    public List<URL> listFiles(URL url) throws IOException {
         return retrieveListing(url, true, false);
     }
 
@@ -99,9 +99,9 @@ public class ApacheURLLister {
      * @throws IOException
      *             If an error occures retrieving the HTML.
      */
-    public List retrieveListing(URL url, boolean includeFiles, boolean includeDirectories)
+    public List<URL> retrieveListing(URL url, boolean includeFiles, boolean includeDirectories)
             throws IOException {
-        List urlList = new ArrayList();
+        List<URL> urlList = new ArrayList<URL>();
 
         // add trailing slash for relative urls
         if (!url.getPath().endsWith("/") && !url.getPath().endsWith(".html")) {

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/e1276e0a/test/java/org/apache/ivy/core/module/id/ModuleIdTest.java
----------------------------------------------------------------------
diff --git a/test/java/org/apache/ivy/core/module/id/ModuleIdTest.java b/test/java/org/apache/ivy/core/module/id/ModuleIdTest.java
index 9388a26..9910ac9 100644
--- a/test/java/org/apache/ivy/core/module/id/ModuleIdTest.java
+++ b/test/java/org/apache/ivy/core/module/id/ModuleIdTest.java
@@ -100,19 +100,6 @@ public class ModuleIdTest extends TestCase {
         }
     }
 
-    public void testCompareToOtherObject() {
-        String org = "apache";
-        String name = "some-new-module";
-        ModuleId moduleId = new ModuleId(org, name);
-
-        try {
-            moduleId.compareTo(new String());
-            fail("A ClassCastException was expected.");
-        } catch (ClassCastException cce) {
-            // success
-        }
-    }
-
     public void testCompareToEqual() {
         String org = "apache";
         String name = "some-new-module";


Mime
View raw message