From 8e9c0653dd6c6862123c9609ae34e1206d86456e Mon Sep 17 00:00:00 2001 From: talig Date: Wed, 20 Dec 2017 14:30:43 +0200 Subject: Add collaboration feature Issue-ID: SDC-767 Change-Id: I14fb4c1f54086ed03a56a7ff7fab9ecd40381795 Signed-off-by: talig --- .../java/org/openecomp/core/impl/ToscaConverterUtil.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterUtil.java') diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterUtil.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterUtil.java index 20ac6413e7..d34d46796d 100644 --- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterUtil.java +++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterUtil.java @@ -4,6 +4,8 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.openecomp.core.converter.errors.CreateToscaObjectErrorBuilder; import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import java.lang.reflect.Field; import java.util.HashSet; @@ -20,6 +22,8 @@ public class ToscaConverterUtil { private static final String DEFAULT_CAPITAL = "Default"; private static Set defaultValueKeys; + private static Logger LOGGER = LoggerFactory.getLogger(ToscaConverterUtil.class.getName()); + static { defaultValueKeys = Stream.of(DEFAULT, DEFAULT_CAPITAL).collect(Collectors.toSet()); @@ -30,10 +34,10 @@ public class ToscaConverterUtil { Class classToCreate) { try { return createObjectUsingSetters(objectCandidate, classToCreate); - } catch (Exception e) { + } catch (Exception ex) { throw new CoreException( - new CreateToscaObjectErrorBuilder(classToCreate.getSimpleName(), objectId, e.getMessage()) - .build()); + new CreateToscaObjectErrorBuilder(classToCreate.getSimpleName(), objectId) + .build(), ex); } } @@ -68,6 +72,8 @@ public class ToscaConverterUtil { return Objects.nonNull(fieldValueToAssign) && Objects.nonNull(classToCreate.getMethod(methodName, field.getType())); } catch (NoSuchMethodException e) { + LOGGER.debug(String.format("Could not extract method '%s' from class '%s'. returning false " + + "with filedType '%s'.", methodName, classToCreate, field.getType()), e); return false; } } -- cgit 1.2.3-korg