[jboss-cvs] JBossAS SVN: r72896 - projects/jboss-deployers/trunk/deployers-impl/src/main/org/jboss/deployers/plugins/annotations.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Apr 30 08:22:50 EDT 2008


Author: alesj
Date: 2008-04-30 08:22:50 -0400 (Wed, 30 Apr 2008)
New Revision: 72896

Modified:
   projects/jboss-deployers/trunk/deployers-impl/src/main/org/jboss/deployers/plugins/annotations/DefaultAnnotationEnvironment.java
Log:
Check for empty.

Modified: projects/jboss-deployers/trunk/deployers-impl/src/main/org/jboss/deployers/plugins/annotations/DefaultAnnotationEnvironment.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/main/org/jboss/deployers/plugins/annotations/DefaultAnnotationEnvironment.java	2008-04-30 11:55:01 UTC (rev 72895)
+++ projects/jboss-deployers/trunk/deployers-impl/src/main/org/jboss/deployers/plugins/annotations/DefaultAnnotationEnvironment.java	2008-04-30 12:22:50 UTC (rev 72896)
@@ -104,6 +104,9 @@
     */
    protected Set<Class<?>> transformToClasses(Set<ClassSignaturePair> pairs)
    {
+      if (pairs.isEmpty())
+         return Collections.emptySet();
+
       Set<Class<?>> classes = new HashSet<Class<?>>(pairs.size());
       for (ClassSignaturePair pair : pairs)
          classes.add(loadClass(pair.getClassName()));
@@ -124,8 +127,11 @@
          Class<M> expectedAccessibleObjectClass
    )
    {
+      Set<ClassSignaturePair> pairs = getCSPairs(annClass, type);
+      if (pairs.isEmpty())
+         return Collections.emptySet();
+
       ClassLoader classLoader = getClassLoader();
-      Set<ClassSignaturePair> pairs = getCSPairs(annClass, type);
       Set<Element<A, M>> elements = new HashSet<Element<A, M>>();
       for (ClassSignaturePair pair : pairs)
          elements.add(toElement(classLoader, pair, annClass, expectedAccessibleObjectClass));




More information about the jboss-cvs-commits mailing list