-
Bug
-
Resolution: Done
-
Major
-
1.4.10.Final
-
None
-
-
User Experience
-
Workaround Exists
-
-
Low
When registering a custom Decoder to decode binary web socket messages the value type is sometimes resolved incorrectly. This is not the case if the Decoder is a Text Decoder.
The issue is only there if the decoder extends from a generic decoder class that leaves the value type generic: i.e.
@Override public T decode(ByteBuffer bytes) { ... }
The decoders (and encoders) are resolved in the following method of EncodingFactory:
public static EncodingFactory createFactory(classIntrospecter, decoders, encoders) { ... }
On line 184 the type for text decoders is resolved via:
final Class<?> type = resolveReturnType(method, decoder);
However for binary decoders (and all Encoders) the type is resolved via:
final Class<?> type = method.getReturnType();
It seems this issue used to also be there for text decoders but was resolved by adding the resolveReturnType() method. However, the person that added that method seems to have forgotten to also change the part that targets binary decoders.