Merge "Bug 735 - Part 1: Update ietf-restconf and ietf-yangtypes to newer versions"
[yangtools.git] / code-generator / binding-generator-util / src / main / java / org / opendaylight / yangtools / binding / generator / util / generated / type / builder / AbstractTypeMember.java
index 51721882883201c377ddb8e51c1a2e237aef3928..cfadce1a5e6f36938bbaacc8f06ea5af7759c0de 100644 (file)
@@ -29,11 +29,11 @@ abstract class AbstractTypeMember implements TypeMember {
 
     public AbstractTypeMember(final Type definingType, final String name,  final List<AnnotationType> annotations,
                               final String comment, final AccessModifier accessModifier, final Type returnType,
-                              boolean isFinal, boolean isStatic) {
+                              final boolean isFinal, final boolean isStatic) {
         super();
         this.definingType = definingType;
         this.name = name;
-        this.annotations = Collections.unmodifiableList(annotations);
+        this.annotations = annotations.isEmpty() ? Collections.<AnnotationType>emptyList() : Collections.unmodifiableList(annotations);
         this.comment = comment;
         this.accessModifier = accessModifier;
         this.returnType = returnType;
@@ -92,7 +92,7 @@ abstract class AbstractTypeMember implements TypeMember {
     }
 
     @Override
-    public boolean equals(Object obj) {
+    public boolean equals(final Object obj) {
         if (this == obj) {
             return true;
         }