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

Bug 95490

Summary: String substitution variables are lost during import
Product: [Eclipse Project] Platform Reporter: Sergey Prigogin <eclipse.sprigogin>
Component: DebugAssignee: Kevin Barnes <cocoakevin>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: dj.houghton
Version: 3.1   
Target Milestone: 3.1 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Preferences file none

Description Sergey Prigogin CLA 2005-05-16 23:39:07 EDT
Run/Debug string substitution variables are lost during import of preferences. 
To reproduce import preferences from the attached file. Import of string 
substitution variables did work in M5, I'm not sure about M6.
Comment 1 Sergey Prigogin CLA 2005-05-16 23:40:37 EDT
Created attachment 21245 [details]
Preferences file
Comment 2 Darin Wright CLA 2005-05-17 09:45:57 EDT
Verified that export/import of String Substitution Variables does not work in 
M7.

* created several variables on "Preferences > Run/Debug > String Substitution"
* exported prefs (looked in file to see they were there)
* deleted the new variables from pref page
* imported preference file
> variables did not appear.

Moving to runtime for comment.

Comment 3 Pascal Rapicault CLA 2005-05-31 16:57:03 EDT
Need to investigate for RC2, as this might hide something bigger.
Comment 4 DJ Houghton CLA 2005-05-31 17:32:57 EDT
I have verified that the exported values are applied to the workspace when they
are imported but for some reason they aren't appearing in the preference dialog.

Will investigate property change notification.
Comment 5 DJ Houghton CLA 2005-06-01 06:53:38 EDT
The StringVariableManager class initializes the values on startup but it doesn't
react to changes in the preferences after that.

Something like this:

IPropertyChangeListener listener = new IPropertyChangeListener() {
   public void propertyChange(PropertyChangeEvent event) {
      if (!PREF_VALUE_VARIABLES.equals(event.getProperty()))
         return;
     // todo reload the preference values
   }
};
VariablesPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(listener);
Comment 6 Darin Wright CLA 2005-06-01 08:56:36 EDT
Thanks DJ.
Comment 7 Darin Wright CLA 2005-06-02 11:58:57 EDT
Fixed in StringVariableManager. Also added synchronization to variable access 
methods to avoid concurrent access while initializing variable tables.
Comment 8 Darin Wright CLA 2005-06-02 11:59:09 EDT
Please verify, Kevin.
Comment 9 Kevin Barnes CLA 2005-06-07 15:40:03 EDT
verified