We are performing a null and an instanceof check, where the latter
can also serve as a a null check. Remove the explicit null check.
Change-Id: Iac43aae00d8832cb7ade2f45041375451d5bedf4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
ed5716fa515d66d284d3f6a6f4b1866a74b79724)
private static ActionDefinition findActionDefinition(final SchemaContext context, final SchemaPath path) {
final SchemaNode node = SchemaContextUtil.findDataSchemaNode(context, path.getParent());
- if (node != null) {
- if (node instanceof ActionNodeContainer) {
- for (ActionDefinition action : ((ActionNodeContainer) node).getActions()) {
- if (action.getQName().equals(path.getLastComponent())) {
- return action;
- }
+ if (node instanceof ActionNodeContainer) {
+ for (ActionDefinition action : ((ActionNodeContainer) node).getActions()) {
+ if (action.getQName().equals(path.getLastComponent())) {
+ return action;
}
}
}