[
https://issues.apache.org/jira/browse/THRIFT-31?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12613519#action_12613519
]
Todd Lipcon commented on THRIFT-31:
-----------------------------------
I definitely agree that the size checking is a great improvement.
As for the name checking, I agree with Johan that the performance hit is likely
to be negligible anyway - a few microseconds at most. If people are worried we
should benchmark it.
The one change I'd make is to change:
+ indent() << "if (!struct.name.equals(\"\") && !struct.name.equals(\"" <<
tstruct->get_name() << "\")) {" << endl <<
to:
+ indent() << "if (!\"\".equals(struct.name) && !\"" << tstruct->get_name()
<< "\".equals(struct.name)) {" << endl <<
This guards against a protocol not setting struct.name at all.
> More validation during serialization
> ------------------------------------
>
> Key: THRIFT-31
> URL: https://issues.apache.org/jira/browse/THRIFT-31
> Project: Thrift
> Issue Type: Improvement
> Components: Compiler (Java), Library (Java)
> Reporter: Johan Stuyts
> Attachments: MoreValidationDuringSerialization.patch
>
>
> The protocols and the generated code can perform more validation during
> deserialization. The additional validations are:
> - check the size of strings, binaries and containers is >= zero (protocols)
> - check if the name of the structure is correct (if present) (structures)
> - check if the field type is valid (structures)
> - check if container elements have the correct type (structures)
> - check if the call message has the correct type (processors)
> - check if the reply message has the correct type (clients)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.