- byYangBuilder.put(childProto.getYangArg(), childProto);
-
- // FIXME: It really feels like we should be specializing DataContainerCodecPrototype so as to ditch
- // createInstance() and then we could do an instanceof check instead.
- if (childProto.runtimeType() instanceof ChoiceRuntimeType) {
- final var choice = (ChoiceCodecContext<?>) childProto.getCodecContext();
- for (var cazeChild : choice.getCaseChildrenClasses()) {
- byBindingArgClassBuilder.put(cazeChild, childProto);
+ byYangBuilder.put(childProto.yangArg(), childProto);
+
+ if (childProto instanceof ChoiceCodecPrototype<?> choiceProto) {
+ for (var cazeChild : choiceProto.getCodecContext().getCaseChildrenClasses()) {
+ byBindingArgClassBuilder.put(cazeChild, choiceProto);