From 2a97e8877989bd56717b9a352a98a553eed68b71 Mon Sep 17 00:00:00 2001 From: Nicholas Clarke Date: Wed, 2 Sep 2015 12:01:42 +0200 Subject: [PATCH] Version string changed to only show 40 char hashes nad ommit the build status as this can be deduced from the maven artifact version. --- .../java/dk/netarkivet/common/Constants.java | 30 +++++-------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/common/common-core/src/main/java/dk/netarkivet/common/Constants.java b/common/common-core/src/main/java/dk/netarkivet/common/Constants.java index de3c751409..78064e365d 100644 --- a/common/common-core/src/main/java/dk/netarkivet/common/Constants.java +++ b/common/common-core/src/main/java/dk/netarkivet/common/Constants.java @@ -53,28 +53,12 @@ public final class Constants { /** The mimetype for a list of CDX entries. */ public static final String CDX_MIME_TYPE = "application/x-cdx"; - /** Possible states of code. */ - private static enum CodeStatus { - /** Released code. */ - RELEASE, - /** Code is under codefreeze. The code is a release candidate. */ - CODEFREEZE, - /** - * The code is not production ready. Although it usually compiles, all code has not necessarily been tested. - */ - UNSTABLE - } - /** Extension of XML file names. */ public static final String XML_EXTENSION = ".xml"; // Version string. */ private static String version; - // It is QA's responsibility to update the following parameter on all release and codefreeze actions. - /** Current status of code. */ - private static final CodeStatus BUILDSTATUS = CodeStatus.UNSTABLE; - /** Current version of Heritrix used by netarkivet-code. */ private static final String HERITRIX_VERSION = "1.14.4"; @@ -117,13 +101,13 @@ public static String getVersionString() { sb.append("Version: "); sb.append(Constants.class.getPackage().getSpecificationVersion()); String implementationVersion = Constants.class.getPackage().getImplementationVersion(); - sb.append(" ("); - sb.append(implementationVersion.substring(0, 10)); - sb.append(")"); - sb.append(" status "); - sb.append(BUILDSTATUS); + if (implementationVersion != null && implementationVersion.length() == 40) { + sb.append(" ("); + sb.append(implementationVersion.substring(0, 10)); + sb.append(")"); + } version = sb.toString(); } return version;