[jira] [Updated] (LANG-1013) Adding to StringUtils truncate method and test cases

2016-05-11 Thread Thiago Andrade (JIRA)

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

Thiago Andrade updated LANG-1013:
-
Description: 
Adding the following methods from StringUtils:

* {{public static String truncate(final String str, final int maxWidth)}}
* {{public static String truncate(final String str, int offset, final int 
maxWidth)}}

For example

{code:java}
StringUtils.truncate("abcdefg", 4) = "abcd"
StringUtils.truncate("abcdefg", 6) = "abcdef"
StringUtils.truncate("abcdefg", 7) = "abcdefg"
StringUtils.truncate("abcdefg", 8) = "abcdefg"

StringUtils.truncate("abcdefghijklmno", -1, 10) = "abcdefghij"
StringUtils.truncate("abcdefghijklmno", 0, 10) = "abcdefghij"
StringUtils.truncate("abcdefghijklmno", Integer.MIN_VALUE, 10) = "abcdefghij"
StringUtils.truncate("abcdefghijklmno", Integer.MIN_VALUE, Integer.MAX_VALUE) = 
"abcdefghijklmno"
StringUtils.truncate("abcdefghijklmno", 0, Integer.MAX_VALUE) = 
"abcdefghijklmno"
StringUtils.truncate("abcdefghijklmno", 1, 10) = "bcdefghijk"
StringUtils.truncate("abcdefghijklmno", 2, 10) = "cdefghijkl"
StringUtils.truncate("abcdefghijklmno", 3, 10) = "defghijklm"
StringUtils.truncate("abcdefghijklmno", 4, 10) = "efghijklmn"
StringUtils.truncate("abcdefghijklmno", 5, 10) = "fghijklmno"
StringUtils.truncate("abcdefghijklmno", 5, 5) = "fghij"
StringUtils.truncate("abcdefghijklmno", 5, 3) = "fgh"
StringUtils.truncate("abcdefghijklmno", 10, 3) = "klm"
StringUtils.truncate("abcdefghijklmno", 10, Integer.MAX_VALUE) = "klmno"
StringUtils.truncate("abcdefghijklmno", 13, 1) = "n"
StringUtils.truncate("abcdefghijklmno", 13, Integer.MAX_VALUE) = "no"
StringUtils.truncate("abcdefghijklmno", 14, 1) = "o"
StringUtils.truncate("abcdefghijklmno", 14, Integer.MAX_VALUE) = "o"
{code}

See: https://github.com/apache/commons-lang/pull/137

  was:
Adding the following methods from StringUtils:

* {{public static String truncate(final String str, final int maxWidth)}}
* {{public static String truncate(final String str, int offset, final int 
maxWidth)}}

For example

{code:java}
StringUtils.truncate("abcdefg", 4) = "abcd"
StringUtils.truncate("abcdefg", 6) = "abcdef"
StringUtils.truncate("abcdefg", 7) = "abcdefg"
StringUtils.truncate("abcdefg", 8) = "abcdefg"

StringUtils.truncate("abcdefghijklmno", -1, 10) = "abcdefghij"
StringUtils.truncate("abcdefghijklmno", 0, 10) = "abcdefghij"
StringUtils.truncate("abcdefghijklmno", Integer.MIN_VALUE, 10) = "abcdefghij"
StringUtils.truncate("abcdefghijklmno", Integer.MIN_VALUE, Integer.MAX_VALUE) = 
"abcdefghijklmno"
StringUtils.truncate("abcdefghijklmno", 0, Integer.MAX_VALUE) = 
"abcdefghijklmno"
StringUtils.truncate("abcdefghijklmno", 1, 10) = "bcdefghijk"
StringUtils.truncate("abcdefghijklmno", 2, 10) = "cdefghijkl"
StringUtils.truncate("abcdefghijklmno", 3, 10) = "defghijklm"
StringUtils.truncate("abcdefghijklmno", 4, 10) = "efghijklmn"
StringUtils.truncate("abcdefghijklmno", 5, 10) = "fghijklmno"
StringUtils.truncate("abcdefghijklmno", 5, 5) = "fghij"
StringUtils.truncate("abcdefghijklmno", 5, 3) = "fgh"
StringUtils.truncate("abcdefghijklmno", 10, 3) = "klm"
StringUtils.truncate("abcdefghijklmno", 10, Integer.MAX_VALUE) = "klmno"
StringUtils.truncate("abcdefghijklmno", 13, 1) = "n"
StringUtils.truncate("abcdefghijklmno", 13, Integer.MAX_VALUE) = "no"
StringUtils.truncate("abcdefghijklmno", 14, 1) = "o"
StringUtils.truncate("abcdefghijklmno", 14, Integer.MAX_VALUE) = "o"
{code}

See: https://github.com/apache/commons-lang/pull/24


> Adding to StringUtils truncate method and test cases
> 
>
> Key: LANG-1013
> URL: https://issues.apache.org/jira/browse/LANG-1013
> Project: Commons Lang
>  Issue Type: New Feature
>  Components: lang.*
>Reporter: Thiago Andrade
>Assignee: Benedikt Ritter
>  Labels: github
> Fix For: Review Patch
>
>
> Adding the following methods from StringUtils:
> * {{public static String truncate(final String str, final int maxWidth)}}
> * {{public static String truncate(final String str, int offset, final int 
> maxWidth)}}
> For example
> {code:java}
> StringUtils.truncate("abcdefg", 4) = "abcd"
> StringUtils.truncate("abcdefg", 6) = "abcdef"
> StringUtils.truncate("abcdefg", 7) = "abcdefg"
> StringUtils.truncate("abcdefg", 8) = "abcdefg"
> StringUtils.truncate("abcdefghijklmno", -1, 10) = "abcdefghij"
> StringUtils.truncate("abcdefghijklmno", 0, 10) = "abcdefghij"
> StringUtils.truncate("abcdefghijklmno", Integer.MIN_VALUE, 10) = "abcdefghij"
> StringUtils.truncate("abcdefghijklmno", Integer.MIN_VALUE, Integer.MAX_VALUE) 
> = "abcdefghijklmno"
> StringUtils.truncate("abcdefghijklmno", 0, Integer.MAX_VALUE) = 
> "abcdefghijklmno"
> StringUtils.truncate("abcdefghijklmno", 1, 10) = "bcdefghijk"
> StringUtils.truncate("abcdefghijklmno", 2, 10) = "cdefghijkl"
> 

[jira] [Updated] (LANG-1014) Adding unwrap and unwrapFull methods to StringUtils

2016-05-11 Thread Thiago Andrade (JIRA)

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

Thiago Andrade updated LANG-1014:
-
Description: 
Placeholder ticket for github PR 136: 
https://github.com/apache/commons-lang/pull/136

Adding the following methods from StringUtils:

{code:java}
public static String unwrap(String str, char unwrapChar)
public static String unwrapFull(String str, char unwrapChar)
public static String unwrap(String str, String unwrapStr)
public static String unwrapFull(String str, String unwrapStr)
public static String unwrap(String str, String unwrapLeft, String 
unwrapRight)
public static String unwrapFull(String str, String unwrapLeft, String 
unwrapRight)
{code}

These methods unwraps (fully or not) the string parameter. See pull request for 
usage examples.

  was:
Placeholder ticket for github PR 25: 
https://github.com/apache/commons-lang/pull/25

Adding the following methods from StringUtils:

{code:java}
public static String unwrap(String str, char unwrapChar)
public static String unwrapFull(String str, char unwrapChar)
public static String unwrap(String str, String unwrapStr)
public static String unwrapFull(String str, String unwrapStr)
public static String unwrap(String str, String unwrapLeft, String 
unwrapRight)
public static String unwrapFull(String str, String unwrapLeft, String 
unwrapRight)
{code}

These methods unwraps (fully or not) the string parameter. See pull request for 
usage examples.


> Adding unwrap and unwrapFull methods to StringUtils
> ---
>
> Key: LANG-1014
> URL: https://issues.apache.org/jira/browse/LANG-1014
> Project: Commons Lang
>  Issue Type: New Feature
>  Components: lang.*
>Reporter: Thiago Andrade
>Assignee: Benedikt Ritter
>  Labels: github
> Fix For: Review Patch, Discussion
>
>
> Placeholder ticket for github PR 136: 
> https://github.com/apache/commons-lang/pull/136
> Adding the following methods from StringUtils:
> {code:java}
> public static String unwrap(String str, char unwrapChar)
> public static String unwrapFull(String str, char unwrapChar)
> public static String unwrap(String str, String unwrapStr)
> public static String unwrapFull(String str, String unwrapStr)
> public static String unwrap(String str, String unwrapLeft, String 
> unwrapRight)
> public static String unwrapFull(String str, String unwrapLeft, String 
> unwrapRight)
> {code}
> These methods unwraps (fully or not) the string parameter. See pull request 
> for usage examples.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (LANG-1013) Adding to StringUtils truncate method and test cases

2014-11-17 Thread Thiago Andrade (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14214878#comment-14214878
 ] 

Thiago Andrade commented on LANG-1013:
--

I've fixed the code according to your recommendations.. you can see at 
https://github.com/apache/commons-lang/pull/24

 Adding to StringUtils truncate method and test cases
 

 Key: LANG-1013
 URL: https://issues.apache.org/jira/browse/LANG-1013
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*
Reporter: Thiago Andrade
Assignee: Benedikt Ritter
  Labels: github
 Fix For: Review Patch


 Adding the following methods from StringUtils:
 * {{public static String truncate(final String str, final int maxWidth)}}
 * {{public static String truncate(final String str, int offset, final int 
 maxWidth)}}
 For example
 {code:java}
 StringUtils.truncate(abcdefg, 4) = abcd
 StringUtils.truncate(abcdefg, 6) = abcdef
 StringUtils.truncate(abcdefg, 7) = abcdefg
 StringUtils.truncate(abcdefg, 8) = abcdefg
 StringUtils.truncate(abcdefghijklmno, -1, 10) = abcdefghij
 StringUtils.truncate(abcdefghijklmno, 0, 10) = abcdefghij
 StringUtils.truncate(abcdefghijklmno, Integer.MIN_VALUE, 10) = abcdefghij
 StringUtils.truncate(abcdefghijklmno, Integer.MIN_VALUE, Integer.MAX_VALUE) 
 = abcdefghijklmno
 StringUtils.truncate(abcdefghijklmno, 0, Integer.MAX_VALUE) = 
 abcdefghijklmno
 StringUtils.truncate(abcdefghijklmno, 1, 10) = bcdefghijk
 StringUtils.truncate(abcdefghijklmno, 2, 10) = cdefghijkl
 StringUtils.truncate(abcdefghijklmno, 3, 10) = defghijklm
 StringUtils.truncate(abcdefghijklmno, 4, 10) = efghijklmn
 StringUtils.truncate(abcdefghijklmno, 5, 10) = fghijklmno
 StringUtils.truncate(abcdefghijklmno, 5, 5) = fghij
 StringUtils.truncate(abcdefghijklmno, 5, 3) = fgh
 StringUtils.truncate(abcdefghijklmno, 10, 3) = klm
 StringUtils.truncate(abcdefghijklmno, 10, Integer.MAX_VALUE) = klmno
 StringUtils.truncate(abcdefghijklmno, 13, 1) = n
 StringUtils.truncate(abcdefghijklmno, 13, Integer.MAX_VALUE) = no
 StringUtils.truncate(abcdefghijklmno, 14, 1) = o
 StringUtils.truncate(abcdefghijklmno, 14, Integer.MAX_VALUE) = o
 {code}
 See: https://github.com/apache/commons-lang/pull/24



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (LANG-1014) Adding unwrap and unwrapFull methods to StringUtils

2014-10-15 Thread Thiago Andrade (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1014?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14172960#comment-14172960
 ] 

Thiago Andrade commented on LANG-1014:
--

Usage:


// public static String unwrap(String str, char unwrapChar)
StringUtils.unwrap(, '\0') = 
StringUtils.unwrap(xabx, 'x') = ab
StringUtils.unwrap(\ab\, '\') = ab
StringUtils.unwrap(\\ab\\, '\') = \ab\
StringUtils.unwrap('ab', '\'') = ab
StringUtils.unwrap(''ab'', '\'') = 'ab'
StringUtils.unwrap('''ab''', '\'') = ''ab''
StringUtils.unwrap('\abcd\', '\'') = \abcd\
StringUtils.unwrap('\abcd\', '\') = '\abcd\'

// public static String unwrapFull(String str, char unwrapChar)
StringUtils.unwrapFull(, '\0') = 
StringUtils.unwrapFull(xabx, 'x') = ab
StringUtils.unwrapFull(xxabxx, 'x') = ab
StringUtils.unwrapFull(\ab\, '\') = ab
StringUtils.unwrapFull(\\ab\\, '\') = ab
StringUtils.unwrapFull('ab', '\'') = ab
StringUtils.unwrapFull('x'ab'x', '\'') = x'ab'x
StringUtils.unwrapFull(''ab'', '\'') = ab
StringUtils.unwrapFull('ab', '\'') = ab
StringUtils.unwrapFull(x'ab', '\'') = x'ab'
StringUtils.unwrapFull('ab, '\'') = ab'''

// public static String unwrap(String str, String unwrapStr)
StringUtils.unwrap(xxabxx, xx) = ab
StringUtils.unwrap(ab, xx) = xxabxx
StringUtils.unwrap(xx xxabxx xx, xx) =  xxabxx 
StringUtils.unwrap(xxZxx, xx) = Z
StringUtils.unwrap(xxZxx, x) = xZx
StringUtils.unwrap(xzx xzx, xzx) =  
StringUtils.unwrap( , xx) = xx xx
StringUtils.unwrap('name', ') = name
StringUtils.unwrap(''name'', ') = 'name'
StringUtils.unwrap('''name''', ') = ''name''

// public static String unwrapFull(String str, String unwrapStr)
StringUtils.unwrapFull(xxabxx, x) = ab
StringUtils.unwrapFull(xx xxabxx xx, xx) =  ab 
StringUtils.unwrapFull(xxZxx, xx) = Z
StringUtils.unwrapFull(xzx xzx, xzx) =  
StringUtils.unwrapFull( , xx) =  
StringUtils.unwrapFull('name', ') = name
StringUtils.unwrapFull(''name'', ') = name
StringUtils.unwrapFull('''name''', ') = name

// public static String unwrap(String str, String unwrapLeft, String 
unwrapRight)
StringUtils.unwrap(xxabxx, x, x) = ab
StringUtils.unwrap(xx xxabxx xx, xx, xx) =  ab 
StringUtils.unwrap(xxZxx, xx, xx) = Z
StringUtils.unwrap(xxZxx, xx, yy) = xxZxx // no unwrap
StringUtils.unwrap(xzx xzx, xzx, xzx) =  
StringUtils.unwrap( , xx, xx) =  
StringUtils.unwrap( , xx, yy) =   // no unwrap
StringUtils.unwrap(xxoutputxx, x, x) = output
StringUtils.unwrap(%{name}, %{, }) = name
StringUtils.unwrap(%{ name}, %{, }) =  name
StringUtils.unwrap(%{ name }, %{, }) =  name 
StringUtils.unwrap( %{ name }, %{, }) =   name 
StringUtils.unwrap(%{'name'}, %{', '}) = name
StringUtils.unwrap(%{' name'}, %{', '}) =  name
StringUtils.unwrap(%{' name '}, %{', '}) =  name 
StringUtils.unwrap( %{' name '}, %{', '}) =   name 
StringUtils.unwrap(%{ 'name'}, %{', '}) = %{ 'name'} // no unwrap
StringUtils.unwrap(% {'name'}, %{', '}) = % {'name'} // no unwrap
StringUtils.unwrap(% { 'name'}, %{', '}) = % { 'name'} // no unwrap

// public static String unwrapFull(String str, String unwrapLeft, String 
unwrapRight)
StringUtils.unwrapFull(xxabxx, x, x) = ab
StringUtils.unwrapFull(xx xxabxx xx, xx, xx) =  ab 
StringUtils.unwrapFull(xxZxx, xx, xx) = Z
StringUtils.unwrapFull(xxZxx, xx, yy) = xxZxx // no unwrap
StringUtils.unwrapFull(xzx xzx, xzx, xzx) =  
StringUtils.unwrapFull( , xx, xx) =  
StringUtils.unwrapFull( , xx, yy) =   // no unwrap
StringUtils.unwrapFull(xxoutputxx, x, x) = 
output
StringUtils.unwrapFull(%{name}, %{, }) = name
StringUtils.unwrapFull(%{ name}, %{, }) =  name
StringUtils.unwrapFull(%{ name }, %{, }) =  name 
StringUtils.unwrapFull( %{ name }, %{, }) =   name 
StringUtils.unwrapFull(%{'name'}, %{', '}) = name
StringUtils.unwrapFull(%{' name'}, %{', '}) =  name
StringUtils.unwrapFull(%{' name '}, %{', '}) =  name 
StringUtils.unwrapFull( %{' name '}, %{', '}) =   name 
StringUtils.unwrapFull(%{ 'name'}, %{', '}) = %{ 'name'} // no unwrap
StringUtils.unwrapFull(% {'name'}, %{', '}) = % {'name'} // no unwrap
StringUtils.unwrapFull(% { 'name'}, %{', '}) = % { 'name'} // no unwrap


 Adding unwrap and unwrapFull methods to StringUtils
 ---

 Key: LANG-1014
 URL: https://issues.apache.org/jira/browse/LANG-1014
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*
Reporter: Thiago Andrade
Assignee: Benedikt Ritter
  Labels: github
 Fix For: Review Patch


 Placeholder ticket for github PR 25: 
 https://github.com/apache/commons-lang/pull/25
 Adding the following methods from StringUtils:
 {code:java}
 public static String unwrap(String str, char unwrapChar)
 public static String unwrapFull(String str, char unwrapChar)

[jira] [Updated] (LANG-1015) Adding the new JsonToStringStyle to ToStringStyle

2014-05-16 Thread Thiago Andrade (JIRA)

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

Thiago Andrade updated LANG-1015:
-

Description: Placeholder ticket for github PR 26: 
https://github.com/apache/commons-lang/pull/26  (was: Placeholder ticket for 
github PR 25: https://github.com/apache/commons-lang/pull/26)

 Adding the new JsonToStringStyle to ToStringStyle
 -

 Key: LANG-1015
 URL: https://issues.apache.org/jira/browse/LANG-1015
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*, lang.builder.*
Affects Versions: 4.0
Reporter: Thiago Andrade
Assignee: Benedikt Ritter
  Labels: github

 Placeholder ticket for github PR 26: 
 https://github.com/apache/commons-lang/pull/26



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Created] (LANG-1015) Adding the new JsonToStringStyle to ToStringStyle

2014-05-16 Thread Thiago Andrade (JIRA)
Thiago Andrade created LANG-1015:


 Summary: Adding the new JsonToStringStyle to ToStringStyle
 Key: LANG-1015
 URL: https://issues.apache.org/jira/browse/LANG-1015
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*
Affects Versions: 4.0
Reporter: Thiago Andrade
Assignee: Benedikt Ritter


Placeholder ticket for github PR 25: 
https://github.com/apache/commons-lang/pull/25



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (LANG-1015) Adding the new JsonToStringStyle to ToStringStyle

2014-05-16 Thread Thiago Andrade (JIRA)

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

Thiago Andrade updated LANG-1015:
-

Description: Placeholder ticket for github PR 25: 
https://github.com/apache/commons-lang/pull/26  (was: Placeholder ticket for 
github PR 25: https://github.com/apache/commons-lang/pull/25)

 Adding the new JsonToStringStyle to ToStringStyle
 -

 Key: LANG-1015
 URL: https://issues.apache.org/jira/browse/LANG-1015
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*
Affects Versions: 4.0
Reporter: Thiago Andrade
Assignee: Benedikt Ritter
  Labels: github

 Placeholder ticket for github PR 25: 
 https://github.com/apache/commons-lang/pull/26



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (LANG-1015) Adding the new JsonToStringStyle to ToStringStyle

2014-05-16 Thread Thiago Andrade (JIRA)

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

Thiago Andrade updated LANG-1015:
-

Component/s: lang.builder.*

 Adding the new JsonToStringStyle to ToStringStyle
 -

 Key: LANG-1015
 URL: https://issues.apache.org/jira/browse/LANG-1015
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*, lang.builder.*
Affects Versions: 4.0
Reporter: Thiago Andrade
Assignee: Benedikt Ritter
  Labels: github

 Placeholder ticket for github PR 25: 
 https://github.com/apache/commons-lang/pull/26



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Created] (LANG-1014) Adding unwrap and unwrapFull methods to StringUtils

2014-05-15 Thread Thiago Andrade (JIRA)
Thiago Andrade created LANG-1014:


 Summary: Adding unwrap and unwrapFull methods to StringUtils
 Key: LANG-1014
 URL: https://issues.apache.org/jira/browse/LANG-1014
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*
Affects Versions: 4.0
Reporter: Thiago Andrade
Assignee: Benedikt Ritter


Placeholder ticket for github PR 24: 
https://github.com/apache/commons-lang/pull/24



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (LANG-1014) Adding unwrap and unwrapFull methods to StringUtils

2014-05-15 Thread Thiago Andrade (JIRA)

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

Thiago Andrade updated LANG-1014:
-

Description: Placeholder ticket for github PR 25: 
https://github.com/apache/commons-lang/pull/25  (was: Placeholder ticket for 
github PR 24: https://github.com/apache/commons-lang/pull/24)

 Adding unwrap and unwrapFull methods to StringUtils
 ---

 Key: LANG-1014
 URL: https://issues.apache.org/jira/browse/LANG-1014
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*
Affects Versions: 4.0
Reporter: Thiago Andrade
Assignee: Benedikt Ritter
  Labels: github

 Placeholder ticket for github PR 25: 
 https://github.com/apache/commons-lang/pull/25



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Created] (LANG-1013) Adding to StringUtils truncate method and test cases

2014-05-13 Thread Thiago Andrade (JIRA)
Thiago Andrade created LANG-1013:


 Summary: Adding to StringUtils truncate method and test cases
 Key: LANG-1013
 URL: https://issues.apache.org/jira/browse/LANG-1013
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*, lang.math.*
Reporter: Thiago Andrade
Assignee: Benedikt Ritter
 Fix For: 3.4


Placeholder ticket for github PR 23: 
https://github.com/apache/commons-lang/pull/23



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (LANG-1013) Adding to StringUtils truncate method and test cases

2014-05-13 Thread Thiago Andrade (JIRA)

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

Thiago Andrade updated LANG-1013:
-

  Component/s: (was: lang.math.*)
  Description: Placeholder ticket for github PR 24: 
https://github.com/apache/commons-lang/pull/24  (was: Placeholder ticket for 
github PR 23: https://github.com/apache/commons-lang/pull/23)
Affects Version/s: 4.0
Fix Version/s: (was: 3.4)

 Adding to StringUtils truncate method and test cases
 

 Key: LANG-1013
 URL: https://issues.apache.org/jira/browse/LANG-1013
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*
Affects Versions: 4.0
Reporter: Thiago Andrade
Assignee: Benedikt Ritter
  Labels: github

 Placeholder ticket for github PR 24: 
 https://github.com/apache/commons-lang/pull/24



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (LANG-1008) Adding the maxVA and minVA methods to NumberUtils and test methods

2014-05-06 Thread Thiago Andrade (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13990605#comment-13990605
 ] 

Thiago Andrade commented on LANG-1008:
--

[~michael-o] i've just sent the e-mail. Please tell me whether you received

 Adding the maxVA and minVA methods to NumberUtils and test methods
 --

 Key: LANG-1008
 URL: https://issues.apache.org/jira/browse/LANG-1008
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*, lang.math.*
Reporter: Thiago Andrade
  Labels: github
 Fix For: Review Patch


 Placeholder ticket for github PR 23: 
 https://github.com/apache/commons-lang/pull/23



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Comment Edited] (LANG-1008) Adding the maxVA and minVA methods to NumberUtils and test methods

2014-05-06 Thread Thiago Andrade (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13990605#comment-13990605
 ] 

Thiago Andrade edited comment on LANG-1008 at 5/6/14 1:38 PM:
--

[~michael-o] i've just sent the e-mail. This one: 
http://mail-archives.apache.org/mod_mbox/commons-dev/201405.mbox/%3CCADe42VyEhtYo2uw9Q9s4OWXyTvMmZmrSDi-xjxiAa7xmdfhMbw%40mail.gmail.com%3E


was (Author: thiagoh1):
[~michael-o] i've just sent the e-mail. Please tell me whether you received

 Adding the maxVA and minVA methods to NumberUtils and test methods
 --

 Key: LANG-1008
 URL: https://issues.apache.org/jira/browse/LANG-1008
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*, lang.math.*
Reporter: Thiago Andrade
  Labels: github
 Fix For: Review Patch


 Placeholder ticket for github PR 23: 
 https://github.com/apache/commons-lang/pull/23



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (LANG-1008) Adding the maxVA and minVA methods to NumberUtils and test methods

2014-05-06 Thread Thiago Andrade (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13990810#comment-13990810
 ] 

Thiago Andrade commented on LANG-1008:
--

But this problem was found inside commons-lang..  isnt it more appropriate? 

 Adding the maxVA and minVA methods to NumberUtils and test methods
 --

 Key: LANG-1008
 URL: https://issues.apache.org/jira/browse/LANG-1008
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*, lang.math.*
Reporter: Thiago Andrade
  Labels: github
 Fix For: Review Patch


 Placeholder ticket for github PR 23: 
 https://github.com/apache/commons-lang/pull/23



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (LANG-1006) Add wrap (with String or char) to StringUtils. Fixing NumberUtils comments. Adding methods to NumberUtils

2014-05-05 Thread Thiago Andrade (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13989579#comment-13989579
 ] 

Thiago Andrade commented on LANG-1006:
--

I dont know how to split it. I'll google for it.. but since now i've removed 
other improvements and let {{StringUtils}} modifications.

 Add wrap (with String or char) to StringUtils. Fixing NumberUtils comments. 
 Adding methods to NumberUtils
 -

 Key: LANG-1006
 URL: https://issues.apache.org/jira/browse/LANG-1006
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*, lang.math.*
Reporter: Thiago Andrade
  Labels: github
 Fix For: Review Patch


 Placeholder ticket for github PR 21: 
 https://github.com/apache/commons-lang/pull/21



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Created] (LANG-1008) Adding maxVA and minVA methods to NumberUtils and test methods

2014-05-05 Thread Thiago Andrade (JIRA)
Thiago Andrade created LANG-1008:


 Summary: Adding maxVA and minVA methods to NumberUtils and test 
methods
 Key: LANG-1008
 URL: https://issues.apache.org/jira/browse/LANG-1008
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*, lang.math.*
Reporter: Thiago Andrade
 Fix For: Review Patch


Placeholder ticket for github PR 21: 
https://github.com/apache/commons-lang/pull/21



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Created] (LANG-1007) Fixing NumberUtils JAVADoc comments

2014-05-05 Thread Thiago Andrade (JIRA)
Thiago Andrade created LANG-1007:


 Summary: Fixing NumberUtils JAVADoc comments
 Key: LANG-1007
 URL: https://issues.apache.org/jira/browse/LANG-1007
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*, lang.math.*
Reporter: Thiago Andrade
 Fix For: Review Patch


Placeholder ticket for github PR 21: 
https://github.com/apache/commons-lang/pull/21



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (LANG-1006) Add wrap (with String or char) to StringUtils

2014-05-05 Thread Thiago Andrade (JIRA)

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

Thiago Andrade updated LANG-1006:
-

Summary: Add wrap (with String or char) to StringUtils  (was: Add wrap 
(with String or char) to StringUtils. Fixing NumberUtils comments. Adding 
methods to NumberUtils)

 Add wrap (with String or char) to StringUtils
 -

 Key: LANG-1006
 URL: https://issues.apache.org/jira/browse/LANG-1006
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*, lang.math.*
Reporter: Thiago Andrade
  Labels: github
 Fix For: Review Patch


 Placeholder ticket for github PR 21: 
 https://github.com/apache/commons-lang/pull/21



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (LANG-1007) Fixing NumberUtils JAVADoc comments

2014-05-05 Thread Thiago Andrade (JIRA)

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

Thiago Andrade updated LANG-1007:
-

Description: Placeholder ticket for github PR 22: 
https://github.com/apache/commons-lang/pull/22  (was: Placeholder ticket for 
github PR 21: https://github.com/apache/commons-lang/pull/21)

 Fixing NumberUtils JAVADoc comments
 ---

 Key: LANG-1007
 URL: https://issues.apache.org/jira/browse/LANG-1007
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*, lang.math.*
Reporter: Thiago Andrade
  Labels: github
 Fix For: Review Patch


 Placeholder ticket for github PR 22: 
 https://github.com/apache/commons-lang/pull/22



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (LANG-1008) Adding maxVA and minVA methods to NumberUtils and test methods

2014-05-05 Thread Thiago Andrade (JIRA)

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

Thiago Andrade updated LANG-1008:
-

Description: Placeholder ticket for github PR 23: 
https://github.com/apache/commons-lang/pull/23  (was: Placeholder ticket for 
github PR 21: https://github.com/apache/commons-lang/pull/21)

 Adding maxVA and minVA methods to NumberUtils and test methods
 --

 Key: LANG-1008
 URL: https://issues.apache.org/jira/browse/LANG-1008
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*, lang.math.*
Reporter: Thiago Andrade
  Labels: github
 Fix For: Review Patch


 Placeholder ticket for github PR 23: 
 https://github.com/apache/commons-lang/pull/23



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (LANG-1007) Fixing NumberUtils JAVADoc comments for max methods

2014-05-05 Thread Thiago Andrade (JIRA)

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

Thiago Andrade updated LANG-1007:
-

Summary: Fixing NumberUtils JAVADoc comments for max methods  (was: Fixing 
NumberUtils JAVADoc comments)

 Fixing NumberUtils JAVADoc comments for max methods
 ---

 Key: LANG-1007
 URL: https://issues.apache.org/jira/browse/LANG-1007
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*, lang.math.*
Reporter: Thiago Andrade
  Labels: github
 Fix For: Review Patch


 Placeholder ticket for github PR 22: 
 https://github.com/apache/commons-lang/pull/22



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (LANG-1006) Add wrap (with String or char) to StringUtils

2014-05-05 Thread Thiago Andrade (JIRA)

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

Thiago Andrade updated LANG-1006:
-

Component/s: (was: lang.math.*)

 Add wrap (with String or char) to StringUtils
 -

 Key: LANG-1006
 URL: https://issues.apache.org/jira/browse/LANG-1006
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*
Reporter: Thiago Andrade
  Labels: github
 Fix For: Review Patch


 Placeholder ticket for github PR 21: 
 https://github.com/apache/commons-lang/pull/21



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (LANG-1008) Adding the maxVA and minVA methods to NumberUtils and test methods

2014-05-05 Thread Thiago Andrade (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13989608#comment-13989608
 ] 

Thiago Andrade commented on LANG-1008:
--

All these methods have the purpose of being a shorcut for max and min methods 
but using ´varargs´ instead of creating an regular java array to use the method.

For example

{code:java|borderStyle=solid}
NumberUtils.max(new int[] { 1, 2, 3, 4, 5, 6  }); // returns 6

NumberUtils.maxVA(1, 2, 3, 4, 5, 6); // returns 6
{code}

 Adding the maxVA and minVA methods to NumberUtils and test methods
 --

 Key: LANG-1008
 URL: https://issues.apache.org/jira/browse/LANG-1008
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*, lang.math.*
Reporter: Thiago Andrade
  Labels: github
 Fix For: Review Patch


 Placeholder ticket for github PR 23: 
 https://github.com/apache/commons-lang/pull/23



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (LANG-1008) Adding the maxVA and minVA methods to NumberUtils and test methods

2014-05-05 Thread Thiago Andrade (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13989961#comment-13989961
 ] 

Thiago Andrade commented on LANG-1008:
--

[~michael-o] you are right! I around the web and found this 
[NullPointerException is a great way to tell, that an argument should not be 
null|http://books.google.com.br/books?id=ka2VUBqHiWkCpg=PA248lpg=PA248dq=%22Arguably,+all+erroneous+method+invocations+boil+down+to+an+illegal+argument+or+illegal+state,+but+other+exceptions+are+standardly+used+for+certain+kinds+of+illegal+arguments+and+states.+If+a+caller+passes+null+in+some+parameter+for+which+null+values+are+prohibited,+convention+dictates+that+NullPointerException+be+thrown+rather+than+IllegalArgumentException.+Similarly,+if+a+caller+passes+an+out-of-range+value+in+a+parameter+representing+an+index+into+a+sequence,+IndexOutOfBoundsException+should+be+thrown+rather+than+IllegalArgumentException.%22source=blots=yYLoLgqZT4sig=2npCOGZcepQ954Cg8LISYc2iGNAhl=ensa=Xei=xvlnU4jSIYHJsQTpg4DIAQved=0CCgQ6AEwAA#v=onepageq=%22Arguably%2C%20all%20erroneous%20method%20invocations%20boil%20down%20to%20an%20illegal%20argument%20or%20illegal%20state%2C%20but%20other%20exceptions%20are%20standardly%20used%20for%20certain%20kinds%20of%20illegal%20arguments%20and%20states.%20If%20a%20caller%20passes%20null%20in%20some%20parameter%20for%20which%20null%20values%20are%20prohibited%2C%20convention%20dictates%20that%20NullPointerException%20be%20thrown%20rather%20than%20IllegalArgumentException.%20Similarly%2C%20if%20a%20caller%20passes%20an%20out-of-range%20value%20in%20a%20parameter%20representing%20an%20index%20into%20a%20sequence%2C%20IndexOutOfBoundsException%20should%20be%20thrown%20rather%20than%20IllegalArgumentException.%22f=false]
 from Effective Java 2nd edition Book from Sun

 Adding the maxVA and minVA methods to NumberUtils and test methods
 --

 Key: LANG-1008
 URL: https://issues.apache.org/jira/browse/LANG-1008
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*, lang.math.*
Reporter: Thiago Andrade
  Labels: github
 Fix For: Review Patch


 Placeholder ticket for github PR 23: 
 https://github.com/apache/commons-lang/pull/23



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (LANG-1008) Adding the maxVA and minVA methods to NumberUtils and test methods

2014-05-05 Thread Thiago Andrade (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13989981#comment-13989981
 ] 

Thiago Andrade commented on LANG-1008:
--

[~dmjones500] I think that throwing a NullPointerException still is the correct 
way of verify arguments. Please read this: [Unchecked Exceptions — The 
Controversy|http://docs.oracle.com/javase/tutorial/essential/exceptions/runtime.html]
 ??One case where it is common practice to throw a RuntimeException is when the 
user calls a method incorrectly. For example, a method can check if one of its 
arguments is incorrectly null. If an argument is null, the method might throw a 
NullPointerException, which is an unchecked exception.??

 Adding the maxVA and minVA methods to NumberUtils and test methods
 --

 Key: LANG-1008
 URL: https://issues.apache.org/jira/browse/LANG-1008
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*, lang.math.*
Reporter: Thiago Andrade
  Labels: github
 Fix For: Review Patch


 Placeholder ticket for github PR 23: 
 https://github.com/apache/commons-lang/pull/23



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (LANG-1008) Adding the maxVA and minVA methods to NumberUtils and test methods

2014-05-05 Thread Thiago Andrade (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13989993#comment-13989993
 ] 

Thiago Andrade commented on LANG-1008:
--

So [~michael-o] it seems that we have a big problem. The official documentation 
(Oracle|Sun) says X and [Apache Commons Lang Developer 
Guide|http://commons.apache.org/proper/commons-lang/developerguide.html#Exception_throwing]
 says Y. Once the {{NumberUtils}} (and probably many other classes) obey 
ApacheCommon's guide, what should be done?

 Adding the maxVA and minVA methods to NumberUtils and test methods
 --

 Key: LANG-1008
 URL: https://issues.apache.org/jira/browse/LANG-1008
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*, lang.math.*
Reporter: Thiago Andrade
  Labels: github
 Fix For: Review Patch


 Placeholder ticket for github PR 23: 
 https://github.com/apache/commons-lang/pull/23



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Created] (LANG-1006) Add wrap (with String or char) to StringUtils. Fixing NumberUtils comments. Adding methods to NumberUtils

2014-05-04 Thread Thiago Andrade (JIRA)
Thiago Andrade created LANG-1006:


 Summary: Add wrap (with String or char) to StringUtils. Fixing 
NumberUtils comments. Adding methods to NumberUtils
 Key: LANG-1006
 URL: https://issues.apache.org/jira/browse/LANG-1006
 Project: Commons Lang
  Issue Type: New Feature
  Components: lang.*, lang.math.*
Reporter: Thiago Andrade


Placeholder ticket for github PR 21: 
https://github.com/apache/commons-lang/pull/21



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (COLLECTIONS-523) Removing unnecessary method

2014-05-04 Thread Thiago Andrade (JIRA)

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

Thiago Andrade updated COLLECTIONS-523:
---

Affects Version/s: 4.0

 Removing unnecessary method
 ---

 Key: COLLECTIONS-523
 URL: https://issues.apache.org/jira/browse/COLLECTIONS-523
 Project: Commons Collections
  Issue Type: Improvement
  Components: Map
Affects Versions: 4.0
Reporter: Thiago Andrade

 Removing unnecessary method {{private V put(final K key, final V value, final 
 long now)}} once the final long now parameter was never used.
 The param was confusing the logic of this method.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Created] (COLLECTIONS-523) Removing unnecessary method

2014-05-04 Thread Thiago Andrade (JIRA)
Thiago Andrade created COLLECTIONS-523:
--

 Summary: Removing unnecessary method
 Key: COLLECTIONS-523
 URL: https://issues.apache.org/jira/browse/COLLECTIONS-523
 Project: Commons Collections
  Issue Type: Improvement
  Components: Map
Reporter: Thiago Andrade


Removing unnecessary method {{private V put(final K key, final V value, final 
long now)}} once the final long now parameter was never used.

The param was confusing the logic of this method.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (COLLECTIONS-523) Removing unnecessary method

2014-05-04 Thread Thiago Andrade (JIRA)

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

Thiago Andrade updated COLLECTIONS-523:
---

Description: 
I suggest remmove unnecessary method {{private V put(final K key, final V 
value, final long now)}} from the class {{PassiveExpiringMap}} once the {{final 
long now}} parameter was never used. I've addapted the code to work properly.

The param was confusing the logic of this method.

Placeholder ticket for github PR 2: 
https://github.com/apache/commons-collections/pull/2


  was:
Removing unnecessary method {{private V put(final K key, final V value, final 
long now)}} once the final long now parameter was never used.

The param was confusing the logic of this method.


 Removing unnecessary method
 ---

 Key: COLLECTIONS-523
 URL: https://issues.apache.org/jira/browse/COLLECTIONS-523
 Project: Commons Collections
  Issue Type: Improvement
  Components: Map
Affects Versions: 4.0
Reporter: Thiago Andrade

 I suggest remmove unnecessary method {{private V put(final K key, final V 
 value, final long now)}} from the class {{PassiveExpiringMap}} once the 
 {{final long now}} parameter was never used. I've addapted the code to work 
 properly.
 The param was confusing the logic of this method.
 Placeholder ticket for github PR 2: 
 https://github.com/apache/commons-collections/pull/2



--
This message was sent by Atlassian JIRA
(v6.2#6252)