Joe Walker-3 wrote:
That's fine, Tim - go for it.
Joe.
On Fri, Sep 5, 2008 at 8:36 PM, tpeierls <tim@peierls.net> wrote:
>
> I see that Joe addressed this by making the builder field volatile.
>
> There's a slight improvement that could be made, however. As the code
> stands, the builder field is accessed twice in each get method, once to
> check for nullity and then again to use the non-null value.
>
> It would better to read the volatile field once into a temporary variable.
> It's more efficient and it prevents the (extremely unlikely) case where the
> value is set to null after being seen as non-null.
>
> I have the patch ready to check in, if you like, but it's just adding this
> line (in two methods) before the nullity test:
>
> Builder<T> builder = this.builder;
>
> --tim
>