The annotation seems to me to call for the custom type both times.

On Thu, Oct 2, 2008 at 9:16 AM, Peter Jones <[EMAIL PROTECTED]> wrote:

>
> Hi Benson,
>
> Thanks for checking this out.  Just to clarify, do you think the test
> should be checking that its an instance of StringType in both places, or do
> you think the wrong type is being returned (i.e. it should be a
> CustomStringType in both cases)?
>
> Cheers,
> Peter
>
> On Wed, Oct 01, 2008 at 05:57:55PM -0400, Benson Margulies wrote:
> > I think I agree with you. I'm in no position to test with the IBM JDK.
> Could
> > you tack a patch onto a JIRA and I'll apply it.
> >
> > On Mon, Sep 29, 2008 at 7:47 AM, Benson Margulies <[EMAIL PROTECTED]
> >wrote:
> >
> > > It may take me a day or two to get to this, but I will.
> > >
> > >
> > > On Sun, Sep 28, 2008 at 10:52 PM, Peter Jones <[EMAIL PROTECTED]
> >wrote:
> > >
> > >>
> > >> Hi there,
> > >>
> > >> Think there's a small discrepancy in the rt/databinding/aegis
> > >> JaxbTypeTest.
> > >> Note the type which is checked for when the element QName is
> > >> "elementProperty" in the two checks below:
> > >>
> > >>    AnnotatedTypeInfo info = new AnnotatedTypeInfo(tm, JaxbBean1.class,
> > >>        "urn:foo", new TypeCreationOptions());
> > >>    ...
> > >>    QName element = (QName)elements.next();
> > >>    ...
> > >>    Type custom = info.getType(element);
> > >>    if ("bogusProperty".equals(element.getLocalPart())) {
> > >>        assertTrue(custom instanceof StringType);
> > >>    } else if ("elementProperty".equals(element.getLocalPart())) {
> > >>        assertTrue(custom instanceof CustomStringType);
> > >>    } else {
> > >>        fail("Unexpected element name: " + element.getLocalPart());
> > >>    }
> > >>    element = (QName)elements.next();
> > >>    ...
> > >>    custom = info.getType(element);
> > >>    if ("bogusProperty".equals(element.getLocalPart())) {
> > >>        assertTrue(custom instanceof StringType);
> > >>    } else if ("elementProperty".equals(element.getLocalPart())) {
> > >>        assertTrue(custom instanceof StringType);
> > >>    } else {
> > >>        fail("Unexpected element name: " + element.getLocalPart());
> > >>    }
> > >>
> > >> If the "elementProperty" is the first QName, we check that the type is
> an
> > >> instance of CustomStringType, but if its the second Qname we check
> that
> > >> its an instance of StringType.
> > >>
> > >> This is the annotation in the JaxbBean1 class:
> > >>
> > >>    @XmlElement(type = CustomStringType.class)
> > >>        public String getElementProperty() {
> > >>
> > >> Would that suggest the type should be a CustomStringType?  In the
> test,
> > >> it's
> > >> always a StringType.
> > >>
> > >> The test passes with the sun jdk as "elementProperty" is always the
> second
> > >> QName returned, but if you run this test with the ibm jdk, it fails
> since
> > >> "elementProperty" is the first QName returned.
> > >>
> > >> If the test is wrong and it should check for StringType both times,
> fair
> > >> enough, otherwise, I can file a jira.  Let me know if you have any
> > >> thoughts.
> > >>
> > >> Cheers,
> > >> Peter
>
> --
> Peter Jones
> Progress Software
> E-Mail: mailto:[EMAIL PROTECTED]
> Tel: 709-738-3725 x321 | Fax: 709-738-3745
> 570 Newfoundland Drive, St. John's, NL, Canada A1A 5B1
>

Reply via email to