Remove unnecessary casts

This commit is contained in:
Chris Beams
2010-07-29 19:18:34 +02:00
parent 283d6559b4
commit ef57164a1b
7 changed files with 7 additions and 7 deletions

View File

@@ -101,7 +101,7 @@ public class SimpleMessageConverter implements MessageConverter {
messageProperties.setContentEncoding(this.defaultCharset);
}
else if (object instanceof Serializable) {
bytes = SerializationUtils.serialize((Serializable) object);
bytes = SerializationUtils.serialize(object);
messageProperties.setContentType(MessageProperties.CONTENT_TYPE_SERIALIZED_OBJECT);
}
if (bytes != null) {

View File

@@ -54,7 +54,7 @@ public class MarshallingMessageConverterTests {
converter.afterPropertiesSet();
Message message = new Message("UNMARSHAL TEST".getBytes(), new TestMessageProperties());
Object result = converter.fromMessage(message);
assertEquals("unmarshal test", (String) result);
assertEquals("unmarshal test", result);
}

View File

@@ -121,7 +121,7 @@ public class Background {
(appendErr == true ? ">>" : " >") +
Escape.escape(errFile.getAbsolutePath()));
Runtime.getRuntime().exec((String [])tmpCmd.toArray(cmd));
Runtime.getRuntime().exec(tmpCmd.toArray(cmd));
}
public static void main(String[] args) throws Exception {

View File

@@ -327,7 +327,7 @@ public class Execute {
String key = env[i].substring(0, pos+1);
int size = osEnv.size();
for (int j = 0; j < size; j++) {
if (((String)osEnv.elementAt(j)).startsWith(key)) {
if ((osEnv.elementAt(j)).startsWith(key)) {
osEnv.removeElementAt(j);
break;
}

View File

@@ -22,8 +22,8 @@ import static org.junit.Assert.assertTrue;
import java.util.List;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.connection.SingleConnectionFactory;
import org.springframework.erlang.OtpIOException;

View File

@@ -224,7 +224,7 @@ public class RabbitMessageProperties implements MessageProperties {
return basicProperties.getCorrelationId().getBytes(this.defaultCharset);
}
catch (UnsupportedEncodingException ex) {
throw new AmqpUnsupportedEncodingException((UnsupportedEncodingException) ex);
throw new AmqpUnsupportedEncodingException(ex);
}
}

View File

@@ -118,7 +118,7 @@ public abstract class RabbitUtils {
return new AmqpIOException((IOException) ex);
}
if (ex instanceof UnsupportedEncodingException) {
return new AmqpUnsupportedEncodingException((UnsupportedEncodingException) ex);
return new AmqpUnsupportedEncodingException(ex);
}
//fallback
return new UncategorizedAmqpException(ex);