File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed
src/main/java/org/gephi/graph/impl Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -162,23 +162,15 @@ protected void setEdgeCounter(int count) {
162162 }
163163
164164 private static boolean isNumeric (String str ) {
165- if (str == null ) {
165+ if (str == null || str . isEmpty () ) {
166166 return false ;
167167 }
168- char [] data = str .toCharArray ();
169- if (data .length <= 0 || data .length > 9 ) {
168+ try {
169+ Integer .parseInt (str );
170+ return true ;
171+ } catch (NumberFormatException e ) {
170172 return false ;
171173 }
172- int index = 0 ;
173- if (data [0 ] == '-' && data .length > 1 ) {
174- index = 1 ;
175- }
176- for (; index < data .length ; index ++) {
177- if (data [index ] < '0' || data [index ] > '9' ) {
178- return false ;
179- }
180- }
181- return true ;
182174 }
183175
184176 public int deepHashCode () {
You can’t perform that action at this time.
0 commit comments