Hi all,
Recently I've noticed a discrepancy in the generation of my Types. I have a
bean containing a property that is a Map<String, String> (I'm using Java 5).
I noticed that this property was not being populated properly when my bean
was sent over web services and fired up the debugger to investigate. The
MapType generated for the property had both keyType and valueType fields set
to instances of ObjectType rather than the expected StringType.
Going back to where the types were created, this was ultimately the
TypeCreator associated with the service's CustomTypeMapping. This turned out
to be an instance of XMLTypeCreator (whose nextCreator field was an instance
of Java5TypeCreator). What happened was that the map property was detected,
createMapType() was called which then went on to call
getOrCreateMapKeyType().
At this stage the XMLTypeCreator's version of this method was called, and
since info.getKeyType() was null it delegated to the superclass
AbstractTypeCreator (which always just returns ObjectType here). It is worth
noting that the TypeClassInfo object passed into these calls did have a
properly populated genericType field, so if the Java5TypeCreator's method had
been called, the right thing would have happened.
Is this an issue with delegation here (shouldn't the XMLTypeCreator go to
nextCreator.getOrCreateMapKeyType() so long as nextCreator is non-null,
instead of jumping straight up to the superclass)? Alternatively, is there
some configuration I can change to have the Java5TypeCreator as my 'primary'
type creator (I do all my config via annotations, so the XMLTC doesn't really
need to do anything)? (Judging by DefaultTypeMapping.createTypeCreator(),
the primary type creator will always be an XML one, even if Java 5 is
detected...)
I was going to report this as a bug but first wanted to check that I'd
characterised the issue properly, and there wasn't some configuration I could
have done to avoid it.
Thanks,
Andrzej
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email