Add @Serial annotation to all serialVersionUID fields.

Closes #2973
This commit is contained in:
Mark Paluch
2024-08-20 10:30:24 +02:00
parent 3bc9423cd1
commit e56e8c59b2
8 changed files with 20 additions and 1 deletions

View File

@@ -15,6 +15,8 @@
*/
package org.springframework.data.redis;
import java.io.Serial;
import org.springframework.dao.DataRetrievalFailureException;
/**
@@ -27,6 +29,7 @@ import org.springframework.dao.DataRetrievalFailureException;
*/
public class ClusterRedirectException extends DataRetrievalFailureException {
@Serial
private static final long serialVersionUID = -857075813794333965L;
private final int slot;

View File

@@ -15,6 +15,8 @@
*/
package org.springframework.data.redis;
import java.io.Serial;
import org.springframework.dao.DataAccessResourceFailureException;
/**
@@ -28,6 +30,7 @@ import org.springframework.dao.DataAccessResourceFailureException;
*/
public class ClusterStateFailureException extends DataAccessResourceFailureException {
@Serial
private static final long serialVersionUID = 333399051713240852L;
/**

View File

@@ -15,6 +15,8 @@
*/
package org.springframework.data.redis;
import java.io.Serial;
import org.springframework.dao.DataRetrievalFailureException;
/**
@@ -25,6 +27,7 @@ import org.springframework.dao.DataRetrievalFailureException;
*/
public class TooManyClusterRedirectionsException extends DataRetrievalFailureException {
@Serial
private static final long serialVersionUID = -2818933672669154328L;
/**

View File

@@ -15,6 +15,7 @@
*/
package org.springframework.data.redis.connection;
import java.io.Serial;
import java.util.Collections;
import java.util.List;
@@ -29,7 +30,7 @@ import org.springframework.dao.UncategorizedDataAccessException;
*/
public class ClusterCommandExecutionFailureException extends UncategorizedDataAccessException {
private static final long serialVersionUID = 5727044227040368955L;
@Serial private static final long serialVersionUID = 5727044227040368955L;
/**
* Creates new {@link ClusterCommandExecutionFailureException}.

View File

@@ -15,6 +15,8 @@
*/
package org.springframework.data.redis.domain.geo;
import java.io.Serial;
import org.springframework.data.geo.Distance;
import org.springframework.data.geo.Metric;
import org.springframework.data.geo.Shape;
@@ -30,6 +32,7 @@ import org.springframework.util.ObjectUtils;
*/
public class BoundingBox implements Shape {
@Serial
private static final long serialVersionUID = 5215611530535947924L;
private final Distance width;

View File

@@ -15,6 +15,7 @@
*/
package org.springframework.data.redis.support.atomic;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.concurrent.TimeUnit;
@@ -46,6 +47,7 @@ import org.springframework.util.Assert;
*/
public class RedisAtomicDouble extends Number implements Serializable, BoundKeyOperations<String> {
@Serial
private static final long serialVersionUID = 1L;
private volatile String key;

View File

@@ -15,6 +15,7 @@
*/
package org.springframework.data.redis.support.atomic;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.concurrent.TimeUnit;
@@ -47,6 +48,7 @@ import org.springframework.util.Assert;
*/
public class RedisAtomicInteger extends Number implements Serializable, BoundKeyOperations<String> {
@Serial
private static final long serialVersionUID = 1L;
private volatile String key;

View File

@@ -15,6 +15,7 @@
*/
package org.springframework.data.redis.support.atomic;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.concurrent.TimeUnit;
@@ -48,6 +49,7 @@ import org.springframework.util.Assert;
*/
public class RedisAtomicLong extends Number implements Serializable, BoundKeyOperations<String> {
@Serial
private static final long serialVersionUID = 1L;
private volatile String key;