From 17eec667fb73a70a2f9bd0d54afbf6610a896c85 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Mon, 5 Dec 2022 14:46:58 +0100 Subject: [PATCH] better release number representation --- .../net/yacy/peers/operation/yacyVersion.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/source/net/yacy/peers/operation/yacyVersion.java b/source/net/yacy/peers/operation/yacyVersion.java index edc1f299a..b9bd56e68 100644 --- a/source/net/yacy/peers/operation/yacyVersion.java +++ b/source/net/yacy/peers/operation/yacyVersion.java @@ -16,7 +16,7 @@ public class yacyVersion implements Comparator, Comparable, Comparable 2) { try { - this.svn = Integer.parseInt(comp[2]); + this.svn = Long.parseLong(comp[2]); this.git = ""; } catch (final NumberFormatException e) { // this is not a number, so it is a new release name using an git version hash - this.svn = 0; + // to have an easy way to compare versions constructed that way, we make a fake svn number using the date + this.svn = Long.parseLong(this.dateStamp); this.git = comp[2]; } } else { - this.svn = 0; // we migrate to git + this.svn = 0L; // we migrate to git this.git = ""; } // finished! we parsed a relase string @@ -110,7 +111,7 @@ public class yacyVersion implements Comparator, Comparable, Comparable, Comparable 0.0d) d = d / 10000.0d; // long numbers constructed from dates which are four more digits long + return this.getReleaseNr() + d; } public String getName() {