Project: Eclipse_Platform_UI
Bug 345735 JDT leak tests are failing due to ToolBarManagerRenderer holding onto references
Reported: 2011-05-13 09:35:35 | Status: verified fixed

They all seem to have the same cause and looks kind of like this. junit.framework.AssertionFailedError: Expected instance count: 0, actual: 1 Element 0 org.eclipse.ui.editors.text.TextEditor org.eclipse.ui.texteditor.AbstractTextEditor$InformationDispatchAction#this$0 -> org.eclipse.ui.editors.text.TextEditor@13f8d4b org.eclipse.ui.texteditor.RetargetTextEditorAction#fAction -> org.eclipse.ui.texteditor.AbstractTextEditor$InformationDispatchAction@b1a510 org.eclipse.ui.editors.text.TextEditorActionContributor#fRetargetShowInformationAction -> org.eclipse.ui.texteditor.RetargetTextEditorAction@16a3692 org.eclipse.ui.internal.EditorActionBars#editorContributor -> org.eclipse.ui.editors.text.TextEditorActionContributor@110bed6 org.eclipse.ui.internal.EditorActionBars$Overrides#this$0 -> org.eclipse.ui.internal.EditorActionBars@1364853 org.eclipse.jface.action.ContributionManager#overrides -> org.eclipse.ui.internal.EditorActionBars$Overrides@152a5f7 java.util.HashMap$Entry#value -> org.eclipse.jface.internal.provisional.action.ToolBarManager2@24c7aa java.util.HashMap$Entry[2] -> org.eclipse.e4.ui.model.application.ui.menu.impl.ToolBarImpl@b0795c (elementId: org.eclipse.ui.Defa java.util.HashMap#table -> [Ljava.util.HashMap$Entry;@250f64 org.eclipse.e4.ui.workbench.renderers.swt.ToolBarManagerRenderer#modelToManager -> {org.eclipse.e4.ui.model.application.ui.menu.impl.ToolBarImpl@66eb46 (elementId: org.eclipse.ui.mac org.eclipse.e4.ui.workbench.renderers.swt.ToolBarManagerRenderer$1#this$0 -> org.eclipse.e4.ui.workbench.renderers.swt.ToolBarManagerRenderer@1c00972 org.eclipse.e4.ui.services.internal.events.UIEventHandler#eventHandler -> org.eclipse.e4.ui.workbench.renderers.swt.ToolBarManagerRenderer$1@1bf8a41 org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl#service -> org.eclipse.e4.ui.services.internal.events.UIEventHandler@77399e java.lang.Object[175] -> {org.osgi.service.event.EventHandler}={event.topics=[org/eclipse/e4/ui/model/ui/UILabel/*], service java.util.ArrayList#elementData -> [Ljava.lang.Object;@53cb28 org.eclipse.osgi.internal.serviceregistry.ServiceRegistry#allPublishedServices -> [{org.eclipse.osgi.framework.console.CommandProvider}={service.ranking=2147483647, service.id=2}, { org.eclipse.osgi.framework.internal.core.Framework#serviceRegistry -> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry@bb855b org.eclipse.osgi.framework.internal.core.AbstractBundle#framework -> org.eclipse.osgi.framework.internal.core.Framework@1bacc7d org.eclipse.osgi.internal.loader.BundleLoader#bundle -> org.eclipse.jdt.ui.tests_3.7.0.qualifier [194] org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader#delegate -> org.eclipse.jdt.ui.tests_3.7.0.qualifier org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader -> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@1926e41 at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.assertTrue(Assert.java:20) at org.eclipse.jdt.ui.leaktest.LeakTestCase.assertInstanceCount(LeakTestCase.java:127) at org.eclipse.jdt.ui.tests.leaks.JavaLeakTest.internalTestEditorClose(JavaLeakTest.java:324) at org.eclipse.jdt.ui.tests.leaks.JavaLeakTest.internalTestEditorClose(JavaLeakTest.java:293) at org.eclipse.jdt.ui.tests.leaks.JavaLeakTest.testTextEditorClose(JavaLeakTest.java:90)

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CoolBarToTrimManager.java