Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ve-dev] FYI: Label Providers - new info


Some new info about Bean Label Providers:

Just found something out. We just recently changed it so that Bean Label Providers are cached in the Bean Property Descriptor. This was done for performance reasons. But this introduced a problem. Some of the providers (e.g EnumeratedLabelProvider) cache some IBeanProxies in them. However these proxies are only valid for one editor. But the LabelProviders are shared with all of the editors. So what happens is the first editor up becomes the one that the proxies were created against. Now if that editor shuts down, the proxies are now invalid for that registry, but they are still being used. So exceptions can occur because of this.

From now on any LabelProvider that wants to cache bean proxies will need to use the "registered constants" concept in the proxy registry of the current edit domain. That way as editors are switched they will pick the registry associated with the editor, plus when that editor is closed, those constants will automatically be cleaned up and thrown away.

Thanks,
Rich

Back to the top