make preferences check for [ and ] in key

Change-Id: If60e87f1f141678ba261c7bf77aa26a12aa97a8b
This commit is contained in:
Joe Ross
2014-10-19 13:34:50 -07:00
committed by Thomas Clark
parent 5c702edd8f
commit 042a1dbc82
2 changed files with 21 additions and 15 deletions

View File

@@ -503,7 +503,7 @@ public class Preferences {
file.createNewFile();
output = new FileOutputStream(file);
output.write("[Preferences]\n".getBytes());
for (int i = 0; i < keys.size(); i++) {
@@ -803,6 +803,8 @@ public class Preferences {
case '\r':
case ' ':
case '\t':
case '[':
case ']':
throw new ImproperPreferenceKeyException(value, letter);
}
}
@@ -813,7 +815,7 @@ public class Preferences {
* preference table.
*
* @param value
* @return
* @return true if the given string is ok to use in the preference table
*/
public static boolean isAcceptable(String value) {
for (int i = 0; i < value.length(); i++) {
@@ -824,6 +826,8 @@ public class Preferences {
case '\r':
case ' ':
case '\t':
case '[':
case ']':
return false;
}
}