Skip to content

Commit ae0eed5

Browse files
committed
Fix another minor issue
1 parent c3c0c25 commit ae0eed5

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/main/java/org/gephi/graph/impl/GraphFactoryImpl.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff 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() {

0 commit comments

Comments
 (0)