code: @Override
     public void add(NodeData data) throws RepositoryException, UnsupportedOperationException, InvalidItemStateException,
        IllegalStateException
     {
        currentItem = data;
        try
        {
           setOperationType(TYPE_ADD);
           if (containerConfig.useSequenceForOrderNumber)
           {
              localMaxOrderNumber = Math.max(data.getOrderNumber(), localMaxOrderNumber);
              if (!updateSequence)
              {
                 if (addedNodeIds == null)
                 {
                    addedNodeIds = new HashSet<String>();
                 }
                 addedNodeIds.add(data.getIdentifier());
                 String pid = data.getParentIdentifier();
                 updateSequence = pid != null && addedNodeIds.contains(pid);
                 if (updateSequence)
                 {
                    addedNodeIds = null;
                 }
              }
           }
           super.add(data);
        }
        finally
        {
           currentItem = null;
        }
     }
docs: {@inheritDoc}