AppendableCharSequence private constructor does not set correct position #2252

Closed
JatinderSingh opened this Issue Feb 20, 2014 · 9 comments

Projects

None yet

2 participants

@JatinderSingh
Contributor

private constructor

private AppendableCharSequence(char[] chars) {
this.chars = chars;
}

does not update position as a result of which subsequence method gives unusable AppendableCharSequence.

@normanmaurer
Member

@JatinderSingh why you think this is a problem? It should just start a position 0. Can you provide a unit test that show what is wrong ?

@JatinderSingh
Contributor

sure..

@JatinderSingh
Contributor
@Test
public void testSubSequence() {
    AppendableCharSequence master = new AppendableCharSequence(26);
    master.append("abcdefghijlkmonpqrstuvwxyz");
    assertEquals(master.subSequence(0, 10).toString(), "abcdefghij");
}

above test will fail because of the issue i mentioned.

@normanmaurer
Member

Maybe even with a fix ?

This would be awesome :)

-- 
Norman Maurer

An 20. Februar 2014 at 13:42:26, JatinderSingh (notifications@github.com) schrieb:

sure..


Reply to this email directly or view it on GitHub.

@JatinderSingh
Contributor
    private AppendableCharSequence(char[] chars) {
        this.chars = chars;
        pos = chars.length; // fix
    }

JatinderSingh@3729be3
(fix)
JatinderSingh@084b834
(test case)

@normanmaurer
Member

@JatinderSingh you are right... Could you please open a PR with the two changes (squashed into one) and sign our CLA:
https://docs.google.com/spreadsheet/viewform?formkey=dHBjc1YzdWhsZERUQnhlSklsbG1KT1E6MQ

Once this is done let me know and I will merge it and so include it in the next release. Thanks again for your time!

@JatinderSingh
Contributor

@normanmaurer
I have raised a pull request (URL below) for same after signing the CLA.
#2283

@normanmaurer
Member

Cool will check later today

Am 03.03.2014 um 12:57 schrieb JatinderSingh notifications@github.com:

@normanmaurer
I have raised a pull request (URL below) for same after signing the CLA.
#2283


Reply to this email directly or view it on GitHub.

@normanmaurer
Member

@JatinderSingh sqashed and cherry-picked.. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment