johnzon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hendrik Saly (JIRA)" <>
Subject [jira] [Commented] (JOHNZON-16) RFC4627AwareInputStreamReader has unreachable code
Date Wed, 29 Oct 2014 15:07:34 GMT


Hendrik Saly commented on JOHNZON-16:

Thanks for the patch but will not apply the RFC4627AwareInputStreamReader stuff, new Testcase
is ok, thanks for that.
The patch removes BOM detection, so UTF which comes with BOM's are then not correctly handled.

For example a test like 
    public void testUTF16Stream() {
        //this writes UTF 16 with Byte Order Mark (BOM)
        ByteArrayInputStream bin = new ByteArrayInputStream("[\"UTF16\"]".getBytes(UTF_16));
        JsonParser parser = Json.createParser(bin);;;
        assertEquals("UTF16", parser.getString());;
fails with the patch applied.

But during review i found that we not handle UTF-8 well with BOM. Will fix this and add also
more test cases that checks BOMs (to check functionality and to increase coverage)

> RFC4627AwareInputStreamReader has unreachable code
> --------------------------------------------------
>                 Key: JOHNZON-16
>                 URL:
>             Project: Johnzon
>          Issue Type: Improvement
>            Reporter: Thiago Veronezi
>            Assignee: Hendrik Saly
>            Priority: Minor
>         Attachments: remove_unreachable_improve_test_coverage.patch
> The RFC4627AwareInputStreamReader#getCharset method has some unreachable branches. Therefore,
it is not 100% covered by the unit tests.

This message was sent by Atlassian JIRA

View raw message