Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dubbo-4685] Improve if-block from if(hasException == false) to if (!hasException) #4695

Merged
merged 1 commit into from
Jul 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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