Author: woonsan
Date: Wed Aug 8 23:02:51 2007
New Revision: 564106
URL: http://svn.apache.org/viewvc?view=rev&rev=564106
Log:
PB-72: ClassCastException in PortletApplicationModelImpl since Spring Framework
2.0.5
Since Spring Framework 2.0.3, the value of PropertyValue from BeanDefinition is
changed from value object to TypedStringValue object.
The default implementation of BeanWrapper of Spring Framework uses
o.sf.factory.config.BeanDefinitionVisitor, which checks if the attribute value
is instance of TypedStringValue or instance of String.
Therefore, PortletApplicationModelImpl should use this same technique also.
Modified:
portals/bridges/trunk/frameworks/src/java/org/apache/portals/bridges/frameworks/spring/PortletApplicationModelImpl.java
Modified:
portals/bridges/trunk/frameworks/src/java/org/apache/portals/bridges/frameworks/spring/PortletApplicationModelImpl.java
URL:
http://svn.apache.org/viewvc/portals/bridges/trunk/frameworks/src/java/org/apache/portals/bridges/frameworks/spring/PortletApplicationModelImpl.java?view=diff&rev=564106&r1=564105&r2=564106
==============================================================================
---
portals/bridges/trunk/frameworks/src/java/org/apache/portals/bridges/frameworks/spring/PortletApplicationModelImpl.java
(original)
+++
portals/bridges/trunk/frameworks/src/java/org/apache/portals/bridges/frameworks/spring/PortletApplicationModelImpl.java
Wed Aug 8 23:02:51 2007
@@ -27,6 +27,7 @@
import org.springframework.beans.PropertyValue;
import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.config.TypedStringValue;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.FileSystemResource;
@@ -233,10 +234,19 @@
}
String lookup = null;
boolean requiresExternalSupport = false;
- PropertyValue value =
bd.getPropertyValues().getPropertyValue("lookupKey");
- if (value != null)
+ PropertyValue propValue =
bd.getPropertyValues().getPropertyValue("lookupKey");
+ if (propValue != null)
{
- lookup = (String)value.getValue();
+ Object value = propValue.getValue();
+
+ if (value instanceof TypedStringValue)
+ {
+ lookup = ((TypedStringValue) value).getValue();
+ }
+ else
+ {
+ lookup = (String) value;
+ }
}
if (bean instanceof ExternalComponentSupport)
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]