Author: toad
Date: 2006-09-01 15:29:41 +0000 (Fri, 01 Sep 2006)
New Revision: 10317
Modified:
trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
trunk/freenet/src/freenet/clients/http/BookmarkManager.java
trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java
trunk/freenet/src/freenet/config/BooleanOption.java
trunk/freenet/src/freenet/config/FilePersistentConfig.java
trunk/freenet/src/freenet/config/IntOption.java
trunk/freenet/src/freenet/config/LongOption.java
trunk/freenet/src/freenet/config/Option.java
trunk/freenet/src/freenet/config/ShortOption.java
trunk/freenet/src/freenet/config/StringArrOption.java
trunk/freenet/src/freenet/config/StringOption.java
trunk/freenet/src/freenet/config/SubConfig.java
trunk/freenet/src/freenet/node/LoggingConfigHandler.java
trunk/freenet/src/freenet/node/Node.java
trunk/freenet/src/freenet/node/NodeClientCore.java
trunk/freenet/src/freenet/node/NodeIPDetector.java
trunk/freenet/src/freenet/node/TestnetHandler.java
trunk/freenet/src/freenet/node/TextModeClientInterfaceServer.java
trunk/freenet/src/freenet/node/fcp/FCPServer.java
trunk/freenet/src/freenet/node/updater/NodeUpdater.java
trunk/freenet/src/freenet/plugin/PluginManager.java
trunk/freenet/src/freenet/pluginmanager/PluginManager.java
trunk/freenet/src/freenet/support/SimpleFieldSet.java
Log:
Don't write (most) config values to freenet.ini unless they are different to
the default.
Practically speaking this means that we can change the defaults and have the
changes deployed, except for things like storeSize where the user doesn't
expect abrupt changes!
Modified: trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
===================================================================
--- trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
2006-09-01 14:47:33 UTC (rev 10316)
+++ trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
2006-09-01 15:29:41 UTC (rev 10317)
@@ -137,7 +137,7 @@
allRequestsByClientRequest = new HashMap();
this.name = name;
- sc.register(name+"_priority_policy", PRIORITY_HARD,
name.hashCode(), true, "Priority policy of the "+name+"scheduler", "Set the
priority policy scheme used by the scheduler. Could be one of
["+PRIORITY_HARD+", "+PRIORITY_SOFT+"]",
+ sc.register(name+"_priority_policy", PRIORITY_HARD,
name.hashCode(), true, false, "Priority policy of the "+name+"scheduler", "Set
the priority policy scheme used by the scheduler. Could be one of
["+PRIORITY_HARD+", "+PRIORITY_SOFT+"]",
new PrioritySchedulerCallback(this));
this.choosenPriorityScheduler =
sc.getString(name+"_priority_policy");
logMINOR = Logger.shouldLog(Logger.MINOR, this);
Modified: trunk/freenet/src/freenet/clients/http/BookmarkManager.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/BookmarkManager.java 2006-09-01
14:47:33 UTC (rev 10316)
+++ trunk/freenet/src/freenet/clients/http/BookmarkManager.java 2006-09-01
15:29:41 UTC (rev 10317)
@@ -82,7 +82,7 @@
this.bookmarks = new Vector();
this.node = n;
this.uskcb = new USKUpdatedCallback();
- sc.register("bookmarks", n.isTestnetEnabled() ?
DEFAULT_TESTNET_BOOKMARKS : DEFAULT_DARKNET_BOOKMARKS, 0, true, "List of
bookmarks", "A list of bookmarked freesites", makeCB());
+ sc.register("bookmarks", n.isTestnetEnabled() ?
DEFAULT_TESTNET_BOOKMARKS : DEFAULT_DARKNET_BOOKMARKS, 0, true, false, "List of
bookmarks", "A list of bookmarked freesites", makeCB());
String[] initialbookmarks = sc.getStringArr("bookmarks");
for (int i = 0; i < initialbookmarks.length; i++) {
Modified: trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
2006-09-01 14:47:33 UTC (rev 10316)
+++ trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
2006-09-01 15:29:41 UTC (rev 10317)
@@ -166,7 +166,7 @@
*/
public SimpleToadletServer(SubConfig fproxyConfig, NodeClientCore core)
throws IOException, InvalidConfigValueException {
- fproxyConfig.register("enabled", true, 1, true, "Enable
FProxy?", "Whether to enable FProxy and related HTTP services",
+ fproxyConfig.register("enabled", true, 1, true, true, "Enable
FProxy?", "Whether to enable FProxy and related HTTP services",
new FProxyEnabledCallback());
boolean enabled = fproxyConfig.getBoolean("enabled");
@@ -212,17 +212,17 @@
}
}
- fproxyConfig.register("port", DEFAULT_FPROXY_PORT, 2, true,
"FProxy port number", "FProxy port number",
+ fproxyConfig.register("port", DEFAULT_FPROXY_PORT, 2, true,
false, "FProxy port number", "FProxy port number",
new FProxyPortCallback());
- fproxyConfig.register("bindTo", "127.0.0.1", 2, true, "IP
address to bind to", "IP address to bind to",
+ fproxyConfig.register("bindTo", "127.0.0.1", 2, true, false,
"IP address to bind to", "IP address to bind to",
new FProxyBindtoCallback());
- fproxyConfig.register("allowedHosts", "127.0.0.1", 2, true,
"Allowed hosts", "Hostnames or IP addresses that are allowed to connect to
FProxy. May be a comma-separated list of hostnames, single IPs and even CIDR
masked IPs like 192.168.0.0/24",
+ fproxyConfig.register("allowedHosts", "127.0.0.1", 2, true,
false, "Allowed hosts", "Hostnames or IP addresses that are allowed to connect
to FProxy. May be a comma-separated list of hostnames, single IPs and even CIDR
masked IPs like 192.168.0.0/24",
new FProxyAllowedHostsCallback());
- fproxyConfig.register("css", "clean", 1, false, "CSS Name",
"Name of the CSS FProxy should use "+themes.toString(),
+ fproxyConfig.register("css", "clean", 1, false, false, "CSS
Name", "Name of the CSS FProxy should use "+themes.toString(),
new FProxyCSSNameCallback());
- fproxyConfig.register("advancedDarknetEnabled", false, 1,
false, "Enable Advanced Darknet?", "Whether to show or not informations meant
for advanced users/devs. This setting should be turned to false in most cases.",
+ fproxyConfig.register("advancedDarknetEnabled", false, 1,
false, false, "Enable Advanced Darknet?", "Whether to show or not informations
meant for advanced users/devs. This setting should be turned to false in most
cases.",
new FProxyAdvancedDarknetEnabledCallback(this));
- fproxyConfig.register("showPanicButton", false, 1, true, "Show
the panic button?", "Whether to show or not the panic button on the /queue/
page.",
+ fproxyConfig.register("showPanicButton", false, 1, true, false,
"Show the panic button?", "Whether to show or not the panic button on the
/queue/ page.",
new BooleanCallback(){
public boolean get(){
return
SimpleToadletServer.isPanicButtonToBeShown;
Modified: trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java
2006-09-01 14:47:33 UTC (rev 10316)
+++ trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java
2006-09-01 15:29:41 UTC (rev 10317)
@@ -24,7 +24,7 @@
super(client);
this.node = node;
tslconfig = new SubConfig("toadletsymlinker", node.config);
- tslconfig.register("symlinks", null, 9, true, "Symlinks in
ToadletServer",
+ tslconfig.register("symlinks", null, 9, true, false, "Symlinks
in ToadletServer",
"A list of \"alias#target\"'s that forms a
bunch of symlinks",
new StringArrCallback() {
public String get() {
Modified: trunk/freenet/src/freenet/config/BooleanOption.java
===================================================================
--- trunk/freenet/src/freenet/config/BooleanOption.java 2006-09-01 14:47:33 UTC
(rev 10316)
+++ trunk/freenet/src/freenet/config/BooleanOption.java 2006-09-01 15:29:41 UTC
(rev 10317)
@@ -7,8 +7,8 @@
private boolean currentValue;
public BooleanOption(SubConfig conf, String optionName, boolean
defaultValue, int sortOrder,
- boolean expert, String shortDesc, String longDesc,
BooleanCallback cb) {
- super(conf, optionName, sortOrder, expert, shortDesc, longDesc);
+ boolean expert, boolean forceWrite, String shortDesc,
String longDesc, BooleanCallback cb) {
+ super(conf, optionName, sortOrder, expert, forceWrite,
shortDesc, longDesc);
this.defaultValue = defaultValue;
this.cb = cb;
this.currentValue = defaultValue;
@@ -48,5 +48,9 @@
} else
throw new OptionFormatException("Unrecognized boolean:
"+val);
}
+
+ public boolean isDefault() {
+ return currentValue == defaultValue;
+ }
}
Modified: trunk/freenet/src/freenet/config/FilePersistentConfig.java
===================================================================
--- trunk/freenet/src/freenet/config/FilePersistentConfig.java 2006-09-01
14:47:33 UTC (rev 10316)
+++ trunk/freenet/src/freenet/config/FilePersistentConfig.java 2006-09-01
15:29:41 UTC (rev 10317)
@@ -159,7 +159,7 @@
}
for(int i=0;i<configs.length;i++) {
SimpleFieldSet scfs = configs[i].exportFieldSet();
- fs.put(configs[i].prefix, scfs);
+ fs.tput(configs[i].prefix, scfs);
}
return fs;
}
Modified: trunk/freenet/src/freenet/config/IntOption.java
===================================================================
--- trunk/freenet/src/freenet/config/IntOption.java 2006-09-01 14:47:33 UTC
(rev 10316)
+++ trunk/freenet/src/freenet/config/IntOption.java 2006-09-01 15:29:41 UTC
(rev 10317)
@@ -12,8 +12,8 @@
private String cachedStringValue;
public IntOption(SubConfig conf, String optionName, int defaultValue,
String defaultValueString,
- int sortOrder, boolean expert, String shortDesc, String
longDesc, IntCallback cb) {
- super(conf, optionName, sortOrder, expert, shortDesc, longDesc);
+ int sortOrder, boolean expert, boolean forceWrite,
String shortDesc, String longDesc, IntCallback cb) {
+ super(conf, optionName, sortOrder, expert, forceWrite,
shortDesc, longDesc);
this.defaultValue = defaultValue;
this.cb = cb;
this.currentValue = defaultValue;
@@ -21,8 +21,8 @@
}
public IntOption(SubConfig conf, String optionName, String
defaultValueString,
- int sortOrder, boolean expert, String shortDesc, String
longDesc, IntCallback cb) {
- super(conf, optionName, sortOrder, expert, shortDesc, longDesc);
+ int sortOrder, boolean expert, boolean forceWrite,
String shortDesc, String longDesc, IntCallback cb) {
+ super(conf, optionName, sortOrder, expert, forceWrite,
shortDesc, longDesc);
this.defaultValue = Fields.parseInt(defaultValueString);
this.cb = cb;
this.currentValue = defaultValue;
@@ -59,5 +59,9 @@
if(cachedStringValue != null) return cachedStringValue;
return Integer.toString(getValue());
}
+
+ public boolean isDefault() {
+ return currentValue == defaultValue;
+ }
}
Modified: trunk/freenet/src/freenet/config/LongOption.java
===================================================================
--- trunk/freenet/src/freenet/config/LongOption.java 2006-09-01 14:47:33 UTC
(rev 10316)
+++ trunk/freenet/src/freenet/config/LongOption.java 2006-09-01 15:29:41 UTC
(rev 10317)
@@ -12,8 +12,8 @@
private String cachedStringValue;
public LongOption(SubConfig conf, String optionName, long defaultValue,
String defaultValueString,
- int sortOrder, boolean expert, String shortDesc, String
longDesc, LongCallback cb) {
- super(conf, optionName, sortOrder, expert, shortDesc, longDesc);
+ int sortOrder, boolean expert, boolean forceWrite,
String shortDesc, String longDesc, LongCallback cb) {
+ super(conf, optionName, sortOrder, expert, forceWrite,
shortDesc, longDesc);
this.defaultValue = defaultValue;
this.cb = cb;
this.currentValue = defaultValue;
@@ -21,8 +21,8 @@
}
public LongOption(SubConfig conf, String optionName, String
defaultValueString,
- int sortOrder, boolean expert, String shortDesc, String
longDesc, LongCallback cb) {
- super(conf, optionName, sortOrder, expert, shortDesc, longDesc);
+ int sortOrder, boolean expert, boolean forceWrite,
String shortDesc, String longDesc, LongCallback cb) {
+ super(conf, optionName, sortOrder, expert, forceWrite,
shortDesc, longDesc);
this.defaultValue = Fields.parseLong(defaultValueString);
this.cb = cb;
this.currentValue = defaultValue;
@@ -60,4 +60,8 @@
currentValue = x;
}
+ public boolean isDefault() {
+ return currentValue == defaultValue;
+ }
+
}
Modified: trunk/freenet/src/freenet/config/Option.java
===================================================================
--- trunk/freenet/src/freenet/config/Option.java 2006-09-01 14:47:33 UTC
(rev 10316)
+++ trunk/freenet/src/freenet/config/Option.java 2006-09-01 15:29:41 UTC
(rev 10317)
@@ -13,18 +13,21 @@
final int sortOrder;
/** Is this config variable expert-only? */
final boolean expert;
+ /** Is this config variable to be written out even if it uses the
default value? */
+ final boolean forceWrite;
/** Short description of value e.g. "FCP port" */
final String shortDesc;
/** Long description of value e.g. "The TCP port to listen for FCP
connections on" */
final String longDesc;
- Option(SubConfig config, String name, int sortOrder, boolean expert,
String shortDesc, String longDesc) {
+ Option(SubConfig config, String name, int sortOrder, boolean expert,
boolean forceWrite, String shortDesc, String longDesc) {
this.config = config;
this.name = name;
this.sortOrder = sortOrder;
this.expert = expert;
this.shortDesc = shortDesc;
this.longDesc = longDesc;
+ this.forceWrite = forceWrite;
}
/**
@@ -67,4 +70,9 @@
public boolean isExpert(){
return expert;
}
+
+ /**
+ * Is this option set to the default?
+ */
+ public abstract boolean isDefault();
}
Modified: trunk/freenet/src/freenet/config/ShortOption.java
===================================================================
--- trunk/freenet/src/freenet/config/ShortOption.java 2006-09-01 14:47:33 UTC
(rev 10316)
+++ trunk/freenet/src/freenet/config/ShortOption.java 2006-09-01 15:29:41 UTC
(rev 10317)
@@ -9,8 +9,8 @@
private short currentValue;
public ShortOption(SubConfig conf, String optionName, short
defaultValue, int sortOrder,
- boolean expert, String shortDesc, String longDesc,
ShortCallback cb) {
- super(conf, optionName, sortOrder, expert, shortDesc, longDesc);
+ boolean expert, boolean forceWrite, String shortDesc,
String longDesc, ShortCallback cb) {
+ super(conf, optionName, sortOrder, expert, forceWrite,
shortDesc, longDesc);
this.defaultValue = defaultValue;
this.cb = cb;
this.currentValue = defaultValue;
@@ -38,5 +38,9 @@
short x = Fields.parseShort(val);
currentValue = x;
}
+
+ public boolean isDefault() {
+ return currentValue == defaultValue;
+ }
}
Modified: trunk/freenet/src/freenet/config/StringArrOption.java
===================================================================
--- trunk/freenet/src/freenet/config/StringArrOption.java 2006-09-01
14:47:33 UTC (rev 10316)
+++ trunk/freenet/src/freenet/config/StringArrOption.java 2006-09-01
15:29:41 UTC (rev 10317)
@@ -13,16 +13,16 @@
public static final String delimiter = ";";
public StringArrOption(SubConfig conf, String optionName, String
defaultValue, int sortOrder,
- boolean expert, String shortDesc, String longDesc,
StringArrCallback cb) {
- super(conf, optionName, sortOrder, expert, shortDesc, longDesc);
+ boolean expert, boolean forceWrite, String shortDesc,
String longDesc, StringArrCallback cb) {
+ super(conf, optionName, sortOrder, expert, forceWrite,
shortDesc, longDesc);
this.defaultValue = (defaultValue==null)?"":defaultValue;
this.cb = cb;
this.currentValue = (defaultValue==null)?"":defaultValue;
}
public StringArrOption(SubConfig conf, String optionName, String
defaultValue[], int sortOrder,
- boolean expert, String shortDesc, String longDesc,
StringArrCallback cb) {
- this(conf, optionName, arrayToString(defaultValue), sortOrder,
expert, shortDesc, longDesc, cb);
+ boolean expert, boolean forceWrite, String shortDesc,
String longDesc, StringArrCallback cb) {
+ this(conf, optionName, arrayToString(defaultValue), sortOrder,
expert, forceWrite, shortDesc, longDesc, cb);
}
/** Get the current value. This is the value in use if we have finished
@@ -71,5 +71,9 @@
public String getDefaultValue() {
return defaultValue;
}
+
+ public boolean isDefault() {
+ return currentValue.equals(defaultValue);
+ }
}
Modified: trunk/freenet/src/freenet/config/StringOption.java
===================================================================
--- trunk/freenet/src/freenet/config/StringOption.java 2006-09-01 14:47:33 UTC
(rev 10316)
+++ trunk/freenet/src/freenet/config/StringOption.java 2006-09-01 15:29:41 UTC
(rev 10317)
@@ -7,8 +7,8 @@
private String currentValue;
public StringOption(SubConfig conf, String optionName, String
defaultValue, int sortOrder,
- boolean expert, String shortDesc, String longDesc,
StringCallback cb) {
- super(conf, optionName, sortOrder, expert, shortDesc, longDesc);
+ boolean expert, boolean forceWrite, String shortDesc,
String longDesc, StringCallback cb) {
+ super(conf, optionName, sortOrder, expert, forceWrite,
shortDesc, longDesc);
this.defaultValue = defaultValue;
this.cb = cb;
this.currentValue = defaultValue;
@@ -34,5 +34,9 @@
public void setInitialValue(String val) throws
InvalidConfigValueException {
this.currentValue = val;
}
+
+ public boolean isDefault() {
+ return currentValue.equals(defaultValue);
+ }
}
Modified: trunk/freenet/src/freenet/config/SubConfig.java
===================================================================
--- trunk/freenet/src/freenet/config/SubConfig.java 2006-09-01 14:47:33 UTC
(rev 10316)
+++ trunk/freenet/src/freenet/config/SubConfig.java 2006-09-01 15:29:41 UTC
(rev 10317)
@@ -50,43 +50,43 @@
}
public void register(String optionName, int defaultValue, int sortOrder,
- boolean expert, String shortDesc, String longDesc,
IntCallback cb) {
- register(new IntOption(this, optionName, defaultValue, null,
sortOrder, expert, shortDesc, longDesc, cb));
+ boolean expert, boolean forceWrite, String shortDesc,
String longDesc, IntCallback cb) {
+ register(new IntOption(this, optionName, defaultValue, null,
sortOrder, expert, forceWrite, shortDesc, longDesc, cb));
}
public void register(String optionName, long defaultValue, int
sortOrder,
- boolean expert, String shortDesc, String longDesc,
LongCallback cb) {
- register(new LongOption(this, optionName, defaultValue, null,
sortOrder, expert, shortDesc, longDesc, cb));
+ boolean expert, boolean forceWrite, String shortDesc,
String longDesc, LongCallback cb) {
+ register(new LongOption(this, optionName, defaultValue, null,
sortOrder, expert, forceWrite, shortDesc, longDesc, cb));
}
public void register(String optionName, String defaultValueString, int
sortOrder,
- boolean expert, String shortDesc, String longDesc,
IntCallback cb) {
- register(new IntOption(this, optionName, defaultValueString,
sortOrder, expert, shortDesc, longDesc, cb));
+ boolean expert, boolean forceWrite, String shortDesc,
String longDesc, IntCallback cb) {
+ register(new IntOption(this, optionName, defaultValueString,
sortOrder, expert, forceWrite, shortDesc, longDesc, cb));
}
public void register(String optionName, String defaultValueString, int
sortOrder,
- boolean expert, String shortDesc, String longDesc,
LongCallback cb) {
- register(new LongOption(this, optionName, defaultValueString,
sortOrder, expert, shortDesc, longDesc, cb));
+ boolean expert, boolean forceWrite, String shortDesc,
String longDesc, LongCallback cb) {
+ register(new LongOption(this, optionName, defaultValueString,
sortOrder, expert, forceWrite, shortDesc, longDesc, cb));
}
public void register(String optionName, boolean defaultValue, int
sortOrder,
- boolean expert, String shortDesc, String longDesc,
BooleanCallback cb) {
- register(new BooleanOption(this, optionName, defaultValue,
sortOrder, expert, shortDesc, longDesc, cb));
+ boolean expert, boolean forceWrite, String shortDesc,
String longDesc, BooleanCallback cb) {
+ register(new BooleanOption(this, optionName, defaultValue,
sortOrder, expert, forceWrite, shortDesc, longDesc, cb));
}
public void register(String optionName, String defaultValue, int
sortOrder,
- boolean expert, String shortDesc, String longDesc,
StringCallback cb) {
- register(new StringOption(this, optionName, defaultValue,
sortOrder, expert, shortDesc, longDesc, cb));
+ boolean expert, boolean forceWrite, String shortDesc,
String longDesc, StringCallback cb) {
+ register(new StringOption(this, optionName, defaultValue,
sortOrder, expert, forceWrite, shortDesc, longDesc, cb));
}
public void register(String optionName, short defaultValue, int
sortOrder,
- boolean expert, String shortDesc, String longDesc,
ShortCallback cb) {
- register(new ShortOption(this, optionName, defaultValue,
sortOrder, expert, shortDesc, longDesc, cb));
+ boolean expert, boolean forceWrite, String shortDesc,
String longDesc, ShortCallback cb) {
+ register(new ShortOption(this, optionName, defaultValue,
sortOrder, expert, forceWrite, shortDesc, longDesc, cb));
}
public void register(String optionName, String[] defaultValue, int
sortOrder,
- boolean expert, String shortDesc, String longDesc,
StringArrCallback cb) {
- register(new StringArrOption(this, optionName, defaultValue,
sortOrder, expert, shortDesc, longDesc, cb));
+ boolean expert, boolean forceWrite, String shortDesc,
String longDesc, StringArrCallback cb) {
+ register(new StringArrOption(this, optionName, defaultValue,
sortOrder, expert, forceWrite, shortDesc, longDesc, cb));
}
public int getInt(String optionName) {
@@ -185,6 +185,7 @@
Map.Entry entry = (Map.Entry) i.next();
String key = (String) entry.getKey();
Option o = (Option) entry.getValue();
+ if(o.isDefault() && !o.forceWrite) continue;
fs.put(key, o.getValueString());
}
return fs;
Modified: trunk/freenet/src/freenet/node/LoggingConfigHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/LoggingConfigHandler.java 2006-09-01
14:47:33 UTC (rev 10316)
+++ trunk/freenet/src/freenet/node/LoggingConfigHandler.java 2006-09-01
15:29:41 UTC (rev 10317)
@@ -31,7 +31,7 @@
public LoggingConfigHandler(SubConfig loggingConfig) throws
InvalidConfigValueException {
this.config = loggingConfig;
- loggingConfig.register("enabled", true, 1, true, "Enable logging?",
"Set to false to completely disable logging",
+ loggingConfig.register("enabled", true, 1, true, false, "Enable
logging?", "Set to false to completely disable logging",
new BooleanCallback() {
public boolean get() {
return fileLoggerHook != null;
@@ -47,7 +47,7 @@
boolean loggingEnabled = loggingConfig.getBoolean("enabled");
- loggingConfig.register("dirname", "logs", 2, true, "Logging directory",
"Directory into which to put log files",
+ loggingConfig.register("dirname", "logs", 2, true, false, "Logging
directory", "Directory into which to put log files",
new StringCallback() {
public String get() {
@@ -77,7 +77,7 @@
// max space used by zipped logs
- config.register("maxZippedLogsSize", "128M", 3, true, "Maximum disk
space used by old logs", "Maximum disk space used by old logs",
+ config.register("maxZippedLogsSize", "128M", 3, true, true, "Maximum
disk space used by old logs", "Maximum disk space used by old logs",
new LongCallback() {
public long get() {
return maxZippedLogsSize;
@@ -98,7 +98,7 @@
// priority
// Node must override this to minor on testnet.
- config.register("priority", "normal", 4, false, "Minimum priority to
log messages at", "Minimum priority at which messages are logged. options are
debug, minor, normal, error, in order of diminishing verbosity",
+ config.register("priority", "normal", 4, false, false, "Minimum
priority to log messages at", "Minimum priority at which messages are logged.
options are debug, minor, normal, error, in order of diminishing verbosity",
new StringCallback() {
public String get() {
LoggerHookChain chain =
Logger.getChain();
@@ -116,7 +116,7 @@
// detailed priority
- config.register("priorityDetail", "", 5, true, "Detailed priority
thresholds", "Detailed priority thresholds, example
freenet:normal,freenet.node:minor",
+ config.register("priorityDetail", "", 5, true, false, "Detailed
priority thresholds", "Detailed priority thresholds, example
freenet:normal,freenet.node:minor",
new StringCallback() {
public String get() {
@@ -138,7 +138,7 @@
// interval
- config.register("interval", "5MINUTE", 5, true, "Log rotation
interval", "Log rotation interval - period after which logs are rotated. We
keep the last two log files (current and prev), plus lots of compressed
logfiles up to maxZippedLogsSize",
+ config.register("interval", "5MINUTE", 5, true, false, "Log rotation
interval", "Log rotation interval - period after which logs are rotated. We
keep the last two log files (current and prev), plus lots of compressed
logfiles up to maxZippedLogsSize",
new StringCallback() {
public String get() {
return logRotateInterval;
@@ -160,7 +160,7 @@
logRotateInterval = config.getString("interval");
// max cached bytes in RAM
- config.register("maxCachedBytes", "10M", 6, true, "Max cached log bytes
in RAM", "Maximum number of bytes of logging cached in RAM",
+ config.register("maxCachedBytes", "10M", 6, true, false, "Max cached
log bytes in RAM", "Maximum number of bytes of logging cached in RAM",
new LongCallback() {
public long get() {
return maxCachedLogBytes;
@@ -177,7 +177,7 @@
maxCachedLogBytes = config.getLong("maxCachedBytes");
// max cached lines in RAM
- config.register("maxCachedLines", "100k", 7, true, "Max cached log
lines in RAM", "Maximum number of lines of logging cached in RAM",
+ config.register("maxCachedLines", "100k", 7, true, false, "Max cached
log lines in RAM", "Maximum number of lines of logging cached in RAM",
new IntCallback() {
public int get() {
return maxCachedLogLines;
Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java 2006-09-01 14:47:33 UTC (rev
10316)
+++ trunk/freenet/src/freenet/node/Node.java 2006-09-01 15:29:41 UTC (rev
10317)
@@ -729,7 +729,7 @@
SubConfig nodeConfig = new SubConfig("node", config);
- nodeConfig.register("aggressiveGC", aggressiveGCModificator,
sortOrder++, true, "AggressiveGC modificator", "Enables the user to tweak the
time in between GC and forced finalization. SHOULD NOT BE CHANGED unless you
know what you're doing! -1 means : disable forced call to System.gc() and
System.runFinalization()",
+ nodeConfig.register("aggressiveGC", aggressiveGCModificator,
sortOrder++, true, false, "AggressiveGC modificator", "Enables the user to
tweak the time in between GC and forced finalization. SHOULD NOT BE CHANGED
unless you know what you're doing! -1 means : disable forced call to
System.gc() and System.runFinalization()",
new IntCallback() {
public int get() {
return aggressiveGCModificator;
@@ -755,14 +755,14 @@
- nodeConfig.register("bindTo", "0.0.0.0", sortOrder++, true, "IP
address to bind to", "IP address to bind to",
+ nodeConfig.register("bindTo", "0.0.0.0", sortOrder++, true,
false, "IP address to bind to", "IP address to bind to",
new NodeBindtoCallback(this));
this.bindto = nodeConfig.getString("bindTo");
// Determine the port number
- nodeConfig.register("listenPort", -1 /* means random */,
sortOrder++, true, "FNP port number (UDP)", "UDP port for node-to-node
communications (Freenet Node Protocol)",
+ nodeConfig.register("listenPort", -1 /* means random */,
sortOrder++, true, true, "FNP port number (UDP)", "UDP port for node-to-node
communications (Freenet Node Protocol)",
new IntCallback() {
public int get() {
return portNumber;
@@ -831,7 +831,7 @@
// Bandwidth limit
- nodeConfig.register("outputBandwidthLimit", "15K", sortOrder++,
false,
+ nodeConfig.register("outputBandwidthLimit", "15K", sortOrder++,
false, true,
"Output bandwidth limit (bytes per second)",
"Hard output bandwidth limit (bytes/sec); the node should almost never exceed
this",
new IntCallback() {
public int get() {
@@ -856,7 +856,7 @@
requestOutputThrottle =
new TokenBucket(Math.max(obwLimit*60, 32768*20),
(1000L*1000L*1000L) / obwLimit, 0);
- nodeConfig.register("inputBandwidthLimit", "-1", sortOrder++,
false,
+ nodeConfig.register("inputBandwidthLimit", "-1", sortOrder++,
false, true,
"Input bandwidth limit (bytes per second)",
"Input bandwidth limit (bytes/sec); the node will try not to exceed this; -1 =
4x set outputBandwidthLimit",
new IntCallback() {
public int get() {
@@ -890,7 +890,7 @@
// SwapRequestInterval
- nodeConfig.register("swapRequestSendInterval", 2000,
sortOrder++, true,
+ nodeConfig.register("swapRequestSendInterval", 2000,
sortOrder++, true, false,
"Swap request send interval (ms)", "Interval
between swap attempting to send swap requests in milliseconds. Leave this
alone!",
new IntCallback() {
public int get() {
@@ -953,7 +953,7 @@
// Directory for node-related files other than store
- nodeConfig.register("nodeDir", ".", sortOrder++, true, "Node
directory", "Name of directory to put node-related files e.g. peers list in",
+ nodeConfig.register("nodeDir", ".", sortOrder++, true, false,
"Node directory", "Name of directory to put node-related files e.g. peers list
in",
new StringCallback() {
public String get() {
return nodeDir.getPath();
@@ -993,7 +993,7 @@
usm.setLowLevelFilter(packetMangler = new
FNPPacketMangler(this));
// Extra Peer Data Directory
- nodeConfig.register("extraPeerDataDir", new File(nodeDir,
"extra-peer-data-"+portNumber).toString(), sortOrder++, true, "Extra peer data
directory", "Name of directory to put extra peer data in",
+ nodeConfig.register("extraPeerDataDir", new File(nodeDir,
"extra-peer-data-"+portNumber).toString(), sortOrder++, true, false, "Extra
peer data directory", "Name of directory to put extra peer data in",
new StringCallback() {
public String get() {
return
extraPeerDataDir.getPath();
@@ -1011,13 +1011,13 @@
}
// Name
- nodeConfig.register("name", myName, sortOrder++, false, "Node name for
darknet", "Node name; you may want to set this to something descriptive if
running on darknet e.g. Fred Blogg's Node; it is visible to any connecting
node",
+ nodeConfig.register("name", myName, sortOrder++, false, true, "Node
name for darknet", "Node name; you may want to set this to something
descriptive if running on darknet e.g. Fred Blogg's Node; it is visible to any
connecting node",
new NodeNameCallback(this));
myName = nodeConfig.getString("name");
// Datastore
- nodeConfig.register("storeSize", "1G", sortOrder++, false,
"Store size in bytes", "Store size in bytes",
+ nodeConfig.register("storeSize", "1G", sortOrder++, false,
true, "Store size in bytes", "Store size in bytes",
new LongCallback() {
public long get() {
@@ -1067,7 +1067,7 @@
maxTotalKeys = storeSize / sizePerKey;
- nodeConfig.register("storeDir", ".", sortOrder++, true, "Store
directory", "Name of directory to put store files in",
+ nodeConfig.register("storeDir", ".", sortOrder++, true, false,
"Store directory", "Name of directory to put store files in",
new StringCallback() {
public String get() {
return storeDir.getPath();
@@ -1214,7 +1214,7 @@
throw new NodeInitException(EXIT_STORE_OTHER, msg);
}
- nodeConfig.register("throttleFile", "throttle.dat",
sortOrder++, true, "File to store the persistent throttle data to", "File to
store the persistent throttle data to", new StringCallback() {
+ nodeConfig.register("throttleFile", "throttle.dat",
sortOrder++, true, false, "File to store the persistent throttle data to",
"File to store the persistent throttle data to", new StringCallback() {
public String get() {
return persistTarget.toString();
Modified: trunk/freenet/src/freenet/node/NodeClientCore.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeClientCore.java 2006-09-01 14:47:33 UTC
(rev 10316)
+++ trunk/freenet/src/freenet/node/NodeClientCore.java 2006-09-01 15:29:41 UTC
(rev 10317)
@@ -100,7 +100,7 @@
// Temp files
- nodeConfig.register("tempDir", new File(nodeDir,
"temp-"+portNumber).toString(), sortOrder++, true, "Temp files directory",
"Name of directory to put temporary files in",
+ nodeConfig.register("tempDir", new File(nodeDir,
"temp-"+portNumber).toString(), sortOrder++, true, false, "Temp files
directory", "Name of directory to put temporary files in",
new StringCallback() {
public String get() {
return tempDir.getPath();
@@ -126,7 +126,7 @@
}
// Persistent temp files
- nodeConfig.register("persistentTempDir", new File(nodeDir,
"persistent-temp-"+portNumber).toString(), sortOrder++, true, "Persistent temp
files directory", "Name of directory to put persistent temp files in",
+ nodeConfig.register("persistentTempDir", new File(nodeDir,
"persistent-temp-"+portNumber).toString(), sortOrder++, true, false,
"Persistent temp files directory", "Name of directory to put persistent temp
files in",
new StringCallback() {
public String get() {
return
persistentTempBucketFactory.getDir().toString();
@@ -150,7 +150,7 @@
// Downloads directory
- nodeConfig.register("downloadsDir", "downloads", sortOrder++,
true, "Default download directory", "The directory to save downloaded files
into by default", new StringCallback() {
+ nodeConfig.register("downloadsDir", "downloads", sortOrder++,
true, true, "Default download directory", "The directory to save downloaded
files into by default", new StringCallback() {
public String get() {
return downloadDir.getPath();
Modified: trunk/freenet/src/freenet/node/NodeIPDetector.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeIPDetector.java 2006-09-01 14:47:33 UTC
(rev 10316)
+++ trunk/freenet/src/freenet/node/NodeIPDetector.java 2006-09-01 15:29:41 UTC
(rev 10317)
@@ -240,7 +240,7 @@
public int registerConfigs(SubConfig nodeConfig, int sortOrder) {
// IP address override
- nodeConfig.register("ipAddressOverride", "", sortOrder++, true,
"IP address override", "IP address override (not usually needed)", new
StringCallback() {
+ nodeConfig.register("ipAddressOverride", "", sortOrder++, true,
false, "IP address override", "IP address override (not usually needed)", new
StringCallback() {
public String get() {
if(overrideIPAddress == null) return "";
@@ -285,7 +285,7 @@
// Temporary IP address hint
- nodeConfig.register("tempIPAddressHint", "", sortOrder++,
false, "Temporary IP address hint", "Temporary hint to what our IP might be;
deleted after use", new StringCallback() {
+ nodeConfig.register("tempIPAddressHint", "", sortOrder++,
false, false, "Temporary IP address hint", "Temporary hint to what our IP might
be; deleted after use", new StringCallback() {
public String get() {
return "";
@@ -320,7 +320,7 @@
// Include local IPs in noderef file
- nodeConfig.register("includeLocalAddressesInNoderefs", false,
sortOrder++, true, "Include local addresses in noderef", "Whether to include
local addresses (LAN and localhost) in node references. This will not be useful
unless the other side sets metadata.allowLocalAddresses=true for this
reference.", new BooleanCallback() {
+ nodeConfig.register("includeLocalAddressesInNoderefs", false,
sortOrder++, true, false, "Include local addresses in noderef", "Whether to
include local addresses (LAN and localhost) in node references. This will not
be useful unless the other side sets metadata.allowLocalAddresses=true for this
reference.", new BooleanCallback() {
public boolean get() {
return includeLocalAddressesInNoderefs;
Modified: trunk/freenet/src/freenet/node/TestnetHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/TestnetHandler.java 2006-09-01 14:47:33 UTC
(rev 10316)
+++ trunk/freenet/src/freenet/node/TestnetHandler.java 2006-09-01 15:29:41 UTC
(rev 10317)
@@ -243,7 +243,7 @@
public static TestnetHandler maybeCreate(Node node, Config config)
throws NodeInitException {
SubConfig testnetConfig = new SubConfig("node.testnet", config);
- testnetConfig.register("enabled", false, 1, true /*Switch it to false
if we want large-scale testing */,
+ testnetConfig.register("enabled", false, 1, true /*Switch it to false
if we want large-scale testing */, true,
"Enable testnet mode? (DANGEROUS)",
"Whether to enable testnet mode (DANGEROUS!). Testnet
mode eliminates your anonymity in exchange for greatly assisting the developers
in debugging the node.",
new TestnetEnabledCallback(node));
@@ -253,7 +253,7 @@
if(enabled) {
// Get the testnet port
- testnetConfig.register("port", node.portNumber+1000, 2, true,
"Testnet port", "Testnet port number (-1 = listenPort+1000)",
+ testnetConfig.register("port", node.portNumber+1000, 2, true,
false, "Testnet port", "Testnet port number (-1 = listenPort+1000)",
new TestnetPortNumberCallback(node));
int port = testnetConfig.getInt("port");
Modified: trunk/freenet/src/freenet/node/TextModeClientInterfaceServer.java
===================================================================
--- trunk/freenet/src/freenet/node/TextModeClientInterfaceServer.java
2006-09-01 14:47:33 UTC (rev 10316)
+++ trunk/freenet/src/freenet/node/TextModeClientInterfaceServer.java
2006-09-01 15:29:41 UTC (rev 10317)
@@ -58,15 +58,15 @@
NodeClientCore core = node.clientCore;
- TMCIConfig.register("enabled", true, 1, true, "Enable TMCI",
"Whether to enable the TMCI",
+ TMCIConfig.register("enabled", true, 1, true, false, "Enable
TMCI", "Whether to enable the TMCI",
new TMCIEnabledCallback(core));
- TMCIConfig.register("bindTo", "127.0.0.1", 2, true, "IP address
to bind to", "IP address to bind to",
+ TMCIConfig.register("bindTo", "127.0.0.1", 2, true, false, "IP
address to bind to", "IP address to bind to",
new TMCIBindtoCallback(core));
- TMCIConfig.register("allowedHosts", "127.0.0.1", 2, true,
"Allowed hosts", "Hostnames or IP addresses that are allowed to connect to the
TMCI. May be a comma-separated list of hostnames, single IPs and even CIDR
masked IPs like 192.168.0.0/24",
+ TMCIConfig.register("allowedHosts", "127.0.0.1", 2, true,
false, "Allowed hosts", "Hostnames or IP addresses that are allowed to connect
to the TMCI. May be a comma-separated list of hostnames, single IPs and even
CIDR masked IPs like 192.168.0.0/24",
new TMCIAllowedHostsCallback(core));
- TMCIConfig.register("port", 2323, 1, true, "Telnet port",
"Telnet port number",
+ TMCIConfig.register("port", 2323, 1, true, false, "Telnet
port", "Telnet port number",
new TCMIPortNumberCallback(core));
- TMCIConfig.register("directEnabled", false, 1, true, "Enable on
stdout/stdin?", "Enable text mode client interface on standard input/output?
(.enabled refers to providing a telnet-style server, this runs it over a
socket)",
+ TMCIConfig.register("directEnabled", false, 1, true, false,
"Enable on stdout/stdin?", "Enable text mode client interface on standard
input/output? (.enabled refers to providing a telnet-style server, this runs it
over a socket)",
new TMCIDirectEnabledCallback(core));
boolean TMCIEnabled = TMCIConfig.getBoolean("enabled");
Modified: trunk/freenet/src/freenet/node/fcp/FCPServer.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPServer.java 2006-09-01 14:47:33 UTC
(rev 10316)
+++ trunk/freenet/src/freenet/node/fcp/FCPServer.java 2006-09-01 15:29:41 UTC
(rev 10317)
@@ -294,23 +294,23 @@
public static FCPServer maybeCreate(Node node, NodeClientCore core,
Config config) throws IOException, InvalidConfigValueException {
SubConfig fcpConfig = new SubConfig("fcp", config);
- fcpConfig.register("enabled", true, 2, true, "Is FCP server
enabled ?", "Is FCP server enabled ?", new FCPEnabledCallback(core));
+ fcpConfig.register("enabled", true, 2, true, false, "Is FCP
server enabled ?", "Is FCP server enabled ?", new FCPEnabledCallback(core));
fcpConfig.register("port", FCPServer.DEFAULT_FCP_PORT /*
anagram of 1984, and 1000 up from old number */,
- 2, true, "FCP port number", "FCP port number",
new FCPPortNumberCallback(core));
- fcpConfig.register("bindTo", "127.0.0.1", 2, true, "IP address
to bind to", "IP address to bind the FCP server to", new
FCPBindtoCallback(core));
- fcpConfig.register("allowedHosts", "127.0.0.1", 2, true,
"Allowed hosts", "Hostnames or IP addresses that are allowed to connect to the
FCP server. May be a comma-separated list of hostnames, single IPs and even
CIDR masked IPs like 192.168.0.0/24", new FCPAllowedHostsCallback(core));
+ 2, true, true, "FCP port number", "FCP port
number", new FCPPortNumberCallback(core));
+ fcpConfig.register("bindTo", "127.0.0.1", 2, true, false, "IP
address to bind to", "IP address to bind the FCP server to", new
FCPBindtoCallback(core));
+ fcpConfig.register("allowedHosts", "127.0.0.1", 2, true, false,
"Allowed hosts", "Hostnames or IP addresses that are allowed to connect to the
FCP server. May be a comma-separated list of hostnames, single IPs and even
CIDR masked IPs like 192.168.0.0/24", new FCPAllowedHostsCallback(core));
PersistentDownloadsEnabledCallback cb1;
PersistentDownloadsFileCallback cb2;
PersistentDownloadsIntervalCallback cb3;
- fcpConfig.register("persistentDownloadsEnabled", true, 3, true,
"Enable persistent downloads?", "Whether to enable Persistence=forever for FCP
requests. Meaning whether to support requests which persist over node restarts;
they must be written to disk and this may constitute a security risk for some
people.",
+ fcpConfig.register("persistentDownloadsEnabled", true, 3, true,
true, "Enable persistent downloads?", "Whether to enable Persistence=forever
for FCP requests. Meaning whether to support requests which persist over node
restarts; they must be written to disk and this may constitute a security risk
for some people.",
cb1 = new PersistentDownloadsEnabledCallback());
boolean persistentDownloadsEnabled =
fcpConfig.getBoolean("persistentDownloadsEnabled");
- fcpConfig.register("persistentDownloadsFile", "downloads.dat",
4, true, "Filename to store persistent downloads in", "Filename to store
details of persistent downloads to",
+ fcpConfig.register("persistentDownloadsFile", "downloads.dat",
4, true, false, "Filename to store persistent downloads in", "Filename to store
details of persistent downloads to",
cb2 = new PersistentDownloadsFileCallback());
String persistentDownloadsDir =
fcpConfig.getString("persistentDownloadsFile");
- fcpConfig.register("persistentDownloadsInterval", (5*60*1000),
5, true, "Interval between writing persistent downloads to disk", "Interval
between writing persistent downloads to disk",
+ fcpConfig.register("persistentDownloadsInterval", (5*60*1000),
5, true, false, "Interval between writing persistent downloads to disk",
"Interval between writing persistent downloads to disk",
cb3 = new
PersistentDownloadsIntervalCallback());
long persistentDownloadsInterval =
fcpConfig.getLong("persistentDownloadsInterval");
Modified: trunk/freenet/src/freenet/node/updater/NodeUpdater.java
===================================================================
--- trunk/freenet/src/freenet/node/updater/NodeUpdater.java 2006-09-01
14:47:33 UTC (rev 10316)
+++ trunk/freenet/src/freenet/node/updater/NodeUpdater.java 2006-09-01
15:29:41 UTC (rev 10317)
@@ -621,19 +621,19 @@
public static NodeUpdater maybeCreate(Node node, Config config) throws
Exception {
SubConfig updaterConfig = new SubConfig("node.updater", config);
- updaterConfig.register("enabled",
WrapperManager.isControlledByNativeWrapper(), 1, true, "Check for, and download
new versions",
+ updaterConfig.register("enabled",
WrapperManager.isControlledByNativeWrapper(), 1, true, false, "Check for, and
download new versions",
"Should your node automatically check for new versions
of Freenet. If yes, new versions will be automatically detected and downloaded,
but not necessarily installed. This setting resets itself always back to false
unless the node runs within the wrapper.",
new UpdaterEnabledCallback(node, config));
boolean enabled = updaterConfig.getBoolean("enabled");
// is the auto-update allowed ?
- updaterConfig.register("autoupdate", false, 2, false, "Automatically
install new versions", "Should your node automatically update to the newest
version of Freenet, without asking?",
+ updaterConfig.register("autoupdate", false, 2, false, true,
"Automatically install new versions", "Should your node automatically update to
the newest version of Freenet, without asking?",
new AutoUpdateAllowedCallback(node));
boolean autoUpdateAllowed = updaterConfig.getBoolean("autoupdate");
updaterConfig.register("URI", NodeUpdater.UPDATE_URI, 3,
- true, "Where should the node look for updates?",
+ true, false, "Where should the node look for updates?",
"Where should the node look for updates?",
new UpdateURICallback(node));
@@ -641,7 +641,7 @@
updaterConfig.register("revocationURI",
NodeUpdater.REVOCATION_URI,4,
- true, "Where should the node look for revocation ?",
+ true, false, "Where should the node look for revocation
?",
"Where should the node look for revocation ?",
new UpdateRevocationURICallback(node));
Modified: trunk/freenet/src/freenet/plugin/PluginManager.java
===================================================================
--- trunk/freenet/src/freenet/plugin/PluginManager.java 2006-09-01 14:47:33 UTC
(rev 10316)
+++ trunk/freenet/src/freenet/plugin/PluginManager.java 2006-09-01 15:29:41 UTC
(rev 10317)
@@ -45,7 +45,7 @@
this.node = node;
config = new SubConfig("pluginmanager2", node.config);
- config.register("loadedPlugins", null, 9, true, "Plugins to
load on start up", "A list of plugins that are started when the node starts",
new StringArrCallback() {
+ config.register("loadedPlugins", null, 9, true, false, "Plugins
to load on start up", "A list of plugins that are started when the node
starts", new StringArrCallback() {
/**
* Returns the current value of this option.
Modified: trunk/freenet/src/freenet/pluginmanager/PluginManager.java
===================================================================
--- trunk/freenet/src/freenet/pluginmanager/PluginManager.java 2006-09-01
14:47:33 UTC (rev 10316)
+++ trunk/freenet/src/freenet/pluginmanager/PluginManager.java 2006-09-01
15:29:41 UTC (rev 10317)
@@ -55,7 +55,7 @@
pmconfig = new SubConfig("pluginmanager", node.config);
// Start plugins in the config
- pmconfig.register("loadplugin", null, 9, true, "Plugins to load
on startup ", "Classpath, name and location for plugins to load when node
starts up",
+ pmconfig.register("loadplugin", null, 9, true, false, "Plugins
to load on startup ", "Classpath, name and location for plugins to load when
node starts up",
new StringArrCallback() {
public String get() {
return getConfigLoadString();
Modified: trunk/freenet/src/freenet/support/SimpleFieldSet.java
===================================================================
--- trunk/freenet/src/freenet/support/SimpleFieldSet.java 2006-09-01
14:47:33 UTC (rev 10316)
+++ trunk/freenet/src/freenet/support/SimpleFieldSet.java 2006-09-01
15:29:41 UTC (rev 10317)
@@ -351,9 +351,15 @@
}
}
+ /** Tolerant put(); does nothing if fs is empty */
+ public void tput(String key, SimpleFieldSet fs) {
+ if(fs == null || fs.isEmpty()) return;
+ put(key, fs);
+ }
+
public void put(String key, SimpleFieldSet fs) {
if(fs == null) return; // legal no-op, because used everywhere
- if(fs.isEmpty())
+ if(fs.isEmpty()) // can't just no-op, because caller might add
the FS then populate it...
throw new IllegalArgumentException("Empty");
if(subsets == null)
subsets = new HashMap();