activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [25/50] [abbrv] activemq-artemis git commit: fix up checkstyle issues
Date Mon, 07 Nov 2016 16:36:45 GMT
fix up checkstyle issues


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/1b89801c
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/1b89801c
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/1b89801c

Branch: refs/heads/ARTEMIS-780
Commit: 1b89801cb3ed9dab92d35c0fe2a0d73cdb133cb9
Parents: a4e1431
Author: Martyn Taylor <mtaylor@redhat.com>
Authored: Tue Nov 1 11:40:09 2016 +0000
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Mon Nov 7 11:28:07 2016 -0500

----------------------------------------------------------------------
 .../artemis/core/journal/impl/JournalImpl.java         |  6 +++---
 .../journal/codec/PersistentQueueBindingEncoding.java  |  3 +--
 .../activemq/artemis/core/server/impl/QueueImpl.java   |  5 +----
 .../activemq/artemis/tools/migrate/config/Main.java    |  3 +--
 .../migrate/config/XMLConfigurationMigration.java      | 13 +++++--------
 .../tests/integration/addressing/AddressingTest.java   |  8 +++-----
 6 files changed, 14 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1b89801c/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 b1093ed..c3d3a87 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
@@ -48,8 +48,8 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
-import org.apache.activemq.artemis.api.core.Pair;
 import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
+import org.apache.activemq.artemis.api.core.Pair;
 import org.apache.activemq.artemis.core.io.IOCallback;
 import org.apache.activemq.artemis.core.io.SequentialFile;
 import org.apache.activemq.artemis.core.io.SequentialFileFactory;
@@ -866,7 +866,7 @@ public class JournalImpl extends JournalBase implements TestableJournal,
Journal
    }
 
    private static SimpleFuture<Boolean> newSyncAndCallbackResult(boolean sync, IOCompletion
callback) {
-      return (sync && callback == null) ? new SimpleFuture<>() : null;
+      return (sync && callback == null) ? new SimpleFuture<Boolean>() : null;
    }
 
    @Override
@@ -2227,7 +2227,7 @@ public class JournalImpl extends JournalBase implements TestableJournal,
Journal
             }
          });
 
-         threadPool = new ThreadPoolExecutor(0,Integer.MAX_VALUE, 60L,TimeUnit.SECONDS, new
SynchronousQueue<>(), factory);
+         threadPool = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 60L,TimeUnit.SECONDS,
new SynchronousQueue(), factory);
          ioExecutorFactory = new OrderedExecutorFactory(threadPool);
       } else {
          ioExecutorFactory = providedIOThreadPool;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1b89801c/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentQueueBindingEncoding.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentQueueBindingEncoding.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentQueueBindingEncoding.java
index 78a81ea..169cd7d 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentQueueBindingEncoding.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentQueueBindingEncoding.java
@@ -176,8 +176,7 @@ public class PersistentQueueBindingEncoding implements EncodingSupport,
QueueBin
       if (buffer.readableBytes() > 0) {
          maxConsumers = buffer.readInt();
          deleteOnNoConsumers = buffer.readBoolean();
-      }
-      else {
+      } else {
          maxConsumers = -1;
          deleteOnNoConsumers = false;
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1b89801c/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
index 38d738b..7e68382 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
@@ -41,7 +41,6 @@ import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.apache.activemq.artemis.api.core.ActiveMQSecurityException;
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.Pair;
 import org.apache.activemq.artemis.api.core.SimpleString;
@@ -54,7 +53,6 @@ import org.apache.activemq.artemis.core.paging.cursor.PageSubscription;
 import org.apache.activemq.artemis.core.paging.cursor.PagedReference;
 import org.apache.activemq.artemis.core.persistence.QueueStatus;
 import org.apache.activemq.artemis.core.persistence.StorageManager;
-import org.apache.activemq.artemis.core.postoffice.AddressManager;
 import org.apache.activemq.artemis.core.postoffice.Binding;
 import org.apache.activemq.artemis.core.postoffice.Bindings;
 import org.apache.activemq.artemis.core.postoffice.DuplicateIDCache;
@@ -827,8 +825,7 @@ public class QueueImpl implements Queue {
          if (noConsumers.decrementAndGet() == 0 && deleteOnNoConsumers) {
             try {
                deleteQueue();
-            }
-            catch (Exception e) {
+            } catch (Exception e) {
                logger.error("Error deleting queue on no consumers.  " + this.toString(),
e);
             }
          }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1b89801c/artemis-tools/src/main/java/org/apache/activemq/artemis/tools/migrate/config/Main.java
----------------------------------------------------------------------
diff --git a/artemis-tools/src/main/java/org/apache/activemq/artemis/tools/migrate/config/Main.java
b/artemis-tools/src/main/java/org/apache/activemq/artemis/tools/migrate/config/Main.java
index c45d92a..94d4d53 100644
--- a/artemis-tools/src/main/java/org/apache/activemq/artemis/tools/migrate/config/Main.java
+++ b/artemis-tools/src/main/java/org/apache/activemq/artemis/tools/migrate/config/Main.java
@@ -37,8 +37,7 @@ public class Main {
             } else {
                try {
                   XMLConfigurationMigration migration = new XMLConfigurationMigration(input,
new File(args[1]));
-               }
-               catch (Exception e) {
+               } catch (Exception e) {
                   // Unable to process file, move on.
                }
             }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1b89801c/artemis-tools/src/main/java/org/apache/activemq/artemis/tools/migrate/config/XMLConfigurationMigration.java
----------------------------------------------------------------------
diff --git a/artemis-tools/src/main/java/org/apache/activemq/artemis/tools/migrate/config/XMLConfigurationMigration.java
b/artemis-tools/src/main/java/org/apache/activemq/artemis/tools/migrate/config/XMLConfigurationMigration.java
index f5811a6..4e47999 100644
--- a/artemis-tools/src/main/java/org/apache/activemq/artemis/tools/migrate/config/XMLConfigurationMigration.java
+++ b/artemis-tools/src/main/java/org/apache/activemq/artemis/tools/migrate/config/XMLConfigurationMigration.java
@@ -31,7 +31,6 @@ import javax.xml.xpath.XPathFactory;
 import java.io.File;
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
@@ -111,8 +110,7 @@ public class XMLConfigurationMigration {
          if (coreElement == null) {
             throw new Exception("Not a artemis config");
          }
-      }
-      catch (Exception e) {
+      } catch (Exception e) {
          throw new Exception(e);
       }
    }
@@ -194,8 +192,7 @@ public class XMLConfigurationMigration {
          Address address;
          if (jmsQueueAddresses.containsKey(name)) {
             address = jmsQueueAddresses.get(name);
-         }
-         else {
+         } else {
             address = new Address();
             address.setName(name);
             address.setRoutingType("anycast");
@@ -217,8 +214,7 @@ public class XMLConfigurationMigration {
          Address address;
          if (jmsTopicAddresses.containsKey(name)) {
             address = jmsTopicAddresses.get(name);
-         }
-         else {
+         } else {
             address = new Address();
             address.setName(name);
             address.setRoutingType("multicast");
@@ -247,7 +243,8 @@ public class XMLConfigurationMigration {
    }
 
    private void writeAddressListToDoc(String comment, Collection<Address> addresses,
Node addressElement) {
-      if (addresses.isEmpty()) return;
+      if (addresses.isEmpty())
+         return;
 
       addressElement.appendChild(document.createComment("=================="));
       addressElement.appendChild(document.createComment(comment));

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1b89801c/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java
index a21a62b..c2004e7 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java
@@ -22,7 +22,6 @@ import java.util.List;
 import java.util.UUID;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.ActiveMQQueueMaxConsumerLimitReached;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
@@ -159,7 +158,7 @@ public class AddressingTest extends ActiveMQTestBase {
       ClientConsumer consumer1 = session.createConsumer(q1.getName());
       ClientConsumer consumer2 = session.createConsumer(q2.getName());
       ClientConsumer consumer3 = session.createConsumer(q3.getName());
-      List<ClientConsumer> consumers = new ArrayList<>(Arrays.asList(new ClientConsumer[]
{consumer1, consumer2, consumer3}));
+      List<ClientConsumer> consumers = new ArrayList<>(Arrays.asList(new ClientConsumer[]{consumer1,
consumer2, consumer3}));
 
       List<String> messages = new ArrayList<>();
       messages.add("Message1");
@@ -272,9 +271,8 @@ public class AddressingTest extends ActiveMQTestBase {
          ClientSession session = sessionFactory.createSession();
          session.start();
 
-         ClientConsumer consumer1 = session.createConsumer(q1.getName());
-      }
-      catch (ActiveMQQueueMaxConsumerLimitReached e) {
+         session.createConsumer(q1.getName());
+      } catch (ActiveMQQueueMaxConsumerLimitReached e) {
          expectedException = e;
       }
 


Mime
View raw message