This commit is contained in:
thinkgem
2022-06-21 09:27:05 +08:00
parent a4f9c5332c
commit 8951a3f07f
22 changed files with 133 additions and 120 deletions

View File

@@ -74,15 +74,15 @@ public class DesUtils {
String encData = "";
List firstKeyBt = null, secondKeyBt = null, thirdKeyBt = null;
int firstLength = 0, secondLength = 0, thirdLength = 0;
if (firstKey != null && !firstKey.equals("")) {
if (firstKey != null && !"".equals(firstKey)) {
firstKeyBt = getKeyBytes(firstKey);
firstLength = firstKeyBt.size();
}
if (secondKey != null && !secondKey.equals("")) {
if (secondKey != null && !"".equals(secondKey)) {
secondKeyBt = getKeyBytes(secondKey);
secondLength = secondKeyBt.size();
}
if (thirdKey != null && !thirdKey.equals("")) {
if (thirdKey != null && !"".equals(thirdKey)) {
thirdKeyBt = getKeyBytes(thirdKey);
thirdLength = thirdKeyBt.size();
}
@@ -91,7 +91,7 @@ public class DesUtils {
if (leng < 4) {
int[] bt = strToBt(data);
int[] encByte = null;
if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("") && thirdKey != null && !firstKey.equals("")) {
if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey) && thirdKey != null && !"".equals(firstKey)) {
int[] tempBt;
int x, y, z;
tempBt = bt;
@@ -106,7 +106,7 @@ public class DesUtils {
}
encByte = tempBt;
} else {
if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("")) {
if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey)) {
int[] tempBt;
int x, y;
tempBt = bt;
@@ -118,7 +118,7 @@ public class DesUtils {
}
encByte = tempBt;
} else {
if (firstKey != null && !firstKey.equals("")) {
if (firstKey != null && !"".equals(firstKey)) {
int[] tempBt;
int x = 0;
tempBt = bt;
@@ -138,7 +138,7 @@ public class DesUtils {
String tempData = data.substring(i * 4 + 0, i * 4 + 4);
int[] tempByte = strToBt(tempData);
int[] encByte = null;
if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("") && thirdKey != null && !thirdKey.equals("")) {
if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey) && thirdKey != null && !"".equals(thirdKey)) {
int[] tempBt;
int x, y, z;
tempBt = tempByte;
@@ -153,7 +153,7 @@ public class DesUtils {
}
encByte = tempBt;
} else {
if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("")) {
if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey)) {
int[] tempBt;
int x, y;
tempBt = tempByte;
@@ -165,7 +165,7 @@ public class DesUtils {
}
encByte = tempBt;
} else {
if (firstKey != null && !firstKey.equals("")) {
if (firstKey != null && !"".equals(firstKey)) {
int[] tempBt;
int x;
tempBt = tempByte;
@@ -182,7 +182,7 @@ public class DesUtils {
String remainderData = data.substring(iterator * 4 + 0, leng);
int[] tempByte = strToBt(remainderData);
int[] encByte = null;
if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("") && thirdKey != null && !thirdKey.equals("")) {
if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey) && thirdKey != null && !"".equals(thirdKey)) {
int[] tempBt;
int x, y, z;
tempBt = tempByte;
@@ -197,7 +197,7 @@ public class DesUtils {
}
encByte = tempBt;
} else {
if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("")) {
if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey)) {
int[] tempBt;
int x, y;
tempBt = tempByte;
@@ -209,7 +209,7 @@ public class DesUtils {
}
encByte = tempBt;
} else {
if (firstKey != null && !firstKey.equals("")) {
if (firstKey != null && !"".equals(firstKey)) {
int[] tempBt;
int x;
tempBt = tempByte;
@@ -237,15 +237,15 @@ public class DesUtils {
String decStr = "";
List firstKeyBt = null, secondKeyBt = null, thirdKeyBt = null;
int firstLength = 0, secondLength = 0, thirdLength = 0;
if (firstKey != null && !firstKey.equals("")) {
if (firstKey != null && !"".equals(firstKey)) {
firstKeyBt = getKeyBytes(firstKey);
firstLength = firstKeyBt.size();
}
if (secondKey != null && !secondKey.equals("")) {
if (secondKey != null && !"".equals(secondKey)) {
secondKeyBt = getKeyBytes(secondKey);
secondLength = secondKeyBt.size();
}
if (thirdKey != null && !thirdKey.equals("")) {
if (thirdKey != null && !"".equals(thirdKey)) {
thirdKeyBt = getKeyBytes(thirdKey);
thirdLength = thirdKeyBt.size();
}
@@ -261,7 +261,7 @@ public class DesUtils {
intByte[j] = Integer.parseInt(strByte.substring(j, j + 1));
}
int[] decByte = null;
if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("") && thirdKey != null && !thirdKey.equals("")) {
if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey) && thirdKey != null && !"".equals(thirdKey)) {
int[] tempBt;
int x, y, z;
tempBt = intByte;
@@ -276,7 +276,7 @@ public class DesUtils {
}
decByte = tempBt;
} else {
if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("")) {
if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey)) {
int[] tempBt;
int x, y, z;
tempBt = intByte;
@@ -288,7 +288,7 @@ public class DesUtils {
}
decByte = tempBt;
} else {
if (firstKey != null && !firstKey.equals("")) {
if (firstKey != null && !"".equals(firstKey)) {
int[] tempBt;
int x, y, z;
tempBt = intByte;
@@ -382,37 +382,37 @@ public class DesUtils {
*/
public String bt4ToHex(String binary) {
String hex = "";
if (binary.equalsIgnoreCase("0000")) {
if ("0000".equalsIgnoreCase(binary)) {
hex = "0";
} else if (binary.equalsIgnoreCase("0001")) {
} else if ("0001".equalsIgnoreCase(binary)) {
hex = "1";
} else if (binary.equalsIgnoreCase("0010")) {
} else if ("0010".equalsIgnoreCase(binary)) {
hex = "2";
} else if (binary.equalsIgnoreCase("0011")) {
} else if ("0011".equalsIgnoreCase(binary)) {
hex = "3";
} else if (binary.equalsIgnoreCase("0100")) {
} else if ("0100".equalsIgnoreCase(binary)) {
hex = "4";
} else if (binary.equalsIgnoreCase("0101")) {
} else if ("0101".equalsIgnoreCase(binary)) {
hex = "5";
} else if (binary.equalsIgnoreCase("0110")) {
} else if ("0110".equalsIgnoreCase(binary)) {
hex = "6";
} else if (binary.equalsIgnoreCase("0111")) {
} else if ("0111".equalsIgnoreCase(binary)) {
hex = "7";
} else if (binary.equalsIgnoreCase("1000")) {
} else if ("1000".equalsIgnoreCase(binary)) {
hex = "8";
} else if (binary.equalsIgnoreCase("1001")) {
} else if ("1001".equalsIgnoreCase(binary)) {
hex = "9";
} else if (binary.equalsIgnoreCase("1010")) {
} else if ("1010".equalsIgnoreCase(binary)) {
hex = "A";
} else if (binary.equalsIgnoreCase("1011")) {
} else if ("1011".equalsIgnoreCase(binary)) {
hex = "B";
} else if (binary.equalsIgnoreCase("1100")) {
} else if ("1100".equalsIgnoreCase(binary)) {
hex = "C";
} else if (binary.equalsIgnoreCase("1101")) {
} else if ("1101".equalsIgnoreCase(binary)) {
hex = "D";
} else if (binary.equalsIgnoreCase("1110")) {
} else if ("1110".equalsIgnoreCase(binary)) {
hex = "E";
} else if (binary.equalsIgnoreCase("1111")) {
} else if ("1111".equalsIgnoreCase(binary)) {
hex = "F";
}
@@ -426,51 +426,51 @@ public class DesUtils {
*/
public String hexToBt4(String hex) {
String binary = "";
if (hex.equalsIgnoreCase("0")) {
if ("0".equalsIgnoreCase(hex)) {
binary = "0000";
} else if (hex.equalsIgnoreCase("1")) {
} else if ("1".equalsIgnoreCase(hex)) {
binary = "0001";
}
if (hex.equalsIgnoreCase("2")) {
if ("2".equalsIgnoreCase(hex)) {
binary = "0010";
}
if (hex.equalsIgnoreCase("3")) {
if ("3".equalsIgnoreCase(hex)) {
binary = "0011";
}
if (hex.equalsIgnoreCase("4")) {
if ("4".equalsIgnoreCase(hex)) {
binary = "0100";
}
if (hex.equalsIgnoreCase("5")) {
if ("5".equalsIgnoreCase(hex)) {
binary = "0101";
}
if (hex.equalsIgnoreCase("6")) {
if ("6".equalsIgnoreCase(hex)) {
binary = "0110";
}
if (hex.equalsIgnoreCase("7")) {
if ("7".equalsIgnoreCase(hex)) {
binary = "0111";
}
if (hex.equalsIgnoreCase("8")) {
if ("8".equalsIgnoreCase(hex)) {
binary = "1000";
}
if (hex.equalsIgnoreCase("9")) {
if ("9".equalsIgnoreCase(hex)) {
binary = "1001";
}
if (hex.equalsIgnoreCase("A")) {
if ("A".equalsIgnoreCase(hex)) {
binary = "1010";
}
if (hex.equalsIgnoreCase("B")) {
if ("B".equalsIgnoreCase(hex)) {
binary = "1011";
}
if (hex.equalsIgnoreCase("C")) {
if ("C".equalsIgnoreCase(hex)) {
binary = "1100";
}
if (hex.equalsIgnoreCase("D")) {
if ("D".equalsIgnoreCase(hex)) {
binary = "1101";
}
if (hex.equalsIgnoreCase("E")) {
if ("E".equalsIgnoreCase(hex)) {
binary = "1110";
}
if (hex.equalsIgnoreCase("F")) {
if ("F".equalsIgnoreCase(hex)) {
binary = "1111";
}
return binary;

View File

@@ -247,7 +247,8 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
private static ThreadLocal<FSTConfiguration> fstConfiguration =
new NamedThreadLocal<FSTConfiguration>("FSTConfiguration") {
public FSTConfiguration initialValue() {
@Override
public FSTConfiguration initialValue() {
return FSTConfiguration.createDefaultConfiguration();
}
};

View File

@@ -76,7 +76,7 @@ public class WorkDayUtils {
* @return
*/
public String getChineseWeek(Calendar date) {
final String dayNames[] = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
final String[] dayNames = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
int dayOfWeek = date.get(Calendar.DAY_OF_WEEK);
// System.out.println(dayNames[dayOfWeek - 1]);
return dayNames[dayOfWeek - 1];

View File

@@ -170,7 +170,7 @@ public class VideoUtils {
command.add(getFfmpegFile());
command.add("-i");
command.add(inputFile);
if ((imgFileExtension.toLowerCase()).equals("gif")) {
if ("gif".equals(imgFileExtension.toLowerCase())) {
command.add("-vframes");
command.add("30");
command.add("-f");

View File

@@ -2227,7 +2227,7 @@ public class DiffMatchPatch {
if (m.group(2).length() == 0) {
patch.start1--;
patch.length1 = 1;
} else if (m.group(2).equals("0")) {
} else if ("0".equals(m.group(2))) {
patch.length1 = 0;
} else {
patch.start1--;
@@ -2238,7 +2238,7 @@ public class DiffMatchPatch {
if (m.group(4).length() == 0) {
patch.start2--;
patch.length2 = 1;
} else if (m.group(4).equals("0")) {
} else if ("0".equals(m.group(4))) {
patch.length2 = 0;
} else {
patch.start2--;

View File

@@ -123,7 +123,7 @@ public class PinyinUtils {
if (input == null){
return null;
}
char c[] = input.toCharArray();
char[] c = input.toCharArray();
for (int i = 0; i < c.length; i++) {
if (c[i] == ' ') {
c[i] = '\u3000';
@@ -143,7 +143,7 @@ public class PinyinUtils {
if (input == null){
return null;
}
char c[] = input.toCharArray();
char[] c = input.toCharArray();
for (int i = 0; i < c.length; i++) {
if (c[i] == '\u3000') {
c[i] = ' ';

View File

@@ -24,17 +24,17 @@ public class IdcardUtils extends StringUtils {
public static final int CHINA_ID_MAX_LENGTH = 18;
/** 省、直辖市代码表 */
public static final String cityCode[] = { "11", "12", "13", "14", "15",
public static final String[] cityCode = { "11", "12", "13", "14", "15",
"21", "22", "23", "31", "32", "33", "34", "35", "36", "37", "41",
"42", "43", "44", "45", "46", "50", "51", "52", "53", "54", "61",
"62", "63", "64", "65", "71", "81", "82", "91" };
/** 每位加权因子 */
public static final int power[] = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9,
public static final int[] power = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9,
10, 5, 8, 4, 2 };
/** 第18位校检码 */
public static final String verifyCode[] = { "1", "0", "X", "9", "8", "7",
public static final String[] verifyCode = { "1", "0", "X", "9", "8", "7",
"6", "5", "4", "3", "2" };
/** 最低年限 */
public static final int MIN = 1930;
@@ -177,7 +177,7 @@ public class IdcardUtils extends StringUtils {
}
String[] cardval = validateIdCard10(card);
if (cardval != null) {
if (cardval[2].equals("true")) {
if ("true".equals(cardval[2])) {
return true;
}
}
@@ -276,10 +276,10 @@ public class IdcardUtils extends StringUtils {
info[0] = "台湾";
System.out.println("11111");
String char2 = idCard.substring(1, 2);
if (char2.equals("1")) {
if ("1".equals(char2)) {
info[1] = "M";
System.out.println("MMMMMMM");
} else if (char2.equals("2")) {
} else if ("2".equals(char2)) {
info[1] = "F";
System.out.println("FFFFFFF");
} else {
@@ -361,7 +361,7 @@ public class IdcardUtils extends StringUtils {
sum = sum + Integer.valueOf(c + "") * iflag;
iflag--;
}
if (end.toUpperCase().equals("A")) {
if ("A".equals(end.toUpperCase())) {
sum = sum + 10;
} else {
sum = sum + Integer.valueOf(end);

View File

@@ -168,7 +168,7 @@ public abstract class ExcelReader extends DefaultHandler {
// 将单元格内容加入rowlist中在这之前先去掉字符串前后的空白符
} else if ("v".equals(name)) {
String value = lastContents.trim();
value = value.equals("") ? " " : value;
value = "".equals(value) ? " " : value;
try {
// 日期格式处理
if (dateFlag) {
@@ -188,7 +188,7 @@ public abstract class ExcelReader extends DefaultHandler {
curCol++;
} else {
// 如果标签名称为 row ,这说明已到行尾,调用 optRows() 方法
if (name.equals("row")) {
if ("row".equals(name)) {
getRows(sheetIndex + 1, curRow, rowList);
rowList.clear();
curRow++;

View File

@@ -23,21 +23,24 @@ public class MoneyType implements FieldType {
/**
* 获取对象值(导入)
*/
public Object getValue(String val) {
@Override
public Object getValue(String val) {
return val == null ? StringUtils.EMPTY : StringUtils.replace(val, ",", StringUtils.EMPTY);
}
/**
* 获取对象值(导出)
*/
public String setValue(Object val) {
@Override
public String setValue(Object val) {
return val == null ? StringUtils.EMPTY : nf.format(val);
}
/**
* 获取对象值格式(导出)
*/
public String getDataFormat() {
@Override
public String getDataFormat() {
return "0.00";
}

View File

@@ -464,7 +464,7 @@ public class BookMark {
// Get the first node and catch it's reference for return if
// the first child node is a style node (w:rPr).
childNode = parentNode.getFirstChild();
if (childNode != null && childNode.getNodeName().equals("w:rPr")) {
if (childNode != null && "w:rPr".equals(childNode.getNodeName())) {
styleNode = childNode;
} else {
// If the first node was not a style node and there are other