From c55f1967de3b5fd36ef3c25a4285b39f2a6f478a Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 25 Feb 2019 14:39:10 +0100 Subject: [PATCH] Hide ResourceYangTextSchemaSource Exposing a concrete subclass here makes the API design asymmetric, because YinTestSchemaSource equivament is not exposed. Hide ResourceYangTextSchemaSource. Change-Id: I187a0c049cf885bdbc567ba20b55b4d278095198 JIRA: YANGTOOLS-849 Signed-off-by: Robert Varga --- .../model/repo/api/ResourceYangTextSchemaSource.java | 5 +---- .../yang/model/repo/api/YangTextSchemaSource.java | 9 +++------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/ResourceYangTextSchemaSource.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/ResourceYangTextSchemaSource.java index b00b750466..8250fedada 100644 --- a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/ResourceYangTextSchemaSource.java +++ b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/ResourceYangTextSchemaSource.java @@ -9,7 +9,6 @@ package org.opendaylight.yangtools.yang.model.repo.api; import static java.util.Objects.requireNonNull; -import com.google.common.annotations.Beta; import com.google.common.base.MoreObjects.ToStringHelper; import java.io.IOException; import java.io.InputStream; @@ -21,9 +20,7 @@ import org.opendaylight.yangtools.concepts.Delegator; /** * A resource-backed {@link YinTextSchemaSource}. */ -@Beta -// FIXME: YANGTOOLS-849: 3.0.0: hide this class -public final class ResourceYangTextSchemaSource extends YangTextSchemaSource implements Delegator { +final class ResourceYangTextSchemaSource extends YangTextSchemaSource implements Delegator { private final @NonNull URL url; ResourceYangTextSchemaSource(final SourceIdentifier identifier, final URL url) { diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/YangTextSchemaSource.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/YangTextSchemaSource.java index d6c8873a7f..0e521561aa 100644 --- a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/YangTextSchemaSource.java +++ b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/YangTextSchemaSource.java @@ -25,8 +25,7 @@ import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.yangtools.yang.common.Revision; /** - * YANG text schema source representation. Exposes an RFC6020 or RFC7950 text representation - * as an {@link InputStream}. + * YANG text schema source representation. Exposes an RFC6020 or RFC7950 text representation as an {@link InputStream}. */ @Beta public abstract class YangTextSchemaSource extends ByteSource implements YangSchemaSourceRepresentation { @@ -94,8 +93,7 @@ public abstract class YangTextSchemaSource extends ByteSource implements YangSch * @return A new instance. * @throws IllegalArgumentException if the resource does not exist or if the name has invalid format */ - // FIXME: 3.0.0: YANGTOOLS-849: return YangTextSchemaSource - public static @NonNull ResourceYangTextSchemaSource forResource(final String resourceName) { + public static @NonNull YangTextSchemaSource forResource(final String resourceName) { return forResource(YangTextSchemaSource.class, resourceName); } @@ -108,8 +106,7 @@ public abstract class YangTextSchemaSource extends ByteSource implements YangSch * @return A new instance. * @throws IllegalArgumentException if the resource does not exist or if the name has invalid format */ - // FIXME: 3.0.0: YANGTOOLS-849: return YangTextSchemaSource - public static @NonNull ResourceYangTextSchemaSource forResource(final Class clazz, final String resourceName) { + public static @NonNull YangTextSchemaSource forResource(final Class clazz, final String resourceName) { final String fileName = resourceName.substring(resourceName.lastIndexOf('/') + 1); final SourceIdentifier identifier = identifierFromFilename(fileName); final URL url = Resources.getResource(clazz, resourceName); -- 2.36.6