diff options
Diffstat (limited to 'eaaf_core/src')
-rw-r--r-- | eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/utils/DefaultJsonMapper.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/utils/DefaultJsonMapper.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/utils/DefaultJsonMapper.java index 92bf94d4..b6586bff 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/utils/DefaultJsonMapper.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/utils/DefaultJsonMapper.java @@ -1,8 +1,8 @@ package at.gv.egiz.eaaf.core.impl.utils; import java.io.IOException; +import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; import com.fasterxml.jackson.annotation.PropertyAccessor; @@ -135,11 +135,12 @@ public final class DefaultJsonMapper { private static Module getModuleInstance(Class<?> clazz, String constructorName) { try { - final Method constructor = clazz.getMethod(constructorName, new Class[] {}); + + final Constructor<?> constructor = clazz.getConstructor(new Class[] {}); if (constructor != null) { log.trace("Found method: {} for class:{}. Creating instanze .... ", constructorName, clazz.getName()); - final Object rawModule = constructor.invoke(clazz); + final Object rawModule = constructor.newInstance(null); return rawModule instanceof Module ? (Module) rawModule : null; } else { @@ -148,8 +149,8 @@ public final class DefaultJsonMapper { } } catch (NoSuchMethodException | SecurityException | IllegalAccessException - | IllegalArgumentException | InvocationTargetException e) { - log.debug("Can not create instanze of Jackson module: {}. Reason: {}", clazz.getName(), e.getMessage()); + | IllegalArgumentException | InvocationTargetException | InstantiationException e) { + log.info("Can not create instanze of Jackson module: {}. Reason: {}", clazz.getName(), e.getMessage()); log.trace("Detailed error", e); } |