BUG-2159: fix sort() conflict 19/11819/1
authorRobert Varga <rovarga@cisco.com>
Wed, 8 Oct 2014 16:21:01 +0000 (18:21 +0200)
committerRobert Varga <rovarga@cisco.com>
Wed, 8 Oct 2014 16:21:01 +0000 (18:21 +0200)
Java 8 introduces a default method into java.util.List, which has a
different signature (and semantics) than the xtend extension. This patch
changes the code to not use the syntactic sugar while retaining the use
of the extension.

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

index 1a9914828a8b2891a69fbca4adafde56f97d11cf..1162e67f096f15fc126fe5d0be09729c0255216c 100644 (file)
@@ -1178,7 +1178,7 @@ class TransformerGenerator extends AbstractTransformerGenerator {
                 ]
                 method(Object, "fromDomValue", Object) [
                     modifiers = PUBLIC + FINAL + STATIC
-                    val sortedBits = typeDef.bits.sort[o1, o2|o1.propertyName.compareTo(o2.propertyName)]
+                    val sortedBits = IterableExtensions.sort(typeDef.bits, [o1, o2|o1.propertyName.compareTo(o2.propertyName)])
                     val body = '''
                         {
                             //System.out.println("«inputType.simpleName»#fromDomValue: "+$1);