| commit | 2fef2d3bb0e52e3e8232c11a4d2145fdda1a9169 | [log] [tgz] |
|---|---|---|
| author | Kalyan Prasad Tatavarthi <kalyan_prasad@in.ibm.com> | Fri Apr 23 11:57:21 2021 +0530 |
| committer | Kalyan Prasad Tatavarthi <kalyan_prasad@in.ibm.com> | Fri Apr 23 06:01:54 2021 -0400 |
| tree | 83e70cfbd16579f812a272d929f945284974310b | |
| parent | 911be81f7f421dbe263aee800630c9313861a137 [diff] |
Bug 573098 - Switching perspective gives ClassCastException Change-Id: I8b68872ecdafa1ed5046aeb2f6869b9070eabd02 Signed-off-by: Kalyan Prasad Tatavarthi <kalyan_prasad@in.ibm.com> Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/179713 Tested-by: Platform Bot <platform-bot@eclipse.org> (cherry picked from commit 2e5e6ec2b3792fa46634cf16f3bf614a008e3eca) Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/179625
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CoolBarToTrimManager.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CoolBarToTrimManager.java index e97ba74..b318217 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CoolBarToTrimManager.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CoolBarToTrimManager.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2017 IBM Corporation and others. + * Copyright (c) 2011, 2021 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -156,7 +156,8 @@ return; } - MToolBar toolBar = (MToolBar) modelService.find(item.getId(), window); + List<MToolBar> toolbars = modelService.findElements(window, item.getId(), MToolBar.class); + MToolBar toolBar = toolbars.isEmpty() ? null : toolbars.get(0); boolean tbFound = toolBar != null; if (!tbFound) { toolBar = modelService.createModelElement(MToolBar.class);