Remove unnecessary casts
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user