【fix sonar】oConvertUtils文件
This commit is contained in:
+6
-5
@@ -194,7 +194,7 @@ public class oConvertUtils {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
return null;
|
return new Integer[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,12 +241,13 @@ public class oConvertUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static long stringToLong(String str) {
|
public static long stringToLong(String str) {
|
||||||
Long test = new Long(0);
|
long test = 0L;
|
||||||
try {
|
try {
|
||||||
test = Long.valueOf(str);
|
test = Long.parseLong(str);
|
||||||
} catch (Exception e) {
|
} 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){
|
public static<F,T> List<T> entityListToModelList(List<F> fromList, Class<T> tClass){
|
||||||
if(fromList == null || fromList.isEmpty()){
|
if(fromList == null || fromList.isEmpty()){
|
||||||
return null;
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
List<T> tList = new ArrayList<>();
|
List<T> tList = new ArrayList<>();
|
||||||
for(F f : fromList){
|
for(F f : fromList){
|
||||||
|
|||||||
Reference in New Issue
Block a user