myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Lucy (JIRA)" <>
Subject [jira] [Created] (MYFACES-4107) StringIndexOutOfBoundsException in getResourceVersion
Date Wed, 05 Apr 2017 16:20:41 GMT
Bill Lucy created MYFACES-4107:

             Summary: StringIndexOutOfBoundsException in getResourceVersion
                 Key: MYFACES-4107
             Project: MyFaces Core
          Issue Type: Bug
    Affects Versions: 2.2.12, 2.1.18, 2.0.24
         Environment: WebSphere Liberty
            Reporter: Bill Lucy
            Assignee: Bill Lucy
            Priority: Minor
         Attachments: MYFACES-4107.patch

I've run into a case where, given an incorrect context parameter, a StringIndexOutOfBoundsException
is thrown.  This occurs in WebSphere Liberty because the server normalizes the external context
resource paths during app initialization.

For example, this parameter:



java.lang.StringIndexOutOfBoundsException: String index out of  range: 35
at java.lang.String.substring(
at org.apache.myfaces.shared.resource.ExternalContextResourceLoader.getResourceVersion(

That parameter value is not allowed to have a leading slash.  However, the current exception
is not very helpful, and can be easily avoided.  

I'll attach a patch which avoids the StringIndexOutOfBoundsException in getResourceVersion();
we already have this logic in getLibraryVersion().

This message was sent by Atlassian JIRA

View raw message