izumi
izumi copied to clipboard
We should prevent unitialized proxies from being used in Sets
Right now proxied value which needs to be added into a set will fail.
We have two strategies to address the issue:
- We may stop proxying equals/hashcode. It's easy and reliable strategy but may lead to some hard-to-discover problems in user's logic
- When instantiating a set we may check if any of it's members is a proxy. Then we may (a) create an instance of custom "lazy set" which would instantiate real one on first usage (b) wrap a proxy into another one with equals/hashcode inherited from Object. In that case the user may only be exposed to an incorrect behaviour when he checks equality of set element against same dependency injected somewhere else.