users@jaxb.java.net

Re: Generated code uses unchecked conversion

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 15 Apr 2005 13:44:12 -0700

Kirill Grouchnikov wrote:
> How about Class<String>?

Try this:

  return new JAXBElement<List<String>>(
     _GREETING_QNAME, List.class, null, value);


> --- Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
> wrote:
>> Uday Subbarayan wrote:
>> > [first i am not sure whether i should post it here
>> or in the issues
>> > mailing list OR a file a bug]
>>
>> In general, I believe there are some
>> generics-related warnings that you
>> cannot remove. And I think this is one of those.
>>
>> >
>> > I used the 2.0EA xjc to compile my very simple XSD
>> and then did javac,
>> >
>>
> ------------------------------------------------------------------------------------------------------------------------------------------
>> >
>>
> C:\projects\Sonoa-Systems\Product\Sun\JAXB\Test\greeting\generated>javac
>>
>> > ObjectFactory.java -Xlint:unchecked
>> > ObjectFactory.java:49: warning: [unchecked]
>> unchecked conversion
>> > found : java.lang.Class
>> > required: java.lang.Class<java.lang.String>
>> > return new
>> JAXBElement<String>(_GREETING_QNAME, ((Class)
>> > String.class), null, value);
>> >
>>
>> > ^
>> > 1 warning
>> >
>>
> ---------------------------------------------------------------------------------------------------------------------------------------------
>> > This needs to be fixed in the code generator
>> class.
>> >
>> > Uday.
>> >
>>
>>
>> --
>> Kohsuke Kawaguchi
>> Sun Microsystems
>> kohsuke.kawaguchi_at_sun.com
>>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com