Community
Participate
Working Groups
In the olden days, ReferenceBindings could safely be compared with ==, and only ReferenceBinding.hashCode() contained a tweak to enable replacing a URB with a resolved binding without re-hashing (see the comment still visible in RB.hashCode()). With the advent of type annotations (JSR 308) differently annotated references to the same type have different instances of RB, connected to the one an only prototype of each. From this point on every use of == needs an explicit excuse documented with //$IDENTITY-COMPARISON$. Every other comparison must go through TypeBinding.equalsEquals(). Bug 544921 introduced ReferenceBindingSetWrapper, which allows to create sets that bypass both contracts: - a URB and its resolved binding will be treated as different types - an annotated type and its prototype will be treated as different types. I'm not saying that storing ReferenceBindings in sets (or ObjectVector) was fully safe before bug 544921, but the current state surely looks inconsistent. One thing to research in git history: why was TypeBinding.equalsEquals() made a static method, rather than overriding the member method equals() in TypeBinding?
Also, what is the relationship between TypeSystem.HashedParameterizedTypes.PTBKey and the new ReferenceBindingSetWrapper?
Bulk move to 4.14
Thanks for adding to this bug Stephan. It's still not clear to me though, what's supposed to be done here.
Bulk move of unassigned bugs to 4.15
Bulk move to 4.16
Bulk move of unassigned bugs to 4.17
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.