On Monday, April 4, 2011 8:18:49 PM UTC+2, Bob Vawter wrote: > > This change would break the contract of the WeakMapping, since the > value object isn't guaranteed to outlive the key object.
Oh, right, of course! A better way to fix AutoBeans is to only use WeakMapping for > non-generated bean implementations, and have the shim implement a > private interface that's queried by AutoBeanUtils.getAutoBean(). > By "non-generated" I suppose you mean "wrapper"? Are we guaranteed that unwrap() will be called so that the WeakMapping will be set to a null value? As far as I can tell, RequestFactory does not use "wrapper" autobeans (at least on the server-side) so that shouldn't be an issue (at least for me; you might want to explicitly document the potential memory leak though for those who use AutoBeans directly, with AutoBeanFactoryMagic, rather than through RequestFactory). So if I understand correctly, you're suggesting adding a com.google.gwt.autobean.shared.impl.Shim interface with a "__getAutoBean_MethodUnlikelyToCollideWithUserMethod" method, that shims (both generated for client-side code, and dynamic proxies for ProxyAutoBean) will implement; and AutoBeanUtils.getAutoBean would use that method if the "delegate" is a Shim and fallback to WeakMapping otherwise? -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
