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

FilteringGeneratorDelegate.writeUTF8String() should delegate to writeUTF8String() #280

Merged
merged 1 commit into from May 6, 2016

Conversation

tlrx
Copy link
Contributor

@tlrx tlrx commented May 6, 2016

In its writeUTF8String() method, a FilteringGeneratorDelegate uses the delegating writeRawUTF8String() method that do not manage additional escaping:

@Override
public void writeUTF8String(byte[] text, int offset, int length) throws IOException
{
    // not exact match, but best we can do
    if (_checkRawValueWrite()) {
        delegate.writeRawUTF8String(text, offset, length);
    }
}

I think it should use the delegate.writeUTF8String() instead so that it correctly escapes required chars:

    // not exact match, but best we can do
    if (_checkRawValueWrite()) {
        delegate.writeUTF8String(text, offset, length);
    }

This pull request changes that and adds a small unit test.

@cowtowncoder cowtowncoder merged commit a8a9beb into FasterXML:master May 6, 2016
@cowtowncoder
Copy link
Member

Ah yes, good catch. Cut'n paste error. Thank you for reporting this!
I'll manually backport this in 2.7 as well.

cowtowncoder added a commit that referenced this pull request May 6, 2016
@tlrx
Copy link
Contributor Author

tlrx commented May 9, 2016

@cowtowncoder awesome, thanks!

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 this pull request may close these issues.

None yet

2 participants