BUG-6497: Do not lose augmentation statement order 75/44975/1
authorRobert Varga <rovarga@cisco.com>
Tue, 30 Aug 2016 16:41:48 +0000 (18:41 +0200)
committerRobert Varga <rovarga@cisco.com>
Thu, 1 Sep 2016 08:09:03 +0000 (10:09 +0200)
This is a follow-up patch to keep augmentation order
in uses statement.

Change-Id: Iaef4aa949d225d914af3a04c111d0ec41aab6451
Signed-off-by: Robert Varga <rovarga@cisco.com>
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/UsesEffectiveStatementImpl.java

index b212011a5e5b00ad6732520790cd3562ec0ddc67..a861f354dd5d37abec80825b80232e6cc57ec763 100644 (file)
@@ -13,7 +13,7 @@ import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
@@ -62,7 +62,7 @@ public final class UsesEffectiveStatementImpl extends AbstractEffectiveDocumente
         // initSubstatementCollections
         final Collection<? extends EffectiveStatement<?, ?>> effectiveSubstatements = effectiveSubstatements();
         final List<UnknownSchemaNode> unknownNodesInit = new LinkedList<>();
-        final Set<AugmentationSchema> augmentationsInit = new HashSet<>();
+        final Set<AugmentationSchema> augmentationsInit = new LinkedHashSet<>();
         final Map<SchemaPath, SchemaNode> refinesInit = new HashMap<>();
         for (final EffectiveStatement<?, ?> effectiveStatement : effectiveSubstatements) {
             if (effectiveStatement instanceof UnknownSchemaNode) {