Fix checkstyle violations in /sal-connector-api and sal-dummy-distributed-datastore
[controller.git] / opendaylight / md-sal / sal-dummy-distributed-datastore / src / main / java / org / opendaylight / controller / dummy / datastore / Main.java
index 81da1f89a645d529ef12ed10135a29416f7dfc17..3342b5de8b519e19f94582098761430a545b2542 100644 (file)
@@ -10,42 +10,45 @@ package org.opendaylight.controller.dummy.datastore;
 
 import akka.actor.ActorSystem;
 import com.typesafe.config.ConfigFactory;
+import org.kohsuke.args4j.CmdLineException;
 import org.kohsuke.args4j.CmdLineParser;
 import org.kohsuke.args4j.Option;
 
 public class Main {
-    @Option(name="-member-name", usage="Sets the member name", required = true)
+    @Option(name = "-member-name", usage = "Sets the member name", required = true)
     public String memberName;
 
-    @Option(name="-max-delay-millis", usage = "Sets the maximum delay that should be applied for any append entry. Only applies when cause-trouble is present.")
+    @Option(name = "-max-delay-millis", usage = "Sets the maximum delay that should be applied for any append entry. "
+            + "Only applies when cause-trouble is present.")
     public int maxDelayInMillis = 500;
 
-    @Option(name="-cause-trouble", usage="If present turns on artificial failures")
+    @Option(name = "-cause-trouble", usage = "If present turns on artificial failures")
     public boolean causeTrouble = false;
 
-    @Option(name="-drop-replies", usage = "If present drops replies. Only applies when cause-trouble is present.")
+    @Option(name = "-drop-replies", usage = "If present drops replies. Only applies when cause-trouble is present.")
     public boolean dropReplies = false;
 
-    public void run(){
-        ActorSystem actorSystem = ActorSystem.create("opendaylight-cluster-data", ConfigFactory.load(memberName).getConfig("odl-cluster-data"));
+    public void run() {
+        ActorSystem actorSystem = ActorSystem.create("opendaylight-cluster-data",
+                ConfigFactory.load(memberName).getConfig("odl-cluster-data"));
 
         Configuration configuration = new Configuration(maxDelayInMillis, dropReplies, causeTrouble);
 
-        actorSystem.actorOf(DummyShardManager.props(configuration, memberName, new String[] {"inventory", "default", "toaster", "topology"}, "operational"), "shardmanager-operational");
-        actorSystem.actorOf(DummyShardManager.props(configuration, memberName, new String[] {"inventory", "default", "toaster", "topology"}, "config"), "shardmanager-config");
+        actorSystem.actorOf(DummyShardManager.props(configuration, memberName,
+                new String[] {"inventory", "default", "toaster", "topology"}, "operational"),
+                "shardmanager-operational");
+        actorSystem.actorOf(DummyShardManager.props(configuration, memberName,
+                new String[] {"inventory", "default", "toaster", "topology"}, "config"), "shardmanager-config");
     }
 
     @Override
     public String toString() {
-        return "Main{" +
-                "memberName='" + memberName + '\'' +
-                ", maxDelayInMillis=" + maxDelayInMillis +
-                ", causeTrouble=" + causeTrouble +
-                ", dropReplies=" + dropReplies +
-                '}';
+        return "Main{" + "memberName='" + memberName + '\'' + ", maxDelayInMillis=" + maxDelayInMillis
+                + ", causeTrouble=" + causeTrouble + ", dropReplies=" + dropReplies + '}';
     }
 
-    public static void main(String[] args){
+    @SuppressWarnings("checkstyle:RegexpSingleLineJava")
+    public static void main(String[] args) {
         Main bean = new Main();
         CmdLineParser parser = new CmdLineParser(bean);
 
@@ -53,10 +56,9 @@ public class Main {
             parser.parseArgument(args);
             System.out.println(bean.toString());
             bean.run();
-        } catch(Exception e){
+        } catch (CmdLineException e) {
             System.err.println(e.getMessage());
             parser.printUsage(System.err);
         }
     }
-
 }