mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-08 16:57:09 +08:00
style: 调整代码风格 null != xx => xx != null(更符合大众风格)
This commit is contained in:
@@ -115,7 +115,7 @@ public class StringConstants {
|
||||
public static final String SLASH = "/";
|
||||
|
||||
/**
|
||||
* 双斜杠 {@code "//"}
|
||||
* 双斜杠 {@code "//"}
|
||||
*/
|
||||
public static final String DOUBLE_SLASH = "//";
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user