From: Robert Varga Date: Fri, 29 Nov 2019 10:18:13 +0000 (+0100) Subject: Add generated serialVersionUUID to exceptions X-Git-Tag: release/neon-sr3~19 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=cd57e8b5a3fd1fcc17377b00eed50941db044c2d;p=ovsdb.git Add generated serialVersionUUID to exceptions Exceptions are serializable and therefore should have a serial version. Fixes Eclipse warnings pointing this out. Change-Id: I2cf04412709cf3214b53aa3ac5dc40f332f67295 Signed-off-by: Robert Varga (cherry picked from commit 8b8f15eaed3f4ff2e4acba53e04f2c34b6861e2f) --- diff --git a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/BadSchemaException.java b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/BadSchemaException.java index 1a8fc4a04..057541277 100644 --- a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/BadSchemaException.java +++ b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/BadSchemaException.java @@ -5,20 +5,19 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.ovsdb.lib.error; /** * BadSchema exception is thrown when the received schema is invalid. */ public class BadSchemaException extends RuntimeException { + private static final long serialVersionUID = -7045398620135011253L; - public BadSchemaException(String message) { + public BadSchemaException(final String message) { super(message); } - public BadSchemaException(String message, Throwable cause) { + public BadSchemaException(final String message, final Throwable cause) { super(message, cause); } - } diff --git a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/ColumnSchemaNotFoundException.java b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/ColumnSchemaNotFoundException.java index 0491ece51..7a1922619 100644 --- a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/ColumnSchemaNotFoundException.java +++ b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/ColumnSchemaNotFoundException.java @@ -5,24 +5,23 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.ovsdb.lib.error; /** * This exception is thrown when a ColumnSchema cannot be found. */ public class ColumnSchemaNotFoundException extends RuntimeException { + private static final long serialVersionUID = -5273616784432907818L; - public ColumnSchemaNotFoundException(String message) { + public ColumnSchemaNotFoundException(final String message) { super(message); } - public ColumnSchemaNotFoundException(String message, Throwable cause) { + public ColumnSchemaNotFoundException(final String message, final Throwable cause) { super(message, cause); } - public static String createMessage(String columnName, String tableName) { + public static String createMessage(final String columnName, final String tableName) { return "Unable to locate ColumnSchema for " + columnName + " in " + tableName; } - } diff --git a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/InvalidEncodingException.java b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/InvalidEncodingException.java index dcb40deea..d592a7f29 100644 --- a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/InvalidEncodingException.java +++ b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/InvalidEncodingException.java @@ -5,17 +5,17 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.ovsdb.lib.error; /** * InvalidEncodingException in cases where something is not UTF-8 Encoded. */ public class InvalidEncodingException extends RuntimeException { + private static final long serialVersionUID = -6333965543652086978L; private final String actual; - public InvalidEncodingException(String actual, String message) { + public InvalidEncodingException(final String actual, final String message) { super(message); this.actual = actual; } diff --git a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/ParsingException.java b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/ParsingException.java index 808efe0de..f1e6f2998 100644 --- a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/ParsingException.java +++ b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/ParsingException.java @@ -5,30 +5,31 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.ovsdb.lib.error; /** * The ParsingException is thrown when JSON could not be successfully parsed. */ public class ParsingException extends RuntimeException { + private static final long serialVersionUID = -3950575478467855764L; public ParsingException() { } - public ParsingException(String message) { + public ParsingException(final String message) { super(message); } - public ParsingException(String message, Throwable cause) { + public ParsingException(final String message, final Throwable cause) { super(message, cause); } - public ParsingException(Throwable cause) { + public ParsingException(final Throwable cause) { super(cause); } - public ParsingException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { + public ParsingException(final String message, final Throwable cause, final boolean enableSuppression, + final boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } } diff --git a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/SchemaVersionMismatchException.java b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/SchemaVersionMismatchException.java index 43e9c0780..4d982c49f 100644 --- a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/SchemaVersionMismatchException.java +++ b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/SchemaVersionMismatchException.java @@ -15,8 +15,10 @@ import org.opendaylight.ovsdb.lib.notation.Version; * and the version requirements are not met. */ public class SchemaVersionMismatchException extends RuntimeException { + private static final long serialVersionUID = -5194270510726950745L; - public SchemaVersionMismatchException(Version schemaVersion, Version fromVersion, Version untilVersion) { + public SchemaVersionMismatchException(final Version schemaVersion, final Version fromVersion, + final Version untilVersion) { super("The schema version used to access the table/column (" + schemaVersion + ") does not match the required" + " version (from " + fromVersion + " to " + untilVersion + ")"); } diff --git a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/TableSchemaNotFoundException.java b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/TableSchemaNotFoundException.java index 420b5278e..1b817ca16 100644 --- a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/TableSchemaNotFoundException.java +++ b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/TableSchemaNotFoundException.java @@ -5,24 +5,23 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.ovsdb.lib.error; /** * This exception is thrown when a TableSchema cannot be found. */ public class TableSchemaNotFoundException extends RuntimeException { + private static final long serialVersionUID = -5030339562929850369L; - public TableSchemaNotFoundException(String message) { + public TableSchemaNotFoundException(final String message) { super(message); } - public TableSchemaNotFoundException(String message, Throwable cause) { + public TableSchemaNotFoundException(final String message, final Throwable cause) { super(message, cause); } - public static String createMessage(String tableName, String schemaName) { + public static String createMessage(final String tableName, final String schemaName) { return "Unable to locate TableSchema for " + tableName + " in " + schemaName; } - } diff --git a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/TyperException.java b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/TyperException.java index a8d6efc81..863f9f219 100644 --- a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/TyperException.java +++ b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/TyperException.java @@ -5,19 +5,19 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.ovsdb.lib.error; /** * This is a generic exception thrown by the Typed Schema utilities. */ public class TyperException extends RuntimeException { + private static final long serialVersionUID = 5464754787320848910L; - public TyperException(String message) { + public TyperException(final String message) { super(message); } - public TyperException(String message, Throwable cause) { + public TyperException(final String message, final Throwable cause) { super(message, cause); } } diff --git a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/UnexpectedResultException.java b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/UnexpectedResultException.java index 5f50da493..83d1b0261 100644 --- a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/UnexpectedResultException.java +++ b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/UnexpectedResultException.java @@ -5,18 +5,19 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.ovsdb.lib.error; /** * This exception is thrown when a result does not meet any of the known formats in RFC7047. */ public class UnexpectedResultException extends RuntimeException { - public UnexpectedResultException(String message) { + private static final long serialVersionUID = 7440870601052355685L; + + public UnexpectedResultException(final String message) { super(message); } - public UnexpectedResultException(String message, Throwable cause) { + public UnexpectedResultException(final String message, final Throwable cause) { super(message, cause); } } diff --git a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/UnsupportedArgumentException.java b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/UnsupportedArgumentException.java index fd420be5b..c858dfe48 100644 --- a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/UnsupportedArgumentException.java +++ b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/UnsupportedArgumentException.java @@ -5,16 +5,16 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.ovsdb.lib.error; public class UnsupportedArgumentException extends RuntimeException { + private static final long serialVersionUID = -160548497974342130L; - public UnsupportedArgumentException(String message) { + public UnsupportedArgumentException(final String message) { super(message); } - public UnsupportedArgumentException(String message, Throwable cause) { + public UnsupportedArgumentException(final String message, final Throwable cause) { super(message, cause); } } diff --git a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/UnsupportedMethodException.java b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/UnsupportedMethodException.java index 80b36805b..7c52f78c6 100644 --- a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/UnsupportedMethodException.java +++ b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/error/UnsupportedMethodException.java @@ -5,16 +5,16 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.ovsdb.lib.error; public class UnsupportedMethodException extends RuntimeException { + private static final long serialVersionUID = -1665779125782132104L; - public UnsupportedMethodException(String message) { + public UnsupportedMethodException(final String message) { super(message); } - public UnsupportedMethodException(String message, Throwable cause) { + public UnsupportedMethodException(final String message, final Throwable cause) { super(message, cause); } }