*) Bugfix for NullpointerException in serverAbstractSwitch.setConfig

See: http://www.yacy-forum.de/viewtopic.php?t=692#5575

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@636 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 19 years ago
parent 7626823519
commit f9eb550fbc

@ -151,7 +151,7 @@ public abstract class serverAbstractSwitch implements serverSwitch {
}
// set the value
String oldValue = (String) configProps.put(key, value);
Object oldValue = configProps.put(key, value);
saveConfig();
// perform actions afterwards
@ -160,7 +160,7 @@ public abstract class serverAbstractSwitch implements serverSwitch {
entry = (Map.Entry) i.next();
action = (serverSwitchAction) entry.getValue();
try {
action.doAfterSetConfig(key, value, oldValue);
action.doAfterSetConfig(key, value, (oldValue==null)?null:(String)oldValue);
} catch (Exception e) {
log.logSevere("serverAction afterSetConfig '" + action.getShortDescription() + "' failed with exception: " + e.getMessage());
}
@ -169,7 +169,7 @@ public abstract class serverAbstractSwitch implements serverSwitch {
public String getConfig(String key, String dflt) {
// get the value
String s = (String) configProps.get(key);
Object s = configProps.get(key);
// do action
Map.Entry entry;
@ -179,14 +179,14 @@ public abstract class serverAbstractSwitch implements serverSwitch {
entry = (Map.Entry) i.next();
action = (serverSwitchAction) entry.getValue();
try {
action.doWhenGetConfig(key, s, dflt);
action.doWhenGetConfig(key, (s==null)?null:(String)s, dflt);
} catch (Exception e) {
log.logSevere("serverAction whenGetConfig '" + action.getShortDescription() + "' failed with exception: " + e.getMessage());
}
}
// return value
if (s == null) return dflt; else return s;
if (s == null) return dflt; else return (String)s;
}
public Iterator configKeys() {

Loading…
Cancel
Save