fix DecoderListsTest and cleanup code

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2020-06-30 11:18:36 +10:00
parent 4fdf52bd55
commit 32b29a3ced
6 changed files with 9 additions and 7 deletions

View File

@ -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)
{

View File

@ -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)

View File

@ -50,7 +50,6 @@ public class DecodedBinaryStreamMessageSink<T> extends AbstractDecodedMessageSin
return new InputStreamMessageSink(coreSession, methodHandle);
}
@SuppressWarnings("Duplicates")
public void onStreamStart(InputStream stream)
{
try

View File

@ -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)

View File

@ -50,7 +50,6 @@ public class DecodedTextStreamMessageSink<T> extends AbstractDecodedMessageSink.
return new ReaderMessageSink(coreSession, methodHandle);
}
@SuppressWarnings("Duplicates")
public void onStreamStart(Reader reader)
{
try

View File

@ -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>