Changeset ca57b712


Ignore:
Timestamp:
Mar 22, 2012 7:40:17 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
adcd1e8
Parents:
e3da181c
Message:
  • Router: When removing a config setting, remove from context also
Location:
router/java/src/net/i2p/router
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/Router.java

    re3da181c rca57b712  
    346346    public void removeConfigSetting(String name) {
    347347            _config.remove(name);
     348            // remove the backing default also
     349            _context.removeProperty(name);
    348350    }
    349351
     
    12801282            _config.put(name, value);
    12811283        else
    1282             _config.remove(name);
     1284            removeConfigSetting(name);
    12831285        return saveConfig();
    12841286    }
     
    12991301        if (toRemove != null) {
    13001302            for (String s : toRemove) {
    1301                 _config.remove(s);
     1303                removeConfigSetting(s);
    13021304            }
    13031305        }
  • router/java/src/net/i2p/router/RouterContext.java

    re3da181c rca57b712  
    114114     * Modify the configuration attributes of this context, changing
    115115     * one of the properties provided during the context construction.
     116     *
    116117     * @param propName The name of the property.
    117118     * @param value The new value for the property.
     119     * @since 0.8.4
     120     * @deprecated Use Router.saveConfig()
    118121     */
    119122    public void setProperty(String propName, String value) {
    120123                _overrideProps.setProperty(propName, value);
     124    }
     125   
     126    /**
     127     * Remove a property provided during the context construction.
     128     * Only for use by the router. Others use Router.saveConfig()
     129     *
     130     * @param propName The name of the property.
     131     * @since 0.9
     132     */
     133    void removeProperty(String propName) {
     134        _overrideProps.remove(propName);
    121135    }
    122136
Note: See TracChangeset for help on using the changeset viewer.