> Why? Is it a soft reference cleared exactly when the referenced 
> object is finalized? 

No. The soft reference is cleared first. Then the object is finalized.

Look at the javadoc for the java.lang.ref package:

    An object is softly reachable if it is not strongly reachable but
can 
    be reached by traversing a soft reference. 

    An object is weakly reachable if it is neither strongly nor softly 
    reachable but can be reached by traversing a weak reference. When
the 
    weak references to a weakly-reachable object are cleared, the object

    becomes eligible for finalization. 

I.e. the object must *not* have a strong or soft or weak reference to it

before it can be finalized.

If you want to detect when the reference is cleared in order to provide
some other processing, use a ReferenceQueue.

/LS


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

Reply via email to