Fix parsing of build in FaweVersion

Dieser Commit ist enthalten in:
dordsor21 2021-12-22 11:44:37 +00:00
Ursprung d98f626ba6
Commit 77802758a9
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B

Datei anzeigen

@ -36,7 +36,8 @@ public class FaweVersion {
} }
this.semver = ver; this.semver = ver;
this.snapshot = split.length > 1 && split[1].toLowerCase(Locale.ROOT).contains("snapshot"); this.snapshot = split.length > 1 && split[1].toLowerCase(Locale.ROOT).contains("snapshot");
this.build = version.contains("-") ? Integer.parseInt(version.substring(version.indexOf('-') + 10)) : 0; int buildIndex = this.snapshot ? 2 : 1;
this.build = split.length == buildIndex + 1 ? Integer.parseInt(split[buildIndex]) : 0;
this.hash = Integer.parseInt(commit.substring(commit.indexOf('=') + 1), 16); this.hash = Integer.parseInt(commit.substring(commit.indexOf('=') + 1), 16);
String[] split2 = date.substring(date.indexOf('=') + 1).split("\\."); String[] split2 = date.substring(date.indexOf('=') + 1).split("\\.");
this.year = Integer.parseInt(split2[0]); this.year = Integer.parseInt(split2[0]);