You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Tim Ellison (JIRA)" <ji...@apache.org> on 2006/05/04 14:32:17 UTC

[jira] Closed: (HARMONY-271) HARMONY-39 java.util.regex.Pattern.split() method discards last trailing empty string

     [ http://issues.apache.org/jira/browse/HARMONY-271?page=all ]
     
Tim Ellison closed HARMONY-271:
-------------------------------


Verified by Nikolay


> HARMONY-39 java.util.regex.Pattern.split() method discards last trailing empty string
> -------------------------------------------------------------------------------------
>
>          Key: HARMONY-271
>          URL: http://issues.apache.org/jira/browse/HARMONY-271
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>  Environment: Any
>     Reporter: Nikolay Kuznetsov
>     Assignee: Tim Ellison
>     Priority: Minor
>  Attachments: split_patch.diff
>
> HARMONY-39 Pattern.split() method discards last trailing empty string when given pattern matches last symbol of input character sequence.
> The same problem appears if the input string is empty. JavaDoc says that if the expression does not match any part of the input sequence then the resulting array has just one element, namely this string. Thus in the case of empty input string one element array containing empty string should be returned, however HARMONY-39 Pattern.split() returns empty array.
> This problem also affects java.lang.String.split() method, because according to JavaDoc it uses Pattern.split() method.
> The following test demonstrates the problem:
> ",,".split(",", 3).length; //Resulted array will have two elements, while it should have three.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira