Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent TextBuffer#getTextBuffer behavior #182

Closed
masaruh opened this issue Feb 17, 2015 · 1 comment · Fixed by #183
Closed

Inconsistent TextBuffer#getTextBuffer behavior #182

masaruh opened this issue Feb 17, 2015 · 1 comment · Fixed by #183

Comments

@masaruh
Copy link

masaruh commented Feb 17, 2015

Hi, I'm using 2.4.2. While I'm working on CBORParser, I noticed that CBORParser#getTextCharacters() returns sometimes null sometimes [] (empty array) when it's parsing empty string "".

While debugging, I noticed that TextBuffer#getTextBuffer behaves inconsistently.

TextBuffer buffer = new TextBuffer(new BufferRecycler());
buffer.resetWithEmpty();
buffer.getTextBuffer(); // returns null
buffer.contentsAsString(); // returns empty string ""
buffer.getTextBuffer(); // returns empty array []

I think getTextBuffer should return the same value. Not sure which (null or []) is expected though.

@cowtowncoder
Copy link
Member

Interesting. I would guess that returning an empty array is the proper behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants