Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E9F88200C48 for ; Thu, 6 Apr 2017 21:07:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E8654160B91; Thu, 6 Apr 2017 19:07:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3BCF6160B81 for ; Thu, 6 Apr 2017 21:07:45 +0200 (CEST) Received: (qmail 98440 invoked by uid 500); 6 Apr 2017 19:07:44 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 98420 invoked by uid 99); 6 Apr 2017 19:07:44 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Apr 2017 19:07:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id A3323189F88 for ; Thu, 6 Apr 2017 19:07:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.918 X-Spam-Level: X-Spam-Status: No, score=0.918 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_FAIL=0.919] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id C7nvegAabn3i for ; Thu, 6 Apr 2017 19:07:42 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 3FDA85FC8E for ; Thu, 6 Apr 2017 19:07:42 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id C6B41E0185 for ; Thu, 6 Apr 2017 19:07:41 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 817F124065 for ; Thu, 6 Apr 2017 19:07:41 +0000 (UTC) Date: Thu, 6 Apr 2017 19:07:41 +0000 (UTC) From: "Bill Lucy (JIRA)" To: dev@myfaces.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MYFACES-4107) StringIndexOutOfBoundsException in getResourceVersion MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 06 Apr 2017 19:07:46 -0000 [ https://issues.apache.org/jira/browse/MYFACES-4107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15959547#comment-15959547 ] Bill Lucy commented on MYFACES-4107: ------------------------------------ If no one has any issues with the patch, I'll commit it tomorrow. > StringIndexOutOfBoundsException in getResourceVersion > ----------------------------------------------------- > > Key: MYFACES-4107 > URL: https://issues.apache.org/jira/browse/MYFACES-4107 > Project: MyFaces Core > Issue Type: Bug > Affects Versions: 2.0.24, 2.1.18, 2.2.12 > 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: > > javax.faces.WEBAPP_RESOURCES_DIRECTORY > /META-INF/resources > > throws: > java.lang.StringIndexOutOfBoundsException: String index out of range: 35 > at java.lang.String.substring(String.java:1377) > at org.apache.myfaces.shared.resource.ExternalContextResourceLoader.getResourceVersion(ExternalContextResourceLoader.java:81) > 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 (v6.3.15#6346)