Fix [serial] compiler warnings
Fix serialization warnings by applying @SuppressWarnings("serial")
when appropriate.
In certain cases and for unknown reasons, a correctly-placed
@SuppressWarnings("serial") annotation will fix the warning at the
javac level (i.e. the Gradle command-line), but will produce an
"unnecessary @SuppressWarnings" warning within Eclipse. In these
cases, a private static final serialVersionUID field has been added
with the default value of 1L.
This commit is contained in:
committed by
Chris Beams
parent
7f0aa5cfb2
commit
b0986049a3
@@ -32,6 +32,7 @@ import org.springframework.util.Assert;
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.0
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class AttributeAccessorSupport implements AttributeAccessor, Serializable {
|
||||
|
||||
/** Map with String keys and Object values */
|
||||
|
||||
@@ -334,6 +334,7 @@ public abstract class CollectionFactory {
|
||||
* ConcurrentMap adapter for the JDK ConcurrentHashMap class.
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
private static class JdkConcurrentHashMap extends ConcurrentHashMap implements ConcurrentMap {
|
||||
|
||||
private JdkConcurrentHashMap(int initialCapacity) {
|
||||
|
||||
@@ -24,6 +24,7 @@ package org.springframework.core;
|
||||
* @since 28.04.2003
|
||||
* @see org.springframework.core.Constants
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ConstantException extends IllegalArgumentException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -35,6 +35,7 @@ import java.io.IOException;
|
||||
* @see org.springframework.core.NestedCheckedException
|
||||
* @see org.springframework.core.NestedRuntimeException
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class NestedIOException extends IOException {
|
||||
|
||||
static {
|
||||
|
||||
@@ -99,6 +99,7 @@ public abstract class AbstractCachingLabeledEnumResolver implements LabeledEnumR
|
||||
/**
|
||||
* Inner cache class that implements lazy building of LabeledEnum Maps.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
private class LabeledEnumCache extends CachingMapDecorator<Class, Map<Comparable, LabeledEnum>> {
|
||||
|
||||
public LabeledEnumCache() {
|
||||
|
||||
@@ -23,6 +23,7 @@ package org.springframework.core.enums;
|
||||
* @since 1.2.6
|
||||
* @deprecated as of Spring 3.0, in favor of Java 5 enums.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class AbstractGenericLabeledEnum extends AbstractLabeledEnum {
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,6 +26,7 @@ package org.springframework.core.enums;
|
||||
* @deprecated as of Spring 3.0, in favor of Java 5 enums.
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class AbstractLabeledEnum implements LabeledEnum {
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,6 +30,7 @@ import org.springframework.util.Assert;
|
||||
* @deprecated as of Spring 3.0, in favor of Java 5 enums.
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
public class LetterCodedLabeledEnum extends AbstractGenericLabeledEnum {
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,6 +30,8 @@ package org.springframework.core.enums;
|
||||
@Deprecated
|
||||
public class ShortCodedLabeledEnum extends AbstractGenericLabeledEnum {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* The unique code of this enum.
|
||||
*/
|
||||
|
||||
@@ -44,6 +44,7 @@ package org.springframework.core.enums;
|
||||
* @deprecated as of Spring 3.0, in favor of Java 5 enums.
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class StaticLabeledEnum extends AbstractLabeledEnum {
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.springframework.util.Assert;
|
||||
* @deprecated as of Spring 3.0, in favor of Java 5 enums.
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
public class StringCodedLabeledEnum extends AbstractGenericLabeledEnum {
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,6 +28,7 @@ import org.springframework.core.NestedRuntimeException;
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0.5
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class SerializationFailedException extends NestedRuntimeException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,6 +44,7 @@ import org.springframework.util.CustomizableThreadCreator;
|
||||
* @see org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
|
||||
* @see org.springframework.scheduling.commonj.WorkManagerTaskExecutor
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class SimpleAsyncTaskExecutor extends CustomizableThreadCreator implements AsyncTaskExecutor, Serializable {
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,6 +36,7 @@ import org.springframework.util.Assert;
|
||||
* @since 2.0
|
||||
* @see SimpleAsyncTaskExecutor
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class SyncTaskExecutor implements TaskExecutor, Serializable {
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,6 +27,7 @@ import java.util.concurrent.RejectedExecutionException;
|
||||
* @see TaskExecutor#execute(Runnable)
|
||||
* @see TaskTimeoutException
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class TaskRejectedException extends RejectedExecutionException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,6 +25,7 @@ package org.springframework.core.task;
|
||||
* @see AsyncTaskExecutor#execute(Runnable, long)
|
||||
* @see TaskRejectedException
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class TaskTimeoutException extends TaskRejectedException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,6 +40,7 @@ public class CachingMetadataReaderFactory extends SimpleMetadataReaderFactory {
|
||||
|
||||
private volatile int cacheLimit = DEFAULT_CACHE_LIMIT;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
private final Map<Resource, MetadataReader> metadataReaderCache =
|
||||
new LinkedHashMap<Resource, MetadataReader>(DEFAULT_CACHE_LIMIT, 0.75f, true) {
|
||||
@Override
|
||||
|
||||
@@ -39,6 +39,7 @@ import java.util.ListIterator;
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.0
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class AutoPopulatingList<E> implements List<E>, Serializable {
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,6 +44,7 @@ import java.util.WeakHashMap;
|
||||
* @deprecated as of Spring 3.2, to be removed along with LabeledEnum support
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class CachingMapDecorator<K, V> implements Map<K, V>, Serializable {
|
||||
|
||||
private static Object NULL_VALUE = new Object();
|
||||
|
||||
@@ -386,6 +386,7 @@ public abstract class CollectionUtils {
|
||||
/**
|
||||
* Adapts a Map to the MultiValueMap contract.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
private static class MultiValueMapAdapter<K, V> implements MultiValueMap<K, V>, Serializable {
|
||||
|
||||
private final Map<K, List<V>> map;
|
||||
|
||||
@@ -43,6 +43,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
* @see org.springframework.aop.interceptor.ConcurrencyThrottleInterceptor
|
||||
* @see java.io.Serializable
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class ConcurrencyThrottleSupport implements Serializable {
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.io.Serializable;
|
||||
* @since 2.0.3
|
||||
* @see org.springframework.scheduling.concurrent.CustomizableThreadFactory
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class CustomizableThreadCreator implements Serializable {
|
||||
|
||||
private String threadNamePrefix;
|
||||
|
||||
@@ -33,6 +33,7 @@ import java.util.Map;
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class LinkedCaseInsensitiveMap<V> extends LinkedHashMap<String, V> {
|
||||
|
||||
private final Map<String, String> caseInsensitiveKeys;
|
||||
|
||||
@@ -25,6 +25,7 @@ import java.util.Comparator;
|
||||
* @author Keith Donald
|
||||
* @since 1.2.2
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public final class BooleanComparator implements Comparator<Boolean>, Serializable {
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user