fix DecoderListsTest and cleanup code
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
4fdf52bd55
commit
32b29a3ced
|
@ -57,13 +57,13 @@ public abstract class AbstractDecodedMessageSink implements MessageSink
|
|||
|
||||
/**
|
||||
* Invoke the MessageSink with the decoded message.
|
||||
* @param args the decoded message.
|
||||
* @param message the decoded message.
|
||||
*/
|
||||
public void invoke(Object... args)
|
||||
void invoke(Object message)
|
||||
{
|
||||
try
|
||||
{
|
||||
_methodHandle.invoke(args);
|
||||
_methodHandle.invoke(message);
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
|
|
|
@ -53,7 +53,6 @@ public class DecodedBinaryMessageSink<T> extends AbstractDecodedMessageSink.Basi
|
|||
return new ByteBufferMessageSink(coreSession, methodHandle);
|
||||
}
|
||||
|
||||
@SuppressWarnings("Duplicates")
|
||||
public void onWholeMessage(ByteBuffer wholeMessage)
|
||||
{
|
||||
for (Decoder.Binary<T> decoder : _decoders)
|
||||
|
|
|
@ -50,7 +50,6 @@ public class DecodedBinaryStreamMessageSink<T> extends AbstractDecodedMessageSin
|
|||
return new InputStreamMessageSink(coreSession, methodHandle);
|
||||
}
|
||||
|
||||
@SuppressWarnings("Duplicates")
|
||||
public void onStreamStart(InputStream stream)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -52,7 +52,6 @@ public class DecodedTextMessageSink<T> extends AbstractDecodedMessageSink.Basic<
|
|||
return new StringMessageSink(coreSession, methodHandle);
|
||||
}
|
||||
|
||||
@SuppressWarnings("Duplicates")
|
||||
public void onMessage(String wholeMessage)
|
||||
{
|
||||
for (Decoder.Text<T> decoder : _decoders)
|
||||
|
|
|
@ -50,7 +50,6 @@ public class DecodedTextStreamMessageSink<T> extends AbstractDecodedMessageSink.
|
|||
return new ReaderMessageSink(coreSession, methodHandle);
|
||||
}
|
||||
|
||||
@SuppressWarnings("Duplicates")
|
||||
public void onStreamStart(Reader reader)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -216,6 +216,12 @@ public class DecoderListTest
|
|||
{
|
||||
session.addMessageHandler(new PartialBinaryHandler(session));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Session session, Throwable t)
|
||||
{
|
||||
t.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private static class PartialTextHandler implements MessageHandler.Whole<String>
|
||||
|
|
Loading…
Reference in New Issue