users@jaxb.java.net

Re: Generated code uses unchecked conversion

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 15 Apr 2005 10:49:07 -0700

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