This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 435949 - [Contributions] Double items in contextual menu
Summary: [Contributions] Double items in contextual menu
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 critical with 1 vote (vote)
Target Milestone: 4.4 RC3   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 435414 436018 436720 (view as bug list)
Depends on:
Blocks: 435808
  Show dependency tree
 
Reported: 2014-05-27 12:05 EDT by Maxime Porhel CLA
Modified: 2014-06-05 11:08 EDT (History)
13 users (show)

See Also:
pwebster: review+
Lars.Vogel: review+
daniel.rolka: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maxime Porhel CLA 2014-05-27 12:05:51 EDT
+++ This bug was initially created as a clone of Bug #435808 +++ discovered during Sirius 1.0.0 RC2 homologation on Eclipse Luna SDK RC2

See Bug 435808 for more details.

The popupAny contributions (locationUri popup:org.eclipse.ui.popup.anybefore=additions for example) are added twice in
org.eclipse.e4.ui.internal.workbench.ContributionsAnalyzer.XXXgatherMenuContributions(MMenu, List<MMenuContribution>, String, ArrayList<MMenuContribution>, ExpressionContext, boolean) :

   if (!filtered && menuContribution.isToBeRendered() && popupAny) {
      // process POPUP_ANY first
      toContribute.add(menuContribution);
   } else if (filtered || (!popupTarget && !parentID.equals(id))
					|| !menuContribution.isToBeRendered()) {
     continue;
   }
   includedPopups.add(menuContribution);
 }
 toContribute.addAll(includedPopups);


The if/else if block should be improved to avoid duplicated entries or a LinkedHAshSet should be used.
Comment 1 Maxime Porhel CLA 2014-05-27 12:13:13 EDT
See https://git.eclipse.org/r/27392 for a proposed correction. 

It corrects the duplication in Sirius (Bug 435808).
Comment 2 Dani Megert CLA 2014-05-27 14:40:32 EDT
According to bug 435808 comment 1 this is a regression compared to 4.4 M7, hence something we have to look at for 4.4.
Comment 3 Paul Webster CLA 2014-05-27 16:22:06 EDT
Daniel, could you please review this patch?

PW
Comment 4 Paul Webster CLA 2014-05-27 16:22:39 EDT
+1 component lead

PW
Comment 5 Paul Webster CLA 2014-05-28 06:21:04 EDT
*** Bug 436018 has been marked as a duplicate of this bug. ***
Comment 7 Wojciech Sudol CLA 2014-05-28 12:43:36 EDT
*** Bug 435414 has been marked as a duplicate of this bug. ***
Comment 8 Wojciech Sudol CLA 2014-05-30 06:43:02 EDT
Verified in I20140528-2000.
Comment 9 Paul Webster CLA 2014-06-05 11:08:28 EDT
*** Bug 436720 has been marked as a duplicate of this bug. ***