Bug 125965 - [prefs] "Export/Import preferences" should let user to choose wich preference to export/import
Summary: [prefs] "Export/Import preferences" should let user to choose wich preference...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL: http://www.azew.com
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-31 21:07 EST by fx CLA
Modified: 2006-02-15 06:46 EST (History)
2 users (show)

See Also:


Attachments
Eclipse preference export file (95.85 KB, text/plain)
2006-02-01 20:24 EST, fx CLA
no flags Details
Patch to fix this issue (6.42 KB, patch)
2006-02-02 12:08 EST, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description fx CLA 2006-01-31 21:07:02 EST
When click File->Export/Import->General->Preference , some path information such as JAVA_HOME, ECLIPSE_HOME path and some configuaration that I don't want to import is imported. 
So, one of the two results is generated: 
1, I give up using Import/Export preferences
2, Bad preferences is imported
Comment 1 DJ Houghton CLA 2006-02-01 09:41:17 EST
1). The ability to export only certain preferences currently exists and its up to the plug-in developers to provide the filters. I would recommend opening bug reports for specific preference values that you don't want exported.

2). I don't see JAVA_HOME and ECLIPSE_HOME in my exported preferences. Can you paste the line in your export file with those values here so we can look at it? Thanks.
Comment 2 fx CLA 2006-02-01 20:18:28 EST
When I exported preferences from 3.1.1, and imported to 3.2m2, some thing related to some path value is wrong, I don't know why.


I opened the exported config.epf, I saw the following:

/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.classpathVariable.JUNIT_HOME=c\:/eclipse311/plugins/org.junit_3.8.1

you can see the path is c\:/eclipse311

My Eclipse 3.2M2 is installed in c:\eclipse322

I think many path related  value is wrong.

I attached the .epf, you can watch it yourself
Comment 3 fx CLA 2006-02-01 20:24:34 EST
Created attachment 33990 [details]
Eclipse preference export file

I installed Eclipse 3.1.1 in c:\eclipse311, and exported the preference to this file. 
I installed eclipse 3.2 M2 in c:\eclipse322, when I import the .epf into Eclipse 3.2 M2, some path-related issues happened
Comment 4 fx CLA 2006-02-01 20:29:51 EST
There are many path related value in the .epf file:

/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.classpathVariable.JUNIT_HOME=c\:/eclipse311/plugins/org.junit_3.8.1
/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.classpathVariable.ECLIPSE_HOME=c\:/eclipse311
/instance/org.eclipse.pde.core/platform_path=c\:\\eclipse311
Comment 5 DJ Houghton CLA 2006-02-02 07:17:20 EST
Moving to JDT/Core for comment. I think this is a case where a preference modify listener could be registered and strip out values which don't make sense importing from legacy files? (see PreferenceModifyListener)
Comment 6 Frederic Fusier CLA 2006-02-02 09:54:17 EST
There's already a preference listener on JavaModelManager. We can add a filter for some specific variables...

However, there are still some remaining issue:
1) we cannot filter other plugins variables (pde platform_path in comment 4 for 
   example)
2) I'm relunctant to hard code the list of variable names which must be filtered.
   I think this list should be made of variables which have an initializer...
   Jerome, do you agree with this point?
Comment 7 Jerome Lanneluc CLA 2006-02-02 10:18:59 EST
I agree that we should filter out the imported value of classpath variables that have an initializer.

fx please enter a separate bug against PDE if you want them to filter out /instance/org.eclipse.pde.core/platform_path
Comment 8 Frederic Fusier CLA 2006-02-02 12:08:25 EST
Created attachment 34026 [details]
Patch to fix this issue

Jerome, may you review this fix?
Thx
Comment 9 Frederic Fusier CLA 2006-02-03 10:33:22 EST
Released in HEAD.
Comment 10 David Audel CLA 2006-02-15 06:46:56 EST
Verified for 3.2 M5 using build I20060215-0010