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
@@ -140,6 +140,7 @@ public class ConcurrentMapCache implements Cache {
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
private static class NullHolder implements Serializable {
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import org.springframework.beans.FatalBeanException;
|
||||
*
|
||||
* @author Rod Johnson
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ApplicationContextException extends FatalBeanException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.Locale;
|
||||
*
|
||||
* @author Rod Johnson
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class NoSuchMessageException extends RuntimeException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.springframework.context.ApplicationEvent;
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.5
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class ApplicationContextEvent extends ApplicationEvent {
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.springframework.context.ApplicationContext;
|
||||
* @since 12.08.2003
|
||||
* @see ContextRefreshedEvent
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ContextClosedEvent extends ApplicationContextEvent {
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.springframework.context.ApplicationContext;
|
||||
* @since 04.03.2003
|
||||
* @see ContextClosedEvent
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ContextRefreshedEvent extends ApplicationContextEvent {
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.springframework.context.ApplicationContext;
|
||||
* @since 2.5
|
||||
* @see ContextStoppedEvent
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ContextStartedEvent extends ApplicationContextEvent {
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.springframework.context.ApplicationContext;
|
||||
* @since 2.5
|
||||
* @see ContextStartedEvent
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ContextStoppedEvent extends ApplicationContextEvent {
|
||||
|
||||
/**
|
||||
|
||||
@@ -66,6 +66,7 @@ public class MapAccessor implements PropertyAccessor {
|
||||
* Exception thrown from {@code read} in order to reset a cached
|
||||
* PropertyAccessor, allowing other accessors to have a try.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
private static class MapAccessException extends AccessException {
|
||||
|
||||
private final String key;
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.springframework.util.StringUtils;
|
||||
* @since 13.02.2004
|
||||
* @see org.springframework.context.MessageSource#getMessage(MessageSourceResolvable, java.util.Locale)
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class DefaultMessageSourceResolvable implements MessageSourceResolvable, Serializable {
|
||||
|
||||
private final String[] codes;
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.springframework.core.NestedRuntimeException;
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.0
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class EjbAccessException extends NestedRuntimeException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -54,6 +54,7 @@ import org.springframework.util.WeakReferenceMonitor;
|
||||
* @deprecated as of Spring 3.2, in favor of implementing EJBs in EJB 3 style
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class AbstractEnterpriseBean implements EnterpriseBean {
|
||||
|
||||
public static final String BEAN_FACTORY_PATH_ENVIRONMENT_KEY = "java:comp/env/ejb/BeanFactoryPath";
|
||||
|
||||
@@ -26,6 +26,7 @@ import javax.jms.MessageListener;
|
||||
* @deprecated as of Spring 3.2, in favor of implementing EJBs in EJB 3 style
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class AbstractJmsMessageDrivenBean extends AbstractMessageDrivenBean implements MessageListener {
|
||||
|
||||
// Empty: The purpose of this class is to ensure
|
||||
|
||||
@@ -43,6 +43,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
* @deprecated as of Spring 3.2, in favor of implementing EJBs in EJB 3 style
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class AbstractMessageDrivenBean extends AbstractEnterpriseBean
|
||||
implements MessageDrivenBean {
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import javax.ejb.SessionContext;
|
||||
* @deprecated as of Spring 3.2, in favor of implementing EJBs in EJB 3 style
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class AbstractSessionBean extends AbstractEnterpriseBean implements SmartSessionBean {
|
||||
|
||||
/** The SessionContext passed to this EJB */
|
||||
|
||||
@@ -44,6 +44,7 @@ import org.springframework.beans.FatalBeanException;
|
||||
* @deprecated as of Spring 3.2, in favor of implementing EJBs in EJB 3 style
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class AbstractStatefulSessionBean extends AbstractSessionBean {
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,6 +48,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
* @deprecated as of Spring 3.2, in favor of implementing EJBs in EJB 3 style
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class AbstractStatelessSessionBean extends AbstractSessionBean {
|
||||
|
||||
/** Logger available to subclasses */
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.springframework.core.NestedRuntimeException;
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.0
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class JmxException extends NestedRuntimeException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,6 +25,7 @@ package org.springframework.jmx;
|
||||
* @since 1.2
|
||||
* @see org.springframework.jmx.support.JmxUtils#locateMBeanServer
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class MBeanServerNotFoundException extends JmxException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,6 +27,7 @@ import javax.management.JMRuntimeException;
|
||||
* @since 1.2
|
||||
* @see MBeanClientInterceptor
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class InvalidInvocationException extends JMRuntimeException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.springframework.jmx.JmxException;
|
||||
* @since 1.2
|
||||
* @see MBeanClientInterceptor
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class InvocationFailureException extends JmxException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.springframework.jmx.JmxException;
|
||||
* @since 2.5.6
|
||||
* @see MBeanClientInterceptor
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class MBeanConnectFailureException extends JmxException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,6 +28,7 @@ import org.springframework.jmx.JmxException;
|
||||
* @see MBeanClientInterceptor
|
||||
* @see MBeanProxyFactoryBean
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class MBeanInfoRetrievalException extends JmxException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.springframework.jmx.JmxException;
|
||||
* @since 2.0
|
||||
* @see MBeanExportOperations
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class MBeanExportException extends JmxException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -1069,6 +1069,7 @@ public class MBeanExporter extends MBeanRegistrationSupport
|
||||
* {@link org.springframework.jmx.export.notification.NotificationPublisher}
|
||||
* into the lazy resource as it is created if required.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
private class NotificationPublisherAwareLazyTargetSource extends LazyInitTargetSource {
|
||||
|
||||
private ModelMBean modelMBean;
|
||||
|
||||
@@ -23,6 +23,7 @@ package org.springframework.jmx.export;
|
||||
* @author Rob Harrop
|
||||
* @since 2.0
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class UnableToRegisterMBeanException extends MBeanExportException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.springframework.jmx.JmxException;
|
||||
* @see JmxAttributeSource
|
||||
* @see org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class InvalidMetadataException extends JmxException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,6 +28,7 @@ import org.springframework.jmx.JmxException;
|
||||
* @since 2.0
|
||||
* @see NotificationPublisher
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class UnableToSendNotificationException extends JmxException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.springframework.core.NestedRuntimeException;
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.0.3
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class JndiLookupFailureException extends NestedRuntimeException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,6 +26,7 @@ import javax.naming.NamingException;
|
||||
* @since 1.2.8
|
||||
* @see JndiTemplate#lookup(String, Class)
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class TypeMismatchNamingException extends NamingException {
|
||||
|
||||
private Class requiredType;
|
||||
|
||||
@@ -23,6 +23,7 @@ package org.springframework.remoting;
|
||||
* @author Juergen Hoeller
|
||||
* @since 1.1
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class RemoteConnectFailureException extends RemoteAccessException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,6 +25,7 @@ package org.springframework.remoting;
|
||||
* @since 2.5
|
||||
* @see RemoteProxyFailureException
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class RemoteInvocationFailureException extends RemoteAccessException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,6 +23,7 @@ package org.springframework.remoting;
|
||||
* @author Juergen Hoeller
|
||||
* @since 1.1
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class RemoteLookupFailureException extends RemoteAccessException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,6 +25,7 @@ package org.springframework.remoting;
|
||||
* @since 1.2.8
|
||||
* @see RemoteInvocationFailureException
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class RemoteProxyFailureException extends RemoteAccessException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.springframework.remoting.RemoteInvocationFailureException;
|
||||
* @see javax.xml.rpc.soap.SOAPFaultException
|
||||
* @see javax.xml.ws.soap.SOAPFaultException
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class SoapFaultException extends RemoteInvocationFailureException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.springframework.core.NestedRuntimeException;
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.0
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class SchedulingException extends NestedRuntimeException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.springframework.util.CustomizableThreadCreator;
|
||||
* @see #setThreadPriority
|
||||
* @deprecated as of Spring 3.2, in favor of using the native JDK 6 concurrent support
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@Deprecated
|
||||
public class CustomizableThreadFactory extends CustomizableThreadCreator implements ThreadFactory {
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ import org.springframework.util.Assert;
|
||||
* @deprecated as of Spring 3.2, in favor of using the native JDK 6 concurrent support
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
public class ThreadPoolTaskExecutor extends CustomizableThreadFactory
|
||||
implements SchedulingTaskExecutor, Executor, BeanNameAware, InitializingBean, DisposableBean {
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.springframework.util.CustomizableThreadCreator;
|
||||
* @see #setThreadNamePrefix
|
||||
* @see #setThreadPriority
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class CustomizableThreadFactory extends CustomizableThreadCreator implements ThreadFactory {
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,6 +40,7 @@ import org.springframework.beans.factory.InitializingBean;
|
||||
* @see java.util.concurrent.Executors
|
||||
* @see java.util.concurrent.ThreadPoolExecutor
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class ExecutorConfigurationSupport extends CustomizableThreadFactory
|
||||
implements BeanNameAware, InitializingBean, DisposableBean {
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ import org.springframework.util.ObjectUtils;
|
||||
* @see java.util.concurrent.ScheduledExecutorService
|
||||
* @see java.util.concurrent.ScheduledThreadPoolExecutor
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ScheduledExecutorFactoryBean extends ExecutorConfigurationSupport
|
||||
implements FactoryBean<ScheduledExecutorService> {
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ import org.springframework.beans.factory.InitializingBean;
|
||||
* @see java.util.concurrent.Executors
|
||||
* @see java.util.concurrent.ThreadPoolExecutor
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ThreadPoolExecutorFactoryBean extends ExecutorConfigurationSupport
|
||||
implements FactoryBean<ExecutorService>, InitializingBean, DisposableBean {
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ import org.springframework.util.Assert;
|
||||
* @see java.util.concurrent.ThreadPoolExecutor
|
||||
* @see ConcurrentTaskExecutor
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ThreadPoolTaskExecutor extends ExecutorConfigurationSupport implements SchedulingTaskExecutor {
|
||||
|
||||
private final Object poolSizeMonitor = new Object();
|
||||
|
||||
@@ -48,6 +48,7 @@ import org.springframework.util.ErrorHandler;
|
||||
* @see #setThreadFactory
|
||||
* @see #setErrorHandler
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ThreadPoolTaskScheduler extends ExecutorConfigurationSupport
|
||||
implements TaskScheduler, SchedulingTaskExecutor {
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.springframework.core.NestedRuntimeException;
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.0
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ScriptCompilationException extends NestedRuntimeException {
|
||||
|
||||
private ScriptSource scriptSource;
|
||||
|
||||
@@ -212,6 +212,7 @@ public abstract class BshScriptUtils {
|
||||
/**
|
||||
* Exception to be thrown on script execution failure.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public static class BshExecutionException extends NestedRuntimeException {
|
||||
|
||||
private BshExecutionException(EvalError ex) {
|
||||
|
||||
@@ -233,6 +233,7 @@ public abstract class JRubyScriptUtils {
|
||||
* have useful {@link Object#toString()}, {@link Throwable#getMessage()},
|
||||
* and {@link Throwable#printStackTrace} implementations.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public static class JRubyExecutionException extends NestedRuntimeException {
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,6 +38,7 @@ import org.springframework.util.Assert;
|
||||
* @see org.springframework.web.servlet.ModelAndView
|
||||
* @see org.springframework.web.portlet.ModelAndView
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ModelMap extends LinkedHashMap<String, Object> {
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.springframework.validation.BindingResult;
|
||||
* @since 2.5.6
|
||||
* @see org.springframework.validation.BindingResult
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BindingAwareModelMap extends ExtendedModelMap {
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user