[jboss-cvs] JBossAS SVN: r95336 - 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 16:00:55 EDT 2009
Author: alesj
Date: 2009-10-21 16:00:54 -0400 (Wed, 21 Oct 2009)
New Revision: 95336
Modified:
projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/GenericAnnotationResourceVisitor.java
Log:
Fix signature bug.
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 19:39:26 UTC (rev 95335)
+++ projects/mc-ann/trunk/core/src/main/java/org/jboss/mcann/repository/GenericAnnotationResourceVisitor.java 2009-10-21 20:00:54 UTC (rev 95336)
@@ -32,6 +32,8 @@
import org.jboss.classloading.spi.visitor.ResourceVisitor;
import org.jboss.logging.Logger;
import org.jboss.metadata.spi.signature.Signature;
+import org.jboss.metadata.spi.signature.ConstructorParametersSignature;
+import org.jboss.metadata.spi.signature.MethodParametersSignature;
import org.jboss.reflect.spi.AnnotatedInfo;
import org.jboss.reflect.spi.ClassInfo;
import org.jboss.reflect.spi.ConstructorInfo;
@@ -209,9 +211,10 @@
if (isParametrized(ainfo))
{
Annotation[][] paramAnnotations = getParameterAnnotations(member);
- for (Annotation[] paramAnnotation : paramAnnotations)
+ for (int index = 0; index < paramAnnotations.length; index++)
{
- handleAnnotations(ElementType.PARAMETER, Signature.getSignature(member), paramAnnotation, className, commit);
+ Signature signature = getParameterSignature(member, index);
+ handleAnnotations(ElementType.PARAMETER, signature, paramAnnotations[index], className, commit);
}
}
}
@@ -250,6 +253,24 @@
return values;
}
+ protected Signature getParameterSignature(MemberInfo info, int index)
+ {
+ if (info instanceof ConstructorInfo)
+ {
+ ConstructorInfo ci = ConstructorInfo.class.cast(info);
+ return new ConstructorParametersSignature(ci, index);
+ }
+ else if (info instanceof MethodInfo)
+ {
+ MethodInfo mi = MethodInfo.class.cast(info);
+ return new MethodParametersSignature(mi, index);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Cannot handle info: " + info);
+ }
+ }
+
/**
* Handle annotations.
*
More information about the jboss-cvs-commits
mailing list