代码优化

This commit is contained in:
thinkgem
2024-03-11 16:56:57 +08:00
parent 5e4608d486
commit d7c9138a31
7 changed files with 42 additions and 18 deletions

View File

@@ -93,7 +93,7 @@ public class IpUtils {
}
public static byte[] textToNumericFormatV4(String paramString) {
if (paramString.length() == 0) {
if (paramString.isEmpty()) {
return null;
}
byte[] arrayOfByte = new byte[4];

View File

@@ -1,5 +1,7 @@
package com.jeesite.common.utils;
import org.apache.commons.lang3.StringUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
@@ -7,8 +9,6 @@ import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
/**
* 身份证工具类
*
@@ -152,7 +152,7 @@ public class IdcardUtils extends StringUtils {
int iSum17 = getPowerSum(iCard);
// 获取校验位
String sVal = getCheckCode18(iSum17);
if (sVal.length() > 0) {
if (!sVal.isEmpty()) {
idCard18 += sVal;
} else {
return null;
@@ -205,7 +205,7 @@ public class IdcardUtils extends StringUtils {
int iSum17 = getPowerSum(iCard);
// 获取校验位
String val = getCheckCode18(iSum17);
if (val.length() > 0) {
if (!val.isEmpty()) {
if (val.equalsIgnoreCase(code18)) {
bTrue = true;
}