Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-2350

Impossible to remove a named rule from the notification manager

    XMLWordPrintable

    Details

    • keywords:
      named rule, notification
    • Tests:
      Unit
    • Similar issues:

      Description

      Named rules cannot be removed from the notification manager, since the removeNamedRule tries to remove the rule in the vector of that named rule, instead of removing the rule itself. See the addNamedRule and removeNamedRule methods below :

          public void addNamedRule(String name, XWikiNotificationRule rule) {
              synchronized (namedrules) {
                  Vector vnamedrules = (Vector) namedrules.get(name);
                  if (vnamedrules==null) {
                      vnamedrules = new Vector();
                      namedrules.put(name, vnamedrules);
                  }
                  vnamedrules.add(rule);
              }
          }
      
          public void removeNamedRule(String name) {
              synchronized (namedrules) {
                  Vector vnamedrules = (Vector) namedrules.get(name);
                  if (vnamedrules!=null) {
                      vnamedrules.remove(name);
                      if (vnamedrules.size()==0)
                          namedrules.remove(name);
                  }
              }
          }
      

        Attachments

        1. XWIKI-2350.patch
          17 kB
        2. XWIKI-2350.patch
          17 kB
        3. XWIKI-2350.patch
          18 kB
        4. XWIKI-2350.patch
          16 kB

          Activity

            People

            Assignee:
            jerome Jerome Velociter
            Reporter:
            jerome Jerome Velociter
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response: