Remove unneeded null check 50/82950/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 8 Jul 2019 09:24:06 +0000 (11:24 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 8 Jul 2019 10:57:20 +0000 (12:57 +0200)
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)

dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/DOMActionRoutingTable.java

index b2556893b40dc81cc01b47bdb1ce57783635219e..2446cd277aca694e36741631e2ce871294553bc7 100644 (file)
@@ -69,12 +69,10 @@ final class DOMActionRoutingTable extends AbstractDOMRoutingTable<DOMActionInsta
 
     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;
                 }
             }
         }