harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikolay Kuznetsov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-271) HARMONY-39 java.util.regex.Pattern.split() method discards last trailing empty string
Date Wed, 29 Mar 2006 11:28:19 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-271?page=all ]

Nikolay Kuznetsov updated HARMONY-271:

    Attachment: split_patch.diff

Attached patch contains fix for this issue and also includes unit tests which covers Pattern.split()
method functionality.

> 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
>     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

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message