openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1499916 - /openwebbeans/trunk/webbeans-arquillian/owb-arquillian-standalone/src/main/java/org/apache/webbeans/arquillian/standalone/OwbSWClassLoader.java
Date Fri, 05 Jul 2013 06:13:18 GMT
Author: struberg
Date: Fri Jul  5 06:13:18 2013
New Revision: 1499916

URL: http://svn.apache.org/r1499916
Log:
OWB-876 Collections.emptyEnumeration() doesn't exist prior to java7

Modified:
    openwebbeans/trunk/webbeans-arquillian/owb-arquillian-standalone/src/main/java/org/apache/webbeans/arquillian/standalone/OwbSWClassLoader.java

Modified: openwebbeans/trunk/webbeans-arquillian/owb-arquillian-standalone/src/main/java/org/apache/webbeans/arquillian/standalone/OwbSWClassLoader.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-arquillian/owb-arquillian-standalone/src/main/java/org/apache/webbeans/arquillian/standalone/OwbSWClassLoader.java?rev=1499916&r1=1499915&r2=1499916&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-arquillian/owb-arquillian-standalone/src/main/java/org/apache/webbeans/arquillian/standalone/OwbSWClassLoader.java
(original)
+++ openwebbeans/trunk/webbeans-arquillian/owb-arquillian-standalone/src/main/java/org/apache/webbeans/arquillian/standalone/OwbSWClassLoader.java
Fri Jul  5 06:13:18 2013
@@ -42,6 +42,22 @@ import java.util.List;
 
 public class OwbSWClassLoader extends URLClassLoader implements Closeable
 {
+    // Collections.emptyEnumeration only exists in java7++
+    private final static Enumeration EMPTY_ENUMERATION = new Enumeration()
+    {
+        @Override
+        public boolean hasMoreElements()
+        {
+            return false;
+        }
+
+        @Override
+        public Object nextElement()
+        {
+            return null;
+        }
+    };
+
     private final List<InputStream> openedStreams = new ArrayList<InputStream>();
     private final String prefix;
     private final boolean useOnlyArchiveResources;
@@ -141,7 +157,7 @@ public class OwbSWClassLoader extends UR
         }
         if (useOnlyArchiveResources)
         {
-            return Collections.emptyEnumeration();
+            return EMPTY_ENUMERATION;
         }
 
         return super.findResources(name);



Mime
View raw message