import org.opendaylight.yangtools.yang.model.api.ActionNodeContainer;
import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.SchemaTreeAwareEffectiveStatement;
-import org.opendaylight.yangtools.yang.model.api.stmt.SchemaTreeEffectiveStatement;
/**
* Compatibility bridge between {@link ActionNodeContainer#findAction(QName)} and
default Optional<ActionDefinition> findAction(final QName qname) {
// 'action' identifier must never collide with another element, hence if we look it up and it ends up being
// an ActionDefinition, we have found a match.
- final SchemaTreeEffectiveStatement<?> child = get(Namespace.class, qname);
+ //
+ // Note: JDK 11 does not like the statement constraint here, hence we go through object (which is just as fine)
+ @SuppressWarnings("unchecked")
+ final Object child = get(Namespace.class, qname);
return child instanceof ActionDefinition ? Optional.of((ActionDefinition) child) : Optional.empty();
}
}
import org.opendaylight.yangtools.yang.model.api.NotificationNodeContainer;
import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.SchemaTreeAwareEffectiveStatement;
-import org.opendaylight.yangtools.yang.model.api.stmt.SchemaTreeEffectiveStatement;
/**
* Compatibility bridge between {@link NotificationNodeContainer#findNotification(QName)} and
default Optional<NotificationDefinition> findNotification(final QName qname) {
// 'notification' identifier must never collide with another element, hence if we look it up and it ends up
// being an NotificationDefinition, we have found a match.
- final SchemaTreeEffectiveStatement<?> child = get(Namespace.class, qname);
+ //
+ // Note: JDK 11 does not like the statement constraint here, hence we go through object (which is just as fine)
+ @SuppressWarnings("unchecked")
+ final Object child = get(Namespace.class, qname);
return child instanceof NotificationDefinition ? Optional.of((NotificationDefinition) child) : Optional.empty();
}
}