Uploaded image for project: 'Java Mission Control'
  1. Java Mission Control
  2. JMC-6241

Leaking context menu items

XMLWordPrintable

    • other
    • JMC 7 Sprint 19 Stabilization

      Ken Dobson discovered the following:

      I discovered a bug that results in the actions in the context menu for Thread Activity being
      constantly added without removing the old items. There is a screenshot below that shows the bug.
      This is replicated by editing the lanes from the legend and then from the chart. The reason for this bug is this snippet below.

      public void updateContextMenu(MCContextMenuManager mm) {
      for (String id : actionIdentifiers)

      { mm.remove(id); }

      actionIdentifiers.clear();

      This is able to be called from two separate context menus so when we call it from the chart menu and then the legend menu we call actionIdentifiers.clear() on the previous context menus action id's leaving them orphaned and unable to be removed. There's a couple of possible solutions that I can think of.

      1. Remove the context menu from the chart legend. That being said I've been told this was previously expected to work this way so we don't want to remove that from the user which makes sense.

      2. We could create an chartActionIdentifiers and a legendActionIdentifiers. This doesn't seem all that elegant but would be easily implemented.

            neugens Mario Torre
            hirt Marcus Hirt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: