Ayaka Koshibe
Committed by Gerrit Code Review

Trim whitespaces before and after .cfg file arguments.

Change-Id: Iaf165b4e289075376deab806d3c7c15169e3dca7
......@@ -149,7 +149,7 @@ public class ReactiveForwarding {
try {
String flag = (String) properties.get(propertyName);
if (flag != null) {
enabled = flag.equals("true");
enabled = flag.trim().equals("true");
}
} catch (ClassCastException e) {
// No propertyName defined.
......
......@@ -158,13 +158,13 @@ public class DefaultTopologyProvider extends AbstractProvider
int newMaxEvents, newMaxBatchMs, newMaxIdleMs;
try {
String s = (String) properties.get("maxEvents");
newMaxEvents = isNullOrEmpty(s) ? maxEvents : Integer.parseInt(s);
newMaxEvents = isNullOrEmpty(s) ? maxEvents : Integer.parseInt(s.trim());
s = (String) properties.get("maxBatchMs");
newMaxBatchMs = isNullOrEmpty(s) ? maxBatchMs : Integer.parseInt(s);
newMaxBatchMs = isNullOrEmpty(s) ? maxBatchMs : Integer.parseInt(s.trim());
s = (String) properties.get("maxIdleMs");
newMaxIdleMs = isNullOrEmpty(s) ? maxIdleMs : Integer.parseInt(s);
newMaxIdleMs = isNullOrEmpty(s) ? maxIdleMs : Integer.parseInt(s.trim());
} catch (Exception e) {
newMaxEvents = DEFAULT_MAX_EVENTS;
......
......@@ -147,9 +147,9 @@ public class NullLinkProvider extends AbstractProvider implements LinkProvider {
int newRate;
try {
String s = (String) properties.get("flicker");
flickSetting = isNullOrEmpty(s) ? flicker : Boolean.valueOf(s);
flickSetting = isNullOrEmpty(s) ? flicker : Boolean.valueOf(s.trim());
s = (String) properties.get("eventRate");
newRate = isNullOrEmpty(s) ? eventRate : Integer.valueOf(s);
newRate = isNullOrEmpty(s) ? eventRate : Integer.valueOf(s.trim());
} catch (Exception e) {
log.warn(e.getMessage());
flickSetting = flicker;
......
......@@ -122,7 +122,7 @@ public class NullPacketProvider extends AbstractProvider implements
int newRate;
try {
String s = String.valueOf(properties.get("pktRate"));
newRate = isNullOrEmpty(s) ? pktRate : Integer.valueOf(s);
newRate = isNullOrEmpty(s) ? pktRate : Integer.valueOf(s.trim());
} catch (Exception e) {
log.warn(e.getMessage());
newRate = pktRate;
......