[jboss-cvs] JBossAS SVN: r75220 - projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/jboss.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jun 30 10:59:18 EDT 2008


Author: emuckenhuber
Date: 2008-06-30 10:59:18 -0400 (Mon, 30 Jun 2008)
New Revision: 75220

Modified:
   projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/jboss/AbstractComponentProcessor.java
Log:
[JBMETA-20] consider all inherited metadata processors

Modified: projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/jboss/AbstractComponentProcessor.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/jboss/AbstractComponentProcessor.java	2008-06-30 14:49:56 UTC (rev 75219)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/jboss/AbstractComponentProcessor.java	2008-06-30 14:59:18 UTC (rev 75220)
@@ -81,7 +81,7 @@
    /** Map<Processor metdata type class, List<Processor for methods>> */
    protected Map<Class<?>, List<Processor<Object, Method>>> methodProcessors;
    /** */
-   protected Set<Class> boundedTypes = new HashSet<Class>();
+   protected Set<Class<?>> boundedTypes = new HashSet<Class<?>>();
 
    /**
     * @param finder
@@ -237,18 +237,16 @@
       if(trace)
          log.trace("Found "+processorCount+" processors for type: "+type);
       // See if metaData has a bounded type
-      type = type.getSuperclass();
-      while(boundedTypes.contains(type) == false && type != Object.class)
+      while(type != Object.class)
       {
          type = type.getSuperclass();
+         if(boundedTypes.contains(type))
+         {
+            if(trace)
+               log.trace("Reprocessing class using bounded processor type: "+type);
+            processClass(metaData, cls, type);            
+         }
       }
-      // 
-      if(type != Object.class)
-      {
-         if(trace)
-            log.trace("Reprocessing class using bounded processor type: "+type);
-         processClass(metaData, cls, type);
-      }
       // Also process the interfaces of the metadata class
       for(Class<?> iface : metaData.getClass().getInterfaces())
       {
@@ -368,15 +366,18 @@
       // Get the type of the T parameter
       ParameterizedType pt = (ParameterizedType) processorType;
       Type t0 = pt.getActualTypeArguments()[0];
-      Class t = null;
+      Class<?> t = null;
       if(t0 instanceof Class)
-         t = (Class) t0;
+         t = (Class<?>) t0;
       else if(t0 instanceof TypeVariable)
       {
          TypeVariable tv = (TypeVariable) t0;
-         t = (Class)tv.getBounds()[0];
+         t = (Class<?>)tv.getBounds()[0];
+      }
+      // Add processor to boundedTypes
+      if(! boundedTypes.contains(t))
          boundedTypes.add(t);
-      }
+      
       return t;
    }
 




More information about the jboss-cvs-commits mailing list