From 60a139378e88719445a0958cadd4271dd5e2d6bc Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 25 Jun 2009 18:25:56 +0000 Subject: account for snapshot version in update conf git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@377 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'BKUWebStart/src/main/java/at') diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java index 5e4ab634..abc0b8ee 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java @@ -152,11 +152,19 @@ public class BKULauncher implements BKUControllerInterface { */ private boolean updateRequired(String oldVersion, String newVersion) { if (oldVersion != null) { + log.debug("comparing " + oldVersion + " to " + MIN_CONFIG_VERSION); + int majorEnd = oldVersion.indexOf('-'); - if (majorEnd > 0) { - oldVersion = oldVersion.substring(0, majorEnd); + String oldMajor = (majorEnd < 0) ? oldVersion : oldVersion.substring(0, majorEnd); + + int compare = oldMajor.compareTo(MIN_CONFIG_VERSION); + if (compare < 0 || + // SNAPSHOT versions are pre-releases (update if release required) + (compare == 0 && oldVersion.startsWith("-SNAPSHOT", majorEnd))) { + return true; + } else { + return false; } - return (oldVersion.compareTo(MIN_CONFIG_VERSION) < 0); } log.debug("no old version, update required"); return true; -- cgit v1.2.3