Community
Participate
Working Groups
if you put a breakpoint inside "BaseEditorExtension" constructor, you will see that is is called 2 time when you open editor on a test element. when you close the openned editor, the "dispose" method is only called on one of theses instance it lead of 2 side effect : . first, it slow down editor opening . second, if you put listener on editor creating and remove them on editor disposing, all the listener are not removed (they are plugged 2 time instead of one, and unplugged only one time, so they stay behind)
updating estimated time here's my findings : inside org.eclipse.hyades.ui.internal.extension.AssociationDescriptor we make a call to createImplementationClassInstance() Class cls = getImplementationClass(); if(cls != null) { try { return cls.newInstance(); } catch (Exception e) { CommonPlugin.logError(e); } } return null; this code create an instance of a "class" problem is that "getImplementationClass()" create another instance of the same class : if((extensionClass == null) && (configurationElement != null)) { if(getValue(configurationElement, "class") != null) { try { extensionClass = configurationElement.createExecutableExtension("class").getClass(); } catch (Exception e) { CommonPlugin.logError(e); } } } return extensionClass; (instance is created inside "createExecutableExtension") so, to make short : . we create an instance . we make a "getClass()" on it . and on the result, we ask to create an instance => to open an editor, we created 2 different instance.... i will examine a bit who use theses method to rationalize a bit all of this....
Created attachment 167461 [details] patch this patch fix the "double instance editor" problem instead of calling "getImplementationClass", it make the same kind code if no extension class is defined, and return the instance used to calculate the "Class" instead of creating a new one
updating worked hours Paul, could you review it please ? many thanks in advance to note : this patch is on tptp.platform.common.ui plugin, inside src-common-internal part. I will make a test case as soon as possible but i won't be able to commit the patch itself
Reviewed and approved with comments: -We still need org.eclipse.hyades.ui.internal.extension.AssociationDescriptor.getImplementationClass() since it is an API on the interface (poorly designed, in my opinion), so we should call it from org.eclipse.hyades.ui.internal.extension.AssociationDescriptor.createImplementationClassInstance(), but cache the instance at the class level when created in either method.
Created attachment 167480 [details] patch V2 this patch is previous one fixed following your review Paul, could you please commit it under CVS ? i don't have the write access for this plugin many thanks in advance
(In reply to comment #5) > Created an attachment (id=167480) [details] > patch V2 > > this patch is previous one fixed following your review > > Paul, could you please commit it under CVS ? i don't have the write access for > this plugin > > many thanks in advance The attached patch checked in to CVS (HEAD). Note, we will test this scenario under defect 228262.
fix verified, closing