You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by wa...@apache.org on 2019/09/24 00:32:43 UTC
[dubbo] branch master updated: Fixes a bug in gson's
deserialization feature (#5099)
This is an automated email from the ASF dual-hosted git repository.
wangxin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new 600f0db Fixes a bug in gson's deserialization feature (#5099)
600f0db is described below
commit 600f0db5fa3516fcee5e9b70e4bf100e49741840
Author: 张志勇 <go...@163.com>
AuthorDate: Tue Sep 24 08:32:29 2019 +0800
Fixes a bug in gson's deserialization feature (#5099)
---
.../java/org/apache/dubbo/rpc/protocol/dubbo/DecodeableRpcResult.java | 2 +-
.../org/apache/dubbo/common/serialize/gson/GsonJsonObjectInput.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DecodeableRpcResult.java b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DecodeableRpcResult.java
index 9515a1b..0b53dc5 100644
--- a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DecodeableRpcResult.java
+++ b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DecodeableRpcResult.java
@@ -141,7 +141,7 @@ public class DecodeableRpcResult extends AppResponse implements Codec, Decodeabl
private void handleException(ObjectInput in) throws IOException {
try {
- Object obj = in.readObject();
+ Object obj = in.readObject(Throwable.class);
if (!(obj instanceof Throwable)) {
throw new IOException("Response data error, expect Throwable, but get " + obj);
}
diff --git a/dubbo-serialization/dubbo-serialization-gson/src/main/java/org/apache/dubbo/common/serialize/gson/GsonJsonObjectInput.java b/dubbo-serialization/dubbo-serialization-gson/src/main/java/org/apache/dubbo/common/serialize/gson/GsonJsonObjectInput.java
index 056d719..239841a 100644
--- a/dubbo-serialization/dubbo-serialization-gson/src/main/java/org/apache/dubbo/common/serialize/gson/GsonJsonObjectInput.java
+++ b/dubbo-serialization/dubbo-serialization-gson/src/main/java/org/apache/dubbo/common/serialize/gson/GsonJsonObjectInput.java
@@ -90,7 +90,7 @@ public class GsonJsonObjectInput implements ObjectInput {
@Override
public Object readObject() throws IOException, ClassNotFoundException {
String json = readLine();
- return gson.fromJson(json, String.class);
+ return gson.fromJson(json, Object.class);
}
@Override