[ 
https://issues.apache.org/jira/browse/THRIFT-5105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17053212#comment-17053212
 ] 

Zezeng Wang commented on THRIFT-5105:
-------------------------------------

I agree, 

[https://github.com/apache/thrift/blob/882d48da5d5db439c11029f46006c71f6429ae2c/lib/java/src/org/apache/thrift/protocol/TBinaryProtocol.java#L432-L452]

and 

[https://github.com/apache/thrift/blob/042580f53441efe1bc5c80c89351fcb30740659e/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc#L424-L429]

both are actually trying to achieve the same function,but looks different.

I personally think the implementation of cpp is better.

 

> Very minor issue: why are the values for "unlimited" different between Java 
> and cpp?
> ------------------------------------------------------------------------------------
>
>                 Key: THRIFT-5105
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5105
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.13.0
>            Reporter: Mario Emmenlauer
>            Priority: Trivial
>
> I've seen that in Java, 
> [https://github.com/apache/thrift/blob/882d48da5d5db439c11029f46006c71f6429ae2c/lib/java/src/org/apache/thrift/protocol/TBinaryProtocol.java#L34]
>  defines a constant {{NO_LENGTH_LIMIT = -1}} to initialize string_limit and 
> container_limit of TBinaryProtocol. In C++ on the other hand, the default 
> values (I guess they represent unlimited) are set in 
> [https://github.com/apache/thrift/blob/042580f53441efe1bc5c80c89351fcb30740659e/lib/cpp/src/thrift/protocol/TBinaryProtocol.h#L47]
>  with {{string_limit_(0)}}.
>  
> This is really no big issue but for consistency it may be nicer if all 
> implementation use the same default for "unlimited"?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to