Bug 344720 - Removing nature from project description does not call plugin.deconfigure() properly
Summary: Removing nature from project description does not call plugin.deconfigure() p...
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.8 M7   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks: 343878
  Show dependency tree
 
Reported: 2011-05-04 11:11 EDT by Kaloyan Raev CLA
Modified: 2012-04-18 12:15 EDT (History)
3 users (show)

See Also:


Attachments
Test case (4.02 KB, application/octet-stream)
2011-05-04 11:16 EDT, Kaloyan Raev CLA
no flags Details
Patch (1.07 KB, patch)
2012-04-03 12:04 EDT, Szymon Ptaszkiewicz CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kaloyan Raev CLA 2011-05-04 11:11:47 EDT
The Eclipse Libra project has a logic that removes the Plug-in Nature from a project (see bug 343878). 

According to the guidelines given in the Javadoc, we remove the nature from the IProjectDescription and the call IProject.setDescription() with the modified IProjectDescription. It looks like the Project.setDescription() implementation does not call IPluginNature.deconfigure() properly, because after it is executed the plug-in nature is gone, but the two plug-in builders (SchemaBuilder and ManifestBuilder) are still there. 

I've tried to debug and I see that the PluginProject.deconfigure() is actually called, but this does not affect the final IProjectDescription that is set in Project.setDescription().

I will attach a simple test case that demonstrates the bug. 

We can work around this bug by explicitly removing the two builders from  the IProjectDescription, but this is not a good solution, because we are duplicating the functionality of PluginProject.deconfigure().
Comment 1 Kaloyan Raev CLA 2011-05-04 11:16:44 EDT
Created attachment 194727 [details]
Test case

Test case attached.
Comment 2 Szymon Ptaszkiewicz CLA 2012-04-03 12:03:45 EDT
I can reproduce this using the test case. This is not Platform/Resources issue. The root cause is that the changed description is not stored using IProject#setDescription call inside org.eclipse.pde.internal.core.natures.BaseProject.removeFromBuildSpec(String). Similar thing is already done in BaseProject.setBuilderCommand(IProjectDescription, ICommand)

Moving to PDE/UI.
Comment 3 Szymon Ptaszkiewicz CLA 2012-04-03 12:04:39 EDT
Created attachment 213506 [details]
Patch
Comment 4 Curtis Windatt CLA 2012-04-18 12:15:35 EDT
Fix applied to master.  Thanks!