This is an automated email from the ASF dual-hosted git repository. mibo pushed a commit to branch OLINGO-1349 in repository https://gitbox.apache.org/repos/asf/olingo-odata2.git
commit cd2db731c9df27a45ae97346ccc5fc5665e83473 Author: mibo <[email protected]> AuthorDate: Wed Apr 24 08:54:43 2019 +0200 [OLINGO-1349] Get TZ only once --- .../src/main/java/org/apache/olingo/odata2/core/edm/EdmTime.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/EdmTime.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/EdmTime.java index fc99d6a..22f3cc8 100644 --- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/EdmTime.java +++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/EdmTime.java @@ -43,6 +43,7 @@ public class EdmTime extends AbstractSimpleType { private static final Pattern PATTERN = Pattern.compile( "PT(?:(\\p{Digit}{1,2})H)?(?:(\\p{Digit}{1,4})M)?(?:(\\p{Digit}{1,5})(?:\\.(\\p{Digit}+?)0*)?S)?"); private static final EdmTime instance = new EdmTime(); + private static final TimeZone TIME_ZONE_GMT = TimeZone.getTimeZone("GMT"); public static EdmTime getInstance() { return instance; @@ -129,7 +130,7 @@ public class EdmTime extends AbstractSimpleType { } else if (value instanceof Calendar) { dateTimeValue = (Calendar) ((Calendar) value).clone(); } else if (value instanceof Long) { - dateTimeValue = Calendar.getInstance(TimeZone.getTimeZone("GMT")); + dateTimeValue = Calendar.getInstance(TIME_ZONE_GMT); dateTimeValue.clear(); dateTimeValue.setTimeInMillis((Long) value); } else {
