deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject git commit: DELTASPIKE-609 fixed @Transactional lookup for methods in super-class(es)
Date Mon, 26 May 2014 13:16:44 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master e75e2a5e9 -> d7e82d9d5


DELTASPIKE-609 fixed @Transactional lookup for methods in super-class(es)


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/d7e82d9d
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/d7e82d9d
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/d7e82d9d

Branch: refs/heads/master
Commit: d7e82d9d58009f7933cb9a3248b10c0b97b6a790
Parents: e75e2a5
Author: gpetracek <gpetracek@apache.org>
Authored: Mon May 26 15:12:49 2014 +0200
Committer: gpetracek <gpetracek@apache.org>
Committed: Mon May 26 15:13:36 2014 +0200

----------------------------------------------------------------------
 .../java/org/apache/deltaspike/core/util/AnnotationUtils.java  | 6 +++---
 .../jpa/impl/transaction/TransactionStrategyHelper.java        | 4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/d7e82d9d/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/AnnotationUtils.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/AnnotationUtils.java
b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/AnnotationUtils.java
index 49267a7..9d4c8e2 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/AnnotationUtils.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/AnnotationUtils.java
@@ -33,17 +33,17 @@ public abstract class AnnotationUtils
     }
 
     public static <T extends Annotation> T extractAnnotationFromMethodOrClass(
-        BeanManager beanManager, Method targetMethod, Class<T> targetAnnotationType)
+        BeanManager beanManager, Method targetMethod, Class targetClass, Class<T> targetAnnotationType)
     {
         T result = extractAnnotationFromMethod(beanManager, targetMethod, targetAnnotationType);
 
         if (result == null)
         {
             //see DELTASPIKE-517
-            Class targetClass = ProxyUtils.getUnproxiedClass(targetMethod.getDeclaringClass());
+            Class unproxiedTargetClass = ProxyUtils.getUnproxiedClass(targetClass);
 
             // and if not found search on the class
-            result = findAnnotation(beanManager, targetClass.getAnnotations(), targetAnnotationType);
+            result = findAnnotation(beanManager, unproxiedTargetClass.getAnnotations(), targetAnnotationType);
         }
         return result;
     }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/d7e82d9d/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/TransactionStrategyHelper.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/TransactionStrategyHelper.java
b/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/TransactionStrategyHelper.java
index c6ec253..064707c 100644
--- a/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/TransactionStrategyHelper.java
+++ b/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/TransactionStrategyHelper.java
@@ -154,7 +154,9 @@ public class TransactionStrategyHelper implements Serializable
      */
     protected Transactional extractTransactionalAnnotation(InvocationContext context)
     {
+        Class targetClass = context.getTarget() != null ? context.getTarget().getClass()
:
+            context.getMethod().getDeclaringClass();
         return AnnotationUtils
-            .extractAnnotationFromMethodOrClass(this.beanManager, context.getMethod(), Transactional.class);
+            .extractAnnotationFromMethodOrClass(beanManager, context.getMethod(), targetClass,
Transactional.class);
     }
 }


Mime
View raw message