openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1800498 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/xbean/CdiArchive.java
Date Sat, 01 Jul 2017 12:43:41 GMT
Author: rmannibucau
Date: Sat Jul  1 12:43:40 2017
New Revision: 1800498

URL: http://svn.apache.org/viewvc?rev=1800498&view=rev
Log:
avoid to add twice the custom archive passed to CdiArchive

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/xbean/CdiArchive.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/xbean/CdiArchive.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/xbean/CdiArchive.java?rev=1800498&r1=1800497&r2=1800498&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/xbean/CdiArchive.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/xbean/CdiArchive.java
Sat Jul  1 12:43:40 2017
@@ -56,23 +56,28 @@ public class CdiArchive implements Archi
                       Filter userFilter, Archive customArchive)
     {
         Collection<Archive> archives = new ArrayList<>();
-        if (customArchive != null)
-        {
-            archives.add(userFilter != null ? new FilteredArchive(customArchive, userFilter)
: customArchive);
-        }
+        boolean customAdded = false;
         for (URL url : urls.values())
         {
             List<String> urlClasses = new ArrayList<>();
 
             BeanArchiveInformation beanArchiveInfo = beanArchiveService.getBeanArchiveInformation(url);
+            final boolean custom = "openwebbeans".equals(url.getProtocol());
             Archive archive = new FilteredArchive(
-                    "openwebbeans".equals(url.getProtocol()) ? customArchive : ClasspathArchive.archive(loader,
url),
+                    custom ? customArchive : ClasspathArchive.archive(loader, url),
                     new BeanArchiveFilter(beanArchiveInfo, urlClasses, userFilter));
+            if (!customAdded && custom)
+            {
+                customAdded = true;
+            }
 
             classesByUrl.put(url.toExternalForm(), new FoundClasses(url, urlClasses, beanArchiveInfo));
             archives.add(archive);
         }
-
+        if (!customAdded && customArchive != null)
+        {
+            archives.add(userFilter != null ? new FilteredArchive(customArchive, userFilter)
: customArchive);
+        }
         delegate = new CompositeArchive(archives);
     }
 



Mime
View raw message