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

Livnat Peer updated XMLRPC-174:
-------------------------------

    Attachment: ClientFactory.java

The fixed Client factory.
I added a check if the given input is null or empty, if this is the case i did 
not concatenate a prefix  to the method name.


In the current implementation if the value of pRemoteName is null the remote 
method generated is  "null.foo()"  and no NullPointerExcpetion is being thrown.

for consistency in the fixed implementation no NullPointerExcpetion is thrown 
as well.
In case the pRemoteName is null no prefix is added to the method name. 


> The ClientFactory always concatenates a "." before the method name.
> -------------------------------------------------------------------
>
>                 Key: XMLRPC-174
>                 URL: https://issues.apache.org/jira/browse/XMLRPC-174
>             Project: XML-RPC
>          Issue Type: Bug
>          Components: Source
>    Affects Versions: 3.1.1
>            Reporter: Livnat Peer
>            Priority: Minor
>         Attachments: ClientFactory.java
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> I want to invoke a remote method, who's name is without any prefix.
> In the "newInstance"  methods:
>  1.   The first 2 signatures add the class name as a prefix:
>    public interface X{
>       public void foo();
>    }
>     foo()  invokes--> X.foo()
>  2. The 3rd signature adds the string passed in pRemoteName as a prefix:
>           invoking newInstance with pRemoteName="goo" invokes--> "goo.foo()"
>                                            passing  pRemoteName=""   invokes 
> -->   ".foo()"
> suggested patch:
> In the class
>    "ClientFactory.java"
> In method
>    "public Object newInstance(ClassLoader pClassLoader, final Class pClass,
>  final String pRemoteName)"
>  add a check if the pRemoteName is empty, if this is the case then no need to
>  concatenate "." before the method name.
> today - String methodName = pRemoteName + "." + pMethod.getName();
> a fix - String methodName = pMethod.getName();
>                if(pRemoteName.length()>0){
>                    methodName = pRemoteName + "." + methodName;
>                }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to