We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c4350c8 commit 2ac1692Copy full SHA for 2ac1692
kernel/src/main/java/com/itextpdf/kernel/Version.java
@@ -281,11 +281,10 @@ static String[] parseVersionString(String version) {
281
}
282
283
static boolean isVersionNumeric(String version) {
284
- //I did not want to introduce an extra dependency on apache.commons in order to use StringUtils.
285
- //This small method is not the most optimal, but it should do for release
286
try {
287
- Double.parseDouble(version);
288
- return true;
+ int value = (int) Integer.parseInt(version);
+ // parseInt accepts numbers which start with a plus sign, but for a version it's unacceptable
+ return value >= 0 && !version.contains("+");
289
} catch (NumberFormatException e) {
290
return false;
291
0 commit comments