mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Cleanup usages
This commit is contained in:
@@ -71,7 +71,6 @@ import static net.openhft.chronicle.hash.impl.SizePrefixedBlob.*;
|
||||
import static net.openhft.chronicle.hash.impl.VanillaChronicleHash.throwRecoveryOrReturnIOException;
|
||||
import static net.openhft.chronicle.hash.impl.util.FileIOUtils.readFully;
|
||||
import static net.openhft.chronicle.hash.impl.util.FileIOUtils.writeFully;
|
||||
import static net.openhft.chronicle.hash.impl.util.Objects.builderEquals;
|
||||
import static net.openhft.chronicle.map.ChronicleHashCorruptionImpl.format;
|
||||
import static net.openhft.chronicle.map.ChronicleHashCorruptionImpl.report;
|
||||
import static net.openhft.chronicle.map.DefaultSpi.mapEntryOperations;
|
||||
@@ -139,7 +138,7 @@ import static net.openhft.chronicle.map.VanillaChronicleMap.alignAddr;
|
||||
*/
|
||||
public final class ChronicleMapBuilder<K, V> implements
|
||||
ChronicleHashBuilder<K, ChronicleMap<K, V>,
|
||||
ChronicleMapBuilder<K, V>> {
|
||||
ChronicleMapBuilder<K, V>> {
|
||||
|
||||
private static final int UNDEFINED_ALIGNMENT_CONFIG = -1;
|
||||
private static final int NO_ALIGNMENT = 1;
|
||||
@@ -1384,7 +1383,9 @@ public final class ChronicleMapBuilder<K, V> implements
|
||||
@SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
return builderEquals(this, o);
|
||||
return this == o ||
|
||||
o != null && this.getClass() == o.getClass() &&
|
||||
this.toString().equals(o.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1704,8 +1705,8 @@ public final class ChronicleMapBuilder<K, V> implements
|
||||
if (!canonicalFile.exists()) {
|
||||
if (recover)
|
||||
throw new FileNotFoundException("file " + canonicalFile + " should exist for recovery");
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
canonicalFile.createNewFile();
|
||||
if (!canonicalFile.createNewFile())
|
||||
throw new IOException("Unable to create file " + canonicalFile + " which presumably already exists");
|
||||
}
|
||||
final RandomAccessFile raf = CanonicalRandomAccessFiles.acquire(canonicalFile);
|
||||
final ChronicleHashResources resources = new PersistedChronicleHashResources(canonicalFile);
|
||||
|
||||
Reference in New Issue
Block a user