mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Warnings.
This commit is contained in:
parent
446901283d
commit
f10749adae
1 changed files with 5 additions and 4 deletions
|
@ -10,16 +10,17 @@ public class Versions {
|
||||||
/**
|
/**
|
||||||
* Turn "6.9.4" into 600090004
|
* Turn "6.9.4" into 600090004
|
||||||
*/
|
*/
|
||||||
public fun toLongVersion(version: String) : Long {
|
fun toLongVersion(version: String) : Long {
|
||||||
val count = version.countChar('.')
|
val count = version.countChar('.')
|
||||||
val normalizedVersion = if (count == 2) version else if (count == 1) version + ".0"
|
val normalizedVersion =
|
||||||
else version + ".0.0"
|
if (count == 2) version else if (count == 1) version + ".0"
|
||||||
|
else version + ".0.0"
|
||||||
|
|
||||||
fun parseLong(s: String, radix: Int) : Long {
|
fun parseLong(s: String, radix: Int) : Long {
|
||||||
try {
|
try {
|
||||||
return java.lang.Long.parseLong(s, radix)
|
return java.lang.Long.parseLong(s, radix)
|
||||||
} catch(ex: NumberFormatException) {
|
} catch(ex: NumberFormatException) {
|
||||||
warn("Couldn't parse version \"${version}\"")
|
warn("Couldn't parse version \"$version\"")
|
||||||
return 0L
|
return 0L
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue