X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=common%2Fconcepts%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fconcepts%2FWritableObjects.java;h=51281657f4761f60c790df3b085a125eeb286bfe;hb=f429749a59a10820b1bad0e9c3502ceac2ec1d07;hp=2ae58220a5f8dedd33d85902bef23f4d0446723e;hpb=c38e7968883917eaab5c8db358c68fae912aac31;p=yangtools.git diff --git a/common/concepts/src/main/java/org/opendaylight/yangtools/concepts/WritableObjects.java b/common/concepts/src/main/java/org/opendaylight/yangtools/concepts/WritableObjects.java index 2ae58220a5..51281657f4 100644 --- a/common/concepts/src/main/java/org/opendaylight/yangtools/concepts/WritableObjects.java +++ b/common/concepts/src/main/java/org/opendaylight/yangtools/concepts/WritableObjects.java @@ -13,7 +13,7 @@ import com.google.common.annotations.Beta; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; -import javax.annotation.Nonnull; +import org.eclipse.jdt.annotation.NonNullByDefault; /** * Utility methods for working with {@link WritableObject}s. @@ -21,9 +21,10 @@ import javax.annotation.Nonnull; * @author Robert Varga */ @Beta +@NonNullByDefault public final class WritableObjects { private WritableObjects() { - throw new UnsupportedOperationException(); + // Hidden on purpose } /** @@ -71,7 +72,7 @@ public final class WritableObjects { * @throws IOException if an I/O error occurs * @throws NullPointerException if input is null */ - public static long readLong(final @Nonnull DataInput in) throws IOException { + public static long readLong(final DataInput in) throws IOException { return readLongBody(in, readLongHeader(in)); } @@ -84,7 +85,7 @@ public final class WritableObjects { * @throws IOException if an I/O error occurs * @throws NullPointerException if input is null */ - public static byte readLongHeader(final @Nonnull DataInput in) throws IOException { + public static byte readLongHeader(final DataInput in) throws IOException { return in.readByte(); } @@ -108,7 +109,7 @@ public final class WritableObjects { * @throws IOException if an I/O error occurs * @throws NullPointerException if input is null */ - public static long readLongBody(final @Nonnull DataInput in, final byte header) throws IOException { + public static long readLongBody(final DataInput in, final byte header) throws IOException { int bytes = header & 0xF; if (bytes >= 8) { return in.readLong(); @@ -146,8 +147,7 @@ public final class WritableObjects { * @throws IOException if an I/O error occurs * @throws NullPointerException if output is null */ - public static void writeLongs(final @Nonnull DataOutput out, final long value0, final long value1) - throws IOException { + public static void writeLongs(final DataOutput out, final long value0, final long value1) throws IOException { final int clen = WritableObjects.valueBytes(value1); writeLong(out, value0, clen << 4); WritableObjects.writeValue(out, value1, clen); @@ -162,7 +162,7 @@ public final class WritableObjects { * @throws IOException if an I/O error occurs * @throws NullPointerException if input is null */ - public static long readFirstLong(final @Nonnull DataInput in, final byte header) throws IOException { + public static long readFirstLong(final DataInput in, final byte header) throws IOException { return WritableObjects.readLongBody(in, header); } @@ -175,7 +175,7 @@ public final class WritableObjects { * @throws IOException if an I/O error occurs * @throws NullPointerException if input is null */ - public static long readSecondLong(final @Nonnull DataInput in, final byte header) throws IOException { + public static long readSecondLong(final DataInput in, final byte header) throws IOException { return WritableObjects.readLongBody(in, (byte)(header >> 4)); }