[Jboss-cvs] JBossAS SVN: r56344 - projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Aug 28 10:49:04 EDT 2006


Author: alesj
Date: 2006-08-28 10:48:57 -0400 (Mon, 28 Aug 2006)
New Revision: 56344

Modified:
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/AbstractTypeMetaData.java
Log:
Small fix - try/catch inside if.

Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/AbstractTypeMetaData.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/AbstractTypeMetaData.java	2006-08-28 14:41:53 UTC (rev 56343)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/AbstractTypeMetaData.java	2006-08-28 14:48:57 UTC (rev 56344)
@@ -35,25 +35,35 @@
 
 /**
  * A typed value.
- * 
+ *
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
 public abstract class AbstractTypeMetaData extends AbstractValueMetaData
 {
-   /** The type */
+   /**
+    * The type
+    */
    protected String type;
 
-   /** The configurator */
+   /**
+    * The configurator
+    */
    protected KernelController controller;
 
-   /** The configurator */
+   /**
+    * The configurator
+    */
    protected KernelConfigurator configurator;
 
-   /** The property name */
+   /**
+    * The property name
+    */
    protected String propertyName;
 
-   /** The bean name */
+   /**
+    * The bean name
+    */
    protected String beanName;
 
    /**
@@ -65,7 +75,7 @@
 
    /**
     * Create a new typed value
-    * 
+    *
     * @param value the value
     */
    public AbstractTypeMetaData(String value)
@@ -75,7 +85,7 @@
 
    /**
     * Set the type
-    * 
+    *
     * @param type the type
     */
    public void setType(String type)
@@ -121,9 +131,9 @@
 
    protected Object preinstantiatedLookup(ClassLoader cl, Class expected)
    {
-      try
+      if (propertyName != null && beanName != null)
       {
-         if (propertyName != null && beanName != null)
+         try
          {
             KernelControllerContext context = (KernelControllerContext) controller.getContext(beanName, ControllerState.INSTANTIATED);
             TargettedJoinpoint joinpoint = configurator.getPropertyGetterJoinPoint(context.getBeanInfo(), propertyName);
@@ -133,17 +143,17 @@
                throw new ClassCastException(result.getClass() + " is not a " + expected.getName());
             return result;
          }
+         catch (Throwable t)
+         {
+            log.warn("Exception in preinstantiated lookup: " + t, t);
+         }
       }
-      catch (Throwable t)
-      {
-         log.warn("Exception in preinstantiated lookup: " + t, t);
-      }
       return null;
    }
 
    /**
     * Set the configurator
-    * 
+    *
     * @param configurator the configurator
     */
    public void setConfigurator(KernelConfigurator configurator)
@@ -160,7 +170,7 @@
 
    /**
     * Get the class info for this type
-    * 
+    *
     * @param cl classloader
     * @return the class info
     * @throws Throwable for any error




More information about the jboss-cvs-commits mailing list