X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fbabel%2Fxml%2Fgenerator%2FModelGenerator.java;h=f47432104c3b61388172b03c66ca16e68eeb7f26;hb=302b153c43ba08d1fe7f5a428cbc7be4299377f4;hp=65e0ada02fc496ca820c4bfc9dcd209e30540b3c;hpb=66b3afa06776e9944ad515206d281d67747c9770;p=aai%2Fbabel.git diff --git a/src/main/java/org/onap/aai/babel/xml/generator/ModelGenerator.java b/src/main/java/org/onap/aai/babel/xml/generator/ModelGenerator.java index 65e0ada..f474321 100644 --- a/src/main/java/org/onap/aai/babel/xml/generator/ModelGenerator.java +++ b/src/main/java/org/onap/aai/babel/xml/generator/ModelGenerator.java @@ -38,7 +38,7 @@ import org.onap.aai.babel.xml.generator.data.GroupType; import org.onap.aai.cl.api.Logger; /** - * This class is responsible for generating xml model artifacts from a collection of csar file artifacts + * This class is responsible for generating XML model artifacts from a collection of CSAR artifacts. */ public class ModelGenerator implements ArtifactGenerator { @@ -54,7 +54,7 @@ public class ModelGenerator implements ArtifactGenerator { * @param csarArchive * @param csarArtifacts the input artifacts * @return {@link List} of output artifacts - * @throws XmlArtifactGenerationException if there is an error trying to generate xml artifacts + * @throws XmlArtifactGenerationException if there is an error trying to generate XML artifacts */ @Override public List generateArtifacts(byte[] csarArchive, List csarArtifacts) @@ -64,8 +64,6 @@ public class ModelGenerator implements ArtifactGenerator { // Get the service version to pass into the generator String toscaVersion = csarArtifacts.get(0).getVersion(); - logger.debug( - "Getting the service version for Tosca Version of the yml file. The Tosca Version is " + toscaVersion); String serviceVersion = getServiceVersion(toscaVersion); logger.debug("The service version is " + serviceVersion); Map additionalParams = new HashMap<>(); @@ -111,12 +109,10 @@ public class ModelGenerator implements ArtifactGenerator { } private static String getServiceVersion(String artifactVersion) { + logger.debug("Artifact version=" + artifactVersion); String serviceVersion; - try { - String[] versionParts = artifactVersion.split(VERSION_DELIMITER_REGEXP); - Integer majorVersion = Integer.parseInt(versionParts[0]); - + int majorVersion = Integer.parseInt(artifactVersion.split(VERSION_DELIMITER_REGEXP)[0]); serviceVersion = majorVersion + VERSION_DELIMITER + "0"; } catch (Exception e) { logger.warn(ApplicationMsgs.DISTRIBUTION_EVENT,