From af94a01336a8ec2c44a220548bb9ab409976b69d Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 19 Oct 2020 14:46:41 +0300 Subject: serialVersionUID for all Serializable classes --- src/main/java/com/juick/util/HttpBadRequestException.java | 5 +++++ src/main/java/com/juick/util/HttpForbiddenException.java | 5 +++++ src/main/java/com/juick/util/HttpNotFoundException.java | 5 +++++ src/main/java/com/juick/util/PrettyTimeFormatter.java | 5 +++++ src/main/java/com/juick/util/UsernameTakenException.java | 5 +++++ 5 files changed, 25 insertions(+) (limited to 'src/main/java/com/juick/util') diff --git a/src/main/java/com/juick/util/HttpBadRequestException.java b/src/main/java/com/juick/util/HttpBadRequestException.java index 386b52df..4b4faa4a 100644 --- a/src/main/java/com/juick/util/HttpBadRequestException.java +++ b/src/main/java/com/juick/util/HttpBadRequestException.java @@ -25,6 +25,11 @@ import org.springframework.web.bind.annotation.ResponseStatus; */ @ResponseStatus(value = HttpStatus.BAD_REQUEST) public class HttpBadRequestException extends RuntimeException { + /** + * + */ + private static final long serialVersionUID = 2034547017639929277L; + public HttpBadRequestException() { super("the request was bad", null, false, false); } diff --git a/src/main/java/com/juick/util/HttpForbiddenException.java b/src/main/java/com/juick/util/HttpForbiddenException.java index e2211574..2684e1ab 100644 --- a/src/main/java/com/juick/util/HttpForbiddenException.java +++ b/src/main/java/com/juick/util/HttpForbiddenException.java @@ -26,6 +26,11 @@ import org.springframework.web.bind.annotation.ResponseStatus; */ @ResponseStatus(value = HttpStatus.FORBIDDEN) public class HttpForbiddenException extends RuntimeException { + /** + * + */ + private static final long serialVersionUID = -8001596218646655068L; + public HttpForbiddenException() { super(StringUtils.EMPTY, null, false, false); } diff --git a/src/main/java/com/juick/util/HttpNotFoundException.java b/src/main/java/com/juick/util/HttpNotFoundException.java index f9d1ffbe..0e8ee9d9 100644 --- a/src/main/java/com/juick/util/HttpNotFoundException.java +++ b/src/main/java/com/juick/util/HttpNotFoundException.java @@ -26,6 +26,11 @@ import org.springframework.web.bind.annotation.ResponseStatus; */ @ResponseStatus(value = HttpStatus.NOT_FOUND) public class HttpNotFoundException extends RuntimeException { + /** + * + */ + private static final long serialVersionUID = 6136243111317477522L; + public HttpNotFoundException() { super(StringUtils.EMPTY, null, false, false); } diff --git a/src/main/java/com/juick/util/PrettyTimeFormatter.java b/src/main/java/com/juick/util/PrettyTimeFormatter.java index 34a230f5..5c736413 100644 --- a/src/main/java/com/juick/util/PrettyTimeFormatter.java +++ b/src/main/java/com/juick/util/PrettyTimeFormatter.java @@ -33,6 +33,11 @@ public class PrettyTimeFormatter { // Cache PrettyTime per locale. LRU cache to prevent memory leak. private static final Map PRETTY_TIME_LOCALE_MAP = new LinkedHashMap<>(MAX_CACHE_SIZE + 1, 1.1F, true) { + /** + * + */ + private static final long serialVersionUID = 1828878791879310392L; + @Override protected boolean removeEldestEntry(Map.Entry eldest) { return size() > MAX_CACHE_SIZE; diff --git a/src/main/java/com/juick/util/UsernameTakenException.java b/src/main/java/com/juick/util/UsernameTakenException.java index ee787e99..45eb4448 100644 --- a/src/main/java/com/juick/util/UsernameTakenException.java +++ b/src/main/java/com/juick/util/UsernameTakenException.java @@ -18,6 +18,11 @@ package com.juick.util; public class UsernameTakenException extends RuntimeException { + /** + * + */ + private static final long serialVersionUID = -5182991814500998221L; + public UsernameTakenException() { super("Username taken", null, false, false); } -- cgit v1.2.3