users@jaxb.java.net

Re: Any possibility of Unmarshaller.unmarshal() returning null?

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Wed, 17 Mar 2010 22:30:32 +0100

I guess there might be a tricky way of creating (for instance) a DomSource
containing
just a fancy node (perhaps an XML Comment) and feeding the Unmarshaller with
that
which *might* get you a null result.

Please provide details about your JAXBContext (package? class list?), how
you
create the Java classes (manually annotated? xjc generated?) and how you
call
the unmarshaller. Also, what does the XML look like, etc. etc. The JAXB
version
would also be of interest. Heck, we don't have a crystal ball, you know ;-)
-W


On Wed, Mar 17, 2010 at 8:43 PM, KARR, DAVID (ATTSI) <dk068x_at_att.com> wrote:

> I've been analyzing some possible paths in my code, to be sure that I'm
> checking for null results where it's necessary, and avoiding the check
> if there's no way something can be null. I've looked at the
> "Unmarshaller.unmarshal()" method, and I can't see any reasonable
> situation where this could possibly return null. If it has some sort of
> problem, it will throw an exception, but I can't imagine any way it
> could return null, indicating success. The javadoc doesn't mention
> this, which is perhaps a statement by omission that it can't return
> null, but I'm working with some people who don't necessarily take my
> assurance as the truth. Is there some stronger statement of
> "non-nullity" somewhere that I can rely on?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>