Author: chris.laprun(a)jboss.com
Date: 2007-02-26 12:41:06 -0500 (Mon, 26 Feb 2007)
New Revision: 6407
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java
Log:
Property descriptions are optional in ModelDescription so descs could be null.
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java 2007-02-26
16:27:46 UTC (rev 6406)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java 2007-02-26
17:41:06 UTC (rev 6407)
@@ -27,7 +27,6 @@
import org.jboss.portal.WindowState;
import org.jboss.portal.common.util.LocaleInfo;
import org.jboss.portal.common.util.ParameterValidation;
-import org.jboss.portal.common.value.Value;
import org.jboss.portal.portlet.info.CacheInfo;
import org.jboss.portal.portlet.info.CapabilitiesInfo;
import org.jboss.portal.portlet.info.MetaInfo;
@@ -136,14 +135,21 @@
if (modelDesc != null)
{
PropertyDescription[] descs = modelDesc.getPropertyDescriptions();
- prefInfos = new HashMap(descs.length);
- for (int i = 0; i < descs.length; i++)
+ if (descs != null)
{
- PropertyDescription desc = descs[i];
- String key = desc.getName();
- prefInfos.put(key, new WSRPPreferenceInfo(key,
createPortalLocalizedStringFrom(desc.getLabel()),
- createPortalLocalizedStringFrom(desc.getHint())));
+ prefInfos = new HashMap(descs.length);
+ for (int i = 0; i < descs.length; i++)
+ {
+ PropertyDescription desc = descs[i];
+ String key = desc.getName();
+ prefInfos.put(key, new WSRPPreferenceInfo(key,
createPortalLocalizedStringFrom(desc.getLabel()),
+ createPortalLocalizedStringFrom(desc.getHint())));
+ }
}
+ else
+ {
+ prefInfos = Collections.EMPTY_MAP;
+ }
}
else
{