style: 调整代码风格 null != xx => xx != null(更符合大众风格)

This commit is contained in:
2025-05-17 13:50:59 +08:00
parent 49bd289e29
commit ae7a267c1d
19 changed files with 49 additions and 48 deletions

View File

@@ -115,7 +115,7 @@ public class StringConstants {
public static final String SLASH = "/";
/**
* 双斜杠 {@code "//"}
* 双斜杠 {@code "//"}
*/
public static final String DOUBLE_SLASH = "//";

View File

@@ -57,7 +57,7 @@ public class ExceptionUtils {
Thread.currentThread().interrupt();
}
}
if (null != throwable) {
if (throwable != null) {
log.error(throwable.getMessage(), throwable);
}
}
@@ -120,7 +120,7 @@ public class ExceptionUtils {
try {
return exSupplier.get();
} catch (Exception e) {
if (null != exConsumer) {
if (exConsumer != null) {
exConsumer.accept(e);
}
return defaultValue;

View File

@@ -59,7 +59,7 @@ public class Validator {
* @param exceptionType 异常类型
*/
protected static void throwIfNotNull(Object obj, String message, Class<? extends RuntimeException> exceptionType) {
throwIf(null != obj, message, exceptionType);
throwIf(obj != null, message, exceptionType);
}
/**
@@ -193,7 +193,7 @@ public class Validator {
protected static void throwIf(BooleanSupplier conditionSupplier,
String message,
Class<? extends RuntimeException> exceptionType) {
if (null != conditionSupplier && conditionSupplier.getAsBoolean()) {
if (conditionSupplier != null && conditionSupplier.getAsBoolean()) {
throw ReflectUtil.newInstance(exceptionType, message);
}
}