You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by cr...@apache.org on 2019/07/30 05:19:05 UTC

[dubbo] branch master updated: #4685 修改代码if判断false问题 if (hasException == false)修改成if (!hasException) (#4695)

This is an automated email from the ASF dual-hosted git repository.

crazyhzm 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 25ec31e  #4685  修改代码if判断false问题 if (hasException == false)修改成if (!hasException) (#4695)
25ec31e is described below

commit 25ec31ea169260712193e2bfba375637c6d4b1bf
Author: smipo <53...@users.noreply.github.com>
AuthorDate: Tue Jul 30 13:18:52 2019 +0800

    #4685  修改代码if判断false问题 if (hasException == false)修改成if (!hasException) (#4695)
---
 .../src/test/java/org/apache/dubbo/filter/LegacyInvoker.java            | 2 +-
 .../test/java/org/apache/dubbo/remoting/PerformanceClientFixedTest.java | 2 +-
 .../src/test/java/org/apache/dubbo/rpc/support/BlockMyInvoker.java      | 2 +-
 .../src/test/java/org/apache/dubbo/rpc/support/MyInvoker.java           | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dubbo-compatible/src/test/java/org/apache/dubbo/filter/LegacyInvoker.java b/dubbo-compatible/src/test/java/org/apache/dubbo/filter/LegacyInvoker.java
index f77e0a5..b1d19b5 100644
--- a/dubbo-compatible/src/test/java/org/apache/dubbo/filter/LegacyInvoker.java
+++ b/dubbo-compatible/src/test/java/org/apache/dubbo/filter/LegacyInvoker.java
@@ -59,7 +59,7 @@ public class LegacyInvoker<T> implements Invoker<T> {
 
     public Result invoke(Invocation invocation) throws RpcException {
         AppResponse result = new AppResponse();
-        if (hasException == false) {
+        if (!hasException) {
             result.setValue("alibaba");
         } else {
             result.setException(new RuntimeException("mocked exception"));
diff --git a/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/PerformanceClientFixedTest.java b/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/PerformanceClientFixedTest.java
index 93ccc76..8380f5a 100644
--- a/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/PerformanceClientFixedTest.java
+++ b/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/PerformanceClientFixedTest.java
@@ -80,7 +80,7 @@ public class PerformanceClientFixedTest  {
             } catch (Throwable t) {
                 t.printStackTrace();
             } finally {
-                if (client != null && client.isConnected() == false) {
+                if (client != null && !client.isConnected()) {
                     f++;
                     System.out.println("open client failed, try again " + f);
                     client.close();
diff --git a/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/support/BlockMyInvoker.java b/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/support/BlockMyInvoker.java
index 7fec8d4..ee6e1be 100644
--- a/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/support/BlockMyInvoker.java
+++ b/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/support/BlockMyInvoker.java
@@ -40,7 +40,7 @@ public class BlockMyInvoker<T> extends MyInvoker<T> {
     @Override
     public Result invoke(Invocation invocation) throws RpcException {
         AppResponse result = new AppResponse();
-        if (hasException == false) {
+        if (!hasException) {
             try {
                 Thread.sleep(blockTime);
             } catch (InterruptedException e) {
diff --git a/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/support/MyInvoker.java b/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/support/MyInvoker.java
index 57f1f1e..ffccff6 100644
--- a/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/support/MyInvoker.java
+++ b/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/support/MyInvoker.java
@@ -60,7 +60,7 @@ public class MyInvoker<T> implements Invoker<T> {
 
     public Result invoke(Invocation invocation) throws RpcException {
         AppResponse result = new AppResponse();
-        if (hasException == false) {
+        if (!hasException) {
             result.setValue("alibaba");
         } else {
             result.setException(new RuntimeException("mocked exception"));