diff options
author | vasraz <vasyl.razinkov@est.tech> | 2021-02-23 16:38:16 +0000 |
---|---|---|
committer | Christophe Closset <christophe.closset@intl.att.com> | 2021-02-25 15:10:39 +0000 |
commit | 058fdf8229ef1cfc82bbad223e885ae6afdc78d0 (patch) | |
tree | 9435736fd4c1114b11e02f5ebf2a5e31579f642e /catalog-model/src | |
parent | 6ac7274a7149f03eb464c94a3c2c1132feb04818 (diff) |
Fix bugs introduced by new code
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Change-Id: Ide809e2e83b3f620dd1f173266edbe94967454f5
Issue-ID: SDC-3475
Diffstat (limited to 'catalog-model/src')
-rw-r--r-- | catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaOperationFacade.java | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaOperationFacade.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaOperationFacade.java index 083483be1b..c5b82dc295 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaOperationFacade.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaOperationFacade.java @@ -23,9 +23,10 @@ package org.openecomp.sdc.be.model.jsonjanusgraph.operations; import static java.util.Objects.requireNonNull; import static org.apache.commons.collections.CollectionUtils.isEmpty; import static org.apache.commons.collections.CollectionUtils.isNotEmpty; -import static org.janusgraph.core.attribute.Contain.NOT_IN; import static org.janusgraph.core.attribute.Text.REGEX; -import static org.openecomp.sdc.be.dao.janusgraph.JanusGraphUtils.buildNotInPredicate; + +import com.vdurmont.semver4j.Semver; +import com.vdurmont.semver4j.Semver.SemverType; import fj.data.Either; import java.util.ArrayList; import java.util.Arrays; @@ -58,7 +59,6 @@ import org.openecomp.sdc.be.dao.jsongraph.HealingJanusGraphDao; import org.openecomp.sdc.be.dao.jsongraph.types.EdgeLabelEnum; import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum; import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum; -import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; import org.openecomp.sdc.be.datatypes.elements.ArtifactDataDefinition; import org.openecomp.sdc.be.datatypes.elements.AttributeDataDefinition; import org.openecomp.sdc.be.datatypes.elements.CapabilityDataDefinition; @@ -79,7 +79,6 @@ import org.openecomp.sdc.be.datatypes.elements.RequirementDataDefinition; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; -import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum; import org.openecomp.sdc.be.datatypes.enums.PromoteVersionEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; @@ -121,14 +120,11 @@ import org.openecomp.sdc.be.model.operations.impl.DaoStatusConverter; import org.openecomp.sdc.be.model.operations.impl.UniqueIdBuilder; import org.openecomp.sdc.be.model.utils.GroupUtils; import org.openecomp.sdc.be.resources.data.ComponentMetadataData; -import org.openecomp.sdc.be.resources.data.GroupTypeData; import org.openecomp.sdc.common.jsongraph.util.CommonUtility; import org.openecomp.sdc.common.jsongraph.util.CommonUtility.LogLevelEnum; import org.openecomp.sdc.common.log.wrappers.Logger; import org.openecomp.sdc.common.util.ValidationUtils; import org.springframework.beans.factory.annotation.Autowired; -import com.vdurmont.semver4j.Semver; -import com.vdurmont.semver4j.Semver.SemverType; @org.springframework.stereotype.Component("tosca-operation-facade") @@ -482,18 +478,18 @@ public class ToscaOperationFacade { } private Map<String, Entry<JanusGraphPredicate, Object>> getVendorVersionPredicate(final String vendorRelease) { - Map<String, Entry<JanusGraphPredicate, Object>> predicateCriteria = new HashMap<>(); - if (vendorRelease != null && vendorRelease != "1.0") { + Map<String, Entry<JanusGraphPredicate, Object>> predicateCriteria = new HashMap<>(); + if (!"1.0".equals(vendorRelease)) { String[] vendorReleaseElements = vendorRelease.split("\\."); if (vendorReleaseElements.length > 0) { String regex = ".*\"vendorRelease\":\""; - for (int i = 0; i <vendorReleaseElements.length; i++) { + for (int i = 0; i < vendorReleaseElements.length; i++) { regex += vendorReleaseElements[i]; - regex += i < vendorReleaseElements.length -1 ? "\\." : "\".*"; + regex += i < vendorReleaseElements.length - 1 ? "\\." : "\".*"; } predicateCriteria.put("metadata", new HashMap.SimpleEntry<>(REGEX, regex)); } - } + } return predicateCriteria; } |