http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalCompactor.java ---------------------------------------------------------------------- diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalCompactor.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalCompactor.java index 3637f56..1acbcaa 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalCompactor.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalCompactor.java @@ -48,18 +48,18 @@ public class JournalCompactor extends AbstractJournalUpdateTask implements Journ private static final short COMPACT_SPLIT_LINE = 2; // Snapshot of transactions that were pending when the compactor started - private final Map<Long, PendingTransaction> pendingTransactions = new ConcurrentHashMap<Long, PendingTransaction>(); + private final Map<Long, PendingTransaction> pendingTransactions = new ConcurrentHashMap<>(); - private final Map<Long, JournalRecord> newRecords = new HashMap<Long, JournalRecord>(); + private final Map<Long, JournalRecord> newRecords = new HashMap<>(); - private final Map<Long, JournalTransaction> newTransactions = new HashMap<Long, JournalTransaction>(); + private final Map<Long, JournalTransaction> newTransactions = new HashMap<>(); /** * Commands that happened during compacting * We can't process any counts during compacting, as we won't know in what files the records are taking place, so * we cache those updates. As soon as we are done we take the right account. */ - private final LinkedList<CompactCommand> pendingCommands = new LinkedList<CompactCommand>(); + private final LinkedList<CompactCommand> pendingCommands = new LinkedList<>(); public static SequentialFile readControlFile(final SequentialFileFactory fileFactory, final List<String> dataFiles, @@ -70,7 +70,7 @@ public class JournalCompactor extends AbstractJournalUpdateTask implements Journ if (controlFile.exists()) { JournalFile file = new JournalFileImpl(controlFile, 0, JournalImpl.FORMAT_VERSION); - final ArrayList<RecordInfo> records = new ArrayList<RecordInfo>(); + final ArrayList<RecordInfo> records = new ArrayList<>(); JournalImpl.readJournalFile(fileFactory, file, new JournalReaderCallbackAbstract() { @Override @@ -101,7 +101,7 @@ public class JournalCompactor extends AbstractJournalUpdateTask implements Journ for (int i = 0; i < numberRenames; i++) { String from = input.readUTF(); String to = input.readUTF(); - renameFile.add(new Pair<String, String>(from, to)); + renameFile.add(new Pair<>(from, to)); } }
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFileImpl.java ---------------------------------------------------------------------- diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFileImpl.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFileImpl.java index 4c766b7..01d8000 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFileImpl.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFileImpl.java @@ -43,7 +43,7 @@ public class JournalFileImpl implements JournalFile { private final int version; - private final Map<JournalFile, AtomicInteger> negCounts = new ConcurrentHashMap<JournalFile, AtomicInteger>(); + private final Map<JournalFile, AtomicInteger> negCounts = new ConcurrentHashMap<>(); public JournalFileImpl(final SequentialFile file, final long fileID, final int version) { this.file = file; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java ---------------------------------------------------------------------- diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java index 159690d..e1d69ab 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java @@ -61,11 +61,11 @@ public class JournalFilesRepository { private final JournalImpl journal; - private final BlockingDeque<JournalFile> dataFiles = new LinkedBlockingDeque<JournalFile>(); + private final BlockingDeque<JournalFile> dataFiles = new LinkedBlockingDeque<>(); - private final ConcurrentLinkedQueue<JournalFile> freeFiles = new ConcurrentLinkedQueue<JournalFile>(); + private final ConcurrentLinkedQueue<JournalFile> freeFiles = new ConcurrentLinkedQueue<>(); - private final BlockingQueue<JournalFile> openedFiles = new LinkedBlockingQueue<JournalFile>(); + private final BlockingQueue<JournalFile> openedFiles = new LinkedBlockingQueue<>(); private final AtomicLong nextFileID = new AtomicLong(0); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalImpl.java ---------------------------------------------------------------------- diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalImpl.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalImpl.java index f8aa784..4b72992 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalImpl.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalImpl.java @@ -174,10 +174,10 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal private final JournalFilesRepository filesRepository; // Compacting may replace this structure - private final ConcurrentMap<Long, JournalRecord> records = new ConcurrentHashMap<Long, JournalRecord>(); + private final ConcurrentMap<Long, JournalRecord> records = new ConcurrentHashMap<>(); // Compacting may replace this structure - private final ConcurrentMap<Long, JournalTransaction> transactions = new ConcurrentHashMap<Long, JournalTransaction>(); + private final ConcurrentMap<Long, JournalTransaction> transactions = new ConcurrentHashMap<>(); // This will be set only while the JournalCompactor is being executed private volatile JournalCompactor compactor; @@ -188,7 +188,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal private ExecutorService compactorExecutor = null; - private ConcurrentHashSet<CountDownLatch> latches = new ConcurrentHashSet<CountDownLatch>(); + private ConcurrentHashSet<CountDownLatch> latches = new ConcurrentHashSet<>(); // Lock used during the append of records // This lock doesn't represent a global lock. @@ -348,7 +348,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal public List<JournalFile> orderFiles() throws Exception { List<String> fileNames = fileFactory.listFiles(filesRepository.getFileExtension()); - List<JournalFile> orderedFiles = new ArrayList<JournalFile>(fileNames.size()); + List<JournalFile> orderedFiles = new ArrayList<>(fileNames.size()); for (String fileName : fileNames) { SequentialFile file = fileFactory.createSequentialFile(fileName); @@ -1168,9 +1168,9 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal final List<PreparedTransactionInfo> preparedTransactions, final TransactionFailureCallback failureCallback, final boolean fixBadTX) throws Exception { - final Set<Long> recordsToDelete = new HashSet<Long>(); + final Set<Long> recordsToDelete = new HashSet<>(); // ArrayList was taking too long to delete elements on checkDeleteSize - final List<RecordInfo> records = new LinkedList<RecordInfo>(); + final List<RecordInfo> records = new LinkedList<>(); final int DELETE_FLUSH = 20000; @@ -1296,7 +1296,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal compactorLock.writeLock().lock(); try { - ArrayList<JournalFile> dataFilesToProcess = new ArrayList<JournalFile>(filesRepository.getDataFilesCount()); + ArrayList<JournalFile> dataFilesToProcess = new ArrayList<>(filesRepository.getDataFilesCount()); boolean previousReclaimValue = isAutoReclaim(); @@ -1527,7 +1527,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal transactions.clear(); currentFile = null; - final Map<Long, TransactionHolder> loadTransactions = new LinkedHashMap<Long, TransactionHolder>(); + final Map<Long, TransactionHolder> loadTransactions = new LinkedHashMap<>(); final List<JournalFile> orderedFiles = orderFiles(); @@ -2194,7 +2194,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal cleanupList = null; } else { - cleanupList = new ArrayList<Pair<String, String>>(); + cleanupList = new ArrayList<>(); cleanupList.add(cleanupRename); } return AbstractJournalUpdateTask.writeControlFile(fileFactory, files, newFiles, cleanupList); @@ -2545,9 +2545,9 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal * @throws Exception */ private void checkControlFile() throws Exception { - ArrayList<String> dataFiles = new ArrayList<String>(); - ArrayList<String> newFiles = new ArrayList<String>(); - ArrayList<Pair<String, String>> renames = new ArrayList<Pair<String, String>>(); + ArrayList<String> dataFiles = new ArrayList<>(); + ArrayList<String> newFiles = new ArrayList<>(); + ArrayList<Pair<String, String>> renames = new ArrayList<>(); SequentialFile controlFile = JournalCompactor.readControlFile(fileFactory, dataFiles, newFiles, renames); if (controlFile != null) { @@ -2629,9 +2629,9 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal public final long transactionID; - public final List<RecordInfo> recordInfos = new ArrayList<RecordInfo>(); + public final List<RecordInfo> recordInfos = new ArrayList<>(); - public final List<RecordInfo> recordsToDelete = new ArrayList<RecordInfo>(); + public final List<RecordInfo> recordsToDelete = new ArrayList<>(); public boolean prepared; @@ -2726,7 +2726,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal public synchronized Map<Long, JournalFile> createFilesForBackupSync(long[] fileIds) throws Exception { synchronizationLock(); try { - Map<Long, JournalFile> map = new HashMap<Long, JournalFile>(); + Map<Long, JournalFile> map = new HashMap<>(); long maxID = -1; for (long id : fileIds) { maxID = Math.max(maxID, id); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalRecord.java ---------------------------------------------------------------------- diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalRecord.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalRecord.java index a7d4169..c8c0bda 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalRecord.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalRecord.java @@ -47,10 +47,10 @@ public class JournalRecord { void addUpdateFile(final JournalFile updateFile, final int size) { if (updateFiles == null) { - updateFiles = new ArrayList<Pair<JournalFile, Integer>>(); + updateFiles = new ArrayList<>(); } - updateFiles.add(new Pair<JournalFile, Integer>(updateFile, size)); + updateFiles.add(new Pair<>(updateFile, size)); updateFile.incPosCount(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalTransaction.java ---------------------------------------------------------------------- diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalTransaction.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalTransaction.java index 8a29d60..a01efed 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalTransaction.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalTransaction.java @@ -103,7 +103,7 @@ public class JournalTransaction { public void merge(final JournalTransaction other) { if (other.pos != null) { if (pos == null) { - pos = new ArrayList<JournalUpdate>(); + pos = new ArrayList<>(); } pos.addAll(other.pos); @@ -111,7 +111,7 @@ public class JournalTransaction { if (other.neg != null) { if (neg == null) { - neg = new ArrayList<JournalUpdate>(); + neg = new ArrayList<>(); } neg.addAll(other.neg); @@ -119,7 +119,7 @@ public class JournalTransaction { if (other.pendingFiles != null) { if (pendingFiles == null) { - pendingFiles = new HashSet<JournalFile>(); + pendingFiles = new HashSet<>(); } pendingFiles.addAll(other.pendingFiles); @@ -169,7 +169,7 @@ public class JournalTransaction { public TransactionCallback getCallback(final JournalFile file) throws Exception { if (callbackList == null) { - callbackList = new HashMap<JournalFile, TransactionCallback>(); + callbackList = new HashMap<>(); } currentCallback = callbackList.get(file); @@ -194,7 +194,7 @@ public class JournalTransaction { addFile(file); if (pos == null) { - pos = new ArrayList<JournalUpdate>(); + pos = new ArrayList<>(); } pos.add(new JournalUpdate(file, id, size)); @@ -206,7 +206,7 @@ public class JournalTransaction { addFile(file); if (neg == null) { - neg = new ArrayList<JournalUpdate>(); + neg = new ArrayList<>(); } neg.add(new JournalUpdate(file, id, 0)); @@ -349,7 +349,7 @@ public class JournalTransaction { private void addFile(final JournalFile file) { if (pendingFiles == null) { - pendingFiles = new HashSet<JournalFile>(); + pendingFiles = new HashSet<>(); } if (!pendingFiles.contains(file)) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisAbstractPlugin.java ---------------------------------------------------------------------- diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisAbstractPlugin.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisAbstractPlugin.java index 0747ea8..d4c8abd 100644 --- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisAbstractPlugin.java +++ b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisAbstractPlugin.java @@ -112,7 +112,7 @@ public abstract class ArtemisAbstractPlugin extends AbstractMojo { } protected List<Artifact> explodeDependencies(Artifact artifact) throws DependencyCollectionException { - final List<Artifact> dependencies = new LinkedList<Artifact>(); + final List<Artifact> dependencies = new LinkedList<>(); CollectRequest exploreDependenciesRequest = new CollectRequest(new Dependency(artifact, "compile"), remoteRepos); CollectResult result = repositorySystem.collectDependencies(repoSession, exploreDependenciesRequest); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/jms/ServerJMSMapMessage.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/jms/ServerJMSMapMessage.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/jms/ServerJMSMapMessage.java index 52f4f6a..2083b84 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/jms/ServerJMSMapMessage.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/jms/ServerJMSMapMessage.java @@ -249,7 +249,7 @@ public final class ServerJMSMapMessage extends ServerJMSMessage implements MapMe @Override public Enumeration getMapNames() throws JMSException { Set<SimpleString> simplePropNames = map.getPropertyNames(); - Set<String> propNames = new HashSet<String>(simplePropNames.size()); + Set<String> propNames = new HashSet<>(simplePropNames.size()); for (SimpleString str : simplePropNames) { propNames.add(str.toString()); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-hqclient-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/util/HQPropertiesConverter.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-hqclient-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/util/HQPropertiesConverter.java b/artemis-protocols/artemis-hqclient-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/util/HQPropertiesConverter.java index 9240e55..ee71162 100644 --- a/artemis-protocols/artemis-hqclient-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/util/HQPropertiesConverter.java +++ b/artemis-protocols/artemis-hqclient-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/util/HQPropertiesConverter.java @@ -33,7 +33,7 @@ public class HQPropertiesConverter { private static Map<SimpleString, SimpleString> amqHqDictionary; static { - Map<SimpleString, SimpleString> d = new HashMap<SimpleString, SimpleString>(); + Map<SimpleString, SimpleString> d = new HashMap<>(); // Add entries for outgoing messages d.put(new SimpleString("_HQ_ACTUAL_EXPIRY"), new SimpleString("_AMQ_ACTUAL_EXPIRY")); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnection.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnection.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnection.java index c11bd86..87849ab 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnection.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnection.java @@ -90,7 +90,7 @@ public class MQTTConnection implements RemotingConnection { @Override public List<CloseListener> removeCloseListeners() { synchronized (closeListeners) { - List<CloseListener> deletedCloseListeners = new ArrayList<CloseListener>(closeListeners); + List<CloseListener> deletedCloseListeners = new ArrayList<>(closeListeners); closeListeners.clear(); return deletedCloseListeners; } @@ -109,7 +109,7 @@ public class MQTTConnection implements RemotingConnection { @Override public List<FailureListener> removeFailureListeners() { synchronized (failureListeners) { - List<FailureListener> deletedFailureListeners = new ArrayList<FailureListener>(failureListeners); + List<FailureListener> deletedFailureListeners = new ArrayList<>(failureListeners); failureListeners.clear(); return deletedFailureListeners; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnectionManager.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnectionManager.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnectionManager.java index fb10717..9d60513 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnectionManager.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnectionManager.java @@ -38,7 +38,7 @@ public class MQTTConnectionManager { private MQTTSession session; //TODO Read in a list of existing client IDs from stored Sessions. - public static Set<String> CONNECTED_CLIENTS = new ConcurrentHashSet<String>(); + public static Set<String> CONNECTED_CLIENTS = new ConcurrentHashSet<>(); private MQTTLogger log = MQTTLogger.LOGGER; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSessionState.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSessionState.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSessionState.java index 6fd5752..9bc3074 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSessionState.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSessionState.java @@ -80,13 +80,13 @@ public class MQTTSessionState { void addOutbandMessageRef(int mqttId, String address, long serverMessageId, int qos) { synchronized (outboundLock) { - outboundMessageReferenceStore.put(mqttId, new Pair<String, Long>(address, serverMessageId)); + outboundMessageReferenceStore.put(mqttId, new Pair<>(address, serverMessageId)); if (qos == 2) { if (reverseOutboundReferenceStore.containsKey(address)) { reverseOutboundReferenceStore.get(address).put(serverMessageId, mqttId); } else { - ConcurrentHashMap<Long, Integer> serverToMqttId = new ConcurrentHashMap<Long, Integer>(); + ConcurrentHashMap<Long, Integer> serverToMqttId = new ConcurrentHashMap<>(); serverToMqttId.put(serverMessageId, mqttId); reverseOutboundReferenceStore.put(address, serverToMqttId); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java index 0de5990..0bc87ee 100644 --- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java +++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java @@ -108,9 +108,9 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor, S private final long creationTime; - private final List<FailureListener> failureListeners = new CopyOnWriteArrayList<FailureListener>(); + private final List<FailureListener> failureListeners = new CopyOnWriteArrayList<>(); - private final List<CloseListener> closeListeners = new CopyOnWriteArrayList<CloseListener>(); + private final List<CloseListener> closeListeners = new CopyOnWriteArrayList<>(); private boolean destroyed = false; @@ -132,20 +132,20 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor, S private final ReentrantReadWriteLock serviceLock = new ReentrantReadWriteLock(); - protected final List<Command> dispatchQueue = new LinkedList<Command>(); + protected final List<Command> dispatchQueue = new LinkedList<>(); private boolean inServiceException; private final AtomicBoolean asyncException = new AtomicBoolean(false); - private final Map<ConsumerId, AMQConsumerBrokerExchange> consumerExchanges = new HashMap<ConsumerId, AMQConsumerBrokerExchange>(); - private final Map<ProducerId, AMQProducerBrokerExchange> producerExchanges = new HashMap<ProducerId, AMQProducerBrokerExchange>(); + private final Map<ConsumerId, AMQConsumerBrokerExchange> consumerExchanges = new HashMap<>(); + private final Map<ProducerId, AMQProducerBrokerExchange> producerExchanges = new HashMap<>(); private ConnectionState state; - private final Set<ActiveMQDestination> tempQueues = new ConcurrentHashSet<ActiveMQDestination>(); + private final Set<ActiveMQDestination> tempQueues = new ConcurrentHashSet<>(); - private Map<TransactionId, TransactionInfo> txMap = new ConcurrentHashMap<TransactionId, TransactionInfo>(); + private Map<TransactionId, TransactionInfo> txMap = new ConcurrentHashMap<>(); private volatile AMQSession advisorySession; @@ -341,7 +341,7 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor, S @Override public List<CloseListener> removeCloseListeners() { - List<CloseListener> ret = new ArrayList<CloseListener>(closeListeners); + List<CloseListener> ret = new ArrayList<>(closeListeners); closeListeners.clear(); @@ -364,7 +364,7 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor, S @Override public List<FailureListener> removeFailureListeners() { - List<FailureListener> ret = new ArrayList<FailureListener>(failureListeners); + List<FailureListener> ret = new ArrayList<>(failureListeners); failureListeners.clear(); @@ -464,7 +464,7 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor, S } private void callFailureListeners(final ActiveMQException me) { - final List<FailureListener> listenersClone = new ArrayList<FailureListener>(failureListeners); + final List<FailureListener> listenersClone = new ArrayList<>(failureListeners); for (final FailureListener listener : listenersClone) { try { @@ -480,7 +480,7 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor, S } private void callClosingListeners() { - final List<CloseListener> listenersClone = new ArrayList<CloseListener>(closeListeners); + final List<CloseListener> listenersClone = new ArrayList<>(closeListeners); for (final CloseListener listener : listenersClone) { try { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java index 0ef7669..f916c8f 100644 --- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java +++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java @@ -119,19 +119,19 @@ public class OpenWireProtocolManager implements ProtocolManager<Interceptor>, No // from broker protected final Map<ConnectionId, OpenWireConnection> brokerConnectionStates = Collections.synchronizedMap(new HashMap<ConnectionId, OpenWireConnection>()); - private final CopyOnWriteArrayList<OpenWireConnection> connections = new CopyOnWriteArrayList<OpenWireConnection>(); + private final CopyOnWriteArrayList<OpenWireConnection> connections = new CopyOnWriteArrayList<>(); - protected final ConcurrentMap<ConnectionId, ConnectionInfo> connectionInfos = new ConcurrentHashMap<ConnectionId, ConnectionInfo>(); + protected final ConcurrentMap<ConnectionId, ConnectionInfo> connectionInfos = new ConcurrentHashMap<>(); - private final Map<String, AMQConnectionContext> clientIdSet = new HashMap<String, AMQConnectionContext>(); + private final Map<String, AMQConnectionContext> clientIdSet = new HashMap<>(); private String brokerName; - private Map<SessionId, AMQSession> sessions = new ConcurrentHashMap<SessionId, AMQSession>(); + private Map<SessionId, AMQSession> sessions = new ConcurrentHashMap<>(); - private Map<TransactionId, AMQSession> transactions = new ConcurrentHashMap<TransactionId, AMQSession>(); + private Map<TransactionId, AMQSession> transactions = new ConcurrentHashMap<>(); - private Map<String, SessionId> sessionIdMap = new ConcurrentHashMap<String, SessionId>(); + private Map<String, SessionId> sessionIdMap = new ConcurrentHashMap<>(); private final ScheduledExecutorService scheduledPool; @@ -649,7 +649,7 @@ public class OpenWireProtocolManager implements ProtocolManager<Interceptor>, No } public TransactionId[] recoverTransactions(Set<SessionId> sIds) { - List<TransactionId> recovered = new ArrayList<TransactionId>(); + List<TransactionId> recovered = new ArrayList<>(); if (sIds != null) { for (SessionId sid : sIds) { AMQSession s = this.sessions.get(sid); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java index 40d253e..7da1f3e 100644 --- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java +++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java @@ -54,7 +54,7 @@ public class AMQConsumer implements BrowserListener { private final int prefetchSize; private AtomicInteger windowAvailable; - private final java.util.Queue<MessageInfo> deliveringRefs = new ConcurrentLinkedQueue<MessageInfo>(); + private final java.util.Queue<MessageInfo> deliveringRefs = new ConcurrentLinkedQueue<>(); private long messagePullSequence = 0; private MessagePullHandler messagePullHandler; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQServerSession.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQServerSession.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQServerSession.java index 08cb1ee..c414319 100644 --- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQServerSession.java +++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQServerSession.java @@ -154,7 +154,7 @@ public class AMQServerSession extends ServerSessionImpl { if (oper != null) { List<MessageReference> ackRefs = oper.getReferencesToAcknowledge(); - Map<Long, List<MessageReference>> toAcks = new HashMap<Long, List<MessageReference>>(); + Map<Long, List<MessageReference>> toAcks = new HashMap<>(); for (MessageReference ref : ackRefs) { Long consumerId = ref.getConsumerId(); @@ -162,7 +162,7 @@ public class AMQServerSession extends ServerSessionImpl { if (acked.contains(ref.getMessage().getMessageID())) { List<MessageReference> ackList = toAcks.get(consumerId); if (ackList == null) { - ackList = new ArrayList<MessageReference>(); + ackList = new ArrayList<>(); toAcks.put(consumerId, ackList); } ackList.add(ref); @@ -329,7 +329,7 @@ public class AMQServerSession extends ServerSessionImpl { Pair<UUID, AtomicLong> value = targetAddressInfos.get(msg.getAddress()); if (value == null) { - targetAddressInfos.put(msg.getAddress(), new Pair<UUID, AtomicLong>(msg.getUserID(), new AtomicLong(1))); + targetAddressInfos.put(msg.getAddress(), new Pair<>(msg.getUserID(), new AtomicLong(1))); } else { value.setA(msg.getUserID()); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java index 1d285e0..0765676 100644 --- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java +++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java @@ -399,7 +399,7 @@ public class AMQSession implements SessionCallback { } else { Iterator<AMQConsumer> iter = consumers.values().iterator(); - Set<Long> acked = new HashSet<Long>(); + Set<Long> acked = new HashSet<>(); while (iter.hasNext()) { AMQConsumer consumer = iter.next(); consumer.rollbackTx(acked); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonSessionContext.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonSessionContext.java b/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonSessionContext.java index 00d1c67..abb3115 100644 --- a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonSessionContext.java +++ b/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonSessionContext.java @@ -45,9 +45,9 @@ public abstract class AbstractProtonSessionContext extends ProtonInitializable i private long currentTag = 0; - protected Map<Receiver, AbstractProtonReceiverContext> receivers = new HashMap<Receiver, AbstractProtonReceiverContext>(); + protected Map<Receiver, AbstractProtonReceiverContext> receivers = new HashMap<>(); - protected Map<Sender, AbstractProtonContextSender> senders = new HashMap<Sender, AbstractProtonContextSender>(); + protected Map<Sender, AbstractProtonContextSender> senders = new HashMap<>(); protected boolean closed = false; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerSessionContext.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerSessionContext.java b/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerSessionContext.java index adfacae..46178a9 100644 --- a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerSessionContext.java +++ b/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerSessionContext.java @@ -40,7 +40,7 @@ public class ProtonServerSessionContext extends AbstractProtonSessionContext { super(sessionSPI, connection, session); } - protected Map<Object, AbstractProtonContextSender> serverSenders = new HashMap<Object, AbstractProtonContextSender>(); + protected Map<Object, AbstractProtonContextSender> serverSenders = new HashMap<>(); /** * The consumer object from the broker or the key used to store the sender http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-proton-plug/src/test/java/org/proton/plug/test/AbstractJMSTest.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-proton-plug/src/test/java/org/proton/plug/test/AbstractJMSTest.java b/artemis-protocols/artemis-proton-plug/src/test/java/org/proton/plug/test/AbstractJMSTest.java index 90fff62..156b3ce 100644 --- a/artemis-protocols/artemis-proton-plug/src/test/java/org/proton/plug/test/AbstractJMSTest.java +++ b/artemis-protocols/artemis-proton-plug/src/test/java/org/proton/plug/test/AbstractJMSTest.java @@ -47,7 +47,7 @@ public class AbstractJMSTest { public static void forceGC() { System.out.println("#test forceGC"); - WeakReference<Object> dumbReference = new WeakReference<Object>(new Object()); + WeakReference<Object> dumbReference = new WeakReference<>(new Object()); // A loop that will wait GC, using the minimalserver time as possible while (dumbReference.get() != null) { System.gc(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompException.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompException.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompException.java index 8688750..a6a7c50 100644 --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompException.java +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompException.java @@ -29,7 +29,7 @@ public class ActiveMQStompException extends Exception { private static final long serialVersionUID = -274452327574950068L; private int code = NONE; - private final List<Header> headers = new ArrayList<Header>(10); + private final List<Header> headers = new ArrayList<>(10); private String body; private VersionedStompFrameHandler handler; private boolean disconnect; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java index 08bc2e9..2701b5f 100644 --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java @@ -71,9 +71,9 @@ public final class StompConnection implements RemotingConnection { private final Acceptor acceptorUsed; - private final List<FailureListener> failureListeners = new CopyOnWriteArrayList<FailureListener>(); + private final List<FailureListener> failureListeners = new CopyOnWriteArrayList<>(); - private final List<CloseListener> closeListeners = new CopyOnWriteArrayList<CloseListener>(); + private final List<CloseListener> closeListeners = new CopyOnWriteArrayList<>(); private final Object failLock = new Object(); @@ -177,7 +177,7 @@ public final class StompConnection implements RemotingConnection { @Override public List<CloseListener> removeCloseListeners() { - List<CloseListener> ret = new ArrayList<CloseListener>(closeListeners); + List<CloseListener> ret = new ArrayList<>(closeListeners); closeListeners.clear(); @@ -186,7 +186,7 @@ public final class StompConnection implements RemotingConnection { @Override public List<FailureListener> removeFailureListeners() { - List<FailureListener> ret = new ArrayList<FailureListener>(failureListeners); + List<FailureListener> ret = new ArrayList<>(failureListeners); failureListeners.clear(); @@ -374,7 +374,7 @@ public final class StompConnection implements RemotingConnection { } private void callFailureListeners(final ActiveMQException me) { - final List<FailureListener> listenersClone = new ArrayList<FailureListener>(failureListeners); + final List<FailureListener> listenersClone = new ArrayList<>(failureListeners); for (final FailureListener listener : listenersClone) { try { @@ -390,7 +390,7 @@ public final class StompConnection implements RemotingConnection { } private void callClosingListeners() { - final List<CloseListener> listenersClone = new ArrayList<CloseListener>(closeListeners); + final List<CloseListener> listenersClone = new ArrayList<>(closeListeners); for (final CloseListener listener : listenersClone) { try { @@ -417,7 +417,7 @@ public final class StompConnection implements RemotingConnection { } else { StringTokenizer tokenizer = new StringTokenizer(acceptVersion, ","); - Set<String> requestVersions = new HashSet<String>(tokenizer.countTokens()); + Set<String> requestVersions = new HashSet<>(tokenizer.countTokens()); while (tokenizer.hasMoreTokens()) { requestVersions.add(tokenizer.nextToken()); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java index 2e493b4..c1a3093 100644 --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java @@ -562,7 +562,7 @@ public class StompDecoder { command = null; - headers = new HashMap<String, String>(); + headers = new HashMap<>(); this.headerBytesCopyStart = -1; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompFrame.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompFrame.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompFrame.java index 0834e96..4e184db 100644 --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompFrame.java +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompFrame.java @@ -53,7 +53,7 @@ public class StompFrame { public StompFrame(String command, boolean disconnect) { this.command = command; - this.headers = new LinkedHashMap<String, String>(); + this.headers = new LinkedHashMap<>(); this.disconnect = disconnect; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManager.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManager.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManager.java index 7d069c2..951bb89 100644 --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManager.java +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManager.java @@ -73,12 +73,12 @@ class StompProtocolManager implements ProtocolManager<StompFrameInterceptor>, No private final Executor executor; - private final Map<String, StompSession> transactedSessions = new HashMap<String, StompSession>(); + private final Map<String, StompSession> transactedSessions = new HashMap<>(); // key => connection ID, value => Stomp session - private final Map<Object, StompSession> sessions = new HashMap<Object, StompSession>(); + private final Map<Object, StompSession> sessions = new HashMap<>(); - private final Set<String> destinations = new ConcurrentHashSet<String>(); + private final Set<String> destinations = new ConcurrentHashSet<>(); private final List<StompFrameInterceptor> incomingInterceptors; private final List<StompFrameInterceptor> outgoingInterceptors; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java index 2b1eaa6..85eebe0 100644 --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java @@ -57,10 +57,10 @@ public class StompSession implements SessionCallback { private final OperationContext sessionContext; - private final Map<Long, StompSubscription> subscriptions = new ConcurrentHashMap<Long, StompSubscription>(); + private final Map<Long, StompSubscription> subscriptions = new ConcurrentHashMap<>(); // key = message ID, value = consumer ID - private final Map<Long, Pair<Long, Integer>> messagesToAck = new ConcurrentHashMap<Long, Pair<Long, Integer>>(); + private final Map<Long, Pair<Long, Integer>> messagesToAck = new ConcurrentHashMap<>(); private volatile boolean noLocal = false; @@ -145,7 +145,7 @@ public class StompSession implements SessionCallback { } } else { - messagesToAck.put(newServerMessage.getMessageID(), new Pair<Long, Integer>(consumer.getID(), length)); + messagesToAck.put(newServerMessage.getMessageID(), new Pair<>(consumer.getID(), length)); // Must send AFTER adding to messagesToAck - or could get acked from client BEFORE it's been added! manager.send(connection, frame); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompUtils.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompUtils.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompUtils.java index d8468b1..00acb44 100644 --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompUtils.java +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompUtils.java @@ -37,7 +37,7 @@ public class StompUtils { // Static -------------------------------------------------------- public static void copyStandardHeadersFromFrameToMessage(StompFrame frame, ServerMessageImpl msg) throws Exception { - Map<String, String> headers = new HashMap<String, String>(frame.getHeadersMap()); + Map<String, String> headers = new HashMap<>(frame.getHeadersMap()); String priority = headers.remove(Stomp.Headers.Send.PRIORITY); if (priority != null) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameV11.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameV11.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameV11.java index e14d3a6..31c7132 100644 --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameV11.java +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameV11.java @@ -26,7 +26,7 @@ import org.apache.activemq.artemis.core.protocol.stomp.StompFrame; public class StompFrameV11 extends StompFrame { //stomp 1.1 talks about repetitive headers. - protected final List<Header> allHeaders = new ArrayList<Header>(); + protected final List<Header> allHeaders = new ArrayList<>(); public StompFrameV11(String command, Map<String, String> headers, byte[] content) { super(command, headers, content); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionMetaData.java ---------------------------------------------------------------------- diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionMetaData.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionMetaData.java index 9a22289..32b4d0d 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionMetaData.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionMetaData.java @@ -145,7 +145,7 @@ public class ActiveMQRAConnectionMetaData implements ConnectionMetaData { */ @Override public Enumeration<Object> getJMSXPropertyNames() { - Vector<Object> v = new Vector<Object>(); + Vector<Object> v = new Vector<>(); v.add("JMSXGroupID"); v.add("JMSXGroupSeq"); v.add("JMSXDeliveryCount"); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAManagedConnection.java ---------------------------------------------------------------------- diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAManagedConnection.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAManagedConnection.java index 800972c..3cd1515 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAManagedConnection.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAManagedConnection.java @@ -479,7 +479,7 @@ public final class ActiveMQRAManagedConnection implements ManagedConnection, Exc if (xaResource == null) { ClientSessionInternal csi = (ClientSessionInternal) xaSession.getXAResource(); ActiveMQRAXAResource activeMQRAXAResource = new ActiveMQRAXAResource(this, xaSession.getXAResource()); - Map<String, Object> xaResourceProperties = new HashMap<String, Object>(); + Map<String, Object> xaResourceProperties = new HashMap<>(); xaResourceProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_JNDI_NAME, ra.getJndiName()); xaResourceProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_NODE_ID, csi.getNodeId()); xaResourceProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_PRODUCT_NAME, ActiveMQResourceAdapter.PRODUCT_NAME); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAManagedConnectionFactory.java ---------------------------------------------------------------------- diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAManagedConnectionFactory.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAManagedConnectionFactory.java index e2e7fc0..73b443f 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAManagedConnectionFactory.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAManagedConnectionFactory.java @@ -164,7 +164,7 @@ public final class ActiveMQRAManagedConnectionFactory implements ManagedConnecti if (recoveryConnectionFactory == null) { recoveryConnectionFactory = ra.createRecoveryActiveMQConnectionFactory(mcfProperties); - Map<String, String> recoveryConfProps = new HashMap<String, String>(); + Map<String, String> recoveryConfProps = new HashMap<>(); recoveryConfProps.put(XARecoveryConfig.JNDI_NAME_PROPERTY_KEY, ra.getJndiName()); resourceRecovery = ra.getRecoveryManager().register(recoveryConnectionFactory, null, null, recoveryConfProps); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASession.java ---------------------------------------------------------------------- diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASession.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASession.java index 2ea9626..05006e4 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASession.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASession.java @@ -105,8 +105,8 @@ public final class ActiveMQRASession implements QueueSession, TopicSession, XAQu this.mc = mc; this.cri = cri; sf = null; - consumers = new HashSet<MessageConsumer>(); - producers = new HashSet<MessageProducer>(); + consumers = new HashSet<>(); + producers = new HashSet<>(); } /** http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASessionFactoryImpl.java ---------------------------------------------------------------------- diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASessionFactoryImpl.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASessionFactoryImpl.java index 655ad25..832871a 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASessionFactoryImpl.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASessionFactoryImpl.java @@ -108,17 +108,17 @@ public final class ActiveMQRASessionFactoryImpl extends ActiveMQConnectionForCon /** * The sessions */ - private final Set<ActiveMQRASession> sessions = new HashSet<ActiveMQRASession>(); + private final Set<ActiveMQRASession> sessions = new HashSet<>(); /** * The temporary queues */ - private final Set<TemporaryQueue> tempQueues = new HashSet<TemporaryQueue>(); + private final Set<TemporaryQueue> tempQueues = new HashSet<>(); /** * The temporary topics */ - private final Set<TemporaryTopic> tempTopics = new HashSet<TemporaryTopic>(); + private final Set<TemporaryTopic> tempTopics = new HashSet<>(); /** * Constructor http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRaUtils.java ---------------------------------------------------------------------- diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRaUtils.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRaUtils.java index cd43897..6103bc8 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRaUtils.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRaUtils.java @@ -170,7 +170,7 @@ public final class ActiveMQRaUtils { * @return hash-table with configuration option pairs */ public static Hashtable<String, String> parseHashtableConfig(final String config) { - Hashtable<String, String> hashtable = new Hashtable<String, String>(); + Hashtable<String, String> hashtable = new Hashtable<>(); String[] topElements = config.split(";"); @@ -188,12 +188,12 @@ public final class ActiveMQRaUtils { } public static List<Map<String, Object>> parseConfig(final String config) { - List<Map<String, Object>> result = new ArrayList<Map<String, Object>>(); + List<Map<String, Object>> result = new ArrayList<>(); String[] topElements = config.split(","); for (String topElement : topElements) { - HashMap<String, Object> map = new HashMap<String, Object>(); + HashMap<String, Object> map = new HashMap<>(); result.add(map); String[] elements = topElement.split(";"); @@ -213,7 +213,7 @@ public final class ActiveMQRaUtils { } public static List<String> parseConnectorConnectorConfig(String config) { - List<String> res = new ArrayList<String>(); + List<String> res = new ArrayList<>(); String[] elements = config.split(","); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQResourceAdapter.java ---------------------------------------------------------------------- diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQResourceAdapter.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQResourceAdapter.java index f1d6d03..f9781c1 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQResourceAdapter.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQResourceAdapter.java @@ -120,7 +120,7 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { private boolean useAutoRecovery = true; - private final List<ActiveMQRAManagedConnectionFactory> managedConnectionFactories = new ArrayList<ActiveMQRAManagedConnectionFactory>(); + private final List<ActiveMQRAManagedConnectionFactory> managedConnectionFactories = new ArrayList<>(); private String entries; @@ -129,7 +129,7 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * configured the exact same way. Using the same connection factory instance also makes connection load-balancing * behave as expected for outbound connections. */ - private final Map<ConnectionFactoryProperties, Pair<ActiveMQConnectionFactory, AtomicInteger>> knownConnectionFactories = new HashMap<ConnectionFactoryProperties, Pair<ActiveMQConnectionFactory, AtomicInteger>>(); + private final Map<ConnectionFactoryProperties, Pair<ActiveMQConnectionFactory, AtomicInteger>> knownConnectionFactories = new HashMap<>(); /** * Constructor @@ -141,7 +141,7 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { raProperties = new ActiveMQRAProperties(); configured = new AtomicBoolean(false); - activations = new ConcurrentHashMap<ActivationSpec, ActiveMQActivation>(); + activations = new ConcurrentHashMap<>(); recoveryManager = new RecoveryManager(); } @@ -215,7 +215,7 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { return null; } else { - List<XAResource> xaresources = new ArrayList<XAResource>(); + List<XAResource> xaresources = new ArrayList<>(); for (ActivationSpec spec : specs) { ActiveMQActivation activation = activations.get(spec); if (activation != null) { @@ -1573,7 +1573,7 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { defaultActiveMQConnectionFactory = createActiveMQConnectionFactory(raProperties); recoveryActiveMQConnectionFactory = createRecoveryActiveMQConnectionFactory(raProperties); - Map<String, String> recoveryConfProps = new HashMap<String, String>(); + Map<String, String> recoveryConfProps = new HashMap<>(); recoveryConfProps.put(XARecoveryConfig.JNDI_NAME_PROPERTY_KEY, getJndiName()); recoveryManager.register(recoveryActiveMQConnectionFactory, raProperties.getUserName(), raProperties.getPassword(), recoveryConfProps); } @@ -1842,7 +1842,7 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { public Map<String, Object> overrideConnectionParameters(final Map<String, Object> connectionParams, final Map<String, Object> overrideConnectionParams) { - Map<String, Object> map = new HashMap<String, Object>(); + Map<String, Object> map = new HashMap<>(); if (connectionParams != null) { map.putAll(connectionParams); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java ---------------------------------------------------------------------- diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java index af5fec2..79b9cb9 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java @@ -111,13 +111,13 @@ public class ActiveMQActivation { */ private SimpleString topicTemporaryQueue; - private final List<ActiveMQMessageHandler> handlers = new ArrayList<ActiveMQMessageHandler>(); + private final List<ActiveMQMessageHandler> handlers = new ArrayList<>(); private ActiveMQConnectionFactory factory; private List<String> nodes = Collections.synchronizedList(new ArrayList<String>()); - private Map<String, Long> removedNodes = new ConcurrentHashMap<String, Long>(); + private Map<String, Long> removedNodes = new ConcurrentHashMap<>(); private boolean lastReceived = false; @@ -272,7 +272,7 @@ public class ActiveMQActivation { * @return the list of XAResources for this activation endpoint */ public List<XAResource> getXAResources() { - List<XAResource> xaresources = new ArrayList<XAResource>(); + List<XAResource> xaresources = new ArrayList<>(); for (ActiveMQMessageHandler handler : handlers) { XAResource xares = handler.getXAResource(); if (xares != null) { @@ -345,7 +345,7 @@ public class ActiveMQActivation { handler.start(); } - Map<String, String> recoveryConfProps = new HashMap<String, String>(); + Map<String, String> recoveryConfProps = new HashMap<>(); recoveryConfProps.put(XARecoveryConfig.JNDI_NAME_PROPERTY_KEY, ra.getJndiName()); resourceRecovery = ra.getRecoveryManager().register(factory, spec.getUser(), spec.getPassword(), recoveryConfProps); if (spec.isRebalanceConnections()) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java ---------------------------------------------------------------------- diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java index feb195f..c1ca63d 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java @@ -691,8 +691,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen ActiveMQRALogger.LOGGER.trace("validate()"); } - List<String> errorMessages = new ArrayList<String>(); - List<PropertyDescriptor> propsNotSet = new ArrayList<PropertyDescriptor>(); + List<String> errorMessages = new ArrayList<>(); + List<PropertyDescriptor> propsNotSet = new ArrayList<>(); try { if (destination == null || destination.trim().equals("")) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java ---------------------------------------------------------------------- diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java index 8353634..a180fc7 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java @@ -177,7 +177,7 @@ public class ActiveMQMessageHandler implements MessageHandler, FailoverEventList useLocalTx = !activation.isDeliveryTransacted() && activation.getActivationSpec().isUseLocalTx(); transacted = activation.isDeliveryTransacted(); if (activation.isDeliveryTransacted() && !activation.getActivationSpec().isUseLocalTx()) { - Map<String, Object> xaResourceProperties = new HashMap<String, Object>(); + Map<String, Object> xaResourceProperties = new HashMap<>(); xaResourceProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_JNDI_NAME, ((ActiveMQResourceAdapter) spec.getResourceAdapter()).getJndiName()); xaResourceProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_NODE_ID, ((ClientSessionFactoryInternal) cf).getLiveNodeId()); xaResourceProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_PRODUCT_NAME, ActiveMQResourceAdapter.PRODUCT_NAME); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/recovery/RecoveryManager.java ---------------------------------------------------------------------- diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/recovery/RecoveryManager.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/recovery/RecoveryManager.java index 13023c8..2eb42ba 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/recovery/RecoveryManager.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/recovery/RecoveryManager.java @@ -33,7 +33,7 @@ public final class RecoveryManager { private static final String RESOURCE_RECOVERY_CLASS_NAMES = "org.jboss.as.messaging.jms.AS7RecoveryRegistry;" + "org.jboss.as.integration.activemq.recovery.AS5RecoveryRegistry"; - private final Set<XARecoveryConfig> resources = new ConcurrentHashSet<XARecoveryConfig>(); + private final Set<XARecoveryConfig> resources = new ConcurrentHashSet<>(); public void start(final boolean useAutoRecovery) { if (useAutoRecovery) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/MessageServiceManager.java ---------------------------------------------------------------------- diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/MessageServiceManager.java b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/MessageServiceManager.java index 1bef82c..014853d 100644 --- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/MessageServiceManager.java +++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/MessageServiceManager.java @@ -136,7 +136,7 @@ public class MessageServiceManager { defaultSettings.setDuplicatesAllowed(configuration.isDupsOk()); defaultSettings.setDurableSend(configuration.isDefaultDurableSend()); - HashMap<String, Object> transportConfig = new HashMap<String, Object>(); + HashMap<String, Object> transportConfig = new HashMap<>(); transportConfig.put(TransportConstants.SERVER_ID_PROP_NAME, configuration.getInVmId()); ServerLocator consumerLocator = new ServerLocatorImpl(false, new TransportConfiguration(InVMConnectorFactory.class.getName(), transportConfig)); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/ConsumersResource.java ---------------------------------------------------------------------- diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/ConsumersResource.java b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/ConsumersResource.java index 278461c..84dae83 100644 --- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/ConsumersResource.java +++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/ConsumersResource.java @@ -40,7 +40,7 @@ import org.apache.activemq.artemis.rest.util.TimeoutTask; public class ConsumersResource implements TimeoutTask.Callback { - protected ConcurrentMap<String, QueueConsumer> queueConsumers = new ConcurrentHashMap<String, QueueConsumer>(); + protected ConcurrentMap<String, QueueConsumer> queueConsumers = new ConcurrentHashMap<>(); protected ClientSessionFactory sessionFactory; protected String destination; protected final String startup = Long.toString(System.currentTimeMillis()); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/PostMessage.java ---------------------------------------------------------------------- diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/PostMessage.java b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/PostMessage.java index c99cdf1..6931695 100644 --- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/PostMessage.java +++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/PostMessage.java @@ -206,7 +206,7 @@ public class PostMessage { } public void init() throws Exception { - pool = new ArrayBlockingQueue<Pooled>(poolSize); + pool = new ArrayBlockingQueue<>(poolSize); for (int i = 0; i < poolSize; i++) { addPooled(); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/QueueDestinationsResource.java ---------------------------------------------------------------------- diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/QueueDestinationsResource.java b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/QueueDestinationsResource.java index 3f17af0..7f7ce09 100644 --- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/QueueDestinationsResource.java +++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/QueueDestinationsResource.java @@ -45,7 +45,7 @@ import org.w3c.dom.Document; @Path(Constants.PATH_FOR_QUEUES) public class QueueDestinationsResource { - private Map<String, QueueResource> queues = new ConcurrentHashMap<String, QueueResource>(); + private Map<String, QueueResource> queues = new ConcurrentHashMap<>(); private QueueServiceManager manager; public QueueDestinationsResource(QueueServiceManager manager) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/QueueServiceManager.java ---------------------------------------------------------------------- diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/QueueServiceManager.java b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/QueueServiceManager.java index 1e643af..159cca4 100644 --- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/QueueServiceManager.java +++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/QueueServiceManager.java @@ -27,7 +27,7 @@ import org.apache.activemq.artemis.rest.queue.push.FilePushStore; public class QueueServiceManager extends DestinationServiceManager { protected PushStore pushStore; - protected List<QueueDeployment> queues = new ArrayList<QueueDeployment>(); + protected List<QueueDeployment> queues = new ArrayList<>(); protected QueueDestinationsResource destination; public List<QueueDeployment> getQueues() { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/FilePushStore.java ---------------------------------------------------------------------- diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/FilePushStore.java b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/FilePushStore.java index 70e0d64..54d2b50 100644 --- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/FilePushStore.java +++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/FilePushStore.java @@ -31,7 +31,7 @@ import org.apache.activemq.artemis.rest.topic.PushTopicRegistration; public class FilePushStore implements PushStore { - protected Map<String, PushRegistration> map = new HashMap<String, PushRegistration>(); + protected Map<String, PushRegistration> map = new HashMap<>(); protected File dir; protected JAXBContext ctx; @@ -58,13 +58,13 @@ public class FilePushStore implements PushStore { } public synchronized List<PushRegistration> getRegistrations() { - List<PushRegistration> list = new ArrayList<PushRegistration>(map.values()); + List<PushRegistration> list = new ArrayList<>(map.values()); return list; } @Override public synchronized List<PushRegistration> getByDestination(String destination) { - List<PushRegistration> list = new ArrayList<PushRegistration>(); + List<PushRegistration> list = new ArrayList<>(); for (PushRegistration reg : map.values()) { if (reg.getDestination().equals(destination)) { list.add(reg); @@ -108,7 +108,7 @@ public class FilePushStore implements PushStore { @Override public synchronized void removeAll() throws Exception { - ArrayList<PushRegistration> copy = new ArrayList<PushRegistration>(map.values()); + ArrayList<PushRegistration> copy = new ArrayList<>(map.values()); for (PushRegistration reg : copy) remove(reg); this.dir.delete(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/PushConsumer.java ---------------------------------------------------------------------- diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/PushConsumer.java b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/PushConsumer.java index 906ff78..ef47f0a 100644 --- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/PushConsumer.java +++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/PushConsumer.java @@ -81,8 +81,8 @@ public class PushConsumer { strategy.setRegistration(registration); strategy.start(); - sessions = new ArrayList<ClientSession>(); - consumers = new ArrayList<ClientConsumer>(); + sessions = new ArrayList<>(); + consumers = new ArrayList<>(); for (int i = 0; i < registration.getSessionCount(); i++) { ClientSession session = factory.createSession(false, false, 0); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/PushConsumerResource.java ---------------------------------------------------------------------- diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/PushConsumerResource.java b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/PushConsumerResource.java index d1a3f16..76dcf5e 100644 --- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/PushConsumerResource.java +++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/PushConsumerResource.java @@ -38,7 +38,7 @@ import org.apache.activemq.artemis.rest.ActiveMQRestLogger; public class PushConsumerResource { - protected Map<String, PushConsumer> consumers = new ConcurrentHashMap<String, PushConsumer>(); + protected Map<String, PushConsumer> consumers = new ConcurrentHashMap<>(); protected ClientSessionFactory sessionFactory; protected String destination; protected final String startup = Long.toString(System.currentTimeMillis()); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/xml/PushRegistration.java ---------------------------------------------------------------------- diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/xml/PushRegistration.java b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/xml/PushRegistration.java index af3a129..b934f7b 100644 --- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/xml/PushRegistration.java +++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/xml/PushRegistration.java @@ -38,7 +38,7 @@ public class PushRegistration implements Serializable { private boolean durable; private XmlLink target; private Authentication authenticationMechanism; - private List<XmlHttpHeader> headers = new ArrayList<XmlHttpHeader>(); + private List<XmlHttpHeader> headers = new ArrayList<>(); private String destination; private Object loadedFrom; private String selector; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/FileTopicPushStore.java ---------------------------------------------------------------------- diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/FileTopicPushStore.java b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/FileTopicPushStore.java index 417b65d..57cadd9 100644 --- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/FileTopicPushStore.java +++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/FileTopicPushStore.java @@ -30,7 +30,7 @@ public class FileTopicPushStore extends FilePushStore implements TopicPushStore @Override public synchronized List<PushTopicRegistration> getByTopic(String topic) { - List<PushTopicRegistration> list = new ArrayList<PushTopicRegistration>(); + List<PushTopicRegistration> list = new ArrayList<>(); for (PushRegistration reg : map.values()) { PushTopicRegistration topicReg = (PushTopicRegistration) reg; if (topicReg.getTopic().equals(topic)) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/PushSubscriptionsResource.java ---------------------------------------------------------------------- diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/PushSubscriptionsResource.java b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/PushSubscriptionsResource.java index de4a16a..c01459b 100644 --- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/PushSubscriptionsResource.java +++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/PushSubscriptionsResource.java @@ -40,7 +40,7 @@ import java.util.concurrent.atomic.AtomicLong; public class PushSubscriptionsResource { - protected Map<String, PushSubscription> consumers = new ConcurrentHashMap<String, PushSubscription>(); + protected Map<String, PushSubscription> consumers = new ConcurrentHashMap<>(); protected ClientSessionFactory sessionFactory; protected String destination; protected final String startup = Long.toString(System.currentTimeMillis()); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/SubscriptionsResource.java ---------------------------------------------------------------------- diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/SubscriptionsResource.java b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/SubscriptionsResource.java index 140599d..2fcbdd5 100644 --- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/SubscriptionsResource.java +++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/SubscriptionsResource.java @@ -46,7 +46,7 @@ import org.apache.activemq.artemis.rest.util.TimeoutTask; public class SubscriptionsResource implements TimeoutTask.Callback { - protected ConcurrentMap<String, QueueConsumer> queueConsumers = new ConcurrentHashMap<String, QueueConsumer>(); + protected ConcurrentMap<String, QueueConsumer> queueConsumers = new ConcurrentHashMap<>(); protected ClientSessionFactory sessionFactory; protected String destination; protected final String startup = Long.toString(System.currentTimeMillis()); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/TopicDestinationsResource.java ---------------------------------------------------------------------- diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/TopicDestinationsResource.java b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/TopicDestinationsResource.java index e084b03..8c72e49 100644 --- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/TopicDestinationsResource.java +++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/TopicDestinationsResource.java @@ -46,7 +46,7 @@ import org.w3c.dom.Document; @Path("/topics") public class TopicDestinationsResource { - private Map<String, TopicResource> topics = new ConcurrentHashMap<String, TopicResource>(); + private Map<String, TopicResource> topics = new ConcurrentHashMap<>(); private TopicServiceManager manager; public TopicDestinationsResource(TopicServiceManager manager) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/TopicServiceManager.java ---------------------------------------------------------------------- diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/TopicServiceManager.java b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/TopicServiceManager.java index b782d5c..cd2020f 100644 --- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/TopicServiceManager.java +++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/topic/TopicServiceManager.java @@ -26,7 +26,7 @@ import java.util.List; public class TopicServiceManager extends DestinationServiceManager { protected TopicPushStore pushStore; - protected List<TopicDeployment> topics = new ArrayList<TopicDeployment>(); + protected List<TopicDeployment> topics = new ArrayList<>(); protected TopicDestinationsResource destination; public TopicPushStore getPushStore() { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/util/TimeoutTask.java ---------------------------------------------------------------------- diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/util/TimeoutTask.java b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/util/TimeoutTask.java index ae5f5de..ba87669 100644 --- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/util/TimeoutTask.java +++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/util/TimeoutTask.java @@ -30,9 +30,9 @@ public class TimeoutTask implements Runnable { protected boolean running = true; protected int interval = 10; protected final Lock callbacksLock = new ReentrantLock(); - protected Map<String, Callback> callbacks = new HashMap<String, Callback>(); + protected Map<String, Callback> callbacks = new HashMap<>(); protected final Lock pendingCallbacksLock = new ReentrantLock(); - protected Map<String, Callback> pendingCallbacks = new HashMap<String, Callback>(); + protected Map<String, Callback> pendingCallbacks = new HashMap<>(); protected Thread thread; public TimeoutTask(int interval) { @@ -107,7 +107,7 @@ public class TimeoutTask implements Runnable { // First, test all known callbacks for timeouts. // If the timeout is true, then move it to a separate map. - Map<String, Callback> expiredCallbacks = new HashMap<String, Callback>(); + Map<String, Callback> expiredCallbacks = new HashMap<>(); int liveConsumers = 0; int deadConsumers = 0; @@ -115,7 +115,7 @@ public class TimeoutTask implements Runnable { callbacksLock.lock(); try { long startTime = System.currentTimeMillis(); - List<String> tokens = new ArrayList<String>(callbacks.size()); + List<String> tokens = new ArrayList<>(callbacks.size()); for (String token : callbacks.keySet()) { tokens.add(token); } @@ -154,7 +154,7 @@ public class TimeoutTask implements Runnable { // Finally, freely shutdown all expired consumers. if (expiredCallbacks.size() > 0) { long startTime = System.currentTimeMillis(); - List<String> tokens = new ArrayList<String>(expiredCallbacks.size()); + List<String> tokens = new ArrayList<>(expiredCallbacks.size()); for (String token : expiredCallbacks.keySet()) { tokens.add(token); }