Fix checkstyle warnings in yang-jmx-generator-plugin 04/13004/10
authorMarian Dubai <mdubai@cisco.com>
Thu, 20 Nov 2014 12:10:18 +0000 (13:10 +0100)
committerMarian Dubai <mdubai@cisco.com>
Tue, 9 Dec 2014 13:31:24 +0000 (13:31 +0000)
Change-Id: I2c1d564b8ddbc04beaa0f2a1914fb6c64bfc2dfb
Signed-off-by: Marian Dubai <mdubai@cisco.com>
35 files changed:
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/CodeWriter.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGenerator.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractFactoryTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractFtlTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractModuleTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/GeneralClassTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/GeneralInterfaceTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/RuntimeRegistratorFtlTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/StubFactoryTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/TemplateFactory.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Annotation.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Field.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/HeaderSerializer.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/ModuleField.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/TypeDeclaration.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/AbsModuleGeneratedObjectFactory.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/ConcreteModuleGeneratedObjectFactory.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/FullyQualifiedName.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/GeneratedObject.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/GeneratedObjectBuilder.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/JavaFileInput.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/JavaFileInputBuilder.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/StringUtil.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/AbstractGeneratorTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGeneratorFileNamesValidationTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGeneratorGeneratedFilesTrackerTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGeneratorTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ModuleMXBeanEntryPluginTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ModuleMXBeanEntryTemplatesTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/RuntimeRegistratorFtlFileTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/module/AbstractGeneratedObjectTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/module/abs/AbsModuleGeneratedObjectFactoryTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/module/concrete/ConcreteModuleGeneratedObjectFactoryTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/StringUtilTest.java

index cd0f491..a1ccdc3 100644 (file)
@@ -9,6 +9,16 @@ package org.opendaylight.controller.config.yangjmxgenerator.plugin;
 
 import com.google.common.base.Optional;
 import com.google.common.collect.Lists;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
 import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
 import org.opendaylight.controller.config.yangjmxgenerator.RuntimeBeanEntry;
 import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry;
@@ -28,20 +38,9 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.StringUti
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
 final class CodeWriter {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(CodeWriter.class);
+    private static final Logger LOG = LoggerFactory.getLogger(CodeWriter.class);
     private static final Optional<String> COPYRIGHT = StringUtil.loadCopyright();
 
     public File writeSie(ServiceInterfaceEntry sie, File outputBaseDir) {
@@ -52,7 +51,7 @@ final class CodeWriter {
         } catch (Exception e) {
             String message = "An error occurred during Service interface generating, sie:"
                     + sie.getTypeName() + ", " + sie.getFullyQualifiedName();
-            LOGGER.error(message, e);
+            LOG.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -113,7 +112,7 @@ final class CodeWriter {
         } catch (Exception e) {
             String message = "An error occurred during Module generating, mbe:"
                     + mbe.getJavaNamePrefix();
-            LOGGER.error(message, e);
+            LOG.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
index c835627..3cbbb28 100644 (file)
@@ -12,6 +12,16 @@ import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 import org.apache.commons.io.FileUtils;
 import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.project.MavenProject;
@@ -30,17 +40,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.impl.StaticLoggerBinder;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
 /**
  * This class interfaces with yang-maven-plugin. Gets parsed yang modules in
  * {@link SchemaContext}, and parameters form the plugin configuration, and
@@ -54,7 +53,7 @@ public class JMXGenerator implements CodeGenerator {
 
     private PackageTranslator packageTranslator;
     private final CodeWriter codeWriter;
-    private static final Logger LOGGER = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(JMXGenerator.class);
     private Map<String, String> namespaceToPackageMapping;
     private File resourceBaseDir;
@@ -167,7 +166,7 @@ public class JMXGenerator implements CodeGenerator {
                         fullyQualifiedNamesOfFactories.toString());
             } catch (IOException e) {
                 String message = "Cannot write to " + serviceLoaderFile;
-                LOGGER.error(message);
+                LOG.error(message);
                 throw new RuntimeException(message, e);
             }
         }
@@ -185,8 +184,8 @@ public class JMXGenerator implements CodeGenerator {
 
     @Override
     public void setAdditionalConfig(Map<String, String> additionalCfg) {
-        if (LOGGER != null) {
-            LOGGER.debug(getClass().getCanonicalName(),
+        if (LOG != null) {
+            LOG.debug(getClass().getCanonicalName(),
                     ": Additional configuration received: ",
                     additionalCfg.toString());
         }
@@ -254,8 +253,8 @@ public class JMXGenerator implements CodeGenerator {
     public void setMavenProject(MavenProject project) {
         this.projectBaseDir = project.getBasedir();
 
-        if (LOGGER != null)
-            LOGGER.debug(getClass().getCanonicalName(), " project base dir: ",
+        if (LOG != null)
+            LOG.debug(getClass().getCanonicalName(), " project base dir: ",
                     projectBaseDir);
     }
 
@@ -272,7 +271,7 @@ public class JMXGenerator implements CodeGenerator {
                     }
                 }
                 if (undeletedFiles.isEmpty() == false) {
-                    LOGGER.error(
+                    LOG.error(
                             "Illegal state occurred: Unable to delete already generated files, undeleted files: {}",
                             undeletedFiles);
                 }
index c3a00b9..52b6bc1 100644 (file)
@@ -8,15 +8,14 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
 import com.google.common.collect.Lists;
+import java.util.Collections;
+import java.util.List;
 import org.opendaylight.controller.config.spi.ModuleFactory;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition;
 
-import java.util.Collections;
-import java.util.List;
-
 public class AbstractFactoryTemplate extends GeneralClassTemplate {
 
     private static final List<String> IMPLEMENTED_IFCS = Lists
index a959978..edcd11d 100644 (file)
@@ -9,6 +9,8 @@ package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
 import com.google.common.base.Optional;
 import com.google.common.collect.Lists;
+import java.util.Collections;
+import java.util.List;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
@@ -17,9 +19,6 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Meth
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.TypeDeclaration;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.FullyQualifiedNameHelper;
 
-import java.util.Collections;
-import java.util.List;
-
 public abstract class AbstractFtlTemplate implements FtlTemplate {
     private final String packageName;
     private final List<Field> fields;
index 92a71c2..2402014 100644 (file)
@@ -7,15 +7,14 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
+import java.util.Collections;
+import java.util.List;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.ModuleField;
 
-import java.util.Collections;
-import java.util.List;
-
 public class AbstractModuleTemplate extends GeneralClassTemplate {
 
     private final List<ModuleField> moduleFields;
index d01f3f9..2e867d3 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
 import com.google.common.base.Optional;
+import java.util.List;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
@@ -15,8 +16,6 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Head
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Method;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.TypeDeclaration;
 
-import java.util.List;
-
 public interface FtlTemplate {
 
     Header getHeader();
index 4df7b2a..1576c9d 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
 import java.util.Collections;
 import java.util.List;
-
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header;
index 1539e10..6842ed1 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
 import java.util.Collections;
 import java.util.List;
-
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDeclaration;
index aa69645..13345d6 100644 (file)
@@ -11,6 +11,8 @@ import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkState;
 import static java.lang.String.format;
 
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.collect.Lists;
 import java.io.Closeable;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -24,7 +26,6 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
-
 import org.opendaylight.controller.config.api.runtime.HierarchicalRuntimeBeanRegistration;
 import org.opendaylight.controller.config.api.runtime.RootRuntimeBeanRegistrator;
 import org.opendaylight.controller.config.yangjmxgenerator.RuntimeBeanEntry;
@@ -34,9 +35,6 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Fiel
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.FullyQualifiedNameHelper;
 
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.collect.Lists;
-
 public class RuntimeRegistratorFtlTemplate extends GeneralClassTemplate {
 
     private RuntimeRegistratorFtlTemplate(RuntimeBeanEntry runtimeBeanEntry,
@@ -44,7 +42,7 @@ public class RuntimeRegistratorFtlTemplate extends GeneralClassTemplate {
         // TODO header
         super(null, runtimeBeanEntry.getPackageName(), name, Collections
                 .<String> emptyList(), Arrays.asList(Closeable.class
-                .getCanonicalName()), fields, methods);
+                    .getCanonicalName()), fields, methods);
     }
 
     public static RuntimeBeanEntry findRoot(
index 5d2d664..1dd23a1 100644 (file)
@@ -8,12 +8,11 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
 import com.google.common.collect.Lists;
+import java.util.Collections;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition;
 
-import java.util.Collections;
-
 public class StubFactoryTemplate extends GeneralClassTemplate {
 
     public StubFactoryTemplate(Header header, String packageName, String name,
index ca1e823..942def0 100644 (file)
@@ -10,6 +10,14 @@ package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import javax.management.openmbean.SimpleType;
 import org.opendaylight.controller.config.api.DependencyResolver;
 import org.opendaylight.controller.config.api.IdentityAttributeRef;
 import org.opendaylight.controller.config.api.RuntimeBeanRegistratorAwareModule;
@@ -44,15 +52,6 @@ import org.opendaylight.yangtools.binding.generator.util.BindingGeneratorUtil;
 import org.opendaylight.yangtools.sal.binding.model.api.ParameterizedType;
 import org.opendaylight.yangtools.sal.binding.model.api.Type;
 
-import javax.management.openmbean.SimpleType;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
 public class TemplateFactory {
 
     /**
index a8ddabc..ae5f947 100644 (file)
@@ -9,19 +9,18 @@ package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model;
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
-import org.opendaylight.controller.config.api.annotations.Description;
-import org.opendaylight.controller.config.api.annotations.RequireInterface;
-import org.opendaylight.controller.config.api.annotations.ServiceInterfaceAnnotation;
-import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry;
-import org.opendaylight.yangtools.yang.binding.annotations.ModuleQName;
-import org.opendaylight.yangtools.yang.common.QName;
-
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
+import org.opendaylight.controller.config.api.annotations.Description;
+import org.opendaylight.controller.config.api.annotations.RequireInterface;
+import org.opendaylight.controller.config.api.annotations.ServiceInterfaceAnnotation;
+import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry;
+import org.opendaylight.yangtools.yang.binding.annotations.ModuleQName;
+import org.opendaylight.yangtools.yang.common.QName;
 
 public class Annotation {
     final String name;
index 3639b6d..312bb4a 100644 (file)
@@ -7,12 +7,11 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model;
 
-import com.google.common.collect.Lists;
+import static com.google.common.base.Preconditions.checkNotNull;
 
+import com.google.common.collect.Lists;
 import java.util.List;
 
-import static com.google.common.base.Preconditions.checkNotNull;
-
 public class Field {
     private final String type;
     private final String name;
index eb07c80..89a2cf7 100644 (file)
@@ -8,9 +8,8 @@
 
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model;
 
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator;
-
 import java.util.Date;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator;
 
 public class HeaderSerializer {
     private static final String GENERATOR_CLASS = JMXGenerator.class.getCanonicalName();
index 37d6603..7dc864b 100644 (file)
@@ -8,11 +8,10 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model;
 
 
-import org.opendaylight.controller.config.yangjmxgenerator.attribute.Dependency;
-
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import org.opendaylight.controller.config.yangjmxgenerator.attribute.Dependency;
 
 public class ModuleField extends Field {
 
index a5bb987..1c44040 100644 (file)
@@ -7,9 +7,8 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model;
 
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.TypeName;
-
 import java.util.List;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.TypeName;
 
 public class TypeDeclaration {
     private final String type, name;
index 2378fac..64a13d3 100644 (file)
@@ -89,7 +89,7 @@ public class AbsModuleGeneratedObjectFactory {
         }
 
         // add logger:
-        b.addToBody(getLogger(abstractFQN));
+        b.addToBody(getLoggerDefinition(abstractFQN));
 
         b.addToBody("//attributes start");
         for(ModuleField moduleField: moduleFields) {
@@ -377,7 +377,7 @@ public class AbsModuleGeneratedObjectFactory {
         return result;
     }
 
-    private static String getLogger(FullyQualifiedName fqn) {
+    private static String getLoggerDefinition(FullyQualifiedName fqn) {
         return format("private static final %s logger = %s.getLogger(%s.class);",
                 Logger.class.getCanonicalName(), LoggerFactory.class.getCanonicalName(), fqn);
     }
index 051b1a7..68dd704 100644 (file)
@@ -1,7 +1,8 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.gofactory;
 
+import com.google.common.base.Joiner;
+import com.google.common.base.Optional;
 import java.util.LinkedHashMap;
-
 import org.opendaylight.controller.config.api.DependencyResolver;
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
@@ -11,9 +12,6 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.Generated
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.JavaFileInputBuilder;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.TypeName;
 
-import com.google.common.base.Joiner;
-import com.google.common.base.Optional;
-
 public class ConcreteModuleGeneratedObjectFactory {
 
     public GeneratedObject toGeneratedObject(ModuleMXBeanEntry mbe, Optional<String> copyright, Optional<String> header) {
index f72551a..5572bff 100644 (file)
@@ -1,11 +1,11 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.java;
 
+import static com.google.common.base.Preconditions.checkNotNull;
+
 import java.io.File;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import static com.google.common.base.Preconditions.checkNotNull;
-
 public class FullyQualifiedName {
 
     private final String packageName;
index 4ad080c..4d8bd3e 100644 (file)
@@ -1,15 +1,14 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.java;
 
+import static com.google.common.base.Preconditions.checkNotNull;
+
 import com.google.common.base.Optional;
 import com.google.common.collect.Maps;
-import org.apache.commons.io.FileUtils;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.StringUtil;
-
 import java.io.File;
 import java.io.IOException;
 import java.util.Map.Entry;
-
-import static com.google.common.base.Preconditions.checkNotNull;
+import org.apache.commons.io.FileUtils;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.StringUtil;
 
 public class GeneratedObject {
 
index 72819db..336bece 100644 (file)
@@ -1,10 +1,10 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.java;
 
+import static org.opendaylight.controller.config.yangjmxgenerator.plugin.util.StringUtil.prefixAndJoin;
+
 import com.google.common.base.Optional;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.StringUtil;
 
-import static org.opendaylight.controller.config.yangjmxgenerator.plugin.util.StringUtil.prefixAndJoin;
-
 public class GeneratedObjectBuilder {
     private final JavaFileInput input;
 
index c739f57..588e218 100644 (file)
@@ -8,14 +8,13 @@
 
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.java;
 
-import com.google.common.base.Optional;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation;
+import static com.google.common.base.Preconditions.checkNotNull;
 
+import com.google.common.base.Optional;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-
-import static com.google.common.base.Preconditions.checkNotNull;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation;
 
 public class JavaFileInputBuilder {
 
index bcc55a2..536dc2f 100644 (file)
@@ -4,16 +4,15 @@ import com.google.common.base.Joiner;
 import com.google.common.base.Optional;
 import com.google.common.base.Splitter;
 import com.google.common.base.Strings;
+import java.util.List;
+import java.util.regex.Pattern;
 import org.apache.commons.lang3.StringUtils;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.List;
-import java.util.regex.Pattern;
-
 public class StringUtil {
-    private static final Logger logger = LoggerFactory.getLogger(StringUtils.class);
+    private static final Logger LOG = LoggerFactory.getLogger(StringUtil.class);
 
     /**
      * @param list   of strings to be joined by ','
@@ -66,7 +65,7 @@ public class StringUtil {
                     return Optional.of(IOUtils.toString(in));
                 }
             } catch (IOException e) {
-                logger.warn("Cannot load copyright.txt", e);
+                LOG.warn("Cannot load copyright.txt", e);
             }
 
         */
index 1dde94b..2eae8b6 100644 (file)
@@ -7,12 +7,11 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin;
 
+import java.io.File;
 import org.apache.commons.io.FileUtils;
 import org.junit.Before;
 import org.opendaylight.controller.config.yangjmxgenerator.AbstractYangTest;
 
-import java.io.File;
-
 public abstract class AbstractGeneratorTest extends AbstractYangTest {
     private static final File GENERATOR_OUTPUT_PATH_ROOT = new File(
             "target/testgen");
index cdff509..3a820fd 100644 (file)
@@ -13,12 +13,11 @@ import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import com.google.common.collect.Sets;
 import org.junit.Test;
 import org.opendaylight.controller.config.yangjmxgenerator.ConfigConstants;
 import org.opendaylight.controller.config.yangjmxgenerator.PackageTranslatorTest;
 
-import com.google.common.collect.Sets;
-
 public class JMXGeneratorFileNamesValidationTest extends JMXGeneratorTest {
 
     @Test
index 4211201..8c2b5d6 100644 (file)
@@ -565,7 +565,7 @@ public class JMXGeneratorTest extends AbstractGeneratorTest {
 
     private static class SieASTVisitor extends ASTVisitor {
         protected String packageName, descriptionAnotValue, sieAnnotValue,
-                sieAnnotOsgiRegistrationType, type, extnds, javadoc;
+        sieAnnotOsgiRegistrationType, type, extnds, javadoc;
         protected Map<String, String> methodDescriptions = Maps.newHashMap();
 
         @Override
index 3c01cc0..076e4e9 100644 (file)
@@ -7,7 +7,14 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin;
 
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+
 import com.google.common.collect.Maps;
+import java.util.Collections;
+import java.util.Map;
 import org.junit.Test;
 import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
 import org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc;
@@ -16,14 +23,6 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.AbstractFa
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.TemplateFactory;
 import org.opendaylight.yangtools.sal.binding.model.api.Type;
 
-import java.util.Collections;
-import java.util.Map;
-
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-
 public class ModuleMXBeanEntryTemplatesTest {
 
     @Test
index f21765e..925f95a 100644 (file)
@@ -7,20 +7,19 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin;
 
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Map;
 import org.junit.Test;
 import org.opendaylight.controller.config.yangjmxgenerator.RuntimeBeanEntry;
 import org.opendaylight.controller.config.yangjmxgenerator.RuntimeRegistratorTest;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.FtlTemplate;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.RuntimeRegistratorFtlTemplate;
 
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Map;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
-
 public class RuntimeRegistratorFtlFileTest extends RuntimeRegistratorTest {
 
     @Test
index 957fbf5..c3ca077 100644 (file)
@@ -8,6 +8,12 @@
 
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.module;
 
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
 import net.sourceforge.pmd.lang.Parser;
 import net.sourceforge.pmd.lang.ParserOptions;
 import net.sourceforge.pmd.lang.ast.Node;
@@ -17,15 +23,8 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.AbstractGenera
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
 public class AbstractGeneratedObjectTest extends AbstractGeneratorTest {
-    private static final Logger logger = LoggerFactory.getLogger(AbstractGeneratedObjectTest.class);
+    private static final Logger LOG = LoggerFactory.getLogger(AbstractGeneratedObjectTest.class);
 
     protected void assertHasMethodNamed(Node c, String method) {
         assertTrue(c.hasDescendantMatchingXPath("//MethodDeclaration[MethodDeclarator[@Image='" +
@@ -35,7 +34,7 @@ public class AbstractGeneratedObjectTest extends AbstractGeneratorTest {
 
     protected Node parse(File dstFile) throws IOException {
         assertNotNull(dstFile);
-        logger.debug(FileUtils.readFileToString(dstFile));
+        LOG.debug(FileUtils.readFileToString(dstFile));
         Parser parser = new Java17Parser(new ParserOptions());
         return parser.parse(dstFile.toString(), new FileReader(dstFile));
     }
index 164d1a5..ba9f544 100644 (file)
@@ -9,6 +9,10 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.module.abs;
 
 import com.google.common.base.Optional;
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
+import java.util.Map.Entry;
 import org.junit.Test;
 import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
 import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry;
@@ -18,11 +22,6 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.Generated
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.module.AbstractGeneratedObjectTest;
 import org.opendaylight.yangtools.yang.common.QName;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.Map;
-import java.util.Map.Entry;
-
 public class AbsModuleGeneratedObjectFactoryTest extends AbstractGeneratedObjectTest {
 
     @Test
index 519b0ed..a9bf2b2 100644 (file)
@@ -1,6 +1,12 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.module.concrete;
 
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+
 import com.google.common.base.Optional;
+import java.io.File;
+import java.util.Map.Entry;
 import net.sourceforge.pmd.lang.ast.Node;
 import net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceDeclaration;
 import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit;
@@ -11,13 +17,6 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQual
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.GeneratedObject;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.module.AbstractGeneratedObjectTest;
 
-import java.io.File;
-import java.util.Map.Entry;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-
 public class ConcreteModuleGeneratedObjectFactoryTest extends AbstractGeneratedObjectTest {
 
     @Test
index 1ad0207..1576b38 100644 (file)
@@ -1,15 +1,14 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.util;
 
-import org.junit.Ignore;
-import org.junit.Test;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName;
-
-import java.io.IOException;
-
 import static java.util.Arrays.asList;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import java.io.IOException;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName;
+
 public class StringUtilTest {
     @Test
     public void testPrefixAndJoin() {
@@ -33,19 +32,19 @@ public class StringUtilTest {
     @Test
     public void testFormatting() {
         {
-        String input = "  \tpack;\n" +
+            String input = "  \tpack;\n" +
                 "class Bar{ \n" +
                 " method() {\n" +
                 "  body\n" +
                 "}\n" +
                 "  }";
-        String expected = "pack;\n" +
+            String expected = "pack;\n" +
                 "class Bar{\n" +
                 "    method() {\n" +
                 "        body\n" +
                 "    }\n" +
                 "}\n";
-        assertEquals(expected, StringUtil.formatJavaSource(input));
+            assertEquals(expected, StringUtil.formatJavaSource(input));
         }
         {
             String input = "{\n" +

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.