[
https://issues.apache.org/jira/browse/CXF-3526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039056#comment-13039056
]
Freeman Fang commented on CXF-3526:
-----------------------------------
Hi,
As the super class HashMap<String, Map<Integer, Integer>> of ComplexMapResult
isn't directly visible by reflection of the service interface, so actually this
is the expected behavior, the solution(as described from[1],Using Java Classes
That Aren't Visible to the Service Interface) is declare the method signature
using base type(HashMap<String, Map<Integer, Integer>> for your case)
So the code should be
{code}
Map<String, Map<Integer, Integer>> testComplexMapResult();
{code}
in interface
and
{code}
public Map<String, Map<Integer, Integer>> testComplexMapResult() {
ComplexMapResult result
= new ComplexMapResult();
Map<Integer, Integer> map1 = new HashMap<Integer, Integer>();
map1.put(1, 3);
result.put("key1", map1);
return result;
}
{code}
in impl class.
Anyway, I'm going to commit a testcase to demonstrate how it works.
[1]http://cxf.apache.org/docs/aegis-21.html
Freeman
> Aegis cannot handle nested map inheritance
> ------------------------------------------
>
> Key: CXF-3526
> URL: https://issues.apache.org/jira/browse/CXF-3526
> Project: CXF
> Issue Type: Bug
> Components: Aegis Databinding
> Affects Versions: 2.3.3
> Environment: Debian GNU/Linux tomcat 6
> Reporter: Vassilis Virvilis
> Assignee: Freeman Fang
> Attachments: ws-test.tgz
>
>
> The following code fails when trying to retrieve data with the simple fronted
> public class ComplexMapResult extends
> HashMap<String, Map<Integer, Integer>> {
> }
> // fail returns null map value
> public ComplexMapResult testComplexMapResult();
> How it fails. On retrieve when I try to print the resulting matrix I get
> INFO: client.TestClient.testComplexMapResult(TestClient.java:35):
> {key1=[#document: null]}
> where I should get a valid map for the key "key1"
> The following code succeeds
> // success
> public Map<String, Map<Integer, Integer>> testDirectComplexMapResult();
> So my guess is Aegis doesn't handle the inheritance very well.
> Further more the following code succeeds
> // success
> public class SimpleMapResult extends HashMap<String, Integer> {
> }
> // success
> public SimpleMapResult testSimpleMapResult();
> so that means it handles the extension when there is no nesting
> I will try to attach the eclipse project for this (~7k)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira