import com.google.common.collect.ImmutableList.Builder;
import com.google.common.collect.ListMultimap;
import com.google.common.collect.MultimapBuilder;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
import org.opendaylight.yangtools.concepts.Mutable;
import org.opendaylight.yangtools.concepts.ObjectRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.QNameModule;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.opendaylight.yangtools.yang.model.api.stmt.ModuleEffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.SubmoduleEffectiveStatement;
-import org.opendaylight.yangtools.yang.model.parser.api.YangParserFactory;
-import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier;
import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException;
import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
+import org.opendaylight.yangtools.yang.parser.api.YangParserFactory;
+import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException;
import org.opendaylight.yangtools.yang.parser.repo.YangTextSchemaContextResolver;
-import org.opendaylight.yangtools.yang.parser.repo.YangTextSchemaSourceRegistration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Beta
public final class ModuleInfoSnapshotResolver implements Mutable {
private static final class RegisteredModuleInfo {
- final YangTextSchemaSourceRegistration reg;
+ final Registration reg;
final YangModuleInfo info;
final ClassLoader loader;
private int refcount = 1;
- RegisteredModuleInfo(final YangModuleInfo info, final YangTextSchemaSourceRegistration reg,
- final ClassLoader loader) {
+ RegisteredModuleInfo(final YangModuleInfo info, final Registration reg, final ClassLoader loader) {
this.info = requireNonNull(info);
this.reg = requireNonNull(reg);
this.loader = requireNonNull(loader);
}
// Create an explicit registration
- final YangTextSchemaSourceRegistration reg;
+ final Registration reg;
try {
reg = ctxResolver.registerSource(toYangTextSource(sourceId, info));
} catch (YangSyntaxErrorException | SchemaSourceException | IOException e) {
final Optional<Revision> revision = entry.getKey().getRevision();
final ModuleEffectiveStatement module = entry.getValue();
- sources.add(RevisionSourceIdentifier.create(module.argument(), revision));
+ sources.add(RevisionSourceIdentifier.create(module.argument().getLocalName(), revision));
module.streamEffectiveSubstatements(SubmoduleEffectiveStatement.class)
- .map(submodule -> RevisionSourceIdentifier.create(submodule.argument(), revision))
+ .map(submodule -> RevisionSourceIdentifier.create(submodule.argument().getLocalName(), revision))
.forEach(sources::add);
}
return next;
}
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private synchronized void unregister(final ImmutableList<RegisteredModuleInfo> regInfos) {
for (RegisteredModuleInfo regInfo : regInfos) {
if (!regInfo.decRef()) {