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:
@@ -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();
|
||||
|
@@ -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
|
||||
|
@@ -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"));
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user