[ 
https://issues.apache.org/jira/browse/LANG-701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14246397#comment-14246397
 ] 

Benedikt Ritter commented on LANG-701:
--------------------------------------

Hello James,

nice idea to use ExpectedException for testing the exception's message. However 
we do not use it anywhere else in the code, so it would be a bit strange to 
have this one test that uses it. I'm fine with just making sure the expected 
exception is thrown.

The {{join(Iterable, String)}} method treats null as empty string. Your 
implementation of {{joinWith(String, Object...)}} writes "null" to the result 
if the varargs array contains null entries. Would be better if both methods 
behave the same way.

It would be helpful to add a list of example to the JavaDoc of your method, so 
that users can see easily how the new method behaves for different inputs.

br,
Benedikt

> StringUtils join with var args
> ------------------------------
>
>                 Key: LANG-701
>                 URL: https://issues.apache.org/jira/browse/LANG-701
>             Project: Commons Lang
>          Issue Type: New Feature
>          Components: lang.*
>            Reporter: Gabriele Kahlout
>            Priority: Minor
>             Fix For: Review Patch
>
>         Attachments: VarArgJoinTest.java
>
>
> {code:java}
> final String apple = "apple";
> final String banana = "banana";
> final String orange = "orange";
> final String expected = apple +  SPACE + banana + SPACE + orange;
> final String  actual = join(SPACE, apple, banana, orange);
> final int expLength = expected.length();
> final int actLength = actual.length();
> assertEquals(expLength, actLength);
> assertEquals(expected, actual);
> {code}
> I missed the functionality of joining strings with the space separator in one 
> line. BTW, why space ' ' not a constant field anywhere?



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

Reply via email to