Fix usage of the Parent.hasOwnContent method
authorSergey Malenkov <sergey.malenkov@jetbrains.com>
Fri, 24 Oct 2014 16:16:33 +0000 (20:16 +0400)
committerSergey Malenkov <sergey.malenkov@jetbrains.com>
Fri, 24 Oct 2014 16:16:33 +0000 (20:16 +0400)
platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsFilter.java

index fdd4fa96aaeeb569cdebd42883fc793ae1aad71f..0818cb6d176f79c6c7566f2943aeeb8abe2b05ca 100644 (file)
@@ -20,6 +20,7 @@ import com.intellij.ide.ui.search.SearchableOptionsRegistrar;
 import com.intellij.openapi.options.Configurable;
 import com.intellij.openapi.options.ConfigurableGroup;
 import com.intellij.openapi.options.SearchableConfigurable;
+import com.intellij.openapi.options.ex.ConfigurableWrapper;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.ActionCallback;
 import com.intellij.openapi.wm.IdeFocusManager;
@@ -208,10 +209,7 @@ abstract class SettingsFilter extends ElementFilter.Active.Impl<SimpleNode> {
   }
 
   private static boolean isEmptyParent(Configurable configurable) {
-    if (configurable instanceof SearchableConfigurable.Parent) {
-      SearchableConfigurable.Parent parent = (SearchableConfigurable.Parent)configurable;
-      return !parent.hasOwnContent();
-    }
-    return false;
+    SearchableConfigurable.Parent parent = ConfigurableWrapper.cast(SearchableConfigurable.Parent.class, configurable);
+    return parent != null && !parent.hasOwnContent();
   }
 }