Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLakshmi Shanmugam2020-02-10 09:51:20 +0000
committerLakshmi Shanmugam2020-02-12 05:57:23 +0000
commitefa9c6cbad2468990268fe123ef4a8c30d23a467 (patch)
tree8f92bf7a7798ff90b0cbc5b545f571898281d933
parent0aac1a72367cb9075ae8de87a8e68c605c679107 (diff)
downloadeclipse.platform.swt-efa9c6cbad2468990268fe123ef4a8c30d23a467.tar.gz
eclipse.platform.swt-efa9c6cbad2468990268fe123ef4a8c30d23a467.tar.xz
eclipse.platform.swt-efa9c6cbad2468990268fe123ef4a8c30d23a467.zip
Bug 423463 - ClassCastException in CCombo while selecting menu items
from SWTBotToolbarDropDownButton. Widgets such as Items can send FocusIn event using notifyListeners(). Add missing instanceOf check before casting. Change-Id: I84ce5bbf76ffccf360470c0d039fe5e9e3778d54
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java
index 55a24c70c2..5cb3e280e9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java
@@ -146,9 +146,11 @@ public CCombo (Composite parent, int style) {
}
return;
}
- Shell shell = ((Control)event.widget).getShell ();
- if (shell == CCombo.this.getShell ()) {
- handleFocus (SWT.FocusOut);
+ if (event.widget instanceof Control) {
+ Shell shell = ((Control)event.widget).getShell ();
+ if (shell == CCombo.this.getShell ()) {
+ handleFocus (SWT.FocusOut);
+ }
}
};

Back to the top