Bug 344720

Summary: Removing nature from project description does not call plugin.deconfigure() properly
Product: [Eclipse Project] PDE Reporter: Kaloyan Raev <kaloyan>
Component: UIAssignee: Curtis Windatt <curtis.windatt.public>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, sptaszkiewicz, thatnitind
Version: 3.5Keywords: contributed
Target Milestone: 3.8 M7   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Bug Depends on:    
Bug Blocks: 343878    
Attachments:
Description Flags
Test case
none
Patch none

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!