Fix 'raw type' warnings. No significant API changes.
This commit is contained in:
@@ -74,8 +74,7 @@ public final class BindingBuilder {
|
||||
return new Binding(this.queue, this.exchange, routingKey);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Binding with(Enum routingKeyEnum) {
|
||||
public Binding with(Enum<?> routingKeyEnum) {
|
||||
return new Binding(this.queue, this.exchange, routingKeyEnum.toString());
|
||||
}
|
||||
}
|
||||
@@ -91,8 +90,7 @@ public final class BindingBuilder {
|
||||
return new Binding(this.queue, this.exchange, routingKey);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Binding with(Enum routingKeyEnum) {
|
||||
public Binding with(Enum<?> routingKeyEnum) {
|
||||
return new Binding(this.queue, this.exchange, routingKeyEnum.toString());
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public interface ClassMapper {
|
||||
|
||||
String getClassIdFieldName();
|
||||
|
||||
String fromClass(Class clazz);
|
||||
String fromClass(Class<?> clazz);
|
||||
|
||||
Class toClass(String classId);
|
||||
Class<?> toClass(String classId);
|
||||
}
|
||||
|
||||
@@ -33,16 +33,16 @@ public class DefaultClassMapper implements ClassMapper, InitializingBean {
|
||||
|
||||
public static final String DEFAULT_CLASSID_FIELD_NAME = "__TypeId__";
|
||||
|
||||
private Map<String, Class> idClassMapping = new HashMap<String, Class>();
|
||||
private Map<String, Class<?>> idClassMapping = new HashMap<String, Class<?>>();
|
||||
|
||||
private Map<Class, String> classIdMapping = new HashMap<Class, String>();
|
||||
private Map<Class<?>, String> classIdMapping = new HashMap<Class<?>, String>();
|
||||
|
||||
private String defaultHashtableTypeId = "Hashtable";
|
||||
|
||||
private Class defaultHashtableClass = Hashtable.class;
|
||||
private Class<?> defaultHashtableClass = Hashtable.class;
|
||||
|
||||
|
||||
public void setDefaultHashtableClass(Class defaultHashtableClass) {
|
||||
public void setDefaultHashtableClass(Class<?> defaultHashtableClass) {
|
||||
this.defaultHashtableClass = defaultHashtableClass;
|
||||
}
|
||||
|
||||
@@ -50,11 +50,11 @@ public class DefaultClassMapper implements ClassMapper, InitializingBean {
|
||||
return DEFAULT_CLASSID_FIELD_NAME;
|
||||
}
|
||||
|
||||
public void setIdClassMapping(Map<String, Class> idClassMapping) {
|
||||
public void setIdClassMapping(Map<String, Class<?>> idClassMapping) {
|
||||
this.idClassMapping = idClassMapping;
|
||||
}
|
||||
|
||||
public String fromClass(Class classOfObjectToConvert) {
|
||||
public String fromClass(Class<?> classOfObjectToConvert) {
|
||||
if (classIdMapping.containsKey(classOfObjectToConvert)) {
|
||||
return classIdMapping.get(classOfObjectToConvert);
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public class DefaultClassMapper implements ClassMapper, InitializingBean {
|
||||
return classOfObjectToConvert.getName();
|
||||
}
|
||||
|
||||
public Class toClass(String classId) {
|
||||
public Class<?> toClass(String classId) {
|
||||
if (this.idClassMapping.containsKey(classId)) {
|
||||
return idClassMapping.get(classId);
|
||||
}
|
||||
@@ -89,10 +89,10 @@ public class DefaultClassMapper implements ClassMapper, InitializingBean {
|
||||
}
|
||||
|
||||
private void validateIdTypeMapping() {
|
||||
Map<String, Class> finalIdClassMapping = new HashMap<String, Class>();
|
||||
for (Entry<String, Class> entry : idClassMapping.entrySet()) {
|
||||
Map<String, Class<?>> finalIdClassMapping = new HashMap<String, Class<?>>();
|
||||
for (Entry<String, Class<?>> entry : idClassMapping.entrySet()) {
|
||||
String id = entry.getKey();
|
||||
Class clazz = entry.getValue();
|
||||
Class<?> clazz = entry.getValue();
|
||||
finalIdClassMapping.put(id, clazz);
|
||||
classIdMapping.put(clazz, id);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class ServerHandler {
|
||||
public TradeResponse handleMessage(TradeRequest tradeRequest)
|
||||
{
|
||||
TradeResponse tradeResponse;
|
||||
List errors = new ArrayList();
|
||||
List<?> errors = new ArrayList<Object>();
|
||||
if (creditCheckService.canExecute(tradeRequest, errors))
|
||||
{
|
||||
tradeResponse = executionVenueService.executeTradeRequest(tradeRequest);
|
||||
|
||||
@@ -28,5 +28,6 @@ import org.springframework.amqp.rabbit.stocks.domain.TradeRequest;
|
||||
*/
|
||||
public interface CreditCheckService {
|
||||
|
||||
boolean canExecute(TradeRequest tradeRequest, List errors);
|
||||
boolean canExecute(TradeRequest tradeRequest, List<?> errors);
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.springframework.amqp.rabbit.stocks.service.CreditCheckService;
|
||||
*/
|
||||
public class CreditCheckServiceStub implements CreditCheckService {
|
||||
|
||||
public boolean canExecute(TradeRequest tradeRequest, List errors) {
|
||||
public boolean canExecute(TradeRequest tradeRequest, List<?> errors) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -109,6 +109,7 @@ public class Background {
|
||||
String[] execCmd;
|
||||
ArrayList tmpCmd = new ArrayList();
|
||||
Runtime r;
|
||||
ArrayList<String> tmpCmd = new ArrayList<String>();
|
||||
|
||||
tmpCmd.add("cmd");
|
||||
tmpCmd.add("/c");
|
||||
|
||||
@@ -51,15 +51,15 @@ public class Execute {
|
||||
private File workingDirectory = null;
|
||||
private boolean newEnvironment = false;
|
||||
|
||||
private static Vector procEnvironment = null;
|
||||
private static Vector<String> procEnvironment = null;
|
||||
|
||||
/**
|
||||
* Find the list of environment variables for this process.
|
||||
*/
|
||||
public static synchronized Vector getProcEnvironment() {
|
||||
public static synchronized Vector<String> getProcEnvironment() {
|
||||
if (procEnvironment != null) return procEnvironment;
|
||||
|
||||
procEnvironment = new Vector();
|
||||
procEnvironment = new Vector<String>();
|
||||
try {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
Execute exe = new Execute(new PumpStreamHandler(out));
|
||||
@@ -321,7 +321,8 @@ public class Execute {
|
||||
* @return the patched environment
|
||||
*/
|
||||
private String[] patchEnvironment() {
|
||||
Vector osEnv = (Vector) getProcEnvironment().clone();
|
||||
@SuppressWarnings("unchecked")
|
||||
Vector<String> osEnv = (Vector<String>) getProcEnvironment().clone();
|
||||
for (int i = 0; i < env.length; i++) {
|
||||
int pos = env[i].indexOf('=');
|
||||
// Get key including "="
|
||||
@@ -340,18 +341,18 @@ public class Execute {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static int execute( Vector envVars, String cmd, File baseDir ) {
|
||||
Vector v=new Vector();
|
||||
public static int execute(Vector<String> envVars, String cmd, File baseDir ) {
|
||||
Vector<String> v = new Vector<String>();
|
||||
StringTokenizer st=new StringTokenizer( cmd, " " );
|
||||
while( st.hasMoreTokens() ) {
|
||||
v.addElement( st.nextElement() );
|
||||
v.addElement( st.nextToken() );
|
||||
}
|
||||
|
||||
return execute( envVars, v, baseDir );
|
||||
}
|
||||
|
||||
public static int execute( Vector envVars, Vector cmd, File baseDir) {
|
||||
return execute( envVars, cmd, baseDir, 10000 /* default time to wait */);
|
||||
public static int execute(Vector<String> envVars, Vector<String> cmd, File baseDir) {
|
||||
return execute( envVars, cmd, baseDir, 10000 /* default time to wait */);
|
||||
}
|
||||
|
||||
/** Wrapper for common execution patterns
|
||||
@@ -360,7 +361,7 @@ public class Execute {
|
||||
* @param baseDir the base directory to run from (optional)
|
||||
* @param timeToWait milliseconds to wait for completion
|
||||
*/
|
||||
public static int execute( Vector envVars, Vector cmd, File baseDir, int timeToWait) {
|
||||
public static int execute(Vector<String> envVars, Vector<String> cmd, File baseDir, int timeToWait) {
|
||||
try {
|
||||
// We can collect the out or provide in if needed
|
||||
ExecuteWatchdog watchdog=new ExecuteWatchdog( timeToWait );
|
||||
|
||||
@@ -318,7 +318,7 @@ public class MessageListenerAdapter implements MessageListener, ChannelAwareMess
|
||||
if (delegate != this) {
|
||||
if (delegate instanceof ChannelAwareMessageListener) {
|
||||
if (channel != null) {
|
||||
((ChannelAwareMessageListener) delegate).onMessage(message, channel);
|
||||
((ChannelAwareMessageListener<Message>) delegate).onMessage(message, channel);
|
||||
return;
|
||||
}
|
||||
else if (!(delegate instanceof MessageListener)) {
|
||||
|
||||
@@ -16,7 +16,7 @@ public class RabbitGatewaySupportTests {
|
||||
public void testRabbitGatewaySupportWithConnectionFactory() throws Exception {
|
||||
|
||||
org.springframework.amqp.rabbit.connection.ConnectionFactory mockConnectionFactory = mock(org.springframework.amqp.rabbit.connection.ConnectionFactory.class);
|
||||
final List test = new ArrayList();
|
||||
final List<String> test = new ArrayList<String>();
|
||||
RabbitGatewaySupport gateway = new RabbitGatewaySupport() {
|
||||
protected void initGateway() {
|
||||
test.add("test");
|
||||
@@ -32,7 +32,7 @@ public class RabbitGatewaySupportTests {
|
||||
@Test
|
||||
public void testRabbitGatewaySupportWithJmsTemplate() throws Exception {
|
||||
RabbitTemplate template = new RabbitTemplate();
|
||||
final List test = new ArrayList();
|
||||
final List<String> test = new ArrayList<String>();
|
||||
RabbitGatewaySupport gateway = new RabbitGatewaySupport() {
|
||||
protected void initGateway() {
|
||||
test.add("test");
|
||||
|
||||
Reference in New Issue
Block a user