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 2015/04/23 13:50:39 UTC
[jira] [Commented] (LANG-1118) StringUtils.repeat('z', -1) throws
NegativeArraySizeException
[ https://issues.apache.org/jira/browse/LANG-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14508908#comment-14508908 ]
ASF GitHub Bot commented on LANG-1118:
--------------------------------------
GitHub user rikles opened a pull request:
https://github.com/apache/commons-lang/pull/68
LANG-1118 Fix StringUtils.repeat(char, int)
Now doing what is said in JavaDoc comment :
when passing a negative repeat value to the StringUtils.repeat(char, int) function, it returns an empty String instead of throwing a NegativeArraySizeException.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/rikles/commons-lang fix-LANG-1118
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/commons-lang/pull/68.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #68
----
commit daa95a18a153190ec9928dc19f3e9c0433954ee9
Author: Loic Guibert <lf...@yahoo.fr>
Date: 2015-04-23T11:41:51Z
LANG-1118 Fix StringUtils.repeat(char, int) dealing with negative repeat value
commit b3a36ae0fa0fc2a892f04ac53b1100ff7c5e9f4c
Author: Loic Guibert <lf...@yahoo.fr>
Date: 2015-04-23T11:43:21Z
LANG-1118 Adding a test case for StringUtils.repeat(String, int) checking dealing with negative repeat value
----
> StringUtils.repeat('z', -1) throws NegativeArraySizeException
> -------------------------------------------------------------
>
> Key: LANG-1118
> URL: https://issues.apache.org/jira/browse/LANG-1118
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.*
> Reporter: Loic Guibert
> Priority: Minor
>
> Unlike what is said in JavaDoc comment, when passing a negative repeat value to the *StringUtils.repeat(char, int)* function, it doesn't return an empty String but throws a _NegativeArraySizeException_.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)