You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2018/11/04 15:55:00 UTC
[jira] [Comment Edited] (TEXT-138) TextStringBuilder append
sub-sequence not consistant with Appendable
[ https://issues.apache.org/jira/browse/TEXT-138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16674431#comment-16674431 ]
Gary Gregory edited comment on TEXT-138 at 11/4/18 3:54 PM:
------------------------------------------------------------
{quote}
Probable the simplest solution would be to remove 'Appendable' from implements.
{quote}
We cannot do that in the 1.x line since it would completely break binary compatibility.
It seems to me the changes should be to:
- Fix TextStringBuilder to adhere to the Appendable contract
- Fix call sites within Commons Text.
Patches welcome :-)
Gary
was (Author: garydgregory):
{quote}
Probable the simplest solution would be to remove 'Appendable' from implements.
{quote}
We cannot do that in the 1.x line since it would completely break binary compatibility.
It seems to me the changes should be to:
- Fix TextStringBuilder to adhere to the Appendable contract
- Fix call sites within Commons Text.
Gary
> TextStringBuilder append sub-sequence not consistant with Appendable
> --------------------------------------------------------------------
>
> Key: TEXT-138
> URL: https://issues.apache.org/jira/browse/TEXT-138
> Project: Commons Text
> Issue Type: Bug
> Affects Versions: 1.4
> Reporter: Neal Johnson
> Priority: Minor
> Labels: usability
>
> The method:
> {{append(final CharSequence seq, final int startIndex, final int length)}}
> Overrides the method defined by Appendable. However the behavior of the TextStringBuilder implementation is not consistent with the definition in Appendable. As the class defines "that some edge cases, with invalid indices or null input, have been altered - see individual methods" this would not normally be an issue. However as the implementation states that it overrides Appendable the class cannot be used as an Appendable as the last argument is expected to be an end index and not a length.
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)