Updated ARM Spec
Paul Benedict
pbenedict at apache.org
Tue Oct 26 16:49:09 PDT 2010
On Tue, Oct 26, 2010 at 6:33 PM, Rémi Forax <forax at univ-mlv.fr> wrote:
> Throwable is not immutable. You can call initCause(), setStacktrace,
> etc.
Agreed. That's why Joe started the email. The problem is the mutability.
> But we also want to be able to create some immutable throwables in
> order to preallocate them and share them between several threads.
> For these immutable throwable they should be initialized with nulls to
> avoid to tie the VM internals too much with the Throwable Java class.
I still don't see why you have to use null as a magic value. Share
your immutable Throwable instances, just don't "overload" null to do
your tricks.
> Because we want to use these tricks, we can not create a method freeze
> as you suggest.
> As you say, this is a common idiom that work well but not in this
> peculiar case.
I may have read Joe's email wrong, but I thought he wanted the ability
to tell certain Throwable instances not to tag on additional data. I
thought he wanted to have immutability when he needed it. So why can't
you preallocate your Throwable instances, call freeze(), and share
them? What is "null" doing that freeze() cannot?
Paul
More information about the coin-dev
mailing list