From aa114afeef7193a3d0cfd18ad922354ec274ff57 Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Wed, 6 Dec 2006 10:46:38 +0000 Subject: [PATCH] Fix CCE in case of includes grouping --- .../ui/text/AbstractInformationControl.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/AbstractInformationControl.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/AbstractInformationControl.java index 9cef71da331..79c5e072d81 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/AbstractInformationControl.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/AbstractInformationControl.java @@ -448,16 +448,19 @@ public abstract class AbstractInformationControl extends PopupDialog implements private ICElement findElement(TreeItem[] items) { ILabelProvider labelProvider= (ILabelProvider)fTreeViewer.getLabelProvider(); for (int i= 0; i < items.length; i++) { - ICElement element= (ICElement)items[i].getData(); - if (fStringMatcher == null) - return element; - - if (element != null) { - String label= labelProvider.getText(element); - if (fStringMatcher.match(label)) + Object item= items[i].getData(); + ICElement element= null; + if (item instanceof ICElement) { + element= (ICElement)item; + if (fStringMatcher == null) return element; + + if (element != null) { + String label= labelProvider.getText(element); + if (fStringMatcher.match(label)) + return element; + } } - element= findElement(items[i].getItems()); if (element != null) return element;