[jboss-cvs] JBossAS SVN: r95286 - projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Oct 21 08:50:30 EDT 2009


Author: alesj
Date: 2009-10-21 08:50:30 -0400 (Wed, 21 Oct 2009)
New Revision: 95286

Modified:
   projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/GenericAnnotationResourceVisitor.java
Log:
Use annotations directly.

Modified: projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/GenericAnnotationResourceVisitor.java
===================================================================
--- projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/GenericAnnotationResourceVisitor.java	2009-10-21 12:50:17 UTC (rev 95285)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/GenericAnnotationResourceVisitor.java	2009-10-21 12:50:30 UTC (rev 95286)
@@ -33,7 +33,6 @@
 import org.jboss.logging.Logger;
 import org.jboss.metadata.spi.signature.Signature;
 import org.jboss.reflect.spi.AnnotatedInfo;
-import org.jboss.reflect.spi.AnnotationValue;
 import org.jboss.reflect.spi.ClassInfo;
 import org.jboss.reflect.spi.ConstructorInfo;
 import org.jboss.reflect.spi.MemberInfo;
@@ -162,7 +161,7 @@
       if (log.isTraceEnabled())
          log.trace("Scanning class " + className + " for annotations");
 
-      AnnotationValue[] annotations = classInfo.getAnnotations();
+      Annotation[] annotations = classInfo.getUnderlyingAnnotations();
       handleAnnotations(ElementType.TYPE, (Signature)null, annotations, className, commit);
 
       handleMembers(ElementType.CONSTRUCTOR, classInfo.getDeclaredConstructors(), className, commit);
@@ -204,13 +203,13 @@
             if (ainfo instanceof MemberInfo == false)
                throw new IllegalArgumentException("Can only handle member info: " + ainfo);
 
-            AnnotationValue[] annotations = ainfo.getAnnotations();
+            Annotation[] annotations = ainfo.getUnderlyingAnnotations();
             MemberInfo member = MemberInfo.class.cast(ainfo);
             handleAnnotations(type, member, annotations, className, commit);
             if (isParametrized(ainfo))
             {
-               AnnotationValue[][] paramAnnotations = getParameterAnnotations(member);
-               for (AnnotationValue[] paramAnnotation : paramAnnotations)
+               Annotation[][] paramAnnotations = getParameterAnnotations(member);
+               for (Annotation[] paramAnnotation : paramAnnotations)
                {
                   handleAnnotations(ElementType.PARAMETER, Signature.getSignature(member), paramAnnotation, className, commit);
                }
@@ -224,7 +223,7 @@
       return member instanceof MethodInfo || member instanceof ConstructorInfo;
    }
 
-   protected AnnotationValue[][] getParameterAnnotations(MemberInfo info)
+   protected Annotation[][] getParameterAnnotations(MemberInfo info)
    {
       ParameterInfo[] pinfos;
       if (info instanceof ConstructorInfo)
@@ -242,11 +241,11 @@
          throw new IllegalArgumentException("Cannot handle info: " + info);
       }
 
-      AnnotationValue[][] values = new AnnotationValue[pinfos.length][];
+      Annotation[][] values = new Annotation[pinfos.length][];
       for (int i = 0; i < pinfos.length; i++)
       {
          ParameterInfo pi = pinfos[i];
-         values[i] = pi.getAnnotations();
+         values[i] = pi.getUnderlyingAnnotations();
       }
       return values;
    }
@@ -261,7 +260,7 @@
     * @param commit      the commit list
     * @throws Exception for any annotations lookup problems
     */
-   protected static void handleAnnotations(ElementType type, MemberInfo member, AnnotationValue[] annotations, String className, List<CommitElement> commit) throws Exception
+   protected static void handleAnnotations(ElementType type, MemberInfo member, Annotation[] annotations, String className, List<CommitElement> commit) throws Exception
    {
       Signature signature = null;
       if (member != null)
@@ -279,13 +278,12 @@
     * @param className   the className
     * @param commit      the commit list
     */
-   protected static void handleAnnotations(ElementType type, Signature signature, AnnotationValue[] annotations, String className, List<CommitElement> commit)
+   protected static void handleAnnotations(ElementType type, Signature signature, Annotation[] annotations, String className, List<CommitElement> commit)
    {
       if (annotations != null && annotations.length > 0)
       {
-         for (AnnotationValue annotationValue : annotations)
+         for (Annotation annotation : annotations)
          {
-            Annotation annotation = annotationValue.getUnderlyingAnnotation();
             commit.add(new CommitElement(annotation, type, className, signature));
          }
       }




More information about the jboss-cvs-commits mailing list