Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336862 - [Compatibility] Java editor context menu's OpaqueMenuItem causes editor to leak
Summary: [Compatibility] Java editor context menu's OpaqueMenuItem causes editor to leak
Status: VERIFIED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: 4.1 RC2   Edit
Assignee: Remy Suen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-10 14:14 EST by Remy Suen CLA
Modified: 2011-05-24 09:49 EDT (History)
2 users (show)

See Also:


Attachments
PopupMenuExtender patch v1 (3.28 KB, patch)
2011-02-15 14:40 EST, Remy Suen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2011-02-10 14:14:24 EST
org.eclipse.jdt.ui.tests.leaks.JavaLeakTest's testJavaEditorContextMenu is failing.

junit.framework.AssertionFailedError: Expected instance count: 0, actual: 1
Element 0
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor
  org.eclipse.ui.texteditor.TextEditorAction#fTextEditor -> org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor@1321a4f
  org.eclipse.jface.action.ActionContributionItem#action -> org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction@261e08
  java.util.HashMap$Entry#value -> org.eclipse.jface.action.ActionContributionItem(id=paste)
  java.util.HashMap$Entry[61] -> org.eclipse.e4.ui.model.application.ui.menu.impl.OpaqueMenuItemImpl@c7d60c (elementId: paste, tags:
  java.util.HashMap#table -> [Ljava.util.HashMap$Entry;@755470
  org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer#modelToContribution -> {org.eclipse.e4.ui.model.application.ui.menu.impl.MenuSeparatorImpl@1330af4 (elementId: reorgGroup,
  org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer$1#this$0 -> org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer@4621ac
  org.eclipse.e4.ui.services.internal.events.UIEventHandler#eventHandler -> org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer$1@1ae74f5
  org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl#service -> org.eclipse.e4.ui.services.internal.events.UIEventHandler@1f24908
  java.lang.Object[160] -> {org.osgi.service.event.EventHandler}={event.topics=[org/eclipse/e4/ui/model/ui/UILabel/*], service
  java.util.ArrayList#elementData -> [Ljava.lang.Object;@9003aa
  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@187b9fe
  org.eclipse.osgi.framework.internal.core.AbstractBundle#framework -> org.eclipse.osgi.framework.internal.core.Framework@538793
  org.eclipse.osgi.internal.loader.BundleLoader#bundle -> org.eclipse.jdt.ui.tests_3.7.0.qualifier [154]
  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@3e090f
Comment 1 Remy Suen CLA 2011-02-15 14:40:18 EST
Created attachment 189040 [details]
PopupMenuExtender patch v1

Patch to perform a deep unlinking operation of all model items from their corresponding contribution items so that the renderer no longer references them.

Paul, should the PopupMenuExtender have to do this? It feels to me like it should be handled by the renderer itself or that a deep call should be made when any model element and contribution item gets cleared from the renderer.
Comment 2 Paul Webster CLA 2011-05-13 15:50:52 EDT
Remy, are we still mis-behaving here?

PW
Comment 3 Remy Suen CLA 2011-05-13 19:57:44 EDT
(In reply to comment #2)
> Remy, are we still mis-behaving here?

The test still fails, yes.
Comment 4 Paul Webster CLA 2011-05-17 11:57:49 EDT
Released.
PW
Comment 5 Remy Suen CLA 2011-05-24 09:49:03 EDT
Verified with I20110523-2200 on Windows XP.