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

Impossible to remove a named rule from the notification manager

    XMLWordPrintable

Details

    • named rule, notification
    • Unit

    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
          Jerome Velociter
        2. XWIKI-2350.patch
          17 kB
          Jerome Velociter
        3. XWIKI-2350.patch
          18 kB
          Jerome Velociter
        4. XWIKI-2350.patch
          16 kB
          Jerome Velociter

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: