[jboss-cvs] JBossAS SVN: r95128 - projects/annotations/branches/AnnEnv/core/src/main/java/org/jboss/papaki/repository/plugins.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Oct 19 12:26:05 EDT 2009


Author: alesj
Date: 2009-10-19 12:26:05 -0400 (Mon, 19 Oct 2009)
New Revision: 95128

Modified:
   projects/annotations/branches/AnnEnv/core/src/main/java/org/jboss/papaki/repository/plugins/GenericAnnotationResourceVisitor.java
Log:
Check null before.

Modified: projects/annotations/branches/AnnEnv/core/src/main/java/org/jboss/papaki/repository/plugins/GenericAnnotationResourceVisitor.java
===================================================================
--- projects/annotations/branches/AnnEnv/core/src/main/java/org/jboss/papaki/repository/plugins/GenericAnnotationResourceVisitor.java	2009-10-19 16:25:17 UTC (rev 95127)
+++ projects/annotations/branches/AnnEnv/core/src/main/java/org/jboss/papaki/repository/plugins/GenericAnnotationResourceVisitor.java	2009-10-19 16:26:05 UTC (rev 95128)
@@ -125,16 +125,16 @@
    /**
     * Handle class adapter for annotations.
     *
-    * @param ctClass the class adapter instance
+    * @param classAdapter the class adapter instance
     * @param commit  the commit list
     * @throws Exception      for any annotations lookup problems
     */
-   protected void handleClass(ClassAdapter ctClass, List<CommitElement> commit) throws Exception
+   protected void handleClass(ClassAdapter classAdapter, List<CommitElement> commit) throws Exception
    {
-      if (isRelevant(ctClass) == false)
+      if (classAdapter == null || isRelevant(classAdapter) == false)
          return;
 
-      String className = ctClass.getName();
+      String className = classAdapter.getName();
       if (repository.isAlreadyChecked(className))
       {
          if (log.isTraceEnabled())
@@ -142,7 +142,7 @@
          return;
       }
 
-      if (checkInterfaces == false && ctClass.isInterface())
+      if (checkInterfaces == false && classAdapter.isInterface())
       {
          if (log.isTraceEnabled())
             log.trace("Skipping interface: " + className);
@@ -152,19 +152,19 @@
       if (log.isTraceEnabled())
          log.trace("Scanning class " + className + " for annotations");
 
-      Object[] annotations = forceAnnotations ? ctClass.getAnnotations() : ctClass.getAvailableAnnotations();
+      Object[] annotations = forceAnnotations ? classAdapter.getAnnotations() : classAdapter.getAvailableAnnotations();
       handleAnnotations(ElementType.TYPE, (Signature)null, annotations, className, commit);
 
-      handleMembers(ElementType.CONSTRUCTOR, ctClass.getDeclaredConstructors(), className, commit);
-      handleMembers(ElementType.METHOD, ctClass.getDeclaredMethods(), className, commit);
-      handleMembers(ElementType.FIELD, ctClass.getDeclaredFields(), className, commit);
+      handleMembers(ElementType.CONSTRUCTOR, classAdapter.getDeclaredConstructors(), className, commit);
+      handleMembers(ElementType.METHOD, classAdapter.getDeclaredMethods(), className, commit);
+      handleMembers(ElementType.FIELD, classAdapter.getDeclaredFields(), className, commit);
 
       if (checkSuper)
       {
          if (checkInterfaces)
          {
             // interfaces
-            ClassAdapter[] interfaces = ctClass.getInterfaces();
+            ClassAdapter[] interfaces = classAdapter.getInterfaces();
             if (interfaces != null && interfaces.length > 0)
             {
                for (ClassAdapter intf : interfaces)
@@ -172,7 +172,7 @@
             }
          }
          // super class
-         handleClass(ctClass.getSuperclass(), commit);
+         handleClass(classAdapter.getSuperclass(), commit);
       }
    }
 




More information about the jboss-cvs-commits mailing list