Fix checkstyle in mdsal-binding-generator-util 77/76877/3
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 11 Oct 2018 12:31:01 +0000 (14:31 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 11 Oct 2018 15:24:05 +0000 (17:24 +0200)
This fixes violations and flips enforcement on.

Change-Id: Ibc12e6595498c4349695d62bcd74f3d126f4b8e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
39 files changed:
binding/mdsal-binding-generator-util/pom.xml
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/AbstractBaseType.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/BindingGeneratorUtil.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/ReferencedTypeImpl.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/TypeComments.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/Types.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/AbstractEnumerationBuilder.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/AbstractGeneratedTOBuilder.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/AbstractGeneratedType.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/AbstractGeneratedTypeBuilder.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/AbstractTypeMemberBuilder.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/AnnotationTypeBuilderImpl.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/CodegenEnumerationBuilder.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/CodegenGeneratedTOBuilder.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/CodegenGeneratedTypeBuilder.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/ConstantImpl.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/GeneratedPropertyBuilderImpl.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/GeneratedPropertyImpl.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/MethodParameterImpl.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/MethodSignatureBuilderImpl.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/MethodSignatureImpl.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/RuntimeEnumerationBuilder.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/RuntimeGeneratedTOBuilder.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/RuntimeGeneratedTypeBuilder.java
binding/mdsal-binding-generator-util/src/test/java/org/opendaylight/mdsal/binding/model/util/BindingGeneratorUtilTest.java
binding/mdsal-binding-generator-util/src/test/java/org/opendaylight/mdsal/binding/model/util/BindingTypesTest.java
binding/mdsal-binding-generator-util/src/test/java/org/opendaylight/mdsal/binding/model/util/TypeNameTest.java
binding/mdsal-binding-generator-util/src/test/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/AbstractTypeMemberTest.java
binding/mdsal-binding-generator-util/src/test/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/AnnotationBuilderTest.java
binding/mdsal-binding-generator-util/src/test/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/EnumerationBuilderImplTest.java
binding/mdsal-binding-generator-util/src/test/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/GeneratedPropertyBuilderImplTest.java
binding/mdsal-binding-generator-util/src/test/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/GeneratedPropertyImplTest.java
binding/mdsal-binding-generator-util/src/test/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/GeneratedPropertyTest.java
binding/mdsal-binding-generator-util/src/test/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/GeneratedTOBuilderImplTest.java
binding/mdsal-binding-generator-util/src/test/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/GeneratedTypeBuilderTest.java
binding/mdsal-binding-generator-util/src/test/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/MethodParameterImplTest.java
binding/mdsal-binding-generator-util/src/test/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/MethodSignatureBuilderImplTest.java
binding/mdsal-binding-generator-util/src/test/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/MethodSignatureBuilderTest.java
binding/mdsal-binding-generator-util/src/test/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/MethodSignatureImplTest.java

index 3ea3a649832e3a2863405f1d2049171d011c8b58..d9539bc984556584cf1c3fa95387c50c9cff72f8 100644 (file)
             <artifactId>yang-test-util</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>
index 7347716be0e178f7cb256fbed5af6e70cb368532..f955acf7fce073f4845fe3976b13df81db445a89 100644 (file)
@@ -11,7 +11,7 @@ import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
 import org.opendaylight.mdsal.binding.model.api.Type;
 
 /**
- * It is used only as ancestor for other <code>Type</code>s
+ * It is used only as ancestor for other <code>Type</code>s.
  */
 public class AbstractBaseType implements Type {
     /**
index 0fe1440d32d63ca1314d5e286b4ac0b43ed209de..91b4223b81ea9af1c56a5cc16344351c930aa4f9 100644 (file)
@@ -33,8 +33,6 @@ import org.opendaylight.mdsal.binding.model.api.type.builder.MethodSignatureBuil
 import org.opendaylight.mdsal.binding.model.api.type.builder.TypeMemberBuilder;
 import org.opendaylight.mdsal.binding.spec.naming.BindingMapping;
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.QNameModule;
-import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 import org.opendaylight.yangtools.yang.model.api.type.BinaryTypeDefinition;
@@ -54,10 +52,10 @@ import org.opendaylight.yangtools.yang.model.util.type.DecimalTypeBuilder;
 public final class BindingGeneratorUtil {
 
     /**
-     * Impossible to instantiate this class. All of the methods or attributes
-     * are static.
+     * Impossible to instantiate this class. All of the methods or attributes are static.
      */
     private BindingGeneratorUtil() {
+
     }
 
     /**
@@ -97,13 +95,10 @@ public final class BindingGeneratorUtil {
     private static final Comparator<Type> SUID_NAME_COMPARATOR = Comparator.comparing(Type::getFullyQualifiedName);
 
     /**
-     * Converts <code>parameterName</code> to valid JAVA parameter name.
-     *
-     * If the <code>parameterName</code> is one of the JAVA reserved words then
-     * it is prefixed with underscore character.
+     * Converts <code>parameterName</code> to valid JAVA parameter name. If the <code>parameterName</code> is one
+     * of the JAVA reserved words then it is prefixed with underscore character.
      *
-     * @param parameterName
-     *            string with the parameter name
+     * @param parameterName string with the parameter name
      * @return string with the admissible parameter name
      */
     public static String resolveJavaReservedWordEquivalency(final String parameterName) {
@@ -114,19 +109,13 @@ public final class BindingGeneratorUtil {
     }
 
     /**
-     * Creates package name from specified <code>basePackageName</code> (package
-     * name for module) and <code>schemaPath</code>.
-     *
-     * 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.
+     * Creates package name from specified <code>basePackageName</code> (package name for module)
+     * and <code>schemaPath</code>. 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.
      *
-     * @param basePackageName
-     *            string with package name of the module, MUST be normalized,
-     *            otherwise this method may return an invalid string.
-     * @param schemaPath
-     *            list of names of YANG nodes which are parents of some node +
-     *            name of this node
+     * @param basePackageName string with package name of the module, MUST be normalized, otherwise this method may
+     *                        return an invalid string.
+     * @param schemaPath list of names of YANG nodes which are parents of some node + name of this node
      * @return string with valid JAVA package name
      * @throws NullPointerException if any of the arguments are null
      */
@@ -140,23 +129,19 @@ 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. 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.
-     *
-     * @param basePackageName
-     *            string with package name of the module, MUST be normalized,
-     *            otherwise this method may return an invalid string.
-     * @param schemaPath
-     *            list of names of YANG nodes which are parents of some node +
-     *            name of this node
+     * @param basePackageName string with package name of the module, MUST be normalized, otherwise this method may
+     *                        return an invalid string.
+     * @param schemaPath list of names of YANG nodes which are parents of some node + name of this node
      * @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 int size = Iterables.size(schemaPath.getPathTowardsRoot());
         if (size == 0) {
             return basePackageName;
@@ -178,15 +163,12 @@ public final class BindingGeneratorUtil {
     }
 
     /**
-     *
      * Converts string <code>token</code> to the cammel case format.
      *
-     * @param token
-     *            string which should be converted to the cammel case format
-     * @param uppercase
-     *            boolean value which says whether the first character of the
-     *            <code>token</code> should|shuldn't be uppercased
-     * @return string in the cammel case format
+     * @param token string which should be converted to the cammel case format
+     * @param uppercase boolean value which says whether the first character of the <code>token</code> should be
+     *                  upper-cased or not
+     * @return string in the camel case format
      * @throws IllegalArgumentException
      *             <ul>
      *             <li>if <code>token</code> without white spaces is empty</li>
@@ -274,7 +256,7 @@ public final class BindingGeneratorUtil {
 
     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);
 
@@ -456,14 +438,17 @@ public final class BindingGeneratorUtil {
             public Optional<? extends RangeConstraint<?>> getRangeConstraint() {
                 return range;
             }
+
             @Override
             public List<PatternConstraint> getPatternConstraints() {
                 return pattern;
             }
+
             @Override
             public Optional<LengthConstraint> getLengthConstraint() {
                 return length;
             }
+
             @Override
             public boolean isEmpty() {
                 return false;
@@ -482,7 +467,8 @@ 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
      */
@@ -494,7 +480,7 @@ public final class BindingGeneratorUtil {
         return description;
     }
 
-    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;
     }
index cbe6c82b68db37df309045c065266b862ce78d31..39750341c657f8f180ffc7d63f3e92fd813f4d90 100644 (file)
@@ -10,14 +10,11 @@ package org.opendaylight.mdsal.binding.model.util;
 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
 
 /**
- *
- * Wraps combination of <code>packageName</code> and <code>name</code> to the
- * object representation
+ * Wraps combination of <code>packageName</code> and <code>name</code> to the object representation.
  */
 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 identifier JavaTypeName of the referenced type
      */
index bd7f1adc1158ddbbc8e087c536408757b8f6bd9a..99225858a3975873cbf776ed876bb04ede302069 100644 (file)
@@ -32,6 +32,10 @@ public final class TypeComments {
             .addEscape('@', "&#64;").build();
     private static final Pattern TAIL_COMMENT_PATTERN = Pattern.compile("*/", Pattern.LITERAL);
 
+    private TypeComments() {
+
+    }
+
     /**
      * 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 0574008ffa41c2f7711a3c88a604744c0c3e5c60..07311981d2d7dba92a2bc82906e9d963f978aa16 100644 (file)
@@ -67,7 +67,7 @@ public final class Types {
     private static final ConcreteType SET_TYPE = typeForClass(Set.class);
 
     /**
-     * It is not desirable to create instance of this class
+     * It is not desirable to create instance of this class.
      */
     private Types() {
     }
@@ -121,10 +121,9 @@ public final class Types {
     }
 
     /**
-     * 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) {
@@ -144,13 +143,10 @@ public final class Types {
     }
 
     /**
-     * Returns an instance of {@link ParameterizedType} describing the typed
-     * {@link Map}&lt;K,V&gt;
+     * Returns an instance of {@link ParameterizedType} describing the typed {@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) {
@@ -158,11 +154,10 @@ 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) {
@@ -170,11 +165,10 @@ 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) {
@@ -186,11 +180,10 @@ public final class Types {
     }
 
     /**
-     * Returns an instance of {@link ParameterizedType} describing the typed
-     * {@link ListenableFuture}&lt;V&gt; with concrete type of value.
+     * Returns an instance of {@link ParameterizedType} describing the typed {@link ListenableFuture}&lt;V&gt;
+     * with concrete type of value.
      *
-     * @param valueType
-     *            Value Type
+     * @param valueType Value Type
      * @return Description of type instance of ListenableFuture
      */
     public static ParameterizedType listenableFutureTypeFor(final Type valueType) {
@@ -209,16 +202,11 @@ public final class Types {
     }
 
     /**
-     * Creates instance of type
-     * {@link org.opendaylight.mdsal.binding.model.api.ParameterizedType
-     * ParameterizedType}
+     * Creates instance of type {@link org.opendaylight.mdsal.binding.model.api.ParameterizedType ParameterizedType}.
      *
-     * @param type
-     *            JAVA <code>Type</code> for raw type
-     * @param parameters
-     *            JAVA <code>Type</code>s for actual parameter types
-     * @return <code>ParametrizedType</code> representation of <code>type</code>
-     *         and its parameters <code>parameters</code>
+     * @param type JAVA <code>Type</code> for raw type
+     * @param parameters JAVA <code>Type</code>s for actual parameter types
+     * @return <code>ParametrizedType</code> representation of <code>type</code> and its <code>parameters</code>
      * @throws NullPointerException if any argument or any member of {@code parameters} is null
      */
     public static ParameterizedType parameterizedTypeFor(final Type type, final Type... parameters) {
@@ -242,8 +230,7 @@ public final class Types {
      * {@link org.opendaylight.yangtools.yang.binding.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
      *         <code>Augmentable</code> with actual parameter
      *         <code>valueType</code>
@@ -254,14 +241,11 @@ public final class Types {
     }
 
     /**
-     * Creates instance of
-     * {@link org.opendaylight.mdsal.binding.model.api.ParameterizedType
-     * ParameterizedType} where raw type is
-     * {@link org.opendaylight.yangtools.yang.binding.Augmentation} and actual
-     * parameter is <code>valueType</code>.
+     * Creates instance of {@link org.opendaylight.mdsal.binding.model.api.ParameterizedType ParameterizedType} where
+     * raw type is {@link org.opendaylight.yangtools.yang.binding.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
      *         <code>Augmentation</code> with actual parameter
      *         <code>valueType</code>
@@ -276,21 +260,16 @@ public final class Types {
     }
 
     /**
-     *
      * Represents concrete JAVA type.
-     *
      */
     private static final class ConcreteTypeImpl extends AbstractBaseType implements ConcreteType {
         private final Restrictions restrictions;
 
         /**
-         * 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
          */
         ConcreteTypeImpl(final JavaTypeName identifier, final Restrictions restrictions) {
             super(identifier);
@@ -306,17 +285,15 @@ public final class Types {
     /**
      * 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>.
+         * 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
          */
         BaseTypeWithRestrictionsImpl(final JavaTypeName identifier, final Restrictions restrictions) {
             super(identifier);
@@ -339,31 +316,17 @@ public final class Types {
         private final Type[] actualTypes;
 
         /**
-         * JAVA raw type (like List, Set, Map...)
+         * JAVA raw type (like List, Set, Map...).
          */
         private final Type rawType;
 
-        @Override
-        public Type[] getActualTypeArguments() {
-
-            return this.actualTypes;
-        }
-
-        @Override
-        public Type getRawType() {
-            return this.rawType;
-        }
-
         /**
-         * 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 ParametrizedTypeImpl(final Type rawType, final Type[] actTypes) {
+        ParametrizedTypeImpl(final Type rawType, final Type[] actTypes) {
             super(rawType.getIdentifier());
             this.rawType = requireNonNull(rawType);
             actualTypes = actTypes.clone();
@@ -371,6 +334,17 @@ public final class Types {
                 throw new NullPointerException("actTypes contains a null");
             }
         }
+
+        @Override
+        public Type[] getActualTypeArguments() {
+
+            return this.actualTypes;
+        }
+
+        @Override
+        public Type getRawType() {
+            return this.rawType;
+        }
     }
 
     /**
@@ -380,17 +354,15 @@ public final class Types {
         /**
          * 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
          */
         WildcardTypeImpl(final JavaTypeName identifier) {
             super(identifier);
         }
     }
 
-    public static <T extends Number& Comparable<T>> DefaultRestrictions<T> getDefaultRestrictions(final T min,
+    public static <T extends Number & Comparable<T>> DefaultRestrictions<T> getDefaultRestrictions(final T min,
             final T max) {
         return new DefaultRestrictions<>(min, max);
     }
index 94e723630fd6f57b55f5113fd2f055e8e6962a7f..793be27cd0c9eecb16638a0bbe3c7d037da9ba91 100644 (file)
@@ -22,9 +22,9 @@ import org.opendaylight.mdsal.binding.model.api.Constant;
 import org.opendaylight.mdsal.binding.model.api.Enumeration;
 import org.opendaylight.mdsal.binding.model.api.GeneratedProperty;
 import org.opendaylight.mdsal.binding.model.api.GeneratedType;
+import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
 import org.opendaylight.mdsal.binding.model.api.MethodSignature;
 import org.opendaylight.mdsal.binding.model.api.Type;
-import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
 import org.opendaylight.mdsal.binding.model.api.type.builder.AnnotationTypeBuilder;
 import org.opendaylight.mdsal.binding.model.api.type.builder.EnumBuilder;
 import org.opendaylight.mdsal.binding.model.util.AbstractBaseType;
@@ -68,7 +68,7 @@ public abstract class AbstractEnumerationBuilder extends AbstractBaseType implem
     public abstract void setSchemaPath(SchemaPath schemaPath);
 
     abstract AbstractPair createEnumPair(String name, String mappedName, int value, Status status, String description,
-            final String reference);
+            String reference);
 
     /*
      * (non-Javadoc)
@@ -203,20 +203,19 @@ public abstract class AbstractEnumerationBuilder extends AbstractBaseType implem
             builder.append(" {");
             builder.append("\n");
 
-            int i = 0;
+            int offset = 0;
             for (final Enumeration.Pair valPair : this.values) {
-                builder.append("\t");
-                builder.append(" ");
+                builder.append("\t ");
                 builder.append(valPair.getMappedName());
                 builder.append(" (");
                 builder.append(valPair.getValue());
 
-                if (i == this.values.size() - 1) {
+                if (offset == this.values.size() - 1) {
                     builder.append(" );");
                 } else {
                     builder.append(" ),");
                 }
-                ++i;
+                ++offset;
             }
             builder.append("\n}");
             return builder.toString();
index fb2378cef1dccc68ab70c33029ab400eceda4a1d..e35905cbbd418acde0656dd92b573e7993ba040c 100644 (file)
@@ -118,8 +118,8 @@ abstract class AbstractGeneratedTOBuilder extends AbstractGeneratedTypeBuilder<G
     }
 
     @Override
-    public final void setTypedef(final boolean isTypedef) {
-        this.isTypedef = isTypedef;
+    public final void setTypedef(final boolean newIsTypedef) {
+        this.isTypedef = newIsTypedef;
     }
 
     @Override
@@ -128,8 +128,8 @@ abstract class AbstractGeneratedTOBuilder extends AbstractGeneratedTypeBuilder<G
     }
 
     @Override
-    public final void setIsUnion(final boolean isUnion) {
-        this.isUnionType = isUnion;
+    public final void setIsUnion(final boolean newIsUnion) {
+        this.isUnionType = newIsUnion;
     }
 
     @Override
@@ -138,12 +138,12 @@ abstract class AbstractGeneratedTOBuilder extends AbstractGeneratedTypeBuilder<G
     }
 
     @Override
-    public final void setIsUnionBuilder(final boolean isUnionTypeBuilder) {
-        this.isUnionTypeBuilder = isUnionTypeBuilder;
+    public final void setIsUnionBuilder(final boolean newIsUnionTypeBuilder) {
+        this.isUnionTypeBuilder = newIsUnionTypeBuilder;
     }
 
-    static abstract class AbstractGeneratedTransferObject extends AbstractGeneratedType implements
-    GeneratedTransferObject {
+    abstract static class AbstractGeneratedTransferObject extends AbstractGeneratedType implements
+            GeneratedTransferObject {
 
         private final List<GeneratedProperty> equalsProperties;
         private final List<GeneratedProperty> hashCodeProperties;
index b3c2891db5332d847aa359959b122686f79740d8..b27a0aad5c45fba1492860fbef552a0929745b6c 100644 (file)
@@ -16,10 +16,10 @@ import org.opendaylight.mdsal.binding.model.api.Constant;
 import org.opendaylight.mdsal.binding.model.api.Enumeration;
 import org.opendaylight.mdsal.binding.model.api.GeneratedProperty;
 import org.opendaylight.mdsal.binding.model.api.GeneratedType;
+import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
 import org.opendaylight.mdsal.binding.model.api.MethodSignature;
 import org.opendaylight.mdsal.binding.model.api.Type;
 import org.opendaylight.mdsal.binding.model.api.TypeComment;
-import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
 import org.opendaylight.mdsal.binding.model.api.YangSourceDefinition;
 import org.opendaylight.mdsal.binding.model.api.type.builder.AnnotationTypeBuilder;
 import org.opendaylight.mdsal.binding.model.api.type.builder.EnumBuilder;
@@ -81,18 +81,20 @@ abstract class AbstractGeneratedType extends AbstractBaseType implements Generat
 
     protected static final <T> List<T> makeUnmodifiable(final List<T> list) {
         switch (list.size()) {
-        case 0:
-            return Collections.emptyList();
-        case 1:
-            return Collections.singletonList(list.get(0));
-        default:
-            return Collections.unmodifiableList(list);
+            case 0:
+                return Collections.emptyList();
+            case 1:
+                return Collections.singletonList(list.get(0));
+            default:
+                return Collections.unmodifiableList(list);
         }
     }
 
-    private static List<GeneratedType> toUnmodifiableEnclosedTypes(final List<GeneratedTypeBuilder> enclosedGenTypeBuilders,
+    private static List<GeneratedType> toUnmodifiableEnclosedTypes(
+            final List<GeneratedTypeBuilder> enclosedGenTypeBuilders,
             final List<GeneratedTOBuilder> enclosedGenTOBuilders) {
-        final ArrayList<GeneratedType> enclosedTypesList = new ArrayList<>(enclosedGenTypeBuilders.size() + enclosedGenTOBuilders.size());
+        final ArrayList<GeneratedType> enclosedTypesList = new ArrayList<>(enclosedGenTypeBuilders.size()
+                + enclosedGenTOBuilders.size());
         for (final GeneratedTypeBuilder builder : enclosedGenTypeBuilders) {
             if (builder != null) {
                 enclosedTypesList.add(builder.build());
@@ -133,7 +135,8 @@ abstract class AbstractGeneratedType extends AbstractBaseType implements Generat
         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());
         for (final GeneratedPropertyBuilder methodBuilder : methodBuilders) {
             methods.add(methodBuilder.toInstance(this));
index 81fc1f099ac2860e19d9001f6e8496a73920f404..38e5c922aea1463f829cf341736531039e85775b 100644 (file)
@@ -7,7 +7,9 @@
  */
 package org.opendaylight.mdsal.binding.model.util.generated.type.builder;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+import static java.util.Objects.requireNonNull;
+
 import java.util.Collections;
 import java.util.List;
 import java.util.Objects;
@@ -92,10 +94,10 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
 
     @Override
     public GeneratedTOBuilder addEnclosingTransferObject(final String name) {
-        Preconditions.checkArgument(name != null, "Name for Enclosing Generated Transfer Object cannot be null!");
+        checkArgument(name != null, "Name for Enclosing Generated Transfer Object cannot be null!");
         final GeneratedTOBuilder builder = new CodegenGeneratedTOBuilder(getIdentifier().createEnclosed(name));
 
-        Preconditions.checkArgument(!this.enclosedTransferObjects.contains(builder),
+        checkArgument(!enclosedTransferObjects.contains(builder),
             "This generated type already contains equal enclosing transfer object.");
         this.enclosedTransferObjects = LazyCollections.lazyAdd(this.enclosedTransferObjects, builder);
         return builder;
@@ -103,16 +105,16 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
 
     @Override
     public T addEnclosingTransferObject(final GeneratedTOBuilder genTOBuilder) {
-        Preconditions.checkArgument(genTOBuilder != null, "Parameter genTOBuilder cannot be null!");
-        Preconditions.checkArgument(!this.enclosedTransferObjects.contains(genTOBuilder),
+        checkArgument(genTOBuilder != null, "Parameter genTOBuilder cannot be null!");
+        checkArgument(!enclosedTransferObjects.contains(genTOBuilder),
             "This generated type already contains equal enclosing transfer object.");
         this.enclosedTransferObjects = LazyCollections.lazyAdd(this.enclosedTransferObjects, genTOBuilder);
         return thisInstance();
     }
 
     @Override
-    public T addComment(final TypeComment comment) {
-        this.comment = Preconditions.checkNotNull(comment);
+    public T addComment(final TypeComment newComment) {
+        this.comment = requireNonNull(newComment);
         return thisInstance();
     }
 
@@ -120,22 +122,21 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
     public AnnotationTypeBuilder addAnnotation(final JavaTypeName identifier) {
         final AnnotationTypeBuilder builder = new AnnotationTypeBuilderImpl(identifier);
 
-        Preconditions.checkArgument(!this.annotationBuilders.contains(builder),
-            "This generated type already contains equal annotation.");
+        checkArgument(!annotationBuilders.contains(builder), "This generated type already contains equal annotation.");
         this.annotationBuilders = LazyCollections.lazyAdd(this.annotationBuilders, builder);
         return builder;
     }
 
     @Override
-    public T setAbstract(final boolean isAbstract) {
-        this.isAbstract = isAbstract;
+    public T setAbstract(final boolean newIsAbstract) {
+        this.isAbstract = newIsAbstract;
         return thisInstance();
     }
 
     @Override
     public T addImplementsType(final Type genType) {
-        Preconditions.checkArgument(genType != null, "Type cannot be null");
-        Preconditions.checkArgument(!this.implementsTypes.contains(genType),
+        checkArgument(genType != null, "Type cannot be null");
+        checkArgument(!implementsTypes.contains(genType),
             "This generated type already contains equal implements type.");
         this.implementsTypes = LazyCollections.lazyAdd(this.implementsTypes, genType);
         return thisInstance();
@@ -143,9 +144,9 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
 
     @Override
     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),
+        checkArgument(type != null, "Returning Type for Constant cannot be null!");
+        checkArgument(name != null, "Name of constant cannot be null!");
+        checkArgument(!containsConstant(name),
             "This generated type already contains constant with the same name.");
 
         final Constant constant = new ConstantImpl(this, type, name, value);
@@ -154,7 +155,7 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
     }
 
     public boolean containsConstant(final String name) {
-        Preconditions.checkArgument(name != null, "Parameter name can't be null");
+        checkArgument(name != null, "Parameter name can't be null");
         for (final Constant constant : this.constants) {
             if (name.equals(constant.getName())) {
                 return true;
@@ -165,7 +166,7 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
 
     @Override
     public EnumBuilder addEnumeration(String name) {
-        Preconditions.checkArgument(name != null, "Name of enumeration cannot be null!");
+        checkArgument(name != null, "Name of enumeration cannot be null!");
 
         // This enumeration may be generated from a leaf, which may end up colliding with its enclosing type
         // hierarchy. Check it and assign another name if that should be the case.
@@ -176,7 +177,7 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
         }
 
         final EnumBuilder builder = newEnumerationBuilder(getIdentifier().createEnclosed(name));
-        Preconditions.checkArgument(!this.enumDefinitions.contains(builder),
+        checkArgument(!enumDefinitions.contains(builder),
             "Generated type %s already contains an enumeration for %s", this, builder);
         this.enumDefinitions = LazyCollections.lazyAdd(this.enumDefinitions, builder);
         return builder;
@@ -184,7 +185,7 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
 
     @Override
     public MethodSignatureBuilder addMethod(final String name) {
-        Preconditions.checkArgument(name != null, "Name of method cannot be null!");
+        checkArgument(name != null, "Name of method cannot be null!");
         final MethodSignatureBuilder builder = new MethodSignatureBuilderImpl(name);
         builder.setAccessModifier(AccessModifier.PUBLIC);
         builder.setAbstract(true);
@@ -194,7 +195,7 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
 
     @Override
     public boolean containsMethod(final String name) {
-        Preconditions.checkArgument(name != null, "Parameter name can't be null");
+        checkArgument(name != null, "Parameter name can't be null");
         for (final MethodSignatureBuilder methodDefinition : this.methodDefinitions) {
             if (name.equals(methodDefinition.getName())) {
                 return true;
@@ -205,8 +206,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");
-        Preconditions.checkArgument(!containsProperty(name),
+        checkArgument(name != null, "Parameter name can't be null");
+        checkArgument(!containsProperty(name),
             "This generated type already contains property with the same name.");
 
         final GeneratedPropertyBuilder builder = new GeneratedPropertyBuilderImpl(name);
@@ -217,7 +218,7 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
 
     @Override
     public boolean containsProperty(final String name) {
-        Preconditions.checkArgument(name != null, "Parameter name can't be null");
+        checkArgument(name != null, "Parameter name can't be null");
         for (final GeneratedPropertyBuilder property : this.properties) {
             if (name.equals(property.getName())) {
                 return true;
@@ -243,7 +244,7 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
 
     @Override
     public void setYangSourceDefinition(final YangSourceDefinition definition) {
-        yangSourceDefinition = Preconditions.checkNotNull(definition);
+        yangSourceDefinition = requireNonNull(definition);
     }
 
     @Override
index d94e9509353e3b10b0af84054655d3eaf998cb6d..e2b7cbc1876ca21e20aee4351994b79859a2265d 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.mdsal.binding.model.util.generated.type.builder;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -15,8 +16,8 @@ import java.util.List;
 import java.util.Objects;
 import org.opendaylight.mdsal.binding.model.api.AccessModifier;
 import org.opendaylight.mdsal.binding.model.api.AnnotationType;
-import org.opendaylight.mdsal.binding.model.api.Type;
 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
+import org.opendaylight.mdsal.binding.model.api.Type;
 import org.opendaylight.mdsal.binding.model.api.type.builder.AnnotationTypeBuilder;
 import org.opendaylight.mdsal.binding.model.api.type.builder.TypeMemberBuilder;
 import org.opendaylight.yangtools.util.LazyCollections;
@@ -30,7 +31,7 @@ abstract class AbstractTypeMemberBuilder<T extends TypeMemberBuilder<T>> impleme
     private boolean isStatic;
     private AccessModifier accessModifier;
 
-    public AbstractTypeMemberBuilder(final String name) {
+    AbstractTypeMemberBuilder(final String name) {
         this.name = name;
     }
 
@@ -74,37 +75,34 @@ abstract class AbstractTypeMemberBuilder<T extends TypeMemberBuilder<T>> impleme
     protected abstract T thisInstance();
 
     @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 newReturnType) {
+        checkArgument(newReturnType != null, "Return Type of member cannot be null!");
+        this.returnType = newReturnType;
         return thisInstance();
     }
 
     @Override
     public T setAccessModifier(final AccessModifier modifier) {
-        Preconditions.checkArgument(modifier != null, "Access Modifier for member type cannot be null!");
+        checkArgument(modifier != null, "Access Modifier for member type cannot be null!");
         this.accessModifier = modifier;
         return thisInstance();
     }
 
     @Override
-    public T setComment(final String comment) {
-        if (comment == null) {
-            this.comment = "";
-        }
-        this.comment = comment;
+    public T setComment(final String newComment) {
+        this.comment = newComment;
         return thisInstance();
     }
 
     @Override
-    public T setFinal(final boolean isFinal) {
-        this.isFinal = isFinal;
+    public T setFinal(final boolean newIsFinal) {
+        this.isFinal = newIsFinal;
         return thisInstance();
     }
 
     @Override
-    public T setStatic(final boolean isStatic) {
-        this.isStatic = isStatic;
+    public T setStatic(final boolean newIsStatic) {
+        this.isStatic = newIsStatic;
         return thisInstance();
     }
 
index 8ddafc9dee5daeb2a57bcb36f2fab2889d02bb1e..c4e81481b216fdce6e80bcd33124f8cf110fd7e0 100644 (file)
@@ -72,6 +72,11 @@ final class AnnotationTypeBuilderImpl extends AbstractBaseType implements Annota
         return new AnnotationTypeImpl(getIdentifier(), this.annotationBuilders, this.parameters);
     }
 
+    @Override
+    public int hashCode() {
+        return super.hashCode();
+    }
+
     @Override
     public boolean equals(final Object obj) {
         if (this == obj) {
@@ -200,13 +205,13 @@ final class AnnotationTypeBuilderImpl extends AbstractBaseType implements Annota
         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 = Collections.emptyList();
         }
 
-        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;
index 5c82e2e63626f95e9a2aedaeb9c17993fbbfa897..92c5221e3c92393a3ef8d5f2fce2af2f3b888de3 100644 (file)
@@ -11,9 +11,9 @@ import static java.util.Objects.requireNonNull;
 
 import java.util.Optional;
 import org.opendaylight.mdsal.binding.model.api.Enumeration;
+import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
 import org.opendaylight.mdsal.binding.model.api.Type;
 import org.opendaylight.mdsal.binding.model.api.TypeComment;
-import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
 import org.opendaylight.mdsal.binding.model.api.YangSourceDefinition;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
@@ -57,8 +57,8 @@ public final class CodegenEnumerationBuilder extends AbstractEnumerationBuilder
 
     @Override
     EnumPair createEnumPair(final String name, final String mappedName, final int value, final Status status,
-            final String description, final String reference) {
-        return new EnumPair(name, mappedName, value, status, description, reference);
+            final String enumDescription, final String enumReference) {
+        return new EnumPair(name, mappedName, value, status, enumDescription, enumReference);
     }
 
     private static final class EnumPair extends AbstractPair {
@@ -66,8 +66,8 @@ public final class CodegenEnumerationBuilder extends AbstractEnumerationBuilder
         private final String reference;
         private final Status status;
 
-        EnumPair(final String name, final String mappedName, final int value, final Status status, final String description,
-            final String reference) {
+        EnumPair(final String name, final String mappedName, final int value, final Status status,
+                final String description, final String reference) {
             super(name, mappedName, value);
             this.status = requireNonNull(status);
             this.description = description;
@@ -91,7 +91,6 @@ public final class CodegenEnumerationBuilder extends AbstractEnumerationBuilder
     }
 
     private static final class EnumerationImpl extends AbstractEnumeration {
-
         private final String description;
         private final String reference;
         private final String moduleName;
index 36cd6d2c201f106cc1fa2c5e1aef9ddcf6357335..4a27bbe31ae4e453bb59a989592c4c61860c7999 100644 (file)
@@ -18,7 +18,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 public final class CodegenGeneratedTOBuilder extends AbstractGeneratedTOBuilder {
 
     private Restrictions restrictions;
-    private GeneratedPropertyBuilder SUID;
+    private GeneratedPropertyBuilder suid;
     private String reference;
     private String description;
     private String moduleName;
@@ -34,8 +34,8 @@ public final class CodegenGeneratedTOBuilder extends AbstractGeneratedTOBuilder
     }
 
     @Override
-    public void setSUID(final GeneratedPropertyBuilder suid) {
-        this.SUID = suid;
+    public void setSUID(final GeneratedPropertyBuilder newSuid) {
+        this.suid = newSuid;
     }
 
     @Override
@@ -70,7 +70,7 @@ public final class CodegenGeneratedTOBuilder extends AbstractGeneratedTOBuilder
 
     private static final class GTO extends AbstractGeneratedTransferObject {
         private final Restrictions restrictions;
-        private final GeneratedProperty SUID;
+        private final GeneratedProperty suid;
         private final String reference;
         private final String description;
         private final String moduleName;
@@ -84,10 +84,10 @@ public final class CodegenGeneratedTOBuilder extends AbstractGeneratedTOBuilder
             this.moduleName = builder.moduleName;
             this.schemaPath = builder.schemaPath;
 
-            if (builder.SUID == null) {
-                this.SUID = null;
+            if (builder.suid == null) {
+                this.suid = null;
             } else {
-                this.SUID = builder.SUID.toInstance(GTO.this);
+                this.suid = builder.suid.toInstance(GTO.this);
             }
         }
 
@@ -98,7 +98,7 @@ public final class CodegenGeneratedTOBuilder extends AbstractGeneratedTOBuilder
 
         @Override
         public GeneratedProperty getSUID() {
-            return this.SUID;
+            return this.suid;
         }
 
         @Override
index d2dde0fe0a5e5f705a566b658a7d7b4faf128909..30d1c9969b93cf044e8ec6f4b055a19cacda1ed1 100644 (file)
@@ -8,8 +8,8 @@
 package org.opendaylight.mdsal.binding.model.util.generated.type.builder;
 
 import org.opendaylight.mdsal.binding.model.api.GeneratedType;
-import org.opendaylight.mdsal.binding.model.api.TypeComment;
 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
+import org.opendaylight.mdsal.binding.model.api.TypeComment;
 import org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedTypeBuilder;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
@@ -99,7 +99,7 @@ public final class CodegenGeneratedTypeBuilder extends AbstractGeneratedTypeBuil
         private final String moduleName;
         private final SchemaPath schemaPath;
 
-        public GeneratedTypeImpl(final CodegenGeneratedTypeBuilder builder) {
+        GeneratedTypeImpl(final CodegenGeneratedTypeBuilder builder) {
             super(builder);
 
             this.description = builder.description;
index 0ea3947815b5d1bd74d6241e11d23290eaf4d82e..7ad4fbb3c804894f21c77a14e135c48d4dc4fb95 100644 (file)
@@ -64,14 +64,12 @@ final class ConstantImpl implements Constant {
         if (this == obj) {
             return true;
         }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
+        if (obj == null || getClass() != obj.getClass()) {
             return false;
         }
         final ConstantImpl other = (ConstantImpl) obj;
-        return Objects.equals(this.name, other.name) && Objects.equals(this.type, other.type) && Objects.equals(this.value, other.value);
+        return Objects.equals(this.name, other.name) && Objects.equals(this.type, other.type)
+                && Objects.equals(this.value, other.value);
     }
 
     @Override
index 8ede78fcbaff5cfd935d5f5ca2790038d7d0c62e..07e5492297d211a5ddf3448461a49444f1af6d93 100644 (file)
@@ -13,13 +13,14 @@ import org.opendaylight.mdsal.binding.model.api.GeneratedProperty;
 import org.opendaylight.mdsal.binding.model.api.Type;
 import org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedPropertyBuilder;
 
-public final class GeneratedPropertyBuilderImpl extends AbstractTypeMemberBuilder<GeneratedPropertyBuilder> implements GeneratedPropertyBuilder {
+public final class GeneratedPropertyBuilderImpl extends AbstractTypeMemberBuilder<GeneratedPropertyBuilder>
+        implements GeneratedPropertyBuilder {
     private String value;
-    private boolean isReadOnly;
+    private boolean readOnly;
 
     public GeneratedPropertyBuilderImpl(final String name) {
         super(name);
-        this.isReadOnly = true;
+        this.readOnly = true;
     }
 
     @Override
@@ -30,7 +31,7 @@ public final class GeneratedPropertyBuilderImpl extends AbstractTypeMemberBuilde
 
     @Override
     public GeneratedPropertyBuilderImpl setReadOnly(final boolean isReadOnly) {
-        this.isReadOnly = isReadOnly;
+        this.readOnly = isReadOnly;
         return this;
     }
 
@@ -43,7 +44,7 @@ public final class GeneratedPropertyBuilderImpl extends AbstractTypeMemberBuilde
     public GeneratedProperty toInstance(final Type definingType) {
         final List<AnnotationType> annotations = toAnnotationTypes();
         return new GeneratedPropertyImpl(definingType, getName(), annotations, getComment(), getAccessModifier(),
-                getReturnType(), isFinal(), isStatic(), this.isReadOnly, this.value);
+                getReturnType(), isFinal(), isStatic(), this.readOnly, this.value);
     }
 
     @Override
@@ -60,7 +61,7 @@ public final class GeneratedPropertyBuilderImpl extends AbstractTypeMemberBuilde
         builder.append(", isFinal=");
         builder.append(isFinal());
         builder.append(", isReadOnly=");
-        builder.append(this.isReadOnly);
+        builder.append(this.readOnly);
         builder.append(", modifier=");
         builder.append(getAccessModifier());
         builder.append("]");
index 96745e43f1315aaa2598de03d300099db124d58e..c83aefb7a6f5c9f2ef5871170fa3260b91ae68b2 100644 (file)
@@ -15,13 +15,14 @@ import org.opendaylight.mdsal.binding.model.api.Type;
 
 final class GeneratedPropertyImpl extends AbstractTypeMember implements GeneratedProperty {
     private final String value;
-    private final boolean isReadOnly;
+    private final boolean readOnly;
 
-    public GeneratedPropertyImpl(final Type definingType, final String name, final List<AnnotationType> annotations, final String comment,
-                                 final AccessModifier accessModifier, final Type returnType, final boolean isFinal, final boolean isStatic, final boolean isReadOnly, final String value) {
+    GeneratedPropertyImpl(final Type definingType, final String name, final List<AnnotationType> annotations,
+            final String comment, final AccessModifier accessModifier, final Type returnType, final boolean isFinal,
+            final boolean isStatic, final boolean isReadOnly, final String value) {
         super(definingType, name, annotations, comment, accessModifier, returnType, isFinal, isStatic);
         this.value = value;
-        this.isReadOnly = isReadOnly;
+        this.readOnly = isReadOnly;
     }
 
     @Override
@@ -31,7 +32,7 @@ final class GeneratedPropertyImpl extends AbstractTypeMember implements Generate
 
     @Override
     public boolean isReadOnly() {
-        return this.isReadOnly;
+        return this.readOnly;
     }
 
     @Override
@@ -56,7 +57,7 @@ final class GeneratedPropertyImpl extends AbstractTypeMember implements Generate
         builder.append(", isFinal=");
         builder.append(isFinal());
         builder.append(", isReadOnly=");
-        builder.append(this.isReadOnly);
+        builder.append(this.readOnly);
         builder.append(", modifier=");
         builder.append(getAccessModifier());
         builder.append("]");
index 242290ce9273023aee146f1bb466891021d2d2b1..311a23216b24530decada1340fc2abe6a05f9a7a 100644 (file)
@@ -16,7 +16,7 @@ final class MethodParameterImpl implements Parameter {
     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;
     }
@@ -40,8 +40,8 @@ final class MethodParameterImpl implements Parameter {
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = (prime * result) + Objects.hashCode(this.name);
-        result = (prime * result) + Objects.hashCode(this.type);
+        result = prime * result + Objects.hashCode(this.name);
+        result = prime * result + Objects.hashCode(this.type);
         return result;
     }
 
@@ -55,10 +55,7 @@ final class MethodParameterImpl implements Parameter {
         if (this == obj) {
             return true;
         }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
+        if (obj == null || getClass() != obj.getClass()) {
             return false;
         }
         final MethodParameterImpl other = (MethodParameterImpl) obj;
index ba09b43463cebb966eaf0bc5a6be9191a20452c9..17ae8e3c390eed6faa4d7ec35a4ef4d2fe324097 100644 (file)
@@ -16,19 +16,20 @@ import org.opendaylight.mdsal.binding.model.api.Type;
 import org.opendaylight.mdsal.binding.model.api.type.builder.MethodSignatureBuilder;
 import org.opendaylight.yangtools.util.LazyCollections;
 
-final class MethodSignatureBuilderImpl extends AbstractTypeMemberBuilder<MethodSignatureBuilder> implements MethodSignatureBuilder {
+final class MethodSignatureBuilderImpl extends AbstractTypeMemberBuilder<MethodSignatureBuilder>
+        implements MethodSignatureBuilder {
 
     private List<MethodSignature.Parameter> parameters = Collections.emptyList();
-    private List<MethodSignature.Parameter> unmodifiableParams  = Collections.emptyList();
+    private List<MethodSignature.Parameter> unmodifiableParams = Collections.emptyList();
     private boolean isAbstract;
 
-    public MethodSignatureBuilderImpl(final String name) {
+    MethodSignatureBuilderImpl(final String name) {
         super(name);
     }
 
     @Override
-    public MethodSignatureBuilder setAbstract(final boolean isAbstract) {
-        this.isAbstract = isAbstract;
+    public MethodSignatureBuilder setAbstract(final boolean newIsAbstract) {
+        this.isAbstract = newIsAbstract;
         return this;
     }
 
@@ -55,9 +56,9 @@ final class MethodSignatureBuilderImpl extends AbstractTypeMemberBuilder<MethodS
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = (prime * result) + Objects.hashCode(getName());
-        result = (prime * result) + Objects.hashCode(this.parameters);
-        result = (prime * result) + Objects.hashCode(getReturnType());
+        result = prime * result + Objects.hashCode(getName());
+        result = prime * result + Objects.hashCode(this.parameters);
+        result = prime * result + Objects.hashCode(getReturnType());
         return result;
     }
 
index c3bb96207526f994cf5476ff7b99ee4678b2faad..eae052323aebe4413c88c02b2cde2b95d0f5af73 100644 (file)
@@ -19,11 +19,9 @@ class MethodSignatureImpl extends AbstractTypeMember implements MethodSignature
     private final List<Parameter> params;
     private final boolean isAbstract;
 
-    public 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 boolean isAbstract, final boolean isStatic) {
+    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 boolean isAbstract, final boolean isStatic) {
         super(definingType, name, annotations, comment, accessModifier, returnType, isFinal, isStatic);
         this.params = params;
         this.isAbstract = isAbstract;
@@ -43,9 +41,9 @@ class MethodSignatureImpl extends AbstractTypeMember implements MethodSignature
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = (prime * result) + Objects.hashCode(getName());
-        result = (prime * result) + Objects.hashCode(this.params);
-        result = (prime * result) + Objects.hashCode(getReturnType());
+        result = prime * result + Objects.hashCode(getName());
+        result = prime * result + Objects.hashCode(this.params);
+        result = prime * result + Objects.hashCode(getReturnType());
         return result;
     }
 
index 46ddfc72cc9cd826a350febf97f84a1597f38fc9..0e89df11b22c10c2aeb614ad4e572dec54fcdc0f 100644 (file)
@@ -9,9 +9,9 @@ package org.opendaylight.mdsal.binding.model.util.generated.type.builder;
 
 import java.util.Optional;
 import org.opendaylight.mdsal.binding.model.api.Enumeration;
+import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
 import org.opendaylight.mdsal.binding.model.api.Type;
 import org.opendaylight.mdsal.binding.model.api.TypeComment;
-import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
 import org.opendaylight.mdsal.binding.model.api.YangSourceDefinition;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
index 4136a60884a963e952c2b96adbb5d803d1ce10b7..8701014b7c901ef013103892bfeb44c98cba9c97 100644 (file)
@@ -9,8 +9,8 @@ package org.opendaylight.mdsal.binding.model.util.generated.type.builder;
 
 import org.opendaylight.mdsal.binding.model.api.GeneratedProperty;
 import org.opendaylight.mdsal.binding.model.api.GeneratedTransferObject;
-import org.opendaylight.mdsal.binding.model.api.Restrictions;
 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
+import org.opendaylight.mdsal.binding.model.api.Restrictions;
 import org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedPropertyBuilder;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
index 27d3ff27c05545b765618138a120fc3bd590c003..8787d29527543c3da9b9abc0519aa87b11b0a5d5 100644 (file)
@@ -8,8 +8,8 @@
 package org.opendaylight.mdsal.binding.model.util.generated.type.builder;
 
 import org.opendaylight.mdsal.binding.model.api.GeneratedType;
-import org.opendaylight.mdsal.binding.model.api.TypeComment;
 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
+import org.opendaylight.mdsal.binding.model.api.TypeComment;
 import org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedTypeBuilder;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
index dfc88184f0ecb0863895276c85b3074d99d9a08c..ca8496ea64064b2793e35d60e3a3dc37bc7ea658 100644 (file)
@@ -57,7 +57,7 @@ public class BindingGeneratorUtilTest {
     @Rule
     public ExpectedException expectedEx = ExpectedException.none();
 
-    /**
+    /*
      * Tests methods:
      * &lt;ul&gt;
      * &lt;li&gt;moduleNamespaceToPackageName&lt;/li&gt; - with revision
@@ -118,7 +118,7 @@ public class BindingGeneratorUtilTest {
         assertNotEquals(computedSUID, computedSUID2);
     }
 
-    /**
+    /*
      * Test for the method
      * &lt;ul&gt;
      * &lt;li&gt;{@link BindingGeneratorUtil#packageNameForGeneratedType(String, SchemaPath)
@@ -131,7 +131,7 @@ public class BindingGeneratorUtilTest {
         BindingGeneratorUtil.packageNameForGeneratedType(null, null);
     }
 
-    /**
+    /*
      * Test for the method
      * &lt;ul&gt;
      * &lt;li&gt;{@link BindingGeneratorUtil#packageNameForGeneratedType(String, SchemaPath)
@@ -144,7 +144,7 @@ public class BindingGeneratorUtilTest {
         BindingGeneratorUtil.packageNameForGeneratedType("test.package", null);
     }
 
-    /**
+    /*
      * Test for the method
      * &lt;ul&gt;
      * &lt;li&gt;{@link BindingGeneratorUtil#resolveJavaReservedWordEquivalency(String)
@@ -160,7 +160,7 @@ public class BindingGeneratorUtilTest {
                 BindingGeneratorUtil.resolveJavaReservedWordEquivalency("case"));
     }
 
-    /**
+    /*
      * Tests the methods:
      * &lt;ul&gt;
      * &lt;li&gt;parseToClassName&lt;/li&gt;
index 4dd4f2766030d9712584530ae06f56fad3170553..79876b771b15ff4fddd0ee9c00311a8991809791 100644 (file)
@@ -37,7 +37,8 @@ public class BindingTypesTest {
         assertEquals("IDENTIFIER", typeForClass(Identifier.class), BindingTypes.IDENTIFIER);
         assertEquals("INSTANCE_IDENTIFIER", typeForClass(InstanceIdentifier.class), BindingTypes.INSTANCE_IDENTIFIER);
         assertEquals("NOTIFICATION", typeForClass(Notification.class), BindingTypes.NOTIFICATION);
-        assertEquals("NOTIFICATION_LISTENER", typeForClass(NotificationListener.class), BindingTypes.NOTIFICATION_LISTENER);
+        assertEquals("NOTIFICATION_LISTENER", typeForClass(NotificationListener.class),
+            BindingTypes.NOTIFICATION_LISTENER);
         assertEquals("RPC_SERVICE", typeForClass(RpcService.class), BindingTypes.RPC_SERVICE);
     }
 
index ed42b775e49ba255a8b448f5a3ff14fb4745c502..3b558bb048eb6a2b40c68242460997957191ccd1 100644 (file)
@@ -38,14 +38,13 @@ public class TypeNameTest {
 
     @Test
     public void testEquals() {
-        JavaTypeName baseType1 = JavaTypeName.create("org.opendaylight.yangtools.test", "Test");
-        JavaTypeName baseType2 = JavaTypeName.create("org.opendaylight.yangtools.test", "Test2");
-        JavaTypeName baseType3 = null;
-        JavaTypeName baseType4 = JavaTypeName.create("org.opendaylight.yangtools.test", "Test");
-        JavaTypeName baseType5 = JavaTypeName.create("org.opendaylight.yangtools.test1", "Test");
+        final JavaTypeName baseType1 = JavaTypeName.create("org.opendaylight.yangtools.test", "Test");
+        final JavaTypeName baseType2 = JavaTypeName.create("org.opendaylight.yangtools.test", "Test2");
+        final JavaTypeName baseType4 = JavaTypeName.create("org.opendaylight.yangtools.test", "Test");
+        final JavaTypeName baseType5 = JavaTypeName.create("org.opendaylight.yangtools.test1", "Test");
 
         assertFalse(baseType1.equals(baseType2));
-        assertFalse(baseType1.equals(baseType3));
+        assertFalse(baseType1.equals(null));
         assertTrue(baseType1.equals(baseType4));
         assertFalse(baseType1.equals(baseType5));
         assertFalse(baseType1.equals(null));
index 8bb1824154d2dde1832df7abfeb258407820b8ba..c334119c0c5c87ef7dc893fa0a7fcac1432c1c84 100644 (file)
@@ -13,8 +13,8 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 import org.junit.Test;
-import org.opendaylight.mdsal.binding.model.api.MethodSignature;
 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
+import org.opendaylight.mdsal.binding.model.api.MethodSignature;
 
 public class AbstractTypeMemberTest {
 
index a68d7cfa55935e496500b378f9112f57e14ca88a..cfadb5b3c9816304afc11177dbf758a0e2afabcc 100644 (file)
@@ -261,13 +261,13 @@ public class AnnotationBuilderTest {
 
     @Test
     public void annotationTypeBuilderEqualsTest() {
-        AnnotationTypeBuilder annotationTypeBuilder = new AnnotationTypeBuilderImpl(
+        final AnnotationTypeBuilder annotationTypeBuilder = new AnnotationTypeBuilderImpl(
             JavaTypeName.create("my.package", "MyName"));
-        AnnotationTypeBuilder annotationTypeBuilder2 = new AnnotationTypeBuilderImpl(
+        final AnnotationTypeBuilder annotationTypeBuilder2 = new AnnotationTypeBuilderImpl(
             JavaTypeName.create("my.package2", "MyName"));
-        AnnotationTypeBuilder annotationTypeBuilder3 = new AnnotationTypeBuilderImpl(
+        final AnnotationTypeBuilder annotationTypeBuilder3 = new AnnotationTypeBuilderImpl(
             JavaTypeName.create("my.package", "MyName2"));
-        AnnotationTypeBuilder annotationTypeBuilder4 = new AnnotationTypeBuilderImpl(
+        final AnnotationTypeBuilder annotationTypeBuilder4 = new AnnotationTypeBuilderImpl(
             JavaTypeName.create("my.package", "MyName"));
 
         assertFalse(annotationTypeBuilder.equals(null));
@@ -280,16 +280,16 @@ public class AnnotationBuilderTest {
         assertFalse(annotationTypeBuilder.equals(annotationTypeBuilder3));
 
         AnnotationType instance = annotationTypeBuilder.build();
-        AnnotationType instance2 = annotationTypeBuilder2.build();
-        AnnotationType instance3 = annotationTypeBuilder3.build();
-        AnnotationType instance4 = annotationTypeBuilder4.build();
-
         assertFalse(instance.equals(null));
         assertFalse(instance.equals(new Object()));
         assertTrue(instance.equals(instance));
 
+        AnnotationType instance2 = annotationTypeBuilder2.build();
         assertFalse(instance.equals(instance2));
+
+        final AnnotationType instance3 = annotationTypeBuilder3.build();
         assertFalse(instance.equals(instance3));
+        final AnnotationType instance4 = annotationTypeBuilder4.build();
         assertTrue(instance.equals(instance4));
 
         annotationTypeBuilder.addParameter("myName", "myValue1");
@@ -299,9 +299,9 @@ public class AnnotationBuilderTest {
         instance = annotationTypeBuilder.build();
         instance2 = annotationTypeBuilder2.build();
 
-        Parameter parameter = instance.getParameter("myName");
-        Parameter parameter2 = instance.getParameter("myName2");
-        Parameter parameter3 = instance2.getParameter("myName");
+        final Parameter parameter = instance.getParameter("myName");
+        final Parameter parameter2 = instance.getParameter("myName2");
+        final Parameter parameter3 = instance2.getParameter("myName");
 
         assertFalse(parameter.equals(null));
         assertFalse(parameter.equals(new Object()));
@@ -405,15 +405,17 @@ public class AnnotationBuilderTest {
         annotationTypeBuilder.addAnnotation("my.package", "MySubAnnotationName");
         annotationTypeBuilder.addParameter("MyParameter", "myValue");
 
-        assertEquals(
-                "AnnotationTypeBuilder [packageName=my.package, name=MyAnnotationName, annotationBuilders=[AnnotationTypeBuilder [packageName=my.package, name=MySubAnnotationName, annotationBuilders=[], parameters=[]]], parameters=[ParameterImpl [name=MyParameter, value=myValue, values=[]]]]",
-                annotationTypeBuilder.toString());
+        assertEquals("AnnotationTypeBuilder [packageName=my.package, name=MyAnnotationName, "
+                + "annotationBuilders=[AnnotationTypeBuilder [packageName=my.package, name=MySubAnnotationName, "
+                + "annotationBuilders=[], parameters=[]]], parameters=[ParameterImpl [name=MyParameter, value=myValue, "
+                + "values=[]]]]", annotationTypeBuilder.toString());
 
         AnnotationType annotationTypeInstance = annotationTypeBuilder.build();
 
         assertEquals("my.package.MyAnnotationName", annotationTypeInstance.getFullyQualifiedName());
-        assertEquals(
-                "AnnotationType [packageName=my.package, name=MyAnnotationName, annotations=[AnnotationType [packageName=my.package, name=MySubAnnotationName, annotations=[], parameters=[]]], parameters=[ParameterImpl [name=MyParameter, value=myValue, values=[]]]]",
+        assertEquals("AnnotationType [packageName=my.package, name=MyAnnotationName, annotations=[AnnotationType "
+                + "[packageName=my.package, name=MySubAnnotationName, annotations=[], parameters=[]]], "
+                + "parameters=[ParameterImpl [name=MyParameter, value=myValue, values=[]]]]",
                 annotationTypeInstance.toString());
 
     }
index 80125e85211b6f21f179b547673ac611aab4838f..285cf3244750a4af93c19e5de944599330599155 100644 (file)
@@ -27,8 +27,8 @@ import org.opendaylight.yangtools.yang.model.util.type.EnumPairBuilder;
 
 public class EnumerationBuilderImplTest {
 
-    private final QName qName = QName.create("TestQName", "2014-10-10", "TestLocalQName");
-    private final String DESCRIPTION = "Test description of Enum";
+    private final QName qname = QName.create("TestQName", "2014-10-10", "TestLocalQName");
+    private static final String DESCRIPTION = "Test description of Enum";
     private final String packageName = "org.opendaylight.test";
     private final String name = "TestName";
     private final String moduleName = "TestModuleName";
@@ -48,12 +48,13 @@ public class EnumerationBuilderImplTest {
         enumerationBuilder.setDescription(DESCRIPTION);
         enumerationBuilder.setModuleName(moduleName);
         enumerationBuilder.setReference(reference);
-        enumerationBuilder.setSchemaPath(SchemaPath.create(true, qName));
+        enumerationBuilder.setSchemaPath(SchemaPath.create(true, qname));
         enumerationBuilder.addValue(valueName, valueName, value, Status.CURRENT, valueDescription, null);
         enumerationBuilder.addAnnotation(packageName, "TestAnnotation");
         enumerationBuilderSame = new CodegenEnumerationBuilder(JavaTypeName.create(packageName, name));
         enumerationBuilderOtherName = new CodegenEnumerationBuilder(JavaTypeName.create(packageName, "SomeOtherName"));
-        enumerationBuilderOtherPackage = new CodegenEnumerationBuilder(JavaTypeName.create("org.opendaylight.other", name));
+        enumerationBuilderOtherPackage = new CodegenEnumerationBuilder(JavaTypeName.create("org.opendaylight.other",
+            name));
         enumeration = enumerationBuilder.toInstance(enumerationBuilder);
     }
 
@@ -96,7 +97,7 @@ public class EnumerationBuilderImplTest {
         assertEquals(moduleName, enumeration.getModuleName());
         assertEquals(packageName + '.' + name, enumeration.getFullyQualifiedName());
         assertEquals(reference, enumeration.getReference());
-        assertEquals(Collections.singletonList(qName), enumeration.getSchemaPath());
+        assertEquals(Collections.singletonList(qname), enumeration.getSchemaPath());
         assertEquals(Collections.EMPTY_LIST, enumeration.getEnclosedTypes());
         assertEquals(Collections.EMPTY_LIST, enumeration.getEnumerations());
         assertEquals(Collections.EMPTY_LIST, enumeration.getMethodDefinitions());
@@ -111,7 +112,8 @@ public class EnumerationBuilderImplTest {
         assertEquals(enumeration, enumeration);
         assertNotEquals(enumeration, "string");
 
-        final Enumeration enumerationOtherPackage = enumerationBuilderOtherPackage.toInstance(enumerationBuilderOtherPackage);
+        final Enumeration enumerationOtherPackage = enumerationBuilderOtherPackage
+                .toInstance(enumerationBuilderOtherPackage);
         assertNotEquals(enumeration, enumerationOtherPackage);
 
         final Enumeration enumerationOtherName = enumerationBuilderOtherName.toInstance(enumerationBuilderOtherName);
@@ -131,19 +133,17 @@ public class EnumerationBuilderImplTest {
 
     @Test
     public void testEnumerationToString() {
-        final String formattedString =
-                "public enum " + name + " {\n" +
-                "\t TestValue " + "(12 );\n" +
-                "}";
+        final String formattedString = "public enum " + name + " {\n"
+                + "\t TestValue " + "(12 );\n"
+                + "}";
         final String s = "Enumeration [packageName=" + packageName + ", definingType=" + packageName + "." + name
                 + ", name=" + name + ", values=[EnumPair [name=TestValue, mappedName=TestValue, value=12]]]";
 
         assertEquals(s, enumeration.toString());
         assertEquals(formattedString, enumeration.toFormattedString());
 
-        assertEquals("EnumerationBuilderImpl " +
-                "[packageName=org.opendaylight.test, name=TestName, " +
-                "values=[EnumPair [name=TestValue, mappedName=TestValue, value=12]]]",
+        assertEquals("EnumerationBuilderImpl [packageName=org.opendaylight.test, name=TestName, "
+                + "values=[EnumPair [name=TestValue, mappedName=TestValue, value=12]]]",
                 enumerationBuilder.toString());
     }
 
index 762ccb4d3dc4f71d7f790ca8a8670b0fd888d835..779725427e3d7f27be09005d7735bbb794eb8c3c 100644 (file)
@@ -11,10 +11,11 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+
 import org.junit.Test;
-import org.opendaylight.mdsal.binding.model.util.Types;
 import org.opendaylight.mdsal.binding.model.api.AccessModifier;
 import org.opendaylight.mdsal.binding.model.api.GeneratedProperty;
+import org.opendaylight.mdsal.binding.model.util.Types;
 
 public class GeneratedPropertyBuilderImplTest {
 
@@ -29,8 +30,8 @@ public class GeneratedPropertyBuilderImplTest {
         generatedPropertyBuilderImpl.setAccessModifier(AccessModifier.PUBLIC);
         generatedPropertyBuilderImpl.setReturnType(Types.BOOLEAN);
 
-        assertEquals(
-                "GeneratedPropertyImpl [name=myPropertyName, annotations=[], comment=null, returnType=Type (java.lang.Boolean), isFinal=true, isReadOnly=false, modifier=PUBLIC]",
+        assertEquals("GeneratedPropertyImpl [name=myPropertyName, annotations=[], comment=null, returnType=Type "
+                + "(java.lang.Boolean), isFinal=true, isReadOnly=false, modifier=PUBLIC]",
                 generatedPropertyBuilderImpl.toString());
 
         GeneratedProperty instance = generatedPropertyBuilderImpl.toInstance(null);
@@ -49,10 +50,14 @@ public class GeneratedPropertyBuilderImplTest {
 
     @Test
     public void generatedPropertyBuilderImplEqualsAndHashCodeTest() {
-        GeneratedPropertyBuilderImpl generatedPropertyBuilderImpl = new GeneratedPropertyBuilderImpl("myPropertyName");
-        GeneratedPropertyBuilderImpl generatedPropertyBuilderImpl2 = new GeneratedPropertyBuilderImpl("myPropertyName");
-        GeneratedPropertyBuilderImpl generatedPropertyBuilderImpl3 = new GeneratedPropertyBuilderImpl("myPropertyName3");
-        GeneratedPropertyBuilderImpl generatedPropertyBuilderImpl4 = new GeneratedPropertyBuilderImpl("myPropertyName");
+        final GeneratedPropertyBuilderImpl generatedPropertyBuilderImpl =
+                new GeneratedPropertyBuilderImpl("myPropertyName");
+        final GeneratedPropertyBuilderImpl generatedPropertyBuilderImpl2 =
+                new GeneratedPropertyBuilderImpl("myPropertyName");
+        final GeneratedPropertyBuilderImpl generatedPropertyBuilderImpl3 =
+                new GeneratedPropertyBuilderImpl("myPropertyName3");
+        final GeneratedPropertyBuilderImpl generatedPropertyBuilderImpl4 =
+                new GeneratedPropertyBuilderImpl("myPropertyName");
 
         assertNotNull(generatedPropertyBuilderImpl);
         assertNotNull(generatedPropertyBuilderImpl2);
@@ -76,5 +81,4 @@ public class GeneratedPropertyBuilderImplTest {
         assertFalse(generatedPropertyBuilderImpl.hashCode() == generatedPropertyBuilderImpl3.hashCode());
         assertFalse(generatedPropertyBuilderImpl.hashCode() == generatedPropertyBuilderImpl4.hashCode());
     }
-
 }
index 5c7180dbf34bbfc98e31e27e9e852b14082e22fe..420ac7c8c33faab45fba05345941377ace709276 100644 (file)
@@ -53,18 +53,20 @@ public class GeneratedPropertyImplTest {
     public void generatedPropertyImplEqualsAndHashCodeTest() {
         GeneratedPropertyBuilderImpl generatedPropertyBuilderImpl = new GeneratedPropertyBuilderImpl("myPropertyName");
         GeneratedPropertyBuilderImpl generatedPropertyBuilderImpl2 = new GeneratedPropertyBuilderImpl("myPropertyName");
-        GeneratedPropertyBuilderImpl generatedPropertyBuilderImpl3 = new GeneratedPropertyBuilderImpl("myPropertyName3");
-        GeneratedPropertyBuilderImpl generatedPropertyBuilderImpl4 = new GeneratedPropertyBuilderImpl("myPropertyName");
+        final GeneratedPropertyBuilderImpl generatedPropertyBuilderImpl3 =
+                new GeneratedPropertyBuilderImpl("myPropertyName3");
+        final GeneratedPropertyBuilderImpl generatedPropertyBuilderImpl4 =
+                new GeneratedPropertyBuilderImpl("myPropertyName");
 
         generatedPropertyBuilderImpl.setReturnType(Types.BOOLEAN);
         generatedPropertyBuilderImpl2.setReturnType(Types.BOOLEAN);
         generatedPropertyBuilderImpl3.setReturnType(Types.BOOLEAN);
         generatedPropertyBuilderImpl4.setReturnType(Types.STRING);
 
-        GeneratedProperty property = generatedPropertyBuilderImpl.toInstance(null);
-        GeneratedProperty property2 = generatedPropertyBuilderImpl2.toInstance(null);
-        GeneratedProperty property3 = generatedPropertyBuilderImpl3.toInstance(null);
-        GeneratedProperty property4 = generatedPropertyBuilderImpl4.toInstance(null);
+        final GeneratedProperty property = generatedPropertyBuilderImpl.toInstance(null);
+        final GeneratedProperty property2 = generatedPropertyBuilderImpl2.toInstance(null);
+        final GeneratedProperty property3 = generatedPropertyBuilderImpl3.toInstance(null);
+        final GeneratedProperty property4 = generatedPropertyBuilderImpl4.toInstance(null);
 
         assertNotNull(property);
         assertNotNull(property2);
index 30519ae2e79546a62671a56cc95b834961fde1a0..5e3ef4e37f58fb07549aab8ef57e91a82b3a9344 100644 (file)
@@ -32,7 +32,8 @@ public class GeneratedPropertyTest {
 
     @Test
     public void testMethodsForGeneratedPropertyImpl() {
-        final GeneratedPropertyImpl propertyImpl = new GeneratedPropertyImpl(null, "Test", null, "test property", AccessModifier.PRIVATE, null, true, true, true, "test value");
+        final GeneratedPropertyImpl propertyImpl = new GeneratedPropertyImpl(null, "Test", null, "test property",
+            AccessModifier.PRIVATE, null, true, true, true, "test value");
 
         assertEquals("test value", propertyImpl.getValue());
         assertTrue(propertyImpl.isReadOnly());
index 839a1162fc83d7a45c02e85b004ff2ada09ddfd4..d5cdf7e9be9b86f0552e903a14e36988bb876160 100644 (file)
@@ -15,8 +15,8 @@ import java.util.List;
 import java.util.Optional;
 import org.junit.Test;
 import org.opendaylight.mdsal.binding.model.api.GeneratedTransferObject;
-import org.opendaylight.mdsal.binding.model.api.Restrictions;
 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
+import org.opendaylight.mdsal.binding.model.api.Restrictions;
 import org.opendaylight.mdsal.binding.model.api.type.builder.MethodSignatureBuilder;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint;
index f77af510ad3e01cd073f5d6d0b4246db07870cef..aefe5ca94e2e4cad1d4edf4d9a6dcf1a3ac65b46 100644 (file)
@@ -19,9 +19,9 @@ import org.opendaylight.mdsal.binding.model.api.Constant;
 import org.opendaylight.mdsal.binding.model.api.Enumeration;
 import org.opendaylight.mdsal.binding.model.api.GeneratedProperty;
 import org.opendaylight.mdsal.binding.model.api.GeneratedType;
+import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
 import org.opendaylight.mdsal.binding.model.api.MethodSignature;
 import org.opendaylight.mdsal.binding.model.api.Type;
-import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
 import org.opendaylight.mdsal.binding.model.api.type.builder.EnumBuilder;
 import org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedPropertyBuilder;
 import org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedTOBuilder;
@@ -52,10 +52,10 @@ public class GeneratedTypeBuilderTest {
 
         Constant constant3 = new ConstantImpl(generatedTypeBuilder, Types.typeForClass(String.class), "myConstant",
                 "myConstantValue");
-        Constant constant4 = new ConstantImpl(generatedTypeBuilder, Types.typeForClass(String.class), "myConstant2",
-                "myConstantValue");
-        Constant constant5 = new ConstantImpl(generatedTypeBuilder, Types.typeForClass(String.class), "myConstant",
-                "myConstantValue2");
+        final Constant constant4 = new ConstantImpl(generatedTypeBuilder, Types.typeForClass(String.class),
+            "myConstant2", "myConstantValue");
+        final Constant constant5 = new ConstantImpl(generatedTypeBuilder, Types.typeForClass(String.class),
+            "myConstant", "myConstantValue2");
 
         assertNotNull(constant);
         assertNotNull(constant2);
@@ -79,9 +79,8 @@ public class GeneratedTypeBuilderTest {
         assertFalse(constant.hashCode() == constant4.hashCode());
         assertTrue(constant.hashCode() == constant5.hashCode());
 
-        assertEquals(
-                "Constant [type=Type (java.lang.String), name=myConstant, value=myConstantValue, definingType=my.package.MyName]",
-                constant.toString());
+        assertEquals("Constant [type=Type (java.lang.String), name=myConstant, value=myConstantValue, "
+                + "definingType=my.package.MyName]", constant.toString());
 
         assertEquals("Type (java.lang.String) myConstant myConstantValue", constant.toFormattedString());
 
@@ -115,13 +114,13 @@ public class GeneratedTypeBuilderTest {
 
     @Test
     public void generatedTypeBuilderEqualsAndHashCodeTest() {
-        CodegenGeneratedTypeBuilder generatedTypeBuilder = new CodegenGeneratedTypeBuilder(
+        final CodegenGeneratedTypeBuilder generatedTypeBuilder = new CodegenGeneratedTypeBuilder(
             JavaTypeName.create("my.package", "MyName"));
-        CodegenGeneratedTypeBuilder generatedTypeBuilder2 = new CodegenGeneratedTypeBuilder(
+        final CodegenGeneratedTypeBuilder generatedTypeBuilder2 = new CodegenGeneratedTypeBuilder(
             JavaTypeName.create("my.package", "MyName"));
-        CodegenGeneratedTypeBuilder generatedTypeBuilder3 = new CodegenGeneratedTypeBuilder(
+        final CodegenGeneratedTypeBuilder generatedTypeBuilder3 = new CodegenGeneratedTypeBuilder(
             JavaTypeName.create("my.package", "MyName2"));
-        CodegenGeneratedTypeBuilder generatedTypeBuilder4 = new CodegenGeneratedTypeBuilder(
+        final CodegenGeneratedTypeBuilder generatedTypeBuilder4 = new CodegenGeneratedTypeBuilder(
             JavaTypeName.create("my.package2", "MyName"));
 
         assertFalse(generatedTypeBuilder.equals(null));
@@ -220,7 +219,8 @@ public class GeneratedTypeBuilderTest {
 
         assertTrue(enumerations.contains(enumBuilder.toInstance(instance)));
         assertTrue(enumerations.contains(enumBuilder2.toInstance(instance)));
-        assertFalse(enumerations.contains(new CodegenEnumerationBuilder(JavaTypeName.create("my.package", "myEnumName3"))
+        assertFalse(enumerations.contains(new CodegenEnumerationBuilder(JavaTypeName.create("my.package",
+            "myEnumName3"))
             .toInstance(instance)));
 
     }
@@ -251,14 +251,14 @@ public class GeneratedTypeBuilderTest {
 
     @Test(expected = IllegalArgumentException.class)
     public void addEnclosingTransferObjectIllegalArgumentTest() {
-        new CodegenGeneratedTypeBuilder(JavaTypeName.create("my.package", "MyName"))
-        .addEnclosingTransferObject((String) null);
+        new CodegenGeneratedTypeBuilder(JavaTypeName.create("my.package", "MyName")).addEnclosingTransferObject(
+            (String) null);
     }
 
     @Test(expected = IllegalArgumentException.class)
     public void addEnclosingTransferObjectIllegalArgumentTest2() {
-        new CodegenGeneratedTypeBuilder(JavaTypeName.create("my.package", "MyName"))
-        .addEnclosingTransferObject((GeneratedTOBuilder) null);
+        new CodegenGeneratedTypeBuilder(JavaTypeName.create("my.package", "MyName")).addEnclosingTransferObject(
+            (GeneratedTOBuilder) null);
     }
 
     @Test
@@ -308,7 +308,8 @@ public class GeneratedTypeBuilderTest {
         assertEquals("My description ...", instance.getDescription());
         assertEquals("myModuleName", instance.getModuleName());
         assertEquals("myReference", instance.getReference());
-        assertEquals(SchemaPath.create(true, QName.create("test", "/path")).getPathFromRoot(), instance.getSchemaPath());
+        assertEquals(SchemaPath.create(true, QName.create("test", "/path")).getPathFromRoot(),
+            instance.getSchemaPath());
         assertEquals("My comment..", instance.getComment().getJavadoc());
     }
 }
index 10063b2d2e6cb65148d26714b49e02cb8232a8b9..8312758092f1189acd4a60070435a54586d1457d 100644 (file)
@@ -13,16 +13,22 @@ import static org.junit.Assert.assertTrue;
 
 import org.junit.Before;
 import org.junit.Test;
-import org.opendaylight.mdsal.binding.model.util.Types;
 import org.opendaylight.mdsal.binding.model.api.Type;
+import org.opendaylight.mdsal.binding.model.util.Types;
 
 public class MethodParameterImplTest {
 
-    private MethodParameterImpl parameter1, parameter2, parameter3, parameter4;
-    private int hash1, hash2, hash3, hash4;
+    private MethodParameterImpl parameter1;
+    private MethodParameterImpl parameter2;
+    private MethodParameterImpl parameter3;
+    private MethodParameterImpl parameter4;
+    private int hash1;
+    private int hash2;
+    private int hash3;
+    private int hash4;
 
     @Before
-    public void Setup() {
+    public void before() {
         String name = "customParameter";
         Type type = Types.STRING;
         parameter1 = new MethodParameterImpl(name, type);
index 044deb62162016040e8ac4a53aa3ce5a6abc47b0..f6e4fe29583bf0ac0d4c0e0cd27e69b9351fabfd 100644 (file)
@@ -13,8 +13,8 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 import org.junit.Test;
-import org.opendaylight.mdsal.binding.model.api.MethodSignature;
 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
+import org.opendaylight.mdsal.binding.model.api.MethodSignature;
 
 public class MethodSignatureBuilderImplTest {
 
index f8ae966d6720e6e84c169dbd0f9afb4ecaccb64a..a53dcfbeee3db623df4487d182c627efbb544b5c 100644 (file)
@@ -14,15 +14,20 @@ import static org.junit.Assert.assertTrue;
 
 import org.junit.Before;
 import org.junit.Test;
-import org.opendaylight.mdsal.binding.model.util.Types;
 import org.opendaylight.mdsal.binding.model.api.MethodSignature;
 import org.opendaylight.mdsal.binding.model.api.Type;
 import org.opendaylight.mdsal.binding.model.api.type.builder.MethodSignatureBuilder;
+import org.opendaylight.mdsal.binding.model.util.Types;
 
 public class MethodSignatureBuilderTest {
 
-    private MethodSignatureBuilder builder1, builder2, builder3, builder4;
-    private int hash1, hash2, hash3;
+    private MethodSignatureBuilder builder1;
+    private MethodSignatureBuilder builder2;
+    private MethodSignatureBuilder builder3;
+    private MethodSignatureBuilder builder4;
+    private int hash1;
+    private int hash2;
+    private int hash3;
 
     @Before
     public void setup() {
index dbb69c298df97c2c460c8f6cc2f4980d0359b4e9..b480eb9c897b5318f6381e9fede0e4adab49170f 100644 (file)
@@ -15,16 +15,20 @@ import java.util.ArrayList;
 import java.util.List;
 import org.junit.Before;
 import org.junit.Test;
-import org.opendaylight.mdsal.binding.model.util.Types;
 import org.opendaylight.mdsal.binding.model.api.AccessModifier;
 import org.opendaylight.mdsal.binding.model.api.AnnotationType;
 import org.opendaylight.mdsal.binding.model.api.MethodSignature.Parameter;
 import org.opendaylight.mdsal.binding.model.api.Type;
+import org.opendaylight.mdsal.binding.model.util.Types;
 
 public class MethodSignatureImplTest {
 
-    private MethodSignatureImpl signature1, signature2, signature3, signature4;
-    private int hash1, hash4;
+    private MethodSignatureImpl signature1;
+    private MethodSignatureImpl signature2;
+    private MethodSignatureImpl signature3;
+    private MethodSignatureImpl signature4;
+    private int hash1;
+    private int hash4;
 
     @Before
     public void setup() {