Fix ClassTemplate.genConstructor() declaration 80/84380/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 4 Sep 2019 12:44:47 +0000 (14:44 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 13 Sep 2019 14:10:15 +0000 (16:10 +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>
(cherry picked from commit 44e0faeba93e1ac992130b3b282c46186b13a076)

binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/ClassTemplate.xtend

index 52d82ff3f91213480f0f7f49dd2cc60c663f70b8..a1c01d6a72de38b4563ebf686c9ca42d0b1f109c 100644 (file)
@@ -252,7 +252,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»);