import org.opendaylight.mdsal.binding.dom.codec.api.IncorrectNestingException;
import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
import org.opendaylight.mdsal.binding.model.api.Type;
-import org.opendaylight.mdsal.binding.runtime.api.ClassLoadingStrategy;
+import org.opendaylight.mdsal.binding.runtime.api.BindingRuntimeContext;
import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
import org.opendaylight.yangtools.concepts.Immutable;
import org.opendaylight.yangtools.util.ClassLoaderUtils;
}
} else {
// We are looking for instantiation via uses in other module
- final QName instantiedName = origDef.getQName().withModule(namespace());
+ final QName instantiedName = origDef.getQName().bindTo(namespace());
final DataSchemaNode potential = getSchema().getDataChildByName(instantiedName);
// We check if it is really instantiated from same
// definition as class was derived
}
private DataContainerCodecPrototype<?> getAugmentationPrototype(final Type value) {
- final ClassLoadingStrategy loader = factory().getRuntimeContext().getStrategy();
- @SuppressWarnings("rawtypes")
- final Class augClass;
+ final BindingRuntimeContext ctx = factory().getRuntimeContext();
+
+ final Class<? extends Augmentation<?>> augClass;
try {
- augClass = loader.loadClass(value);
+ augClass = ctx.loadClass(value);
} catch (final ClassNotFoundException e) {
+ // FIXME: MDSAL-578: this is disallowed
LOG.debug("Failed to load augmentation prototype for {}. Will be retried when needed.", value, e);
return null;
}
- @SuppressWarnings("unchecked")
- final Entry<AugmentationIdentifier, AugmentationSchemaNode> augSchema = factory().getRuntimeContext()
- .getResolvedAugmentationSchema(getSchema(), augClass);
+ final Entry<AugmentationIdentifier, AugmentationSchemaNode> augSchema =
+ ctx.getResolvedAugmentationSchema(getSchema(), augClass);
return DataContainerCodecPrototype.from(augClass, augSchema.getKey(), augSchema.getValue(), factory());
}