activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From martyntay...@apache.org
Subject [50/52] [partial] activemq-artemis git commit: ARTEMIS-765 Improve Checkstyle
Date Fri, 30 Sep 2016 15:26:50 GMT
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java
----------------------------------------------------------------------
diff --git a/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java b/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java
index bc2910d..5847a8b 100644
--- a/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java
+++ b/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java
@@ -45,14 +45,17 @@ public class Artemis {
       execute(fileHome, fileInstance, args);
    }
 
-
-   /** This is a good method for booting an embedded command */
+   /**
+    * This is a good method for booting an embedded command
+    */
    public static Object execute(File artemisHome, File artemisInstance, List<String> args) throws Throwable {
       return execute(artemisHome, artemisInstance, args.toArray(new String[args.size()]));
    }
 
-   /** This is a good method for booting an embedded command */
-   public static Object execute(File fileHome, File fileInstance, String ... args) throws Throwable {
+   /**
+    * This is a good method for booting an embedded command
+    */
+   public static Object execute(File fileHome, File fileInstance, String... args) throws Throwable {
       ArrayList<File> dirs = new ArrayList<>();
       if (fileHome != null) {
          dirs.add(new File(fileHome, "lib"));
@@ -61,7 +64,6 @@ public class Artemis {
          dirs.add(new File(fileInstance, "lib"));
       }
 
-
       ArrayList<URL> urls = new ArrayList<>();
 
       // Without the etc on the config, things like JGroups configuration wouldn't be loaded
@@ -118,13 +120,12 @@ public class Artemis {
       Thread.currentThread().setContextClassLoader(loader);
       Class<?> clazz = loader.loadClass("org.apache.activemq.artemis.cli.Artemis");
       Method method = clazz.getMethod("execute", File.class, File.class, args.getClass());
+
       try {
          return method.invoke(null, fileHome, fileInstance, args);
-      }
-      catch (InvocationTargetException e) {
+      } catch (InvocationTargetException e) {
          throw e.getTargetException();
-      }
-      finally {
+      } finally {
          Thread.currentThread().setContextClassLoader(originalCL);
       }
 
@@ -141,8 +142,7 @@ public class Artemis {
    private static void add(ArrayList<URL> urls, File file) {
       try {
          urls.add(file.toURI().toURL());
-      }
-      catch (MalformedURLException e) {
+      } catch (MalformedURLException e) {
          e.printStackTrace();
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
index bd64b33..16dcd03 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
@@ -24,17 +24,17 @@ import java.util.List;
 import io.airlift.airline.Cli;
 import org.apache.activemq.artemis.cli.commands.Action;
 import org.apache.activemq.artemis.cli.commands.ActionContext;
-import org.apache.activemq.artemis.cli.commands.messages.Browse;
-import org.apache.activemq.artemis.cli.commands.messages.Consumer;
 import org.apache.activemq.artemis.cli.commands.Create;
-import org.apache.activemq.artemis.cli.commands.destination.CreateDestination;
-import org.apache.activemq.artemis.cli.commands.destination.DeleteDestination;
 import org.apache.activemq.artemis.cli.commands.HelpAction;
-import org.apache.activemq.artemis.cli.commands.destination.HelpDestination;
 import org.apache.activemq.artemis.cli.commands.Kill;
-import org.apache.activemq.artemis.cli.commands.messages.Producer;
 import org.apache.activemq.artemis.cli.commands.Run;
 import org.apache.activemq.artemis.cli.commands.Stop;
+import org.apache.activemq.artemis.cli.commands.destination.CreateDestination;
+import org.apache.activemq.artemis.cli.commands.destination.DeleteDestination;
+import org.apache.activemq.artemis.cli.commands.destination.HelpDestination;
+import org.apache.activemq.artemis.cli.commands.messages.Browse;
+import org.apache.activemq.artemis.cli.commands.messages.Consumer;
+import org.apache.activemq.artemis.cli.commands.messages.Producer;
 import org.apache.activemq.artemis.cli.commands.tools.CompactJournal;
 import org.apache.activemq.artemis.cli.commands.tools.DecodeJournal;
 import org.apache.activemq.artemis.cli.commands.tools.EncodeJournal;
@@ -73,25 +73,21 @@ public class Artemis {
    public static Object execute(File artemisHome, File artemisInstance, String... args) throws Exception {
       try {
          return internalExecute(artemisHome, artemisInstance, args);
-      }
-      catch (ConfigurationException configException) {
+      } catch (ConfigurationException configException) {
          System.err.println(configException.getMessage());
          System.out.println();
          System.out.println("Configuration should be specified as 'scheme:location'. Default configuration is 'xml:${ARTEMIS_INSTANCE}/etc/bootstrap.xml'");
          return configException;
-      }
-      catch (CLIException cliException) {
+      } catch (CLIException cliException) {
          System.err.println(cliException.getMessage());
          return cliException;
-      }
-      catch (NullPointerException e) {
+      } catch (NullPointerException e) {
          // Yeah.. I really meant System.err..
          // this is the CLI and System.out and System.err are common places for interacting with the user
          // this is a programming error that must be visualized and corrected
          e.printStackTrace();
          return e;
-      }
-      catch (RuntimeException re) {
+      } catch (RuntimeException re) {
          System.err.println(re.getMessage());
          System.out.println();
 
@@ -102,8 +98,10 @@ public class Artemis {
       }
    }
 
-   /** This method is used to validate exception returns.
-    *  Useful on test cases */
+   /**
+    * This method is used to validate exception returns.
+    * Useful on test cases
+    */
    public static Object internalExecute(File artemisHome, File artemisInstance, String[] args) throws Exception {
       Action action = builder(artemisInstance).build().parse(args);
       action.setHomeValues(artemisHome, artemisInstance);
@@ -122,22 +120,16 @@ public class Artemis {
 
    private static Cli.CliBuilder<Action> builder(File artemisInstance) {
       String instance = artemisInstance != null ? artemisInstance.getAbsolutePath() : System.getProperty("artemis.instance");
-      Cli.CliBuilder<Action> builder = Cli.<Action>builder("artemis").withDescription("ActiveMQ Artemis Command Line")
-              .withCommand(HelpAction.class)
-              .withCommand(Producer.class)
-              .withCommand(Consumer.class)
-              .withCommand(Browse.class)
-              .withDefaultCommand(HelpAction.class);
+      Cli.CliBuilder<Action> builder = Cli.<Action>builder("artemis").withDescription("ActiveMQ Artemis Command Line").withCommand(HelpAction.class).withCommand(Producer.class).withCommand(Consumer.class).withCommand(Browse.class).withDefaultCommand(HelpAction.class);
 
       builder.withGroup("destination").withDescription("Destination tools group (create|delete) (example ./artemis destination create)").
-            withDefaultCommand(HelpDestination.class).withCommands(CreateDestination.class, DeleteDestination.class);
+         withDefaultCommand(HelpDestination.class).withCommands(CreateDestination.class, DeleteDestination.class);
 
       if (instance != null) {
          builder.withGroup("data").withDescription("data tools group (print|exp|imp|exp|encode|decode|compact) (example ./artemis data print)").
             withDefaultCommand(HelpData.class).withCommands(PrintData.class, XmlDataExporter.class, XmlDataImporter.class, DecodeJournal.class, EncodeJournal.class, CompactJournal.class);
          builder = builder.withCommands(Run.class, Stop.class, Kill.class);
-      }
-      else {
+      } else {
          builder.withGroup("data").withDescription("data tools group (print) (example ./artemis data print)").
             withDefaultCommand(HelpData.class).withCommands(PrintData.class);
          builder = builder.withCommand(Create.class);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/CLIException.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/CLIException.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/CLIException.java
index 247d6ef..20a4106 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/CLIException.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/CLIException.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,
@@ -17,7 +17,7 @@
 
 package org.apache.activemq.artemis.cli;
 
-public class CLIException extends Exception  {
+public class CLIException extends Exception {
 
    public CLIException(String message) {
       super(message);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java
index 1fd183c..1df8393 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java
@@ -72,7 +72,6 @@ public abstract class Configurable extends ActionAbstract {
       }
    }
 
-
    protected FileConfiguration getFileConfiguration() throws Exception {
       if (fileConfiguration == null) {
          if (getBrokerInstance() == null) {
@@ -84,8 +83,7 @@ public abstract class Configurable extends ActionAbstract {
             fileConfiguration.setLargeMessagesDirectory(defaultLocation + "/largemessages");
             fileConfiguration.setPagingDirectory(defaultLocation + "/paging");
             fileConfiguration.setBrokerInstance(new File("."));
-         }
-         else {
+         } else {
             fileConfiguration = new FileConfiguration();
             FileJMSConfiguration jmsConfiguration = new FileJMSConfiguration();
 
@@ -97,7 +95,6 @@ public abstract class Configurable extends ActionAbstract {
          }
       }
 
-
       return fileConfiguration;
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
index c99bc78..62de0ef 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
@@ -500,8 +500,7 @@ public class Create extends InputAbstract {
          if (!created) {
             throw new RuntimeException(String.format("Unable to create the path '%s'.", directory));
          }
-      }
-      else if (!directory.canWrite()) {
+      } else if (!directory.canWrite()) {
          throw new RuntimeException(String.format("The path '%s' is not writable.", directory));
       }
    }
@@ -533,16 +532,14 @@ public class Create extends InputAbstract {
       if (replicated) {
          clustered = true;
          filters.put("${replicated.settings}", applyFilters(readTextFile(ETC_REPLICATED_SETTINGS_TXT), filters));
-      }
-      else {
+      } else {
          filters.put("${replicated.settings}", "");
       }
 
       if (sharedStore) {
          clustered = true;
          filters.put("${shared-store.settings}", applyFilters(readTextFile(ETC_SHARED_STORE_SETTINGS_TXT), filters));
-      }
-      else {
+      } else {
          filters.put("${shared-store.settings}", "");
       }
 
@@ -551,8 +548,7 @@ public class Create extends InputAbstract {
       if (IS_WINDOWS || !supportsLibaio()) {
          aio = false;
          filters.put("${journal.settings}", "NIO");
-      }
-      else {
+      } else {
          aio = true;
          filters.put("${journal.settings}", "ASYNCIO");
       }
@@ -567,8 +563,7 @@ public class Create extends InputAbstract {
             extraWebAttr += " clientAuth=\"true\" trustStorePath=\"" + sslTrust + "\" trustStorePassword=\"" + sslTrustPassword + "\"";
          }
          filters.put("${extra.web.attributes}", extraWebAttr);
-      }
-      else {
+      } else {
          filters.put("${web.protocol}", "http");
          filters.put("${extra.web.attributes}", "");
       }
@@ -601,8 +596,7 @@ public class Create extends InputAbstract {
          filters.put("${cluster.settings}", applyFilters(readTextFile(ETC_CLUSTER_SETTINGS_TXT), filters));
          filters.put("${cluster-user}", getClusterUser());
          filters.put("${cluster-password}", getClusterPassword());
-      }
-      else {
+      } else {
          if (name == null) {
             name = getHost();
          }
@@ -643,8 +637,7 @@ public class Create extends InputAbstract {
       if (isAllowAnonymous()) {
          write(ETC_LOGIN_CONFIG_WITH_GUEST, filters, false);
          new File(directory, ETC_LOGIN_CONFIG_WITH_GUEST).renameTo(new File(directory, ETC_LOGIN_CONFIG));
-      }
-      else {
+      } else {
          write(ETC_LOGIN_CONFIG_WITHOUT_GUEST, filters, false);
          new File(directory, ETC_LOGIN_CONFIG_WITHOUT_GUEST).renameTo(new File(directory, ETC_LOGIN_CONFIG));
       }
@@ -670,36 +663,31 @@ public class Create extends InputAbstract {
 
       if (noWeb) {
          filters.put("${bootstrap-web-settings}", "");
-      }
-      else {
+      } else {
          filters.put("${bootstrap-web-settings}", applyFilters(readTextFile(ETC_BOOTSTRAP_WEB_SETTINGS_TXT), filters));
       }
 
       if (noAmqpAcceptor) {
          filters.put("${amqp-acceptor}", "");
-      }
-      else {
+      } else {
          filters.put("${amqp-acceptor}", applyFilters(readTextFile(ETC_AMQP_ACCEPTOR_TXT), filters));
       }
 
       if (noMqttAcceptor) {
          filters.put("${mqtt-acceptor}", "");
-      }
-      else {
+      } else {
          filters.put("${mqtt-acceptor}", applyFilters(readTextFile(ETC_MQTT_ACCEPTOR_TXT), filters));
       }
 
       if (noStompAcceptor) {
          filters.put("${stomp-acceptor}", "");
-      }
-      else {
+      } else {
          filters.put("${stomp-acceptor}", applyFilters(readTextFile(ETC_STOMP_ACCEPTOR_TXT), filters));
       }
 
       if (noHornetQAcceptor) {
          filters.put("${hornetq-acceptor}", "");
-      }
-      else {
+      } else {
          filters.put("${hornetq-acceptor}", applyFilters(readTextFile(ETC_HORNETQ_ACCEPTOR_TXT), filters));
       }
 
@@ -782,8 +770,7 @@ public class Create extends InputAbstract {
    private void performAutoTune(HashMap<String, String> filters, boolean aio, File dataFolder) {
       if (noAutoTune) {
          filters.put("${journal-buffer.settings}", "");
-      }
-      else {
+      } else {
          try {
             int writes = 250;
             System.out.println("");
@@ -804,8 +791,7 @@ public class Create extends InputAbstract {
 
             filters.put("${journal-buffer.settings}", applyFilters(readTextFile(ETC_JOURNAL_BUFFER_SETTINGS), syncFilter));
 
-         }
-         catch (Exception e) {
+         } catch (Exception e) {
             filters.put("${journal-buffer.settings}", "");
             e.printStackTrace();
             System.err.println("Couldn't perform sync calculation, using default values");
@@ -817,20 +803,17 @@ public class Create extends InputAbstract {
       if (forceLibaio) {
          // forcing libaio
          return true;
-      }
-      else if (forceNIO) {
+      } else if (forceNIO) {
          // forcing NIO
          return false;
-      }
-      else if (LibaioContext.isLoaded()) {
+      } else if (LibaioContext.isLoaded()) {
          try (LibaioContext context = new LibaioContext(1, true)) {
             File tmpFile = new File(directory, "validateAIO.bin");
             boolean supportsLibaio = true;
             try {
                LibaioFile file = context.openFile(tmpFile, true);
                file.close();
-            }
-            catch (Exception e) {
+            } catch (Exception e) {
                supportsLibaio = false;
             }
             tmpFile.delete();
@@ -839,8 +822,7 @@ public class Create extends InputAbstract {
             }
             return supportsLibaio;
          }
-      }
-      else {
+      } else {
          return false;
       }
    }
@@ -852,8 +834,7 @@ public class Create extends InputAbstract {
    private String[] getQueueList() {
       if (queues == null) {
          return new String[0];
-      }
-      else {
+      } else {
          return queues.split(",");
       }
    }
@@ -861,8 +842,7 @@ public class Create extends InputAbstract {
    private String[] getTopicList() {
       if (topics == null) {
          return new String[0];
-      }
-      else {
+      } else {
          return topics.split(",");
       }
    }
@@ -874,8 +854,7 @@ public class Create extends InputAbstract {
    private String path(File value, boolean unixPaths) throws IOException {
       if (unixPaths && IS_CYGWIN) {
          return value.getCanonicalPath();
-      }
-      else {
+      } else {
          return value.getCanonicalPath();
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/InputAbstract.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/InputAbstract.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/InputAbstract.java
index a499d4e..5625c9d 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/InputAbstract.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/InputAbstract.java
@@ -50,8 +50,7 @@ public class InputAbstract extends ActionAbstract {
          inputStr = scanner.nextLine();
          if (inputStr.trim().equals("")) {
             System.out.println("Invalid Entry!");
-         }
-         else {
+         } else {
             valid = true;
          }
       } while (!valid);
@@ -74,8 +73,7 @@ public class InputAbstract extends ActionAbstract {
 
          if (inputStr.trim().equals("")) {
             System.out.println("Invalid Entry!");
-         }
-         else {
+         } else {
             valid = true;
          }
       } while (!valid);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java
index 359a564..ff07106 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java
@@ -127,8 +127,7 @@ public class Run extends LockAbstract {
                try {
                   System.err.println("Halting by user request");
                   fileKill.delete();
-               }
-               catch (Throwable ignored) {
+               } catch (Throwable ignored) {
                }
                Runtime.getRuntime().halt(0);
             }
@@ -136,13 +135,11 @@ public class Run extends LockAbstract {
                try {
                   try {
                      server.stop();
-                  }
-                  catch (Exception e) {
+                  } catch (Exception e) {
                      e.printStackTrace();
                   }
                   timer.cancel();
-               }
-               finally {
+               } finally {
                   System.out.println("Server stopped!");
                   System.out.flush();
                   latchRunning.countDown();
@@ -159,8 +156,7 @@ public class Run extends LockAbstract {
          public void run() {
             try {
                server.stop();
-            }
-            catch (Exception e) {
+            } catch (Exception e) {
                e.printStackTrace();
             }
          }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/CreateDestination.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/CreateDestination.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/CreateDestination.java
index 985ef14..a0ae4bf 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/CreateDestination.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/CreateDestination.java
@@ -17,6 +17,8 @@
 
 package org.apache.activemq.artemis.cli.commands.destination;
 
+import javax.jms.Message;
+
 import io.airlift.airline.Command;
 import io.airlift.airline.Option;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
@@ -24,8 +26,6 @@ import org.apache.activemq.artemis.api.core.management.ManagementHelper;
 import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper;
 import org.apache.activemq.artemis.cli.commands.ActionContext;
 
-import javax.jms.Message;
-
 @Command(name = "create", description = "create a queue or topic")
 public class CreateDestination extends DestinationAction {
 
@@ -47,14 +47,11 @@ public class CreateDestination extends DestinationAction {
 
       if (JMS_QUEUE.equals(destType)) {
          createJmsQueue(context);
-      }
-      else if (CORE_QUEUE.equals(destType)) {
+      } else if (CORE_QUEUE.equals(destType)) {
          createCoreQueue(context);
-      }
-      else if (JMS_TOPIC.equals(destType)) {
+      } else if (JMS_TOPIC.equals(destType)) {
          createJmsTopic(context);
-      }
-      else {
+      } else {
          throw new IllegalArgumentException("--type can only be one of " + JMS_QUEUE + ", " + JMS_TOPIC + " and " + CORE_QUEUE);
       }
       return null;
@@ -72,8 +69,7 @@ public class CreateDestination extends DestinationAction {
             boolean result = (boolean) JMSManagementHelper.getResult(reply, Boolean.class);
             if (result) {
                context.out.println("Topic " + getName() + " created successfully.");
-            }
-            else {
+            } else {
                context.err.println("Failed to create topic " + getName() + ".");
             }
          }
@@ -128,8 +124,7 @@ public class CreateDestination extends DestinationAction {
             boolean result = (boolean) JMSManagementHelper.getResult(reply, Boolean.class);
             if (result) {
                context.out.println("Jms queue " + getName() + " created successfully.");
-            }
-            else {
+            } else {
                context.err.println("Failed to create jms queue " + getName() + ".");
             }
          }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/DeleteDestination.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/DeleteDestination.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/DeleteDestination.java
index 9b2bc49..eeb0506 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/DeleteDestination.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/DeleteDestination.java
@@ -17,6 +17,8 @@
 
 package org.apache.activemq.artemis.cli.commands.destination;
 
+import javax.jms.Message;
+
 import io.airlift.airline.Command;
 import io.airlift.airline.Option;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
@@ -24,8 +26,6 @@ import org.apache.activemq.artemis.api.core.management.ManagementHelper;
 import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper;
 import org.apache.activemq.artemis.cli.commands.ActionContext;
 
-import javax.jms.Message;
-
 @Command(name = "delete", description = "delete a queue or topic")
 public class DeleteDestination extends DestinationAction {
 
@@ -38,14 +38,11 @@ public class DeleteDestination extends DestinationAction {
 
       if (JMS_QUEUE.equals(destType)) {
          deleteJmsQueue(context);
-      }
-      else if (CORE_QUEUE.equals(destType)) {
+      } else if (CORE_QUEUE.equals(destType)) {
          deleteCoreQueue(context);
-      }
-      else if (JMS_TOPIC.equals(destType)) {
+      } else if (JMS_TOPIC.equals(destType)) {
          deleteJmsTopic(context);
-      }
-      else {
+      } else {
          throw new IllegalArgumentException("--type can only be one of " + JMS_QUEUE + ", " + JMS_TOPIC + " and " + CORE_QUEUE);
       }
       return null;
@@ -63,8 +60,7 @@ public class DeleteDestination extends DestinationAction {
             boolean result = (boolean) JMSManagementHelper.getResult(reply, Boolean.class);
             if (result) {
                context.out.println("Topic " + getName() + " deleted successfully.");
-            }
-            else {
+            } else {
                context.err.println("Failed to delete topic " + getName());
             }
          }
@@ -89,8 +85,7 @@ public class DeleteDestination extends DestinationAction {
             boolean result = (boolean) JMSManagementHelper.getResult(reply, Boolean.class);
             if (result) {
                context.out.println("Jms queue " + getName() + " deleted successfully.");
-            }
-            else {
+            } else {
                context.err.println("Failed to delete queue " + getName());
             }
          }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/DestinationAction.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/DestinationAction.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/DestinationAction.java
index ffce4d4..c128fc5 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/DestinationAction.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/DestinationAction.java
@@ -16,6 +16,11 @@
  */
 package org.apache.activemq.artemis.cli.commands.destination;
 
+import javax.jms.Message;
+import javax.jms.Queue;
+import javax.jms.QueueRequestor;
+import javax.jms.Session;
+
 import io.airlift.airline.Option;
 import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
@@ -32,11 +37,6 @@ import org.apache.activemq.artemis.jms.client.ActiveMQConnection;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.artemis.jms.client.ActiveMQSession;
 
-import javax.jms.Message;
-import javax.jms.Queue;
-import javax.jms.QueueRequestor;
-import javax.jms.Session;
-
 public abstract class DestinationAction extends InputAbstract {
 
    public static final String JMS_QUEUE = "jms-queue";
@@ -58,7 +58,10 @@ public abstract class DestinationAction extends InputAbstract {
    @Option(name = "--name", description = "destination name")
    String name;
 
-   public static void performJmsManagement(String brokerURL, String user, String password, ManagementCallback<Message> cb) throws Exception {
+   public static void performJmsManagement(String brokerURL,
+                                           String user,
+                                           String password,
+                                           ManagementCallback<Message> cb) throws Exception {
 
       try (ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(brokerURL, user, password);
            ActiveMQConnection connection = (ActiveMQConnection) factory.createConnection();
@@ -79,15 +82,16 @@ public abstract class DestinationAction extends InputAbstract {
 
          if (result) {
             cb.requestSuccessful(reply);
-         }
-         else {
+         } else {
             cb.requestFailed(reply);
          }
       }
    }
 
-   public static void performCoreManagement(String brokerURL, String user, String password, ManagementCallback<ClientMessage> cb) throws Exception {
-
+   public static void performCoreManagement(String brokerURL,
+                                            String user,
+                                            String password,
+                                            ManagementCallback<ClientMessage> cb) throws Exception {
 
       try (ServerLocator locator = ServerLocatorImpl.newLocator(brokerURL);
            ClientSessionFactory sessionFactory = locator.createSessionFactory();
@@ -102,8 +106,7 @@ public abstract class DestinationAction extends InputAbstract {
 
          if (ManagementHelper.hasOperationSucceeded(reply)) {
             cb.requestSuccessful(reply);
-         }
-         else {
+         } else {
             cb.requestFailed(reply);
          }
       }
@@ -130,6 +133,7 @@ public abstract class DestinationAction extends InputAbstract {
    }
 
    public interface ManagementCallback<T> {
+
       void setUpInvocation(T message) throws Exception;
 
       void requestSuccessful(T reply) throws Exception;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/HelpDestination.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/HelpDestination.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/HelpDestination.java
index b9d9d73..3455520 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/HelpDestination.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/HelpDestination.java
@@ -17,14 +17,14 @@
 
 package org.apache.activemq.artemis.cli.commands.destination;
 
-import io.airlift.airline.Help;
-import org.apache.activemq.artemis.cli.commands.Action;
-import org.apache.activemq.artemis.cli.commands.ActionContext;
-
 import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 
+import io.airlift.airline.Help;
+import org.apache.activemq.artemis.cli.commands.Action;
+import org.apache.activemq.artemis.cli.commands.ActionContext;
+
 public class HelpDestination extends Help implements Action {
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Browse.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Browse.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Browse.java
index dbd0913..3149708 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Browse.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Browse.java
@@ -17,6 +17,10 @@
 
 package org.apache.activemq.artemis.cli.commands.messages;
 
+import javax.jms.Connection;
+import javax.jms.Destination;
+import javax.jms.Session;
+
 import io.airlift.airline.Command;
 import io.airlift.airline.Option;
 import org.apache.activemq.artemis.cli.commands.ActionContext;
@@ -24,10 +28,6 @@ import org.apache.activemq.artemis.cli.commands.util.ConsumerThread;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
 
-import javax.jms.Connection;
-import javax.jms.Destination;
-import javax.jms.Session;
-
 @Command(name = "browser", description = "It will send consume messages from an instance")
 public class Browse extends DestAbstract {
 
@@ -49,8 +49,7 @@ public class Browse extends DestAbstract {
             Session session;
             if (txBatchSize > 0) {
                session = connection.createSession(true, Session.SESSION_TRANSACTED);
-            }
-            else {
+            } else {
                session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
             }
             threadsArray[i] = new ConsumerThread(session, dest, i);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Consumer.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Consumer.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Consumer.java
index dee8475..71bf40c 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Consumer.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Consumer.java
@@ -58,8 +58,7 @@ public class Consumer extends DestAbstract {
             Session session;
             if (txBatchSize > 0) {
                session = connection.createSession(true, Session.SESSION_TRANSACTED);
-            }
-            else {
+            } else {
                session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
             }
             threadsArray[i] = new ConsumerThread(session, dest, i);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Producer.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Producer.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Producer.java
index ea3b088..1f6a4b1 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Producer.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Producer.java
@@ -59,8 +59,7 @@ public class Producer extends DestAbstract {
             Session session;
             if (txBatchSize > 0) {
                session = connection.createSession(true, Session.SESSION_TRANSACTED);
-            }
-            else {
+            } else {
                session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
             }
             threadsArray[i] = new ProducerThread(session, dest, i);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/CompactJournal.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/CompactJournal.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/CompactJournal.java
index a638963..2959828 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/CompactJournal.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/CompactJournal.java
@@ -38,8 +38,7 @@ public final class CompactJournal extends LockAbstract {
          compactJournal(new File(getBinding()), "activemq-bindings", "bindings", 2, 1048576, null);
          System.out.println("Compactation succeeded for " + getBinding());
 
-      }
-      catch (Exception e) {
+      } catch (Exception e) {
          treatError(e, "data", "compact");
       }
       return null;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/DecodeJournal.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/DecodeJournal.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/DecodeJournal.java
index e39b055..b392f6f 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/DecodeJournal.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/DecodeJournal.java
@@ -62,8 +62,7 @@ public class DecodeJournal extends LockAbstract {
             directory = getFileConfiguration().getJournalDirectory();
          }
          importJournal(directory, prefix, suffix, 2, size, input);
-      }
-      catch (Exception e) {
+      } catch (Exception e) {
          treatError(e, "data", "decode");
       }
 
@@ -145,41 +144,35 @@ public class DecodeJournal extends LockAbstract {
             if (operation.equals("AddRecord")) {
                RecordInfo info = parseRecord(lineProperties);
                journal.appendAddRecord(info.id, info.userRecordType, info.data, false);
-            }
-            else if (operation.equals("AddRecordTX")) {
+            } else if (operation.equals("AddRecordTX")) {
                long txID = parseLong("txID", lineProperties);
                AtomicInteger counter = getCounter(txID, txCounters);
                counter.incrementAndGet();
                RecordInfo info = parseRecord(lineProperties);
                journal.appendAddRecordTransactional(txID, info.id, info.userRecordType, info.data);
-            }
-            else if (operation.equals("AddRecordTX")) {
+            } else if (operation.equals("AddRecordTX")) {
                long txID = parseLong("txID", lineProperties);
                AtomicInteger counter = getCounter(txID, txCounters);
                counter.incrementAndGet();
                RecordInfo info = parseRecord(lineProperties);
                journal.appendAddRecordTransactional(txID, info.id, info.userRecordType, info.data);
-            }
-            else if (operation.equals("UpdateTX")) {
+            } else if (operation.equals("UpdateTX")) {
                long txID = parseLong("txID", lineProperties);
                AtomicInteger counter = getCounter(txID, txCounters);
                counter.incrementAndGet();
                RecordInfo info = parseRecord(lineProperties);
                journal.appendUpdateRecordTransactional(txID, info.id, info.userRecordType, info.data);
-            }
-            else if (operation.equals("Update")) {
+            } else if (operation.equals("Update")) {
                RecordInfo info = parseRecord(lineProperties);
                journal.appendUpdateRecord(info.id, info.userRecordType, info.data, false);
-            }
-            else if (operation.equals("DeleteRecord")) {
+            } else if (operation.equals("DeleteRecord")) {
                long id = parseLong("id", lineProperties);
 
                // If not found it means the append/update records were reclaimed already
                if (journalRecords.get(id) != null) {
                   journal.appendDeleteRecord(id, false);
                }
-            }
-            else if (operation.equals("DeleteRecordTX")) {
+            } else if (operation.equals("DeleteRecordTX")) {
                long txID = parseLong("txID", lineProperties);
                long id = parseLong("id", lineProperties);
                AtomicInteger counter = getCounter(txID, txCounters);
@@ -189,8 +182,7 @@ public class DecodeJournal extends LockAbstract {
                if (journalRecords.get(id) != null) {
                   journal.appendDeleteRecordTransactional(txID, id);
                }
-            }
-            else if (operation.equals("Prepare")) {
+            } else if (operation.equals("Prepare")) {
                long txID = parseLong("txID", lineProperties);
                int numberOfRecords = parseInt("numberOfRecords", lineProperties);
                AtomicInteger counter = getCounter(txID, txCounters);
@@ -198,8 +190,7 @@ public class DecodeJournal extends LockAbstract {
 
                if (counter.get() == numberOfRecords) {
                   journal.appendPrepareRecord(txID, data, false);
-               }
-               else {
+               } else {
                   System.err.println("Transaction " + txID +
                                         " at line " +
                                         lineNumber +
@@ -208,15 +199,13 @@ public class DecodeJournal extends LockAbstract {
                                         " while the import only had " +
                                         counter);
                }
-            }
-            else if (operation.equals("Commit")) {
+            } else if (operation.equals("Commit")) {
                long txID = parseLong("txID", lineProperties);
                int numberOfRecords = parseInt("numberOfRecords", lineProperties);
                AtomicInteger counter = getCounter(txID, txCounters);
                if (counter.get() == numberOfRecords) {
                   journal.appendCommitRecord(txID, false);
-               }
-               else {
+               } else {
                   System.err.println("Transaction " + txID +
                                         " at line " +
                                         lineNumber +
@@ -225,16 +214,13 @@ public class DecodeJournal extends LockAbstract {
                                         " while the import only had " +
                                         counter);
                }
-            }
-            else if (operation.equals("Rollback")) {
+            } else if (operation.equals("Rollback")) {
                long txID = parseLong("txID", lineProperties);
                journal.appendRollbackRecord(txID, false);
-            }
-            else {
+            } else {
                System.err.println("Invalid operation " + operation + " at line " + lineNumber);
             }
-         }
-         catch (Exception ex) {
+         } catch (Exception ex) {
             System.err.println("Error at line " + lineNumber + ", operation=" + operation + " msg = " + ex.getMessage());
          }
       }
@@ -317,8 +303,7 @@ public class DecodeJournal extends LockAbstract {
          String[] tuple = el.split("@");
          if (tuple.length == 2) {
             properties.put(tuple[0], tuple[1]);
-         }
-         else {
+         } else {
             properties.put(tuple[0], tuple[0]);
          }
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/EncodeJournal.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/EncodeJournal.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/EncodeJournal.java
index d34b4ca..e5fd80c 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/EncodeJournal.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/EncodeJournal.java
@@ -57,8 +57,7 @@ public class EncodeJournal extends LockAbstract {
          }
 
          exportJournal(directory, prefix, suffix, 2, size);
-      }
-      catch (Exception e) {
+      } catch (Exception e) {
          treatError(e, "data", "encode");
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/LockAbstract.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/LockAbstract.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/LockAbstract.java
index 2089d3e..602b55a 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/LockAbstract.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/LockAbstract.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,
@@ -26,7 +26,8 @@ import org.apache.activemq.artemis.cli.CLIException;
 import org.apache.activemq.artemis.cli.commands.Action;
 import org.apache.activemq.artemis.cli.commands.ActionContext;
 
-public abstract class LockAbstract  extends DataAbstract implements Action {
+public abstract class LockAbstract extends DataAbstract implements Action {
+
    // There should be one lock per VM
    // These will be locked as long as the VM is running
    private static RandomAccessFile serverLockFile = null;
@@ -35,9 +36,8 @@ public abstract class LockAbstract  extends DataAbstract implements Action {
    protected File getLockPlace() throws Exception {
       String brokerInstance = getBrokerInstance();
       if (brokerInstance != null) {
-         return new File(new File(brokerInstance),"lock");
-      }
-      else {
+         return new File(new File(brokerInstance), "lock");
+      } else {
          return null;
       }
    }
@@ -53,8 +53,7 @@ public abstract class LockAbstract  extends DataAbstract implements Action {
             serverLockLock.close();
             serverLockLock = null;
          }
-      }
-      catch (Exception ignored) {
+      } catch (Exception ignored) {
       }
    }
 
@@ -65,15 +64,13 @@ public abstract class LockAbstract  extends DataAbstract implements Action {
       if (getBrokerInstance() == null) {
          System.err.println("Warning: You are running a data tool outside of any broker instance. Modifying data on a running server might break the server's data");
          System.err.println();
-      }
-      else {
+      } else {
          lockCLI(getLockPlace());
       }
 
       return null;
    }
 
-
    protected void lockCLI(File lockPlace) throws Exception {
       if (lockPlace != null) {
          lockPlace.mkdirs();
@@ -87,12 +84,10 @@ public abstract class LockAbstract  extends DataAbstract implements Action {
                throw new CLIException("Error: There is another process using the server at " + lockPlace + ". Cannot start the process!");
             }
             serverLockLock = lock;
-         }
-         catch (OverlappingFileLockException e) {
+         } catch (OverlappingFileLockException e) {
             throw new CLIException("Error: There is another process using the server at " + lockPlace + ". Cannot start the process!");
          }
       }
    }
 
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/OptionalLocking.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/OptionalLocking.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/OptionalLocking.java
index 5a53656..7169ba4 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/OptionalLocking.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/OptionalLocking.java
@@ -21,7 +21,9 @@ import java.io.File;
 
 import io.airlift.airline.Option;
 
-/** This is for commands where --f on ignoring lock could be valid. */
+/**
+ * This is for commands where --f on ignoring lock could be valid.
+ */
 public class OptionalLocking extends LockAbstract {
 
    @Option(name = "--f", description = "This will allow certain tools like print-data to be performed ignoring any running servers. WARNING: Changing data concurrently with a running broker may damage your data. Be careful with this option.")

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/PrintData.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/PrintData.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/PrintData.java
index 9b273b2..408aef5 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/PrintData.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/PrintData.java
@@ -65,8 +65,7 @@ public class PrintData extends OptionalLocking {
       super.execute(context);
       try {
          printData(new File(getBinding()), new File(getJournal()), new File(getPaging()));
-      }
-      catch (Exception e) {
+      } catch (Exception e) {
          treatError(e, "data", "print");
       }
       return null;
@@ -87,8 +86,7 @@ public class PrintData extends OptionalLocking {
             System.out.println("Server's ID=" + fileLock.getNodeId().toString());
             System.out.println("********************************************");
             fileLock.stop();
-         }
-         catch (Exception e) {
+         } catch (Exception e) {
             e.printStackTrace();
          }
       }
@@ -99,8 +97,7 @@ public class PrintData extends OptionalLocking {
 
       try {
          DescribeJournal.describeBindingsJournal(bindingsDirectory);
-      }
-      catch (Exception e) {
+      } catch (Exception e) {
          e.printStackTrace();
       }
 
@@ -112,8 +109,7 @@ public class PrintData extends OptionalLocking {
       DescribeJournal describeJournal = null;
       try {
          describeJournal = DescribeJournal.describeMessagesJournal(messagesDirectory);
-      }
-      catch (Exception e) {
+      } catch (Exception e) {
          e.printStackTrace();
          return;
       }
@@ -125,8 +121,7 @@ public class PrintData extends OptionalLocking {
          System.out.println("********************************************");
 
          printPages(pagingDirectory, describeJournal);
-      }
-      catch (Exception e) {
+      } catch (Exception e) {
          e.printStackTrace();
          return;
       }
@@ -218,8 +213,7 @@ public class PrintData extends OptionalLocking {
             }
          }
 
-      }
-      catch (Exception e) {
+      } catch (Exception e) {
          e.printStackTrace();
       }
    }
@@ -248,8 +242,7 @@ public class PrintData extends OptionalLocking {
             }
 
             set.add(encoding.position);
-         }
-         else if (record.userRecordType == JournalRecordIds.PAGE_CURSOR_COMPLETE) {
+         } else if (record.userRecordType == JournalRecordIds.PAGE_CURSOR_COMPLETE) {
             CursorAckRecordEncoding encoding = new CursorAckRecordEncoding();
             encoding.decode(buff);
 
@@ -259,15 +252,13 @@ public class PrintData extends OptionalLocking {
             if (!cursorInfo.getCompletePages(queueID).add(pageNR)) {
                System.err.println("Page " + pageNR + " has been already set as complete on queue " + queueID);
             }
-         }
-         else if (record.userRecordType == JournalRecordIds.PAGE_TRANSACTION) {
+         } else if (record.userRecordType == JournalRecordIds.PAGE_TRANSACTION) {
             if (record.isUpdate) {
                PageUpdateTXEncoding pageUpdate = new PageUpdateTXEncoding();
 
                pageUpdate.decode(buff);
                cursorInfo.getPgTXs().add(pageUpdate.pageTX);
-            }
-            else {
+            } else {
                PageTransactionInfoImpl pageTransactionInfo = new PageTransactionInfoImpl();
 
                pageTransactionInfo.decode(buff);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporter.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporter.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporter.java
index 05f1fb5..a0e6c1e 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporter.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporter.java
@@ -66,12 +66,12 @@ import org.apache.activemq.artemis.core.paging.impl.Page;
 import org.apache.activemq.artemis.core.paging.impl.PageTransactionInfoImpl;
 import org.apache.activemq.artemis.core.paging.impl.PagingManagerImpl;
 import org.apache.activemq.artemis.core.paging.impl.PagingStoreFactoryNIO;
+import org.apache.activemq.artemis.core.persistence.impl.journal.AckDescribe;
 import org.apache.activemq.artemis.core.persistence.impl.journal.DescribeJournal;
 import org.apache.activemq.artemis.core.persistence.impl.journal.DescribeJournal.MessageDescribe;
 import org.apache.activemq.artemis.core.persistence.impl.journal.DescribeJournal.ReferenceDescribe;
 import org.apache.activemq.artemis.core.persistence.impl.journal.JournalRecordIds;
 import org.apache.activemq.artemis.core.persistence.impl.journal.JournalStorageManager;
-import org.apache.activemq.artemis.core.persistence.impl.journal.AckDescribe;
 import org.apache.activemq.artemis.core.persistence.impl.journal.codec.CursorAckRecordEncoding;
 import org.apache.activemq.artemis.core.persistence.impl.journal.codec.PageUpdateTXEncoding;
 import org.apache.activemq.artemis.core.persistence.impl.journal.codec.PersistentQueueBindingEncoding;
@@ -130,8 +130,7 @@ public final class XmlDataExporter extends OptionalLocking {
 
       try {
          process(context.out, getBinding(), getJournal(), getPaging(), getLargeMessages());
-      }
-      catch (Exception e) {
+      } catch (Exception e) {
          treatError(e, "data", "exp");
       }
       return null;
@@ -236,26 +235,21 @@ public final class XmlDataExporter extends OptionalLocking {
          Object o = DescribeJournal.newObjectEncoding(info, storageManager);
          if (info.getUserRecordType() == JournalRecordIds.ADD_MESSAGE) {
             messages.put(info.id, ((MessageDescribe) o).getMsg());
-         }
-         else if (info.getUserRecordType() == JournalRecordIds.ADD_LARGE_MESSAGE) {
+         } else if (info.getUserRecordType() == JournalRecordIds.ADD_LARGE_MESSAGE) {
             messages.put(info.id, ((MessageDescribe) o).getMsg());
-         }
-         else if (info.getUserRecordType() == JournalRecordIds.ADD_REF) {
+         } else if (info.getUserRecordType() == JournalRecordIds.ADD_REF) {
             ReferenceDescribe ref = (ReferenceDescribe) o;
             HashMap<Long, ReferenceDescribe> map = messageRefs.get(info.id);
             if (map == null) {
                HashMap<Long, ReferenceDescribe> newMap = new HashMap<>();
                newMap.put(ref.refEncoding.queueID, ref);
                messageRefs.put(info.id, newMap);
-            }
-            else {
+            } else {
                map.put(ref.refEncoding.queueID, ref);
             }
-         }
-         else if (info.getUserRecordType() == JournalRecordIds.ACKNOWLEDGE_REF) {
+         } else if (info.getUserRecordType() == JournalRecordIds.ACKNOWLEDGE_REF) {
             acks.add(info);
-         }
-         else if (info.userRecordType == JournalRecordIds.ACKNOWLEDGE_CURSOR) {
+         } else if (info.userRecordType == JournalRecordIds.ACKNOWLEDGE_CURSOR) {
             CursorAckRecordEncoding encoding = new CursorAckRecordEncoding();
             encoding.decode(buff);
 
@@ -267,15 +261,13 @@ public final class XmlDataExporter extends OptionalLocking {
             }
 
             set.add(encoding.position);
-         }
-         else if (info.userRecordType == JournalRecordIds.PAGE_TRANSACTION) {
+         } else if (info.userRecordType == JournalRecordIds.PAGE_TRANSACTION) {
             if (info.isUpdate) {
                PageUpdateTXEncoding pageUpdate = new PageUpdateTXEncoding();
 
                pageUpdate.decode(buff);
                pgTXs.add(pageUpdate.pageTX);
-            }
-            else {
+            } else {
                PageTransactionInfoImpl pageTransactionInfo = new PageTransactionInfoImpl();
 
                pageTransactionInfo.decode(buff);
@@ -336,15 +328,13 @@ public final class XmlDataExporter extends OptionalLocking {
             cf.setId(id);
             ActiveMQServerLogger.LOGGER.info("Found JMS connection factory: " + cf.getName());
             jmsConnectionFactories.put(cf.getName(), cf);
-         }
-         else if (rec == JMSJournalStorageManagerImpl.DESTINATION_RECORD) {
+         } else if (rec == JMSJournalStorageManagerImpl.DESTINATION_RECORD) {
             PersistedDestination destination = new PersistedDestination();
             destination.decode(buffer);
             destination.setId(id);
             ActiveMQServerLogger.LOGGER.info("Found JMS destination: " + destination.getName());
             jmsDestinations.put(new Pair<>(destination.getType(), destination.getName()), destination);
-         }
-         else if (rec == JMSJournalStorageManagerImpl.BINDING_RECORD) {
+         } else if (rec == JMSJournalStorageManagerImpl.BINDING_RECORD) {
             PersistedBindings jndi = new PersistedBindings();
             jndi.decode(buffer);
             jndi.setId(id);
@@ -355,8 +345,7 @@ public final class XmlDataExporter extends OptionalLocking {
             }
             ActiveMQServerLogger.LOGGER.info("Found JMS JNDI binding data for " + jndi.getType() + " " + jndi.getName() + ": " + builder.toString());
             jmsJNDI.put(key, jndi);
-         }
-         else {
+         } else {
             throw new IllegalStateException("Invalid record type " + rec);
          }
 
@@ -401,8 +390,7 @@ public final class XmlDataExporter extends OptionalLocking {
          xmlWriter.writeEndDocument();
          xmlWriter.flush();
          xmlWriter.close();
-      }
-      catch (Exception e) {
+      } catch (Exception e) {
          e.printStackTrace();
       }
    }
@@ -745,13 +733,11 @@ public final class XmlDataExporter extends OptionalLocking {
 
                   pageId++;
                }
-            }
-            else {
+            } else {
                ActiveMQServerLogger.LOGGER.debug("Page store was null");
             }
          }
-      }
-      catch (Exception e) {
+      } catch (Exception e) {
          e.printStackTrace();
       }
    }
@@ -771,8 +757,7 @@ public final class XmlDataExporter extends OptionalLocking {
 
       if (message.isLargeMessage()) {
          printLargeMessageBody((LargeServerMessage) message);
-      }
-      else {
+      } else {
          int size = message.getEndOfBodyPosition() - message.getBodyBuffer().readerIndex();
          byte[] buffer = new byte[size];
          message.getBodyBuffer().readBytes(buffer);
@@ -796,8 +781,7 @@ public final class XmlDataExporter extends OptionalLocking {
             Long remainder = bodySize - totalBytesWritten;
             if (remainder >= LARGE_MESSAGE_CHUNK_SIZE) {
                bufferSize = LARGE_MESSAGE_CHUNK_SIZE;
-            }
-            else {
+            } else {
                bufferSize = remainder;
             }
             ActiveMQBuffer buffer = ActiveMQBuffers.fixedBuffer(bufferSize.intValue());
@@ -806,16 +790,13 @@ public final class XmlDataExporter extends OptionalLocking {
             totalBytesWritten += bufferSize;
          }
          encoder.close();
-      }
-      catch (ActiveMQException e) {
+      } catch (ActiveMQException e) {
          e.printStackTrace();
-      }
-      finally {
+      } finally {
          if (encoder != null) {
             try {
                encoder.close();
-            }
-            catch (ActiveMQException e) {
+            } catch (ActiveMQException e) {
                e.printStackTrace();
             }
          }
@@ -839,39 +820,29 @@ public final class XmlDataExporter extends OptionalLocking {
          xmlWriter.writeAttribute(XmlDataConstants.PROPERTY_NAME, key.toString());
          if (value instanceof byte[]) {
             xmlWriter.writeAttribute(XmlDataConstants.PROPERTY_VALUE, encode((byte[]) value));
-         }
-         else {
+         } else {
             xmlWriter.writeAttribute(XmlDataConstants.PROPERTY_VALUE, value == null ? XmlDataConstants.NULL : value.toString());
          }
 
          if (value instanceof Boolean) {
             xmlWriter.writeAttribute(XmlDataConstants.PROPERTY_TYPE, XmlDataConstants.PROPERTY_TYPE_BOOLEAN);
-         }
-         else if (value instanceof Byte) {
+         } else if (value instanceof Byte) {
             xmlWriter.writeAttribute(XmlDataConstants.PROPERTY_TYPE, XmlDataConstants.PROPERTY_TYPE_BYTE);
-         }
-         else if (value instanceof Short) {
+         } else if (value instanceof Short) {
             xmlWriter.writeAttribute(XmlDataConstants.PROPERTY_TYPE, XmlDataConstants.PROPERTY_TYPE_SHORT);
-         }
-         else if (value instanceof Integer) {
+         } else if (value instanceof Integer) {
             xmlWriter.writeAttribute(XmlDataConstants.PROPERTY_TYPE, XmlDataConstants.PROPERTY_TYPE_INTEGER);
-         }
-         else if (value instanceof Long) {
+         } else if (value instanceof Long) {
             xmlWriter.writeAttribute(XmlDataConstants.PROPERTY_TYPE, XmlDataConstants.PROPERTY_TYPE_LONG);
-         }
-         else if (value instanceof Float) {
+         } else if (value instanceof Float) {
             xmlWriter.writeAttribute(XmlDataConstants.PROPERTY_TYPE, XmlDataConstants.PROPERTY_TYPE_FLOAT);
-         }
-         else if (value instanceof Double) {
+         } else if (value instanceof Double) {
             xmlWriter.writeAttribute(XmlDataConstants.PROPERTY_TYPE, XmlDataConstants.PROPERTY_TYPE_DOUBLE);
-         }
-         else if (value instanceof String) {
+         } else if (value instanceof String) {
             xmlWriter.writeAttribute(XmlDataConstants.PROPERTY_TYPE, XmlDataConstants.PROPERTY_TYPE_STRING);
-         }
-         else if (value instanceof SimpleString) {
+         } else if (value instanceof SimpleString) {
             xmlWriter.writeAttribute(XmlDataConstants.PROPERTY_TYPE, XmlDataConstants.PROPERTY_TYPE_SIMPLE_STRING);
-         }
-         else if (value instanceof byte[]) {
+         } else if (value instanceof byte[]) {
             xmlWriter.writeAttribute(XmlDataConstants.PROPERTY_TYPE, XmlDataConstants.PROPERTY_TYPE_BYTES);
          }
       }
@@ -887,17 +858,13 @@ public final class XmlDataExporter extends OptionalLocking {
       String prettyType = XmlDataConstants.DEFAULT_TYPE_PRETTY;
       if (rawType == Message.BYTES_TYPE) {
          prettyType = XmlDataConstants.BYTES_TYPE_PRETTY;
-      }
-      else if (rawType == Message.MAP_TYPE) {
+      } else if (rawType == Message.MAP_TYPE) {
          prettyType = XmlDataConstants.MAP_TYPE_PRETTY;
-      }
-      else if (rawType == Message.OBJECT_TYPE) {
+      } else if (rawType == Message.OBJECT_TYPE) {
          prettyType = XmlDataConstants.OBJECT_TYPE_PRETTY;
-      }
-      else if (rawType == Message.STREAM_TYPE) {
+      } else if (rawType == Message.STREAM_TYPE) {
          prettyType = XmlDataConstants.STREAM_TYPE_PRETTY;
-      }
-      else if (rawType == Message.TEXT_TYPE) {
+      } else if (rawType == Message.TEXT_TYPE) {
          prettyType = XmlDataConstants.TEXT_TYPE_PRETTY;
       }
       xmlWriter.writeAttribute(XmlDataConstants.MESSAGE_TYPE, prettyType);


Mime
View raw message