fixed some foolishness w/ booleans (thanks oOo!)

This commit is contained in:
jrandom
2004-08-27 02:04:49 +00:00
committed by zzz
parent bfe11110aa
commit a5ed02eb1c

View File

@ -297,22 +297,12 @@ public class SpeedCalculator extends Calculator {
if (_context.router() != null) { if (_context.router() != null) {
String val = _context.router().getConfigSetting(PROP_USE_INSTANTANEOUS_RATES); String val = _context.router().getConfigSetting(PROP_USE_INSTANTANEOUS_RATES);
if (val != null) { if (val != null) {
try { return Boolean.valueOf(val).booleanValue();
return Boolean.getBoolean(val);
} catch (NumberFormatException nfe) {
if (_log.shouldLog(Log.WARN))
_log.warn("Instantaneous rate for speed improperly set in the router config [" + val + "]", nfe);
}
} }
} }
String val = _context.getProperty(PROP_USE_INSTANTANEOUS_RATES, ""+DEFAULT_USE_INSTANTANEOUS_RATES); String val = _context.getProperty(PROP_USE_INSTANTANEOUS_RATES, ""+DEFAULT_USE_INSTANTANEOUS_RATES);
if (val != null) { if (val != null) {
try { return Boolean.valueOf(val).booleanValue();
return Boolean.getBoolean(val);
} catch (NumberFormatException nfe) {
if (_log.shouldLog(Log.WARN))
_log.warn("Instantaneous rate for speed improperly set in the router environment [" + val + "]", nfe);
}
} }
return DEFAULT_USE_INSTANTANEOUS_RATES; return DEFAULT_USE_INSTANTANEOUS_RATES;
} }