package org.opendaylight.yangtools.yang.parser.repo;
import static com.google.common.base.Preconditions.checkArgument;
+import static java.util.Objects.requireNonNull;
import static org.opendaylight.yangtools.util.concurrent.FluentFutures.immediateFailedFluentFuture;
import static org.opendaylight.yangtools.util.concurrent.FluentFutures.immediateFluentFuture;
import com.google.common.annotations.Beta;
import com.google.common.base.MoreObjects.ToStringHelper;
-import com.google.common.base.Preconditions;
import com.google.common.base.Verify;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ImmutableSet;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.yang.common.Revision;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
private volatile Object contextVersion = version;
private YangTextSchemaContextResolver(final SchemaRepository repository, final SchemaSourceRegistry registry) {
- this.repository = Preconditions.checkNotNull(repository);
- this.registry = Preconditions.checkNotNull(registry);
+ this.repository = requireNonNull(repository);
+ this.registry = requireNonNull(registry);
final TextToASTTransformer t = TextToASTTransformer.create(repository, registry);
transReg = registry.registerSchemaSourceListener(t);
* @throws IOException when the URL is not readable
* @throws SchemaSourceException When parsing encounters general error
*/
- public YangTextSchemaSourceRegistration registerSource(@Nonnull final YangTextSchemaSource source)
+ public @NonNull YangTextSchemaSourceRegistration registerSource(final @NonNull YangTextSchemaSource source)
throws SchemaSourceException, IOException, YangSyntaxErrorException {
checkArgument(source != null);
* @throws IOException when the URL is not readable
* @throws SchemaSourceException When parsing encounters general error
*/
- public YangTextSchemaSourceRegistration registerSource(@Nonnull final URL url) throws SchemaSourceException,
- IOException, YangSyntaxErrorException {
+ public @NonNull YangTextSchemaSourceRegistration registerSource(final @NonNull URL url)
+ throws SchemaSourceException, IOException, YangSyntaxErrorException {
checkArgument(url != null, "Supplied URL must not be null");
final String path = url.getPath();
});
}
- private static SourceIdentifier guessSourceIdentifier(final String fileName) {
+ private static SourceIdentifier guessSourceIdentifier(final @NonNull String fileName) {
try {
return YangTextSchemaSource.identifierFromFilename(fileName);
} catch (final IllegalArgumentException e) {