-
Enhancement
-
Resolution: Unresolved
-
P4
-
25
-
generic
-
generic
The class sun.java2d.Disposer can use either weak or phantom references. For many years it has used phantom references by default.
One reason why weak references were supported is because phantom references keep a strong reference to the object until the reference is added to the reference queue and cleared. However, weak references were not used by default because they could be cleared before the finalizer of the object finished running.
This behavior changed after the fix forJDK-8071507. Now both weak and phantom references behave the same way when it comes to clearing the reference to the object.
Because of this, we can remove the implementation that uses weak references. This will make the code simpler and reduce the number of paths we need to test.
One reason why weak references were supported is because phantom references keep a strong reference to the object until the reference is added to the reference queue and cleared. However, weak references were not used by default because they could be cleared before the finalizer of the object finished running.
This behavior changed after the fix for
Because of this, we can remove the implementation that uses weak references. This will make the code simpler and reduce the number of paths we need to test.