users@jaxb.java.net

Re: Possible bug in handling xs:gMonthDay in JAXB reflections library

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 30 Jul 2007 12:37:46 -0700

Sachith Dhanushka wrote:
> Hi,
>
> I was trying to read XmlSchemaType schema comes with JAXB-RI distro, using
> JAXB reflections library. This is the schema fragment I am concerned.
>
> <xs:complexType name="TrackingOrderType">
> <xs:sequence>
> <xs:element name="shipDate" type="xs:date" minOccurs="0"/>
> <xs:element name="orderDate" type="xs:gMonthDay" minOccurs="0"/>
> <xs:element name="deliveryDate" type="xs:gMonthDay" minOccurs="0"/>
> <xs:element name="trackingDuration" type="xs:duration" minOccurs="0"/>
> </xs:sequence>
> </xs:complexType>
>
> Assume I have a reference to RuntimePropertyInfo, which represents orderDate
> element. When I call runtimePropertyInfo.getSchemaType(), the element
> representing orderDate always return null. Then I get a reference to the
> type of it by calling RuntimeTypeInfo runtimeTypeInfo =
> runtimePropertyInfo.ref() (this return iter and I get the first element).
> When I call ((RuntimeBuiltinLeafInfo)
> runtimeTypeInfo).getTypeName().getLocalPart() it returns xs:anySimpleType.
>
> But when I debug the same way to tracking duration element,
> runtimePropertyInfo.getSchemaType() itself returns xs:duration.
>
> Isn't it that orderTypeRuntimePropertyInfo.getSchemaType() should also
> return xs:gMonthDay?

Yeah, I think you are right. I filed
https://jaxb.dev.java.net/issues/show_bug.cgi?id=394


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com