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

@@ -42,7 +42,7 @@ public class CrudRequestMappingHandlerMapping extends RequestMappingHandlerMappi
@Override
protected RequestMappingInfo getMappingForMethod(@NonNull Method method, @NonNull Class<?> handlerType) {
RequestMappingInfo requestMappingInfo = super.getMappingForMethod(method, handlerType);
if (null == requestMappingInfo) {
if (requestMappingInfo == null) {
return null;
}
// 如果没有声明 @CrudRequestMapping 注解,直接返回

View File

@@ -56,7 +56,7 @@ public class PageResp<L> extends BasePageResp<L> {
* @return 分页信息
*/
public static <T, L> PageResp<L> build(Page<T> page, Class<L> targetClass) {
if (null == page) {
if (page == null) {
return empty();
}
return new PageResp<>(BeanUtil.copyToList(page.getRecords(), targetClass), page.getTotalRow());
@@ -70,7 +70,7 @@ public class PageResp<L> extends BasePageResp<L> {
* @return 分页信息
*/
public static <L> PageResp<L> build(Page<L> page) {
if (null == page) {
if (page == null) {
return empty();
}
return new PageResp<>(page.getRecords(), page.getTotalRow());

View File

@@ -220,7 +220,7 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T extends BaseIdD
* @param obj 待填充信息
*/
protected void fill(Object obj) {
if (null == obj) {
if (obj == null) {
return;
}
OperateTemplate operateTemplate = SpringUtil.getBean(OperateTemplate.class);

View File

@@ -56,7 +56,7 @@ public class PageResp<L> extends BasePageResp<L> {
* @return 分页信息
*/
public static <T, L> PageResp<L> build(IPage<T> page, Class<L> targetClass) {
if (null == page) {
if (page == null) {
return empty();
}
return new PageResp<>(BeanUtil.copyToList(page.getRecords(), targetClass), page.getTotal());
@@ -70,7 +70,7 @@ public class PageResp<L> extends BasePageResp<L> {
* @return 分页信息
*/
public static <L> PageResp<L> build(IPage<L> page) {
if (null == page) {
if (page == null) {
return empty();
}
return new PageResp<>(page.getRecords(), page.getTotal());

View File

@@ -311,7 +311,7 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T extends BaseIdD
* @param obj 待填充信息
*/
protected void fill(Object obj) {
if (null == obj) {
if (obj == null) {
return;
}
OperateTemplate operateTemplate = SpringUtil.getBean(OperateTemplate.class);

View File

@@ -82,7 +82,7 @@ public class DefaultDataPermissionHandler implements DataPermissionHandler {
for (Method method : methodArr) {
DataPermission dataPermission = method.getAnnotation(DataPermission.class);
String name = method.getName();
if (null == dataPermission || !CharSequenceUtil.equalsAny(methodName, name, name + "_COUNT")) {
if (dataPermission == null || !CharSequenceUtil.equalsAny(methodName, name, name + "_COUNT")) {
continue;
}
if (dataPermissionUserContextProvider.isFilter()) {