diff options
author | burdziak <olaf.burdziakowski@nokia.com> | 2018-01-31 12:15:17 +0100 |
---|---|---|
committer | burdziak <olaf.burdziakowski@nokia.com> | 2018-01-31 12:15:17 +0100 |
commit | 4bb05580f56a79ce177f7c75be7adacc164f6861 (patch) | |
tree | 45634c143d70cdbeabb04160db7499ffc43acc2b | |
parent | 6b98bb3ec93a0bbfbe0e660cabc69978b53bfee8 (diff) |
Fixes in PojoStrategy
Change-Id: Ia6a5b98bad3cffd9aa92c50fa0783423a15f5a9d
Issue-ID: AAI-715
Signed-off-by: burdziak <olaf.burdziakowski@nokia.com>
-rw-r--r-- | aai-core/src/main/java/org/onap/aai/introspection/PojoStrategy.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/aai-core/src/main/java/org/onap/aai/introspection/PojoStrategy.java b/aai-core/src/main/java/org/onap/aai/introspection/PojoStrategy.java index 6e29729d..9a8c4487 100644 --- a/aai-core/src/main/java/org/onap/aai/introspection/PojoStrategy.java +++ b/aai-core/src/main/java/org/onap/aai/introspection/PojoStrategy.java @@ -21,6 +21,8 @@ */ package org.onap.aai.introspection; +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; import com.google.common.base.CaseFormat; import com.google.common.base.Joiner; import com.google.common.collect.Multimap; @@ -43,6 +45,7 @@ import java.lang.reflect.*; import java.util.*; public class PojoStrategy extends Introspector { + private static final EELFLogger LOGGER2 = EELFManager.getInstance().getLogger(PojoStrategy.class); private Object internalObject = null; private PojoInjestor injestor = null; @@ -72,7 +75,7 @@ public class PojoStrategy extends Introspector { marshaller = jaxbContext.createMarshaller(); unmarshaller = jaxbContext.createUnmarshaller(); } catch (JAXBException e) { - + LOGGER2.error(e.getMessage(),e); } } @@ -133,6 +136,7 @@ public class PojoStrategy extends Introspector { try { return this.internalObject.getClass().getDeclaredMethod(getMethodName).invoke(this.internalObject); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { + LOGGER2.error(e.getMessage(),e); return null; } } @@ -181,7 +185,7 @@ public class PojoStrategy extends Introspector { try { field = this.internalObject.getClass().getDeclaredField(CaseFormat.LOWER_HYPHEN.to(CaseFormat.LOWER_CAMEL, name)); } catch (NoSuchFieldException | SecurityException e) { - + LOGGER2.error(e.getMessage(),e); return null; } @@ -202,6 +206,7 @@ public class PojoStrategy extends Introspector { } } catch (Exception e) { + LOGGER2.error(e.getMessage(),e); return null; } } @@ -252,7 +257,7 @@ public class PojoStrategy extends Introspector { marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, properties.getFormatted()); marshaller.marshal(this.internalObject, result); } catch (JAXBException e) { - //e.printStackTrace(); + LOGGER2.error(e.getMessage(),e); } return result.toString(); @@ -270,8 +275,7 @@ public class PojoStrategy extends Introspector { result = unmarshaller.unmarshal(new StreamSource(new StringReader(this.marshal(true))), this.internalObject.getClass()).getValue(); } catch (JAXBException e) { - // TODO Auto-generated catch block - //e.printStackTrace(); + LOGGER2.error(e.getMessage(),e); } result = IntrospectorFactory.newInstance(getModelType(), result); return result; @@ -336,7 +340,7 @@ public class PojoStrategy extends Introspector { } } } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { - // TODO Auto-generated catch block + LOGGER2.error(e.getMessage(),e); } return result; @@ -363,7 +367,7 @@ public class PojoStrategy extends Introspector { try { value = (String)this.classLevelMetadata.getClass().getMethod(methodName).invoke(classLevelMetadata); } catch (IllegalArgumentException | IllegalAccessException | SecurityException | InvocationTargetException | NoSuchMethodException e) { - //TODO + LOGGER2.error(e.getMessage(),e); } return value; |