summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterUtil.java
diff options
context:
space:
mode:
authortalig <talig@amdocs.com>2017-12-20 14:30:43 +0200
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2017-12-21 11:12:33 +0000
commit8e9c0653dd6c6862123c9609ae34e1206d86456e (patch)
tree5eeef00ec0677133baa439ca8d7ffd7aca4804b6 /openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterUtil.java
parent785ebcc95de3e064e843bec04ba7a209d854fc7c (diff)
Add collaboration feature
Issue-ID: SDC-767 Change-Id: I14fb4c1f54086ed03a56a7ff7fab9ecd40381795 Signed-off-by: talig <talig@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterUtil.java')
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterUtil.java12
1 files changed, 9 insertions, 3 deletions
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<String> 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<T> 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;
}
}