code: public void setPort(int p_port) throws MalformedURIException
    {
  
      if (p_port >= 0 && p_port <= 65535)
      {
        if (m_host == null)
        {
          throw new MalformedURIException(
            Utils.messages.createMessage(MsgKey.ER_PORT_WHEN_HOST_NULL, null)); //"Port cannot be set when host is null!");
        }
      }
      else if (p_port != -1)
      {
        throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_INVALID_PORT, null)); //"Invalid port number!");
      }
  
      m_port = p_port;
    }
docs: Set the port for this URI. -1 is used to indicate that the port is
  not specified, otherwise valid port numbers are  between 0 and 65535.
  If a valid port number is passed in and the host field is null,
  an exception is thrown.
  
  @param p_port the port number for this URI
  
  @throws MalformedURIException if p_port is not -1 and not a
  valid port number