From 610f3388c781055fcfc3f1ea8a027b1b9cbc5bae Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 20 Aug 2014 13:48:58 +0200 Subject: java: no need to check for null before calling instanceof the instanceof check returns false when passed a null value Change-Id: I7742d0d9cf25ef23d9adee7328f701c7efeea8b5 --- toolkit/test/accessibility/AccessibilityTreeModelBase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toolkit/test') diff --git a/toolkit/test/accessibility/AccessibilityTreeModelBase.java b/toolkit/test/accessibility/AccessibilityTreeModelBase.java index b15379e7d994..5ff2d96c9e48 100644 --- a/toolkit/test/accessibility/AccessibilityTreeModelBase.java +++ b/toolkit/test/accessibility/AccessibilityTreeModelBase.java @@ -52,7 +52,7 @@ public class AccessibilityTreeModelBase Object aChild = null; try { - if (aParent != null && aParent instanceof AccessibleTreeNode) + if (aParent instanceof AccessibleTreeNode) aChild = ((AccessibleTreeNode)aParent).getChild(nIndex); else System.out.println ("getChild called for unknown parent node"); @@ -69,7 +69,7 @@ public class AccessibilityTreeModelBase Object aChild = null; try { - if (aParent != null && aParent instanceof AccessibleTreeNode) + if (aParent instanceof AccessibleTreeNode) aChild = ((AccessibleTreeNode)aParent).getChildNoCreate(nIndex); else System.out.println ("getChild called for unknown parent node"); -- cgit