diff --git a/src/main/java/net/openhft/chronicle/hash/ChronicleHash.java b/src/main/java/net/openhft/chronicle/hash/ChronicleHash.java
index 4ee1d92c1..b5a7a31fa 100644
--- a/src/main/java/net/openhft/chronicle/hash/ChronicleHash.java
+++ b/src/main/java/net/openhft/chronicle/hash/ChronicleHash.java
@@ -23,7 +23,6 @@ import net.openhft.chronicle.set.ChronicleSet;
import java.io.Closeable;
import java.io.File;
-import java.io.IOException;
/**
* This interface defines common {@link ChronicleMap} and {@link ChronicleSet}, related to off-heap
@@ -61,5 +60,5 @@ public interface ChronicleHash extends Closeable {
* any exception, or even JVM crash. Shortly speaking, don't call use map closing.
*/
@Override
- void close() throws IOException;
+ void close();
}
diff --git a/src/main/java/net/openhft/chronicle/map/AbstractChronicleMapBuilder.java b/src/main/java/net/openhft/chronicle/map/AbstractChronicleMapBuilder.java
index 432b64bfc..590ff2b9d 100644
--- a/src/main/java/net/openhft/chronicle/map/AbstractChronicleMapBuilder.java
+++ b/src/main/java/net/openhft/chronicle/map/AbstractChronicleMapBuilder.java
@@ -782,7 +782,7 @@ public abstract class AbstractChronicleMapBuilder create() throws IOException {
+ public ChronicleMap create() {
// clone() to make this builder instance thread-safe, because createWithoutFile() method
// computes some state based on configurations, but doesn't synchronize on configuration
// changes.
@@ -856,12 +856,17 @@ public abstract class AbstractChronicleMapBuilder createWithoutFile(
- SingleChronicleHashReplication singleHashReplication, ReplicationChannel channel) throws IOException {
- VanillaChronicleMap map = newMap(singleHashReplication, channel);
- BytesStore bytesStore = new DirectStore(JDKObjectSerializer.INSTANCE,
- map.sizeInBytes(), true);
- map.createMappedStoreAndSegments(bytesStore);
- return establishReplication(map, singleHashReplication, channel);
+ SingleChronicleHashReplication singleHashReplication, ReplicationChannel channel) {
+ try {
+ VanillaChronicleMap map = newMap(singleHashReplication, channel);
+ BytesStore bytesStore = new DirectStore(JDKObjectSerializer.INSTANCE,
+ map.sizeInBytes(), true);
+ map.createMappedStoreAndSegments(bytesStore);
+ return establishReplication(map, singleHashReplication, channel);
+ } catch (IOException e) {
+ // file-less version should never trigger an IOException.
+ throw new AssertionError(e);
+ }
}
ChronicleMap createStatelessMap(StatelessMapConfig statelessBuilder)
diff --git a/src/main/java/net/openhft/chronicle/set/SetFromMap.java b/src/main/java/net/openhft/chronicle/set/SetFromMap.java
index 639184432..6ca6b9f4e 100644
--- a/src/main/java/net/openhft/chronicle/set/SetFromMap.java
+++ b/src/main/java/net/openhft/chronicle/set/SetFromMap.java
@@ -123,7 +123,7 @@ class SetFromMap extends AbstractSet
}
@Override
- public void close() throws IOException {
+ public void close() {
m.close();
}
}
diff --git a/src/test/java/net/openhft/chronicle/map/GuavaTest.java b/src/test/java/net/openhft/chronicle/map/GuavaTest.java
index 4c096767d..e6f48ad95 100644
--- a/src/test/java/net/openhft/chronicle/map/GuavaTest.java
+++ b/src/test/java/net/openhft/chronicle/map/GuavaTest.java
@@ -27,7 +27,6 @@ import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import java.io.IOException;
import java.util.List;
import java.util.Map;
@@ -106,22 +105,14 @@ public class GuavaTest extends TestCase {
@Override
Map newMap() {
- try {
- return builder.create();
- } catch (IOException e) {
- throw new AssertionError(e);
- }
+ return builder.create();
}
}
static class HHMTestGenerator extends CHMTestGenerator {
@Override
Map newMap() {
- try {
- return builder.create();
- } catch (IOException e) {
- throw new AssertionError(e);
- }
+ return builder.create();
}
}
}
diff --git a/src/test/java/net/openhft/chronicle/map/ReplicationCheckingMap.java b/src/test/java/net/openhft/chronicle/map/ReplicationCheckingMap.java
index ee72bda1f..1be6f380b 100644
--- a/src/test/java/net/openhft/chronicle/map/ReplicationCheckingMap.java
+++ b/src/test/java/net/openhft/chronicle/map/ReplicationCheckingMap.java
@@ -22,7 +22,6 @@ import org.jetbrains.annotations.NotNull;
import org.junit.Assert;
import java.io.File;
-import java.io.IOException;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
@@ -268,7 +267,7 @@ public class ReplicationCheckingMap implements ChronicleMap {
}
@Override
- public void close() throws IOException {
+ public void close() {
map1.close();
map2.close();
}
diff --git a/src/test/java/net/openhft/chronicle/map/jrs166/map/StatelessChronicleMapTest.java b/src/test/java/net/openhft/chronicle/map/jrs166/map/StatelessChronicleMapTest.java
index 51b9e8fa4..4a251f27a 100755
--- a/src/test/java/net/openhft/chronicle/map/jrs166/map/StatelessChronicleMapTest.java
+++ b/src/test/java/net/openhft/chronicle/map/jrs166/map/StatelessChronicleMapTest.java
@@ -68,7 +68,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
}
@Override
- public void close() throws IOException {
+ public void close() {
for (Closeable c : closeables) {
try {
c.close();