[ 
https://issues.apache.org/jira/browse/XMLRPC-186?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fredrik Wendt updated XMLRPC-186:
---------------------------------

    Attachment: ControllerThreadSocketFactoryTest.java

To me, this looks like the ControllerThreadSocketFactory.createSocket(...) 
method ignores IllegalArgumentExceptions and silently returns null after the 
timeout has elapsed, which breaks the ProtocolSocketFactory contract.
(The httpclient.HttpConnection.open() method in turns expectes that a socket 
factory always returns a socket, which then causes the NullPointerException.)

> NullPointerException thrown for illegal port numbers
> ----------------------------------------------------
>
>                 Key: XMLRPC-186
>                 URL: https://issues.apache.org/jira/browse/XMLRPC-186
>             Project: XML-RPC
>          Issue Type: Bug
>          Components: Source
>    Affects Versions: 3.1.3
>            Reporter: Fredrik Wendt
>            Priority: Minor
>         Attachments: ControllerThreadSocketFactoryTest.java, 
> XMLRPCClientTest.java
>
>
> 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.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to