Fix checkstyle in mdsal-binding2-generator-util 52/64552/10
authorJie Han <han.jie@zte.com.cn>
Fri, 20 Oct 2017 02:09:21 +0000 (10:09 +0800)
committerRobert Varga <nite@hq.sk>
Wed, 3 Oct 2018 15:50:46 +0000 (15:50 +0000)
- Fix checkstyle issues and activate enforcement.
Change-Id: I5e83540c54650f899afa9e711d17f4c3efb2e9f0
Signed-off-by: Jie Han <han.jie@zte.com.cn>
26 files changed:
binding2/mdsal-binding2-generator-util/pom.xml
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/AbstractBaseType.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/BindingGeneratorUtil.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/BindingTypes.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/FormattingUtils.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/JavaIdentifier.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/JavaIdentifierNormalizer.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/ReferencedTypeImpl.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/TypeComments.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/Types.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/YangSnippetCleaner.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/generated/type/builder/AbstractGeneratedType.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/generated/type/builder/AbstractGeneratedTypeBuilder.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/generated/type/builder/AbstractTypeMemberBuilder.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/generated/type/builder/AnnotationTypeBuilderImpl.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/generated/type/builder/ConstantImpl.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/generated/type/builder/EnumerationBuilderImpl.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/generated/type/builder/GeneratedPropertyBuilderImpl.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/generated/type/builder/GeneratedPropertyImpl.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/generated/type/builder/GeneratedTOBuilderImpl.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/generated/type/builder/GeneratedTypeBuilderImpl.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/generated/type/builder/MethodParameterImpl.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/generated/type/builder/MethodSignatureBuilderImpl.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding/javav2/generator/util/generated/type/builder/MethodSignatureImpl.java
binding2/mdsal-binding2-generator-util/src/test/java/org/opendaylight/mdsal/binding/javav2/generator/util/JavaIdentifierNormalizerTest.java
binding2/mdsal-binding2-generator-util/src/test/java/org/opendaylight/mdsal/binding/javav2/generator/util/generated/type/builder/EnumerationBuilderImplTest.java

index 7d083dbbaca4a5fb0db168b7883f1c2c202ab0ad..26c71c812c8758921eeea094aeb277b7c7eb560f 100644 (file)
             <artifactId>yang-parser-impl</artifactId>
             <scope>test</scope>
         </dependency>
             <artifactId>yang-parser-impl</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
         </dependency>
     </dependencies>
         <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <configuration>
+                    <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>
 </project>
index de719fee4a873c2eafd96c052202022ecb63126b..f12b04134536333afea6825cb3c3c86b9ea0c420 100644 (file)
@@ -15,7 +15,7 @@ import org.opendaylight.mdsal.binding.javav2.generator.context.ModuleContext;
 import org.opendaylight.mdsal.binding.javav2.model.api.Type;
 
 /**
 import org.opendaylight.mdsal.binding.javav2.model.api.Type;
 
 /**
- * This class represents ancestor for other <code>Type</code>s
+ * This class represents ancestor for other <code>Type</code>s.
  */
 @Beta
 public abstract class AbstractBaseType implements Type {
  */
 @Beta
 public abstract class AbstractBaseType implements Type {
@@ -40,12 +40,12 @@ public abstract class AbstractBaseType implements Type {
      * @param name
      *            string with the name for this <code>Type</code>
      */
      * @param name
      *            string with the name for this <code>Type</code>
      */
-    protected AbstractBaseType(final String pkName, final String name, ModuleContext context) {
+    protected AbstractBaseType(final String pkName, final String name, final ModuleContext context) {
         Preconditions.checkNotNull(pkName, "Package Name for Generated Type cannot be null!");
         Preconditions.checkNotNull(name, "Name of Generated Type cannot be null!");
         this.packageName = JavaIdentifierNormalizer.normalizeFullPackageName(pkName);
         Preconditions.checkNotNull(pkName, "Package Name for Generated Type cannot be null!");
         Preconditions.checkNotNull(name, "Name of Generated Type cannot be null!");
         this.packageName = JavaIdentifierNormalizer.normalizeFullPackageName(pkName);
-        Preconditions.checkNotNull(context, "In case of not having identifiers normalized, " +
-                "ModuleContext instance must be provided.");
+        Preconditions.checkNotNull(context,
+            "In case of not having identifiers normalized, ModuleContext instance must be provided.");
         this.name = JavaIdentifierNormalizer.normalizeClassIdentifier(pkName, name, context);
     }
 
         this.name = JavaIdentifierNormalizer.normalizeClassIdentifier(pkName, name, context);
     }
 
@@ -62,7 +62,7 @@ public abstract class AbstractBaseType implements Type {
      *            true if pkName and name are normalized
      */
     protected AbstractBaseType(final String pkName, final String name, final boolean isNormalized,
      *            true if pkName and name are normalized
      */
     protected AbstractBaseType(final String pkName, final String name, final boolean isNormalized,
-            ModuleContext context) {
+            final ModuleContext context) {
         Preconditions.checkNotNull(pkName, "Package Name for Generated Type cannot be null!");
         Preconditions.checkNotNull(name, "Name of Generated Type cannot be null!");
         if (isNormalized) {
         Preconditions.checkNotNull(pkName, "Package Name for Generated Type cannot be null!");
         Preconditions.checkNotNull(name, "Name of Generated Type cannot be null!");
         if (isNormalized) {
@@ -70,14 +70,14 @@ public abstract class AbstractBaseType implements Type {
             this.name = name;
         } else {
             this.packageName = JavaIdentifierNormalizer.normalizeFullPackageName(pkName);
             this.name = name;
         } else {
             this.packageName = JavaIdentifierNormalizer.normalizeFullPackageName(pkName);
-            Preconditions.checkNotNull(context, "In case of not having identifiers normalized, " +
-                    "ModuleContext instance must be provided.");
+            Preconditions.checkNotNull(context,
+                "In case of not having identifiers normalized, ModuleContext instance must be provided.");
             this.name = JavaIdentifierNormalizer.normalizeClassIdentifier(pkName, name, context);
         }
     }
 
     protected AbstractBaseType(final String pkName, final String name, final boolean isPkNameNormalized,
             this.name = JavaIdentifierNormalizer.normalizeClassIdentifier(pkName, name, context);
         }
     }
 
     protected AbstractBaseType(final String pkName, final String name, final boolean isPkNameNormalized,
-            final boolean isTypeNormalized, ModuleContext context ) {
+            final boolean isTypeNormalized, final ModuleContext context) {
         Preconditions.checkNotNull(pkName, "Package Name for Generated Type cannot be null!");
         Preconditions.checkNotNull(name, "Name of Generated Type cannot be null!");
         if (isPkNameNormalized) {
         Preconditions.checkNotNull(pkName, "Package Name for Generated Type cannot be null!");
         Preconditions.checkNotNull(name, "Name of Generated Type cannot be null!");
         if (isPkNameNormalized) {
@@ -89,8 +89,8 @@ public abstract class AbstractBaseType implements Type {
         if (isTypeNormalized) {
             this.name = name;
         } else {
         if (isTypeNormalized) {
             this.name = name;
         } else {
-            Preconditions.checkNotNull(context, "In case of not having identifiers normalized, " +
-                    "ModuleContext instance must be provided.");
+            Preconditions.checkNotNull(context,
+                "In case of not having identifiers normalized ModuleContext instance must be provided.");
             this.name = JavaIdentifierNormalizer.normalizeClassIdentifier(pkName, name, context);
         }
     }
             this.name = JavaIdentifierNormalizer.normalizeClassIdentifier(pkName, name, context);
         }
     }
index 1c3a6d59604a43848ba1b91dc75b359a5343d320..10e59a980ccbb12228c3cb512da741679fe9fe8a 100644 (file)
@@ -99,7 +99,7 @@ public final class BindingGeneratorUtil {
     }
 
     /**
     }
 
     /**
-     * Encodes angle brackets in yang statement description
+     * Encodes angle brackets in yang statement description.
      * @param description description of a yang statement which is used to generate javadoc comments
      * @return string with encoded angle brackets
      */
      * @param description description of a yang statement which is used to generate javadoc comments
      * @return string with encoded angle brackets
      */
@@ -114,7 +114,7 @@ public final class BindingGeneratorUtil {
 
     public static long computeDefaultSUID(final GeneratedTypeBuilderBase<?> to) {
         final ByteArrayOutputStream bout = new ByteArrayOutputStream();
 
     public static long computeDefaultSUID(final GeneratedTypeBuilderBase<?> to) {
         final ByteArrayOutputStream bout = new ByteArrayOutputStream();
-        try (final DataOutputStream dout = new DataOutputStream(bout)) {
+        try (DataOutputStream dout = new DataOutputStream(bout)) {
             dout.writeUTF(to.getName());
             dout.writeInt(to.isAbstract() ? 3 : 7);
 
             dout.writeUTF(to.getName());
             dout.writeInt(to.isAbstract() ? 3 : 7);
 
@@ -150,10 +150,12 @@ public final class BindingGeneratorUtil {
      * Creates package name from specified <code>basePackageName</code> (package
      * name for module) and <code>schemaPath</code>.
      *
      * Creates package name from specified <code>basePackageName</code> (package
      * name for module) and <code>schemaPath</code>.
      *
+     * <p>
      * Resulting package name is concatenation of <code>basePackageName</code>
      * and all local names of YANG nodes which are parents of some node for
      * which <code>schemaPath</code> is specified.
      *
      * Resulting package name is concatenation of <code>basePackageName</code>
      * and all local names of YANG nodes which are parents of some node for
      * which <code>schemaPath</code> is specified.
      *
+     * <p>
      * Based on type of node, there is also possible suffix added in order
      * to prevent package name conflicts.
      *
      * Based on type of node, there is also possible suffix added in order
      * to prevent package name conflicts.
      *
@@ -175,9 +177,7 @@ public final class BindingGeneratorUtil {
         if (size <= 0) {
             if (namespaceType != null) {
                 final StringBuilder sb = new StringBuilder();
         if (size <= 0) {
             if (namespaceType != null) {
                 final StringBuilder sb = new StringBuilder();
-                sb.append(basePackageName)
-                  .append('.')
-                  .append(namespaceType.getPackagePrefix());
+                sb.append(basePackageName).append('.').append(namespaceType.getPackagePrefix());
                 return JavaIdentifierNormalizer.normalizeFullPackageName(sb.toString());
             }
             return JavaIdentifierNormalizer.normalizeFullPackageName(basePackageName);
                 return JavaIdentifierNormalizer.normalizeFullPackageName(sb.toString());
             }
             return JavaIdentifierNormalizer.normalizeFullPackageName(basePackageName);
@@ -190,6 +190,7 @@ public final class BindingGeneratorUtil {
      * Creates package name from specified <code>basePackageName</code> (package
      * name for module) and <code>namespaceType</code>.
      *
      * Creates package name from specified <code>basePackageName</code> (package
      * name for module) and <code>namespaceType</code>.
      *
+     * <p>
      * Resulting package name is concatenation of <code>basePackageName</code>
      * and prefix of <code>namespaceType</code>.
      *
      * Resulting package name is concatenation of <code>basePackageName</code>
      * and prefix of <code>namespaceType</code>.
      *
@@ -316,14 +317,17 @@ public final class BindingGeneratorUtil {
             public Optional<? extends RangeConstraint<?>> getRangeConstraint() {
                 return range;
             }
             public Optional<? extends RangeConstraint<?>> getRangeConstraint() {
                 return range;
             }
+
             @Override
             public List<PatternConstraint> getPatternConstraints() {
                 return pattern;
             }
             @Override
             public List<PatternConstraint> getPatternConstraints() {
                 return pattern;
             }
+
             @Override
             public Optional<LengthConstraint> getLengthConstraint() {
                 return length;
             }
             @Override
             public Optional<LengthConstraint> getLengthConstraint() {
                 return length;
             }
+
             @Override
             public boolean isEmpty() {
                 return false;
             @Override
             public boolean isEmpty() {
                 return false;
@@ -335,10 +339,12 @@ public final class BindingGeneratorUtil {
      * Creates package name from specified <code>basePackageName</code> (package
      * name for module) and <code>schemaPath</code> which crosses an augmentation.
      *
      * Creates package name from specified <code>basePackageName</code> (package
      * name for module) and <code>schemaPath</code> which crosses an augmentation.
      *
+     * <p>
      * Resulting package name is concatenation of <code>basePackageName</code>
      * and all local names of YANG nodes which are parents of some node for
      * which <code>schemaPath</code> is specified.
      *
      * Resulting package name is concatenation of <code>basePackageName</code>
      * and all local names of YANG nodes which are parents of some node for
      * which <code>schemaPath</code> is specified.
      *
+     * <p>
      * Based on type of node, there is also possible suffix added in order
      * to prevent package name conflicts.
      *
      * Based on type of node, there is also possible suffix added in order
      * to prevent package name conflicts.
      *
@@ -351,7 +357,8 @@ public final class BindingGeneratorUtil {
      * @return string with valid JAVA package name
      * @throws NullPointerException if any of the arguments are null
      */
      * @return string with valid JAVA package name
      * @throws NullPointerException if any of the arguments are null
      */
-    public static String packageNameForAugmentedGeneratedType(final String basePackageName, final SchemaPath schemaPath) {
+    public static String packageNameForAugmentedGeneratedType(final String basePackageName,
+            final SchemaPath schemaPath) {
         final Iterable<QName> pathTowardsRoot = schemaPath.getPathTowardsRoot();
         final Iterable<QName> pathFromRoot = schemaPath.getPathFromRoot();
         final int size = Iterables.size(pathTowardsRoot);
         final Iterable<QName> pathTowardsRoot = schemaPath.getPathTowardsRoot();
         final Iterable<QName> pathFromRoot = schemaPath.getPathFromRoot();
         final int size = Iterables.size(pathTowardsRoot);
@@ -366,9 +373,11 @@ public final class BindingGeneratorUtil {
      * Creates package name from <code>parentAugmentPackageName</code> (package
      * name for direct parent augmentation) and <code>augmentationSchema</code> .
      *
      * Creates package name from <code>parentAugmentPackageName</code> (package
      * name for direct parent augmentation) and <code>augmentationSchema</code> .
      *
+     * <p>
      * Resulting package name is concatenation of <code>parentAugmentPackageName</code>
      * and the local name of <code>schemaPath</code>.
      *
      * Resulting package name is concatenation of <code>parentAugmentPackageName</code>
      * and the local name of <code>schemaPath</code>.
      *
+     * <p>
      * Based on type of node, there is also possible suffix added in order
      * to prevent package name conflicts.
      *
      * Based on type of node, there is also possible suffix added in order
      * to prevent package name conflicts.
      *
@@ -511,7 +520,7 @@ public final class BindingGeneratorUtil {
         return def.getRangeConstraint();
     }
 
         return def.getRangeConstraint();
     }
 
-    public static String replaceAllIllegalChars(final CharSequence stringBuilder){
+    public static String replaceAllIllegalChars(final CharSequence stringBuilder) {
         final String ret = UNICODE_CHAR_PATTERN.matcher(stringBuilder).replaceAll("\\\\\\\\u");
         return ret.isEmpty() ? "" : ret;
     }
         final String ret = UNICODE_CHAR_PATTERN.matcher(stringBuilder).replaceAll("\\\\\\\\u");
         return ret.isEmpty() ? "" : ret;
     }
index c10619650e2ded9ddd3b6bfee6062f5a11396889..756b56e2aa3a330452ead1674cc9f5fa92047472 100644 (file)
@@ -32,8 +32,8 @@ import org.opendaylight.mdsal.binding.javav2.spec.runtime.NotificationListener;
 import org.opendaylight.mdsal.binding.javav2.spec.structural.Augmentable;
 import org.opendaylight.mdsal.binding.javav2.spec.structural.Augmentation;
 import org.opendaylight.mdsal.binding.javav2.spec.structural.TreeChildNode;
 import org.opendaylight.mdsal.binding.javav2.spec.structural.Augmentable;
 import org.opendaylight.mdsal.binding.javav2.spec.structural.Augmentation;
 import org.opendaylight.mdsal.binding.javav2.spec.structural.TreeChildNode;
-import org.opendaylight.yangtools.concepts.Identifier;
 import org.opendaylight.yangtools.concepts.Identifiable;
 import org.opendaylight.yangtools.concepts.Identifiable;
+import org.opendaylight.yangtools.concepts.Identifier;
 
 public final class BindingTypes {
 
 
 public final class BindingTypes {
 
@@ -62,7 +62,7 @@ public final class BindingTypes {
         throw new UnsupportedOperationException("Utility class");
     }
 
         throw new UnsupportedOperationException("Utility class");
     }
 
-    public static ParameterizedType augmentable(Type t) {
-        return parameterizedTypeFor(AUGMENTABLE, t);
+    public static ParameterizedType augmentable(Type type) {
+        return parameterizedTypeFor(AUGMENTABLE, type);
     }
 }
     }
 }
index 440f27085cdd9df76d447cf8da5cca71d1066566..3045f8664f08b660d5336d679e88e138eae9ff57 100644 (file)
@@ -17,7 +17,7 @@ import javax.annotation.RegEx;
 import org.opendaylight.yangtools.yang.common.QName;
 
 /**
 import org.opendaylight.yangtools.yang.common.QName;
 
 /**
- * Util class
+ * Util class.
  */
 @Beta
 public final class FormattingUtils {
  */
 @Beta
 public final class FormattingUtils {
@@ -48,7 +48,7 @@ public final class FormattingUtils {
     }
 
     /**
     }
 
     /**
-     * Used in #yangtemplateformodule.scala.txt for formating revision description
+     * Used in #yangtemplateformodule.scala.txt for formating revision description.
      *
      * @param text Content of tag description
      * @param nextLineIndent Number of spaces from left side default is 12
      *
      * @param text Content of tag description
      * @param nextLineIndent Number of spaces from left side default is 12
@@ -99,7 +99,7 @@ public final class FormattingUtils {
     }
 
     /**
     }
 
     /**
-     * Used in all yangtemplates for formating augmentation target
+     * Used in all yangtemplates for formating augmentation target.
      *
      * @param schemaPath path to augmented node
      * @return path in string format
      *
      * @param schemaPath path to augmented node
      * @return path in string format
index d1933db21dfe0fa63ae2ed9a2402f8de6cce5610..06d6d05abed7d2d853f6f4aaaf789b9309d25fac 100644 (file)
@@ -20,7 +20,7 @@ import com.google.common.annotations.Beta;
  * <li>variable</li>
  * <li>constant</li>
  * <li>package</li>
  * <li>variable</li>
  * <li>constant</li>
  * <li>package</li>
- * </ul>
+ * </ul>.
  */
 @Beta
 public enum JavaIdentifier {
  */
 @Beta
 public enum JavaIdentifier {
index ea090f72db6a59056661a424583a4a42fd925392..714807bd8332b7b0399138a7562436ef12c4d091 100644 (file)
@@ -122,6 +122,7 @@ import org.opendaylight.mdsal.binding.javav2.util.BindingMapping;
  * </li>
  * </ul>
  *
  * </li>
  * </ul>
  *
+ * <p>
  * There is special case in CLASS, INTERFACE, ENUM, ENUM VALUE, CONSTANT, METHOD
  * and VARIABLE if identifier contains single dash - then the converter ignores
  * the single dash in the way of the non-java chars. In other way, if dash is
  * There is special case in CLASS, INTERFACE, ENUM, ENUM VALUE, CONSTANT, METHOD
  * and VARIABLE if identifier contains single dash - then the converter ignores
  * the single dash in the way of the non-java chars. In other way, if dash is
@@ -158,6 +159,7 @@ import org.opendaylight.mdsal.binding.javav2.util.BindingMapping;
  * </li>
  * </ul>
  *
  * </li>
  * </ul>
  *
+ * <p>
  * Next special case talks about normalizing class name which already exists in
  * package - but with different camel cases (foo, Foo, fOo, ...). To every next
  * classes with same names will by added their actual rank (serial number),
  * Next special case talks about normalizing class name which already exists in
  * package - but with different camel cases (foo, Foo, fOo, ...). To every next
  * classes with same names will by added their actual rank (serial number),
@@ -245,6 +247,7 @@ public final class JavaIdentifierNormalizer {
      * }
      * </pre>
      *
      * }
      * </pre>
      *
+     * <p>
      * YANG enum values will be mapped to 'FOO' and 'FOO_1' Java enum values.
      *
      * @param name
      * YANG enum values will be mapped to 'FOO' and 'FOO_1' Java enum values.
      *
      * @param name
@@ -361,6 +364,39 @@ public final class JavaIdentifierNormalizer {
         return normalizeClassIdentifier(basePackageName, convertedClassName, convertedClassName, 1, context);
     }
 
         return normalizeClassIdentifier(basePackageName, convertedClassName, convertedClassName, 1, context);
     }
 
+    /**
+     * Checking while there doesn't exist any class name with the same name
+     * (regardless of camel cases) in package.
+     *
+     * @param packageName
+     *            - package of class name
+     * @param origClassName
+     *            - original class name
+     * @param actualClassName
+     *            - actual class name with rank (serial number)
+     * @param rank
+     *            - actual rank (serial number)
+     * @return converted identifier
+     */
+    private static String normalizeClassIdentifier(final String packageName, final String origClassName,
+            final String actualClassName, final int rank, final ModuleContext context) {
+
+        final ListMultimap<String, String> packagesMap = context.getPackagesMap();
+
+        synchronized (packagesMap) {
+            if (packagesMap.containsKey(packageName)) {
+                for (final String existingName : packagesMap.get(packageName)) {
+                    if (actualClassName.equalsIgnoreCase(existingName)) {
+                        return normalizeClassIdentifier(packageName, origClassName, origClassName + rank,
+                                rank + 1, context);
+                    }
+                }
+            }
+            context.putToPackagesMap(packageName, actualClassName);
+            return actualClassName;
+        }
+    }
+
     /**
      * Find and convert non Java chars in identifiers of generated transfer objects, initially
      * derived from corresponding YANG.
     /**
      * Find and convert non Java chars in identifiers of generated transfer objects, initially
      * derived from corresponding YANG.
@@ -413,40 +449,7 @@ public final class JavaIdentifierNormalizer {
     }
 
     /**
     }
 
     /**
-     * Checking while there doesn't exist any class name with the same name
-     * (regardless of camel cases) in package.
-     *
-     * @param packageName
-     *            - package of class name
-     * @param origClassName
-     *            - original class name
-     * @param actualClassName
-     *            - actual class name with rank (serial number)
-     * @param rank
-     *            - actual rank (serial number)
-     * @return converted identifier
-     */
-    private static String normalizeClassIdentifier(final String packageName, final String origClassName,
-            final String actualClassName, final int rank, final ModuleContext context) {
-
-        final ListMultimap<String, String> packagesMap = context.getPackagesMap();
-
-        synchronized (packagesMap) {
-            if (packagesMap.containsKey(packageName)) {
-                for (final String existingName : packagesMap.get(packageName)) {
-                    if (actualClassName.equalsIgnoreCase(existingName)) {
-                       return normalizeClassIdentifier(packageName, origClassName, origClassName + rank,
-                           rank + 1, context);
-                    }
-                }
-            }
-            context.putToPackagesMap(packageName, actualClassName);
-            return actualClassName;
-        }
-    }
-
-    /**
-     * Fix cases of converted identifiers by Java type
+     * Fix cases of converted identifiers by Java type.
      *
      * @param convertedIdentifier
      *            - converted identifier
      *
      * @param convertedIdentifier
      *            - converted identifier
@@ -495,7 +498,7 @@ public final class JavaIdentifierNormalizer {
     }
 
     /**
     }
 
     /**
-     * Check if there exist next char in identifier behind actual char position
+     * Check if there exist next char in identifier behind actual char position.
      *
      * @param identifier
      *            - original identifier
      *
      * @param identifier
      *            - original identifier
@@ -509,24 +512,24 @@ public final class JavaIdentifierNormalizer {
 
     /**
      * Converting first char of identifier. This happen only if this char is
 
     /**
      * Converting first char of identifier. This happen only if this char is
-     * non-java char
+     * non-java char.
      *
      *
-     * @param c
+     * @param firstChar
      *            - first char
      * @param existNext
      *            - existing of next char behind actual char
      * @return converted char
      */
      *            - first char
      * @param existNext
      *            - existing of next char behind actual char
      * @return converted char
      */
-    private static String convertFirst(final char c, final boolean existNext) {
-        final String name = DASH_OR_SPACE_MATCHER.replaceFrom(Character.getName(c), UNDERSCORE);
+    private static String convertFirst(final char firstChar, final boolean existNext) {
+        final String name = DASH_OR_SPACE_MATCHER.replaceFrom(Character.getName(firstChar), UNDERSCORE);
         return existNext ? name + '_' : name;
     }
 
     /**
      * Converting any char in java identifier, This happen only if this char is
         return existNext ? name + '_' : name;
     }
 
     /**
      * Converting any char in java identifier, This happen only if this char is
-     * non-java char
+     * non-java char.
      *
      *
-     * @param c
+     * @param actualChar
      *            - actual char
      * @param existNext
      *            - existing of next char behind actual char
      *            - actual char
      * @param existNext
      *            - existing of next char behind actual char
@@ -534,12 +537,12 @@ public final class JavaIdentifierNormalizer {
      *            - last char of partial converted identifier
      * @return converted char
      */
      *            - last char of partial converted identifier
      * @return converted char
      */
-    private static String convert(final char c, final boolean existNext, final char partialLastChar) {
-        return partialLastChar == '_' ? convertFirst(c, existNext) : "_" + convertFirst(c, existNext);
+    private static String convert(final char actualChar, final boolean existNext, final char partialLastChar) {
+        return partialLastChar == '_' ? convertFirst(actualChar, existNext) : "_" + convertFirst(actualChar, existNext);
     }
 
     /**
     }
 
     /**
-     * Capitalize input string
+     * Capitalize input string.
      *
      * @param identifier
      *            - string to be capitalized
      *
      * @param identifier
      *            - string to be capitalized
index 66fb631dd03f0758db4cdd50d465a9442d6cc435..2a326a46f80042b4f0bdfd544d992727cb2ff3cc 100644 (file)
@@ -11,15 +11,14 @@ package org.opendaylight.mdsal.binding.javav2.generator.util;
 import org.opendaylight.mdsal.binding.javav2.generator.context.ModuleContext;
 
 /**
 import org.opendaylight.mdsal.binding.javav2.generator.context.ModuleContext;
 
 /**
- *
  * Wraps combination of <code>packageName</code> and <code>name</code> to the
  * Wraps combination of <code>packageName</code> and <code>name</code> to the
- * object representation
+ * object representation.
  *
  */
 public final class ReferencedTypeImpl extends AbstractBaseType {
 
     /**
  *
  */
 public final class ReferencedTypeImpl extends AbstractBaseType {
 
     /**
-     * Creates instance of this class with concrete package name and type name
+     * Creates instance of this class with concrete package name and type name.
      *
      * @param packageName
      *            string with the package name
      *
      * @param packageName
      *            string with the package name
@@ -32,7 +31,7 @@ public final class ReferencedTypeImpl extends AbstractBaseType {
 
     /**
      * Creates instance of this class with concrete package name and type name
 
     /**
      * Creates instance of this class with concrete package name and type name
-     * for already normalized identifier
+     * for already normalized identifier.
      *
      * @param packageName
      *            string with the package name
      *
      * @param packageName
      *            string with the package name
index 0bf2f9a56920a4b2810eae825564025a2e8afe95..9543ea5646a87532b6a9fb8c16343f1108980536 100644 (file)
@@ -32,6 +32,10 @@ public final class TypeComments {
             .addEscape('@', "&#64;").build();
     private static final Pattern TAIL_COMMENT_PATTERN = Pattern.compile("*/", Pattern.LITERAL);
 
             .addEscape('@', "&#64;").build();
     private static final Pattern TAIL_COMMENT_PATTERN = Pattern.compile("*/", Pattern.LITERAL);
 
+    private TypeComments() {
+        //Defeat initialization.
+    }
+
     /**
      * Create a {@link TypeComment} for a javadoc-compliant text snippet. This snippet must be eligible for direct
      * inclusion in a Java comment without further escaping.
     /**
      * Create a {@link TypeComment} for a javadoc-compliant text snippet. This snippet must be eligible for direct
      * inclusion in a Java comment without further escaping.
index a51ece91afc3f12f3429d0cc329663c2fd936075..33f9aa5742b647f435144841582cdc3d3443eb8f 100644 (file)
@@ -20,12 +20,14 @@ import com.google.common.collect.ImmutableRangeSet;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Range;
 import com.google.common.collect.RangeSet;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Range;
 import com.google.common.collect.RangeSet;
+
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 import java.util.Set;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 import java.util.Set;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
+
 import org.opendaylight.mdsal.binding.javav2.generator.context.ModuleContext;
 import org.opendaylight.mdsal.binding.javav2.model.api.BaseTypeWithRestrictions;
 import org.opendaylight.mdsal.binding.javav2.model.api.ConcreteType;
 import org.opendaylight.mdsal.binding.javav2.generator.context.ModuleContext;
 import org.opendaylight.mdsal.binding.javav2.model.api.BaseTypeWithRestrictions;
 import org.opendaylight.mdsal.binding.javav2.model.api.ConcreteType;
@@ -43,13 +45,13 @@ import org.w3c.dom.Document;
 @Beta
 public final class Types {
     private static final CacheLoader<Class<?>, ConcreteType> TYPE_LOADER =
 @Beta
 public final class Types {
     private static final CacheLoader<Class<?>, ConcreteType> TYPE_LOADER =
-            new CacheLoader<Class<?>, ConcreteType>() {
+        new CacheLoader<Class<?>, ConcreteType>() {
 
 
-                @Override
-                public ConcreteType load(@Nonnull final Class<?> key) throws Exception {
-                    return new ConcreteTypeImpl(key.getPackage().getName(), key.getSimpleName(), null);
-                }
-            };
+            @Override
+            public ConcreteType load(@Nonnull final Class<?> key) throws Exception {
+                return new ConcreteTypeImpl(key.getPackage().getName(), key.getSimpleName(), null);
+            }
+        };
 
     private static final LoadingCache<Class<?>, ConcreteType> TYPE_CACHE =
             CacheBuilder.newBuilder().weakKeys().build(TYPE_LOADER);
 
     private static final LoadingCache<Class<?>, ConcreteType> TYPE_CACHE =
             CacheBuilder.newBuilder().weakKeys().build(TYPE_LOADER);
@@ -78,7 +80,7 @@ public final class Types {
      * ConcreteType} which represents JAVA <code>void</code> type.
      *
      * @return <code>ConcreteType</code> instance which represents JAVA
      * ConcreteType} which represents JAVA <code>void</code> type.
      *
      * @return <code>ConcreteType</code> instance which represents JAVA
-     *         <code>void</code>
+     * <code>void</code>
      */
     public static ConcreteType voidType() {
         return VOID;
      */
     public static ConcreteType voidType() {
         return VOID;
@@ -90,21 +92,19 @@ public final class Types {
      * ConcreteType} which represents primitive JAVA type for which package
      * doesn't exist.
      *
      * ConcreteType} which represents primitive JAVA type for which package
      * doesn't exist.
      *
-     * @param primitiveType
-     *            string containing programmatic construction based on
-     *            primitive type (e.g byte[])
+     * @param primitiveType string containing programmatic construction based on
+     *                      primitive type (e.g byte[])
      * @return <code>ConcreteType</code> instance which represents programmatic
      * @return <code>ConcreteType</code> instance which represents programmatic
-     *         construction with primitive JAVA type
+     *      construction with primitive JAVA type
      */
     public static ConcreteType primitiveType(final String primitiveType, final Restrictions restrictions) {
         return new ConcreteTypeImpl("", primitiveType, restrictions);
     }
 
     /**
      */
     public static ConcreteType primitiveType(final String primitiveType, final Restrictions restrictions) {
         return new ConcreteTypeImpl("", primitiveType, restrictions);
     }
 
     /**
-     * Returns an instance of {@link ConcreteType} describing the class
+     * Returns an instance of {@link ConcreteType} describing the class.
      *
      *
-     * @param cls
-     *            Class to describe
+     * @param cls Class to describe
      * @return Description of class
      */
     public static ConcreteType typeForClass(final Class<?> cls) {
      * @return Description of class
      */
     public static ConcreteType typeForClass(final Class<?> cls) {
@@ -124,7 +124,7 @@ public final class Types {
     }
 
     public static ConcreteType typeForClass(final Class<?> cls, final Restrictions restrictions,
     }
 
     public static ConcreteType typeForClass(final Class<?> cls, final Restrictions restrictions,
-            final ModuleContext moduleContext) {
+                                            final ModuleContext moduleContext) {
         if (restrictions == null) {
             return typeForClass(cls);
         }
         if (restrictions == null) {
             return typeForClass(cls);
         }
@@ -132,18 +132,16 @@ public final class Types {
             return new ConcreteTypeImpl(cls.getPackage().getName(), cls.getSimpleName(), restrictions);
         } else {
             return new BaseTypeWithRestrictionsImpl(cls.getPackage().getName(), cls.getSimpleName(), restrictions,
             return new ConcreteTypeImpl(cls.getPackage().getName(), cls.getSimpleName(), restrictions);
         } else {
             return new BaseTypeWithRestrictionsImpl(cls.getPackage().getName(), cls.getSimpleName(), restrictions,
-                moduleContext);
+                    moduleContext);
         }
     }
 
     /**
         }
     }
 
     /**
-     * Returns an instance of {@link ParameterizedType} describing the typed
+     * Returns an instance of {@link ParameterizedType} describing the typed.
      * {@link Map}&lt;K,V&gt;
      *
      * {@link Map}&lt;K,V&gt;
      *
-     * @param keyType
-     *            Key Type
-     * @param valueType
-     *            Value Type
+     * @param keyType   Key Type
+     * @param valueType Value Type
      * @return Description of generic type instance
      */
     public static ParameterizedType mapTypeFor(final Type keyType, final Type valueType) {
      * @return Description of generic type instance
      */
     public static ParameterizedType mapTypeFor(final Type keyType, final Type valueType) {
@@ -154,8 +152,7 @@ public final class Types {
      * Returns an instance of {@link ParameterizedType} describing the typed
      * {@link Set}&lt;V&gt; with concrete type of value.
      *
      * Returns an instance of {@link ParameterizedType} describing the typed
      * {@link Set}&lt;V&gt; with concrete type of value.
      *
-     * @param valueType
-     *            Value Type
+     * @param valueType Value Type
      * @return Description of generic type instance of Set
      */
     public static ParameterizedType setTypeFor(final Type valueType) {
      * @return Description of generic type instance of Set
      */
     public static ParameterizedType setTypeFor(final Type valueType) {
@@ -166,8 +163,7 @@ public final class Types {
      * Returns an instance of {@link ParameterizedType} describing the typed
      * {@link List}&lt;V&gt; with concrete type of value.
      *
      * Returns an instance of {@link ParameterizedType} describing the typed
      * {@link List}&lt;V&gt; with concrete type of value.
      *
-     * @param valueType
-     *            Value Type
+     * @param valueType Value Type
      * @return Description of type instance of List
      */
     public static ParameterizedType listTypeFor(final Type valueType) {
      * @return Description of type instance of List
      */
     public static ParameterizedType listTypeFor(final Type valueType) {
@@ -175,55 +171,42 @@ public final class Types {
     }
 
     /**
     }
 
     /**
-     * Creates instance of type
-     * {@link ParameterizedType
-     * ParameterizedType}
+     * Creates instance of type {@link ParameterizedType ParameterizedType}.
      *
      *
-     * @param type
-     *            JAVA <code>Type</code> for raw type
-     * @param parameters
-     *            JAVA <code>Type</code>s for actual parameter types
+     * @param type       JAVA <code>Type</code> for raw type
+     * @param parameters JAVA <code>Type</code>s for actual parameter types
      * @return <code>ParametrizedType</code> reprezentation of <code>type</code>
      * @return <code>ParametrizedType</code> reprezentation of <code>type</code>
-     *         and its parameters <code>parameters</code>
+     *      and its parameters <code>parameters</code>
      */
     public static ParameterizedType parameterizedTypeFor(final Type type, final Type... parameters) {
         return new ParameterizedTypeImpl(type, parameters);
     }
 
     /**
      */
     public static ParameterizedType parameterizedTypeFor(final Type type, final Type... parameters) {
         return new ParameterizedTypeImpl(type, parameters);
     }
 
     /**
-     * Creates instance of type
-     * {@link WildcardType
-     * WildcardType}
+     * Creates instance of type {@link WildcardType WildcardType}.
      *
      *
-     * @param packageName
-     *            string with the package name
-     * @param typeName
-     *            string with the type name
+     * @param packageName string with the package name
+     * @param typeName    string with the type name
      * @return <code>WildcardType</code> representation of
      * @return <code>WildcardType</code> representation of
-     *         <code>packageName</code> and <code>typeName</code>
+     * <code>packageName</code> and <code>typeName</code>
      */
     public static WildcardType wildcardTypeFor(final String packageName, final String typeName) {
         return new WildcardTypeImpl(packageName, typeName);
     }
 
     /**
      */
     public static WildcardType wildcardTypeFor(final String packageName, final String typeName) {
         return new WildcardTypeImpl(packageName, typeName);
     }
 
     /**
-     * Creates instance of type
-     * {@link WildcardType
-     * WildcardType}
+     * Creates instance of type {@link WildcardType WildcardType}.
      *
      *
-     * @param packageName
-     *            string with the package name
-     * @param typeName
-     *            string with the type name
-     * @param isPkNameNormalized
-     *            if the package name has been normalized
-     * @param isTypeNormalized
-     *            if the type name has been normalized
+     * @param packageName        string with the package name
+     * @param typeName           string with the type name
+     * @param isPkNameNormalized if the package name has been normalized
+     * @param isTypeNormalized   if the type name has been normalized
      * @return <code>WildcardType</code> representation of
      * @return <code>WildcardType</code> representation of
-     *         <code>packageName</code> and <code>typeName</code>
+     * <code>packageName</code> and <code>typeName</code>
      */
     public static WildcardType wildcardTypeFor(final String packageName, final String typeName,
      */
     public static WildcardType wildcardTypeFor(final String packageName, final String typeName,
-            final boolean isPkNameNormalized, final boolean isTypeNormalized, final ModuleContext context) {
+                                               final boolean isPkNameNormalized, final boolean isTypeNormalized,
+                                               final ModuleContext context) {
         return new WildcardTypeImpl(packageName, typeName, isPkNameNormalized, isTypeNormalized, context);
     }
 
         return new WildcardTypeImpl(packageName, typeName, isPkNameNormalized, isTypeNormalized, context);
     }
 
@@ -234,11 +217,10 @@ public final class Types {
      * {@link Augmentable} and actual
      * parameter is <code>valueType</code>.
      *
      * {@link Augmentable} and actual
      * parameter is <code>valueType</code>.
      *
-     * @param valueType
-     *            JAVA <code>Type</code> with actual parameter
+     * @param valueType JAVA <code>Type</code> with actual parameter
      * @return <code>ParametrizedType</code> representation of raw type
      * @return <code>ParametrizedType</code> representation of raw type
-     *         <code>Augmentable</code> with actual parameter
-     *         <code>valueType</code>
+     * <code>Augmentable</code> with actual parameter
+     * <code>valueType</code>
      */
     public static ParameterizedType augmentableTypeFor(final Type valueType) {
         final Type augmentable = typeForClass(Augmentable.class);
      */
     public static ParameterizedType augmentableTypeFor(final Type valueType) {
         final Type augmentable = typeForClass(Augmentable.class);
@@ -252,11 +234,10 @@ public final class Types {
      * {@link Augmentation} and actual
      * parameter is <code>valueType</code>.
      *
      * {@link Augmentation} and actual
      * parameter is <code>valueType</code>.
      *
-     * @param valueType
-     *            JAVA <code>Type</code> with actual parameter
+     * @param valueType JAVA <code>Type</code> with actual parameter
      * @return <code>ParametrizedType</code> reprezentation of raw type
      * @return <code>ParametrizedType</code> reprezentation of raw type
-     *         <code>Augmentation</code> with actual parameter
-     *         <code>valueType</code>
+     * <code>Augmentation</code> with actual parameter
+     * <code>valueType</code>
      */
     public static ParameterizedType augmentationTypeFor(final Type valueType) {
         final Type augmentation = typeForClass(Augmentation.class);
      */
     public static ParameterizedType augmentationTypeFor(final Type valueType) {
         final Type augmentation = typeForClass(Augmentation.class);
@@ -285,9 +266,7 @@ public final class Types {
     }
 
     /**
     }
 
     /**
-     *
      * Represents concrete JAVA type.
      * Represents concrete JAVA type.
-     *
      */
     private static final class ConcreteTypeImpl extends AbstractBaseType implements ConcreteType {
 
      */
     private static final class ConcreteTypeImpl extends AbstractBaseType implements ConcreteType {
 
@@ -297,13 +276,11 @@ public final class Types {
          * Creates instance of this class with package <code>pkName</code> and
          * with the type name <code>name</code>.
          *
          * Creates instance of this class with package <code>pkName</code> and
          * with the type name <code>name</code>.
          *
-         * @param pkName
-         *            string with package name
-         * @param name
-         *            string with the name of the type
+         * @param pkName string with package name
+         * @param name   string with the name of the type
          */
         private ConcreteTypeImpl(final String pkName, final String name, final Restrictions restrictions) {
          */
         private ConcreteTypeImpl(final String pkName, final String name, final Restrictions restrictions) {
-            super(pkName, name, true,null);
+            super(pkName, name, true, null);
             this.restrictions = restrictions;
         }
 
             this.restrictions = restrictions;
         }
 
@@ -314,21 +291,18 @@ public final class Types {
     }
 
     /**
     }
 
     /**
-     *
      * Represents concrete JAVA type with changed restriction values.
      * Represents concrete JAVA type with changed restriction values.
-     *
      */
      */
-    private static final class BaseTypeWithRestrictionsImpl extends AbstractBaseType implements BaseTypeWithRestrictions {
+    private static final class BaseTypeWithRestrictionsImpl extends AbstractBaseType implements
+            BaseTypeWithRestrictions {
         private final Restrictions restrictions;
 
         /**
          * Creates instance of this class with package <code>pkName</code> and
          * with the type name <code>name</code>.
          *
         private final Restrictions restrictions;
 
         /**
          * Creates instance of this class with package <code>pkName</code> and
          * with the type name <code>name</code>.
          *
-         * @param pkName
-         *            string with package name
-         * @param name
-         *            string with the name of the type
+         * @param pkName string with package name
+         * @param name   string with the name of the type
          */
         private BaseTypeWithRestrictionsImpl(final String pkName, final String name, final Restrictions restrictions) {
             super(pkName, name, null);
          */
         private BaseTypeWithRestrictionsImpl(final String pkName, final String name, final Restrictions restrictions) {
             super(pkName, name, null);
@@ -336,7 +310,7 @@ public final class Types {
         }
 
         private BaseTypeWithRestrictionsImpl(final String pkName, final String name, final Restrictions restrictions,
         }
 
         private BaseTypeWithRestrictionsImpl(final String pkName, final String name, final Restrictions restrictions,
-                final ModuleContext moduleContext) {
+                                             final ModuleContext moduleContext) {
             super(pkName, name, moduleContext);
             this.restrictions = Preconditions.checkNotNull(restrictions);
         }
             super(pkName, name, moduleContext);
             this.restrictions = Preconditions.checkNotNull(restrictions);
         }
@@ -348,9 +322,7 @@ public final class Types {
     }
 
     /**
     }
 
     /**
-     *
      * Represents parametrized JAVA type.
      * Represents parametrized JAVA type.
-     *
      */
     private static class ParameterizedTypeImpl extends AbstractBaseType implements ParameterizedType {
         /**
      */
     private static class ParameterizedTypeImpl extends AbstractBaseType implements ParameterizedType {
         /**
@@ -359,7 +331,7 @@ public final class Types {
         private final Type[] actualTypes;
 
         /**
         private final Type[] actualTypes;
 
         /**
-         * JAVA raw type (like List, Set, Map...)
+         * JAVA raw type (like List, Set, Map...).
          */
         private final Type rawType;
 
          */
         private final Type rawType;
 
@@ -367,12 +339,10 @@ public final class Types {
          * Creates instance of this class with concrete rawType and array of
          * actual parameters.
          *
          * Creates instance of this class with concrete rawType and array of
          * actual parameters.
          *
-         * @param rawType
-         *            JAVA <code>Type</code> for raw type
-         * @param actTypes
-         *            array of actual parameters
+         * @param rawType  JAVA <code>Type</code> for raw type
+         * @param actTypes array of actual parameters
          */
          */
-        public ParameterizedTypeImpl(final Type rawType, final Type[] actTypes) {
+        ParameterizedTypeImpl(final Type rawType, final Type[] actTypes) {
             super(rawType.getPackageName(), rawType.getName(), true, null);
             this.rawType = rawType;
             this.actualTypes = actTypes.clone();
             super(rawType.getPackageName(), rawType.getName(), true, null);
             this.rawType = rawType;
             this.actualTypes = actTypes.clone();
@@ -391,44 +361,36 @@ public final class Types {
     }
 
     /**
     }
 
     /**
-     *
      * Represents JAVA bounded wildcard type.
      * Represents JAVA bounded wildcard type.
-     *
      */
     private static class WildcardTypeImpl extends AbstractBaseType implements WildcardType {
         /**
          * Creates instance of this class with concrete package and type name.
          *
      */
     private static class WildcardTypeImpl extends AbstractBaseType implements WildcardType {
         /**
          * Creates instance of this class with concrete package and type name.
          *
-         * @param packageName
-         *            string with the package name
-         * @param typeName
-         *            string with the name of type
+         * @param packageName string with the package name
+         * @param typeName    string with the name of type
          */
         //FIXME: doesn't seem to be called at all
          */
         //FIXME: doesn't seem to be called at all
-        public WildcardTypeImpl(final String packageName, final String typeName) {
+        WildcardTypeImpl(final String packageName, final String typeName) {
             super(packageName, typeName, null);
         }
 
         /**
          * Creates instance of this class with concrete package and type name.
          *
             super(packageName, typeName, null);
         }
 
         /**
          * Creates instance of this class with concrete package and type name.
          *
-         * @param packageName
-         *            string with the package name
-         * @param typeName
-         *            string with the name of type
-         * @param isPkNameNormalized
-         *            if the package name has been normalized
-         * @param isTypeNormalized
-         *            if the type name has been normalized
+         * @param packageName        string with the package name
+         * @param typeName           string with the name of type
+         * @param isPkNameNormalized if the package name has been normalized
+         * @param isTypeNormalized   if the type name has been normalized
          */
          */
-        public WildcardTypeImpl(final String packageName, final String typeName, final boolean isPkNameNormalized,
-                final boolean isTypeNormalized, final ModuleContext context) {
+        WildcardTypeImpl(final String packageName, final String typeName, final boolean isPkNameNormalized,
+                                final boolean isTypeNormalized, final ModuleContext context) {
             super(packageName, typeName, isPkNameNormalized, isTypeNormalized, context);
         }
     }
 
     public static <T extends Number & Comparable<T>> DefaultRestrictions<T> getDefaultRestrictions(final T min,
             super(packageName, typeName, isPkNameNormalized, isTypeNormalized, context);
         }
     }
 
     public static <T extends Number & Comparable<T>> DefaultRestrictions<T> getDefaultRestrictions(final T min,
-            final T max) {
+                                                                                                   final T max) {
         return new DefaultRestrictions<>(min, max);
     }
 
         return new DefaultRestrictions<>(min, max);
     }
 
index 7b59f87a664d8e6d9c002f93d0b5e3d2821cb2e1..8f60f22bdd807bab934d7176a26504c2c098f3af 100644 (file)
@@ -13,7 +13,7 @@ import javax.annotation.RegEx;
 import org.apache.commons.lang3.StringUtils;
 
 /**
 import org.apache.commons.lang3.StringUtils;
 
 /**
- * Utility class for cleaning yang models of excess whitespaces
+ * Utility class for cleaning yang models of excess whitespaces.
  */
 @Beta
 public final class YangSnippetCleaner {
  */
 @Beta
 public final class YangSnippetCleaner {
@@ -44,7 +44,7 @@ public final class YangSnippetCleaner {
     }
 
     /**
     }
 
     /**
-     * Cleaning yang model of excess whitespaces, adding indentations
+     * Cleaning yang model of excess whitespaces, adding indentations.
      *
      * @param unformedYang
      *            - unformed yang model
      *
      * @param unformedYang
      *            - unformed yang model
@@ -69,7 +69,7 @@ public final class YangSnippetCleaner {
                 indentCount = lineIndent(sb, indentCount, line);
                 sb.append(line).append(NEW_LINE);
                 if (!StringUtils.startsWithAny(line, RESERVED_LINES) && indentCount == 1 && i != 0) {
                 indentCount = lineIndent(sb, indentCount, line);
                 sb.append(line).append(NEW_LINE);
                 if (!StringUtils.startsWithAny(line, RESERVED_LINES) && indentCount == 1 && i != 0) {
-                        sb.append(NEW_LINE);
+                    sb.append(NEW_LINE);
                 }
             }
         }
                 }
             }
         }
@@ -86,11 +86,11 @@ public final class YangSnippetCleaner {
     }
 
     private static int mergeWithPrevious(final StringBuilder sb, final int indentCount) {
     }
 
     private static int mergeWithPrevious(final StringBuilder sb, final int indentCount) {
-        int newIndentCount = indentCount;
         removeRemainingWhitespace(sb);
         sb.append(SPACE);
         sb.append(START_BODY);
         sb.append(NEW_LINE);
         removeRemainingWhitespace(sb);
         sb.append(SPACE);
         sb.append(START_BODY);
         sb.append(NEW_LINE);
+        int newIndentCount = indentCount;
         return ++newIndentCount;
     }
 
         return ++newIndentCount;
     }
 
index fcde49fc840464429bc59a1a478bd995c9e27c3b..b0e6b22568157f75add1e1ad07af11eabaf364a3 100755 (executable)
@@ -10,12 +10,14 @@ package org.opendaylight.mdsal.binding.javav2.generator.util.generated.type.buil
 
 import com.google.common.annotations.Beta;
 import com.google.common.collect.ImmutableList;
 
 import com.google.common.annotations.Beta;
 import com.google.common.collect.ImmutableList;
+
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Objects;
 import java.util.Optional;
 import java.util.stream.Collectors;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Objects;
 import java.util.Optional;
 import java.util.stream.Collectors;
+
 import org.opendaylight.mdsal.binding.javav2.generator.util.AbstractBaseType;
 import org.opendaylight.mdsal.binding.javav2.model.api.AnnotationType;
 import org.opendaylight.mdsal.binding.javav2.model.api.Constant;
 import org.opendaylight.mdsal.binding.javav2.generator.util.AbstractBaseType;
 import org.opendaylight.mdsal.binding.javav2.model.api.AnnotationType;
 import org.opendaylight.mdsal.binding.javav2.model.api.Constant;
@@ -51,7 +53,7 @@ abstract class AbstractGeneratedType extends AbstractBaseType implements Generat
     private final YangSourceDefinition definition;
     private final BindingNamespaceType namespaceType;
 
     private final YangSourceDefinition definition;
     private final BindingNamespaceType namespaceType;
 
-    public AbstractGeneratedType(final AbstractGeneratedTypeBuilder<?> builder) {
+    AbstractGeneratedType(final AbstractGeneratedTypeBuilder<?> builder) {
         super(builder.getPackageName(), builder.getName(), true, null);
         this.parent = builder.getParent();
         this.parentTypeForBuilder = builder.getParentTypeForBuilder();
         super(builder.getPackageName(), builder.getName(), true, null);
         this.parent = builder.getParent();
         this.parentTypeForBuilder = builder.getParentTypeForBuilder();
@@ -80,37 +82,47 @@ abstract class AbstractGeneratedType extends AbstractBaseType implements Generat
         }
     }
 
         }
     }
 
-    private static List<GeneratedType> toUnmodifiableEnclosedTypes(final List<GeneratedTypeBuilder> enclosedGenTypeBuilders,
-                                                                   final List<GeneratedTOBuilder> enclosedGenTOBuilders) {
-        final ArrayList<GeneratedType> enclosedTypesList = new ArrayList<>(enclosedGenTypeBuilders.size() + enclosedGenTOBuilders.size());
-        enclosedTypesList.addAll(enclosedGenTypeBuilders.stream().filter(Objects::nonNull).map(GeneratedTypeBuilder::toInstance).collect(Collectors.toList()));
+    private static List<GeneratedType> toUnmodifiableEnclosedTypes(
+            final List<GeneratedTypeBuilder> enclosedGenTypeBuilders,
+            final List<GeneratedTOBuilder> enclosedGenTOBuilders) {
+        final ArrayList<GeneratedType> enclosedTypesList = new ArrayList<>(enclosedGenTypeBuilders.size()
+                + enclosedGenTOBuilders.size());
+        enclosedTypesList.addAll(enclosedGenTypeBuilders.stream().filter(Objects::nonNull)
+                .map(GeneratedTypeBuilder::toInstance).collect(Collectors.toList()));
 
 
-        enclosedTypesList.addAll(enclosedGenTOBuilders.stream().filter(Objects::nonNull).map(GeneratedTOBuilder::toInstance).collect(Collectors.toList()));
+        enclosedTypesList.addAll(enclosedGenTOBuilders.stream().filter(Objects::nonNull)
+                .map(GeneratedTOBuilder::toInstance).collect(Collectors.toList()));
 
         return makeUnmodifiable(enclosedTypesList);
     }
 
 
         return makeUnmodifiable(enclosedTypesList);
     }
 
-    protected static final List<AnnotationType> toUnmodifiableAnnotations(final List<AnnotationTypeBuilder> annotationBuilders) {
+    protected static final List<AnnotationType> toUnmodifiableAnnotations(final List<AnnotationTypeBuilder>
+                                                                                  annotationBuilders) {
         final List<AnnotationType> annotationList = new ArrayList<>(annotationBuilders.size());
         final List<AnnotationType> annotationList = new ArrayList<>(annotationBuilders.size());
-        annotationList.addAll(annotationBuilders.stream().map(AnnotationTypeBuilder::toInstance).collect(Collectors.toList()));
+        annotationList.addAll(annotationBuilders.stream().map(AnnotationTypeBuilder::toInstance).collect(Collectors
+                .toList()));
         return makeUnmodifiable(annotationList);
     }
 
     protected final List<MethodSignature> toUnmodifiableMethods(final List<MethodSignatureBuilder> methodBuilders) {
         final List<MethodSignature> methods = new ArrayList<>(methodBuilders.size());
         return makeUnmodifiable(annotationList);
     }
 
     protected final List<MethodSignature> toUnmodifiableMethods(final List<MethodSignatureBuilder> methodBuilders) {
         final List<MethodSignature> methods = new ArrayList<>(methodBuilders.size());
-        methods.addAll(methodBuilders.stream().map(methodBuilder -> methodBuilder.toInstance(this)).collect(Collectors.toList()));
+        methods.addAll(methodBuilders.stream().map(methodBuilder -> methodBuilder.toInstance(this))
+                .collect(Collectors.toList()));
         return makeUnmodifiable(methods);
     }
 
     protected final List<Enumeration> toUnmodifiableEnumerations(final List<EnumBuilder> enumBuilders) {
         final List<Enumeration> enums = new ArrayList<>(enumBuilders.size());
         return makeUnmodifiable(methods);
     }
 
     protected final List<Enumeration> toUnmodifiableEnumerations(final List<EnumBuilder> enumBuilders) {
         final List<Enumeration> enums = new ArrayList<>(enumBuilders.size());
-        enums.addAll(enumBuilders.stream().map(enumBuilder -> enumBuilder.toInstance(this)).collect(Collectors.toList()));
+        enums.addAll(enumBuilders.stream().map(enumBuilder -> enumBuilder.toInstance(this))
+                .collect(Collectors.toList()));
         return makeUnmodifiable(enums);
     }
 
         return makeUnmodifiable(enums);
     }
 
-    protected final List<GeneratedProperty> toUnmodifiableProperties(final List<GeneratedPropertyBuilder> methodBuilders) {
+    protected final List<GeneratedProperty> toUnmodifiableProperties(final List<GeneratedPropertyBuilder>
+                                                                             methodBuilders) {
         final List<GeneratedProperty> methods = new ArrayList<>(methodBuilders.size());
         final List<GeneratedProperty> methods = new ArrayList<>(methodBuilders.size());
-        methods.addAll(methodBuilders.stream().map(methodBuilder -> methodBuilder.toInstance(this)).collect(Collectors.toList()));
+        methods.addAll(methodBuilders.stream().map(methodBuilder -> methodBuilder.toInstance(this))
+                .collect(Collectors.toList()));
         return makeUnmodifiable(methods);
     }
 
         return makeUnmodifiable(methods);
     }
 
@@ -192,10 +204,10 @@ abstract class AbstractGeneratedType extends AbstractBaseType implements Generat
         } else {
             builder.append(", parent=null");
         }
         } else {
             builder.append(", parent=null");
         }
-        final TypeComment comment = getComment();
-        if (comment != null) {
+
+        if (getComment() != null) {
             builder.append(", comment=");
             builder.append(", comment=");
-            builder.append(comment.getJavadoc());
+            builder.append(getComment().getJavadoc());
         }
         builder.append(", annotations=");
         builder.append(this.annotations);
         }
         builder.append(", annotations=");
         builder.append(this.annotations);
index 569addbf508ac285bf5a8748759ac9e4114ce9de..7d7dfe46ff75cecd63f62eef949a6c3297b7098a 100755 (executable)
@@ -11,9 +11,11 @@ package org.opendaylight.mdsal.binding.javav2.generator.util.generated.type.buil
 import com.google.common.annotations.Beta;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
 import com.google.common.annotations.Beta;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
+
 import java.util.List;
 import java.util.Objects;
 import java.util.Optional;
 import java.util.List;
 import java.util.Objects;
 import java.util.Optional;
+
 import org.opendaylight.mdsal.binding.javav2.generator.context.ModuleContext;
 import org.opendaylight.mdsal.binding.javav2.generator.util.AbstractBaseType;
 import org.opendaylight.mdsal.binding.javav2.model.api.AccessModifier;
 import org.opendaylight.mdsal.binding.javav2.generator.context.ModuleContext;
 import org.opendaylight.mdsal.binding.javav2.generator.util.AbstractBaseType;
 import org.opendaylight.mdsal.binding.javav2.model.api.AccessModifier;
@@ -54,12 +56,12 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
     }
 
     protected AbstractGeneratedTypeBuilder(final String packageName, final String name, final boolean isNormalized,
     }
 
     protected AbstractGeneratedTypeBuilder(final String packageName, final String name, final boolean isNormalized,
-            ModuleContext context) {
+                                           ModuleContext context) {
         super(packageName, name, true, null);
     }
 
         super(packageName, name, true, null);
     }
 
-    protected AbstractGeneratedTypeBuilder(final String packageName, final String name, final boolean isPkNameNormalized,
-            final boolean isTypeNormalized, ModuleContext context) {
+    protected AbstractGeneratedTypeBuilder(final String packageName, final String name,
+            final boolean isPkNameNormalized, final boolean isTypeNormalized, ModuleContext context) {
         super(packageName, name, isPkNameNormalized, isTypeNormalized, context);
     }
 
         super(packageName, name, isPkNameNormalized, isTypeNormalized, context);
     }
 
@@ -109,7 +111,8 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
         Preconditions.checkArgument(name != null, "Name for Enclosing Generated Transfer Object cannot be null!");
         GeneratedTOBuilder builder = new GeneratedTOBuilderImpl(getFullyQualifiedName(), name, true);
 
         Preconditions.checkArgument(name != null, "Name for Enclosing Generated Transfer Object cannot be null!");
         GeneratedTOBuilder builder = new GeneratedTOBuilderImpl(getFullyQualifiedName(), name, true);
 
-        Preconditions.checkArgument(!enclosedTransferObjects.contains(builder), "This generated type already contains equal enclosing transfer object.");
+        Preconditions.checkArgument(!enclosedTransferObjects.contains(builder),
+                "This generated type already contains equal enclosing transfer object.");
         enclosedTransferObjects = LazyCollections.lazyAdd(enclosedTransferObjects, builder);
         return builder;
     }
         enclosedTransferObjects = LazyCollections.lazyAdd(enclosedTransferObjects, builder);
         return builder;
     }
@@ -117,14 +120,15 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
     @Override
     public T addEnclosingTransferObject(final GeneratedTOBuilder genTOBuilder) {
         Preconditions.checkArgument(genTOBuilder != null, "Parameter genTOBuilder cannot be null!");
     @Override
     public T addEnclosingTransferObject(final GeneratedTOBuilder genTOBuilder) {
         Preconditions.checkArgument(genTOBuilder != null, "Parameter genTOBuilder cannot be null!");
-        Preconditions.checkArgument(!enclosedTransferObjects.contains(genTOBuilder), "This generated type already contains equal enclosing transfer object.");
+        Preconditions.checkArgument(!enclosedTransferObjects.contains(genTOBuilder),
+                "This generated type already contains equal enclosing transfer object.");
         enclosedTransferObjects = LazyCollections.lazyAdd(enclosedTransferObjects, genTOBuilder);
         return thisInstance();
     }
 
     @Override
         enclosedTransferObjects = LazyCollections.lazyAdd(enclosedTransferObjects, genTOBuilder);
         return thisInstance();
     }
 
     @Override
-    public T addComment(final TypeComment comment) {
-        this.comment = Preconditions.checkNotNull(comment);
+    public T addComment(final TypeComment typeComment) {
+        this.comment = Preconditions.checkNotNull(typeComment);
         return thisInstance();
     }
 
         return thisInstance();
     }
 
@@ -135,21 +139,23 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
 
         final AnnotationTypeBuilder builder = new AnnotationTypeBuilderImpl(packageName, name);
 
 
         final AnnotationTypeBuilder builder = new AnnotationTypeBuilderImpl(packageName, name);
 
-        Preconditions.checkArgument(!annotationBuilders.contains(builder), "This generated type already contains equal annotation.");
+        Preconditions.checkArgument(!annotationBuilders.contains(builder),
+                "This generated type already contains equal annotation.");
         annotationBuilders = LazyCollections.lazyAdd(annotationBuilders, builder);
         return builder;
     }
 
     @Override
         annotationBuilders = LazyCollections.lazyAdd(annotationBuilders, builder);
         return builder;
     }
 
     @Override
-    public T setAbstract(final boolean isAbstract) {
-        this.isAbstract = isAbstract;
+    public T setAbstract(final boolean isabstract) {
+        this.isAbstract = isabstract;
         return thisInstance();
     }
 
     @Override
     public T addImplementsType(final Type genType) {
         Preconditions.checkArgument(genType != null, "Type cannot be null");
         return thisInstance();
     }
 
     @Override
     public T addImplementsType(final Type genType) {
         Preconditions.checkArgument(genType != null, "Type cannot be null");
-        Preconditions.checkArgument(!implementsTypes.contains(genType), "This generated type already contains equal implements type.");
+        Preconditions.checkArgument(!implementsTypes.contains(genType),
+                "This generated type already contains equal implements type.");
         implementsTypes = LazyCollections.lazyAdd(implementsTypes, genType);
         return thisInstance();
     }
         implementsTypes = LazyCollections.lazyAdd(implementsTypes, genType);
         return thisInstance();
     }
@@ -158,7 +164,8 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
     public Constant addConstant(final Type type, final String name, final Object value) {
         Preconditions.checkArgument(type != null, "Returning Type for Constant cannot be null!");
         Preconditions.checkArgument(name != null, "Name of constant cannot be null!");
     public Constant addConstant(final Type type, final String name, final Object value) {
         Preconditions.checkArgument(type != null, "Returning Type for Constant cannot be null!");
         Preconditions.checkArgument(name != null, "Name of constant cannot be null!");
-        Preconditions.checkArgument(!containsConstant(name), "This generated type already contains constant with the same name.");
+        Preconditions.checkArgument(!containsConstant(name),
+                "This generated type already contains constant with the same name.");
 
         final Constant constant = new ConstantImpl(this, type, name, value);
         constants = LazyCollections.lazyAdd(constants, constant);
 
         final Constant constant = new ConstantImpl(this, type, name, value);
         constants = LazyCollections.lazyAdd(constants, constant);
@@ -166,7 +173,6 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
     }
 
 
     }
 
 
-
     @Override
     public Type setParentTypeForBuilder(Type type) {
         return this.parentTypeForBuilder = type;
     @Override
     public Type setParentTypeForBuilder(Type type) {
         return this.parentTypeForBuilder = type;
@@ -178,8 +184,8 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
     }
 
     @Override
     }
 
     @Override
-    public void setBindingNamespaceType(BindingNamespaceType namespaceType) {
-        this.namespaceType = namespaceType;
+    public void setBindingNamespaceType(BindingNamespaceType type) {
+        this.namespaceType = type;
     }
 
     public boolean containsConstant(final String name) {
     }
 
     public boolean containsConstant(final String name) {
@@ -198,7 +204,8 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
         final EnumBuilder builder = new EnumerationBuilderImpl(getFullyQualifiedName(), name, true, false,
                 context);
 
         final EnumBuilder builder = new EnumerationBuilderImpl(getFullyQualifiedName(), name, true, false,
                 context);
 
-        Preconditions.checkArgument(!enumDefinitions.contains(builder), "This generated type already contains equal enumeration.");
+        Preconditions.checkArgument(!enumDefinitions.contains(builder),
+                "This generated type already contains equal enumeration.");
         enumDefinitions = LazyCollections.lazyAdd(enumDefinitions, builder);
         return builder;
     }
         enumDefinitions = LazyCollections.lazyAdd(enumDefinitions, builder);
         return builder;
     }
@@ -227,7 +234,8 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
     @Override
     public GeneratedPropertyBuilder addProperty(final String name) {
         Preconditions.checkArgument(name != null, "Parameter name can't be null");
     @Override
     public GeneratedPropertyBuilder addProperty(final String name) {
         Preconditions.checkArgument(name != null, "Parameter name can't be null");
-        Preconditions.checkArgument(!containsProperty(name), "This generated type already contains property with the same name.");
+        Preconditions.checkArgument(!containsProperty(name),
+                "This generated type already contains property with the same name.");
 
         final GeneratedPropertyBuilder builder = new GeneratedPropertyBuilderImpl(name);
         builder.setAccessModifier(AccessModifier.PUBLIC);
 
         final GeneratedPropertyBuilder builder = new GeneratedPropertyBuilderImpl(name);
         builder.setAccessModifier(AccessModifier.PUBLIC);
index 522d86b4c3a49586e3cc92d8b1c5bf6e12ef48c4..24dd66f49f3774dcf41a314b963e9e85e3e84248 100644 (file)
@@ -32,16 +32,16 @@ abstract class AbstractTypeMemberBuilder<T extends TypeMemberBuilder<T>> impleme
     private AccessModifier accessModifier;
     private List<AnnotationTypeBuilder> annotationBuilders = ImmutableList.of();
 
     private AccessModifier accessModifier;
     private List<AnnotationTypeBuilder> annotationBuilders = ImmutableList.of();
 
-    public AbstractTypeMemberBuilder(final String name) {
+    AbstractTypeMemberBuilder(final String name) {
         this.name = name;
     }
 
     @Override
         this.name = name;
     }
 
     @Override
-    public AnnotationTypeBuilder addAnnotation(final String packageName, final String name) {
+    public AnnotationTypeBuilder addAnnotation(final String packageName, final String typeName) {
         Preconditions.checkArgument(packageName != null, "Annotation Type cannot have package name null!");
         Preconditions.checkArgument(packageName != null, "Annotation Type cannot have package name null!");
-        Preconditions.checkArgument(name != null, "Annotation Type cannot have name as null!");
+        Preconditions.checkArgument(typeName != null, "Annotation Type cannot have name as null!");
 
 
-        final AnnotationTypeBuilder builder = new AnnotationTypeBuilderImpl(packageName, name);
+        final AnnotationTypeBuilder builder = new AnnotationTypeBuilderImpl(packageName, typeName);
         annotationBuilders = LazyCollections.lazyAdd(annotationBuilders, builder);
         return builder;
     }
         annotationBuilders = LazyCollections.lazyAdd(annotationBuilders, builder);
         return builder;
     }
@@ -79,9 +79,9 @@ abstract class AbstractTypeMemberBuilder<T extends TypeMemberBuilder<T>> impleme
     }
 
     @Override
     }
 
     @Override
-    public T setReturnType(final Type returnType) {
-        Preconditions.checkArgument(returnType != null, "Return Type of member cannot be null!");
-        this.returnType = returnType;
+    public T setReturnType(final Type retType) {
+        Preconditions.checkArgument(retType != null, "Return Type of member cannot be null!");
+        this.returnType = retType;
         return thisInstance();
     }
 
         return thisInstance();
     }
 
@@ -93,23 +93,23 @@ abstract class AbstractTypeMemberBuilder<T extends TypeMemberBuilder<T>> impleme
     }
 
     @Override
     }
 
     @Override
-    public T setComment(final String comment) {
-        if (comment == null) {
+    public T setComment(final String commentText) {
+        if (commentText == null) {
             this.comment = "";
         }
             this.comment = "";
         }
-        this.comment = comment;
+        this.comment = commentText;
         return thisInstance();
     }
 
     @Override
         return thisInstance();
     }
 
     @Override
-    public T setFinal(final boolean isFinal) {
-        this.isFinal = isFinal;
+    public T setFinal(final boolean finalOrNot) {
+        this.isFinal = finalOrNot;
         return thisInstance();
     }
 
     @Override
         return thisInstance();
     }
 
     @Override
-    public T setStatic(final boolean isStatic) {
-        this.isStatic = isStatic;
+    public T setStatic(final boolean staticOrNot) {
+        this.isStatic = staticOrNot;
         return thisInstance();
     }
 
         return thisInstance();
     }
 
index a04b9f17ce380391e2e070da47c2fe689915a082..526437f6c4c13b8aa8d22093ab6111ceaf1cb702 100644 (file)
@@ -28,16 +28,16 @@ final class AnnotationTypeBuilderImpl extends AbstractBaseType implements Annota
     private List<AnnotationTypeBuilder> annotationBuilders = ImmutableList.of();
     private List<AnnotationType.Parameter> parameters = ImmutableList.of();
 
     private List<AnnotationTypeBuilder> annotationBuilders = ImmutableList.of();
     private List<AnnotationType.Parameter> parameters = ImmutableList.of();
 
-    public AnnotationTypeBuilderImpl(final String packageName, final String name) {
+    AnnotationTypeBuilderImpl(final String packageName, final String name) {
         super(packageName, name, true, null);
         this.packageName = packageName;
         this.name = name;
     }
 
     @Override
         super(packageName, name, true, null);
         this.packageName = packageName;
         this.name = name;
     }
 
     @Override
-    public AnnotationTypeBuilder addAnnotation(final String packageName, final String name) {
-        if (packageName != null && name != null) {
-            final AnnotationTypeBuilder builder = new AnnotationTypeBuilderImpl(packageName, name);
+    public AnnotationTypeBuilder addAnnotation(final String pkgName, final String typeName) {
+        if (pkgName != null && typeName != null) {
+            final AnnotationTypeBuilder builder = new AnnotationTypeBuilderImpl(pkgName, typeName);
             if (!annotationBuilders.contains(builder)) {
                 annotationBuilders = LazyCollections.lazyAdd(annotationBuilders, builder);
                 return builder;
             if (!annotationBuilders.contains(builder)) {
                 annotationBuilders = LazyCollections.lazyAdd(annotationBuilders, builder);
                 return builder;
@@ -125,7 +125,7 @@ final class AnnotationTypeBuilderImpl extends AbstractBaseType implements Annota
         private final List<AnnotationType.Parameter> parameters;
         private final List<String> paramNames;
 
         private final List<AnnotationType.Parameter> parameters;
         private final List<String> paramNames;
 
-        public AnnotationTypeImpl(final String packageName, final String name,
+        AnnotationTypeImpl(final String packageName, final String name,
                 final List<AnnotationTypeBuilder> annotationBuilders,
                 final List<AnnotationType.Parameter> parameters) {
             this.packageName = packageName;
                 final List<AnnotationTypeBuilder> annotationBuilders,
                 final List<AnnotationType.Parameter> parameters) {
             this.packageName = packageName;
@@ -205,7 +205,8 @@ final class AnnotationTypeBuilderImpl extends AbstractBaseType implements Annota
                     .compare(this.name, other.getName())
                     .compare(this.packageName, other.getPackageName())
                     //FIXME: what is natural ordering for AnnotationType?
                     .compare(this.name, other.getName())
                     .compare(this.packageName, other.getPackageName())
                     //FIXME: what is natural ordering for AnnotationType?
-                    .compare(this.annotations, other.getAnnotations(), Ordering.<AnnotationType>natural().lexicographical())
+                    .compare(this.annotations, other.getAnnotations(),
+                            Ordering.<AnnotationType>natural().lexicographical())
                     .compare(this.paramNames, other.getParameterNames(), Ordering.<String>natural().lexicographical())
                     .result();
         }
                     .compare(this.paramNames, other.getParameterNames(), Ordering.<String>natural().lexicographical())
                     .result();
         }
@@ -251,13 +252,13 @@ final class AnnotationTypeBuilderImpl extends AbstractBaseType implements Annota
         private final String value;
         private final List<String> values;
 
         private final String value;
         private final List<String> values;
 
-        public ParameterImpl(final String name, final String value) {
+        ParameterImpl(final String name, final String value) {
             this.name = name;
             this.value = value;
             this.values = ImmutableList.of();
         }
 
             this.name = name;
             this.value = value;
             this.values = ImmutableList.of();
         }
 
-        public ParameterImpl(final String name, final List<String> values) {
+        ParameterImpl(final String name, final List<String> values) {
             this.name = name;
             this.values = values;
             this.value = null;
             this.name = name;
             this.values = values;
             this.value = null;
@@ -280,7 +281,7 @@ final class AnnotationTypeBuilderImpl extends AbstractBaseType implements Annota
 
         @Override
         public int hashCode() {
 
         @Override
         public int hashCode() {
-           return Objects.hash(name);
+            return Objects.hash(name);
         }
 
         @Override
         }
 
         @Override
index d58fa19769287fa44cd6021d3e217185128d94b1..c1658b30c41abb70012a7cc2a5fdfe03250adc0a 100644 (file)
@@ -72,7 +72,8 @@ final class ConstantImpl implements Constant {
         }
 
         ConstantImpl other = (ConstantImpl) obj;
         }
 
         ConstantImpl other = (ConstantImpl) obj;
-        return Objects.equals(name, other.name) && Objects.equals(type, other.type) && Objects.equals(value, other.value);
+        return Objects.equals(name, other.name) && Objects.equals(type, other.type)
+                && Objects.equals(value, other.value);
     }
 
     @Override
     }
 
     @Override
index 0d8fdb1d38557dce4785295e51f48ab232c50541..90c31dc5d2afe0a74d567f1639ae6594c437c6c1 100755 (executable)
@@ -10,12 +10,14 @@ package org.opendaylight.mdsal.binding.javav2.generator.util.generated.type.buil
 
 import com.google.common.annotations.Beta;
 import com.google.common.collect.ImmutableList;
 
 import com.google.common.annotations.Beta;
 import com.google.common.collect.ImmutableList;
+
 import java.util.List;
 import java.util.Objects;
 import java.util.Optional;
 import java.util.stream.Collectors;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 import java.util.List;
 import java.util.Objects;
 import java.util.Optional;
 import java.util.stream.Collectors;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
+
 import org.opendaylight.mdsal.binding.javav2.generator.context.ModuleContext;
 import org.opendaylight.mdsal.binding.javav2.generator.util.AbstractBaseType;
 import org.opendaylight.mdsal.binding.javav2.generator.util.JavaIdentifierNormalizer;
 import org.opendaylight.mdsal.binding.javav2.generator.context.ModuleContext;
 import org.opendaylight.mdsal.binding.javav2.generator.util.AbstractBaseType;
 import org.opendaylight.mdsal.binding.javav2.generator.util.JavaIdentifierNormalizer;
@@ -52,7 +54,7 @@ public class EnumerationBuilderImpl extends AbstractBaseType implements EnumBuil
     }
 
     public EnumerationBuilderImpl(final String packageName, final String name, final boolean isPkNameNormalized,
     }
 
     public EnumerationBuilderImpl(final String packageName, final String name, final boolean isPkNameNormalized,
-            final boolean isTypeNormalized, final ModuleContext context) {
+                                  final boolean isTypeNormalized, final ModuleContext context) {
         super(packageName, name, isPkNameNormalized, isTypeNormalized, context);
     }
 
         super(packageName, name, isPkNameNormalized, isTypeNormalized, context);
     }
 
@@ -83,15 +85,16 @@ public class EnumerationBuilderImpl extends AbstractBaseType implements EnumBuil
     }
 
     @Override
     }
 
     @Override
-    public void addValue(final String name, final int value, final String description, final String reference, final Status status) {
-        final EnumPairImpl p = new EnumPairImpl(name, value, description, reference, status, this.values);
+    public void addValue(final String name, final int value, final String desc, final String ref,
+                         final Status status) {
+        final EnumPairImpl p = new EnumPairImpl(name, value, desc, ref, status, this.values);
         this.values = LazyCollections.lazyAdd(this.values, p);
     }
 
     @Override
     public Enumeration toInstance(final Type definingType) {
         this.values = LazyCollections.lazyAdd(this.values, p);
     }
 
     @Override
     public Enumeration toInstance(final Type definingType) {
-        return new EnumerationImpl(definingType, this.annotationBuilders, this.packageName, this.name, this.values, this.description,
-                this.reference, this.moduleName, this.schemaPath);
+        return new EnumerationImpl(definingType, this.annotationBuilders, this.packageName, this.name, this.values,
+                this.description, this.reference, this.moduleName, this.schemaPath);
     }
 
     @Override
     }
 
     @Override
@@ -123,8 +126,8 @@ public class EnumerationBuilderImpl extends AbstractBaseType implements EnumBuil
         private final String reference;
         private final Status status;
 
         private final String reference;
         private final Status status;
 
-        public EnumPairImpl(final String name, final int value, final String description,
-                final String reference, final Status status, final List<Pair> values) {
+        EnumPairImpl(final String name, final int value, final String description,
+                            final String reference, final Status status, final List<Pair> values) {
 
             this.name = name;
             this.mappedName = JavaIdentifierNormalizer.normalizeEnumValueIdentifier(name, values);
 
             this.name = name;
             this.mappedName = JavaIdentifierNormalizer.normalizeEnumValueIdentifier(name, values);
@@ -164,7 +167,7 @@ public class EnumerationBuilderImpl extends AbstractBaseType implements EnumBuil
         @Nonnull
         @Override
         public Status getStatus() {
         @Nonnull
         @Override
         public Status getStatus() {
-           return this.status;
+            return this.status;
         }
 
         @Override
         }
 
         @Override
@@ -219,9 +222,10 @@ public class EnumerationBuilderImpl extends AbstractBaseType implements EnumBuil
         private final List<Pair> values;
         private final List<AnnotationType> annotations;
 
         private final List<Pair> values;
         private final List<AnnotationType> annotations;
 
-        public EnumerationImpl(final Type definingType, final List<AnnotationTypeBuilder> annotationBuilders,
-                               final String packageName, final String name, final List<Pair> values, final String description,
-                final String reference, final String moduleName, final List<QName> schemaPath) {
+        EnumerationImpl(final Type definingType, final List<AnnotationTypeBuilder> annotationBuilders,
+                               final String packageName, final String name, final List<Pair> values, final String
+                                       description,
+                               final String reference, final String moduleName, final List<QName> schemaPath) {
             super(packageName, name, true, null);
             this.definingType = definingType;
             this.values = values;
             super(packageName, name, true, null);
             this.definingType = definingType;
             this.values = values;
@@ -264,7 +268,7 @@ public class EnumerationBuilderImpl extends AbstractBaseType implements EnumBuil
             builder.append(" {");
             builder.append("\n");
 
             builder.append(" {");
             builder.append("\n");
 
-            int i = 0;
+            int count = 0;
             for (final Enumeration.Pair valPair : this.values) {
                 builder.append("\t");
                 builder.append(' ');
             for (final Enumeration.Pair valPair : this.values) {
                 builder.append("\t");
                 builder.append(' ');
@@ -272,12 +276,12 @@ public class EnumerationBuilderImpl extends AbstractBaseType implements EnumBuil
                 builder.append(" (");
                 builder.append(valPair.getValue());
 
                 builder.append(" (");
                 builder.append(valPair.getValue());
 
-                if (i == this.values.size() - 1) {
+                if (count == this.values.size() - 1) {
                     builder.append(" );");
                 } else {
                     builder.append(" ),");
                 }
                     builder.append(" );");
                 } else {
                     builder.append(" ),");
                 }
-                ++i;
+                ++count;
             }
             builder.append("\n}");
             return builder.toString();
             }
             builder.append("\n}");
             return builder.toString();
index 025d470d5ef031aad52cb127dad2b325426e6d32..d3b7769c101e42a7e9e422b17d6250ffdc14bc7c 100644 (file)
@@ -28,14 +28,14 @@ public final class GeneratedPropertyBuilderImpl extends AbstractTypeMemberBuilde
     }
 
     @Override
     }
 
     @Override
-    public GeneratedPropertyBuilder setValue(String value) {
-        this.value = value;
+    public GeneratedPropertyBuilder setValue(String valueString) {
+        this.value = valueString;
         return this;
     }
 
     @Override
         return this;
     }
 
     @Override
-    public GeneratedPropertyBuilder setReadOnly(boolean isReadOnly) {
-        this.isReadOnly = isReadOnly;
+    public GeneratedPropertyBuilder setReadOnly(boolean readOnlyOrNot) {
+        this.isReadOnly = readOnlyOrNot;
         return this;
     }
 
         return this;
     }
 
index c6a8cab263a1325d03d3f1ba26349024c1ce9010..b7a8195c5f728348e489e0fb6882ed33edad6693 100644 (file)
@@ -21,7 +21,7 @@ final class GeneratedPropertyImpl extends AbstractTypeMember implements Generate
     private String value;
     private boolean isReadOnly;
 
     private String value;
     private boolean isReadOnly;
 
-    public GeneratedPropertyImpl(Type definingType, String name, List<AnnotationType> annotations, String comment,
+    GeneratedPropertyImpl(Type definingType, String name, List<AnnotationType> annotations, String comment,
                                  AccessModifier accessModifier, Type returnType, boolean isFinal, boolean isStatic,
                                  boolean isReadOnly, String value) {
         super(definingType, name, annotations, comment, accessModifier, returnType, isFinal, isStatic);
                                  AccessModifier accessModifier, Type returnType, boolean isFinal, boolean isStatic,
                                  boolean isReadOnly, String value) {
         super(definingType, name, annotations, comment, accessModifier, returnType, isFinal, isStatic);
index 174928eca3c8a62c14069ec195d59b446eac4f65..db0e54ccf6e457f25b7113b91fc50e2d0ada0012 100644 (file)
@@ -11,8 +11,10 @@ package org.opendaylight.mdsal.binding.javav2.generator.util.generated.type.buil
 import com.google.common.annotations.Beta;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
 import com.google.common.annotations.Beta;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
+
 import java.util.List;
 import java.util.Optional;
 import java.util.List;
 import java.util.Optional;
+
 import org.opendaylight.mdsal.binding.javav2.generator.context.ModuleContext;
 import org.opendaylight.mdsal.binding.javav2.model.api.GeneratedProperty;
 import org.opendaylight.mdsal.binding.javav2.model.api.GeneratedTransferObject;
 import org.opendaylight.mdsal.binding.javav2.generator.context.ModuleContext;
 import org.opendaylight.mdsal.binding.javav2.model.api.GeneratedProperty;
 import org.opendaylight.mdsal.binding.javav2.model.api.GeneratedTransferObject;
@@ -56,7 +58,7 @@ public final class GeneratedTOBuilderImpl extends AbstractGeneratedTypeBuilder<G
     }
 
     public GeneratedTOBuilderImpl(final String packageName, final String name, final boolean isPkNameNormalized,
     }
 
     public GeneratedTOBuilderImpl(final String packageName, final String name, final boolean isPkNameNormalized,
-            final boolean isTypeNormalized, ModuleContext context) {
+                                  final boolean isTypeNormalized, ModuleContext context) {
         super(packageName, name, isPkNameNormalized, isTypeNormalized, context);
         setAbstract(false);
     }
         super(packageName, name, isPkNameNormalized, isTypeNormalized, context);
         setAbstract(false);
     }
@@ -78,8 +80,7 @@ public final class GeneratedTOBuilderImpl extends AbstractGeneratedTypeBuilder<G
      * {TypeMemberBuilder#setFinal(boolean)} and
      * {TypeMemberBuilder#setAccessModifier(boolean)}
      *
      * {TypeMemberBuilder#setFinal(boolean)} and
      * {TypeMemberBuilder#setAccessModifier(boolean)}
      *
-     * @param name
-     *            Name of Method
+     * @param name Name of Method
      * @return <code>new</code> instance of Method Signature Builder.
      */
     @Override
      * @return <code>new</code> instance of Method Signature Builder.
      */
     @Override
@@ -118,8 +119,8 @@ public final class GeneratedTOBuilderImpl extends AbstractGeneratedTypeBuilder<G
     }
 
     @Override
     }
 
     @Override
-    public void setTypedef(boolean isTypedef) {
-        this.isTypedef = isTypedef;
+    public void setTypedef(boolean typedefOrNot) {
+        this.isTypedef = typedefOrNot;
     }
 
     @Override
     }
 
     @Override
@@ -133,13 +134,13 @@ public final class GeneratedTOBuilderImpl extends AbstractGeneratedTypeBuilder<G
     }
 
     @Override
     }
 
     @Override
-    public void setIsUnionBuilder(boolean isUnionTypeBuilder) {
-        this.isUnionTypeBuilder = isUnionTypeBuilder;
+    public void setIsUnionBuilder(boolean unionTypeBuilderOrNot) {
+        this.isUnionTypeBuilder = unionTypeBuilderOrNot;
     }
 
     @Override
     }
 
     @Override
-    public void setSUID(GeneratedPropertyBuilder suid) {
-        this.suid = suid;
+    public void setSUID(GeneratedPropertyBuilder suidBuilder) {
+        this.suid = suidBuilder;
     }
 
     @Override
     }
 
     @Override
@@ -194,7 +195,8 @@ public final class GeneratedTOBuilderImpl extends AbstractGeneratedTypeBuilder<G
         return builder.toString();
     }
 
         return builder.toString();
     }
 
-    private static final class GeneratedTransferObjectImpl extends AbstractGeneratedType implements GeneratedTransferObject {
+    private static final class GeneratedTransferObjectImpl extends AbstractGeneratedType implements
+            GeneratedTransferObject {
 
         private final List<GeneratedProperty> equalsProperties;
         private final List<GeneratedProperty> hashCodeProperties;
 
         private final List<GeneratedProperty> equalsProperties;
         private final List<GeneratedProperty> hashCodeProperties;
@@ -211,7 +213,7 @@ public final class GeneratedTOBuilderImpl extends AbstractGeneratedTypeBuilder<G
         private final String moduleName;
         private final List<QName> schemaPath;
 
         private final String moduleName;
         private final List<QName> schemaPath;
 
-        public GeneratedTransferObjectImpl(final GeneratedTOBuilderImpl builder) {
+        GeneratedTransferObjectImpl(final GeneratedTOBuilderImpl builder) {
             super(builder);
 
             this.extendsType = builder.extendsType;
             super(builder);
 
             this.extendsType = builder.extendsType;
index d2d30499d406c54069184575840bc9232ae73be2..e18bf9a7c4708f04a2ba0b1db407e1981cb9ce06 100755 (executable)
@@ -129,7 +129,7 @@ public final class GeneratedTypeBuilderImpl extends AbstractGeneratedTypeBuilder
         private final String moduleName;
         private final List<QName> schemaPath;
 
         private final String moduleName;
         private final List<QName> schemaPath;
 
-        public GeneratedTypeImpl(final GeneratedTypeBuilderImpl builder) {
+        GeneratedTypeImpl(final GeneratedTypeBuilderImpl builder) {
             super(builder);
 
             this.description = builder.description;
             super(builder);
 
             this.description = builder.description;
@@ -165,7 +165,7 @@ public final class GeneratedTypeBuilderImpl extends AbstractGeneratedTypeBuilder
         private final String basePackageName;
         private final String builderPackageName;
 
         private final String basePackageName;
         private final String builderPackageName;
 
-        public GeneratedTypeWithBuilderImpl(GeneratedTypeBuilderImpl builder) {
+        GeneratedTypeWithBuilderImpl(GeneratedTypeBuilderImpl builder) {
             super(builder);
             Preconditions.checkState(builder.getBasePackageName() != null,
                     "Base package name can not be null for type with builder!");
             super(builder);
             Preconditions.checkState(builder.getBasePackageName() != null,
                     "Base package name can not be null for type with builder!");
index 9481ef58f4bcc2302c4d746576ab49ed06933306..e9aea315d75d6df03f31b22aca6f8a7a321817c9 100644 (file)
@@ -19,7 +19,7 @@ final class MethodParameterImpl implements Parameter {
     private final String name;
     private final Type type;
 
     private final String name;
     private final Type type;
 
-    public MethodParameterImpl(final String name, final Type type) {
+    MethodParameterImpl(final String name, final Type type) {
         this.name = name;
         this.type = type;
     }
         this.name = name;
         this.type = type;
     }
index 90bb5e32b940b8d4437e3270633643e8f6515d64..33acc4d927219325f7d4b0c945d2b5adb026f6a1 100644 (file)
@@ -9,9 +9,11 @@ package org.opendaylight.mdsal.binding.javav2.generator.util.generated.type.buil
 
 import com.google.common.annotations.Beta;
 import com.google.common.collect.ImmutableList;
 
 import com.google.common.annotations.Beta;
 import com.google.common.collect.ImmutableList;
+
 import java.util.Collections;
 import java.util.List;
 import java.util.Objects;
 import java.util.Collections;
 import java.util.List;
 import java.util.Objects;
+
 import org.opendaylight.mdsal.binding.javav2.model.api.AnnotationType;
 import org.opendaylight.mdsal.binding.javav2.model.api.MethodSignature;
 import org.opendaylight.mdsal.binding.javav2.model.api.Type;
 import org.opendaylight.mdsal.binding.javav2.model.api.AnnotationType;
 import org.opendaylight.mdsal.binding.javav2.model.api.MethodSignature;
 import org.opendaylight.mdsal.binding.javav2.model.api.Type;
@@ -19,19 +21,20 @@ import org.opendaylight.mdsal.binding.javav2.model.api.type.builder.MethodSignat
 import org.opendaylight.yangtools.util.LazyCollections;
 
 @Beta
 import org.opendaylight.yangtools.util.LazyCollections;
 
 @Beta
-final class MethodSignatureBuilderImpl extends AbstractTypeMemberBuilder<MethodSignatureBuilder> implements MethodSignatureBuilder {
+final class MethodSignatureBuilderImpl extends AbstractTypeMemberBuilder<MethodSignatureBuilder> implements
+        MethodSignatureBuilder {
 
     private List<MethodSignature.Parameter> parameters = ImmutableList.of();
 
     private List<MethodSignature.Parameter> parameters = ImmutableList.of();
-    private List<MethodSignature.Parameter> unmodifiableParams  = ImmutableList.of();
+    private List<MethodSignature.Parameter> unmodifiableParams = ImmutableList.of();
     private boolean isAbstract;
 
     private boolean isAbstract;
 
-    public MethodSignatureBuilderImpl(final String name) {
+    MethodSignatureBuilderImpl(final String name) {
         super(name);
     }
 
     @Override
         super(name);
     }
 
     @Override
-    public MethodSignatureBuilder setAbstract(final boolean isAbstract) {
-        this.isAbstract = isAbstract;
+    public MethodSignatureBuilder setAbstract(final boolean abstractOrNot) {
+        this.isAbstract = abstractOrNot;
         return this;
     }
 
         return this;
     }
 
index 47ff88606c1acfbe2099b54d494e3ec451bdadb0..fd27b9853080c06b37200ed83ddb126e18027e9e 100644 (file)
@@ -21,7 +21,7 @@ class MethodSignatureImpl extends AbstractTypeMember implements MethodSignature
     private final List<Parameter> params;
     private final boolean isAbstract;
 
     private final List<Parameter> params;
     private final boolean isAbstract;
 
-    public MethodSignatureImpl(final Type definingType, final String name,
+    MethodSignatureImpl(final Type definingType, final String name,
             final List<AnnotationType> annotations,
             final String comment, final AccessModifier accessModifier,
             final Type returnType, final List<Parameter> params, final boolean isFinal,
             final List<AnnotationType> annotations,
             final String comment, final AccessModifier accessModifier,
             final Type returnType, final List<Parameter> params, final boolean isFinal,
index 32210f52b2ca27bf7f4766b880a0c0db48c3cf28..c1f58bb84a359aaa8e188d9f257b02aa92911773 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.mdsal.binding.javav2.generator.util;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+
 import org.junit.Test;
 import org.opendaylight.mdsal.binding.javav2.generator.context.ModuleContext;
 import org.opendaylight.mdsal.binding.javav2.util.BindingMapping;
 import org.junit.Test;
 import org.opendaylight.mdsal.binding.javav2.generator.context.ModuleContext;
 import org.opendaylight.mdsal.binding.javav2.util.BindingMapping;
@@ -38,11 +39,13 @@ public class JavaIdentifierNormalizerTest {
 
         // Augmentable - reserved & non reserved
         normalizeIdentifier = JavaIdentifierNormalizer
 
         // Augmentable - reserved & non reserved
         normalizeIdentifier = JavaIdentifierNormalizer
-                .normalizeClassIdentifier("org.opendaylight.mdsal.binding.javav2.spec.structural", "Augmentable", context);
+                .normalizeClassIdentifier("org.opendaylight.mdsal.binding.javav2.spec.structural", "Augmentable",
+                        context);
         assertEquals("Augmentable", normalizeIdentifier);
         // again reserved
         normalizeIdentifier = JavaIdentifierNormalizer
         assertEquals("Augmentable", normalizeIdentifier);
         // again reserved
         normalizeIdentifier = JavaIdentifierNormalizer
-                .normalizeClassIdentifier("org.opendaylight.mdsal.binding.javav2.spec.structural", "Augmentable", context);
+                .normalizeClassIdentifier("org.opendaylight.mdsal.binding.javav2.spec.structural", "Augmentable",
+                        context);
         assertEquals("Augmentable", normalizeIdentifier);
         // non reserved
         normalizeIdentifier = JavaIdentifierNormalizer
         assertEquals("Augmentable", normalizeIdentifier);
         // non reserved
         normalizeIdentifier = JavaIdentifierNormalizer
@@ -73,10 +76,12 @@ public class JavaIdentifierNormalizerTest {
         normalizeIdentifier = JavaIdentifierNormalizer.normalizeClassIdentifier("java.lang", "String", context);
         assertEquals("String", normalizeIdentifier);
         // non reserved
         normalizeIdentifier = JavaIdentifierNormalizer.normalizeClassIdentifier("java.lang", "String", context);
         assertEquals("String", normalizeIdentifier);
         // non reserved
-        normalizeIdentifier = JavaIdentifierNormalizer.normalizeClassIdentifier("string.non.reserved", "String", context);
+        normalizeIdentifier = JavaIdentifierNormalizer.normalizeClassIdentifier("string.non.reserved", "String",
+                context);
         assertEquals("String", normalizeIdentifier);
         // again non reserved
         assertEquals("String", normalizeIdentifier);
         // again non reserved
-        normalizeIdentifier = JavaIdentifierNormalizer.normalizeClassIdentifier("string.non.reserved", "String", context);
+        normalizeIdentifier = JavaIdentifierNormalizer.normalizeClassIdentifier("string.non.reserved", "String",
+                context);
         assertEquals("String1", normalizeIdentifier);
     }
 
         assertEquals("String1", normalizeIdentifier);
     }
 
@@ -115,7 +120,8 @@ public class JavaIdentifierNormalizerTest {
         String normalizeIdentifier2 =
                 JavaIdentifierNormalizer.normalizeClassIdentifier("org.example.other.package.next", "fOo", context);
         final String normalizeIdentifier3 =
         String normalizeIdentifier2 =
                 JavaIdentifierNormalizer.normalizeClassIdentifier("org.example.other.package.next", "fOo", context);
         final String normalizeIdentifier3 =
-                JavaIdentifierNormalizer.normalizeClassIdentifier("org.example.other.package.next.next", "foo", context);
+                JavaIdentifierNormalizer.normalizeClassIdentifier("org.example.other.package.next.next", "foo",
+                        context);
         assertEquals(normalizeIdentifier1, "Foo");
         assertEquals(normalizeIdentifier2, "Foo");
         assertEquals(normalizeIdentifier3, "Foo");
         assertEquals(normalizeIdentifier1, "Foo");
         assertEquals(normalizeIdentifier2, "Foo");
         assertEquals(normalizeIdentifier3, "Foo");
@@ -123,7 +129,8 @@ public class JavaIdentifierNormalizerTest {
         normalizeIdentifier1 = JavaIdentifierNormalizer.normalizeClassIdentifier("org.example.other.package", "*",
                 context);
         normalizeIdentifier2 =
         normalizeIdentifier1 = JavaIdentifierNormalizer.normalizeClassIdentifier("org.example.other.package", "*",
                 context);
         normalizeIdentifier2 =
-                JavaIdentifierNormalizer.normalizeClassIdentifier("org.example.other.package.next", "asterisk", context);
+                JavaIdentifierNormalizer.normalizeClassIdentifier("org.example.other.package.next", "asterisk",
+                        context);
         assertEquals(normalizeIdentifier1, "Asterisk");
         assertEquals(normalizeIdentifier2, "Asterisk");
     }
         assertEquals(normalizeIdentifier1, "Asterisk");
         assertEquals(normalizeIdentifier2, "Asterisk");
     }
@@ -154,7 +161,8 @@ public class JavaIdentifierNormalizerTest {
         final String normalizeIdentifier1 =
                 JavaIdentifierNormalizer.normalizeClassIdentifier("org.example.keywords.other.package", "int", context);
         final String normalizeIdentifier2 =
         final String normalizeIdentifier1 =
                 JavaIdentifierNormalizer.normalizeClassIdentifier("org.example.keywords.other.package", "int", context);
         final String normalizeIdentifier2 =
-                JavaIdentifierNormalizer.normalizeClassIdentifier("org.example.keywords.other.package.next", "InT", context);
+                JavaIdentifierNormalizer.normalizeClassIdentifier("org.example.keywords.other.package.next", "InT",
+                        context);
         final String normalizeIdentifier3 =
                 JavaIdentifierNormalizer.normalizeClassIdentifier("org.example.keywords.other.package.next.next",
                         "inT", context);
         final String normalizeIdentifier3 =
                 JavaIdentifierNormalizer.normalizeClassIdentifier("org.example.keywords.other.package.next.next",
                         "inT", context);
@@ -428,7 +436,7 @@ public class JavaIdentifierNormalizerTest {
     }
 
     private void assertTest(final String testedIdentifier, final String acceptable,
     }
 
     private void assertTest(final String testedIdentifier, final String acceptable,
-            final JavaIdentifier javaTypeOfIdentifier) {
+                            final JavaIdentifier javaTypeOfIdentifier) {
         final String convertedIdentifier =
                 JavaIdentifierNormalizer.normalizeSpecificIdentifier(testedIdentifier, javaTypeOfIdentifier);
         assertNotNull(convertedIdentifier);
         final String convertedIdentifier =
                 JavaIdentifierNormalizer.normalizeSpecificIdentifier(testedIdentifier, javaTypeOfIdentifier);
         assertNotNull(convertedIdentifier);
index e192f426c272b4781c77ce509b3dd15f638a8fa7..5788a3899ed7d3c8ab69885e2ba9b2e3ef5b1b41 100644 (file)
@@ -20,7 +20,8 @@ public class EnumerationBuilderImplTest {
     @Test
     public void sameEnumTest() {
         ModuleContext context = new ModuleContext();
     @Test
     public void sameEnumTest() {
         ModuleContext context = new ModuleContext();
-        EnumerationBuilderImpl enumerationBuilderImpl = new EnumerationBuilderImpl("package.same.test", "test", context);
+        EnumerationBuilderImpl enumerationBuilderImpl = new EnumerationBuilderImpl("package.same.test", "test",
+                context);
         Enumeration enumeration = enumerationBuilderImpl.toInstance(enumerationBuilderImpl);
         String formattedString = enumeration.toFormattedString();
 
         Enumeration enumeration = enumerationBuilderImpl.toInstance(enumerationBuilderImpl);
         String formattedString = enumeration.toFormattedString();