Skip to content

Commit

Permalink
#4685 修改代码if判断false问题 if (hasException == false)修改成if (!hasException) (
Browse files Browse the repository at this point in the history
  • Loading branch information
smipo authored and CrazyHZM committed Jul 30, 2019
1 parent 5d299af commit 25ec31e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public boolean isAvailable() {

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"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void testClient() throws Exception {
} 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public BlockMyInvoker(URL url, boolean hasException, long blockTime) {
@Override
public Result invoke(Invocation invocation) throws RpcException {
AppResponse result = new AppResponse();
if (hasException == false) {
if (!hasException) {
try {
Thread.sleep(blockTime);
} catch (InterruptedException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public boolean isAvailable() {

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"));
Expand Down

0 comments on commit 25ec31e

Please sign in to comment.