|
@@ -738,9 +738,13 @@ public final class CommonUtils {
|
|
|
*/
|
|
|
public static boolean isInteger(String str) {
|
|
|
Boolean strResult = str.matches("-?[0-9]+.?[0-9]*");
|
|
|
- if(strResult && Double.parseDouble(str)>0) {
|
|
|
- return true;
|
|
|
- }
|
|
|
+ try{
|
|
|
+ if(strResult && Double.parseDouble(str)>0) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }catch(NumberFormatException ex){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
return false;
|
|
|
}
|
|
|
}
|