We have a simple check-and-cast, fold them into a instanceof pattern.
Change-Id: I60bb94091b739ced1f886f9c0c29d9b8f86ce49c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
}
final DataContainerCodecContext<?, ?> context = childNonNull(ctxProto, argType,
"Class %s is not valid child of %s", argType, getBindingClass()).get();
- if (context instanceof ChoiceNodeCodecContext) {
- final ChoiceNodeCodecContext<?> choice = (ChoiceNodeCodecContext<?>) context;
+ if (context instanceof ChoiceNodeCodecContext<?> choice) {
choice.addYangPathArgument(arg, builder);
final Optional<? extends Class<? extends DataObject>> caseType = arg.getCaseType();