import com.google.common.collect.ImmutableSet;
import java.util.HashSet;
-import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
-import java.util.Map;
import java.util.Optional;
import java.util.Set;
import org.opendaylight.yangtools.yang.common.QName;
protected AbstractEffectiveDocumentedDataNodeContainer(final StmtContext<A, D, ?> ctx) {
super(ctx);
- Map<QName, DataSchemaNode> mutableChildNodes = new LinkedHashMap<>();
Set<GroupingDefinition> mutableGroupings = new HashSet<>();
Set<UsesNode> mutableUses = new HashSet<>();
Set<TypeDefinition<?>> mutableTypeDefinitions = new LinkedHashSet<>();
for (EffectiveStatement<?, ?> stmt : effectiveSubstatements()) {
if (stmt instanceof DataSchemaNode) {
- final DataSchemaNode dataSchemaNode = (DataSchemaNode) stmt;
- if (mutableChildNodes.containsKey(dataSchemaNode.getQName())) {
- throw EffectiveStmtUtils.createNameCollisionSourceException(ctx, stmt);
- }
-
- mutableChildNodes.put(dataSchemaNode.getQName(), dataSchemaNode);
- mutablePublicChildNodes.add(dataSchemaNode);
+ mutablePublicChildNodes.add((DataSchemaNode) stmt);
}
if (stmt instanceof UsesNode && !mutableUses.add((UsesNode) stmt)) {
throw EffectiveStmtUtils.createNameCollisionSourceException(ctx, stmt);
import java.net.URI;
import java.util.ArrayList;
import java.util.HashSet;
-import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
-import java.util.Map;
import java.util.Optional;
import java.util.Set;
import org.eclipse.jdt.annotation.NonNull;
final Set<FeatureDefinition> featuresInit = new HashSet<>();
final List<ExtensionDefinition> extensionNodesInit = new ArrayList<>();
- final Map<QName, DataSchemaNode> mutableChildNodes = new LinkedHashMap<>();
final Set<GroupingDefinition> mutableGroupings = new HashSet<>();
final Set<UsesNode> mutableUses = new HashSet<>();
final Set<TypeDefinition<?>> mutableTypeDefinitions = new LinkedHashSet<>();
extensionNodesInit.add((ExtensionDefinition) effectiveStatement);
}
if (effectiveStatement instanceof DataSchemaNode) {
- final DataSchemaNode dataSchemaNode = (DataSchemaNode) effectiveStatement;
- if (!mutableChildNodes.containsKey(dataSchemaNode.getQName())) {
- mutableChildNodes.put(dataSchemaNode.getQName(), dataSchemaNode);
- mutablePublicChildNodes.add(dataSchemaNode);
- } else {
- throw EffectiveStmtUtils.createNameCollisionSourceException(ctx, effectiveStatement);
- }
+ mutablePublicChildNodes.add((DataSchemaNode) effectiveStatement);
}
if (effectiveStatement instanceof UsesNode && !mutableUses.add((UsesNode) effectiveStatement)) {
throw EffectiveStmtUtils.createNameCollisionSourceException(ctx, effectiveStatement);