http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/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 61d6800..6dd2a7f 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 @@ -237,8 +237,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal if (compactPercentage == 0) { this.compactPercentage = 0; - } - else { + } else { this.compactPercentage = compactPercentage / 100f; } @@ -350,12 +349,10 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal JournalFileImpl jrnFile = readFileHeader(file); orderedFiles.add(jrnFile); - } - finally { + } finally { file.close(); } - } - else { + } else { ActiveMQJournalLogger.LOGGER.ignoringShortFile(fileName); file.delete(); } @@ -537,17 +534,17 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal // Avoid a buffer overflow caused by damaged data... continue // scanning for more pendingTransactions... logger.trace("Record at position " + pos + - " recordType = " + - recordType + - " file:" + - file.getFile().getFileName() + - " recordSize: " + - recordSize + - " variableSize: " + - variableSize + - " preparedTransactionExtraDataSize: " + - preparedTransactionExtraDataSize + - " is corrupted and it is being ignored (II)"); + " recordType = " + + recordType + + " file:" + + file.getFile().getFileName() + + " recordSize: " + + recordSize + + " variableSize: " + + variableSize + + " preparedTransactionExtraDataSize: " + + preparedTransactionExtraDataSize + + " is corrupted and it is being ignored (II)"); // If a file has damaged pendingTransactions, we make it a dataFile, and the // next reclaiming will fix it reader.markAsDataFile(file); @@ -570,15 +567,15 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal // checkSize by some sort of calculated hash) if (checkSize != variableSize + recordSize + preparedTransactionExtraDataSize) { logger.trace("Record at position " + pos + - " recordType = " + - recordType + - " possible transactionID = " + - transactionID + - " possible recordID = " + - recordID + - " file:" + - file.getFile().getFileName() + - " is corrupted and it is being ignored (III)"); + " recordType = " + + recordType + + " possible transactionID = " + + transactionID + + " possible recordID = " + + recordID + + " file:" + + file.getFile().getFileName() + + " is corrupted and it is being ignored (III)"); // If a file has damaged pendingTransactions, we make it a dataFile, and the // next reclaiming will fix it @@ -667,20 +664,17 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal } return lastDataPos; - } - catch (Throwable e) { + } catch (Throwable e) { ActiveMQJournalLogger.LOGGER.errorReadingFile(e); throw new Exception(e.getMessage(), e); - } - finally { + } finally { if (wholeFileBuffer != null) { fileFactory.releaseBuffer(wholeFileBuffer); } try { file.getFile().close(); - } - catch (Throwable ignored) { + } catch (Throwable ignored) { } } } @@ -710,17 +704,16 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal if (logger.isTraceEnabled()) { logger.trace("appendAddRecord::id=" + id + - ", userRecordType=" + - recordType + - ", record = " + record + - ", usedFile = " + - usedFile); + ", userRecordType=" + + recordType + + ", record = " + record + + ", usedFile = " + + usedFile); } records.put(id, new JournalRecord(usedFile, addRecord.getEncodeSize())); } - } - finally { + } finally { journalLock.readLock().unlock(); } } @@ -755,24 +748,22 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal if (logger.isTraceEnabled()) { logger.trace("appendUpdateRecord::id=" + id + - ", userRecordType=" + - recordType + - ", record = " + record + - ", usedFile = " + - usedFile); + ", userRecordType=" + + recordType + + ", record = " + record + + ", usedFile = " + + usedFile); } // record== null here could only mean there is a compactor, and computing the delete should be done after // compacting is done if (jrnRecord == null) { compactor.addCommandUpdate(id, usedFile, updateRecord.getEncodeSize()); - } - else { + } else { jrnRecord.addUpdateFile(usedFile, updateRecord.getEncodeSize()); } } - } - finally { + } finally { journalLock.readLock().unlock(); } } @@ -792,8 +783,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal if (record == null) { throw new IllegalStateException("Cannot find add info " + id); } - } - else { + } else { if (!records.containsKey(id) && !compactor.lookupRecord(id)) { throw new IllegalStateException("Cannot find add info " + id + " on compactor or current records"); } @@ -816,14 +806,12 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal // compacting is done if (record == null) { compactor.addCommandDelete(id, usedFile); - } - else { + } else { record.delete(usedFile); } } - } - finally { + } finally { journalLock.readLock().unlock(); } } @@ -847,19 +835,18 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal if (logger.isTraceEnabled()) { logger.trace("appendAddRecordTransactional:txID=" + txID + - ",id=" + - id + - ", userRecordType=" + - recordType + - ", record = " + record + - ", usedFile = " + - usedFile); + ",id=" + + id + + ", userRecordType=" + + recordType + + ", record = " + record + + ", usedFile = " + + usedFile); } tx.addPositive(usedFile, id, addRecord.getEncodeSize()); } - } - finally { + } finally { journalLock.readLock().unlock(); } } @@ -893,19 +880,18 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal if (logger.isTraceEnabled()) { logger.trace("appendUpdateRecordTransactional::txID=" + txID + - ",id=" + - id + - ", userRecordType=" + - recordType + - ", record = " + record + - ", usedFile = " + - usedFile); + ",id=" + + id + + ", userRecordType=" + + recordType + + ", record = " + record + + ", usedFile = " + + usedFile); } tx.addPositive(usedFile, id, updateRecordTX.getEncodeSize()); } - } - finally { + } finally { journalLock.readLock().unlock(); } } @@ -928,16 +914,15 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal if (logger.isTraceEnabled()) { logger.trace("appendDeleteRecordTransactional::txID=" + txID + - ", id=" + - id + - ", usedFile = " + - usedFile); + ", id=" + + id + + ", usedFile = " + + usedFile); } tx.addNegative(usedFile, id); } - } - finally { + } finally { journalLock.readLock().unlock(); } } @@ -983,8 +968,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal tx.prepare(usedFile); } - } - finally { + } finally { journalLock.readLock().unlock(); } } @@ -1029,8 +1013,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal tx.commit(usedFile); } - } - finally { + } finally { journalLock.readLock().unlock(); } } @@ -1062,8 +1045,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal tx.rollback(usedFile); } - } - finally { + } finally { journalLock.readLock().unlock(); } } @@ -1215,13 +1197,11 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal try { JournalImpl.this.compact(); - } - catch (Throwable e) { + } catch (Throwable e) { errors.incrementAndGet(); ActiveMQJournalLogger.LOGGER.errorCompacting(e); e.printStackTrace(); - } - finally { + } finally { latch.countDown(); } } @@ -1234,8 +1214,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal if (errors.get() > 0) { throw new RuntimeException("Error during compact, look at the logs"); } - } - finally { + } finally { compactorRunning.set(false); } } @@ -1305,8 +1284,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal // We will calculate the new records during compacting, what will take the position the records will take // after compacting records.clear(); - } - finally { + } finally { journalLock.writeLock().unlock(); } @@ -1320,8 +1298,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal for (final JournalFile file : dataFilesToProcess) { try { JournalImpl.readJournalFile(fileFactory, file, compactor); - } - catch (Throwable e) { + } catch (Throwable e) { ActiveMQJournalLogger.LOGGER.compactReadError(file); throw new Exception("Error on reading compacting for " + file, e); } @@ -1386,13 +1363,11 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal JournalTransaction liveTransaction = transactions.get(newTransaction.getId()); if (liveTransaction != null) { liveTransaction.merge(newTransaction); - } - else { + } else { ActiveMQJournalLogger.LOGGER.compactMergeError(newTransaction.getId()); } } - } - finally { + } finally { journalLock.writeLock().unlock(); } @@ -1402,22 +1377,19 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal ActiveMQJournalLogger.LOGGER.debug("Finished compacting on journal"); - } - finally { + } finally { // An Exception was probably thrown, and the compactor was not cleared if (compactor != null) { try { compactor.flush(); - } - catch (Throwable ignored) { + } catch (Throwable ignored) { } compactor = null; } setAutoReclaim(previousReclaimValue); } - } - finally { + } finally { compactorLock.writeLock().unlock(); } @@ -1650,8 +1622,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal if (healthy) { journalTransaction.prepare(file); - } - else { + } else { ActiveMQJournalLogger.LOGGER.preparedTXIncomplete(transactionID); tx.invalid = true; } @@ -1681,8 +1652,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal for (RecordInfo txRecord : tx.recordInfos) { if (txRecord.isUpdate) { loadManager.updateRecord(txRecord); - } - else { + } else { loadManager.addRecord(txRecord); } } @@ -1692,8 +1662,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal } journalTransaction.commit(file); - } - else { + } else { ActiveMQJournalLogger.LOGGER.txMissingElements(transactionID); journalTransaction.forget(); @@ -1737,8 +1706,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal if (hasData.get()) { lastDataPos = resultLastPost; filesRepository.addDataFileOnBottom(file); - } - else { + } else { if (changeData) { // Empty dataFiles with no data filesRepository.addFreeFile(file, false, false); @@ -1766,8 +1734,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal } loadManager.failedTransaction(transaction.transactionID, transaction.recordInfos, transaction.recordsToDelete); - } - else { + } else { for (RecordInfo info : transaction.recordInfos) { if (info.id > maxID.get()) { maxID.set(info.id); @@ -1823,8 +1790,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal filesRepository.addFreeFile(file, false); } } - } - finally { + } finally { journalLock.readLock().unlock(); } @@ -1878,11 +1844,9 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal try { JournalImpl.this.compact(); - } - catch (Throwable e) { + } catch (Throwable e) { ActiveMQJournalLogger.LOGGER.errorCompacting(e); - } - finally { + } finally { compactorRunning.set(false); } } @@ -1934,8 +1898,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal if (currentFile instanceof JournalFileImpl) { builder.append(((JournalFileImpl) currentFile).debug()); } - } - else { + } else { builder.append("CurrentFile: No current file at this point!"); } @@ -2035,8 +1998,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal moveNextFile(false); debugWait(); } - } - finally { + } finally { journalLock.readLock().unlock(); } } @@ -2113,8 +2075,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal for (CountDownLatch latch : latches) { latch.countDown(); } - } - catch (Throwable e) { + } catch (Throwable e) { ActiveMQJournalLogger.LOGGER.warn(e.getMessage(), e); } @@ -2130,8 +2091,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal currentFile = null; } - } - finally { + } finally { journalLock.writeLock().unlock(); } } @@ -2147,8 +2107,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal ArrayList<Pair<String, String>> cleanupList; if (cleanupRename == null) { cleanupList = null; - } - else { + } else { cleanupList = new ArrayList<>(); cleanupList.add(cleanupRename); } @@ -2178,13 +2137,11 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal for (JournalFile file : oldFiles) { try { filesRepository.addFreeFile(file, false); - } - catch (Throwable e) { + } catch (Throwable e) { ActiveMQJournalLogger.LOGGER.errorReinitializingFile(e, file); } } - } - finally { + } finally { done.countDown(); } } @@ -2308,8 +2265,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal } if (journalVersion >= 2) { return recordSize + 1; - } - else { + } else { return recordSize; } } @@ -2380,8 +2336,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal sequentialFile.writeDirect(bb, true); return bufferSize; - } - finally { + } finally { // release it by first unwrap the unreleasable buffer and then release it. buffer.byteBuf().unwrap().release(); } @@ -2429,8 +2384,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal txcallback.setDelegateCompletion(parameterCallback); } callback = txcallback; - } - else { + } else { callback = null; } @@ -2439,8 +2393,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal // Filling the number of pendingTransactions at the current file tx.fillNumberOfRecords(currentFile, encoder); } - } - else { + } else { callback = parameterCallback; } @@ -2449,8 +2402,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal if (callback != null) { currentFile.getFile().write(encoder, sync, callback); - } - else { + } else { currentFile.getFile().write(encoder, sync); } @@ -2471,8 +2423,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal if (!checkReclaimStatus()) { checkCompact(); } - } - catch (Exception e) { + } catch (Exception e) { ActiveMQJournalLogger.LOGGER.errorSchedulingCompacting(e); } } @@ -2563,8 +2514,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal private static boolean isInvalidSize(final int fileSize, final int bufferPos, final int size) { if (size < 0) { return true; - } - else { + } else { final int position = bufferPos + size; return position > fileSize || position < 0; @@ -2642,8 +2592,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal for (int i = 0; i < pages; i++) { appendRecord(blastRecord, false, false, null, null); } - } - catch (Exception e) { + } catch (Exception e) { ActiveMQJournalLogger.LOGGER.failedToPerfBlast(e); } } @@ -2660,8 +2609,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal public final void synchronizationUnlock() { try { compactorLock.writeLock().unlock(); - } - finally { + } finally { journalLock.writeLock().unlock(); } } @@ -2687,8 +2635,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal } filesRepository.setNextFileID(maxID); return map; - } - finally { + } finally { synchronizationUnlock(); } } @@ -2715,8 +2662,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal if (!currentFile.getFile().isOpen()) currentFile.getFile().open(); currentFile.getFile().position(currentFile.getFile().calculateBlockStart(lastDataPos)); - } - else { + } else { currentFile = filesRepository.getFreeFile(); filesRepository.openFile(currentFile, true); } @@ -2763,8 +2709,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal try { if (timeout < 0) { latch.await(); - } - else { + } else { latch.await(timeout, TimeUnit.SECONDS); } @@ -2772,8 +2717,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal if (state == JournalState.STOPPED) { throw new RuntimeException("Server is not started"); } - } - finally { + } finally { latches.remove(latch); } } @@ -2811,8 +2755,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal public void testCompact() { try { scheduleCompactAndBlock(60); - } - catch (Exception e) { + } catch (Exception e) { throw new RuntimeException(e); } }
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/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 a01efed..6e41c17 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 @@ -78,8 +78,7 @@ public class JournalTransaction { public long[] getPositiveArray() { if (pos == null) { return new long[0]; - } - else { + } else { int i = 0; long[] ids = new long[pos.size()]; for (JournalUpdate el : pos) { @@ -220,8 +219,7 @@ public class JournalTransaction { if (compacting) { compactor.addCommandCommit(this, file); - } - else { + } else { if (pos != null) { for (JournalUpdate trUpdate : pos) { @@ -232,13 +230,11 @@ public class JournalTransaction { // but the commit arrived while compacting was working // We need to cache the counter update, so compacting will take the correct files when it is done compactor.addCommandUpdate(trUpdate.id, trUpdate.file, trUpdate.size); - } - else if (posFiles == null) { + } else if (posFiles == null) { posFiles = new JournalRecord(trUpdate.file, trUpdate.size); journal.getRecords().put(trUpdate.id, posFiles); - } - else { + } else { posFiles.addUpdateFile(trUpdate.file, trUpdate.size); } } @@ -248,8 +244,7 @@ public class JournalTransaction { for (JournalUpdate trDelete : neg) { if (compactor != null) { compactor.addCommandDelete(trDelete.id, trDelete.file); - } - else { + } else { JournalRecord posFiles = journal.getRecords().remove(trDelete.id); if (posFiles != null) { @@ -294,8 +289,7 @@ public class JournalTransaction { if (compacting && compactor != null) { compactor.addCommandRollback(this, file); - } - else { + } else { // Now add negs for the pos we added in each file in which there were // transactional operations // Note that we do this on rollback as we do on commit, since we need http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/Reclaimer.java ---------------------------------------------------------------------- diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/Reclaimer.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/Reclaimer.java index accbe80..3760723 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/Reclaimer.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/Reclaimer.java @@ -58,8 +58,7 @@ public class Reclaimer { if (outstandingNeg) { continue; // Move to next file as we already know that this file can't be reclaimed because criterion 2) - } - else { + } else { currentFile.setNegReclaimCriteria(); } } @@ -78,10 +77,9 @@ public class Reclaimer { } } - if (negCount < posCount ) { + if (negCount < posCount) { logger.tracef("%s can't be reclaimed because there are not enough negatives %d", currentFile, negCount); - } - else { + } else { logger.tracef("%s can be reclaimed", currentFile); currentFile.setPosReclaimCriteria(); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalAddRecord.java ---------------------------------------------------------------------- diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalAddRecord.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalAddRecord.java index aa0e961..c6a5d4a 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalAddRecord.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalAddRecord.java @@ -49,8 +49,7 @@ public class JournalAddRecord extends JournalInternalRecord { public void encode(final ActiveMQBuffer buffer) { if (add) { buffer.writeByte(JournalImpl.ADD_RECORD); - } - else { + } else { buffer.writeByte(JournalImpl.UPDATE_RECORD); } @@ -73,4 +72,4 @@ public class JournalAddRecord extends JournalInternalRecord { public int getEncodeSize() { return JournalImpl.SIZE_ADD_RECORD + record.getEncodeSize() + 1; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalAddRecordTX.java ---------------------------------------------------------------------- diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalAddRecordTX.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalAddRecordTX.java index 2af8797..6cec122 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalAddRecordTX.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalAddRecordTX.java @@ -58,8 +58,7 @@ public class JournalAddRecordTX extends JournalInternalRecord { public void encode(final ActiveMQBuffer buffer) { if (add) { buffer.writeByte(JournalImpl.ADD_RECORD_TX); - } - else { + } else { buffer.writeByte(JournalImpl.UPDATE_RECORD_TX); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalCompleteRecordTX.java ---------------------------------------------------------------------- diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalCompleteRecordTX.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalCompleteRecordTX.java index b0c2c49..ff106d4 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalCompleteRecordTX.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalCompleteRecordTX.java @@ -62,8 +62,7 @@ public class JournalCompleteRecordTX extends JournalInternalRecord { public void encode(final ActiveMQBuffer buffer) { if (txRecordType == TX_RECORD_TYPE.COMMIT) { buffer.writeByte(JournalImpl.COMMIT_RECORD); - } - else { + } else { buffer.writeByte(JournalImpl.PREPARE_RECORD); } @@ -100,8 +99,7 @@ public class JournalCompleteRecordTX extends JournalInternalRecord { public int getEncodeSize() { if (txRecordType == TX_RECORD_TYPE.COMMIT) { return JournalImpl.SIZE_COMPLETE_TRANSACTION_RECORD + 1; - } - else { + } else { return JournalImpl.SIZE_PREPARE_RECORD + (transactionData != null ? transactionData.getEncodeSize() : 0) + 1; } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalInternalRecord.java ---------------------------------------------------------------------- diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalInternalRecord.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalInternalRecord.java index 0087816..988194b 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalInternalRecord.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalInternalRecord.java @@ -51,8 +51,7 @@ public abstract class JournalInternalRecord implements EncodingSupport { public void setCompactCount(final short compactCount) { if (compactCount > Byte.MAX_VALUE) { this.compactCount = Byte.MAX_VALUE; - } - else { + } else { this.compactCount = (byte) compactCount; } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-journal/src/main/java/org/apache/activemq/artemis/journal/ActiveMQJournalBundle.java ---------------------------------------------------------------------- diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/journal/ActiveMQJournalBundle.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/journal/ActiveMQJournalBundle.java index 247064c..472f16f 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/journal/ActiveMQJournalBundle.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/journal/ActiveMQJournalBundle.java @@ -17,9 +17,9 @@ package org.apache.activemq.artemis.journal; import org.apache.activemq.artemis.api.core.ActiveMQIOErrorException; +import org.jboss.logging.Messages; import org.jboss.logging.annotations.Message; import org.jboss.logging.annotations.MessageBundle; -import org.jboss.logging.Messages; /** * Logger Code 14 http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-journal/src/main/java/org/apache/activemq/artemis/journal/ActiveMQJournalLogger.java ---------------------------------------------------------------------- diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/journal/ActiveMQJournalLogger.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/journal/ActiveMQJournalLogger.java index 67574d1..198185c 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/journal/ActiveMQJournalLogger.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/journal/ActiveMQJournalLogger.java @@ -72,8 +72,8 @@ public interface ActiveMQJournalLogger extends BasicLogger { @LogMessage(level = Logger.Level.INFO) @Message(id = 141007, value = "Current File on the journal is <= the sequence file.getFileID={0} on the dataFiles" + - "\nCurrentfile.getFileId={1} while the file.getFileID()={2}" + - "\nIs same = ({3})", + "\nCurrentfile.getFileId={1} while the file.getFileID()={2}" + + "\nIs same = ({3})", format = Message.Format.MESSAGE_FORMAT) void currentFile(Long fileID, Long id, Long fileFileID, Boolean b); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-journal/src/test/java/org/apache/activemq/artemis/core/io/aio/CallbackOrderTest.java ---------------------------------------------------------------------- diff --git a/artemis-journal/src/test/java/org/apache/activemq/artemis/core/io/aio/CallbackOrderTest.java b/artemis-journal/src/test/java/org/apache/activemq/artemis/core/io/aio/CallbackOrderTest.java index 926981c..1749ca1 100644 --- a/artemis-journal/src/test/java/org/apache/activemq/artemis/core/io/aio/CallbackOrderTest.java +++ b/artemis-journal/src/test/java/org/apache/activemq/artemis/core/io/aio/CallbackOrderTest.java @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-journal/src/test/java/org/apache/activemq/artemis/core/io/aio/FileIOUtilTest.java ---------------------------------------------------------------------- diff --git a/artemis-journal/src/test/java/org/apache/activemq/artemis/core/io/aio/FileIOUtilTest.java b/artemis-journal/src/test/java/org/apache/activemq/artemis/core/io/aio/FileIOUtilTest.java index 0e3d7d7..4c8aba4 100644 --- a/artemis-journal/src/test/java/org/apache/activemq/artemis/core/io/aio/FileIOUtilTest.java +++ b/artemis-journal/src/test/java/org/apache/activemq/artemis/core/io/aio/FileIOUtilTest.java @@ -61,7 +61,6 @@ public class FileIOUtilTest { file2.open(); file2.writeDirect(buffer, true); - // This is allocating a reusable buffer to perform the copy, just like it's used within LargeMessageInSync buffer = ByteBuffer.allocate(4 * 1024); @@ -83,5 +82,4 @@ public class FileIOUtilTest { } - } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-junit/pom.xml ---------------------------------------------------------------------- diff --git a/artemis-junit/pom.xml b/artemis-junit/pom.xml index 89aa47f..ca5972d 100644 --- a/artemis-junit/pom.xml +++ b/artemis-junit/pom.xml @@ -17,54 +17,54 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> + <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.activemq</groupId> - <artifactId>artemis-pom</artifactId> - <version>1.5.0-SNAPSHOT</version> - </parent> + <parent> + <groupId>org.apache.activemq</groupId> + <artifactId>artemis-pom</artifactId> + <version>1.5.0-SNAPSHOT</version> + </parent> - <artifactId>artemis-junit</artifactId> - <packaging>jar</packaging> - <name>ActiveMQ Artemis JUnit Rules</name> + <artifactId>artemis-junit</artifactId> + <packaging>jar</packaging> + <name>ActiveMQ Artemis JUnit Rules</name> - <properties> - <activemq.basedir>${project.basedir}/..</activemq.basedir> - </properties> + <properties> + <activemq.basedir>${project.basedir}/..</activemq.basedir> + </properties> - <dependencies> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>provided</scope> - </dependency> - <!-- - --> - <dependency> - <groupId>org.jboss.logmanager</groupId> - <artifactId>jboss-logmanager</artifactId> - </dependency> - <dependency> - <groupId>org.apache.activemq</groupId> - <artifactId>artemis-jms-server</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.activemq</groupId> - <artifactId>artemis-jms-client</artifactId> - <version>${project.version}</version> - </dependency> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>provided</scope> + </dependency> + <!-- + --> + <dependency> + <groupId>org.jboss.logmanager</groupId> + <artifactId>jboss-logmanager</artifactId> + </dependency> + <dependency> + <groupId>org.apache.activemq</groupId> + <artifactId>artemis-jms-server</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.activemq</groupId> + <artifactId>artemis-jms-client</artifactId> + <version>${project.version}</version> + </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-simple</artifactId> - </dependency> - </dependencies> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-simple</artifactId> + </dependency> + </dependencies> </project> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/AbstractActiveMQClientResource.java ---------------------------------------------------------------------- diff --git a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/AbstractActiveMQClientResource.java b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/AbstractActiveMQClientResource.java index 74b9db8..b9179b1 100644 --- a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/AbstractActiveMQClientResource.java +++ b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/AbstractActiveMQClientResource.java @@ -45,8 +45,7 @@ public abstract class AbstractActiveMQClientResource extends ExternalResource { try { this.serverLocator = ActiveMQClient.createServerLocator(url); - } - catch (Exception ex) { + } catch (Exception ex) { throw new RuntimeException(String.format("Error creating {} - createServerLocator( {} ) failed", this.getClass().getSimpleName(), url.toString()), ex); } } @@ -90,11 +89,9 @@ public abstract class AbstractActiveMQClientResource extends ExternalResource { try { sessionFactory = serverLocator.createSessionFactory(); session = sessionFactory.createSession(); - } - catch (RuntimeException runtimeEx) { + } catch (RuntimeException runtimeEx) { throw runtimeEx; - } - catch (Exception ex) { + } catch (Exception ex) { throw new ActiveMQClientResourceException(String.format("%s initialisation failure", this.getClass().getSimpleName()), ex); } @@ -102,8 +99,7 @@ public abstract class AbstractActiveMQClientResource extends ExternalResource { try { session.start(); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { throw new ActiveMQClientResourceException(String.format("%s startup failure", this.getClass().getSimpleName()), amqEx); } } @@ -113,11 +109,9 @@ public abstract class AbstractActiveMQClientResource extends ExternalResource { if (session != null) { try { session.close(); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { log.warn("ActiveMQException encountered closing InternalClient ClientSession - ignoring", amqEx); - } - finally { + } finally { session = null; } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResource.java ---------------------------------------------------------------------- diff --git a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResource.java b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResource.java index 175b771..65f5392 100644 --- a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResource.java +++ b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResource.java @@ -88,8 +88,7 @@ public class ActiveMQConsumerResource extends AbstractActiveMQClientResource { session.createQueue(queueName, queueName); } consumer = session.createConsumer(queueName, browseOnly); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { throw new ActiveMQClientResourceException(String.format("Error creating consumer for queueName %s", queueName.toString()), amqEx); } } @@ -99,11 +98,9 @@ public class ActiveMQConsumerResource extends AbstractActiveMQClientResource { if (consumer != null) { try { consumer.close(); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { log.warn("Exception encountered closing consumer - ignoring", amqEx); - } - finally { + } finally { consumer = null; } } @@ -133,24 +130,19 @@ public class ActiveMQConsumerResource extends AbstractActiveMQClientResource { if (timeout > 0) { try { message = consumer.receive(timeout); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { throw new EmbeddedActiveMQResource.EmbeddedActiveMQResourceException(String.format("ClientConsumer.receive( timeout = %d ) for %s failed", timeout, queueName.toString()), amqEx); } - } - else if (timeout == 0) { + } else if (timeout == 0) { try { message = consumer.receiveImmediate(); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { throw new EmbeddedActiveMQResource.EmbeddedActiveMQResourceException(String.format("ClientConsumer.receiveImmediate() for %s failed", queueName.toString()), amqEx); } - } - else { + } else { try { message = consumer.receive(); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { throw new EmbeddedActiveMQResource.EmbeddedActiveMQResourceException(String.format("ClientConsumer.receive() for %s failed", queueName.toString()), amqEx); } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResource.java ---------------------------------------------------------------------- diff --git a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResource.java b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResource.java index acb8601..7a34cf5 100644 --- a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResource.java +++ b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResource.java @@ -68,12 +68,10 @@ public class ActiveMQDynamicProducerResource extends ActiveMQProducerResource { session.createQueue(address, address); } producer = session.createProducer((SimpleString) null); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { if (address == null) { throw new ActiveMQClientResourceException(String.format("Error creating producer for address %s", address.toString()), amqEx); - } - else { + } else { throw new ActiveMQClientResourceException("Error creating producer", amqEx); } } @@ -104,15 +102,13 @@ public class ActiveMQDynamicProducerResource extends ActiveMQProducerResource { log.warn("queue does not exist - creating queue: address = {}, name = {}", address.toString(), address.toString()); session.createQueue(targetAddress, targetAddress); } - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { throw new ActiveMQClientResourceException(String.format("Queue creation failed for queue: address = %s, name = %s", address.toString(), address.toString())); } try { producer.send(targetAddress, message); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { throw new ActiveMQClientResourceException(String.format("Failed to send message to %s", targetAddress.toString()), amqEx); } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerResource.java ---------------------------------------------------------------------- diff --git a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerResource.java b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerResource.java index 8d57bac..a443a18 100644 --- a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerResource.java +++ b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerResource.java @@ -102,8 +102,7 @@ public class ActiveMQProducerResource extends AbstractActiveMQClientResource { session.createQueue(address, address); } producer = session.createProducer(address); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { throw new ActiveMQClientResourceException(String.format("Error creating producer for address %s", address.toString()), amqEx); } } @@ -113,11 +112,9 @@ public class ActiveMQProducerResource extends AbstractActiveMQClientResource { if (producer != null) { try { producer.close(); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { log.warn("ActiveMQException encountered closing InternalClient ClientProducer - ignoring", amqEx); - } - finally { + } finally { producer = null; } } @@ -231,8 +228,7 @@ public class ActiveMQProducerResource extends AbstractActiveMQClientResource { public void sendMessage(ClientMessage message) { try { producer.send(message); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { throw new ActiveMQClientResourceException(String.format("Failed to send message to %s", producer.getAddress().toString()), amqEx); } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResource.java ---------------------------------------------------------------------- diff --git a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResource.java b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResource.java index 43bae8c..b9e12e7 100644 --- a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResource.java +++ b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResource.java @@ -123,8 +123,7 @@ public class EmbeddedActiveMQResource extends ExternalResource { deploymentManager.addDeployable(config); try { deploymentManager.readConfiguration(); - } - catch (Exception ex) { + } catch (Exception ex) { throw new EmbeddedActiveMQResourceException(String.format("Failed to read configuration file %s", filename), ex); } this.configuration = config; @@ -160,8 +159,7 @@ public class EmbeddedActiveMQResource extends ExternalResource { public void start() { try { server.start(); - } - catch (Exception ex) { + } catch (Exception ex) { throw new RuntimeException(String.format("Exception encountered starting %s: %s", server.getClass().getName(), this.getServerName()), ex); } @@ -183,8 +181,7 @@ public class EmbeddedActiveMQResource extends ExternalResource { if (server != null) { try { server.stop(); - } - catch (Exception ex) { + } catch (Exception ex) { log.warn(String.format("Exception encountered stopping %s: %s", server.getClass().getSimpleName(), this.getServerName()), ex); } } @@ -274,8 +271,7 @@ public class EmbeddedActiveMQResource extends ExternalResource { ActiveMQServer activeMQServer = server.getActiveMQServer(); if (activeMQServer != null) { name = activeMQServer.getConfiguration().getName(); - } - else if (configuration != null) { + } else if (configuration != null) { name = configuration.getName(); } @@ -340,8 +336,7 @@ public class EmbeddedActiveMQResource extends ExternalResource { BindingQueryResult bindingQueryResult = null; try { bindingQueryResult = server.getActiveMQServer().bindingQuery(address); - } - catch (Exception e) { + } catch (Exception e) { throw new EmbeddedActiveMQResourceException(String.format("getBoundQueues( %s ) - bindingQuery( %s ) failed", address.toString(), address.toString())); } if (bindingQueryResult.isExists()) { @@ -366,8 +361,7 @@ public class EmbeddedActiveMQResource extends ExternalResource { Queue queue = null; try { queue = server.getActiveMQServer().createQueue(address, name, filter, isUseDurableQueue(), temporary); - } - catch (Exception ex) { + } catch (Exception ex) { throw new EmbeddedActiveMQResourceException(String.format("Failed to create queue: queueName = %s, name = %s", address.toString(), name.toString()), ex); } @@ -386,8 +380,7 @@ public class EmbeddedActiveMQResource extends ExternalResource { SimpleString filter = null; try { server.getActiveMQServer().createSharedQueue(address, name, filter, user, isUseDurableQueue()); - } - catch (Exception ex) { + } catch (Exception ex) { throw new EmbeddedActiveMQResourceException(String.format("Failed to create shared queue: queueName = %s, name = %s, user = %s", address.toString(), name.toString(), user.toString()), ex); } } @@ -569,8 +562,7 @@ public class EmbeddedActiveMQResource extends ExternalResource { public void sendMessage(SimpleString address, ClientMessage message) { if (address == null) { throw new IllegalArgumentException("sendMessage failure - queueName is required"); - } - else if (message == null) { + } else if (message == null) { throw new IllegalArgumentException("sendMessage failure - a ClientMessage is required"); } @@ -770,11 +762,9 @@ public class EmbeddedActiveMQResource extends ExternalResource { try { serverLocator = ActiveMQClient.createServerLocator(getVmURL()); sessionFactory = serverLocator.createSessionFactory(); - } - catch (RuntimeException runtimeEx) { + } catch (RuntimeException runtimeEx) { throw runtimeEx; - } - catch (Exception ex) { + } catch (Exception ex) { throw new EmbeddedActiveMQResourceException("Internal Client creation failure", ex); } @@ -782,8 +772,7 @@ public class EmbeddedActiveMQResource extends ExternalResource { session = sessionFactory.createSession(); producer = session.createProducer((String) null); session.start(); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { throw new EmbeddedActiveMQResourceException("Internal Client creation failure", amqEx); } } @@ -792,22 +781,18 @@ public class EmbeddedActiveMQResource extends ExternalResource { if (producer != null) { try { producer.close(); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { log.warn("ActiveMQException encountered closing InternalClient ClientProducer - ignoring", amqEx); - } - finally { + } finally { producer = null; } } if (session != null) { try { session.close(); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { log.warn("ActiveMQException encountered closing InternalClient ClientSession - ignoring", amqEx); - } - finally { + } finally { session = null; } } @@ -836,8 +821,7 @@ public class EmbeddedActiveMQResource extends ExternalResource { try { producer.send(address, message); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { throw new EmbeddedActiveMQResourceException(String.format("Failed to send message to %s", address.toString()), amqEx); } } @@ -848,8 +832,7 @@ public class EmbeddedActiveMQResource extends ExternalResource { ClientConsumer consumer = null; try { consumer = session.createConsumer(address, browseOnly); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { throw new EmbeddedActiveMQResourceException(String.format("Failed to create consumer for %s", address.toString()), amqEx); } @@ -857,24 +840,19 @@ public class EmbeddedActiveMQResource extends ExternalResource { if (timeout > 0) { try { message = consumer.receive(timeout); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { throw new EmbeddedActiveMQResourceException(String.format("ClientConsumer.receive( timeout = %d ) for %s failed", timeout, address.toString()), amqEx); } - } - else if (timeout == 0) { + } else if (timeout == 0) { try { message = consumer.receiveImmediate(); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { throw new EmbeddedActiveMQResourceException(String.format("ClientConsumer.receiveImmediate() for %s failed", address.toString()), amqEx); } - } - else { + } else { try { message = consumer.receive(); - } - catch (ActiveMQException amqEx) { + } catch (ActiveMQException amqEx) { throw new EmbeddedActiveMQResourceException(String.format("ClientConsumer.receive() for %s failed", address.toString()), amqEx); } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSResource.java ---------------------------------------------------------------------- diff --git a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSResource.java b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSResource.java index 1471a51..539ddee 100644 --- a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSResource.java +++ b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSResource.java @@ -151,8 +151,7 @@ public class EmbeddedJMSResource extends ExternalResource { coreDeploymentManager.addDeployable(coreConfiguration); try { coreDeploymentManager.readConfiguration(); - } - catch (Exception readCoreConfigEx) { + } catch (Exception readCoreConfigEx) { throw new EmbeddedJMSResourceException(String.format("Failed to read ActiveMQServer configuration from file %s", serverConfigurationFileName), readCoreConfigEx); } this.configuration = coreConfiguration; @@ -162,8 +161,7 @@ public class EmbeddedJMSResource extends ExternalResource { jmsDeploymentManager.addDeployable(jmsConfiguration); try { jmsDeploymentManager.readConfiguration(); - } - catch (Exception readJmsConfigEx) { + } catch (Exception readJmsConfigEx) { throw new EmbeddedJMSResourceException(String.format("Failed to read JMSServerManager configuration from file %s", jmsConfigurationFileName), readJmsConfigEx); } this.jmsConfiguration = jmsConfiguration; @@ -176,8 +174,7 @@ public class EmbeddedJMSResource extends ExternalResource { for (Map.Entry<String, Object> property : properties.entrySet()) { try { message.setObjectProperty(property.getKey(), property.getValue()); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { throw new EmbeddedJMSResourceException(String.format("Failed to set property {%s = %s}", property.getKey(), property.getValue().toString()), jmsEx); } } @@ -200,8 +197,7 @@ public class EmbeddedJMSResource extends ExternalResource { log.info("Starting {}: {}", this.getClass().getSimpleName(), this.getServerName()); try { jmsServer.start(); - } - catch (Exception ex) { + } catch (Exception ex) { throw new RuntimeException(String.format("Exception encountered starting %s: %s", jmsServer.getClass().getSimpleName(), this.getServerName()), ex); } } @@ -222,8 +218,7 @@ public class EmbeddedJMSResource extends ExternalResource { if (jmsServer != null) { try { jmsServer.stop(); - } - catch (Exception ex) { + } catch (Exception ex) { log.warn(String.format("Exception encountered stopping %s: %s - ignoring", jmsServer.getClass().getSimpleName(), this.getServerName()), ex); } } @@ -278,8 +273,7 @@ public class EmbeddedJMSResource extends ExternalResource { ActiveMQServer activeMQServer = jmsServer.getActiveMQServer(); if (activeMQServer != null) { name = activeMQServer.getConfiguration().getName(); - } - else if (configuration != null) { + } else if (configuration != null) { name = configuration.getName(); } @@ -320,13 +314,11 @@ public class EmbeddedJMSResource extends ExternalResource { String name = destination.getName(); if (destination.isQueue()) { queue = jmsServer.getActiveMQServer().locateQueue(destination.getSimpleAddress()); - } - else { + } else { BindingQueryResult bindingQueryResult = null; try { bindingQueryResult = jmsServer.getActiveMQServer().bindingQuery(destination.getSimpleAddress()); - } - catch (Exception ex) { + } catch (Exception ex) { log.error(String.format("getDestinationQueue( %s ) - bindingQuery for %s failed", destinationName, destination.getAddress()), ex); return null; } @@ -357,8 +349,7 @@ public class EmbeddedJMSResource extends ExternalResource { BindingQueryResult bindingQueryResult = null; try { bindingQueryResult = jmsServer.getActiveMQServer().bindingQuery(destination.getSimpleAddress()); - } - catch (Exception ex) { + } catch (Exception ex) { log.error(String.format("getTopicQueues( %s ) - bindingQuery for %s failed", topicName, destination.getAddress()), ex); return queues; } @@ -396,12 +387,10 @@ public class EmbeddedJMSResource extends ExternalResource { if (queue == null) { log.warn("getMessageCount(destinationName) - destination {} not found; returning -1", destinationName); count = -1; - } - else { + } else { count = queue.getMessageCount(); } - } - else { + } else { for (Queue topicQueue : getTopicQueues(destinationName)) { count += topicQueue.getMessageCount(); } @@ -451,8 +440,7 @@ public class EmbeddedJMSResource extends ExternalResource { if (body != null) { try { message.writeBytes(body); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { throw new EmbeddedJMSResourceException(String.format("Failed to set body {%s} on BytesMessage", new String(body)), jmsEx); } } @@ -467,8 +455,7 @@ public class EmbeddedJMSResource extends ExternalResource { if (body != null) { try { message.setText(body); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { throw new EmbeddedJMSResourceException(String.format("Failed to set body {%s} on TextMessage", body), jmsEx); } } @@ -485,8 +472,7 @@ public class EmbeddedJMSResource extends ExternalResource { for (Map.Entry<String, Object> entry : body.entrySet()) { try { message.setObject(entry.getKey(), entry.getValue()); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { throw new EmbeddedJMSResourceException(String.format("Failed to set body entry {%s = %s} on MapMessage", entry.getKey(), entry.getValue().toString()), jmsEx); } } @@ -503,8 +489,7 @@ public class EmbeddedJMSResource extends ExternalResource { if (body != null) { try { message.setObject(body); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { throw new EmbeddedJMSResourceException(String.format("Failed to set body {%s} on ObjectMessage", body.toString()), jmsEx); } } @@ -517,8 +502,7 @@ public class EmbeddedJMSResource extends ExternalResource { public void pushMessage(String destinationName, Message message) { if (destinationName == null) { throw new IllegalArgumentException("sendMessage failure - destination name is required"); - } - else if (message == null) { + } else if (message == null) { throw new IllegalArgumentException("sendMessage failure - a Message is required"); } ActiveMQDestination destination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); @@ -648,8 +632,7 @@ public class EmbeddedJMSResource extends ExternalResource { session = connection.createSession(); producer = session.createProducer(null); connection.start(); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { throw new EmbeddedJMSResourceException("InternalClient creation failure", jmsEx); } } @@ -657,32 +640,26 @@ public class EmbeddedJMSResource extends ExternalResource { void stop() { try { producer.close(); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { log.warn("JMSException encounter closing InternalClient Session - MessageProducer", jmsEx); - } - finally { + } finally { producer = null; } try { session.close(); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { log.warn("JMSException encounter closing InternalClient Session - ignoring", jmsEx); - } - finally { + } finally { session = null; } if (null != connection) { try { connection.close(); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { log.warn("JMSException encounter closing InternalClient Connection - ignoring", jmsEx); - } - finally { + } finally { connection = null; } } @@ -693,8 +670,7 @@ public class EmbeddedJMSResource extends ExternalResource { try { return session.createBytesMessage(); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { throw new EmbeddedJMSResourceException("Failed to create BytesMessage", jmsEx); } } @@ -704,8 +680,7 @@ public class EmbeddedJMSResource extends ExternalResource { try { return session.createTextMessage(); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { throw new EmbeddedJMSResourceException("Failed to create TextMessage", jmsEx); } } @@ -715,8 +690,7 @@ public class EmbeddedJMSResource extends ExternalResource { try { return session.createMapMessage(); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { throw new EmbeddedJMSResourceException("Failed to create MapMessage", jmsEx); } } @@ -726,8 +700,7 @@ public class EmbeddedJMSResource extends ExternalResource { try { return session.createObjectMessage(); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { throw new EmbeddedJMSResourceException("Failed to create ObjectMessage", jmsEx); } } @@ -736,8 +709,7 @@ public class EmbeddedJMSResource extends ExternalResource { checkSession(); try { return session.createStreamMessage(); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { throw new EmbeddedJMSResourceException("Failed to create StreamMessage", jmsEx); } } @@ -749,8 +721,7 @@ public class EmbeddedJMSResource extends ExternalResource { try { producer.send(destination, message); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { throw new EmbeddedJMSResourceException(String.format("Failed to push %s to %s", message.getClass().getSimpleName(), destination.toString()), jmsEx); } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ThreadLeakCheckRule.java ---------------------------------------------------------------------- diff --git a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ThreadLeakCheckRule.java b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ThreadLeakCheckRule.java index 43da4f5..d3c6bee 100644 --- a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ThreadLeakCheckRule.java +++ b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ThreadLeakCheckRule.java @@ -36,6 +36,7 @@ import org.junit.rules.ExternalResource; * This will also clear Client Thread Pools from ActiveMQClient. */ public class ThreadLeakCheckRule extends ExternalResource { + private static Logger log = Logger.getLogger(ThreadLeakCheckRule.class); private static Set<String> knownThreads = new HashSet<>(); @@ -84,26 +85,22 @@ public class ThreadLeakCheckRule extends ExternalResource { forceGC(); try { Thread.sleep(500); - } - catch (Throwable e) { + } catch (Throwable e) { } } } if (failed) { Assert.fail("Thread leaked"); - } - else if (failedOnce) { + } else if (failedOnce) { System.out.println("******************** Threads cleared after retries ********************"); System.out.println(); } - } - else { + } else { enabled = true; } - } - finally { + } finally { // clearing just to help GC previousThreads = null; } @@ -130,21 +127,20 @@ public class ThreadLeakCheckRule extends ExternalResource { System.runFinalization(); try { finalized.await(100, TimeUnit.MILLISECONDS); - } - catch (InterruptedException e) { + } catch (InterruptedException e) { } } if (dumbReference.get() != null) { failedGCCalls++; log.info("It seems that GC is disabled at your VM"); - } - else { + } else { // a success would reset the count failedGCCalls = 0; } log.info("#test forceGC Done "); } + public static void removeKownThread(String name) { knownThreads.remove(name); } @@ -160,7 +156,6 @@ public class ThreadLeakCheckRule extends ExternalResource { if (postThreads != null && previousThreads != null && postThreads.size() > previousThreads.size()) { - for (Thread aliveThread : postThreads.keySet()) { if (aliveThread.isAlive() && !isExpectedThread(aliveThread) && !previousThreads.containsKey(aliveThread)) { if (!failedThread) { @@ -182,11 +177,9 @@ public class ThreadLeakCheckRule extends ExternalResource { } } - return failedThread; } - /** * if it's an expected thread... we will just move along ignoring it * @@ -195,7 +188,7 @@ public class ThreadLeakCheckRule extends ExternalResource { */ private boolean isExpectedThread(Thread thread) { - for (String known: knownThreads) { + for (String known : knownThreads) { if (thread.getName().contains(known)) { return true; } @@ -204,7 +197,6 @@ public class ThreadLeakCheckRule extends ExternalResource { return false; } - protected static class DumbReference { private CountDownLatch finalized; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResourceTest.java ---------------------------------------------------------------------- diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResourceTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResourceTest.java index 90269ed..2f4b11c 100644 --- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResourceTest.java +++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResourceTest.java @@ -50,11 +50,9 @@ public class ActiveMQConsumerResourceTest { ActiveMQConsumerResource consumer = new ActiveMQConsumerResource(server.getVmURL(), TEST_QUEUE); - @Rule public RuleChain ruleChain = RuleChain.outerRule(new ThreadLeakCheckRule()).outerRule(server).around(consumer); - ClientMessage sent = null; @After @@ -92,4 +90,4 @@ public class ActiveMQConsumerResourceTest { sent = server.sendMessageWithProperties(TEST_ADDRESS, TEST_BODY, TEST_PROPERTIES); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceCustomConfigurationTest.java ---------------------------------------------------------------------- diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceCustomConfigurationTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceCustomConfigurationTest.java index fae54cc..180ef91 100644 --- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceCustomConfigurationTest.java +++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceCustomConfigurationTest.java @@ -32,6 +32,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; public class EmbeddedActiveMQResourceCustomConfigurationTest { + static final String TEST_QUEUE = "test.queue"; static final String TEST_ADDRESS = "test.address"; @@ -48,7 +49,7 @@ public class EmbeddedActiveMQResourceCustomConfigurationTest { Configuration configuration = server.getServer().getActiveMQServer().getConfiguration(); assertFalse("Persistence should have been disabled", configuration.isPersistenceEnabled()); - assertTrue( "Security should have been enabled", configuration.isSecurityEnabled()); + assertTrue("Security should have been enabled", configuration.isSecurityEnabled()); assertNotNull(TEST_QUEUE + " should exist", server.locateQueue(TEST_QUEUE)); @@ -57,4 +58,4 @@ public class EmbeddedActiveMQResourceCustomConfigurationTest { assertEquals("Should have one queue bound to address " + TEST_ADDRESS, 1, boundQueues.size()); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceFileConfigurationTest.java ---------------------------------------------------------------------- diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceFileConfigurationTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceFileConfigurationTest.java index ef10173..6731f9f 100644 --- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceFileConfigurationTest.java +++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceFileConfigurationTest.java @@ -37,7 +37,6 @@ public class EmbeddedActiveMQResourceFileConfigurationTest { @Rule public RuleChain rulechain = RuleChain.outerRule(new ThreadLeakCheckRule()).around(server); - @Test public void testConfiguredQueue() throws Exception { assertNotNull(TEST_QUEUE + " should exist", server.locateQueue(TEST_QUEUE)); @@ -47,4 +46,4 @@ public class EmbeddedActiveMQResourceFileConfigurationTest { assertEquals("Should have one queue bound to address " + TEST_ADDRESS, 1, boundQueues.size()); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-junit/src/test/resources/embedded-artemis-jms-only.xml ---------------------------------------------------------------------- diff --git a/artemis-junit/src/test/resources/embedded-artemis-jms-only.xml b/artemis-junit/src/test/resources/embedded-artemis-jms-only.xml index 11d13ba..6f68659 100644 --- a/artemis-junit/src/test/resources/embedded-artemis-jms-only.xml +++ b/artemis-junit/src/test/resources/embedded-artemis-jms-only.xml @@ -15,15 +15,15 @@ limitations under the License. --> <configuration xmlns="urn:activemq" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation=" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation=" urn:activemq /schema/artemis-server.xsd urn:activemq:jms /schema/artemis-jms.xsd"> <jms xmlns="urn:activemq:jms"> - <queue name="test.queue" > + <queue name="test.queue"> <durable>true</durable> </queue> - <topic name="test.topic" /> + <topic name="test.topic"/> </jms> -</configuration> \ No newline at end of file +</configuration> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-junit/src/test/resources/embedded-artemis-jms-server.xml ---------------------------------------------------------------------- diff --git a/artemis-junit/src/test/resources/embedded-artemis-jms-server.xml b/artemis-junit/src/test/resources/embedded-artemis-jms-server.xml index fda43dd..b2dfdfe 100644 --- a/artemis-junit/src/test/resources/embedded-artemis-jms-server.xml +++ b/artemis-junit/src/test/resources/embedded-artemis-jms-server.xml @@ -15,8 +15,8 @@ limitations under the License. --> <configuration xmlns="urn:activemq" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation=" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation=" urn:activemq /schema/artemis-server.xsd urn:activemq:core /schema/artemis-configuration.xsd urn:activemq:jms /schema/artemis-jms.xsd"> @@ -31,10 +31,10 @@ </core> <jms xmlns="urn:activemq:jms"> - <queue name="test.queue" > + <queue name="test.queue"> <durable>true</durable> </queue> - <topic name="test.topic" /> + <topic name="test.topic"/> </jms> -</configuration> \ No newline at end of file +</configuration> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-junit/src/test/resources/embedded-artemis-minimal-server.xml ---------------------------------------------------------------------- diff --git a/artemis-junit/src/test/resources/embedded-artemis-minimal-server.xml b/artemis-junit/src/test/resources/embedded-artemis-minimal-server.xml index 451ce53..b931e46 100644 --- a/artemis-junit/src/test/resources/embedded-artemis-minimal-server.xml +++ b/artemis-junit/src/test/resources/embedded-artemis-minimal-server.xml @@ -15,8 +15,8 @@ limitations under the License. --> <configuration xmlns="urn:activemq" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation=" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation=" urn:activemq /schema/artemis-server.xsd urn:activemq:core /schema/artemis-configuration.xsd"> <core xmlns="urn:activemq:core"> @@ -28,4 +28,4 @@ <acceptor name="in-vm">vm://0</acceptor> </acceptors> </core> -</configuration> \ No newline at end of file +</configuration> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-junit/src/test/resources/embedded-artemis-server.xml ---------------------------------------------------------------------- diff --git a/artemis-junit/src/test/resources/embedded-artemis-server.xml b/artemis-junit/src/test/resources/embedded-artemis-server.xml index 088ed54..8253243 100644 --- a/artemis-junit/src/test/resources/embedded-artemis-server.xml +++ b/artemis-junit/src/test/resources/embedded-artemis-server.xml @@ -15,8 +15,8 @@ limitations under the License. --> <configuration xmlns="urn:activemq" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation=" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation=" urn:activemq /schema/artemis-server.xsd urn:activemq:core /schema/artemis-configuration.xsd"> <core xmlns="urn:activemq:core"> @@ -38,4 +38,4 @@ </queues> </core> -</configuration> \ No newline at end of file +</configuration> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/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 32a9f6a..ea6758b 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 @@ -1,4 +1,4 @@ -/** +/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.activemq.artemis.maven; import java.io.File; @@ -62,16 +61,13 @@ public abstract class ArtemisAbstractPlugin extends AbstractMojo { @Parameter(defaultValue = "${localRepository}") protected ArtifactRepository localRepository; - - @Override public void execute() throws MojoExecutionException, MojoFailureException { if (isIgnore()) { getLog().debug("******************************************************************************************************"); getLog().debug("Execution of " + getClass().getSimpleName() + " is being ignored as ignore has been set to true"); getLog().debug("******************************************************************************************************"); - } - else { + } else { doExecute(); // We could execute the maven plugins over and over on examples // For that reason we just unlock the server here @@ -88,8 +84,7 @@ public abstract class ArtemisAbstractPlugin extends AbstractMojo { Artifact artifact; try { artifact = new DefaultArtifact(artifactID); - } - catch (IllegalArgumentException e) { + } catch (IllegalArgumentException e) { throw new MojoFailureException(e.getMessage(), e); } return artifact; @@ -103,8 +98,7 @@ public abstract class ArtemisAbstractPlugin extends AbstractMojo { ArtifactResult result; try { result = repositorySystem.resolveArtifact(repoSession, request); - } - catch (ArtifactResolutionException e) { + } catch (ArtifactResolutionException e) { throw new MojoExecutionException(e.getMessage(), e); } @@ -148,7 +142,8 @@ public abstract class ArtemisAbstractPlugin extends AbstractMojo { return dependencies; } - protected Set<File> resolveDependencies(String[] dependencyListParameter, String[] individualListParameter) throws DependencyCollectionException, MojoFailureException, MojoExecutionException { + protected Set<File> resolveDependencies(String[] dependencyListParameter, + String[] individualListParameter) throws DependencyCollectionException, MojoFailureException, MojoExecutionException { Set<File> filesSet = new HashSet<>(); if (dependencyListParameter != null) { for (String lib : dependencyListParameter) {
