eliminated all compiler warnings throughout all projects

updated pom to emit compiler warnings so that any new ones become obvious
added serialVersionUID to classes that could reasonably need to be serialized (GenericMessage, MessageHeaders, etc)
@SuppressWarnings("serial") on all others
@SuppressWarnings("unused") on private static classes used as spring beans for testing (their methods never get called from java)
eliminated all redundant casting
introducted generics metadata where raw types were still being used
changed public API on several FactoryBeans (by adding <Type> information to 'implements FactoryBean' clause)
This commit is contained in:
Chris Beams
2010-05-25 23:18:25 +00:00
parent 8599343832
commit e5219dfe8f
69 changed files with 291 additions and 277 deletions

View File

@@ -44,7 +44,7 @@ import org.springframework.util.Assert;
* @author Mark Fisher
* @author Juergen Hoeller
*/
public class ChannelPublishingJmsMessageListener implements SessionAwareMessageListener, InitializingBean {
public class ChannelPublishingJmsMessageListener implements SessionAwareMessageListener<javax.jms.Message>, InitializingBean {
private volatile boolean expectReply;
@@ -238,7 +238,7 @@ public class ChannelPublishingJmsMessageListener implements SessionAwareMessageL
public void onMessage(javax.jms.Message jmsMessage, Session session) throws JMSException {
Object object = this.messageConverter.fromMessage(jmsMessage);
Message<?> requestMessage = (object instanceof Message) ?
Message<?> requestMessage = (object instanceof Message<?>) ?
(Message<?>) object : MessageBuilder.withPayload(object).build();
if (!this.expectReply) {
boolean sent = this.channelTemplate.send(requestMessage);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -142,7 +142,7 @@ public class HeaderMappingMessageConverter implements MessageConverter {
if (conversionResult == null) {
return null;
}
if (conversionResult instanceof Message) {
if (conversionResult instanceof Message<?>) {
builder = MessageBuilder.fromMessage((Message<?>) conversionResult);
}
else {
@@ -166,7 +166,7 @@ public class HeaderMappingMessageConverter implements MessageConverter {
public javax.jms.Message toMessage(Object object, Session session) throws JMSException, MessageConversionException {
MessageHeaders headers = null;
javax.jms.Message jmsMessage = null;
if (object instanceof Message) {
if (object instanceof Message<?>) {
headers = ((Message<?>) object).getHeaders();
if (this.extractIntegrationMessagePayload) {
object = ((Message<?>) object).getPayload();