[
https://issues.apache.org/jira/browse/THRIFT-4822?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jens Geyer resolved THRIFT-4822.
--------------------------------
Resolution: Fixed
Fix Version/s: 0.13.0
Committed
> Refactor bool CTOR flags into enum type
> ---------------------------------------
>
> Key: THRIFT-4822
> URL: https://issues.apache.org/jira/browse/THRIFT-4822
> Project: Thrift
> Issue Type: Improvement
> Components: netstd - Library
> Reporter: Jens Geyer
> Priority: Major
> Fix For: 0.13.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Certain CTORs accept two boolean flags
> {{public SomeTransport( arg1, arg2, ..., bool useBufferedSockets = false,
> bool useFramedTransport = false)}}
> The only valid combinations here are in fact (false,false), (true,false),
> (false,true) - the forth combination does not make sense because framed by
> design already acts as a buffer. Not to mention, that multiple boolean
> arguments are usually less coder-friendly.
> Therefore, the parameterlist should be shortened to the more readable,
> maintainable and concise style like so (proposal):
> {code}
> public enum Buffering {
> None,
> BufferedTransport,
> FramedTransport
> }
> public SomeTransport( arg1, arg2, ..., Buffering buffering = Buffering.None)
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)