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

NullPointerException thrown for illegal port numbers

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.1.3
    • Fix Version/s: None
    • Component/s: Source
    • Labels:
      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. ControllerThreadSocketFactoryTest.java
          1 kB
          Fredrik Wendt
        2. XMLRPCClientTest.java
          1 kB
          Fredrik Wendt

          Activity

            People

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

              Dates

              • Created:
                Updated: