Okay... I've got a question about weak references
Is it possible for the clear() method to be called by the garbage collector when there is still a strong reference in the system?
I'm specifically concerned about the following scenario:
1. The GC finds no strong reference and decides to clear the weak reference object
2. A context switch occurs and GC stops executing
3. The get() method is called and returns a value
4. A context switch occurs and GC starts executing
5. GC calls clear()
Is this possible?
Is it possible for the clear() method to be called by the garbage collector when there is still a strong reference in the system?
I'm specifically concerned about the following scenario:
1. The GC finds no strong reference and decides to clear the weak reference object
2. A context switch occurs and GC stops executing
3. The get() method is called and returns a value
4. A context switch occurs and GC starts executing
5. GC calls clear()
Is this possible?