Closed andrewcox closed 11 years ago
The overload taking an instance is different, but you're right the other two (Class & TypeLiteral) could resolve to one-liners that call the Key overload. So I'll make that change.
The reason for keeping the Class & TypeLiteral overloads is just to reduce verbosity for callers.
Changes applied, merged and pushed
All overloads of bindThriftCodec() actually assumed the class you were referring to was a thrift type, and created a binding for the codec using a provider that would ask the codec manager for an appropriate codec. Only one overload let you install a custom codec, and it required an instance, which is problematic because sometimes you want to create a custom codec that depends on an injected ThriftCatalog or ThriftCodecManager.
I renamed this overload bindThriftCustomCodec() to help reduce confusion between overloads that take a thrift type argument, and overloads that take a codec argument, and then added more overloads of this bindThriftCustomCodec() that will take class, typeliteral, and key.