From b34fcfce719584e0032481b34d81eb0593fe04d1 Mon Sep 17 00:00:00 2001 From: leventov Date: Fri, 11 Dec 2015 18:51:29 +0300 Subject: [PATCH] Remove unused newInstance() method in VanillaChronicleMap --- .../chronicle/map/VanillaChronicleMap.java | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java index 981c78b6a..0377b63d3 100755 --- a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java @@ -30,7 +30,6 @@ import net.openhft.chronicle.map.impl.CompiledMapIterationContext; import net.openhft.chronicle.map.impl.CompiledMapQueryContext; import net.openhft.chronicle.map.impl.ret.InstanceReturnValue; import net.openhft.chronicle.set.ChronicleSet; -import net.openhft.chronicle.values.Values; import net.openhft.chronicle.wire.WireIn; import net.openhft.chronicle.wire.WireOut; import org.jetbrains.annotations.NotNull; @@ -176,41 +175,6 @@ public class VanillaChronicleMap return valueClass; } - static T newInstance(Class aClass, boolean isKey) { - try { - // TODO optimize -- save heap class / direct class in transient fields and call - // newInstance() on them directly - return Values.newHeapInstance(aClass); - - } catch (Exception e) { - if (e.getCause() instanceof IllegalStateException) - throw e; - - if (aClass.isInterface()) - throw new IllegalStateException("It not possible to create a instance from " + - "interface=" + aClass.getSimpleName() + " we recommend you create an " + - "instance in the usual way.", e); - - try { - return (T) aClass.newInstance(); - } catch (Exception e1) { - throw new IllegalStateException("It has not been possible to create a instance " + - "of class=" + aClass.getSimpleName() + - ", Note : its more efficient if your chronicle map is configured with " + - "interface key " + - "and value types rather than classes, as this method is able to use " + - "interfaces to generate off heap proxies that point straight at your " + - "data. " + - "In this case you have used a class and chronicle is unable to create an " + - "instance of this class has it does not have a default constructor. " + - "If your class is mutable, we " + - "recommend you create and instance of your class=" + - aClass.getSimpleName() + - " in the usual way, rather than using this method.", e); - } - } - } - @NotNull @Override public final Closeable acquireContext(K key, V usingValue) {