Repository: deltaspike
Updated Branches:
  refs/heads/master 750063112 -> 0752f78aa


DELTASPIKE-878 support literal instances in AnnotationUtils


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

Branch: refs/heads/master
Commit: aaa5526976b35661e807c3e9465f500cf5b19543
Parents: 7500631
Author: gpetracek <[email protected]>
Authored: Tue Apr 21 22:49:29 2015 +0200
Committer: gpetracek <[email protected]>
Committed: Tue Apr 21 22:49:29 2015 +0200

----------------------------------------------------------------------
 .../org/apache/deltaspike/core/util/AnnotationUtils.java    | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/aaa55269/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 d59a743..e619649 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
@@ -93,11 +93,14 @@ public abstract class AnnotationUtils
                 continue;
             }
 
-            final Object annotationMemberValue;
-            annotationMemberValue = ReflectionUtils.invokeMethod(annotation, 
member, Object.class, true);
+            final Object annotationMemberValue = 
ReflectionUtils.invokeMethod(annotation, member, Object.class, true);
 
             final int arrayValue;
-            if (annotationMemberValue.getClass().isArray())
+            if (annotationMemberValue == null /*possible with literals*/)
+            {
+                arrayValue = 0;
+            }
+            else if (annotationMemberValue.getClass().isArray())
             {
                 Class<?> annotationMemberType = 
annotationMemberValue.getClass().getComponentType();
                 if (annotationMemberType.isPrimitive())

Reply via email to