users@jaxb.java.net

Possible bug in handling xs:gMonthDay in JAXB reflections library

From: Sachith Dhanushka <sachith.dhanushka_at_gmail.com>
Date: Sun, 15 Jul 2007 01:04:21 -0400

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?

Thanks,
SD