summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2013-09-20 02:36:20 (EDT)
committer Stephan Born2013-10-23 12:16:10 (EDT)
commit215f9135aa12d6baea82a4248b86b0d541bcbb34 (patch)
treef6c0431bf4c2d76abd6628860200d67a25ed9dc9
parent92156c5c5a0576b2fa0e2a157598f71fd07f5853 (diff)
downloadorg.eclipse.stardust.ui.web-215f9135aa12d6baea82a4248b86b0d541bcbb34.zip
org.eclipse.stardust.ui.web-215f9135aa12d6baea82a4248b86b0d541bcbb34.tar.gz
org.eclipse.stardust.ui.web-215f9135aa12d6baea82a4248b86b0d541bcbb34.tar.bz2
Jira-ID: CRNT-30210
Added try/catch for CurrentVersion.getBuildVersion() Returned "dev" mode String from IppVersion.java if currentVersion is null. git-svn-id: https://svn.csa.sungard.com/repos/ipp2/product/trunk/stardust/ui.web@67437 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b Signed-off-by: Sidharth Singh <sidharth.singh@sungard.com>
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/env/impl/CurrentVersion.java14
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/env/impl/IppVersion.java10
2 files changed, 22 insertions, 2 deletions
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/env/impl/CurrentVersion.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/env/impl/CurrentVersion.java
index e078dc8..4adb57a 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/env/impl/CurrentVersion.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/env/impl/CurrentVersion.java
@@ -13,6 +13,8 @@ package org.eclipse.stardust.ui.web.viewscommon.common.spi.env.impl;
import java.text.MessageFormat;
import org.eclipse.stardust.common.config.Version;
+import org.eclipse.stardust.ui.web.common.log.LogManager;
+import org.eclipse.stardust.ui.web.common.log.Logger;
@@ -25,6 +27,8 @@ import org.eclipse.stardust.common.config.Version;
*/
public class CurrentVersion
{
+ private static final Logger trace = LogManager.getLogger(CurrentVersion.class);
+
private static final String BUILD_VERSION_NAME = "-buildVersionName";
private static final String VERSION_NAME = "-versionName";
public static final String COPYRIGHT_YEARS = "2000-2013";
@@ -57,7 +61,15 @@ public class CurrentVersion
public static Version getBuildVersion()
{
- return new Version(getBuildVersionName());
+ try
+ {
+ return new Version(getBuildVersionName());
+ }
+ catch (NumberFormatException e)
+ {
+ trace.error("Could not retrieve Version Information " + e.getLocalizedMessage());
+ return null;
+ }
}
public static String getCopyrightMessage()
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/env/impl/IppVersion.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/env/impl/IppVersion.java
index 16a3b42..0ed9e1f 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/env/impl/IppVersion.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/env/impl/IppVersion.java
@@ -38,6 +38,14 @@ public class IppVersion implements Version
public String getCompleteString()
{
- return currentVersion.toCompleteString();
+ if (null != currentVersion)
+ {
+ return currentVersion.toCompleteString();
+ }
+ else
+ {
+ // By default returning 'dev' mode
+ return "dev";
+ }
}
} \ No newline at end of file