openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1796445 - in /openwebbeans/trunk: webbeans-impl/src/main/java/org/apache/webbeans/component/creation/BeanAttributesBuilder.java webbeans-tck/standalone-suite.xml
Date Sat, 27 May 2017 19:50:57 GMT
Author: struberg
Date: Sat May 27 19:50:57 2017
New Revision: 1796445

URL: http://svn.apache.org/viewvc?rev=1796445&view=rev
Log:
OWB-1182 apply new rules for default Qualifier 

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/BeanAttributesBuilder.java
    openwebbeans/trunk/webbeans-tck/standalone-suite.xml

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/BeanAttributesBuilder.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/BeanAttributesBuilder.java?rev=1796445&r1=1796444&r2=1796445&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/BeanAttributesBuilder.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/BeanAttributesBuilder.java
Sat May 27 19:50:57 2017
@@ -258,13 +258,27 @@ public abstract class BeanAttributesBuil
         }
         else if(qualifiers.size() == 1)
         {
+            // section 2.3.1
+            // If a bean does not explicitly declare a qualifier other than @Named or @Any,
+            // the bean has exactly one additional qualifier, of type @Default.
             Annotation annot = qualifiers.iterator().next();
-            if(annot.annotationType().equals(Named.class))
+            if(annot.annotationType().equals(Named.class) || annot.annotationType().equals(Any.class))
             {
                 qualifiers.add(DefaultLiteral.INSTANCE);
             }
         }
-        
+        else if (qualifiers.size() == 2)
+        {
+            Iterator<Annotation> qualiIt = qualifiers.iterator();
+            Class<? extends Annotation> q1 = qualiIt.next().annotationType();
+            Class<? extends Annotation> q2 = qualiIt.next().annotationType();
+            if (q1.equals(Named.class) && q2.equals(Any.class) ||
+                q2.equals(Named.class) && q1.equals(Any.class) )
+            {
+                qualifiers.add(DefaultLiteral.INSTANCE);
+            }
+        }
+
         //Add @Any support
         if(!hasAnyQualifier())
         {

Modified: openwebbeans/trunk/webbeans-tck/standalone-suite.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tck/standalone-suite.xml?rev=1796445&r1=1796444&r2=1796445&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-tck/standalone-suite.xml (original)
+++ openwebbeans/trunk/webbeans-tck/standalone-suite.xml Sat May 27 19:50:57 2017
@@ -88,7 +88,7 @@
                 </methods>
             </class>
 
-            
+
 
             <!--
              Tests broken in the CDI-1.2 TCK:



Mime
View raw message