[jboss-cvs] container/src/main/org/jboss/reflect/plugins/javassist ...

Kabir Khan kkhan at jboss.com
Fri Jul 14 06:52:17 EDT 2006


  User: kkhan   
  Date: 06/07/14 06:52:17

  Modified:    src/main/org/jboss/reflect/plugins/javassist 
                        JavassistTypeInfoFactoryImpl.java
  Log:
  Use AnnotationValueFactory
  
  Revision  Changes    Path
  1.9       +2 -28     container/src/main/org/jboss/reflect/plugins/javassist/JavassistTypeInfoFactoryImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: JavassistTypeInfoFactoryImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/container/src/main/org/jboss/reflect/plugins/javassist/JavassistTypeInfoFactoryImpl.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- JavassistTypeInfoFactoryImpl.java	4 Jul 2006 17:03:54 -0000	1.8
  +++ JavassistTypeInfoFactoryImpl.java	14 Jul 2006 10:52:17 -0000	1.9
  @@ -273,7 +273,7 @@
               return NO_ANNOTATIONS;
            }
   
  -         AnnotationValueImpl[] annotationValues = new AnnotationValueImpl[annotations.length];
  +         AnnotationValue[] annotationValues = new AnnotationValueImpl[annotations.length];
            for (int i = 0 ; i < annotations.length ; i++)
            {
               Class[] interfaces = annotations[i].getClass().getInterfaces();
  @@ -284,34 +284,8 @@
   
               Class clazz = interfaces[0];
               
  -            Method[] methods = clazz.getMethods();
  -          
  -            HashMap<String, Value> attributes = new HashMap<String, Value>();
  -          
  -            for (int j = 0 ; j < methods.length ; j++)
  -            {
  -               try
  -               {
  -                  if (methods[j].getDeclaringClass().equals(clazz))
  -                  {
  -                     Class typeClass = methods[j].getReturnType();
  -                     Object val = methods[j].invoke(annotations[i], new Object[0]);
  -   
  -                     TypeInfo typeInfo = getTypeInfo(typeClass);
  -   
  -                     Value value = AnnotationValueFactory.createValue(this, typeInfo, val);
  -                     
  -                     
  -                     attributes.put(methods[j].getName(), value);
  -                  }                  
  -               }
  -               catch (Throwable e)
  -               {
  -                  throw new RuntimeException(e);
  -               }
  -            }
               AnnotationInfo info = (AnnotationInfo)getTypeInfo(clazz);
  -            annotationValues[i] = new AnnotationValueImpl(info, attributes);
  +            annotationValues[i] = AnnotationValueFactory.createAnnotationValue(this, this, info, annotations[i]);
            }
            return annotationValues;
         }
  
  
  



More information about the jboss-cvs-commits mailing list