Use updated BytesMarshallable with default implementations

This commit is contained in:
Peter Lawrey
2016-04-22 15:30:35 +01:00
parent f3a511e51e
commit 8ef1f1e647
6 changed files with 40 additions and 52 deletions
@@ -16,6 +16,7 @@
package net.openhft.chronicle.hash.serialization.impl;
import net.openhft.chronicle.core.util.ObjectUtils;
import net.openhft.chronicle.hash.Data;
import net.openhft.chronicle.hash.serialization.DataAccess;
import net.openhft.chronicle.hash.serialization.SizedReader;
@@ -62,8 +63,8 @@ public abstract class InstanceCreatingMarshaller<T> implements Marshallable {
*/
protected T createInstance() {
try {
return tClass.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
return ObjectUtils.newInstance(tClass);
} catch (Exception e) {
throw new IllegalStateException("Some of default marshallers, chosen for the type\n" +
tClass + " by default, delegates to \n" +
this.getClass().getName() + " which assumes the type has a public no-arg\n" +