Github user takuti commented on a diff in the pull request:

    https://github.com/apache/incubator-hivemall/pull/110#discussion_r135446415
  
    --- Diff: core/src/main/java/hivemall/utils/lang/StringUtils.java ---
    @@ -172,12 +172,17 @@ public static void clear(@Nonnull final StringBuilder 
buf) {
     
         public static String concat(@Nonnull final List<String> list, @Nonnull 
final String sep) {
    --- End diff --
    
    @myui I guess you originally assumed this method behaves in a similar way 
to [what `org.apache.commons.lang3.StringUtils.join` 
does](https://github.com/apache/commons-lang/blob/1571050a196198f336ae487ee3b6df629d3ee9da/src/main/java/org/apache/commons/lang3/StringUtils.java#L4106-L4150).
 However, the original code appends a separator even at the end of result 
string as:
    
    - expected: `concat(["a", "b", "c"], "-")` => `a-b-c`
    - actual: `concat(["a", "b", "c"], "-")` => `a-b-c-`
    
    So, I fixed the method in 796d388c36c520858b6e61deb34100cb9201e5fa. Is this 
okay? If my assumption was incorrect, I revert the modification and introduce 
alternative method `StringUtils.join()`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to