【fix sonar】oConvertUtils文件

This commit is contained in:
梁琦涛
2023-03-08 15:44:45 +08:00
parent 8158d7bc25
commit eb88c3091c
@@ -194,7 +194,7 @@ public class oConvertUtils {
}
return result;
} catch (NumberFormatException e) {
return null;
return new Integer[0];
}
}
@@ -241,12 +241,13 @@ public class oConvertUtils {
}
public static long stringToLong(String str) {
Long test = new Long(0);
long test = 0L;
try {
test = Long.valueOf(str);
test = Long.parseLong(str);
} catch (Exception e) {
log.error("异常",e);
}
return test.longValue();
return test;
}
/**
@@ -609,7 +610,7 @@ public class oConvertUtils {
*/
public static<F,T> List<T> entityListToModelList(List<F> fromList, Class<T> tClass){
if(fromList == null || fromList.isEmpty()){
return null;
return Collections.emptyList();
}
List<T> tList = new ArrayList<>();
for(F f : fromList){