Uploaded image for project: 'XML-RPC'
  1. XML-RPC
  2. XMLRPC-186

NullPointerException thrown for illegal port numbers

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.1.3
    • None
    • Source
    • None

    Description

      When you try to use an XmlRpcClient with an address containing an illegal port number (>65535), you get a NullPointerException. After debugging I see that the constructor call to java.net.InetSocketAddress throws a good exception: IllegalArgumentException("port out of range"), but this is silently ignored and null is returned from ReflectionSocketFactory.
      I suggest adding:

      if (cause instanceof IllegalArgumentException) {
      throw (IllegalArgumentException) cause;
      }

      to give users of XmlRpcClient better error messages.

      Attachments

        1. XMLRPCClientTest.java
          1 kB
          Fredrik Wendt
        2. ControllerThreadSocketFactoryTest.java
          1 kB
          Fredrik Wendt

        Activity

          People

            Unassigned Unassigned
            wendtse Fredrik Wendt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: