Do not emit empty super() call 79/103179/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 9 Nov 2022 18:31:48 +0000 (19:31 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 9 Nov 2022 18:31:48 +0000 (19:31 +0100)
If we do not have any parent properties, we should not generate a
free-standing super() call -- javac will do that for us.

Change-Id: Ib45ec29e9914f0f3eeef7e2d86ebb94fbd33aab1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/UnionTemplate.xtend

index 7e350d735bc6a35fcb6e1505b294e0cd7475f0ca..f8a765f0b5bd2023e6b12d87743e75058d46d83f 100644 (file)
@@ -68,7 +68,9 @@ class UnionTemplate extends ClassTemplate {
             «val propertyAndTopParentProperties = parentProperties + #[property]»
             «val propFieldName = property.fieldName»
             public «type.name»(«propertyAndTopParentProperties.asArgumentsDeclaration») {
-                super(«parentProperties.asArguments»);
+                «IF !parentProperties.empty»
+                    super(«parentProperties.asArguments»);
+                «ENDIF»
                 «IF restrictions !== null»
                     «checkArgument(property, restrictions, actualType, propFieldName)»
                 «ENDIF»