[weld-commits] Weld SVN: r4786 - api/trunk/cdi/src/main/java/javax/enterprise/util.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Sun Nov 8 13:51:48 EST 2009


Author: gavin.king at jboss.com
Date: 2009-11-08 13:51:48 -0500 (Sun, 08 Nov 2009)
New Revision: 4786

Modified:
   api/trunk/cdi/src/main/java/javax/enterprise/util/AnnotationLiteral.java
   api/trunk/cdi/src/main/java/javax/enterprise/util/TypeLiteral.java
Log:
put the check back in, but only for annotation types with members

Modified: api/trunk/cdi/src/main/java/javax/enterprise/util/AnnotationLiteral.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/util/AnnotationLiteral.java	2009-11-08 17:22:25 UTC (rev 4785)
+++ api/trunk/cdi/src/main/java/javax/enterprise/util/AnnotationLiteral.java	2009-11-08 18:51:48 UTC (rev 4786)
@@ -64,6 +64,10 @@
    {
       if (members==null) {
          members = annotationType().getDeclaredMethods();
+         if ( members.length>0 && !annotationType().isAssignableFrom(this.getClass()) )
+         {
+            throw new RuntimeException(getClass() + " does not implement the annotation type with members " + annotationType().getName());
+         }
       }
       return members;
    }
@@ -113,7 +117,7 @@
          annotationType = getTypeParameter(annotationLiteralSubclass);
          if (annotationType == null)
          {
-            throw new RuntimeException(getClass() + " is missing type parameter in AnnotationLiteral");
+            throw new RuntimeException(getClass() + " does not specify the type parameter T of AnnotationLiteral<T>");
          }
       }
       return annotationType;

Modified: api/trunk/cdi/src/main/java/javax/enterprise/util/TypeLiteral.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/util/TypeLiteral.java	2009-11-08 17:22:25 UTC (rev 4785)
+++ api/trunk/cdi/src/main/java/javax/enterprise/util/TypeLiteral.java	2009-11-08 18:51:48 UTC (rev 4786)
@@ -64,7 +64,7 @@
          actualType = getTypeParameter(typeLiteralSubclass);
          if (actualType == null)
          {
-            throw new RuntimeException(getClass() + " is missing type parameter in TypeLiteral");
+            throw new RuntimeException(getClass() + " does not specify the type parameter T of TypeLiteral<T>");
          }
       }
       return actualType;



More information about the weld-commits mailing list