Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 359550

Summary: Debug Launchers delegate preference is not respected when set as a default the product
Product: [Eclipse Project] Platform Reporter: James Blackburn <jamesblackburn+eclipse>
Component: DebugAssignee: Platform-Debug-Inbox <platform-debug-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, eclipse.sprigogin, thirumala
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard: stalebug
Bug Depends on: 380859    
Bug Blocks:    

Description James Blackburn CLA 2011-09-30 07:08:20 EDT
Perhaps related to: bug 284557.

I override the preference in my product:
org.eclipse.debug.core//org.eclipse.debug.core.PREFERRED_DELEGATES/...

And eclipse doesn't respect it.

This was also detailed in the mailing list post:
http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg15907.html

Steps to reproduce: 
 - Try to choose CDT's: CDI vs DSF using a product preference customization file (rather than programmatically).
Comment 1 Thirumala Reddy Mutchukota CLA 2012-03-15 16:35:36 EDT
I am also facing the problem and tried to look the code to understand the reason. I think the reason for the bug is change in preference format with limited backwards compatibility. The new preference should be in the form /instance/org.eclipse.debug.core/org.eclipse.debug.core.PREFERRED_DELEGATES/<launch_type_id>=<launcher_id>,run;<launcher_id>,debug

Even when we keep the preferences in this form the debug.core plugin is not picking up the default launchers from the default preferences. The reason is, while reading the preferences the DefaultScope is reading the preference as <qualifier>/<path>/<key>=<value>, in which org.eclipse.debug.core is the qualifier, org.eclipse.debug.core/org.eclipse.debug.core.PREFERRED_DELEGATES is the path and <launch_type_id> is the key. But the debug.core plugin is reading the preference as <qualifier>/<key>=<value>, in which it's assuming org.eclipse.debug.core/org.eclipse.debug.core.PREFERRED_DELEGATES/<launch_type_id> as the key. As the DefaultScope read the preference differently than the debug.core plugin is expecting them, debug.core plugin is not finding the default launchers preference values and so it's not showing them in the Default Launchers page.

When I changed debug.core plugin to read the preference in the form of <qualifier>/<path>/<key>=<value>, I am able to get the default values to get populated under Default Launchers preference page. But other problem I see there is, when user changes the Default Launchers preferences locally, the InstanceScope is writing the preference as <qualifier>/<key>=<value>, so after restarting I am seeing the old values for Default Launchers instead of changed values as the debug.core plugin is now reading the preference as <qualifier>/<path>/<key>=<value>. And I found no way to tell InstanceScope (in the present implementation) to deal the preference as <qualifier>/<path>/<key>=<value>.

The debug.core plugin is reading and writing preferences using Preferences.getString and Preferences.setString API. I think this is old and not capable of dealing with preferences of the form <qualifier>/<path>/<key>=<value>. I think the fix for this problem is changing the preference reading and writing logic in debug.core to use DefaultScope.INSTANCE.getNode(qualifier).node(path).getString(key) and InstanceScope.INSTANCE.getNode(qualifier).node(path).putString(key,value).
Comment 2 Thirumala Reddy Mutchukota CLA 2012-05-29 04:26:35 EDT
While investigating this issue I found a more basic problem in how the preferences are read with DefaultPreferences and InstancePreferences which is the main cause of this issue. 

I submitted a path to fix that issue which should solve this issue also.
Comment 3 Thirumala Reddy Mutchukota CLA 2012-05-29 14:29:55 EDT
The other bug I was mentioning in my previous comment is 380859
Comment 4 Lars Vogel CLA 2019-11-14 03:12:05 EST
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.