| Summary: | [launch] Launch configuration listeners called in unexpected way | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | John Cortell <john.cortell> | ||||
| Component: | Debug | Assignee: | Platform-Debug-Inbox <platform-debug-inbox> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | Michael_Rennie, pawel.1.piech | ||||
| Version: | 4.1 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | stalebug | ||||||
| Attachments: |
|
||||||
|
Description
John Cortell
Created attachment 192940 [details]
Sample listener plugin (project)
(In reply to comment #0) > The addition and removal goes as expected. However, each change notification > has a surprising config: not the one created (or removed), and there was never > any addition notification for those configs. That would be due to this code: // notify of add/change for both local and shared configurations - see bug 288368 if (added) { getLaunchManager().launchConfigurationAdded(new LaunchConfiguration(getName(), getContainer())); } else { getLaunchManager().launchConfigurationChanged(new LaunchConfiguration(getName(), getContainer())); } from LaunchConfigurationWorkingCopy#writeNewFile(..). For the life of me I can't recall why we are making new instances of LaunchConfiguration for the notification, rather than simply calling the notifier with 'this' like: if (added) { getLaunchManager().launchConfigurationAdded(this); } else { getLaunchManager().launchConfigurationChanged(this); } at this stage, since the file has been saved and the parent value set we could also always return the original LaunchConfiguration instead of a working copy, like: if (added) { getLaunchManager().launchConfigurationAdded(getOriginal()); } else { getLaunchManager().launchConfigurationChanged(getOriginal()); } For reference bug 288368 introduced the code for always creating new LaunchConfiguration instances for the notifier. Looking at the patch for bug 288368, it seems the creation of a new launch configuration for a *change* notification was already there. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. If the bug is still relevant, please remove the "stalebug" whiteboard tag. |