Skip to content

Commit

Permalink
[type:refactor] Optimize code style (#5878)
Browse files Browse the repository at this point in the history
Co-authored-by: likeguo <[email protected]>
  • Loading branch information
po-168 and li-keguo authored Dec 31, 2024
1 parent e4065e4 commit b18f4f9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class NacosDiscoveryService implements ShenyuDiscoveryService {

@Override
public void init(final DiscoveryConfig config) {
if (this.namingService != null) {
if (Objects.nonNull(this.namingService)) {
LOGGER.info("Nacos naming service already registered");
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
package org.apache.shenyu.disruptor.consumer;

import com.lmax.disruptor.WorkHandler;
import java.util.Objects;
import org.apache.shenyu.disruptor.event.DataEvent;
import org.apache.shenyu.disruptor.event.OrderlyDataEvent;
import org.apache.shenyu.disruptor.thread.OrderlyExecutor;

import java.util.Objects;
import java.util.concurrent.ThreadPoolExecutor;

/**
Expand Down Expand Up @@ -68,6 +68,6 @@ private ThreadPoolExecutor orderly(final DataEvent<T> t) {
}

private boolean isEmpty(final String t) {
return t == null || t.isEmpty();
return Objects.isNull(t) || t.isEmpty();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
if (Objects.isNull(o) || getClass() != o.getClass()) {
return false;
}
Upstream that = (Upstream) o;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

public class ResponsiveException extends ShenyuException {

private static final long serialVersionUID = 3951601337229132230L;

private final int code;

private final ServerWebExchange webExchange;
Expand Down

0 comments on commit b18f4f9

Please sign in to comment.