You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/10/28 20:31:00 UTC

[jira] [Work logged] (LANG-1610) StringUtils.unwrap throws StringIndexOutOfBoundsException

     [ https://issues.apache.org/jira/browse/LANG-1610?focusedWorklogId=505900&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-505900 ]

ASF GitHub Bot logged work on LANG-1610:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 28/Oct/20 20:30
            Start Date: 28/Oct/20 20:30
    Worklog Time Spent: 10m 
      Work Description: liangshuche opened a new pull request #636:
URL: https://github.com/apache/commons-lang/pull/636


   When wrapToken.length() * 2 is larger than str.length(), and str starts with and ends with wrapToken, the function calls str.substring(beginIndex, endIndex) with beginIndex larger than endIndex, which throws a StringIndexOutOfBoundsException.
   
   It should return the original string since it is not quoted properly with the wrapToken according to documentation.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 505900)
    Remaining Estimate: 0h
            Time Spent: 10m

> StringUtils.unwrap throws StringIndexOutOfBoundsException
> ---------------------------------------------------------
>
>                 Key: LANG-1610
>                 URL: https://issues.apache.org/jira/browse/LANG-1610
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>            Reporter: Tony Liang
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Calling
> {{StringUtils.unwrap("ababa", "aba");}}
> throws java.lang.StringIndexOutOfBoundsException: String index out of range: -1



--
This message was sent by Atlassian Jira
(v8.3.4#803005)