[jira] [Commented] (TEXT-138) TextStringBuilder append sub-sequence not consistant with Appendable

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[jira] [Commented] (TEXT-138) TextStringBuilder append sub-sequence not consistant with Appendable

JIRA jira@apache.org

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

ASF GitHub Bot commented on TEXT-138:

GitHub user drajakumar opened a pull request:


    TEXT-138 TextStringBuilder append sub-sequence not consistant with Appendable

    1 considered the end index as exclusive because its exclusive as per the definition done in Appendable.
    2 considered start index not to be same as the end index because start index is inclusive, end index is not.
    3 there is an overloaded append function in TextStringBuilder which takes String, int, int as parameters. The last parameter here is length. I didn't touch this because, its NOT an overridden function from Appendable.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/drajakumar/commons-text master

Alternatively you can review and apply these changes as the patch at:


To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #92
commit d3bfb518ccde125b45b9d7a874cf717321578e7f
Author: Don Jeba <donjeba@...>
Date:   2018-10-29T18:05:19Z

    TEXT-127 Detect when a variable is unknown in StringSubstitutor

commit dde0a395438bf8c7626076c56912a4405f856628
Author: Don Jeba <donjeba@...>
Date:   2018-10-29T18:21:04Z

    fixing build failure

commit 60bed4374a2db82bc7842d3ccd33e2158d2b80f6
Author: Don Jeba <donjeba@...>
Date:   2018-10-29T18:29:19Z

    removing trailing space at L131

commit 2ac7b5029cea1234accca7ec5f48cf17bed364ac
Author: Don Jeba <donjeba@...>
Date:   2018-11-07T09:33:50Z

    TEXT-138 TextStringBuilder append sub-sequence not consistant with Appendable

commit a7d1a89e9aafa2f296758583e661c13f2ab58c20
Author: Don Jeba <donjeba@...>
Date:   2018-11-07T09:42:24Z

    fixing merge conflict

commit a8d94daaa59eef6709b70e66a46319c3c75cd718
Author: Don Jeba <donjeba@...>
Date:   2018-11-07T09:45:30Z

    removing empty lines from StringSubstitutorTest.java


> 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