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

This commit is contained in:
2025-06-01 11:09:12 +08:00
parent f83a901626
commit 265d90fa4c
21 changed files with 34 additions and 34 deletions

View File

@@ -45,7 +45,7 @@ public class ExceptionUtils {
* @param throwable 异常
*/
public static void printException(Runnable runnable, Throwable throwable) {
if (null == throwable && runnable instanceof Future<?> future) {
if (throwable == null && runnable instanceof Future<?> future) {
try {
if (future.isDone()) {
future.get();

View File

@@ -50,7 +50,7 @@ public class IpUtils {
}
Ip2regionSearcher ip2regionSearcher = SpringUtil.getBean(Ip2regionSearcher.class);
IpInfo ipInfo = ip2regionSearcher.memorySearch(ip);
if (null == ipInfo) {
if (ipInfo == null) {
return null;
}
Set<String> regionSet = CollUtil.newLinkedHashSet(ipInfo.getCountry(), ipInfo.getRegion(), ipInfo

View File

@@ -57,7 +57,7 @@ public class ServletUtils extends JakartaServletUtil {
* @return 浏览器及其版本信息
*/
public static String getBrowser(HttpServletRequest request) {
if (null == request) {
if (request == null) {
return null;
}
return getBrowser(request.getHeader("User-Agent"));
@@ -90,7 +90,7 @@ public class ServletUtils extends JakartaServletUtil {
* @return 操作系统
*/
public static String getOs(HttpServletRequest request) {
if (null == request) {
if (request == null) {
return null;
}
return getOs(request.getHeader("User-Agent"));

View File

@@ -48,7 +48,7 @@ public class Validator {
* @param exceptionType 异常类型
*/
protected static void throwIfNull(Object obj, String message, Class<? extends RuntimeException> exceptionType) {
throwIf(null == obj, message, exceptionType);
throwIf(obj == null, message, exceptionType);
}
/**