Author: apetrelli
Date: Tue Aug  1 04:39:34 2006
New Revision: 427541

URL: http://svn.apache.org/viewvc?rev=427541&view=rev
Log:
Corrected the way instances of ComponentDefinitions are got from the attribute 
value

Modified:
    
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/ComponentDefinitionsImpl.java

Modified: 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/ComponentDefinitionsImpl.java
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/ComponentDefinitionsImpl.java?rev=427541&r1=427540&r2=427541&view=diff
==============================================================================
--- 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/ComponentDefinitionsImpl.java
 (original)
+++ 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/ComponentDefinitionsImpl.java
 Tue Aug  1 04:39:34 2006
@@ -216,12 +216,12 @@
      */
     private ComponentDefinition getDefinitionByAttribute(
             ComponentAttribute attr) {
-        ComponentDefinition retValue;
+        ComponentDefinition retValue = null;
         
         Object attrValue = attr.getValue();
         if (attrValue instanceof ComponentDefinition) {
             retValue = (ComponentDefinition) attrValue;
-        } else { // It must be a string
+        } else if (attrValue instanceof String) {
             retValue = this.getDefinition((String) attr
                     .getValue());
         }
@@ -239,12 +239,12 @@
      */
     private ComponentDefinition getDefinitionByAttribute(
             ComponentAttribute attr, Locale locale) {
-        ComponentDefinition retValue;
+        ComponentDefinition retValue = null;
         
         Object attrValue = attr.getValue();
         if (attrValue instanceof ComponentDefinition) {
             retValue = (ComponentDefinition) attrValue;
-        } else { // It must be a string
+        } else if (attrValue instanceof String) {
             retValue = this.getDefinition((String) attr
                     .getValue(), locale);
         }


Reply via email to