[geronimo-jcache-simple] branch master updated: [GERONIMO-6789] ensure we don't veto the bean we add

[email protected]
Newsgroups gmane.comp.java.geronimo.cvs
Message-ID <[email protected]>
This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/geronimo-jcache-simple.git


The following commit(s) were added to refs/heads/master by this push:
     new f4d240b  [GERONIMO-6789] ensure we don't veto the bean we add
f4d240b is described below

commit f4d240bfe1079053cb2ee0a826f0eb14b970d7f9
Author: Romain Manni-Bucau <[email protected]>
AuthorDate: Tue Nov 10 15:16:34 2020 +0100

    [GERONIMO-6789] ensure we don't veto the bean we add
---
 pom.xml                                                          | 4 ++--
 .../jcache/simple/cdi/MakeJCacheCDIInterceptorFriendly.java      | 9 +++++----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/pom.xml b/pom.xml
index 9834d80..8f63359 100644
--- a/pom.xml
+++ b/pom.xml
@@ -141,7 +141,7 @@
     <dependency>
       <groupId>org.apache.openwebbeans</groupId>
       <artifactId>openwebbeans-impl</artifactId>
-      <version>2.0.5</version>
+      <version>2.0.19</version>
       <scope>test</scope>
     </dependency>
   </dependencies>
@@ -250,7 +250,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
-        <version>2.20.1</version>
+        <version>3.0.0-M5</version>
         <configuration>
           <systemPropertyVariables>
             <java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
diff --git a/src/main/java/org/apache/geronimo/jcache/simple/cdi/MakeJCacheCDIInterceptorFriendly.java b/src/main/java/org/apache/geronimo/jcache/simple/cdi/MakeJCacheCDIInterceptorFriendly.java
index d56f6ec..032e358 100644
--- a/src/main/java/org/apache/geronimo/jcache/simple/cdi/MakeJCacheCDIInterceptorFriendly.java
+++ b/src/main/java/org/apache/geronimo/jcache/simple/cdi/MakeJCacheCDIInterceptorFriendly.java
@@ -45,6 +45,7 @@ import javax.enterprise.inject.spi.InjectionPoint;
 import javax.enterprise.inject.spi.InjectionTarget;
 import javax.enterprise.inject.spi.PassivationCapable;
 import javax.enterprise.inject.spi.ProcessAnnotatedType;
+import javax.enterprise.inject.spi.ProcessSyntheticAnnotatedType;
 
 // TODO: observe annotated type (or maybe sthg else) to cache data and inject this extension (used as metadata cache)
 // to get class model and this way allow to add cache annotation on the fly - == avoid java pure reflection to get metadata
@@ -57,7 +58,7 @@ public class MakeJCacheCDIInterceptorFriendly implements Extension {
 
     private boolean needHelper = true;
 
-    protected void discoverInterceptorBindings(final @Observes BeforeBeanDiscovery beforeBeanDiscovery,
+    public void discoverInterceptorBindings(final @Observes BeforeBeanDiscovery beforeBeanDiscovery,
             final BeanManager bm) {
         if (SKIP) {
             return;
@@ -71,7 +72,7 @@ public class MakeJCacheCDIInterceptorFriendly implements Extension {
                 .forEach(it -> beforeBeanDiscovery.addAnnotatedType(bm.createAnnotatedType(it)));
     }
 
-    protected void addHelper(final @Observes AfterBeanDiscovery afterBeanDiscovery, final BeanManager bm) {
+    public void addHelper(final @Observes AfterBeanDiscovery afterBeanDiscovery, final BeanManager bm) {
         if (SKIP) {
             return;
         }
@@ -84,11 +85,11 @@ public class MakeJCacheCDIInterceptorFriendly implements Extension {
         afterBeanDiscovery.addBean(bean);
     }
 
-    protected void vetoScannedCDIJCacheHelperQualifiers(final @Observes ProcessAnnotatedType<CDIJCacheHelper> pat) {
+    public void vetoScannedCDIJCacheHelperQualifiers(final @Observes ProcessAnnotatedType<CDIJCacheHelper> pat) {
         if (SKIP) {
             return;
         }
-        if (!needHelper) { // already seen, shouldn't really happen,just a protection
+        if (!needHelper && !ProcessSyntheticAnnotatedType.class.isInstance(pat)) { // already seen, shouldn't really happen,just a protection
             pat.veto();
         }
         needHelper = false;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.