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

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

    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.

  was:
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.


Removed curly braces from description field.

> 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
>
> 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