Upgrade to RSocket 0.12.1-RC3-SNAPSHOT

Closes gh-22629
This commit is contained in:
Rossen Stoyanchev
2019-03-21 19:31:06 -04:00
parent 3e4f8905a7
commit 2f95859715
6 changed files with 15 additions and 17 deletions

View File

@@ -17,7 +17,6 @@
package org.springframework.messaging.rsocket;
import io.netty.buffer.ByteBuf;
import io.rsocket.Frame;
import io.rsocket.Payload;
import io.rsocket.util.ByteBufPayload;
import io.rsocket.util.DefaultPayload;
@@ -27,7 +26,6 @@ import org.springframework.core.io.buffer.DataBufferFactory;
import org.springframework.core.io.buffer.DefaultDataBuffer;
import org.springframework.core.io.buffer.NettyDataBuffer;
import org.springframework.core.io.buffer.NettyDataBufferFactory;
import org.springframework.util.Assert;
/**
* Static utility methods to create {@link Payload} from {@link DataBuffer}s
@@ -53,11 +51,9 @@ abstract class PayloadUtils {
ByteBuf byteBuf = payload.sliceData().retain();
return ((NettyDataBufferFactory) bufferFactory).wrap(byteBuf);
}
Assert.isTrue(!(payload instanceof ByteBufPayload) && !(payload instanceof Frame),
"NettyDataBufferFactory expected, actual: " + bufferFactory.getClass().getSimpleName());
return bufferFactory.wrap(payload.getData());
else {
return bufferFactory.wrap(payload.getData());
}
}
finally {
if (payload.refCnt() > 0) {