Skip to content

Commit

Permalink
code style: use code block with simple if.
Browse files Browse the repository at this point in the history
  • Loading branch information
dowenliu-xyz committed Jun 8, 2024
1 parent 878872e commit 3902153
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ final class HandlerMeta {
* @throws IllegalArgumentException if `originMethod` is null
*/
static HandlerMeta handlerMetaOf(Method originMethod, Class<?> handlerClass, String handlerName) {
if (originMethod == null) throw new IllegalArgumentException("originMethod should not be null");
if (originMethod == null) {
throw new IllegalArgumentException("originMethod should not be null");
}
return new HandlerMeta(
handlerClass, originMethod.getReturnType(), handlerName, originMethod.getParameterTypes());
}
Expand All @@ -55,8 +57,12 @@ private HandlerMeta(Class<?> handlerClass, Class<?> returnType, String handlerNa

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;

Check warning on line 61 in sentinel-extension/sentinel-annotation-aspectj/src/main/java/com/alibaba/csp/sentinel/annotation/aspectj/HandlerMeta.java

View check run for this annotation

Codecov / codecov/patch

sentinel-extension/sentinel-annotation-aspectj/src/main/java/com/alibaba/csp/sentinel/annotation/aspectj/HandlerMeta.java#L61

Added line #L61 was not covered by tests
}
if (o == null || getClass() != o.getClass()) {
return false;

Check warning on line 64 in sentinel-extension/sentinel-annotation-aspectj/src/main/java/com/alibaba/csp/sentinel/annotation/aspectj/HandlerMeta.java

View check run for this annotation

Codecov / codecov/patch

sentinel-extension/sentinel-annotation-aspectj/src/main/java/com/alibaba/csp/sentinel/annotation/aspectj/HandlerMeta.java#L64

Added line #L64 was not covered by tests
}
HandlerMeta that = (HandlerMeta) o;
return Objects.equals(handlerClass, that.handlerClass) &&
Objects.equals(returnType, that.returnType) &&
Expand Down

0 comments on commit 3902153

Please sign in to comment.