Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-6314

Enhance javadoc of ObservationUtil.registerChangeListener for parameter "nodeTypes"

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Done
    • Neutral
    • 5.3.12, 5.4.3
    • 5.3.10, 5.4
    • core
    • Basel 15
    • 1

    Description

      A customer got confused by the Javadoc of this parameter:
      @param nodeTypes the node types to filter events for

      It lead him to the assumption:
      "Right now it says "nodeTypes the node types to filter events for" and we interpreted that to mean we'd only receive events for those node types, but actually it's the exact opposite."

      The code of JCR using this parameter is:
      org.apache.jackrabbit.core.observation.EventFilter.blocks(EventState)

      To this code parts:

      // check node types
              if (nodeTypes != null) {
                  Set<NodeType> eventTypes = eventState.getNodeTypes(session.getNodeTypeManager());
                  boolean match = false;
                  for (int i = 0; i < nodeTypes.length && !match; i++) {
                      for (NodeType eventType : eventTypes) {
                          NodeTypeImpl nodeType = (NodeTypeImpl) eventType;
                          match |= nodeType.getQName().equals(nodeTypes[i].getQName())
                                  || nodeType.isDerivedFrom(nodeTypes[i].getQName());
                      }
                  }
                  if (!match) {
                      return true;
                  }
              }
      

      See support issue for further information.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              mgeljic Mikaël Geljić
              cringele Christian Ringele
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Task DoD