From 3f20e0d19ae802a5864d59a12630e87705388c66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 24 Jan 2016 13:12:48 +0200 Subject: [PATCH] Remove redundant type parameters --- .../apache/activemq/artemis/utils/uri/URISupport.java | 6 +++--- .../jms/management/impl/JMSQueueControlImpl.java | 2 +- .../management/impl/openmbean/JMSOpenTypeSupport.java | 8 ++++---- .../artemis/core/journal/PreparedTransactionInfo.java | 4 ++-- .../management/impl/openmbean/OpenTypeSupport.java | 8 ++++---- .../impl/journal/AbstractJournalStorageManager.java | 10 +++++----- .../journal/TXLargeMessageConfirmationOperation.java | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URISupport.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URISupport.java index 4b21b6c45c..7cbfeaa0a7 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URISupport.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URISupport.java @@ -121,7 +121,7 @@ public class URISupport { public static Map parseQuery(String uri) throws URISyntaxException { try { uri = uri.substring(uri.lastIndexOf("?") + 1); // get only the relevant part of the query - Map rc = new HashMap(); + Map rc = new HashMap<>(); if (uri != null && !uri.isEmpty()) { parseParameters(rc, uri.split("&")); parseParameters(rc, uri.split(";")); @@ -164,7 +164,7 @@ public class URISupport { } else { CompositeData data = URISupport.parseComposite(uri); - Map parameters = new HashMap(); + Map parameters = new HashMap<>(); parameters.putAll(data.getParameters()); if (parameters.isEmpty()) { parameters = emptyMap(); @@ -402,7 +402,7 @@ public class URISupport { * @return an array containing each inner URI from the composite one. */ private static String[] splitComponents(String str) { - List l = new ArrayList(); + List l = new ArrayList<>(); int last = 0; int depth = 0; diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/JMSQueueControlImpl.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/JMSQueueControlImpl.java index adbe4887ab..d6ca969564 100644 --- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/JMSQueueControlImpl.java +++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/JMSQueueControlImpl.java @@ -304,7 +304,7 @@ public class JMSQueueControlImpl extends StandardMBean implements JMSQueueContro @Override public String sendTextMessageWithProperties(String properties) throws Exception { String[] kvs = properties.split(","); - Map props = new HashMap(); + Map props = new HashMap<>(); for (String kv : kvs) { String[] it = kv.split("="); if (it.length == 2) { diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/openmbean/JMSOpenTypeSupport.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/openmbean/JMSOpenTypeSupport.java index 14d8c841b8..5c1e556834 100644 --- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/openmbean/JMSOpenTypeSupport.java +++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/openmbean/JMSOpenTypeSupport.java @@ -52,9 +52,9 @@ public final class JMSOpenTypeSupport { public abstract static class AbstractOpenTypeFactory implements OpenTypeFactory { private CompositeType compositeType; - private final List itemNamesList = new ArrayList(); - private final List itemDescriptionsList = new ArrayList(); - private final List itemTypesList = new ArrayList(); + private final List itemNamesList = new ArrayList<>(); + private final List itemDescriptionsList = new ArrayList<>(); + private final List itemTypesList = new ArrayList<>(); public CompositeType getCompositeType() throws OpenDataException { if (compositeType == null) { @@ -87,7 +87,7 @@ public final class JMSOpenTypeSupport { } public Map getFields(CompositeDataSupport data) throws OpenDataException { - Map rc = new HashMap(); + Map rc = new HashMap<>(); return rc; } } diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/PreparedTransactionInfo.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/PreparedTransactionInfo.java index afad7d703a..78617a67ce 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/PreparedTransactionInfo.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/PreparedTransactionInfo.java @@ -25,9 +25,9 @@ public class PreparedTransactionInfo { private final byte[] extraData; - private final List records = new ArrayList(); + private final List records = new ArrayList<>(); - private final List recordsToDelete = new ArrayList(); + private final List recordsToDelete = new ArrayList<>(); public PreparedTransactionInfo(final long id, final byte[] extraData) { this.id = id; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/openmbean/OpenTypeSupport.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/openmbean/OpenTypeSupport.java index 50d9c999ac..1f3a109ff0 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/openmbean/OpenTypeSupport.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/openmbean/OpenTypeSupport.java @@ -52,9 +52,9 @@ public final class OpenTypeSupport { static class MessageOpenTypeFactory { private CompositeType compositeType; - private final List itemNamesList = new ArrayList(); - private final List itemDescriptionsList = new ArrayList(); - private final List itemTypesList = new ArrayList(); + private final List itemNamesList = new ArrayList<>(); + private final List itemDescriptionsList = new ArrayList<>(); + private final List itemTypesList = new ArrayList<>(); protected TabularType stringPropertyTabularType; protected TabularType booleanPropertyTabularType; @@ -239,7 +239,7 @@ public final class OpenTypeSupport { } protected CompositeDataSupport createTabularRowValue(TabularType type, String key, Object value) throws OpenDataException { - Map fields = new HashMap(); + Map fields = new HashMap<>(); fields.put("key", key); fields.put("value", value); return new CompositeDataSupport(type.getRowType(), fields); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/AbstractJournalStorageManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/AbstractJournalStorageManager.java index be457c4d5c..b5569bdc9e 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/AbstractJournalStorageManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/AbstractJournalStorageManager.java @@ -1310,9 +1310,9 @@ public abstract class AbstractJournalStorageManager implements StorageManager { public JournalLoadInformation loadBindingJournal(final List queueBindingInfos, final List groupingInfos) throws Exception { - List records = new ArrayList(); + List records = new ArrayList<>(); - List preparedTransactions = new ArrayList(); + List preparedTransactions = new ArrayList<>(); JournalLoadInformation bindingsInfo = bindingsJournal.load(records, preparedTransactions, null); @@ -1521,9 +1521,9 @@ public abstract class AbstractJournalStorageManager implements StorageManager { Transaction tx = new TransactionImpl(preparedTransaction.getId(), xid, this); - List referencesToAck = new ArrayList(); + List referencesToAck = new ArrayList<>(); - Map messages = new HashMap(); + Map messages = new HashMap<>(); // Use same method as load message journal to prune out acks, so they don't get added. // Then have reacknowledge(tx) methods on queue, which needs to add the page size @@ -1677,7 +1677,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager { switch (b) { case ADD_LARGE_MESSAGE_PENDING: { long messageID = buff.readLong(); - if (!pendingLargeMessages.remove(new Pair(recordDeleted.id, messageID))) { + if (!pendingLargeMessages.remove(new Pair<>(recordDeleted.id, messageID))) { ActiveMQServerLogger.LOGGER.largeMessageNotFound(recordDeleted.id); } installLargeMessageConfirmationOnTX(tx, recordDeleted.id); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/TXLargeMessageConfirmationOperation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/TXLargeMessageConfirmationOperation.java index 361477a92c..bac83e673b 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/TXLargeMessageConfirmationOperation.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/TXLargeMessageConfirmationOperation.java @@ -26,7 +26,7 @@ import org.apache.activemq.artemis.core.transaction.TransactionOperationAbstract public final class TXLargeMessageConfirmationOperation extends TransactionOperationAbstract { private AbstractJournalStorageManager journalStorageManager; - public List confirmedMessages = new LinkedList(); + public List confirmedMessages = new LinkedList<>(); public TXLargeMessageConfirmationOperation(AbstractJournalStorageManager journalStorageManager) { this.journalStorageManager = journalStorageManager;