Description
In #8224, @janko reported a case where a Java-based connection object appeared to not be identical to itself for purposes of keying a compare_by_identity
Hash object. This is likely due to the proxy wrappers (JavaProxy and subtypes) not being treated as identical when a Hash does identity comparisons, making what seems like the same object not actually behave like the same object.
We already override the proxy equal?
method to indicate that two equivalent wrappers are the same wrapper, but this behavior was never extended to other places where identity is important (specifically, compare_by_identity
Hash instances). If we intend for proxy wrappers to always appear to be identical when the contained object is the same, we should extend the Hash logic and anywhere else that depends on identity to do the same thing.