> From: Niclas Hedhman [mailto:[EMAIL PROTECTED] 
>
> P.S. I did not initiate the discussion of removing release(), 
> just that Stephen has this fancy "auto reclamation" which I argued 
> can not be dependent upon, but could help me to find user errors, 
> and with that came "my own" ReleaseRequirement interface to deal 
> with "my concerns in my domain".

Java GC isn't a strong contract - if it were, we'd not need close()
for InputStreams and so on (which is exactly what you say).

I agree - you can use the GC to catch user errors: I once did a
stack snapshot (created an Exception) when a component was lookup():ed.
When the component was released, I cleared the snapshot. When the
component
was finalized it would check for the Exception - if found, it would
scream at the console / user (in effect):

  I HAVE NOT BEEN RELEASED!!!! I was lookuped from:

      ... stack trace follows here ...

Worked quite nicely.

I think that's a great idea, although creation of snapshots *are*
expensive. Therefore it may be good to make this optional and only
turn it on during development.

/LS


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to