users@jaxb.java.net

Re: final variables

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 18 Sep 2006 08:18:46 -0700

Trevor Kramer wrote:
> Given the new guarantees in the Java 1.5 memory model in regards to
> final variables and concurrent access are there any plans to allow
> final variables in annotated jaxb classes (remove the no-arg
> constructor requirement)? This would greatly ease writing properly
> synchronized programs that deal with immutable objects.

It's not planned right now. I agree that being able to invoke
constructors are desirable for multiple reasons, though.

Normally, you'd handle the visibility issue by making sure that a thread
obtains access to the JAXB tree via a properly synchronized means.
According to my rather limited understanding of the memory model, that
should guarantee the visibility of all the tree nodes.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com