diff options
Diffstat (limited to 'models-base/src/main/java')
-rw-r--r-- | models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java | 5 | ||||
-rw-r--r-- | models-base/src/main/java/org/onap/policy/models/base/PfTimestampKey.java | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java b/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java index b94900430..97522c4d9 100644 --- a/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java +++ b/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java @@ -21,6 +21,7 @@ package org.onap.policy.models.base; +import com.google.re2j.Pattern; import java.lang.reflect.ParameterizedType; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -73,6 +74,8 @@ public class PfConceptContainer<C extends PfConcept, A extends PfNameVersion> ex implements PfConceptGetter<C>, PfAuthorative<List<Map<String, A>>> { private static final long serialVersionUID = -324211738823208318L; + private static final Pattern KEY_ID_PATTERN = Pattern.compile(PfKey.KEY_ID_REGEXP); + @EmbeddedId private PfConceptKey key; @@ -183,7 +186,7 @@ public class PfConceptContainer<C extends PfConcept, A extends PfNameVersion> ex for (Entry<String, A> incomingConceptEntry : incomingConceptMap.entrySet()) { PfConceptKey conceptKey = new PfConceptKey(); - if (incomingConceptEntry.getKey().matches(PfKey.KEY_ID_REGEXP)) { + if (KEY_ID_PATTERN.matches(incomingConceptEntry.getKey())) { conceptKey = new PfConceptKey(incomingConceptEntry.getKey()); } else { conceptKey.setName(incomingConceptEntry.getKey()); diff --git a/models-base/src/main/java/org/onap/policy/models/base/PfTimestampKey.java b/models-base/src/main/java/org/onap/policy/models/base/PfTimestampKey.java index a2f11290d..5be9b5f58 100644 --- a/models-base/src/main/java/org/onap/policy/models/base/PfTimestampKey.java +++ b/models-base/src/main/java/org/onap/policy/models/base/PfTimestampKey.java @@ -3,6 +3,7 @@ * ONAP Policy Model * ================================================================================ * Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,7 +63,8 @@ public class PfTimestampKey extends PfKeyImpl { */ public PfTimestampKey(@NonNull final PfTimestampKey copyConcept) { super(copyConcept); - this.timeStamp = new Date(copyConcept.getTimeStamp().getTime()); + long millis = copyConcept.getTimeStamp().getTime(); + this.timeStamp = new Date(millis); } /** |