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:
Phillip Webb
2012-12-19 14:35:57 -08:00
committed by Chris Beams
parent 7f0aa5cfb2
commit b0986049a3
550 changed files with 705 additions and 36 deletions

View File

@@ -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);
}
}
}

View File

@@ -670,6 +670,7 @@ public class MessageListenerAdapterTests {
}
@SuppressWarnings("serial")
private static class SerializableObject implements Serializable {
}

View File

@@ -74,6 +74,7 @@ public class MappingJackson2MessageConverterTests {
"bar");
final byte[] bytes = "{\"foo\":\"bar\"}".getBytes();
@SuppressWarnings("serial")
Capture<byte[]> captured = new Capture<byte[]>() {
@Override
public void setValue(byte[] value) {

View File

@@ -67,6 +67,7 @@ public class MappingJacksonMessageConverterTests {
}
@Test
@SuppressWarnings("serial")
public void fromBytesMessage() throws Exception {
BytesMessage bytesMessageMock = createMock(BytesMessage.class);
Map<String, String> unmarshalled = Collections.singletonMap("foo",

View File

@@ -23,6 +23,7 @@ import org.springframework.transaction.support.DefaultTransactionStatus;
* @author Rod Johnson
* @author Juergen Hoeller
*/
@SuppressWarnings("serial")
public class CallCountingTransactionManager extends AbstractPlatformTransactionManager {
public TransactionDefinition lastDefinition;