code: @Override
      public void convert(IEntityLock lock, int newType, int newDuration) throws LockingException {
          if (lock.getLockType() == newType) {
              throw new LockingException(
                      "Could not convert " + lock + " : old and new lock TYPEs are the same.");
          }
  
          if (!isValidLockType(newType)) {
              throw new LockingException(
                      "Could not convert " + lock + " : lock TYPE " + newType + " is invalid.");
          }
  
          if (!isValid(lock)) {
              throw new LockingException("Could not convert " + lock + " : lock is invalid.");
          }
  
          if (newType == WRITE_LOCK
                  && retrieveLocks(lock.getEntityType(), lock.getEntityKey(), null).length > 1) {
              throw new LockingException(
                      "Could not convert " + lock + " : another lock already exists.");
          }
  
          if (newType == READ_LOCK) {
              /* Can always convert to READ */
          }
  
          Date newExpiration = getNewExpiration(newDuration);
          getLockStore().update(lock, newExpiration, newType);
          ((EntityLockImpl) lock).setLockType(newType);
          ((EntityLockImpl) lock).setExpirationTime(newExpiration);
      }
docs: Attempts to change the lock's <code>lockType</code> to <code>newType</code>.
  
  @param lock IEntityLock
  @param newType int
  @param newDuration int
  @exception org.apereo.portal.concurrency.LockingException