Remove unnecessary @SuppressWarnings("unchecked")

This commit is contained in:
Ville Skyttä 2015-12-06 02:11:32 +02:00
parent 96e99e4151
commit 7bf3923cee
12 changed files with 3 additions and 14 deletions

View File

@ -42,7 +42,6 @@ import org.apache.activemq.artemis.cli.commands.tools.XmlDataImporter;
public class Artemis {
@SuppressWarnings("unchecked")
public static void main(String... args) throws Exception {
execute(null, null, args);
}

View File

@ -1554,7 +1554,6 @@ public final class JMSBridgeImpl implements JMSBridge {
* don't lose them!!
*/
private static void copyProperties(final Message msg) throws JMSException {
@SuppressWarnings("unchecked")
Enumeration<String> en = msg.getPropertyNames();
Map<String, Object> oldProps = null;

View File

@ -1374,7 +1374,6 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
JSONObject msgJson = msgs.getJSONObject(i);
JSONObject props = msgJson.getJSONObject(TransactionDetail.KEY_MSG_PROPERTIES);
StringBuilder propstr = new StringBuilder();
@SuppressWarnings("unchecked")
Iterator<String> propkeys = props.keys();
while (propkeys.hasNext()) {
String key = propkeys.next();

View File

@ -933,7 +933,6 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
JSONObject msgJson = msgs.getJSONObject(i);
JSONObject props = msgJson.getJSONObject(TransactionDetail.KEY_MSG_PROPERTIES);
StringBuilder propstr = new StringBuilder();
@SuppressWarnings("unchecked")
Iterator<String> propkeys = props.keys();
while (propkeys.hasNext()) {
String key = propkeys.next();

View File

@ -136,12 +136,12 @@ public class StubX509Certificate extends X509Certificate {
return false;
}
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings("rawtypes")
public Set getCriticalExtensionOIDs() {
return null;
}
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings("rawtypes")
public Set getNonCriticalExtensionOIDs() {
return null;
}

View File

@ -360,7 +360,6 @@ public class JmsQueueBrowserTest extends JmsTestSupport {
}
QueueBrowser browser = session2.createBrowser(destinationPrefetch1);
@SuppressWarnings("unchecked")
Enumeration<Message> browserView = browser.getEnumeration();
List<Message> messages = new ArrayList<>();

View File

@ -88,7 +88,6 @@ public class AMQ2171Test implements Thread.UncaughtExceptionHandler {
connection.start();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
@SuppressWarnings("unchecked")
Enumeration<Message> unread = session.createBrowser(destination).getEnumeration();
int count = 0;

View File

@ -147,7 +147,6 @@ public class PurgeCommandTest extends TestCase {
return ManagementFactory.getPlatformMBeanServer();
}
@SuppressWarnings("unchecked")
public void purgeAllMessages() throws IOException, Exception {
List<ObjectInstance> queueList = JmxMBeansUtil.queryMBeans(createJmxConnection(), "type=Broker,brokerName=localbroker,destinationType=Queue,destinationName=*");
for (ObjectInstance oi : queueList) {
@ -199,7 +198,6 @@ public class PurgeCommandTest extends TestCase {
*
* @throws Exception
*/
@SuppressWarnings("unchecked")
public void testQueueViewMbean() throws Exception {
try {

View File

@ -22,7 +22,6 @@ import javax.naming.Context;
public class ActiveMQWASInitialContextFactoryTest extends JNDITestSupport {
@SuppressWarnings("unchecked")
public void testTransformEnvironment() {
Hashtable<Object, Object> originalEnvironment = new Hashtable<>();
originalEnvironment.put("java.naming.connectionFactoryNames", "ConnectionFactory");

View File

@ -477,7 +477,7 @@ public class BrokerNetworkWithStuckMessagesTest {
return connection;
}
@SuppressWarnings({"unchecked", "unused"})
@SuppressWarnings("unused")
private Object[] browseQueueWithJms(BrokerService broker) throws Exception {
Object[] messages = null;
Connection connection = null;

View File

@ -571,7 +571,6 @@ public class MessageBodyTest extends MessageBodyTestCase {
ProxyAssertSupport.assertFalse(m2.itemExists("sausages"));
HashSet<String> itemNames = new HashSet<>();
@SuppressWarnings("unchecked")
Enumeration<String> en = m2.getMapNames();
while (en.hasMoreElements()) {
String propName = en.nextElement();

View File

@ -290,7 +290,6 @@ public abstract class MessageHeaderTestBase extends ActiveMQServerTestCase {
}
}
@SuppressWarnings("unchecked")
public static void ensureEquivalent(final MapMessage m1, final ActiveMQMapMessage m2) throws JMSException {
MessageHeaderTestBase.ensureEquivalent((Message) m1, m2);