1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Bug 471136 - Ensure preference node path is valid

Change-Id: I6e7634bcf46713ee472f7a86f40051b4db5d5a49
Signed-off-by: Greg Watson <g.watson@computer.org>
This commit is contained in:
Greg Watson 2015-06-26 10:16:55 -04:00
parent bc64e0a017
commit 8ec64b17bf

View file

@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.remote.internal.core;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
@ -127,11 +129,21 @@ public class RemoteConnection implements IRemoteConnection {
}
Preferences getPreferences() {
return connectionType.getPreferenceNode().node(name);
try {
return connectionType.getPreferenceNode().node(URLEncoder.encode(name, "UTF-8")); //$NON-NLS-1$
} catch (UnsupportedEncodingException e) {
// Should not happen!
throw new RuntimeException(e);
}
}
ISecurePreferences getSecurePreferences() {
return connectionType.getSecurePreferencesNode().node(name);
try {
return connectionType.getSecurePreferencesNode().node(URLEncoder.encode(name, "UTF-8")); //$NON-NLS-1$
} catch (UnsupportedEncodingException e) {
// Should not happen!
throw new RuntimeException(e);
}
}
/*