Sunday, March 28, 2010

Problems with ArrayLists

Hi!

I have one service in blazeds thas has 2 methods:


public String test(String x){
?return(''one'');
?}

public String test(ArrayList%26lt;String%26gt; x){
return(''[1]'');
}

When I invoke those methods, using for instance blazemonster, the first method is always called, even when I put one array of Strings in the parameter!!


Anyone have one idea about this problem?

thanks in advance,

Rui

Problems with ArrayLists

Hi. ActionScript types do not map directly to Java types which makes it difficult to support method overloading where two methods have the same number of arguments but the arguments are of different types. As a result, having two methods with the same name and same number of args in your service is not supported. A bug was logged for this awhile back but it got deferred and then closed so I don't see this behavior changing any time soon.

http://bugs.adobe.com/jira/browse/SDK-12726

Hope that helps.

-Alex

Problems with ArrayLists

Thank you for the answer.


I know that Actionscript types do not map directly to java types ... but when we use AMF0(flash remoting) it was possible to call overloaded methods in Java without any problem

Best regards,

Rui

No comments:

Post a Comment