code: public void unlock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException,
        RepositoryException
     {
        checkValid();
  
        if (!session.getLockManager().holdsLock((NodeData)this.getData()))
        {
           throw new LockException("The node not locked " + getPath());
        }
  
        if (!session.getLockManager().isLockHolder(this))
        {
           throw new LockException("There are no permission to unlock the node " + getPath());
        }
  
        if (dataManager.hasPendingChanges(getInternalPath()))
        {
           throw new InvalidItemStateException("Node has pending unsaved changes " + getPath());
        }
  
        // session.checkPermission(getPath(), PermissionType.SET_PROPERTY) is not used because RepositoryException
        // is wrapped into AccessControlException
        if (!session.getAccessManager().hasPermission(getACL(), new String[]{PermissionType.SET_PROPERTY},
           session.getUserState().getIdentity()))
        {
           throw new AccessDeniedException("Access denied: unlock operation " + getPath() + " for: "
              + session.getUserID() + " item owner " + getACL().getOwner());
        }
  
        doUnlock();
  
        session.getActionHandler().postUnlock(this);
     }
docs: {@inheritDoc}