Community
Participate
Working Groups
Build Identifier: M20100211-1343 if I use the following code: Class SomeWizardPage extends WizardPage{ ... ModifyFacetedProjectWizard facetedWizard = new ModifyFacetedProjectWizard(fpjwc); WizardDialog dialog = new WizardDialog(shell, facetedWizard); dialog.open(); ... } And I profile the code, every time I run through this code I get another reference to SomeWizardPage in the memory, and if I remove those lines from the code, the extra references goes away. The must odd thing is that only when I click finish button inside the ModifyFacetedProjectWizard I get the extra references, because if I click on cancel everything works fine. The problem is present even if I overwrite the performFinish() method inside the ModifyFacetedProjectWizard. I think this also affects the New Dynamic Web Project Wizard(and other wizards) using the Modify... button. Reproducible: Always Steps to Reproduce: -----------Using the code sniped I give------------------------- 1.Use some code like the one I post 2.Profile such code with some Profiling tool 3.Verify that every time you go through that code and click on Finish in the ModifyFacetedProjectWizard, you got an extra reference for the WizardPage you used to create the ModifyFacetedProjectWizard instance. --------------Using New Dynamic Web Project Wizard---------------- 1.- open the New dynamic web project wizard 2.- click on Modify... button in configuration group 3.- click OK in the Project Facets Dialog. 4.- click Cancel in the New Dynamic Web Project Wizard. 5.- take a snapshot. 6.- repeat steps 1-5 7.- Compare the two snapshots, you will see some extra facet references.
Does your profiler let you examine what's holding these references? If so, post that here.
Created attachment 172976 [details] References hold by ModifyFacetedProjectWizard My profiler only shows which references some object is holding, but it does not tell me (or I don't know how to) who is holding some reference. I will attach what I can get with it. Please let me know if you prefer a different format for the file or need anything else.
I am not sure what the attached CSV represents. It certainly hasn't helped to clarify the situation. Since you are already profiling this code, I would recommend that you take this a step further and figure our where those references are being held. Most profilers will let you trace reference trees.
Created attachment 173001 [details] Another format of the same snap.csv file Sorry the snap.csv is not useful at all, I didn't verify it exports the tree itself, here is another format where you can actually see the tree, sorry about that :P. The limitation my profiler has is that I can´t see who is holding the ModifyFacetedProjectWizard, but in here you can see the EarProjectWizard reference hold by ModifyFacetedProjectWizard.
Thanks for the additional output. > The limitation my profiler has is that I can´t see who is holding the > ModifyFacetedProjectWizard, but in here you can see the EarProjectWizard > reference hold by ModifyFacetedProjectWizard. I don't think the output shows what you think it shows. EarProjectWizard is a subclass of ModifyFacetedProjectWizard. This output doesn't show object instance id of any kind (at least none that I could see), so cannot tell whether this object tree in turn references another instance of ModifyFacetedProjectWizard like your initial post suggests.
> if I use the following code: > Class SomeWizardPage extends WizardPage{ > ... > ModifyFacetedProjectWizard facetedWizard = new > ModifyFacetedProjectWizard(fpjwc); > WizardDialog dialog = new WizardDialog(shell, facetedWizard); > dialog.open(); > ... > } > > And I profile the code, every time I run through this code I get another > reference to SomeWizardPage in the memory, and if I remove > those lines from the code, the extra references goes away. Could you provide a more complete repro? > I think this also affects the New Dynamic Web Project Wizard(and other wizards) > using the Modify... button. It shouldn't. The modify button doesn't launch another instance of ModifyFacetedProjectWizard. It just opens a facet selection dialog. See PresetSelectionPanel.handleModifyButtonPressed().
Closing pending more conclusive evidence that there is a WTP problem here vs an issue with adopter product.