Merge "BUG-2606: formalize the augmentation removal"
authorTony Tkacik <ttkacik@cisco.com>
Tue, 20 Jan 2015 09:39:18 +0000 (09:39 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 20 Jan 2015 09:39:18 +0000 (09:39 +0000)
code-generator/binding-java-api-generator/src/main/java/org/opendaylight/yangtools/sal/java/api/generator/BuilderTemplate.xtend

index f632d86fb809414303485191463be7e08c932be2..8f3f45fd326674c749932586cc1816ee419a3d68 100644 (file)
@@ -454,7 +454,11 @@ class BuilderTemplate extends BaseTemplate {
         «IF augmentField != null»
 
             public «type.name»«BUILDER» add«augmentField.name.toFirstUpper»(«Class.importedName»<? extends «augmentField.returnType.importedName»> augmentationType, «augmentField.returnType.importedName» augmentation) {
-                this.«augmentField.name».put(augmentationType, augmentation);
+                if (augmentation == null) {
+                    this.«augmentField.name».remove(augmentationType);
+                } else {
+                    this.«augmentField.name».put(augmentationType, augmentation);
+                }
                 return this;
             }
         «ENDIF»