Add @NonNull annotation to $YangModuleInfoImpl.qnameOf()
[mdsal.git] / binding / mdsal-binding-java-api-generator / src / main / java / org / opendaylight / mdsal / binding / java / api / generator / ClassTemplate.xtend
index a1c01d6a72de38b4563ebf686c9ca42d0b1f109c..c34953fd052f2fdab71844a159e2d4d5b3edc701 100644 (file)
@@ -227,15 +227,15 @@ class ClassTemplate extends BaseTemplate {
         «ENDIF»
 
         «FOR p : properties»
-            «IF p.returnType.importedName.contains("[]")»
-                «IF genTO.typedef && allProperties.size == 1 && allProperties.get(0).name
-                .equals("value")»
-                this.«p.fieldName» = «p.fieldName».clone();
+            «val fieldName = p.fieldName»
+            «IF p.returnType.name.endsWith("[]")»
+                «IF genTO.typedef && allProperties.size == 1 && allProperties.get(0).name.equals("value")»
+                this.«fieldName» = «fieldName».clone();
                 «ELSE»
-                this.«p.fieldName» = «p.fieldName» == null ? null : «p.fieldName».clone();
+                this.«fieldName» = «fieldName» == null ? null : «fieldName».clone();
                 «ENDIF»
             «ELSE»
-            this.«p.fieldName» = «p.fieldName»;
+            this.«fieldName» = «fieldName»;
             «ENDIF»
         «ENDFOR»
     }
@@ -258,9 +258,10 @@ class ClassTemplate extends BaseTemplate {
             super(«parentProperties.asArguments»);
         «ENDIF»
 
-        «generateRestrictions(type, property.fieldName.toString, property.returnType)»
+        «val fieldName = property.fieldName»
+        «generateRestrictions(type, fieldName.toString, property.returnType)»
 
-        this.«property.fieldName» = «property.name»;
+        this.«fieldName» = «property.name»;
         «FOR p : other»
             this.«p.fieldName» = null;
         «ENDFOR»
@@ -310,7 +311,8 @@ class ClassTemplate extends BaseTemplate {
             super(source);
         «ENDIF»
         «FOR p : properties»
-            this.«p.fieldName» = source.«p.fieldName»;
+            «val fieldName = p.fieldName»
+            this.«fieldName» = source.«fieldName»;
         «ENDFOR»
     }
     '''