You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Nils Hügelmann (JIRA)" <ji...@apache.org> on 2011/04/16 20:58:05 UTC
[jira] [Created] (THRIFT-1148) list<> type with multiple items is
not encoded properly in JSONProtocol
list<> type with multiple items is not encoded properly in JSONProtocol
------------------------------------------------------------------------
Key: THRIFT-1148
URL: https://issues.apache.org/jira/browse/THRIFT-1148
Project: Thrift
Issue Type: Bug
Components: C# - Library
Affects Versions: 0.6.1
Reporter: Nils Hügelmann
thrift definition
service Foo{
list<i32> test()
}
c# implementation
public List<int> test ()
{
return new List<int>{
42,4242
};
}
produces:
[1,"test",2,0,{"0":{"lst":["i32",2,42],"4242"]}}
reformatted:
[1,"test",2,0,
{
"0":{
"lst":["i32",2,42],"4242"]
}
}
it works as expected with only one item in the list.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (THRIFT-1148) list<> type with multiple items is
not encoded properly in JSONProtocol
Posted by "Nils Hügelmann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13020655#comment-13020655 ]
Nils Hügelmann commented on THRIFT-1148:
----------------------------------------
In the generated service class, there is (in my case) this:
public void Write(TProtocol oprot) {
[...]
oprot.WriteListBegin(new TList(TType.I32, Success.Count));
foreach (int _iter11 in Success)
{
oprot.WriteI32(_iter11);
oprot.WriteListEnd();
}
[...]
}
which of course must be
oprot.WriteListBegin(new TList(TType.I32, Success.Count));
foreach (int _iter11 in Success)
{
oprot.WriteI32(_iter11);
}
oprot.WriteListEnd();
> list<> type with multiple items is not encoded properly in JSONProtocol
> ------------------------------------------------------------------------
>
> Key: THRIFT-1148
> URL: https://issues.apache.org/jira/browse/THRIFT-1148
> Project: Thrift
> Issue Type: Bug
> Components: C# - Library
> Affects Versions: 0.6.1
> Reporter: Nils Hügelmann
>
> thrift definition
> service Foo{
> list<i32> test()
> }
> c# implementation
> public List<int> test ()
> {
> return new List<int>{
> 42,4242
> };
> }
> produces:
> [1,"test",2,0,{"0":{"lst":["i32",2,42],"4242"]}}
> reformatted:
> [1,"test",2,0,
> {
> "0":{
> "lst":["i32",2,42],"4242"]
> }
> }
> it works as expected with only one item in the list.
> [EDIT] Tried to correct formatting/intendations
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (THRIFT-1148) list<> type with multiple items is
not encoded properly in JSONProtocol
Posted by "Nils Hügelmann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13020646#comment-13020646 ]
Nils Hügelmann commented on THRIFT-1148:
----------------------------------------
found a stacktrace
System.InvalidOperationException: Operation is not valid due to the current state of the object
at System.Collections.Generic.Stack`1[Thrift.Protocol.TJSONProtocol+JSONBaseContext].Pop () [0x00058] in /usr/src/packages/BUILD/mono-2.10.1/mcs/class/System/System.Collections.Generic/Stack.cs:127
at Thrift.Protocol.TJSONProtocol.PopContext () [0x00000] in /home/nils/Documents/_Projekte/thrift/trunk/lib/csharp/src/Protocol/TJSONProtocol.cs:366
at Thrift.Protocol.TJSONProtocol.WriteJSONArrayEnd () [0x00000] in /home/nils/Documents/_Projekte/thrift/trunk/lib/csharp/src/Protocol/TJSONProtocol.cs:585
at Thrift.Protocol.TJSONProtocol.WriteMessageEnd () [0x00000] in /home/nils/Documents/_Projekte/thrift/trunk/lib/csharp/src/Protocol/TJSONProtocol.cs:603
at Communication.Client.ClientService+Processor.test_Process (Int32 seqid, Thrift.Protocol.TProtocol iprot, Thrift.Protocol.TProtocol oprot) [0x00043] in /home/nils/Documents/_Projekte/anonymox/server/apps/shared/thrift/gen-csharp/Communication/Client/ClientService.cs:268
at Communication.Client.ClientService+Processor.Process (Thrift.Protocol.TProtocol iprot, Thrift.Protocol.TProtocol oprot) [0x00086] in /home/nils/Documents/_Projekte/anonymox/server/apps/shared/thrift/gen-csharp/Communication/Client/ClientService.cs:211
at Thrift.Transport.THttpHandler.ProcessRequest (System.IO.Stream input, System.IO.Stream output) [0x0001f] in /home/nils/Documents/_Projekte/thrift/src/Transport/THttpHandler.cs:77
> list<> type with multiple items is not encoded properly in JSONProtocol
> ------------------------------------------------------------------------
>
> Key: THRIFT-1148
> URL: https://issues.apache.org/jira/browse/THRIFT-1148
> Project: Thrift
> Issue Type: Bug
> Components: C# - Library
> Affects Versions: 0.6.1
> Reporter: Nils Hügelmann
>
> thrift definition
> service Foo{
> list<i32> test()
> }
> c# implementation
> public List<int> test ()
> {
> return new List<int>{
> 42,4242
> };
> }
> produces:
> [1,"test",2,0,{"0":{"lst":["i32",2,42],"4242"]}}
> reformatted:
> [1,"test",2,0,
> {
> "0":{
> "lst":["i32",2,42],"4242"]
> }
> }
> it works as expected with only one item in the list.
> [EDIT] Tried to correct formatting/intendations
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (THRIFT-1148) list<> type with multiple items is
not encoded properly
Posted by "Roger Meier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Roger Meier resolved THRIFT-1148.
---------------------------------
Resolution: Duplicate
This has been fixed on THRIFT-1120
here's the latest Thrift Compiler for Windows
https://builds.apache.org/hudson/view/S-Z/view/Thrift/job/Thrift-Compiler-Windows/lastSuccessfulBuild/artifact/thrift/thrift.exe
> list<> type with multiple items is not encoded properly
> -------------------------------------------------------
>
> Key: THRIFT-1148
> URL: https://issues.apache.org/jira/browse/THRIFT-1148
> Project: Thrift
> Issue Type: Bug
> Components: C# - Library
> Affects Versions: 0.6.1
> Reporter: Nils Hügelmann
>
> thrift definition
> service Foo{
> list<i32> test()
> }
> c# implementation
> public List<int> test ()
> {
> return new List<int>{
> 42,4242
> };
> }
> produces:
> [1,"test",2,0,{"0":{"lst":["i32",2,42],"4242"]}}
> reformatted:
> [1,"test",2,0,
> {
> "0":{
> "lst":["i32",2,42],"4242"]
> }
> }
> it works as expected with only one item in the list.
> [EDIT] Tried to correct formatting/intendations
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (THRIFT-1148) list<> type with multiple items is
not encoded properly in JSONProtocol
Posted by "Nils Hügelmann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nils Hügelmann updated THRIFT-1148:
-----------------------------------
Description:
thrift definition
service Foo{
list<i32> test()
}
c# implementation
public List<int> test ()
{
return new List<int>{
42,4242
};
}
produces:
[1,"test",2,0,{"0":{"lst":["i32",2,42],"4242"]}}
reformatted:
[1,"test",2,0,
{
"0":{
"lst":["i32",2,42],"4242"]
}
}
it works as expected with only one item in the list.
[EDIT] Tried to correct formatting/intendations
was:
thrift definition
service Foo{
list<i32> test()
}
c# implementation
public List<int> test ()
{
return new List<int>{
42,4242
};
}
produces:
[1,"test",2,0,{"0":{"lst":["i32",2,42],"4242"]}}
reformatted:
[1,"test",2,0,
{
"0":{
"lst":["i32",2,42],"4242"]
}
}
it works as expected with only one item in the list.
> list<> type with multiple items is not encoded properly in JSONProtocol
> ------------------------------------------------------------------------
>
> Key: THRIFT-1148
> URL: https://issues.apache.org/jira/browse/THRIFT-1148
> Project: Thrift
> Issue Type: Bug
> Components: C# - Library
> Affects Versions: 0.6.1
> Reporter: Nils Hügelmann
>
> thrift definition
> service Foo{
> list<i32> test()
> }
> c# implementation
> public List<int> test ()
> {
> return new List<int>{
> 42,4242
> };
> }
> produces:
> [1,"test",2,0,{"0":{"lst":["i32",2,42],"4242"]}}
> reformatted:
> [1,"test",2,0,
> {
> "0":{
> "lst":["i32",2,42],"4242"]
> }
> }
> it works as expected with only one item in the list.
> [EDIT] Tried to correct formatting/intendations
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (THRIFT-1148) list<> type with multiple items is
not encoded properly
Posted by "Nils Hügelmann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nils Hügelmann updated THRIFT-1148:
-----------------------------------
Summary: list<> type with multiple items is not encoded properly (was: list<> type with multiple items is not encoded properly in JSONProtocol )
> list<> type with multiple items is not encoded properly
> -------------------------------------------------------
>
> Key: THRIFT-1148
> URL: https://issues.apache.org/jira/browse/THRIFT-1148
> Project: Thrift
> Issue Type: Bug
> Components: C# - Library
> Affects Versions: 0.6.1
> Reporter: Nils Hügelmann
>
> thrift definition
> service Foo{
> list<i32> test()
> }
> c# implementation
> public List<int> test ()
> {
> return new List<int>{
> 42,4242
> };
> }
> produces:
> [1,"test",2,0,{"0":{"lst":["i32",2,42],"4242"]}}
> reformatted:
> [1,"test",2,0,
> {
> "0":{
> "lst":["i32",2,42],"4242"]
> }
> }
> it works as expected with only one item in the list.
> [EDIT] Tried to correct formatting/intendations
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (THRIFT-1148) list<> type with multiple items is
not encoded properly
Posted by "Nils Hügelmann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13020659#comment-13020659 ]
Nils Hügelmann commented on THRIFT-1148:
----------------------------------------
Yes, just noticed it...
Why windows? there are /'s in the paths, its linux:-)
> list<> type with multiple items is not encoded properly
> -------------------------------------------------------
>
> Key: THRIFT-1148
> URL: https://issues.apache.org/jira/browse/THRIFT-1148
> Project: Thrift
> Issue Type: Bug
> Components: C# - Library
> Affects Versions: 0.6.1
> Reporter: Nils Hügelmann
>
> thrift definition
> service Foo{
> list<i32> test()
> }
> c# implementation
> public List<int> test ()
> {
> return new List<int>{
> 42,4242
> };
> }
> produces:
> [1,"test",2,0,{"0":{"lst":["i32",2,42],"4242"]}}
> reformatted:
> [1,"test",2,0,
> {
> "0":{
> "lst":["i32",2,42],"4242"]
> }
> }
> it works as expected with only one item in the list.
> [EDIT] Tried to correct formatting/intendations
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira