Fix warnings/javadocs in sal-distributed-datastore
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / persisted / AbstractVersionedShardDataTreeSnapshot.java
index 0d92eac586c023444bf95ed6b7dd34394ae477cc..48d267342149e3bbcef9a4b3bc21123701c1510b 100644 (file)
@@ -29,6 +29,7 @@ import org.slf4j.LoggerFactory;
 abstract class AbstractVersionedShardDataTreeSnapshot extends ShardDataTreeSnapshot {
     private static final Logger LOG = LoggerFactory.getLogger(AbstractVersionedShardDataTreeSnapshot.class);
 
+    @SuppressWarnings("checkstyle:FallThrough")
     static ShardDataTreeSnapshot deserialize(final DataInputStream is) throws IOException {
         final PayloadVersion version = PayloadVersion.readFrom(is);
         switch (version) {
@@ -44,6 +45,8 @@ abstract class AbstractVersionedShardDataTreeSnapshot extends ShardDataTreeSnaps
             case TEST_PAST_VERSION:
                 // These versions are never returned and this code is effectively dead
                 break;
+            default:
+                throw new IOException("Invalid payload version in snapshot");
         }
 
         // Not included as default in above switch to ensure we get warnings when new versions are added
@@ -60,14 +63,16 @@ abstract class AbstractVersionedShardDataTreeSnapshot extends ShardDataTreeSnaps
      *
      * @return The root node.
      */
-    abstract @Nonnull NormalizedNode<?, ?> rootNode();
+    @Nonnull
+    abstract NormalizedNode<?, ?> rootNode();
 
     /**
      * Return the snapshot payload version. Implementations of this method should return a constant.
      *
      * @return Snapshot payload version
      */
-    abstract @Nonnull PayloadVersion version();
+    @Nonnull
+    abstract PayloadVersion version();
 
     private void versionedSerialize(final DataOutputStream dos, final PayloadVersion version) throws IOException {
         switch (version) {
@@ -80,7 +85,8 @@ abstract class AbstractVersionedShardDataTreeSnapshot extends ShardDataTreeSnaps
             case TEST_FUTURE_VERSION:
             case TEST_PAST_VERSION:
                 break;
-
+            default:
+                throw new IOException("Invalid payload version in snapshot");
         }
 
         throw new IOException("Encountered unhandled version" + version);