From 30670accb070b20c1c770d1ebbd6d72e24fee2db Mon Sep 17 00:00:00 2001 From: sebdet Date: Tue, 4 Aug 2020 14:16:00 +0200 Subject: Upgrade to java 11 MOve SDC to Java 11, this is one of the PR to move to Jdk 11, jenkins will have to be changed as well Issue-ID: SDC-2725 Change-Id: I85f13f14ba8004f6e9656093a837465a2e4af3e1 Signed-off-by: sebdet Signed-off-by: xuegao Signed-off-by: sebdet --- .../src/main/java/org/openecomp/sdc/be/model/tosca/ToscaType.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'catalog-model/src/main/java/org') diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/ToscaType.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/ToscaType.java index 71abc54cb7..034f6fab92 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/ToscaType.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/ToscaType.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import java.text.DateFormat; import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.List; import java.util.Locale; import java.util.Map; @@ -90,7 +91,7 @@ public enum ToscaType { return true; case TIMESTAMP: try { - DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM, Locale.US).parse(value); + new SimpleDateFormat("MMM dd, yyyy hh:mm:ss a", Locale.US).parse(value); return true; } catch (ParseException e) { return false; @@ -168,7 +169,7 @@ public enum ToscaType { return Long.valueOf(value); case TIMESTAMP: try { - return DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM, Locale.US).parse(value); + return new SimpleDateFormat("MMM dd, yyyy hh:mm:ss a", Locale.US).parse(value); } catch (ParseException e) { throw new IllegalArgumentException("Value must be a valid timestamp", e); } -- cgit 1.2.3-korg