Fix ClassTemplate.genConstructor() declaration 96/84196/2
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 4 Sep 2019 12:44:47 +0000 (14:44 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 4 Sep 2019 13:37:10 +0000 (15:37 +0200)
Using an array here is forcing us to needlessly unwrap the arraylist
(a perfectly iterable thing) to an array, which is only iterater over.

Fix this by passing down an iterable, which means the list can be
passed down as is.

Change-Id: I1572729d554c3ce8ae6ab94c1ba3d5547399e7ab
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/ClassTemplate.xtend

index 02d52bffdaa3a8b8ef7520f4c9d14e102b496b0e..ddce529380605e7ce6301c536f0a2def321b3b01 100644 (file)
@@ -260,7 +260,7 @@ class ClassTemplate extends BaseTemplate {
 
     '''
 
-    def protected genConstructor(GeneratedProperty property, GeneratedProperty... other) '''
+    def protected genConstructor(GeneratedProperty property, Iterable<GeneratedProperty> other) '''
     public «type.name»(«property.returnType.importedName + " " + property.name») {
         «IF false == parentProperties.empty»
             super(«parentProperties.asArguments»);