Fix warnings in StorageException 41/104741/3
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 2 Mar 2023 19:09:29 +0000 (20:09 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 27 Mar 2023 08:56:17 +0000 (10:56 +0200)
Exceptions are serializable and therefore should define
serialVersionUID. Fix this omission.

Change-Id: I24daa7ca923d6df71beaf7325b57fc306564f366
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
third-party/atomix/storage/src/main/java/io/atomix/storage/journal/StorageException.java

index f7060e8387dbf72b82e25978d1d9ab7bd29cd95b..e5dd9a2073a3e03699be04f0ed69f47c81999c4c 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2015-present Open Networking Foundation
+ * Copyright 2015-2021 Open Networking Foundation
+ * Copyright 2023 PANTHEON.tech, s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,37 +22,45 @@ package io.atomix.storage.journal;
  * @author <a href="http://github.com/kuujo">Jordan Halterman</a>
  */
 public class StorageException extends RuntimeException {
+    @java.io.Serial
+    private static final long serialVersionUID = 1L;
 
-  public StorageException() {
-  }
+    public StorageException() {
+    }
 
-  public StorageException(String message) {
-    super(message);
-  }
+    public StorageException(final String message) {
+        super(message);
+    }
 
-  public StorageException(String message, Throwable cause) {
-    super(message, cause);
-  }
+    public StorageException(final String message, final Throwable cause) {
+        super(message, cause);
+    }
 
-  public StorageException(Throwable cause) {
-    super(cause);
-  }
+    public StorageException(final Throwable cause) {
+        super(cause);
+    }
 
-  /**
-   * Exception thrown when an entry being stored is too large.
-   */
-  public static class TooLarge extends StorageException {
-    public TooLarge(String message) {
-      super(message);
+    /**
+     * Exception thrown when an entry being stored is too large.
+     */
+    public static class TooLarge extends StorageException {
+        @java.io.Serial
+        private static final long serialVersionUID = 1L;
+
+        public TooLarge(final String message) {
+            super(message);
+        }
     }
-  }
-
-  /**
-   * Exception thrown when storage runs out of disk space.
-   */
-  public static class OutOfDiskSpace extends StorageException {
-    public OutOfDiskSpace(String message) {
-      super(message);
+
+    /**
+     * Exception thrown when storage runs out of disk space.
+     */
+    public static class OutOfDiskSpace extends StorageException {
+        @java.io.Serial
+        private static final long serialVersionUID = 1L;
+
+        public OutOfDiskSpace(final String message) {
+            super(message);
+        }
     }
-  }
 }