code: protected final void checkForLock() throws LockException, RepositoryException {
  
          if (getParent().isLockedByAnotherSession()) {
              Lock parentLock = this.getParent().getLock();
              if (parentLock != null && parentLock.getLockToken() == null) {
                  throw new LockException(JcrI18n.lockTokenNotHeld.text(node.location()));
              }
          }
      }
docs: Checks that this property's parent node is not already locked by another session. If the parent node is not locked or the
  parent node is locked but the lock is owned by this {@code Session}, this method completes silently. If the parent node is
  locked (either directly or as part of a deep lock from an ancestor), this method throws a {@code LockException}.
  
  @throws LockException if the parent node of this property is locked (that is, if {@code getParent().isLocked() == true &&
  getParent().getLock().getLockToken() == null}.
  @throws RepositoryException if any other error occurs
  @see Node#isLocked()
  @see Lock#getLockToken()