Fix @NotNull annotations

This commit is contained in:
Peter Lawrey
2020-09-25 13:32:02 +01:00
parent 90bd3c527a
commit 87f7820407
28 changed files with 61 additions and 17 deletions
@@ -90,6 +90,7 @@ interface AbstractChronicleMap<K, V> extends ChronicleMap<K, V> {
default Collection<V> values() {
// todo cache view object
return new AbstractCollection<V>() {
@NotNull
@Override
public Iterator<V> iterator() {
return new Iterator<V>() {
@@ -144,6 +145,7 @@ interface AbstractChronicleMap<K, V> extends ChronicleMap<K, V> {
default Set<K> keySet() {
// todo cache view object
return new AbstractSet<K>() {
@NotNull
@Override
public Iterator<K> iterator() {
return new ChronicleMapIterator.OfKeys<>(AbstractChronicleMap.this);
@@ -194,7 +194,7 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
}
@Override
void initTransientsFromBuilder(ChronicleMapBuilder<K, V> builder) {
void initTransientsFromBuilder(@NotNull ChronicleMapBuilder<K, V> builder) {
super.initTransientsFromBuilder(builder);
this.localIdentifier = builder.replicationIdentifier;
//noinspection unchecked
@@ -16,6 +16,8 @@
package net.openhft.chronicle.map;
import org.jetbrains.annotations.NotNull;
import java.nio.channels.SelectionKey;
import java.util.AbstractSet;
import java.util.Iterator;
@@ -103,6 +105,7 @@ final class SelectedSelectionKeySet extends AbstractSet<SelectionKey> {
return false;
}
@NotNull
@Override
public Iterator<SelectionKey> iterator() {
throw new UnsupportedOperationException();
@@ -22,14 +22,12 @@ import net.openhft.chronicle.bytes.Bytes;
import net.openhft.chronicle.bytes.BytesStore;
import net.openhft.chronicle.bytes.PointerBytesStore;
import net.openhft.chronicle.core.Jvm;
import net.openhft.chronicle.hash.Beta;
import net.openhft.chronicle.hash.ChronicleHashClosedException;
import net.openhft.chronicle.hash.ChronicleHashCorruption;
import net.openhft.chronicle.hash.Data;
import net.openhft.chronicle.hash.impl.*;
import net.openhft.chronicle.hash.impl.stage.entry.LocksInterface;
import net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface;
import net.openhft.chronicle.hash.impl.util.Objects;
import net.openhft.chronicle.hash.impl.util.Throwables;
import net.openhft.chronicle.hash.serialization.DataAccess;
import net.openhft.chronicle.hash.serialization.SizeMarshaller;
@@ -347,6 +345,7 @@ public class VanillaChronicleMap<K, V, R>
return name;
}
@NotNull
@Override
public String toIdentityString() {
throwExceptionIfClosed();
@@ -20,6 +20,7 @@ import net.openhft.chronicle.bytes.BytesStore;
import net.openhft.chronicle.bytes.RandomDataInput;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.core.io.ReferenceOwner;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.nio.BufferOverflowException;
@@ -183,66 +184,79 @@ public enum ZeroBytesStore implements BytesStore<ZeroBytesStore, Void> {
return 0;
}
@NotNull
@Override
public ZeroBytesStore writeByte(long l, byte b) {
throw new UnsupportedOperationException();
}
@NotNull
@Override
public ZeroBytesStore writeShort(long l, short i) {
throw new UnsupportedOperationException();
}
@NotNull
@Override
public ZeroBytesStore writeInt(long l, int i) {
throw new UnsupportedOperationException();
}
@NotNull
@Override
public ZeroBytesStore writeOrderedInt(long l, int i) {
throw new UnsupportedOperationException();
}
@NotNull
@Override
public ZeroBytesStore writeLong(long l, long l1) {
throw new UnsupportedOperationException();
}
@NotNull
@Override
public ZeroBytesStore writeOrderedLong(long l, long l1) {
throw new UnsupportedOperationException();
}
@NotNull
@Override
public ZeroBytesStore writeFloat(long l, float v) {
throw new UnsupportedOperationException();
}
@NotNull
@Override
public ZeroBytesStore writeDouble(long l, double v) {
throw new UnsupportedOperationException();
}
@NotNull
@Override
public ZeroBytesStore writeVolatileByte(long l, byte b) {
throw new UnsupportedOperationException();
}
@NotNull
@Override
public ZeroBytesStore writeVolatileShort(long l, short i) {
throw new UnsupportedOperationException();
}
@NotNull
@Override
public ZeroBytesStore writeVolatileInt(long l, int i) {
throw new UnsupportedOperationException();
}
@NotNull
@Override
public ZeroBytesStore writeVolatileLong(long l, long l1) {
throw new UnsupportedOperationException();
}
@NotNull
@Override
public ZeroBytesStore write(long l, byte[] bytes, int i, int i1) {
throw new UnsupportedOperationException();
@@ -253,6 +267,7 @@ public enum ZeroBytesStore implements BytesStore<ZeroBytesStore, Void> {
throw new UnsupportedOperationException();
}
@NotNull
@Override
public ZeroBytesStore write(long l, RandomDataInput randomDataInput, long l1, long l2) {
throw new UnsupportedOperationException();