From 1c7131cb24267d08f85f693cf3ec162c0e03b537 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Wed, 6 Jul 2016 11:51:12 +0200 Subject: [PATCH] BUG-865: eliminate getYangText() Change-Id: Id8a952cb7b299e1eccd49279f91bf6bf41b8986e Signed-off-by: Robert Varga --- .../yang/parser/util/ASTSchemaSource.java | 42 ++----------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/util/ASTSchemaSource.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/util/ASTSchemaSource.java index ed914e2f13..277114de1a 100644 --- a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/util/ASTSchemaSource.java +++ b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/util/ASTSchemaSource.java @@ -65,14 +65,12 @@ public final class ASTSchemaSource implements SchemaSourceRepresentation { private final ParserRuleContext tree; private final SourceIdentifier id; private final SemVerSourceIdentifier semVerId; - private final String text; - private ASTSchemaSource(@Nonnull final SourceIdentifier id, @Nonnull final SemVerSourceIdentifier semVerId, @Nonnull final ParserRuleContext tree, @Nonnull final YangModelDependencyInfo depInfo, final String text) { + private ASTSchemaSource(@Nonnull final SourceIdentifier id, @Nonnull final SemVerSourceIdentifier semVerId, @Nonnull final ParserRuleContext tree, @Nonnull final YangModelDependencyInfo depInfo) { this.depInfo = Preconditions.checkNotNull(depInfo); this.tree = Preconditions.checkNotNull(tree); this.id = Preconditions.checkNotNull(id); this.semVerId = Preconditions.checkNotNull(semVerId); - this.text = text; } /** @@ -88,7 +86,7 @@ public final class ASTSchemaSource implements SchemaSourceRepresentation { final YangModelDependencyInfo depInfo = YangModelDependencyInfo.fromAST(name, tree); final SourceIdentifier id = getSourceId(depInfo); final SemVerSourceIdentifier semVerId = getSemVerSourceId(depInfo); - return new ASTSchemaSource(id, semVerId, tree, depInfo, null); + return new ASTSchemaSource(id, semVerId, tree, depInfo); } private static SourceIdentifier getSourceId(final YangModelDependencyInfo depInfo) { @@ -105,26 +103,6 @@ public final class ASTSchemaSource implements SchemaSourceRepresentation { depInfo.getSemanticVersion().or(Module.DEFAULT_SEMANTIC_VERSION)); } - /** - * Create a new instance of AST representation for a abstract syntax tree, - * performing minimal semantic analysis to acquire dependency information. - * - * @param name YANG source name. Used only for error reporting. - * @param tree ANTLR abstract syntax tree - * @param text YANG text source - * @return A new representation instance. - * @throws YangSyntaxErrorException if we fail to extract dependency information. - * - * @deprecated Migration only, will be removed as soon as the migration is completed. - */ - @Deprecated - public static ASTSchemaSource create(@Nonnull final String name, @Nonnull final ParserRuleContext tree, final String text) throws YangSyntaxErrorException { - final YangModelDependencyInfo depInfo = YangModelDependencyInfo.fromAST(name, tree); - final SourceIdentifier id = getSourceId(depInfo); - final SemVerSourceIdentifier semVerId = getSemVerSourceId(depInfo); - return new ASTSchemaSource(id, semVerId, tree, depInfo, text); - } - /** * Create a new instance of AST representation for a abstract syntax tree, * performing minimal semantic analysis to acquire dependency information. @@ -138,7 +116,6 @@ public final class ASTSchemaSource implements SchemaSourceRepresentation { * @return A new representation instance. * @throws YangSyntaxErrorException * if we fail to extract dependency information. - * */ public static ASTSchemaSource create(@Nonnull final SourceIdentifier identifier, @Nonnull final ParserRuleContext tree, final String text) throws YangSyntaxErrorException { @@ -152,7 +129,7 @@ public final class ASTSchemaSource implements SchemaSourceRepresentation { semVerId = getSemVerSourceId(depInfo); } - return new ASTSchemaSource(id, semVerId, tree, depInfo, text); + return new ASTSchemaSource(id, semVerId, tree, depInfo); } @Override @@ -189,17 +166,4 @@ public final class ASTSchemaSource implements SchemaSourceRepresentation { @Nonnull public YangModelDependencyInfo getDependencyInformation() { return depInfo; } - - /** - * Return the semantically-equivalent text YANG text source. - * - * @return YANG text source - * @deprecated Used for migration purposes. Users are advised to use the - * schema repository to acquire the representation of their - * choice. Will be removed as soon as the migration is completed. - */ - @Deprecated - @Nonnull public String getYangText() { - return text; - } } -- 2.36.6