Trim whitespaces before and after .cfg file arguments.
Change-Id: Iaf165b4e289075376deab806d3c7c15169e3dca7
diff --git a/apps/fwd/src/main/java/org/onosproject/fwd/ReactiveForwarding.java b/apps/fwd/src/main/java/org/onosproject/fwd/ReactiveForwarding.java
index dc925e6..a10bfef 100644
--- a/apps/fwd/src/main/java/org/onosproject/fwd/ReactiveForwarding.java
+++ b/apps/fwd/src/main/java/org/onosproject/fwd/ReactiveForwarding.java
@@ -149,7 +149,7 @@
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.
diff --git a/core/net/src/main/java/org/onosproject/net/topology/impl/DefaultTopologyProvider.java b/core/net/src/main/java/org/onosproject/net/topology/impl/DefaultTopologyProvider.java
index cb24851..b74f8b1 100644
--- a/core/net/src/main/java/org/onosproject/net/topology/impl/DefaultTopologyProvider.java
+++ b/core/net/src/main/java/org/onosproject/net/topology/impl/DefaultTopologyProvider.java
@@ -158,13 +158,13 @@
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;
diff --git a/providers/null/link/src/main/java/org/onosproject/provider/nil/link/impl/NullLinkProvider.java b/providers/null/link/src/main/java/org/onosproject/provider/nil/link/impl/NullLinkProvider.java
index 6656a8f..c12991a 100644
--- a/providers/null/link/src/main/java/org/onosproject/provider/nil/link/impl/NullLinkProvider.java
+++ b/providers/null/link/src/main/java/org/onosproject/provider/nil/link/impl/NullLinkProvider.java
@@ -147,9 +147,9 @@
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;
diff --git a/providers/null/packet/src/main/java/org/onosproject/provider/nil/packet/impl/NullPacketProvider.java b/providers/null/packet/src/main/java/org/onosproject/provider/nil/packet/impl/NullPacketProvider.java
index e70076f..2f63952 100644
--- a/providers/null/packet/src/main/java/org/onosproject/provider/nil/packet/impl/NullPacketProvider.java
+++ b/providers/null/packet/src/main/java/org/onosproject/provider/nil/packet/impl/NullPacketProvider.java
@@ -122,7 +122,7 @@
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;