ICEfaces
  1. ICEfaces
  2. ICE-5795

PorltetEnvironmentRequestRequest should cast portal properties to a List interface rather than a LinkedList impl

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.2-EE-GA_P01
    • Fix Version/s: 1.8.2-EE-GA_P02
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Liferay 5.2.3, ICEfaces 1.8

      Description

      The PortletEnvironmentRenderRequest attempts to cast the list values of portal properties to a LinkedList. In WebSpace 10.0.7 (based on Liferay 5.2.3), the underlying implementation is actually an ArrayList, resulting in a ClassCastException. We should cast to a List interface instead of the LinkedList implementation.

      Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.LinkedList
      at com.icesoft.faces.webapp.http.portlet.PortletEnvironmentRenderRequest.getProperty(PortletEnvironmentRenderRequest.java:121)
      at ca.medavie.providerweb.idm.portlet.beans.AccountLoaderBean.init(AccountLoaderBean.java:50)
      ... 278 more


      PortletEnvironmentRenderRequest line 151:

          public String getProperty(String name) {
              if (properties.containsKey(name)) {
                  List values = (List) properties.get(name);
                  return (String) values.get(0);
              } else {
                  return null;
              }
          }

          public Enumeration getProperties(String name) {
              if (properties.containsKey(name)) {
                  List values = (List) properties.get(name);
                  return Collections.enumeration(values);
              } else {
                  return Collections.enumeration(Collections.EMPTY_LIST);
              }
          }

        Activity

        Hide
        Deryk Sinotte added a comment -

        Resolving. Applied recommended changes.

        Show
        Deryk Sinotte added a comment - Resolving. Applied recommended changes.

          People

          • Assignee:
            Deryk Sinotte
            Reporter:
            Philip Breau
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: