Remove StmtOrderingNamespace 44/87644/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 12 Feb 2020 18:06:49 +0000 (19:06 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 12 Feb 2020 19:58:06 +0000 (20:58 +0100)
This namespace is not really used anywhere, hence there is no point
in maintaining it.

JIRA: YANGTOOLS-652
Change-Id: I8c74a555218b55c59a8c3e301d2a20c53bbee63a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/reactor/RFC7950Reactors.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/augment/AbstractAugmentStatementSupport.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/StmtOrderingNamespace.java [deleted file]
yang/yang-parser-spi/src/test/java/org/opendaylight/yangtools/yang/parser/spi/source/NamespaceTest.java

index 3762049cd23f3278323404ec7fd19af82a736fa9..a4c846197c1fb238fac463b752859c00e573c495 100644 (file)
@@ -146,7 +146,6 @@ import org.opendaylight.yangtools.yang.parser.spi.source.ModuleQNameToModuleName
 import org.opendaylight.yangtools.yang.parser.spi.source.ModulesDeviatedByModules;
 import org.opendaylight.yangtools.yang.parser.spi.source.PrefixToModule;
 import org.opendaylight.yangtools.yang.parser.spi.source.QNameToStatementDefinition;
-import org.opendaylight.yangtools.yang.parser.spi.source.StmtOrderingNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.source.SupportedFeaturesNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.validation.ValidationBundlesNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.validation.ValidationBundlesNamespace.ValidationBundleType;
@@ -301,7 +300,6 @@ public final class RFC7950Reactors {
             .addSupport(FeatureStatementSupport.getInstance())
             .addSupport(PositionStatementSupport.getInstance())
             .addSupport(ValueStatementSupport.getInstance())
-            .addSupport(StmtOrderingNamespace.BEHAVIOUR)
             .build();
 
     private static final Map<ModelProcessingPhase, StatementSupportBundle> RFC7950_BUNDLES =
index 4bb11bb9c3fa927a1fac2e141c450310d5b8661b..5912443d656cb8e6a64ecb18e6c98d69811a1479 100644 (file)
@@ -48,7 +48,6 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.Mutable;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils;
 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
-import org.opendaylight.yangtools.yang.parser.spi.source.StmtOrderingNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.validation.ValidationBundlesNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.validation.ValidationBundlesNamespace.ValidationBundleType;
 import org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextBase;
@@ -120,7 +119,6 @@ abstract class AbstractAugmentStatementSupport
                 try {
                     copyFromSourceToTarget(augmentSourceCtx, augmentTargetCtx);
                     augmentTargetCtx.addEffectiveSubstatement(augmentSourceCtx);
-                    updateAugmentOrder(augmentSourceCtx);
                 } catch (final SourceException e) {
                     LOG.warn("Failed to add augmentation {} defined at {}",
                         augmentTargetCtx.getStatementSourceReference(),
@@ -128,13 +126,6 @@ abstract class AbstractAugmentStatementSupport
                 }
             }
 
-            private void updateAugmentOrder(final StatementContextBase<?, ?, ?> augmentSourceCtx) {
-                final Integer prev = augmentSourceCtx.getFromNamespace(StmtOrderingNamespace.class,
-                    YangStmtMapping.AUGMENT);
-                final int currentOrder = prev == null ? 1 : prev + 1;
-                augmentSourceCtx.addToNs(StmtOrderingNamespace.class, YangStmtMapping.AUGMENT, currentOrder);
-            }
-
             @Override
             public void prerequisiteFailed(final Collection<? extends Prerequisite<?>> failed) {
                 /*
diff --git a/yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/StmtOrderingNamespace.java b/yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/StmtOrderingNamespace.java
deleted file mode 100644 (file)
index 54cb7cb..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.parser.spi.source;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.model.api.YangStmtMapping;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
-import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
-
-/**
- * Map of statement order.
- */
-public interface StmtOrderingNamespace extends IdentifierNamespace<YangStmtMapping, Integer> {
-    NamespaceBehaviour<YangStmtMapping, Integer, @NonNull StmtOrderingNamespace> BEHAVIOUR =
-            NamespaceBehaviour.global(StmtOrderingNamespace.class);
-
-}
\ No newline at end of file
index 5b433a5459ba4a6ad018dc8f073ea3d6f90507f2..7b9a540709c8076674779feb211998f808b2a4ab 100644 (file)
@@ -33,7 +33,6 @@ public class NamespaceTest {
         assertNotNull(ModuleNameToModuleQName.BEHAVIOUR);
         assertNotNull(ModulesDeviatedByModules.BEHAVIOUR);
         assertNotNull(PrefixToModule.BEHAVIOUR);
-        assertNotNull(StmtOrderingNamespace.BEHAVIOUR);
         assertNotNull(SupportedFeaturesNamespace.BEHAVIOUR);
     }
 }