From: Artur Signell Date: Tue, 24 Nov 2009 08:52:46 +0000 (+0000) Subject: Fixed version parsing for #3553 X-Git-Tag: 6.7.0.beta1~2272 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4f6f373c195093f003f5144ae610fa2097f77971;p=vaadin-framework.git Fixed version parsing for #3553 svn changeset:9972/svn branch:6.2 --- diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java index b2ef6f466f..9d10d1ef36 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java @@ -59,35 +59,48 @@ import com.vaadin.ui.Window; @SuppressWarnings("serial") public abstract class AbstractApplicationServlet extends HttpServlet { /** - * Version number of this release. For example "5.0.0". + * The version number of this release. For example "6.2.0". Always in the + * format "major.minor.revision[.build]". The build part is optional. All of + * major, minor, revision must be integers. */ public static final String VERSION; /** - * Major version number. For example 5 in 5.1.0. + * Major version number. For example 5 in 6.2.0. */ public static final int VERSION_MAJOR; /** - * Minor version number. For example 1 in 5.1.0. + * Minor version number. For example 1 in 6.2.0. */ public static final int VERSION_MINOR; /** - * Builds number. For example 0-custom_tag in 5.0.0-custom_tag. + * Version revision number. For example 0 in 6.2.0. + */ + public static final int VERSION_REVISION; + + /** + * Build identifier. For example "nightly-20091123-c9963" in + * 6.2.0.nightly-20091123-c9963. */ public static final String VERSION_BUILD; /* Initialize version numbers from string replaced by build-script. */ static { if ("@VERSION@".equals("@" + "VERSION" + "@")) { - VERSION = "5.9.9-INTERNAL-NONVERSIONED-DEBUG-BUILD"; + VERSION = "9.9.9.INTERNAL-DEBUG-BUILD"; } else { VERSION = "@VERSION@"; } - final String[] digits = VERSION.split("\\."); + final String[] digits = VERSION.split("\\.", 4); VERSION_MAJOR = Integer.parseInt(digits[0]); VERSION_MINOR = Integer.parseInt(digits[1]); - VERSION_BUILD = digits[2]; + VERSION_REVISION = Integer.parseInt(digits[2]); + if (digits.length == 4) { + VERSION_BUILD = digits[3]; + } else { + VERSION_BUILD = ""; + } } /**