} else if (rootType instanceof InstanceIdentifierTypeDefinition) {
return ValueTypeCodec.encapsulatedValueCodecFor(valueType, instanceIdentifierCodec);
} else if (rootType instanceof UnionTypeDefinition) {
- Callable<UnionTypeCodec> loader = UnionTypeCodec.loader(valueType, (UnionTypeDefinition) rootType,
- getInstanceIdentifierCodec(), getIdentityCodec());
+ Callable<UnionTypeCodec> loader = UnionTypeCodec.loader(valueType, (UnionTypeDefinition) rootType);
try {
return loader.call();
} catch (Exception e) {
- throw new IllegalStateException("Unable to load codec for "+valueType,e);
+ throw new IllegalStateException("Unable to load codec for " + valueType, e);
}
}
return ValueTypeCodec.getCodecFor(valueType, instantiatedType);
import java.util.Set;
import java.util.concurrent.Callable;
-import org.opendaylight.yangtools.concepts.Codec;
import org.opendaylight.yangtools.yang.binding.BindingMapping;
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.type.UnionTypeDefinition;
}
}
- @SuppressWarnings("rawtypes")
- static final Callable<UnionTypeCodec> loader(final Class<?> unionCls,final UnionTypeDefinition unionType, final Codec instanceIdentifier, final Codec identity) {
+ static final Callable<UnionTypeCodec> loader(final Class<?> unionCls, final UnionTypeDefinition unionType) {
return new Callable<UnionTypeCodec>() {
-
@Override
public UnionTypeCodec call() throws NoSuchMethodException, SecurityException {
Set<UnionValueOptionContext> values = new HashSet<>();