You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2019/10/10 07:25:18 UTC
[dubbo] branch master updated: revert #5099,
deserialization readObject related changes.
This is an automated email from the ASF dual-hosted git repository.
liujun 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 c31ef9a revert #5099, deserialization readObject related changes.
c31ef9a is described below
commit c31ef9ad934688469826b39f35b709f712e56c75
Author: ken.lj <ke...@gmail.com>
AuthorDate: Thu Oct 10 15:25:04 2019 +0800
revert #5099, deserialization readObject related changes.
---
.../apache/dubbo/rpc/protocol/dubbo/DecodeableRpcResult.java | 2 +-
.../dubbo/common/serialize/gson/GsonJsonObjectInput.java | 11 ++++++-----
2 files changed, 7 insertions(+), 6 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 0b53dc5..9515a1b 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(Throwable.class);
+ Object obj = in.readObject();
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 239841a..9bac747 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
@@ -17,17 +17,18 @@
package org.apache.dubbo.common.serialize.gson;
-import com.google.gson.Gson;
import org.apache.dubbo.common.serialize.ObjectInput;
import org.apache.dubbo.common.utils.PojoUtils;
+import com.google.gson.Gson;
+
import java.io.BufferedReader;
+import java.io.EOFException;
+import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.lang.reflect.Type;
import java.io.Reader;
-import java.io.IOException;
-import java.io.EOFException;
+import java.lang.reflect.Type;
public class GsonJsonObjectInput implements ObjectInput {
private final BufferedReader reader;
@@ -90,7 +91,7 @@ public class GsonJsonObjectInput implements ObjectInput {
@Override
public Object readObject() throws IOException, ClassNotFoundException {
String json = readLine();
- return gson.fromJson(json, Object.class);
+ return gson.fromJson(json, String.class);
}
@Override