diff options
author | vempo <vitaliy.emporopulo@amdocs.com> | 2017-09-25 13:49:08 +0300 |
---|---|---|
committer | vempo <vitaliy.emporopulo@amdocs.com> | 2017-09-25 13:49:08 +0300 |
commit | 3168d167b6e63087e7171a29a0e1c2bfa92ce01c (patch) | |
tree | 3c062c5e227350643cd959f9f83f7b718eb23fa0 | |
parent | 3ef175b5f6e74a685cfa998153b4d635f9883dfe (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.
Change-Id: I28b62bfe4155ecd3929b0f826ae6b2cadae6d7fa
Issue-ID: SDC-381
Signed-off-by: vempo <vitaliy.emporopulo@amdocs.com>
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); |