Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 613EA18D15 for ; Tue, 8 Dec 2015 00:12:29 +0000 (UTC) Received: (qmail 14460 invoked by uid 500); 8 Dec 2015 00:12:29 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 14328 invoked by uid 500); 8 Dec 2015 00:12:29 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 13141 invoked by uid 99); 8 Dec 2015 00:12:28 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2015 00:12:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 14F62E0991; Tue, 8 Dec 2015 00:12:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: clebertsuconic@apache.org To: commits@activemq.apache.org Date: Tue, 08 Dec 2015 00:12:44 -0000 Message-Id: <322118791692477b9941ffbc2f7ec851@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [18/32] activemq-artemis git commit: Remove redundant type arguments http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RawAckTest.java ---------------------------------------------------------------------- diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RawAckTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RawAckTest.java index a67a0eb..9a4140d 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RawAckTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RawAckTest.java @@ -58,7 +58,7 @@ public class RawAckTest { activeMQServer = ActiveMQServers.newActiveMQServer(configuration); activeMQServer.start(); - HashMap transportConfig = new HashMap(); + HashMap transportConfig = new HashMap<>(); serverLocator = new ServerLocatorImpl(false, new TransportConfiguration(InVMConnectorFactory.class.getName(), transportConfig)); sessionFactory = serverLocator.createSessionFactory(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ComparisonExpression.java ---------------------------------------------------------------------- diff --git a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ComparisonExpression.java b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ComparisonExpression.java index 2ed90b2..7ed8a08 100755 --- a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ComparisonExpression.java +++ b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ComparisonExpression.java @@ -28,10 +28,10 @@ import java.util.regex.Pattern; */ public abstract class ComparisonExpression extends BinaryExpression implements BooleanExpression { - public static final ThreadLocal CONVERT_STRING_EXPRESSIONS = new ThreadLocal(); + public static final ThreadLocal CONVERT_STRING_EXPRESSIONS = new ThreadLocal<>(); boolean convertStringExpressions = false; - private static final Set REGEXP_CONTROL_CHARS = new HashSet(); + private static final Set REGEXP_CONTROL_CHARS = new HashSet<>(); /** * @param left http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java ---------------------------------------------------------------------- diff --git a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java index 0c1e66f..999e51d 100755 --- a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java +++ b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java @@ -70,7 +70,7 @@ public abstract class UnaryExpression implements Expression { t = elements; } else { - t = new HashSet(elements); + t = new HashSet<>(elements); } final Collection inList = t; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java ---------------------------------------------------------------------- diff --git a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java index 55c306c..bfb67a7 100755 --- a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java +++ b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java @@ -32,7 +32,7 @@ public class SelectorTest { class MockMessage implements Filterable { - HashMap properties = new HashMap(); + HashMap properties = new HashMap<>(); private String text; private Object destination; private String messageId; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server-osgi/src/main/java/org/apache/activemq/artemis/osgi/OsgiBroker.java ---------------------------------------------------------------------- diff --git a/artemis-server-osgi/src/main/java/org/apache/activemq/artemis/osgi/OsgiBroker.java b/artemis-server-osgi/src/main/java/org/apache/activemq/artemis/osgi/OsgiBroker.java index 55f7c41..f2a30f3 100644 --- a/artemis-server-osgi/src/main/java/org/apache/activemq/artemis/osgi/OsgiBroker.java +++ b/artemis-server-osgi/src/main/java/org/apache/activemq/artemis/osgi/OsgiBroker.java @@ -136,7 +136,7 @@ public class OsgiBroker { private String[] getRequiredProtocols(Set acceptors) { - ArrayList protocols = new ArrayList(); + ArrayList protocols = new ArrayList<>(); for (TransportConfiguration acceptor : acceptors) { String protoName = acceptor.getName().toUpperCase(); if (!"ARTEMIS".equals(protoName)) { @@ -161,7 +161,7 @@ public class OsgiBroker { * we get more. */ public ArrayList getComponentsByStartOrder(Map components) { - ArrayList activeMQComponents = new ArrayList(); + ArrayList activeMQComponents = new ArrayList<>(); ActiveMQComponent jmsComponent = components.get("jms"); if (jmsComponent != null) { activeMQComponents.add(jmsComponent); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server-osgi/src/main/java/org/apache/activemq/artemis/osgi/ProtocolTracker.java ---------------------------------------------------------------------- diff --git a/artemis-server-osgi/src/main/java/org/apache/activemq/artemis/osgi/ProtocolTracker.java b/artemis-server-osgi/src/main/java/org/apache/activemq/artemis/osgi/ProtocolTracker.java index 36430b1..661024b 100644 --- a/artemis-server-osgi/src/main/java/org/apache/activemq/artemis/osgi/ProtocolTracker.java +++ b/artemis-server-osgi/src/main/java/org/apache/activemq/artemis/osgi/ProtocolTracker.java @@ -48,7 +48,7 @@ public class ProtocolTracker implements ServiceTrackerCustomizer(); + this.protocols = new HashMap<>(); for (String requiredProtocol : requiredProtocols) { this.protocols.put(requiredProtocol, false); } @@ -118,7 +118,7 @@ public class ProtocolTracker implements ServiceTrackerCustomizer getMissing() { - List missing = new ArrayList(); + List missing = new ArrayList<>(); for (String protocol : protocols.keySet()) { Boolean present = protocols.get(protocol); if (!present) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java index 2f74afa..fad446f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java @@ -101,25 +101,25 @@ public class ConfigurationImpl implements Configuration, Serializable { private boolean persistIDCache = ActiveMQDefaultConfiguration.isDefaultPersistIdCache(); - private List incomingInterceptorClassNames = new ArrayList(); + private List incomingInterceptorClassNames = new ArrayList<>(); - private List outgoingInterceptorClassNames = new ArrayList(); + private List outgoingInterceptorClassNames = new ArrayList<>(); - protected Map connectorConfigs = new HashMap(); + protected Map connectorConfigs = new HashMap<>(); - private Set acceptorConfigs = new HashSet(); + private Set acceptorConfigs = new HashSet<>(); - protected List bridgeConfigurations = new ArrayList(); + protected List bridgeConfigurations = new ArrayList<>(); - protected List divertConfigurations = new ArrayList(); + protected List divertConfigurations = new ArrayList<>(); - protected List clusterConfigurations = new ArrayList(); + protected List clusterConfigurations = new ArrayList<>(); - private List queueConfigurations = new ArrayList(); + private List queueConfigurations = new ArrayList<>(); - protected transient List broadcastGroupConfigurations = new ArrayList(); + protected transient List broadcastGroupConfigurations = new ArrayList<>(); - protected transient Map discoveryGroupConfigurations = new LinkedHashMap(); + protected transient Map discoveryGroupConfigurations = new LinkedHashMap<>(); // Paging related attributes ------------------------------------------------------------ @@ -204,15 +204,15 @@ public class ConfigurationImpl implements Configuration, Serializable { protected GroupingHandlerConfiguration groupingHandlerConfiguration; - private Map addressesSettings = new HashMap(); + private Map addressesSettings = new HashMap<>(); - private Map resourceLimitSettings = new HashMap(); + private Map resourceLimitSettings = new HashMap<>(); - private Map> securitySettings = new HashMap>(); + private Map> securitySettings = new HashMap<>(); - private List securitySettingPlugins = new ArrayList(); + private List securitySettingPlugins = new ArrayList<>(); - protected List connectorServiceConfigurations = new ArrayList(); + protected List connectorServiceConfigurations = new ArrayList<>(); private boolean maskPassword = ActiveMQDefaultConfiguration.isDefaultMaskPassword(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/SecurityConfiguration.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/SecurityConfiguration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/SecurityConfiguration.java index d647802..3325d5d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/SecurityConfiguration.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/SecurityConfiguration.java @@ -34,14 +34,14 @@ public class SecurityConfiguration extends Configuration { /** * the current valid users */ - protected final Map users = new HashMap(); + protected final Map users = new HashMap<>(); protected String defaultUser = null; /** * the roles for the users */ - protected final Map> roles = new HashMap>(); + protected final Map> roles = new HashMap<>(); public SecurityConfiguration() { } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java index 3459bf5..be1d6dd 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java @@ -277,7 +277,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil { NodeList interceptorNodes = e.getElementsByTagName("remoting-interceptors"); - ArrayList incomingInterceptorList = new ArrayList(); + ArrayList incomingInterceptorList = new ArrayList<>(); if (interceptorNodes.getLength() > 0) { NodeList interceptors = interceptorNodes.item(0).getChildNodes(); @@ -309,7 +309,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil { NodeList outgoingInterceptorNodes = e.getElementsByTagName("remoting-outgoing-interceptors"); - ArrayList outgoingInterceptorList = new ArrayList(); + ArrayList outgoingInterceptorList = new ArrayList<>(); if (outgoingInterceptorNodes.getLength() > 0) { NodeList interceptors = outgoingInterceptorNodes.item(0).getChildNodes(); @@ -504,7 +504,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil { NodeList connectorServiceConfigs = e.getElementsByTagName("connector-service"); - ArrayList configs = new ArrayList(); + ArrayList configs = new ArrayList<>(); for (int i = 0; i < connectorServiceConfigs.getLength(); i++) { Element node = (Element) connectorServiceConfigs.item(i); @@ -594,18 +594,18 @@ public final class FileConfigurationParser extends XMLConfigurationUtil { protected Pair> parseSecurityRoles(final Node node) { final String match = node.getAttributes().getNamedItem("match").getNodeValue(); - HashSet securityRoles = new HashSet(); + HashSet securityRoles = new HashSet<>(); Pair> securityMatch = new Pair>(match, securityRoles); - ArrayList send = new ArrayList(); - ArrayList consume = new ArrayList(); - ArrayList createDurableQueue = new ArrayList(); - ArrayList deleteDurableQueue = new ArrayList(); - ArrayList createNonDurableQueue = new ArrayList(); - ArrayList deleteNonDurableQueue = new ArrayList(); - ArrayList manageRoles = new ArrayList(); - ArrayList allRoles = new ArrayList(); + ArrayList send = new ArrayList<>(); + ArrayList consume = new ArrayList<>(); + ArrayList createDurableQueue = new ArrayList<>(); + ArrayList deleteDurableQueue = new ArrayList<>(); + ArrayList createNonDurableQueue = new ArrayList<>(); + ArrayList deleteNonDurableQueue = new ArrayList<>(); + ArrayList manageRoles = new ArrayList<>(); + ArrayList allRoles = new ArrayList<>(); NodeList children = node.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); @@ -681,7 +681,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil { } }); - return new Pair>(securitySettingPlugin, settings); + return new Pair<>(securitySettingPlugin, settings); } /** @@ -695,7 +695,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil { AddressSettings addressSettings = new AddressSettings(); - Pair setting = new Pair(match, addressSettings); + Pair setting = new Pair<>(match, addressSettings); for (int i = 0; i < children.getLength(); i++) { final Node child = children.item(i); @@ -1099,7 +1099,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil { private void parseBroadcastGroupConfiguration(final Element e, final Configuration mainConfig) { String name = e.getAttribute("name"); - List connectorNames = new ArrayList(); + List connectorNames = new ArrayList<>(); NodeList children = e.getChildNodes(); @@ -1240,7 +1240,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil { String discoveryGroupName = null; - List staticConnectorNames = new ArrayList(); + List staticConnectorNames = new ArrayList<>(); boolean allowDirectConnectionsOnly = false; @@ -1342,7 +1342,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil { String filterString = null; - List staticConnectorNames = new ArrayList(); + List staticConnectorNames = new ArrayList<>(); String discoveryGroupName = null; @@ -1423,7 +1423,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil { String clazz = getString(e, "factory-class", null, Validators.NOT_NULL_OR_EMPTY); - Map params = new HashMap(); + Map params = new HashMap<>(); NodeList paramsNodes = e.getElementsByTagName("param"); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java index 753aa24..5382621 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java @@ -827,7 +827,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM); Map xids = resourceManager.getPreparedTransactionsWithCreationTime(); - ArrayList> xidsSortedByCreationTime = new ArrayList>(xids.entrySet()); + ArrayList> xidsSortedByCreationTime = new ArrayList<>(xids.entrySet()); Collections.sort(xidsSortedByCreationTime, new Comparator>() { @Override public int compare(final Entry entry1, final Entry entry2) { @@ -860,7 +860,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active return ""; } - ArrayList> xidsSortedByCreationTime = new ArrayList>(xids.entrySet()); + ArrayList> xidsSortedByCreationTime = new ArrayList<>(xids.entrySet()); Collections.sort(xidsSortedByCreationTime, new Comparator>() { @Override public int compare(final Entry entry1, final Entry entry2) { @@ -894,7 +894,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active return "

*** Prepared Transaction Details ***

No entry.

"; } - ArrayList> xidsSortedByCreationTime = new ArrayList>(xids.entrySet()); + ArrayList> xidsSortedByCreationTime = new ArrayList<>(xids.entrySet()); Collections.sort(xidsSortedByCreationTime, new Comparator>() { @Override public int compare(final Entry entry1, final Entry entry2) { @@ -1078,7 +1078,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active clearIO(); try { Set connections = remotingService.getConnections(); - List remoteConnections = new ArrayList(); + List remoteConnections = new ArrayList<>(); for (RemotingConnection connection : connections) { String remoteAddress = connection.getRemoteAddress(); if (remoteAddress.contains(ipAddress)) { @@ -1375,7 +1375,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active checkStarted(); AddressSettings addressSettings = server.getAddressSettingsRepository().getMatch(address); - Map settings = new HashMap(); + Map settings = new HashMap<>(); if (addressSettings.getDeadLetterAddress() != null) { settings.put("DLA", addressSettings.getDeadLetterAddress()); } @@ -1844,7 +1844,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active } private static List toList(final String commaSeparatedString) { - List list = new ArrayList(); + List list = new ArrayList<>(); if (commaSeparatedString == null || commaSeparatedString.trim().length() == 0) { return list; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AddressControlImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AddressControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AddressControlImpl.java index 2eb02d6..bf01fbb 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AddressControlImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AddressControlImpl.java @@ -80,7 +80,7 @@ public class AddressControlImpl extends AbstractControl implements AddressContro clearIO(); try { Bindings bindings = postOffice.getBindingsForAddress(address); - List queueNames = new ArrayList(); + List queueNames = new ArrayList<>(); for (Binding binding : bindings.getBindings()) { if (binding instanceof QueueBinding) { queueNames.add(binding.getUniqueName().toString()); @@ -180,7 +180,7 @@ public class AddressControlImpl extends AbstractControl implements AddressContro long totalMsgs = 0; try { Bindings bindings = postOffice.getBindingsForAddress(address); - List queueNames = new ArrayList(); + List queueNames = new ArrayList<>(); for (Binding binding : bindings.getBindings()) { if (binding instanceof QueueBinding) { totalMsgs += ((QueueBinding) binding).getQueue().getMessageCount(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/MBeanInfoHelper.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/MBeanInfoHelper.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/MBeanInfoHelper.java index c507458..72a439a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/MBeanInfoHelper.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/MBeanInfoHelper.java @@ -39,7 +39,7 @@ public class MBeanInfoHelper { // Public -------------------------------------------------------- public static MBeanOperationInfo[] getMBeanOperationsInfo(final Class mbeanInterface) { - List operations = new ArrayList(); + List operations = new ArrayList<>(); for (Method method : mbeanInterface.getMethods()) { if (!MBeanInfoHelper.isGetterMethod(method) && !MBeanInfoHelper.isSetterMethod(method) && http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java index 3c0dab7..b61409e 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java @@ -357,7 +357,7 @@ public class QueueControlImpl extends AbstractControl implements QueueControl { try { Map> msgs = queue.getDeliveringMessages(); - Map[]> msgRet = new HashMap[]>(); + Map[]> msgRet = new HashMap<>(); for (Map.Entry> entry : msgs.entrySet()) { msgRet.put(entry.getKey(), convertMessagesToMaps(entry.getValue())); @@ -390,7 +390,7 @@ public class QueueControlImpl extends AbstractControl implements QueueControl { clearIO(); try { Filter filter = FilterImpl.createFilter(filterStr); - List> messages = new ArrayList>(); + List> messages = new ArrayList<>(); queue.flushExecutor(); LinkedListIterator iterator = queue.totalIterator(); try { @@ -433,7 +433,7 @@ public class QueueControlImpl extends AbstractControl implements QueueControl { clearIO(); try { - List> messages = new ArrayList>(); + List> messages = new ArrayList<>(); queue.flushExecutor(); LinkedListIterator iterator = queue.totalIterator(); try { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/MessageCounter.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/MessageCounter.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/MessageCounter.java index f3ea998..1d91279 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/MessageCounter.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/MessageCounter.java @@ -98,7 +98,7 @@ public class MessageCounter { resetCounter(); // initialize message history - dayCounters = new ArrayList(); + dayCounters = new ArrayList<>(); setHistoryLimit(daycountmax); } @@ -261,7 +261,7 @@ public class MessageCounter { public List getHistory() { updateHistory(0); - return new ArrayList(dayCounters); + return new ArrayList<>(dayCounters); } /** http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/impl/MessageCounterManagerImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/impl/MessageCounterManagerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/impl/MessageCounterManagerImpl.java index ff268c9..1183ce5 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/impl/MessageCounterManagerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/impl/MessageCounterManagerImpl.java @@ -53,7 +53,7 @@ public class MessageCounterManagerImpl implements MessageCounterManager { private final ScheduledExecutorService scheduledThreadPool; public MessageCounterManagerImpl(final ScheduledExecutorService scheduledThreadPool) { - messageCounters = new HashMap(); + messageCounters = new HashMap<>(); this.scheduledThreadPool = scheduledThreadPool; } @@ -134,7 +134,7 @@ public class MessageCounterManagerImpl implements MessageCounterManager { public Set getMessageCounters() { synchronized (messageCounters) { - return new HashSet(messageCounters.values()); + return new HashSet<>(messageCounters.values()); } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/PagedReferenceImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/PagedReferenceImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/PagedReferenceImpl.java index f132723..05b88d6 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/PagedReferenceImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/PagedReferenceImpl.java @@ -64,7 +64,7 @@ public class PagedReferenceImpl implements PagedReference { if (returnMessage == null) { // reference is gone, we will reconstruct it returnMessage = subscription.queryMessage(position); - message = new WeakReference(returnMessage); + message = new WeakReference<>(returnMessage); } return returnMessage; } @@ -85,7 +85,7 @@ public class PagedReferenceImpl implements PagedReference { else { this.messageEstimate = message.getMessage().getMemoryEstimate(); } - this.message = new WeakReference(message); + this.message = new WeakReference<>(message); this.subscription = subscription; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/LivePageCacheImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/LivePageCacheImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/LivePageCacheImpl.java index e319667..fd88e7a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/LivePageCacheImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/LivePageCacheImpl.java @@ -29,7 +29,7 @@ import org.apache.activemq.artemis.core.server.LargeServerMessage; */ public class LivePageCacheImpl implements LivePageCache { - private final List messages = new LinkedList(); + private final List messages = new LinkedList<>(); private final Page page; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageCursorProviderImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageCursorProviderImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageCursorProviderImpl.java index bd8dda5..f9d2bb5 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageCursorProviderImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageCursorProviderImpl.java @@ -70,7 +70,7 @@ public class PageCursorProviderImpl implements PageCursorProvider { private final SoftValueHashMap softCache; - private final ConcurrentMap activeCursors = new ConcurrentHashMap(); + private final ConcurrentMap activeCursors = new ConcurrentHashMap<>(); // Static -------------------------------------------------------- @@ -83,7 +83,7 @@ public class PageCursorProviderImpl implements PageCursorProvider { this.pagingStore = pagingStore; this.storageManager = storageManager; this.executor = executor; - this.softCache = new SoftValueHashMap(maxCacheSize); + this.softCache = new SoftValueHashMap<>(maxCacheSize); } // Public -------------------------------------------------------- @@ -340,7 +340,7 @@ public class PageCursorProviderImpl implements PageCursorProvider { @Override public void cleanup() { - ArrayList depagedPages = new ArrayList(); + ArrayList depagedPages = new ArrayList<>(); while (true) { if (pagingStore.lock(100)) { @@ -507,7 +507,7 @@ public class PageCursorProviderImpl implements PageCursorProvider { * @return */ private synchronized ArrayList cloneSubscriptions() { - ArrayList cursorList = new ArrayList(activeCursors.values()); + ArrayList cursorList = new ArrayList<>(activeCursors.values()); return cursorList; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionCounterImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionCounterImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionCounterImpl.java index c879564..c7b8c5c 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionCounterImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionCounterImpl.java @@ -62,13 +62,13 @@ public class PageSubscriptionCounterImpl implements PageSubscriptionCounter { private final AtomicLong pendingValue = new AtomicLong(0); - private final LinkedList incrementRecords = new LinkedList(); + private final LinkedList incrementRecords = new LinkedList<>(); // We are storing pending counters for non transactional writes on page // we will recount a page case we still see pending records // as soon as we close a page we remove these records replacing by a regular page increment record // A Map per pageID, each page will have a set of IDs, with the increment on each one - private final Map> pendingCounters = new HashMap>(); + private final Map> pendingCounters = new HashMap<>(); private LinkedList> loadList; @@ -115,7 +115,7 @@ public class PageSubscriptionCounterImpl implements PageSubscriptionCounter { // not syncing this to disk may cause the page files to be out of sync on pages. // we can't afford the case where a page file is written without a record here long id = storage.storePendingCounter(this.subscriptionID, page.getPageId(), increment); - pendingInfo = new Pair(id, new AtomicInteger(1)); + pendingInfo = new Pair<>(id, new AtomicInteger(1)); pendingCounters.put((long) page.getPageId(), pendingInfo); } else { @@ -257,10 +257,10 @@ public class PageSubscriptionCounterImpl implements PageSubscriptionCounter { @Override public void loadInc(long id, int add) { if (loadList == null) { - loadList = new LinkedList>(); + loadList = new LinkedList<>(); } - loadList.add(new Pair(id, add)); + loadList.add(new Pair<>(id, add)); } @Override @@ -308,7 +308,7 @@ public class PageSubscriptionCounterImpl implements PageSubscriptionCounter { return; } valueReplace = value.get(); - deleteList = new ArrayList(incrementRecords); + deleteList = new ArrayList<>(incrementRecords); incrementRecords.clear(); } @@ -365,7 +365,7 @@ public class PageSubscriptionCounterImpl implements PageSubscriptionCounter { private static class CounterOperations extends TransactionOperationAbstract implements TransactionOperation { - LinkedList operations = new LinkedList(); + LinkedList operations = new LinkedList<>(); @Override public void afterCommit(Transaction tx) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java index 08bcdfc..b800c4b 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java @@ -86,7 +86,7 @@ final class PageSubscriptionImpl implements PageSubscription { private List recoveredACK; - private final SortedMap consumedPages = new TreeMap(); + private final SortedMap consumedPages = new TreeMap<>(); private final PageSubscriptionCounter counter; @@ -244,7 +244,7 @@ final class PageSubscriptionImpl implements PageSubscription { boolean persist = false; - final ArrayList completedPages = new ArrayList(); + final ArrayList completedPages = new ArrayList<>(); // First get the completed pages using a lock synchronized (consumedPages) { @@ -538,7 +538,7 @@ final class PageSubscriptionImpl implements PageSubscription { @Override public void reloadACK(final PagePosition position) { if (recoveredACK == null) { - recoveredACK = new LinkedList(); + recoveredACK = new LinkedList<>(); } recoveredACK.add(position); @@ -867,7 +867,7 @@ final class PageSubscriptionImpl implements PageSubscription { private WeakReference cache; - private final Set removedReferences = new ConcurrentHashSet(); + private final Set removedReferences = new ConcurrentHashSet<>(); // The page was live at the time of the creation private final boolean wasLive; @@ -909,7 +909,7 @@ final class PageSubscriptionImpl implements PageSubscription { this.numberOfMessages = numberOfMessages; if (cache != null) { wasLive = cache.isLive(); - this.cache = new WeakReference(cache); + this.cache = new WeakReference<>(cache); } else { wasLive = false; @@ -1011,7 +1011,7 @@ final class PageSubscriptionImpl implements PageSubscription { PageCache localcache = this.cache.get(); if (localcache == null) { localcache = cursorProvider.getPageCache(pageId); - this.cache = new WeakReference(localcache); + this.cache = new WeakReference<>(localcache); } return localcache.getNumberOfMessages(); @@ -1025,13 +1025,13 @@ final class PageSubscriptionImpl implements PageSubscription { private static final class PageCursorTX extends TransactionOperationAbstract { - private final Map> pendingPositions = new HashMap>(); + private final Map> pendingPositions = new HashMap<>(); private void addPositionConfirmation(final PageSubscriptionImpl cursor, final PagePosition position) { List list = pendingPositions.get(cursor); if (list == null) { - list = new LinkedList(); + list = new LinkedList<>(); pendingPositions.put(cursor, list); } @@ -1073,7 +1073,7 @@ final class PageSubscriptionImpl implements PageSubscription { private volatile PagedReference lastRedelivery = null; // We only store the position for redeliveries. They will be read from the SoftCache again during delivery. - private final java.util.Queue redeliveries = new LinkedList(); + private final java.util.Queue redeliveries = new LinkedList<>(); /** * next element taken on hasNext test. http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/Page.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/Page.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/Page.java index dca0091..b2373c9 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/Page.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/Page.java @@ -106,7 +106,7 @@ public final class Page implements Comparable { throw ActiveMQMessageBundle.BUNDLE.invalidPageIO(); } - ArrayList messages = new ArrayList(); + ArrayList messages = new ArrayList<>(); size.set((int) file.size()); // Using direct buffer, as described on https://jira.jboss.org/browse/HORNETQ-467 @@ -359,7 +359,7 @@ public final class Page implements Comparable { private synchronized Set getOrCreatePendingCounters() { if (pendingCounters == null) { - pendingCounters = new ConcurrentHashSet(); + pendingCounters = new ConcurrentHashSet<>(); } return pendingCounters; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageSyncTimer.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageSyncTimer.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageSyncTimer.java index 614f201..a595721 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageSyncTimer.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageSyncTimer.java @@ -49,7 +49,7 @@ final class PageSyncTimer { } }; - private final List syncOperations = new LinkedList(); + private final List syncOperations = new LinkedList<>(); // Static -------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTransactionInfoImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTransactionInfoImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTransactionInfoImpl.java index 85c4489..55569b2 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTransactionInfoImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTransactionInfoImpl.java @@ -304,7 +304,7 @@ public final class PageTransactionInfoImpl implements PageTransactionInfo { private static class UpdatePageTXOperation extends TransactionOperationAbstract { - private final HashMap countsToUpdate = new HashMap(); + private final HashMap countsToUpdate = new HashMap<>(); private boolean stored = false; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingManagerImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingManagerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingManagerImpl.java index ce43c34..09dd1f6 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingManagerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingManagerImpl.java @@ -44,7 +44,7 @@ public final class PagingManagerImpl implements PagingManager { */ private final ReentrantReadWriteLock syncLock = new ReentrantReadWriteLock(); - private final ConcurrentMap stores = new ConcurrentHashMap(); + private final ConcurrentMap stores = new ConcurrentHashMap<>(); private final HierarchicalRepository addressSettingsRepository; @@ -52,7 +52,7 @@ public final class PagingManagerImpl implements PagingManager { private volatile boolean cleanupEnabled = true; - private final ConcurrentMap transactions = new ConcurrentHashMap(); + private final ConcurrentMap transactions = new ConcurrentHashMap<>(); // Static // -------------------------------------------------------------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreFactoryNIO.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreFactoryNIO.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreFactoryNIO.java index b6a14f3..0b0d210 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreFactoryNIO.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreFactoryNIO.java @@ -136,7 +136,7 @@ public class PagingStoreFactoryNIO implements PagingStoreFactory { return Collections.emptyList(); } else { - ArrayList storesReturn = new ArrayList(files.length); + ArrayList storesReturn = new ArrayList<>(files.length); for (File file : files) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java index f224fd1..1463b3c 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java @@ -622,7 +622,7 @@ public class PagingStoreImpl implements PagingStore { } - private final Queue onMemoryFreedRunnables = new ConcurrentLinkedQueue(); + private final Queue onMemoryFreedRunnables = new ConcurrentLinkedQueue<>(); private class MemoryFreedRunnablesExecutor implements Runnable { @@ -929,7 +929,7 @@ public class PagingStoreImpl implements PagingStore { private final PageTransactionInfo pageTransaction; private final StorageManager storageManager; private final PagingManager pagingManager; - private final Set usedStores = new HashSet(); + private final Set usedStores = new HashSet<>(); private boolean stored = false; @@ -1069,7 +1069,7 @@ public class PagingStoreImpl implements PagingStore { @Override public Collection getCurrentIds() throws Exception { - List ids = new ArrayList(); + List ids = new ArrayList<>(); if (fileFactory != null) { for (String fileName : fileFactory.listFiles("page")) { ids.add(getPageIdFromFileName(fileName)); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/DescribeJournal.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/DescribeJournal.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/DescribeJournal.java index 14bee91..6d96143 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/DescribeJournal.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/DescribeJournal.java @@ -134,7 +134,7 @@ public final class DescribeJournal { final PrintStream out = System.out; - final Map counters = new HashMap(); + final Map counters = new HashMap<>(); out.println("Journal path: " + path); @@ -249,17 +249,17 @@ public final class DescribeJournal { out.println("### Surviving Records Summary ###"); - List records = new LinkedList(); - List preparedTransactions = new LinkedList(); + List records = new LinkedList<>(); + List preparedTransactions = new LinkedList<>(); journal.start(); final StringBuffer bufferFailingTransactions = new StringBuffer(); int messageCount = 0; - Map messageRefCounts = new HashMap(); + Map messageRefCounts = new HashMap<>(); int preparedMessageCount = 0; - Map preparedMessageRefCount = new HashMap(); + Map preparedMessageRefCount = new HashMap<>(); journal.load(records, preparedTransactions, new TransactionFailureCallback() { @Override http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java index 45a544d..c1f644f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java @@ -206,11 +206,11 @@ public class JournalStorageManager implements StorageManager { private final Configuration config; // Persisted core configuration - private final Map mapPersistedRoles = new ConcurrentHashMap(); + private final Map mapPersistedRoles = new ConcurrentHashMap<>(); - private final Map mapPersistedAddressSettings = new ConcurrentHashMap(); + private final Map mapPersistedAddressSettings = new ConcurrentHashMap<>(); - private final Set largeMessagesToDelete = new HashSet(); + private final Set largeMessagesToDelete = new HashSet<>(); public JournalStorageManager(final Configuration config, final ExecutorFactory executorFactory) { this(config, executorFactory, null); @@ -489,7 +489,7 @@ public class JournalStorageManager implements StorageManager { * @throws Exception */ private Map> getPageInformationForSync(PagingManager pagingManager) throws Exception { - Map> info = new HashMap>(); + Map> info = new HashMap<>(); for (SimpleString storeName : pagingManager.getStoreNames()) { PagingStore store = pagingManager.getPageStore(storeName); info.put(storeName, store.getCurrentIds()); @@ -528,18 +528,18 @@ public class JournalStorageManager implements StorageManager { */ private Map> recoverPendingLargeMessages() throws Exception { - Map> largeMessages = new HashMap>(); + Map> largeMessages = new HashMap<>(); // only send durable messages... // listFiles append a "." to anything... List filenames = largeMessagesFactory.listFiles("msg"); - List idList = new ArrayList(); + List idList = new ArrayList<>(); for (String filename : filenames) { Long id = getLargeMessageIdFromFilename(filename); if (!largeMessagesToDelete.contains(id)) { idList.add(id); SequentialFile seqFile = largeMessagesFactory.createSequentialFile(filename); long size = seqFile.size(); - largeMessages.put(id, new Pair(filename, size)); + largeMessages.put(id, new Pair<>(filename, size)); } } @@ -1201,13 +1201,13 @@ public class JournalStorageManager implements StorageManager { @Override public List recoverAddressSettings() throws Exception { - ArrayList list = new ArrayList(mapPersistedAddressSettings.values()); + ArrayList list = new ArrayList<>(mapPersistedAddressSettings.values()); return list; } @Override public List recoverPersistedRoles() throws Exception { - ArrayList list = new ArrayList(mapPersistedRoles.values()); + ArrayList list = new ArrayList<>(mapPersistedRoles.values()); return list; } @@ -1286,21 +1286,21 @@ public class JournalStorageManager implements StorageManager { final Set> pendingLargeMessages, List pendingNonTXPageCounter, final JournalLoader journalLoader) throws Exception { - List records = new ArrayList(); + List records = new ArrayList<>(); - List preparedTransactions = new ArrayList(); + List preparedTransactions = new ArrayList<>(); - Map messages = new HashMap(); + Map messages = new HashMap<>(); readLock(); try { JournalLoadInformation info = messageJournal.load(records, preparedTransactions, new LargeMessageTXFailureCallback(messages)); - ArrayList largeMessages = new ArrayList(); + ArrayList largeMessages = new ArrayList<>(); - Map> queueMap = new HashMap>(); + Map> queueMap = new HashMap<>(); - Map pageSubscriptions = new HashMap(); + Map pageSubscriptions = new HashMap<>(); final int totalSize = records.size(); @@ -1327,7 +1327,7 @@ public class JournalStorageManager implements StorageManager { if (pendingLargeMessages != null) { // it could be null on tests, and we don't need anything on that case - pendingLargeMessages.add(new Pair(record.id, pending.largeMessageID)); + pendingLargeMessages.add(new Pair<>(record.id, pending.largeMessageID)); } break; } @@ -1359,7 +1359,7 @@ public class JournalStorageManager implements StorageManager { Map queueMessages = queueMap.get(encoding.queueID); if (queueMessages == null) { - queueMessages = new LinkedHashMap(); + queueMessages = new LinkedHashMap<>(); queueMap.put(encoding.queueID, queueMessages); } @@ -1478,12 +1478,12 @@ public class JournalStorageManager implements StorageManager { List> ids = duplicateIDMap.get(encoding.address); if (ids == null) { - ids = new ArrayList>(); + ids = new ArrayList<>(); duplicateIDMap.put(encoding.address, ids); } - ids.add(new Pair(encoding.duplID, record.id)); + ids.add(new Pair<>(encoding.duplID, record.id)); break; } @@ -1805,9 +1805,9 @@ public class JournalStorageManager implements StorageManager { @Override 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); @@ -2173,9 +2173,9 @@ public class JournalStorageManager implements StorageManager { Transaction tx = new TransactionImpl(preparedTransaction.id, 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 @@ -2329,7 +2329,7 @@ public class JournalStorageManager 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); @@ -3372,7 +3372,7 @@ public class JournalStorageManager implements StorageManager { final class TXLargeMessageConfirmationOperation extends TransactionOperationAbstract { - public List confirmedMessages = new LinkedList(); + public List confirmedMessages = new LinkedList<>(); @Override public void afterRollback(Transaction tx) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java index caa71b8..a34a0ad 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java @@ -43,7 +43,7 @@ import org.apache.activemq.artemis.utils.ExecutorFactory; */ public class OperationContextImpl implements OperationContext { - private static final ThreadLocal threadLocalContext = new ThreadLocal(); + private static final ThreadLocal threadLocalContext = new ThreadLocal<>(); public static void clearContext() { OperationContextImpl.threadLocalContext.set(null); @@ -136,7 +136,7 @@ public class OperationContextImpl implements OperationContext { synchronized (this) { if (tasks == null) { - tasks = new LinkedList(); + tasks = new LinkedList<>(); minimalReplicated = replicationLineUp.intValue(); minimalStore = storeLineUp.intValue(); minimalPage = pageLineUp.intValue(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/AddressImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/AddressImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/AddressImpl.java index 357decd..d569a8c 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/AddressImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/AddressImpl.java @@ -33,7 +33,7 @@ public class AddressImpl implements Address { private final boolean containsWildCard; - private final List
linkedAddresses = new ArrayList
(); + private final List
linkedAddresses = new ArrayList<>(); public AddressImpl(final SimpleString address) { this.address = address; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/BindingsImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/BindingsImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/BindingsImpl.java index 995e041..4bf80c3 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/BindingsImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/BindingsImpl.java @@ -51,13 +51,13 @@ public final class BindingsImpl implements Bindings { private static boolean isTrace = ActiveMQServerLogger.LOGGER.isTraceEnabled(); - private final ConcurrentMap> routingNameBindingMap = new ConcurrentHashMap>(); + private final ConcurrentMap> routingNameBindingMap = new ConcurrentHashMap<>(); - private final Map routingNamePositions = new ConcurrentHashMap(); + private final Map routingNamePositions = new ConcurrentHashMap<>(); - private final Map bindingsMap = new ConcurrentHashMap(); + private final Map bindingsMap = new ConcurrentHashMap<>(); - private final List exclusiveBindings = new CopyOnWriteArrayList(); + private final List exclusiveBindings = new CopyOnWriteArrayList<>(); private volatile MessageLoadBalancingType messageLoadBalancingType = MessageLoadBalancingType.OFF; @@ -104,7 +104,7 @@ public final class BindingsImpl implements Bindings { List bindings = routingNameBindingMap.get(routingName); if (bindings == null) { - bindings = new CopyOnWriteArrayList(); + bindings = new CopyOnWriteArrayList<>(); List oldBindings = routingNameBindingMap.putIfAbsent(routingName, bindings); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/DuplicateIDCacheImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/DuplicateIDCacheImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/DuplicateIDCacheImpl.java index 9d97dee..0ce6366 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/DuplicateIDCacheImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/DuplicateIDCacheImpl.java @@ -38,7 +38,7 @@ import org.apache.activemq.artemis.core.transaction.TransactionOperationAbstract public class DuplicateIDCacheImpl implements DuplicateIDCache { // ByteHolder, position - private final Map cache = new ConcurrentHashMap(); + private final Map cache = new ConcurrentHashMap<>(); private final SimpleString address; @@ -62,7 +62,7 @@ public class DuplicateIDCacheImpl implements DuplicateIDCache { cacheSize = size; - ids = new ArrayList>(size); + ids = new ArrayList<>(size); this.storageManager = storageManager; @@ -79,7 +79,7 @@ public class DuplicateIDCacheImpl implements DuplicateIDCache { if (count < cacheSize) { ByteArrayHolder bah = new ByteArrayHolder(id.getA()); - Pair pair = new Pair(bah, id.getB()); + Pair pair = new Pair<>(bah, id.getB()); cache.put(bah, ids.size()); @@ -205,7 +205,7 @@ public class DuplicateIDCacheImpl implements DuplicateIDCache { holder.pos = pos; } else { - id = new Pair(holder, recordID >= 0 ? recordID : null); + id = new Pair<>(holder, recordID >= 0 ? recordID : null); ids.add(id); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java index 6fcca35..da22bb9 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java @@ -116,13 +116,13 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding private final int reaperPriority; - private final ConcurrentMap duplicateIDCaches = new ConcurrentHashMap(); + private final ConcurrentMap duplicateIDCaches = new ConcurrentHashMap<>(); private final int idCacheSize; private final boolean persistIDCache; - private final Map queueInfos = new HashMap(); + private final Map queueInfos = new HashMap<>(); private final Object notificationLock = new Object(); @@ -311,7 +311,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding List filterStrings = info.getFilterStrings(); if (filterStrings == null) { - filterStrings = new ArrayList(); + filterStrings = new ArrayList<>(); info.setFilterStrings(filterStrings); } @@ -743,7 +743,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding queue.reload(reference); } else { - List refs = new ArrayList(1); + List refs = new ArrayList<>(1); refs.add(reference); @@ -773,7 +773,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding boolean routed = bindings.redistribute(copyRedistribute, originatingQueue, context); if (routed) { - return new Pair(context, copyRedistribute); + return new Pair<>(context, copyRedistribute); } } @@ -912,7 +912,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding // However if the client resends the message after receiving, it needs to be removed if ((name.startsWith(MessageImpl.HDR_ROUTE_TO_IDS) && !name.equals(MessageImpl.HDR_ROUTE_TO_IDS)) || (name.startsWith(MessageImpl.HDR_ROUTE_TO_ACK_IDS) && !name.equals(MessageImpl.HDR_ROUTE_TO_ACK_IDS))) { if (valuesToRemove == null) { - valuesToRemove = new LinkedList(); + valuesToRemove = new LinkedList<>(); } valuesToRemove.add(name); } @@ -945,7 +945,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding private static class PageDelivery extends TransactionOperationAbstract { - private final Set queues = new HashSet(); + private final Set queues = new HashSet<>(); public void addQueues(List queueList) { queues.addAll(queueList); @@ -972,7 +972,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding public void processRoute(final ServerMessage message, final RoutingContext context, final boolean direct) throws Exception { - final List refs = new ArrayList(); + final List refs = new ArrayList<>(); Transaction tx = context.getTransaction(); @@ -1124,7 +1124,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding List durableQueues = entry.getValue().getDurableQueues(); List nonDurableQueues = entry.getValue().getNonDurableQueues(); - final List queues = new ArrayList(durableQueues.size() + nonDurableQueues.size()); + final List queues = new ArrayList<>(durableQueues.size() + nonDurableQueues.size()); queues.addAll(durableQueues); queues.addAll(nonDurableQueues); @@ -1292,7 +1292,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding Map nameMap = addressManager.getBindings(); - List queues = new ArrayList(); + List queues = new ArrayList<>(); for (Binding binding : nameMap.values()) { if (binding.getType() == BindingType.LOCAL_QUEUE) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java index 77c36f0..8bfe00d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java @@ -42,14 +42,14 @@ public class SimpleAddressManager implements AddressManager { /** * HashMap */ - private final ConcurrentMap mappings = new ConcurrentHashMap(); + private final ConcurrentMap mappings = new ConcurrentHashMap<>(); /** * HashMap */ - private final ConcurrentMap nameMap = new ConcurrentHashMap(); + private final ConcurrentMap nameMap = new ConcurrentHashMap<>(); - private final ConcurrentHashSet pendingDeletes = new ConcurrentHashSet(); + private final ConcurrentHashSet pendingDeletes = new ConcurrentHashSet<>(); private final BindingsFactory bindingsFactory; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/WildcardAddressManager.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/WildcardAddressManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/WildcardAddressManager.java index 7020e5d..7609355 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/WildcardAddressManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/WildcardAddressManager.java @@ -47,9 +47,9 @@ public class WildcardAddressManager extends SimpleAddressManager { * These are all the addresses, we use this so we can link back from the actual address to its linked wilcard addresses * or vice versa */ - private final Map addresses = new ConcurrentHashMap(); + private final Map addresses = new ConcurrentHashMap<>(); - private final Map wildCardAddresses = new ConcurrentHashMap(); + private final Map wildCardAddresses = new ConcurrentHashMap<>(); public WildcardAddressManager(final BindingsFactory bindingsFactory) { super(bindingsFactory); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreProtocolManager.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreProtocolManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreProtocolManager.java index 270f7dc..9c5b748 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreProtocolManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreProtocolManager.java @@ -144,7 +144,7 @@ public class CoreProtocolManager implements ProtocolManager { return entry; } - private final Map sessionHandlers = new ConcurrentHashMap(); + private final Map sessionHandlers = new ConcurrentHashMap<>(); ServerSessionPacketHandler getSessionHandler(final String sessionName) { return sessionHandlers.get(sessionName); @@ -315,7 +315,7 @@ public class CoreProtocolManager implements ProtocolManager { @Override public void run() { String nodeId = server.getNodeID().toString(); - Pair emptyConfig = new Pair(null, null); + Pair emptyConfig = new Pair<>(null, null); if (channel0.supports(PacketImpl.CLUSTER_TOPOLOGY_V2)) { channel0.send(new ClusterTopologyChangeMessage_V2(System.currentTimeMillis(), nodeId, null, emptyConfig, true)); } @@ -331,9 +331,9 @@ public class CoreProtocolManager implements ProtocolManager { private Pair getPair(TransportConfiguration conn, boolean isBackup) { if (isBackup) { - return new Pair(null, conn); + return new Pair<>(null, conn); } - return new Pair(conn, null); + return new Pair<>(conn, null); } } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/BackupReplicationStartFailedMessage.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/BackupReplicationStartFailedMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/BackupReplicationStartFailedMessage.java index 0499db7..91830f8 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/BackupReplicationStartFailedMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/BackupReplicationStartFailedMessage.java @@ -41,7 +41,7 @@ public final class BackupReplicationStartFailedMessage extends PacketImpl { } static { - HashMap map = new HashMap(); + HashMap map = new HashMap<>(); for (BackupRegistrationProblem type : EnumSet.allOf(BackupRegistrationProblem.class)) { map.put(type.code, type); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/registry/MapBindingRegistry.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/registry/MapBindingRegistry.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/registry/MapBindingRegistry.java index 2d1be92..bba8776 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/registry/MapBindingRegistry.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/registry/MapBindingRegistry.java @@ -23,7 +23,7 @@ import org.apache.activemq.artemis.spi.core.naming.BindingRegistry; public class MapBindingRegistry implements BindingRegistry { - protected ConcurrentMap registry = new ConcurrentHashMap(); + protected ConcurrentMap registry = new ConcurrentHashMap<>(); @Override public Object lookup(String name) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java index 3c0818c..795a711 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java @@ -48,7 +48,7 @@ public final class InVMAcceptor implements Acceptor { private final ConnectionLifeCycleListener listener; - private final ConcurrentMap connections = new ConcurrentHashMap(); + private final ConcurrentMap connections = new ConcurrentHashMap<>(); private volatile boolean started; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnection.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnection.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnection.java index f498af0..7931f82 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnection.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnection.java @@ -258,7 +258,7 @@ public class InVMConnection implements Connection { @Override public TransportConfiguration getConnectorConfig() { - Map params = new HashMap(); + Map params = new HashMap<>(); params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, serverID); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java index 96f6667..33a3147 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java @@ -41,7 +41,7 @@ public class InVMConnector extends AbstractConnector { public static final Map DEFAULT_CONFIG; static { - Map config = new HashMap(); + Map config = new HashMap<>(); config.put(TransportConstants.SERVER_ID_PROP_NAME, TransportConstants.DEFAULT_SERVER_ID); DEFAULT_CONFIG = Collections.unmodifiableMap(config); } @@ -76,7 +76,7 @@ public class InVMConnector extends AbstractConnector { private final InVMAcceptor acceptor; - private final ConcurrentMap connections = new ConcurrentHashMap(); + private final ConcurrentMap connections = new ConcurrentHashMap<>(); private volatile boolean started; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMRegistry.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMRegistry.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMRegistry.java index cdb0ee3..f166a50 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMRegistry.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMRegistry.java @@ -25,7 +25,7 @@ public final class InVMRegistry { public static final InVMRegistry instance = new InVMRegistry(); - private final ConcurrentMap acceptors = new ConcurrentHashMap(); + private final ConcurrentMap acceptors = new ConcurrentHashMap<>(); public void registerAcceptor(final int id, final InVMAcceptor acceptor) { if (acceptors.putIfAbsent(id, acceptor) != null) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/HttpAcceptorHandler.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/HttpAcceptorHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/HttpAcceptorHandler.java index bc5df25..7be3bac 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/HttpAcceptorHandler.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/HttpAcceptorHandler.java @@ -43,9 +43,9 @@ import io.netty.util.ReferenceCountUtil; */ public class HttpAcceptorHandler extends ChannelDuplexHandler { - private final BlockingQueue responses = new LinkedBlockingQueue(); + private final BlockingQueue responses = new LinkedBlockingQueue<>(); - private final BlockingQueue delayedResponses = new LinkedBlockingQueue(); + private final BlockingQueue delayedResponses = new LinkedBlockingQueue<>(); private final ExecutorService executor = new ThreadPoolExecutor(1, 1, 0, TimeUnit.SECONDS, delayedResponses);