BUG-5211: remove SourceStreamAware 95/41995/37
authorRobert Varga <rovarga@cisco.com>
Mon, 18 Jul 2016 16:47:51 +0000 (18:47 +0200)
committerRobert Varga <nite@hq.sk>
Wed, 11 Oct 2017 17:28:44 +0000 (17:28 +0000)
This interface is a direct violation of the model.api contract.
It is used only by the YangToSourceProcessor, which can implement
the suggested fix.

Change-Id: I90928a273503ee21e9663c115b7135cf5e1f0608
Signed-off-by: Robert Varga <rovarga@cisco.com>
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/Module.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SourceStreamAware.java [deleted file]
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/AbstractEffectiveModule.java

index d97e76134c2fe3da204868321b8ec5514a96aca1..05d9354528b7babfedcf29da203b8b0953a1e674 100644 (file)
@@ -61,7 +61,7 @@ import org.opendaylight.yangtools.concepts.SemVer;
     </code>
  */
 @Immutable
-public interface Module extends DataNodeContainer, SourceStreamAware, ModuleIdentifier, NotificationNodeContainer {
+public interface Module extends DataNodeContainer, ModuleIdentifier, NotificationNodeContainer {
     /**
      * Default semantic version of Module.
      */
diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SourceStreamAware.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SourceStreamAware.java
deleted file mode 100644 (file)
index 9a5217d..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (c) 2013 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.model.api;
-
-/**
- * Allows access to module source.
- *
- * @deprecated This interface is a violation of the effective model contract. To look up the source of a particular
- *             module use a {@link org.opendaylight.yangtools.yang.model.repo.api.SchemaRepository} or a similar
- *             lookup table.
- */
-@Deprecated
-public interface SourceStreamAware {
-
-    /**
-     * Get descriptive source path (usually file path) from which this module was parsed.
-     */
-    String getModuleSourcePath();
-}
index 44047a9310789648493ba0c3d5486f3ae380dc5b..f35580790f241b9b030bc6936f5e1c53cd4fe72f 100644 (file)
@@ -52,14 +52,12 @@ import org.opendaylight.yangtools.yang.parser.spi.SubmoduleNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.MutableStatement;
 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.source.DeclarationInTextSource;
 import org.opendaylight.yangtools.yang.parser.spi.source.IncludedSubmoduleNameToIdentifier;
 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 
 abstract class AbstractEffectiveModule<D extends DeclaredStatement<String>> extends
         AbstractEffectiveDocumentedNode<String, D> implements Module, MutableStatement {
     private final String name;
-    private final String sourcePath;
     private final String prefix;
     private final YangVersion yangVersion;
     private final String organization;
@@ -118,12 +116,6 @@ abstract class AbstractEffectiveModule<D extends DeclaredStatement<String>> exte
         final ContactEffectiveStatementImpl contactStmt = firstEffective(ContactEffectiveStatementImpl.class);
         this.contact = contactStmt == null ? null : contactStmt.argument();
 
-        if (ctx.getStatementSourceReference() instanceof DeclarationInTextSource) {
-            this.sourcePath = ((DeclarationInTextSource) ctx.getStatementSourceReference()).getSourceName();
-        } else {
-            this.sourcePath = null;
-        }
-
         // init submodules and substatements of submodules
         final List<EffectiveStatement<?, ?>> substatementsOfSubmodules;
         final Map<String, ModuleIdentifier> includedSubmodulesMap = ctx
@@ -286,11 +278,6 @@ abstract class AbstractEffectiveModule<D extends DeclaredStatement<String>> exte
 
     }
 
-    @Override
-    public String getModuleSourcePath() {
-        return sourcePath;
-    }
-
     @Override
     public String getSource() {
         return null;