docs: private void validateIncomingReferences( JcrVersionNode version ) throws RepositoryException {
          for (PropertyIterator iter = version.getReferences(); iter.hasNext();) {
              AbstractJcrProperty prop = (AbstractJcrProperty)iter.next();
              AbstractJcrNode referrer = prop.getParent();
  
              // If the property's parent is the root node, fail.
              if (referrer.isRoot()) {
                  throw new ReferentialIntegrityException(JcrI18n.cannotRemoveVersion.text(prop.getPath()));
              }
              boolean referrerIsAnotherVersion = (referrer instanceof JcrVersionNode)
                                                 && ((JcrVersionNode)referrer).getContainingHistory()
                                                                              .getIdentifier()
                                                                              .equals(version.getContainingHistory()
                                                                                             .getIdentifier());
              if (!this.equals(referrer) && !referrerIsAnotherVersion) {
                  throw new ReferentialIntegrityException(JcrI18n.cannotRemoveVersion.text(prop.getPath()));
              }
          }
      }