Fix conflict on Object definition
authorRobert Varga <rovarga@cisco.com>
Wed, 13 Aug 2014 12:49:59 +0000 (14:49 +0200)
committerRobert Varga <rovarga@cisco.com>
Wed, 13 Aug 2014 12:51:24 +0000 (14:51 +0200)
The use of Object (in the java.lang sense) is not working with models
which contain a 'container object' or similar. The fix is to not use a
temporary variable.

Change-Id: I98b3bde9a04d5f33a51a0add107829ad92d35907
Signed-off-by: Robert Varga <rovarga@cisco.com>
code-generator/binding-java-api-generator/src/main/java/org/opendaylight/yangtools/sal/java/api/generator/BuilderTemplate.xtend

index 74a5ef379315dfdb53752fc26877bfc002d2a4c6..96e3af8d96c33194d72238dc0c6509e9bfbfa24f 100644 (file)
@@ -691,8 +691,7 @@ class BuilderTemplate extends BaseTemplate {
                     } else {
                         // Hard case: compare our augments with presence there...
                         for («Map.importedName».Entry<«Class.importedName»<? extends «augmentField.returnType.importedName»>, «augmentField.returnType.importedName»> e : «augmentField.name».entrySet()) {
-                            final Object oa = other.getAugmentation(e.getKey());
-                            if (!e.getValue().equals(oa)) {
+                            if (!e.getValue().equals(other.getAugmentation(e.getKey()))) {
                                 return false;
                             }
                         }