jmchamberlain / workspacemechanic

Automatically exported from code.google.com/p/workspacemechanic
0 stars 0 forks source link

Allow empty values in preferences files #95

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
*What steps will reproduce the problem?*
1. Create a task with an empty value, like :
/instance/key=
2. Play this task with workspace mechanic

*What is the expected output? What do you see instead?*
I expect the task to apply successfully, and to drop a value that may exists.
Instead, I get an error in the logs "Value cannot be empty string"

*What version of the product are you using? On what operating system?*
0.3.2 / Eclipse Juno / Linux 64bits

*Please provide any additional information below.*
The culprit is `PreferenceReconcilerTask.parsePreference()` on lines 120~126.
`Preconditions.checkArgument(value.length() > 0, "'value' cannot be empty 
string.");`

Why this check ? Do you have a good reason for this ?
If so, imagine a preference with a default value, and you do not want this 
value, you just want this preference to have no value. How do you manage this 
with workspace mechanic ?

Original issue reported on code.google.com by benoit.g...@gmail.com on 16 Aug 2012 at 7:32

GoogleCodeExporter commented 8 years ago
It certainly has been a while since we added that check; I'll have to go in and 
look. Does the file with the empty value import correctly when you import it 
via File > Import > Preferences?

Original comment by konigsb...@gmail.com on 16 Aug 2012 at 12:14

GoogleCodeExporter commented 8 years ago
File > Import > Preferences says the file has not content :(

But File > Export > Preferences does not support much things ...

Original comment by benoit.g...@gmail.com on 16 Aug 2012 at 5:27

GoogleCodeExporter commented 8 years ago
Sadly, if Eclipse can't import it, we probably can't either. I realize that 
makes it challenging to, say, remove a preference. Do you have any alternate 
suggestions?

Original comment by konigsb...@gmail.com on 16 Aug 2012 at 5:52

GoogleCodeExporter commented 8 years ago
I will recheck with a preference file supported by the import/export wizard of 
eclipse

but just commenting out the NullCheck makes WorkspaceMechanic works as expected 
:)

Original comment by benoit.g...@gmail.com on 16 Aug 2012 at 6:25

GoogleCodeExporter commented 8 years ago
We want to use WorkspaceMechanic in our team to synchornize workspace settings 
(task type RECONCILE), but we run into here mentioned problem. Our use case is:
1. Setup one environment (workspace) manually
2. Export settings using WorkspaceMechanic / Preference Recorder
3. Share exported settings
4. In each workspace in team configure WorkspaceMechanic to shared setting

Problem is that WorkspaceMechanic himself has exported Java Code Style property
/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.codeComplete.staticFieldPref
ixes=
without value (as was configured), but this setting can not be imported more.

When I define standalone epf file with one line containing
org.eclipse.jdt.core/org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
and import this file with Eclipse Import>Preferences, it work fine and removes 
previously set prefix value.

From comments above, can I not exactly understand what is the attitude of 
implementation team to this problem. Will it be corrected and when? Or is it no 
bug?

Original comment by rastisla...@gmail.com on 3 Oct 2012 at 8:35

GoogleCodeExporter commented 8 years ago
As to whether or not it's a bug requires more investigation. However, as I 
recently mentioned on the mailing list [1] I'm not going to be doing much work, 
if any, on Workspace Mechanic. I will, however, consider accepting _complete_ 
patches, including very thorough tests. Many people still rely on the Workspace 
Mechanic, particularly around the area of preferences, and fixes that cause 
regressions makes for unhappy users.

[1] 
https://groups.google.com/forum/?fromgroups=#!topic/workspacemechanic/oJop9jmLZH
0

Original comment by konigsb...@gmail.com on 3 Oct 2012 at 12:20

GoogleCodeExporter commented 8 years ago
Removebin

Original comment by williamng499@gmail.com on 17 May 2015 at 6:08