Skip to content

Commit

Permalink
Dubbo throws exception when use java serializer (#4530)
Browse files Browse the repository at this point in the history
* Dubbo throws exception when use java serializer
issues:
#3951
#3698

* Dubbo throws exception when use java serializer
issues:
#3951
#3698

fix travis-ci
UnusedImports
  • Loading branch information
qixiaobo authored and beiwei30 committed Jul 11, 2019
1 parent f932569 commit 0e886a9
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.alibaba.dubbo.common.io.UnsafeByteArrayInputStream;
import com.alibaba.dubbo.common.logger.Logger;
import com.alibaba.dubbo.common.logger.LoggerFactory;
import com.alibaba.dubbo.common.serialize.ObjectInput;
import com.alibaba.dubbo.common.serialize.ObjectOutput;
import com.alibaba.dubbo.common.utils.ReflectUtils;
import com.alibaba.dubbo.common.utils.StringUtils;
Expand Down Expand Up @@ -73,13 +72,12 @@ protected Object decodeBody(Channel channel, InputStream is, byte[] header) thro
byte status = header[3];
res.setStatus(status);
try {
ObjectInput in = CodecSupport.deserialize(channel.getUrl(), is, proto);
if (status == Response.OK) {
Object data;
if (res.isHeartbeat()) {
data = decodeHeartbeatData(channel, in);
data = decodeHeartbeatData(channel, CodecSupport.deserialize(channel.getUrl(), is, proto));
} else if (res.isEvent()) {
data = decodeEventData(channel, in);
data = decodeEventData(channel, CodecSupport.deserialize(channel.getUrl(), is, proto));
} else {
DecodeableRpcResult result;
if (channel.getUrl().getParameter(
Expand All @@ -97,7 +95,7 @@ protected Object decodeBody(Channel channel, InputStream is, byte[] header) thro
}
res.setResult(data);
} else {
res.setErrorMessage(in.readUTF());
res.setErrorMessage(CodecSupport.deserialize(channel.getUrl(), is, proto).readUTF());
}
} catch (Throwable t) {
if (log.isWarnEnabled()) {
Expand All @@ -117,11 +115,10 @@ protected Object decodeBody(Channel channel, InputStream is, byte[] header) thro
}
try {
Object data;
ObjectInput in = CodecSupport.deserialize(channel.getUrl(), is, proto);
if (req.isHeartbeat()) {
data = decodeHeartbeatData(channel, in);
data = decodeHeartbeatData(channel, CodecSupport.deserialize(channel.getUrl(), is, proto));
} else if (req.isEvent()) {
data = decodeEventData(channel, in);
data = decodeEventData(channel, CodecSupport.deserialize(channel.getUrl(), is, proto));
} else {
DecodeableRpcInvocation inv;
if (channel.getUrl().getParameter(
Expand Down

0 comments on commit 0e886a9

Please sign in to comment.