From 700b3ef4a004cfa2cdec4c75994695943149c2fb Mon Sep 17 00:00:00 2001 From: vempo Date: Sun, 24 Sep 2017 18:12:33 +0300 Subject: 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 --- .../org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java | 6 ------ .../openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java | 7 +------ 2 files changed, 1 insertion(+), 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> { "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> { 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> { "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 choices; @Transient @@ -140,11 +136,10 @@ public class MultiChoiceOrOther> { 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); -- cgit 1.2.3-korg