openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1676144 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/DefaultBeanArchiveService.java
Date Sun, 26 Apr 2015 20:13:08 GMT
Author: struberg
Date: Sun Apr 26 20:13:08 2015
New Revision: 1676144

URL: http://svn.apache.org/r1676144
Log:
OWB-1059 empty beans.xml should result in BeanDiscoveryMode.ALL

This is very important for backward compat to CDI-1.0 applications

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/DefaultBeanArchiveService.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/DefaultBeanArchiveService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/DefaultBeanArchiveService.java?rev=1676144&r1=1676143&r2=1676144&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/DefaultBeanArchiveService.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/DefaultBeanArchiveService.java
Sun Apr 26 20:13:08 2015
@@ -180,8 +180,12 @@ public class DefaultBeanArchiveService i
     {
         DefaultBeanArchiveInformation bdaInfo = createBeanArchiveInformation();
 
-
-        if (xmlStream.available() > 0)
+        if (xmlStream != null && xmlStream.available() == 0)
+        {
+            // an empty beans.xml will be treated as ALL for backward compat with CDI-1.0
+            bdaInfo.setBeanDiscoveryMode(BeanDiscoveryMode.ALL);
+        }
+        else if (xmlStream != null && xmlStream.available() > 0)
         {
             //Get root element of the XML document
             Element webBeansRoot = getBeansRootElement(xmlStream);



Mime
View raw message