Fix for name clash in csar generation 15/109415/2
authorKrupaNagabhushan <krupa.nagabhushan@est.tech>
Mon, 22 Jun 2020 11:55:04 +0000 (12:55 +0100)
committerOfir Sonsino <ofir.sonsino@intl.att.com>
Wed, 24 Jun 2020 15:21:17 +0000 (15:21 +0000)
Issue-ID: SDC-3144
Change-Id: Ia9b66bb14bbff3add70eed8dfe41acc55c72b35b
Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech>
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java

index f479bb5..6e3019c 100644 (file)
@@ -1389,8 +1389,12 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic {
 
                final String nameWithouNamespacePrefix = nodeTypefullName.substring(nodeTypeNamePrefix.length());
                final String[] findTypes = nameWithouNamespacePrefix.split("\\.");
-               final String resourceType = findTypes[0];
-               return nameWithouNamespacePrefix.substring(resourceType.length());
+
+               if(findTypes.length > 1){
+                       final String resourceType = findTypes[0];
+                       return nameWithouNamespacePrefix.substring(resourceType.length());
+               }
+               return nameWithouNamespacePrefix;
        }
 
        private ImmutablePair<Resource, ActionStatus> createNodeTypeResourceFromYaml(final String yamlName,