summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-vendor-license-lib
diff options
context:
space:
mode:
authorvempo <vitaliy.emporopulo@amdocs.com>2017-09-24 18:12:33 +0300
committervempo <vitaliy.emporopulo@amdocs.com>2017-09-24 18:13:59 +0300
commit700b3ef4a004cfa2cdec4c75994695943149c2fb (patch)
tree893145ce9349c568383a49b52b1ad54bc9ef76b1 /openecomp-be/lib/openecomp-sdc-vendor-license-lib
parent8525842a43b083958dbb1c9d1ce91e96bd1516f3 (diff)
Fixed incorrect reconstruction of choice objects
Reverted a change introduced earlier, which supposedly broke re-construction of choice objects when loading them from a database. Issue-ID: SDC-381 Change-Id: Id896d79571c020c36a1cb33eff058858e73fc8b0 Signed-off-by: vempo <vitaliy.emporopulo@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-vendor-license-lib')
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java6
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java7
2 files changed, 1 insertions, 12 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java
index 7f5fc66ef4..4483c67b65 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java
@@ -26,8 +26,6 @@ import org.openecomp.sdc.common.errors.CoreException;
import org.openecomp.sdc.common.errors.ErrorCategory;
import org.openecomp.sdc.common.errors.ErrorCode;
import org.openecomp.sdc.datatypes.error.ErrorLevel;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
import org.openecomp.sdc.logging.types.LoggerConstants;
import org.openecomp.sdc.logging.types.LoggerErrorCode;
@@ -43,8 +41,6 @@ public class ChoiceOrOther<E extends Enum<E>> {
"Enum used as part of ChoiceOrOther type must contain the value 'Other'";
public static final String OTHER_ENUM_VALUE = "Other";
- private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
-
@Transient
private E choice;
@@ -121,11 +117,9 @@ public class ChoiceOrOther<E extends Enum<E>> {
try {
choice = E.valueOf(enumClass, result);
} catch (IllegalArgumentException exception) {
- log.debug("",exception);
try {
choice = E.valueOf(enumClass, OTHER_ENUM_VALUE);
} catch (IllegalArgumentException ex) {
- log.debug("",ex);
MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
LoggerTragetServiceName.VALIDATE_CHOICE_VALUE, ErrorLevel.ERROR.name(),
LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE);
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java
index 2f28142470..36f54ac45e 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java
@@ -26,8 +26,6 @@ import org.openecomp.sdc.common.errors.CoreException;
import org.openecomp.sdc.common.errors.ErrorCategory;
import org.openecomp.sdc.common.errors.ErrorCode;
import org.openecomp.sdc.datatypes.error.ErrorLevel;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
import org.openecomp.sdc.logging.types.LoggerConstants;
import org.openecomp.sdc.logging.types.LoggerErrorCode;
@@ -45,8 +43,6 @@ public class MultiChoiceOrOther<E extends Enum<E>> {
"Enum used as part of MultiChoiceOrOther type must contain the value 'Other'";
public static final String OTHER_ENUM_VALUE = "Other";
- private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
-
@Transient
private Set<E> choices;
@Transient
@@ -140,11 +136,10 @@ public class MultiChoiceOrOther<E extends Enum<E>> {
try {
choices.add(E.valueOf(enumClass, result));
} catch (IllegalArgumentException exception) {
- log.debug("",exception);
try {
choices.add(E.valueOf(enumClass, OTHER_ENUM_VALUE));
} catch (IllegalArgumentException ex) {
- log.debug("",ex);
+
MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
LoggerTragetServiceName.VALIDATE_CHOICE_VALUE, ErrorLevel.ERROR.name(),
LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE);
olor: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.openecomp.sdc.common</groupId>
    <name>openecomp-common-lib</name>
    <artifactId>openecomp-common-lib</artifactId>
    <packaging>pom</packaging>

    <parent>
        <groupId>org.openecomp.sdc</groupId>
        <artifactId>sdc-onboarding</artifactId>
        <version>1.2.0-SNAPSHOT</version>
	<relativePath>../onboarding</relativePath>
    </parent>

    <properties>
        <aspectj.version>1.8.7</aspectj.version>

    </properties>

    <modules>
        <module>openecomp-logging-lib</module>
        <module>openecomp-sdc-artifact-generator-lib</module>
        <module>openecomp-common-configuration-management</module>
        <module>openecomp-tosca-datatype</module>
    </modules>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.10</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <version>${logback.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-yaml</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>${commons.codec.version}</version>
        </dependency>
        <dependency>
            <groupId>com.datastax.cassandra</groupId>
            <artifactId>cassandra-driver-core</artifactId>
            <version>${cassandra.version}</version>
        </dependency>
        <dependency>
            <groupId>com.datastax.cassandra</groupId>
            <artifactId>cassandra-driver-mapping</artifactId>
            <version>${cassandra.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.0-m10</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson.version}</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.8.8</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.aspectj</groupId>
                <artifactId>aspectjrt</artifactId>
                <version>${aspectj.version}</version>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>servlet-api</artifactId>
                <version>${servlet.version}</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
            <dependency>
                <groupId>commons-beanutils</groupId>
                <artifactId>commons-beanutils</artifactId>
                <version>${commons.beanutils.version}</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/com.beust/jcommander -->
            <dependency>
                <groupId>com.beust</groupId>
                <artifactId>jcommander</artifactId>
                <version>${jcommander.version}</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/commons-digester/commons-digester -->
            <dependency>
                <groupId>commons-digester</groupId>
                <artifactId>commons-digester</artifactId>
                <version>${commons.digester.version}</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.beanshell/bsh -->
            <dependency>
                <groupId>org.beanshell</groupId>
                <artifactId>bsh</artifactId>
                <version>${bsh.version}</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/com.google.code.findbugs/annotations -->
            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>annotations</artifactId>
                <version>3.0.1u2</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/cglib/cglib-nodep -->
            <dependency>
                <groupId>cglib</groupId>
                <artifactId>cglib-nodep</artifactId>
                <version>${cglib.nodep.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>

            <!-- ================================================== -->
            <!-- Set the JDK compiler version.                      -->
            <!-- ================================================== -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${mvn.compiler.version}</version>
                <inherited>true</inherited>
                <configuration>
                    <source>${java.source}</source>
                    <target>${java.target}</target>
                </configuration>
            </plugin>
            <!-- blackduck maven plugin -->

            <!--<plugin>
                <groupId>com.blackducksoftware.integration</groupId>
                <artifactId>hub-maven-plugin</artifactId>
                <version>1.0.4</version>
                <inherited>false</inherited>
                <configuration>
                    <target>${project.basedir}</target>
                </configuration>
                <executions>
                    <execution>
                        <id>create-bdio-file</id>
                        <phase>package</phase>
                        <goals>
                            <goal>createHubOutput</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>-->

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${mvn.license.version}</version>
                <configuration>
                    <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
                    <processStartTag>============LICENSE_START=======================================================</processStartTag>
                    <processEndTag>============LICENSE_END=========================================================</processEndTag>
                    <sectionDelimiter>================================================================================</sectionDelimiter>
                    <licenseName>apache_v2</licenseName>
                    <inceptionYear>2017</inceptionYear>
                    <organizationName>AT&amp;T Intellectual Property. All rights reserved.</organizationName>
                    <projectName>SDC</projectName>
                    <canUpdateCopyright>true</canUpdateCopyright>
                    <canUpdateDescription>true</canUpdateDescription>
                    <canUpdateLicense>true</canUpdateLicense>
                    <emptyLineAfterHeader>true</emptyLineAfterHeader>
                    <verbose>false</verbose>
                    <includes>
                        <include>**/*.java</include>
                        <include>**/*.js</include>
                        <include>**/*.ts</include>
                    </includes>
                    <roots>
                        <root>src</root>
                        <root>app</root>
                        <root>server-mock</root>
                        <root>typings</root>
                    </roots>
                </configuration>
                <executions>
                    <execution>
                        <id>first</id>
                        <goals>
                            <goal>update-file-header</goal>
                        </goals>
                        <!--phase>process-sources</phase-->
                    </execution>
                </executions>
            </plugin>


        </plugins>

    </build>

</project>