-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
It is not uncommon to attach timestamps to the "prerelease" part of package version strings. Here is an example -- https://registry.npmjs.org/puppeteer/1.3.0-next.1524774887046
The timestamp is in the unit of microsecond, and hence exceeds the boundary of Integer.MAX_VALUE. Feeding the above example into Version.from() results in this exception:
Caused by: java.lang.NumberFormatException: For input string: "1524774887046"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:583)
at java.lang.Integer.parseInt(Integer.java:615)
at com.github.yuchi.semver.Version.<init>(Version.java:81)
at com.github.yuchi.semver.Version.<init>(Version.java:32)
Using Long may solve the issue. Or all numeric parts in a version string should stay in string data type.
Metadata
Metadata
Assignees
Labels
No labels