commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1088095 - /commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/resource/DiscoverResources.java
Date Sat, 02 Apr 2011 19:41:07 GMT
Author: simonetripodi
Date: Sat Apr  2 19:41:07 2011
New Revision: 1088095

URL: http://svn.apache.org/viewvc?rev=1088095&view=rev
Log:
DiscoverResources users generified JDKHooks

Modified:
    commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/resource/DiscoverResources.java

Modified: commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/resource/DiscoverResources.java
URL: http://svn.apache.org/viewvc/commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/resource/DiscoverResources.java?rev=1088095&r1=1088094&r2=1088095&view=diff
==============================================================================
--- commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/resource/DiscoverResources.java
(original)
+++ commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/resource/DiscoverResources.java
Sat Apr  2 19:41:07 2011
@@ -67,7 +67,7 @@ public class DiscoverResources
         return new ResourceIterator() {
             private int idx = 0;
             private ClassLoader loader = null;
-            private Enumeration resources = null;
+            private Enumeration<URL> resources = null;
             private Resource resource = null;
             
             public boolean hasNext() {
@@ -90,7 +90,7 @@ public class DiscoverResources
 
                 Resource resourceInfo;
                 if (resources != null) {
-                    URL url = (URL)resources.nextElement();
+                    URL url = resources.nextElement();
 
                     if (log.isDebugEnabled())
                         log.debug("getNextResource: next URL='" + url + "'");
@@ -103,13 +103,13 @@ public class DiscoverResources
                 return resourceInfo;
             }
             
-            private Enumeration getNextResources() {
+            private Enumeration<URL> getNextResources() {
                 while (idx < getClassLoaders().size()) {
                     loader = getClassLoaders().get(idx++);
                     if (log.isDebugEnabled())
                         log.debug("getNextResources: search using ClassLoader '" + loader
+ "'");
                     try {
-                        Enumeration e = JDKHooks.getJDKHooks().getResources(loader, resourceName);
+                        Enumeration<URL> e = JDKHooks.getJDKHooks().getResources(loader,
resourceName);
                         if (e != null && e.hasMoreElements()) {
                             return e;
                         }



Mime
View raw message