This is an automated email from the ASF dual-hosted git repository.
iluo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new 416c575 wrong event setting (#3043)
416c575 is described below
commit 416c57529f81f8d8df27e46c0e60501daeb5e867
Author: huazhongming <[email protected]>
AuthorDate: Wed Jan 16 14:59:15 2019 +0800
wrong event setting (#3043)
* wrong event setting
* modify event seeting
* modify
---
.../src/main/java/org/apache/dubbo/remoting/exchange/Request.java | 8 ++++++--
.../org/apache/dubbo/remoting/exchange/codec/ExchangeCodec.java | 5 +----
.../org/apache/dubbo/remoting/exchange/support/DefaultFuture.java | 3 +--
.../dubbo/remoting/transport/codec/DeprecatedExchangeCodec.java | 2 +-
.../main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java | 3 ++-
5 files changed, 11 insertions(+), 10 deletions(-)
diff --git
a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/Request.java
b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/Request.java
index abd0582..e5d233a 100644
---
a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/Request.java
+++
b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/Request.java
@@ -95,8 +95,12 @@ public class Request {
}
public void setEvent(String event) {
- mEvent = true;
- mData = event;
+ this.mEvent = true;
+ this.mData = event;
+ }
+
+ public void setEvent(boolean mEvent) {
+ this.mEvent = mEvent;
}
public boolean isBroken() {
diff --git
a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/codec/ExchangeCodec.java
b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/codec/ExchangeCodec.java
index 4031688..7eb64a1 100644
---
a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/codec/ExchangeCodec.java
+++
b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/codec/ExchangeCodec.java
@@ -43,9 +43,6 @@ import java.io.InputStream;
/**
* ExchangeCodec.
- *
- *
- *
*/
public class ExchangeCodec extends TelnetCodec {
@@ -176,7 +173,7 @@ public class ExchangeCodec extends TelnetCodec {
req.setVersion(Version.getProtocolVersion());
req.setTwoWay((flag & FLAG_TWOWAY) != 0);
if ((flag & FLAG_EVENT) != 0) {
- req.setEvent(Request.HEARTBEAT_EVENT);
+ req.setEvent(true);
}
try {
ObjectInput in = CodecSupport.deserialize(channel.getUrl(),
is, proto);
diff --git
a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java
b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java
index f79d99d..059fdaa 100644
---
a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java
+++
b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java
@@ -126,7 +126,7 @@ public class DefaultFuture implements ResponseFuture {
* @param channel channel to close
*/
public static void closeChannel(Channel channel) {
- for (Map.Entry<Long, Channel> entry: CHANNELS.entrySet()) {
+ for (Map.Entry<Long, Channel> entry : CHANNELS.entrySet()) {
if (channel.equals(entry.getValue())) {
DefaultFuture future = getFuture(entry.getKey());
if (future != null && !future.isDone()) {
@@ -255,7 +255,6 @@ public class DefaultFuture implements ResponseFuture {
if (callbackCopy == null) {
throw new NullPointerException("callback cannot be null.");
}
- c = null;
Response res = response;
if (res == null) {
throw new IllegalStateException("response cannot be null. url:" +
channel.getUrl());
diff --git
a/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/transport/codec/DeprecatedExchangeCodec.java
b/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/transport/codec/DeprecatedExchangeCodec.java
index 1dce90c..36b5831 100644
---
a/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/transport/codec/DeprecatedExchangeCodec.java
+++
b/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/transport/codec/DeprecatedExchangeCodec.java
@@ -167,7 +167,7 @@ final class DeprecatedExchangeCodec extends
DeprecatedTelnetCodec implements Cod
req.setVersion(Version.getProtocolVersion());
req.setTwoWay((flag & FLAG_TWOWAY) != 0);
if ((flag & FLAG_EVENT) != 0) {
- req.setEvent(Request.HEARTBEAT_EVENT);
+ req.setEvent(true);
}
try {
ObjectInput in = CodecSupport.deserialize(channel.getUrl(),
is, proto);
diff --git
a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java
b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java
index d6a8e14..9c1e2fc 100644
---
a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java
+++
b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java
@@ -114,7 +114,7 @@ public class DubboCodec extends ExchangeCodec implements
Codec2 {
req.setVersion(Version.getProtocolVersion());
req.setTwoWay((flag & FLAG_TWOWAY) != 0);
if ((flag & FLAG_EVENT) != 0) {
- req.setEvent(Request.HEARTBEAT_EVENT);
+ req.setEvent(true);
}
try {
Object data;
@@ -145,6 +145,7 @@ public class DubboCodec extends ExchangeCodec implements
Codec2 {
req.setBroken(true);
req.setData(t);
}
+
return req;
}
}