Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 242685 - StringVariableManager - Variable contributions may silently override existing variables
Summary: StringVariableManager - Variable contributions may silently override existing...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.5 M1   Edit
Assignee: Platform-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-31 05:45 EDT by Stefan Liebig CLA
Modified: 2008-07-31 09:50 EDT (History)
1 user (show)

See Also:


Attachments
Checks ´overridden´ variables from extensions (1.88 KB, patch)
2008-07-31 05:45 EDT, Stefan Liebig CLA
darin.eclipse: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Liebig CLA 2008-07-31 05:45:49 EDT
Created attachment 108835 [details]
Checks ´overridden´ variables from extensions

By chance it is possible that variables contributed by extensions can silently override existing variables. Bugs relating from unexpected string substitutions are hard to find. Logging such ´overrides´ would help detecting such problems.
If you add variables manually by  addVariables(IValueVariable[] variables) an exception will be thrown when an ´override´ occurs. 

I attached a patch that logs such ´overrides´ from extensions. With that adding variables manually and by extensions is more consistent.

I also wrote a unit test (not attached) but I had to check the logging output manually.
Comment 1 Darin Wright CLA 2008-07-31 09:48:20 EDT
Applied patch. Enhanced to display name of bunlde that the original variable was contributed from.
Comment 2 Darin Wright CLA 2008-07-31 09:49:31 EDT
Fixed.
Comment 3 Darin Wright CLA 2008-07-31 09:50:23 EDT
Verified.