diff --git a/src/main/java/net/openhft/chronicle/hash/impl/VanillaChronicleHash.java b/src/main/java/net/openhft/chronicle/hash/impl/VanillaChronicleHash.java index c80d500148..61396a6dc6 100644 --- a/src/main/java/net/openhft/chronicle/hash/impl/VanillaChronicleHash.java +++ b/src/main/java/net/openhft/chronicle/hash/impl/VanillaChronicleHash.java @@ -724,6 +724,11 @@ public final void checkKey(final Object key) { } } + public void throwExceptionIfClosing() throws IllegalStateException { + if (this.isClosing()) + throw new ChronicleHashClosedException(this.getClass().getName() + " closing", Jvm.getValue(this, "closedHere")); + } + @Override public void throwExceptionIfClosed() throws IllegalStateException { if (this.isClosed()) diff --git a/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java b/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java index 827a281c71..b3efcce5c1 100644 --- a/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java @@ -324,7 +324,7 @@ public byte identifier() { @Override public ModificationIterator acquireModificationIterator(final byte remoteIdentifier) { - throwExceptionIfClosed(); + throwExceptionIfClosing(); ModificationIterator modificationIterator = modificationIterators.get(remoteIdentifier); if (modificationIterator != null)