Remove useless UnsupportedOperationException throws
[yangtools.git] / common / concepts / src / main / java / org / opendaylight / yangtools / concepts / WritableObjects.java
index 2ae58220a5f8dedd33d85902bef23f4d0446723e..51281657f4761f60c790df3b085a125eeb286bfe 100644 (file)
@@ -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));
     }