[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Why does Property Page "apply" remove the configuration from Managed Project?

I recently ran into a problem with the Autotools plugin and CDT 5.0.0. We have a class that inherits from AbstractCPropertyTab that adds an Autotools configure settings page as part of the C/C++ Build Settings. It has a canBeVisible method that calls a static method which checks if the project has an Autotools builder.

The code for that test used the IProject to get the ManagedBuildInfo which it then used to get the default configuration. The ManagedBuildInfo.getDefaultConfiguration() method uses the internal managedMakeProject to get its configurations. Well, for some reason, the Apply button ends up removing the configuration from the ManagedMakeProject.

If a change is made and the Apply button is pressed, everything works fine. However, if the Ok button gets pressed after that, the canBeVisible() method gets called again for the sendOk and we are out of luck because there is no longer a default configuration. I have since rewritten the code so that it now looks at the ProjectType id of the ManagedProject and that fixes this particular problem, but I do not understand why the configuration is being removed.

The following is the stack trace after hitting the apply button. The configuration is removed which is why it is removed from the ManagedProject. I don't understand why the performSave kicks this off since it can be just for an Apply. Some further alterations might need to be performed on the configuration and there is also this dangling ManagedProject still in the ManagedBuildInfo that has no configuration.

Thread [main] (Suspended (breakpoint at line 336 in ManagedProject)) ManagedProject.removeConfiguration(String) line: 336 ConfigurationDataProvider.removeConfiguration(ICConfigurationDescription, CConfigurationData, IProgressMonitor) line: 567 CProjectDescriptionManager.removeData(ICConfigurationDescription, CConfigurationData, IProgressMonitor) line: 1663 CProjectDescriptionManager.checkRemovedConfigurations(ICDescriptionDelta) line: 2977 SetCProjectDescriptionOperation.executeOperation() line: 83 SetCProjectDescriptionOperation(CModelOperation).execute() line: 341 SetCProjectDescriptionOperation(CModelOperation).run(IProgressMonitor) line: 606 Workspace.run(IWorkspaceRunnable, ISchedulingRule, int, IProgressMonitor) line: 1800 SetCProjectDescriptionOperation(CModelOperation).runOperation(IProgressMonitor) line: 638 CProjectDescriptionManager.setProjectDescription(IProject, ICProjectDescription, int, IProgressMonitor) line: 1255 CProjectDescriptionManager.setProjectDescription(IProject, ICProjectDescription, boolean, IProgressMonitor) line: 1218 CProjectDescriptionManager.setProjectDescription(IProject, ICProjectDescription) line: 1211 CoreModel.setProjectDescription(IProject, ICProjectDescription) line: 1385 AbstractPage$5.run(IProgressMonitor) line: 570 WorkspaceModifyDelegatingOperation.execute(IProgressMonitor) line: 69 WorkspaceModifyOperation$1.run(IProgressMonitor) line: 104 Workspace.run(IWorkspaceRunnable, ISchedulingRule, int, IProgressMonitor) line: 1800 WorkspaceModifyDelegatingOperation(WorkspaceModifyOperation).run(IProgressMonitor) line: 116 ModalContext.runInCurrentThread(IRunnableWithProgress, IProgressMonitor) line: 446 ModalContext.run(IRunnableWithProgress, boolean, IProgressMonitor, Display) line: 354 ProgressMonitorDialog.run(boolean, boolean, IRunnableWithProgress) line: 507 Page_BuildSettings(AbstractPage).performSave(int) line: 581 Page_BuildSettings(AbstractPage).performApply() line: 436 PreferencePage$2.widgetSelected(SelectionEvent) line: 284 TypedListener.handleEvent(Event) line: 228 EventTable.sendEvent(Event) line: 84 Button(Widget).sendEvent(Event) line: 1158 Display.runDeferredEvents() line: 3401 Display.readAndDispatch() line: 3033 PropertyDialog(Window).runEventLoop(Shell) line: 825 PropertyDialog(Window).open() line: 801 PropertyDialogAction.run() line: 157 ProjectPropertyDialogAction.run() line: 77 ProjectPropertyDialogAction(Action).runWithEvent(Event) line: 498 ActionContributionItem.handleWidgetSelection(Event, boolean) line: 583 ActionContributionItem.access$2(ActionContributionItem, Event, boolean) line: 500 ActionContributionItem$5.handleEvent(Event) line: 411 EventTable.sendEvent(Event) line: 84 MenuItem(Widget).sendEvent(Event) line: 1158 Display.runDeferredEvents() line: 3401 Display.readAndDispatch() line: 3033 Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2382 Workbench.runUI() line: 2346 Workbench.access$4(Workbench) line: 2198 Workbench$5.run() line: 493 Realm.runWithDefault(Realm, Runnable) line: 288 Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 488 PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149 IDEApplication.start(IApplicationContext) line: 113 EclipseAppHandle.run(Object) line: 193 EclipseAppLauncher.runApplication(Object) line: 110 EclipseAppLauncher.start(Object) line: 79 EclipseStarter.run(Object) line: 382 EclipseStarter.run(String[], Runnable) line: 179 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 57 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43 Method.invoke(Object, Object...) line: 616 Main.invokeFramework(String[], URL[]) line: 549 Main.basicRun(String[]) line: 504 Main.run(String[]) line: 1236 Main.main(String[]) line: 1212

-- Jeff J.