You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Henrique Mendonca (JIRA)" <ji...@apache.org> on 2011/02/24 13:46:38 UTC

[jira] Updated: (THRIFT-863) Map Type is broken

     [ https://issues.apache.org/jira/browse/THRIFT-863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henrique Mendonca updated THRIFT-863:
-------------------------------------

    Attachment: THRIFT-863-maps-exceptions-qunit.patch

this patch will fix read and write maps on thrift.js (we were writing it inverted and reading completely wrong), and it will also change the java test server a bit to align it with the cpp test server implementation.

However, there are still some errors on the java JSON server (lib/compiler) implementation which this patch will not correct:
*1.* wrong order of item when reading a JSON map<int, int>
{quote}
     [java] Incoming content: [1,"testMap",1,0,\{"1":\{"map":["i32","i32",3,\{"7":77,"8":88,"9":99}]}}]
     [java] testMap(\{8 => 88, 9 => 99, 7 => 77})
     [java] Outgoing content: [1,"testMap",2,0,\{"0":\{"map":["i32","i32",3,\{"8":88,"9":99,"7":77}]}}]
{quote}



*2.* Java JSON Exception response is not properly generated:
{quote}
     [java] Incoming content: [1,"testException",1,0,\{"1":\{"str":"ApplicationException"}}]
     [java] testException(ApplicationException)
     [java] Outgoing content: Error:ApplicationException
expected output: [1,"testException",3,0,\{"1":\{"str":"ApplicationException"},"2":\{"i32":0}}]
{quote}

I hope someone else can have a look on that :)


Anyway, the qunit test (lib/js/test$ ant) should pass 100% with this patch
{quote}
Tests completed in 573 milliseconds.
39 tests of 39 passed, 0 failed.
{quote}

> Map Type is broken
> ------------------
>
>                 Key: THRIFT-863
>                 URL: https://issues.apache.org/jira/browse/THRIFT-863
>             Project: Thrift
>          Issue Type: Bug
>          Components: JavaScript - Compiler, JavaScript - Library
>    Affects Versions: 0.3, 0.4
>         Environment: FireFox 3.6.8
>            Reporter: Roger Meier
>         Attachments: THRIFT-863-maps-exceptions-qunit.patch
>
>
> decoding of Map Types is broken, Unit Test Output looks like:
> {code}
> expected: "{\\"7\\":77,\\"8\\":88,\\"9\\":99}"
> result: "{\\"8\\":88,\\"88\\":88}",
> {code}
> see: http://www.bufferoverflow.ch:8088/test/test.html

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira