[ 
https://issues.apache.org/jira/browse/LANG-1828?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary D. Gregory updated LANG-1828:
----------------------------------
    Priority: Major  (was: Critical)

> StringUtils.rightPad() throws OutOfMemoryError when size is Integer.MIN_VALUE
> -----------------------------------------------------------------------------
>
>                 Key: LANG-1828
>                 URL: https://issues.apache.org/jira/browse/LANG-1828
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: Discussion
>            Reporter: Weijun Liu
>            Priority: Major
>
> StringUtils.rightPad(String str, int size, String padStr) throws 
> OutOfMemoryError instead of returning the original string when size is 
> Integer.MIN_VALUE.
>   Per the API contract, a negative size should return the original string:
>   ▎ StringUtils.rightPad("bat", -1, "yz") = "bat"
>   However, Integer.MIN_VALUE (-2147483648) is a negative value that violates 
> this contract due to an integer overflow.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to