You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by st...@apache.org on 2023/01/26 21:00:25 UTC
[openwebbeans] 02/02: OWB-1417 improve Alternative Sterotype handling
This is an automated email from the ASF dual-hosted git repository.
struberg pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/openwebbeans.git
commit edcd0d3b353d37601c3b9d64741acaa3cc8b839d
Author: Mark Struberg <st...@apache.org>
AuthorDate: Thu Jan 26 21:59:51 2023 +0100
OWB-1417 improve Alternative Sterotype handling
---
.../org/apache/webbeans/util/WebBeansUtil.java | 11 +++--
webbeans-tck/testng-dev.xml | 47 +++++++++++-----------
2 files changed, 32 insertions(+), 26 deletions(-)
diff --git a/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java b/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
index 73781bd41..911b6848a 100644
--- a/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
+++ b/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
@@ -902,14 +902,19 @@ public final class WebBeansUtil
}
if (stereotypes != null && !stereotypes.isEmpty())
{
+ boolean hasPriority = at.getAnnotation(Priority.class) != null;
+ boolean hasStereotypeWithPriority = false;
for (Class<? extends Annotation> stereotype : stereotypes)
{
- if (alternativesManager.isAlternativeStereotype(stereotype) ||
- at.getAnnotation(Priority.class) != null || isStereotypeWithPriority(stereotype, stereotypes))
+ if (isStereotypeWithPriority(stereotype, stereotypes))
{
- return true;
+ hasStereotypeWithPriority = true;
}
}
+ if (hasPriority || hasStereotypeWithPriority)
+ {
+ return true;
+ }
}
return false;
diff --git a/webbeans-tck/testng-dev.xml b/webbeans-tck/testng-dev.xml
index c97b98bd7..4b4aa1ef5 100644
--- a/webbeans-tck/testng-dev.xml
+++ b/webbeans-tck/testng-dev.xml
@@ -16,29 +16,30 @@
License.
-->
<suite name="JSR-346-TCK" verbose="2" configfailurepolicy="continue">
- <test name="JSR-346 TCK">
- <classes>
- <class name="org.jboss.cdi.tck.tests.full.alternative.selection.stereotype.SelectedBeanWithUnselectedStereotypeTest" >
- <methods>
- <include name=".*"/>
- </methods>
- </class>
+ <test name="JSR-346 TCK">
- <!--
+ <classes>
+ <class name="org.jboss.cdi.tck.tests.definition.stereotype.priority.inherited.StereotypeInheritedPriorityTest" >
+ <methods>
+ <include name=".*"/>
+ </methods>
+ </class>
- <class name="org.jboss.cdi.tck.tests.event.parameterized.ParameterizedEventTest" />
- <class name="org.jboss.cdi.tck.tests.event.fires.FireEventTest" />
- -->
- </classes>
- <groups>
- <run>
- <exclude name="integration"/>
- <exclude name="javaee-full"/>
- </run>
- </groups>
- </test>
- <listeners>
- <listener class-name="org.jboss.cdi.tck.impl.testng.SingleTestClassMethodInterceptor"/>
- <listener class-name="org.jboss.cdi.tck.impl.testng.ProgressLoggingTestListener"/>
- </listeners>
+ <!--
+
+ <class name="org.jboss.cdi.tck.tests.event.parameterized.ParameterizedEventTest" />
+ <class name="org.jboss.cdi.tck.tests.event.fires.FireEventTest" />
+ -->
+ </classes>
+ <groups>
+ <run>
+ <exclude name="integration"/>
+ <exclude name="javaee-full"/>
+ </run>
+ </groups>
+ </test>
+ <listeners>
+ <listener class-name="org.jboss.cdi.tck.impl.testng.SingleTestClassMethodInterceptor"/>
+ <listener class-name="org.jboss.cdi.tck.impl.testng.ProgressLoggingTestListener"/>
+ </listeners>
</suite>