Mike commented:
I had a look at the source code and it seems like the org.directwebremoting.extend.Property hierarchy is making it harder to handle generic properties in the correct way. As you are only exposing the raw type from Property, it's hard to use it for looking up actual types. I see you have worked around this in BeanConverter.createTypeHintContext by taking the property's exposed setter method (later using your "getGenericParameterTypesMethod" on it) as this will also reveal the property's actual type, but this is not possible for ObjectConverter as there is no setter.
As this is a construct of your own, why not let both BeanConverter and ObjectConverter examine the Property's actual type? That will avoid the indirect way of having to examine the setter and will fix the issue with ObjectConverter...
Everything I say here is of course in the context of Java5, where you can examine actual generic types. In my opinion this is not so important to fix for earlier Java versions, especially as that would involve enhancing signatures.
The fix would either be to make it possible to create a TypeHintContext for a field, (not only for a method) from ObjectConverter.createTypeContext, or to simply let the actual generic type be sent into convertInbound of BasicObjectConverter's subclasses, and let them do the inspection themselves...
Mike commented:
I had a look at the source code and it seems like the org.directwebremoting.extend.Property hierarchy is making it harder to handle generic properties in the correct way. As you are only exposing the raw type from Property, it's hard to use it for looking up actual types. I see you have worked around this in BeanConverter.createTypeHintContext by taking the property's exposed setter method (later using your "getGenericParameterTypesMethod" on it) as this will also reveal the property's actual type, but this is not possible for ObjectConverter as there is no setter.
As this is a construct of your own, why not let both BeanConverter and ObjectConverter examine the Property's actual type? That will avoid the indirect way of having to examine the setter and will fix the issue with ObjectConverter...
Everything I say here is of course in the context of Java5, where you can examine actual generic types. In my opinion this is not so important to fix for earlier Java versions, especially as that would involve enhancing signatures.
The fix would either be to make it possible to create a TypeHintContext for a field, (not only for a method) from ObjectConverter.createTypeContext, or to simply let the actual generic type be sent into convertInbound of BasicObjectConverter's subclasses, and let them do the inspection themselves...