Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-26461

PortletSessionImpl.getAttributeMap throws a StringIndexOutOfBoundsException

    Details

      Description

      Calling PortletSessionImpl.getAttributeMap from my portlet throws a StringIndexOutOfBoundsException.

      Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -13
      	at java.lang.String.substring(String.java:1937)
      	at java.lang.String.substring(String.java:1904)
      	at com.liferay.portlet.PortletSessionImpl.getAttributeMap(PortletSessionImpl.java:129)
      	at nl.bct.kcs.portlet.jsf.LiferayJsfUtil.clearSession(LiferayJsfUtil.java:93)
      

      When debugging through the code, it seems that at line 129 in PortletSessionImpl a checks needs to be done before doing the actual substring, because the names of some values in the session are shorter than the lenght of the portletscope.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              michael.saechang Michael Saechang
              Reporter:
              jan.eerdekens@gmail.com Jan Eerdekens (Inactive)
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                8 years, 40 weeks, 6 days ago

                  Packages

                  Version Package
                  6.1.20 EE GA2
                  --Sprint 11/12
                  6.2.0 CE M2