On Sun, Aug 31, 2008 at 5:34 PM, Tim Peierls
<tim@...> wrote:
I just stumbled across the new Factory class in org.directwebremoting.extend and noticed a couple of problems. The very minor one is that it seems to have been generified from code that was specific to JsonParser, e.g., get(ServletContext) is documented as returning "The current JsonParser".
Yeah - the JsonParser was the point were my happiness to cut and paste broke, and I generalized it. Thanks.
The more interesting one is that the builder field (and thus the entire class) is not safe for concurrent access. It might be that instances of Factory are meant to be confined to a single thread, in which case the documentation should reflect that. If not, though, builder should be made a volatile or be guarded by a lock.
Once again I'm slightly humbled and scared by the frequency with which you find these.
I've added to the documentation that the function should only be called while the context is starting up.
I believe that the setter should be called first, once only, and from then on it will only be read.
Joe.