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
@@ -21,6 +21,7 @@ import org.springframework.core.enums.ShortCodedLabeledEnum;
|
||||
/**
|
||||
* @author Rob Harrop
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class Colour extends ShortCodedLabeledEnum {
|
||||
|
||||
public static final Colour RED = new Colour(0, "RED");
|
||||
@@ -32,4 +33,4 @@ public class Colour extends ShortCodedLabeledEnum {
|
||||
super(code, label);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.springframework.beans.factory.DisposableBean;
|
||||
* @author Juergen Hoeller
|
||||
* @since 21.08.2003
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class DerivedTestBean extends TestBean implements Serializable, BeanNameAware, DisposableBean {
|
||||
|
||||
private String beanName;
|
||||
@@ -82,4 +83,4 @@ public class DerivedTestBean extends TestBean implements Serializable, BeanNameA
|
||||
return destroyed;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,6 +147,7 @@ public abstract class AbstractApplicationContextTests extends AbstractListableBe
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public static class MyEvent extends ApplicationEvent {
|
||||
|
||||
public MyEvent(Object source) {
|
||||
|
||||
@@ -255,21 +255,25 @@ public class SimpleMappingExceptionResolverTests extends TestCase {
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
private static class SomeOddException extends Exception {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
private static class SomeOddExceptionChild extends SomeOddException {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
private static class NoSubstringMatchesThisException extends SomeOddException {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
private static class AnotherOddException extends Exception {
|
||||
|
||||
}
|
||||
|
||||
@@ -440,7 +440,7 @@ public class PortletAnnotationControllerTests extends TestCase {
|
||||
}
|
||||
|
||||
public void testMavResolver() throws Exception {
|
||||
@SuppressWarnings("serial") DispatcherPortlet portlet = new DispatcherPortlet() {
|
||||
DispatcherPortlet portlet = new DispatcherPortlet() {
|
||||
@Override
|
||||
protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
|
||||
GenericWebApplicationContext wac = new GenericWebApplicationContext();
|
||||
|
||||
Reference in New Issue
Block a user